summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mauderer <Christian.Mauderer@embedded-brains.de>2014-05-09 14:25:40 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-05-12 08:37:00 +0200
commit3a3869c449330b5a3fd99ed4c81ccbb9fd94381e (patch)
tree7c771f47df709b7bddf9ee90a301b4bbd030c934
parent89f079469c4d1cc88ae8745cba3d41acdfad2f7d (diff)
downloadrtems-3a3869c449330b5a3fd99ed4c81ccbb9fd94381e.tar.bz2
bsps/sparc: Move flags to grlib header
This enables re-use for other BSPs
-rw-r--r--c/src/lib/libbsp/sparc/leon3/clock/ckinit.c4
-rw-r--r--c/src/lib/libbsp/sparc/leon3/include/leon.h5
-rw-r--r--c/src/lib/libbsp/sparc/leon3/startup/cpucounter.c4
-rw-r--r--c/src/lib/libbsp/sparc/leon3/timer/timer.c3
-rw-r--r--c/src/lib/libbsp/sparc/shared/include/grlib.h8
5 files changed, 14 insertions, 10 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
index a799908f63..5faf72d77d 100644
--- a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
+++ b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
@@ -113,8 +113,8 @@ static void leon3_clock_profiling_interrupt_delay(void)
rtems_configuration_get_microseconds_per_tick() - 1; \
\
LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].ctrl = \
- LEON3_GPTIMER_EN | LEON3_GPTIMER_RL | \
- LEON3_GPTIMER_LD | LEON3_GPTIMER_IRQEN; \
+ GPTIMER_TIMER_CTRL_EN | GPTIMER_TIMER_CTRL_RS | \
+ GPTIMER_TIMER_CTRL_LD | GPTIMER_TIMER_CTRL_IE; \
} while (0)
#define Clock_driver_support_shutdown_hardware() \
diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h
index 6d2434d36c..3ca33a3f3a 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/leon.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h
@@ -144,11 +144,6 @@ static __inline__ int bsp_irq_fixup(int irq)
/* Macros used for manipulating bits in LEON3 GP Timer Control Register */
-#define LEON3_GPTIMER_EN 1
-#define LEON3_GPTIMER_RL 2
-#define LEON3_GPTIMER_LD 4
-#define LEON3_GPTIMER_IRQEN 8
-
#define LEON3_MP_IRQ 14 /* Irq used by shared memory driver */
#define LEON3_IRQMPSTATUS_CPUNR 28
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/cpucounter.c b/c/src/lib/libbsp/sparc/leon3/startup/cpucounter.c
index a0cfbd8908..b76d404ac3 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/cpucounter.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/cpucounter.c
@@ -113,8 +113,8 @@ void leon3_cpu_counter_initialize(void)
gpt->scaler_reload = min_prescaler - 1;
gpt->timer[0].reload = 0xffffffff;
- gpt->timer[0].ctrl = LEON3_GPTIMER_EN | LEON3_GPTIMER_RL
- | LEON3_GPTIMER_LD;
+ gpt->timer[0].ctrl = GPTIMER_TIMER_CTRL_EN | GPTIMER_TIMER_CTRL_RS
+ | GPTIMER_TIMER_CTRL_LD;
gpt_counter_initialize(gpt, 0, frequency, free_counter_difference);
} else if (LEON3_Timer_Regs != NULL) {
diff --git a/c/src/lib/libbsp/sparc/leon3/timer/timer.c b/c/src/lib/libbsp/sparc/leon3/timer/timer.c
index a9263ff5ac..e7aa7f36ae 100644
--- a/c/src/lib/libbsp/sparc/leon3/timer/timer.c
+++ b/c/src/lib/libbsp/sparc/leon3/timer/timer.c
@@ -48,7 +48,8 @@ void benchmark_timer_initialize(void)
} else {
benchmark_timer_is_initialized = true;
}
- LEON3_Timer_Regs->timer[LEON3_TIMER_INDEX].ctrl = LEON3_GPTIMER_EN | LEON3_GPTIMER_LD;
+ LEON3_Timer_Regs->timer[LEON3_TIMER_INDEX].ctrl =
+ GPTIMER_TIMER_CTRL_EN | GPTIMER_TIMER_CTRL_LD;
}
}
diff --git a/c/src/lib/libbsp/sparc/shared/include/grlib.h b/c/src/lib/libbsp/sparc/shared/include/grlib.h
index cfbced350a..3c207933a9 100644
--- a/c/src/lib/libbsp/sparc/shared/include/grlib.h
+++ b/c/src/lib/libbsp/sparc/shared/include/grlib.h
@@ -78,6 +78,14 @@ struct gptimer_timer_regs {
volatile unsigned int notused;
};
+#define GPTIMER_TIMER_CTRL_EN 0x00000001U
+#define GPTIMER_TIMER_CTRL_RS 0x00000002U
+#define GPTIMER_TIMER_CTRL_LD 0x00000004U
+#define GPTIMER_TIMER_CTRL_IE 0x00000008U
+#define GPTIMER_TIMER_CTRL_IP 0x00000010U
+#define GPTIMER_TIMER_CTRL_CH 0x00000020U
+#define GPTIMER_TIMER_CTRL_DH 0x00000040U
+
/* GPTIMER common registers */
struct gptimer_regs {
volatile unsigned int scaler_value; /* common timer registers */