forked from Imagelibrary/rtems
LEON2: clock driver use new AMBAPP layer
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
This commit is contained in:
committed by
Gedare Bloom
parent
9ea65119f4
commit
1f7cfbe351
@@ -16,12 +16,11 @@
|
|||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
||||||
* http://www.rtems.com/license/LICENSE.
|
* http://www.rtems.com/license/LICENSE.
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
#include <bspopts.h>
|
#include <bspopts.h>
|
||||||
|
#include <ambapp.h>
|
||||||
|
|
||||||
#if SIMSPARC_FAST_IDLE==1
|
#if SIMSPARC_FAST_IDLE==1
|
||||||
#define CLOCK_DRIVER_USE_FAST_IDLE
|
#define CLOCK_DRIVER_USE_FAST_IDLE
|
||||||
@@ -59,14 +58,15 @@ static int clkirq;
|
|||||||
|
|
||||||
#define Clock_driver_support_find_timer() \
|
#define Clock_driver_support_find_timer() \
|
||||||
do { \
|
do { \
|
||||||
int cnt; \
|
struct ambapp_dev *adev; \
|
||||||
amba_apb_device dev; \
|
|
||||||
\
|
\
|
||||||
/* Find LEON3 GP Timer */ \
|
/* Find first LEON3 GP Timer */ \
|
||||||
cnt = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_GPTIMER,&dev); \
|
adev = (void *)ambapp_for_each(&ambapp_plb, (OPTIONS_ALL|OPTIONS_APB_SLVS),\
|
||||||
if ( cnt > 0 ) { \
|
VENDOR_GAISLER, GAISLER_GPTIMER, ambapp_find_by_idx, NULL); \
|
||||||
|
if (adev) { \
|
||||||
/* Found APB GPTIMER Timer */ \
|
/* 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; \
|
clkirq = (LEON3_Timer_Regs->status & 0xf8) >> 3; \
|
||||||
\
|
\
|
||||||
Adjust_clkirq_for_node(); \
|
Adjust_clkirq_for_node(); \
|
||||||
|
|||||||
Reference in New Issue
Block a user