summaryrefslogtreecommitdiff
path: root/bsps
diff options
context:
space:
mode:
Diffstat (limited to 'bsps')
-rw-r--r--bsps/sparc/leon3/include/bsp/leon3.h4
-rw-r--r--bsps/sparc/leon3/start/amba.c9
2 files changed, 12 insertions, 1 deletions
diff --git a/bsps/sparc/leon3/include/bsp/leon3.h b/bsps/sparc/leon3/include/bsp/leon3.h
index 6c139bdaed..f3a9def60b 100644
--- a/bsps/sparc/leon3/include/bsp/leon3.h
+++ b/bsps/sparc/leon3/include/bsp/leon3.h
@@ -187,7 +187,11 @@ extern rtems_interrupt_lock LEON3_IrqCtrl_Lock;
/**
* @brief This pointer provides the IRQ(A)MP register block address.
*/
+#if defined(LEON3_IRQAMP_BASE)
+#define LEON3_IrqCtrl_Regs ((irqamp *) LEON3_IRQAMP_BASE)
+#else
extern irqamp *LEON3_IrqCtrl_Regs;
+#endif
/**
* @brief This pointer provides the IRQ(A)MP device information block.
diff --git a/bsps/sparc/leon3/start/amba.c b/bsps/sparc/leon3/start/amba.c
index d3254e3f0a..efce4110c9 100644
--- a/bsps/sparc/leon3/start/amba.c
+++ b/bsps/sparc/leon3/start/amba.c
@@ -96,9 +96,10 @@ RTEMS_SYSINIT_ITEM(
);
#endif
-/* Pointers to Interrupt Controller configuration registers */
+#if !defined(LEON3_IRQAMP_BASE)
irqamp *LEON3_IrqCtrl_Regs;
struct ambapp_dev *LEON3_IrqCtrl_Adev;
+#endif
#if !defined(LEON3_GPTIMER_BASE)
gptimer *LEON3_Timer_Regs;
@@ -121,7 +122,12 @@ static void amba_initialize(void)
struct ambapp_bus *plb;
plb = ambapp_plb();
+#if defined(LEON3_IRQAMP_BASE) && defined(LEON3_GPTIMER_BASE)
+ (void) plb;
+ (void) adev;
+#endif
+#if !defined(LEON3_IRQAMP_BASE)
/* Find LEON3 Interrupt controller */
adev = (void *)ambapp_for_each(plb, (OPTIONS_ALL|OPTIONS_APB_SLVS),
VENDOR_GAISLER, GAISLER_IRQMP,
@@ -148,6 +154,7 @@ static void amba_initialize(void)
icsel = (icsel >> ((7 - (LEON3_Cpu_Index & 0x7)) * 4)) & 0xf;
LEON3_IrqCtrl_Regs += icsel;
}
+#endif
#if !defined(LEON3_GPTIMER_BASE)
/* find GP Timer */