[PATCH 003/111] leon3: clock driver rely on previous found timer

Daniel Hellstrom daniel at gaisler.com
Thu Feb 26 16:38:05 UTC 2015


No point in scanning for the same GPTIMER twice. Rely on
amba.c AMBA PnP scanning.
---
 c/src/lib/libbsp/sparc/leon3/clock/ckinit.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
index f382f1a..15050eb 100644
--- a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
+++ b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
@@ -87,15 +87,8 @@ static void leon3_clock_profiling_interrupt_delay(void)
 
 #define Clock_driver_support_find_timer() \
   do { \
-    struct ambapp_dev *adev; \
-    \
-    /* Find first LEON3 GP Timer */ \
-    adev = (void *)ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_APB_SLVS),\
-              VENDOR_GAISLER, GAISLER_GPTIMER, ambapp_find_by_idx, NULL); \
-    if (adev) { \
-      /* Found APB GPTIMER Timer */ \
-      LEON3_Timer_Regs = (volatile struct gptimer_regs *) \
-                         DEV_TO_APB(adev)->start; \
+    /* Assume timer found during BSP initialization */ \
+    if (LEON3_Timer_Regs) { \
       clkirq = (LEON3_Timer_Regs->cfg & 0xf8) >> 3; \
       \
       Adjust_clkirq_for_node(); \
-- 
1.7.0.4




More information about the devel mailing list