[PATCH] bsps/sparc: Move flags to grlib header

Sebastian Huber sebastian.huber at embedded-brains.de
Fri May 9 12:29:18 UTC 2014


From: Christian Mauderer <Christian.Mauderer at embedded-brains.de>

This enables re-use for other BSPs
---
 c/src/lib/libbsp/sparc/leon3/clock/ckinit.c   |    4 ++--
 c/src/lib/libbsp/sparc/leon3/include/leon.h   |    5 -----
 c/src/lib/libbsp/sparc/shared/include/grlib.h |    8 ++++++++
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
index a799908..5faf72d 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 6d2434d..3ca33a3 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/shared/include/grlib.h b/c/src/lib/libbsp/sparc/shared/include/grlib.h
index cfbced3..3c20793 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 */
-- 
1.7.7




More information about the devel mailing list