forked from Imagelibrary/rtems
2007-09-06 Daniel Hellstrom <daniel@gaisler.com>
* amba/amba.c: Add missing part of previous patch. * clock/ckinit.c: Update previous patch.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2007-09-06 Daniel Hellstrom <daniel@gaisler.com>
|
||||||
|
|
||||||
|
* amba/amba.c: Add missing part of previous patch.
|
||||||
|
* clock/ckinit.c: Update previous patch.
|
||||||
|
|
||||||
2007-09-06 Daniel Hellstrom <daniel@gaisler.com>
|
2007-09-06 Daniel Hellstrom <daniel@gaisler.com>
|
||||||
|
|
||||||
* pci/pci.c: New file missed on previous commit.
|
* pci/pci.c: New file missed on previous commit.
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ amba_confarea_type amba_conf;
|
|||||||
volatile LEON3_IrqCtrl_Regs_Map *LEON3_IrqCtrl_Regs;
|
volatile LEON3_IrqCtrl_Regs_Map *LEON3_IrqCtrl_Regs;
|
||||||
|
|
||||||
int LEON3_Cpu_Index = 0;
|
int LEON3_Cpu_Index = 0;
|
||||||
static int apb_init = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bsp_leon3_predriver_hook
|
* bsp_leon3_predriver_hook
|
||||||
@@ -47,45 +46,28 @@ extern rtems_configuration_table Configuration;
|
|||||||
|
|
||||||
void bsp_leon3_predriver_hook(void)
|
void bsp_leon3_predriver_hook(void)
|
||||||
{
|
{
|
||||||
unsigned int iobar, conf;
|
|
||||||
int i;
|
int i;
|
||||||
unsigned int tmp;
|
unsigned int tmp;
|
||||||
|
amba_apb_device dev;
|
||||||
|
|
||||||
/* Scan the AMBA Plug&Play info at the default LEON3 area */
|
/* Scan the AMBA Plug&Play info at the default LEON3 area */
|
||||||
amba_scan(&amba_conf,LEON3_IO_AREA,NULL);
|
amba_scan(&amba_conf,LEON3_IO_AREA,NULL);
|
||||||
|
|
||||||
/* Find LEON3 Interrupt controler */
|
/* Find LEON3 Interrupt controler */
|
||||||
i = 0;
|
i = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_IRQMP,&dev);
|
||||||
while (i < amba_conf.apbslv.devnr)
|
if ( i > 0 ){
|
||||||
{
|
/* Found APB IRQ_MP Interrupt Controller */
|
||||||
conf = amba_get_confword(amba_conf.apbslv, i, 0);
|
LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start;
|
||||||
if ((amba_vendor(conf) == VENDOR_GAISLER) && (amba_device(conf) == GAISLER_IRQMP))
|
if (Configuration.User_multiprocessing_table != NULL) {
|
||||||
{
|
tmp = getasr17();
|
||||||
iobar = amba_apb_get_membar(amba_conf.apbslv, i);
|
LEON3_Cpu_Index = (tmp >> 28) & 3;
|
||||||
LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) amba_iobar_start(amba_conf.apbslv.apbmst[i], iobar);
|
|
||||||
/* asm("mov %%asr17, %0": : "r" (tmp)); */
|
|
||||||
if (Configuration.User_multiprocessing_table != NULL)
|
|
||||||
{
|
|
||||||
tmp = getasr17();
|
|
||||||
LEON3_Cpu_Index = (tmp >> 28) & 3;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find GP Timer */
|
/* find GP Timer */
|
||||||
i = 0;
|
i = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_GPTIMER,&dev);
|
||||||
while (i < amba_conf.apbslv.devnr)
|
if ( i > 0 ){
|
||||||
{
|
LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start;
|
||||||
conf = amba_get_confword(amba_conf.apbslv, i, 0);
|
|
||||||
if ((amba_vendor(conf) == VENDOR_GAISLER) &&
|
|
||||||
(amba_device(conf) == GAISLER_GPTIMER)) {
|
|
||||||
iobar = amba_apb_get_membar(amba_conf.apbslv, i);
|
|
||||||
LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *)
|
|
||||||
amba_iobar_start(amba_conf.apbslv.apbmst[i], iobar);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,11 +48,11 @@ static int clkirq;
|
|||||||
int cnt; \
|
int cnt; \
|
||||||
amba_apb_device dev; \
|
amba_apb_device dev; \
|
||||||
\
|
\
|
||||||
/* Find LEON3 Interrupt controler */ \
|
/* Find LEON3 GP Timer */ \
|
||||||
cnt = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_IRQMP,&dev); \
|
cnt = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_GPTIMER,&dev); \
|
||||||
if ( cnt > 0 ){ \
|
if ( cnt > 0 ){ \
|
||||||
/* Found APB IRQ_MP Interrupt Controller */ \
|
/* Found APB GPTIMER Timer */ \
|
||||||
LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start; \
|
LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start; \
|
||||||
clkirq = (LEON3_Timer_Regs->status & 0xfc) >> 3; \
|
clkirq = (LEON3_Timer_Regs->status & 0xfc) >> 3; \
|
||||||
\
|
\
|
||||||
if (Configuration.User_multiprocessing_table != NULL) { \
|
if (Configuration.User_multiprocessing_table != NULL) { \
|
||||||
|
|||||||
Reference in New Issue
Block a user