summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2012-04-17 16:25:39 +0200
committerGedare Bloom <gedare@rtems.org>2012-04-17 22:01:46 -0400
commit1f7cfbe351d7f61960a836a45c116daa96fea866 (patch)
tree88fa7068d7e7b8cd6c607c7e7131732013b5ca61 /c/src/lib/libbsp
parentLEON: updated AMBA PnP API (diff)
downloadrtems-1f7cfbe351d7f61960a836a45c116daa96fea866.tar.bz2
LEON2: clock driver use new AMBAPP layer
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Diffstat (limited to 'c/src/lib/libbsp')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/clock/ckinit.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
index 3cdbb20a66..2a75a35a62 100644
--- a/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
+++ b/c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
@@ -16,12 +16,11 @@
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
- *
- * $Id$
*/
#include <bsp.h>
#include <bspopts.h>
+#include <ambapp.h>
#if SIMSPARC_FAST_IDLE==1
#define CLOCK_DRIVER_USE_FAST_IDLE
@@ -59,14 +58,15 @@ static int clkirq;
#define Clock_driver_support_find_timer() \
do { \
- int cnt; \
- amba_apb_device dev; \
+ struct ambapp_dev *adev; \
\
- /* Find LEON3 GP Timer */ \
- cnt = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_GPTIMER,&dev); \
- if ( cnt > 0 ) { \
+ /* 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 LEON3_Timer_Regs_Map *) dev.start; \
+ LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) \
+ DEV_TO_APB(adev)->start; \
clkirq = (LEON3_Timer_Regs->status & 0xf8) >> 3; \
\
Adjust_clkirq_for_node(); \