[PATCH 30] LEON3: halt boot if IRQ controller not found

Daniel Hellstrom daniel at gaisler.com
Thu Apr 5 15:23:20 UTC 2012


Signed-off-by: Daniel Hellstrom <daniel at gaisler.com>
---
 c/src/lib/libbsp/sparc/leon3/amba/amba.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/amba/amba.c b/c/src/lib/libbsp/sparc/leon3/amba/amba.c
index 03af226..e334aec 100644
--- a/c/src/lib/libbsp/sparc/leon3/amba/amba.c
+++ b/c/src/lib/libbsp/sparc/leon3/amba/amba.c
@@ -44,13 +44,18 @@ void amba_initialize(void)
   /* Scan the AMBA Plug&Play info at the default LEON3 area */
   amba_scan(&amba_conf,LEON3_IO_AREA,NULL);
 
-  /* Find LEON3 Interrupt controler */
+  /* Find LEON3 Interrupt controller */
   i = amba_find_apbslv(&amba_conf,VENDOR_GAISLER,GAISLER_IRQMP,&dev);
-  if ( i > 0 ){
-    /* Found APB IRQ_MP Interrupt Controller */
-    LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start;
+  if (i <= 0){
+    /* PANIC IRQ controller not found!
+     *
+     *  What else can we do but stop ...
+     */
+    asm volatile( "mov 1, %g1; ta 0x0" );
   }
 
+  LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start;
+
   /* Init Extended IRQ controller if available */
   leon3_ext_irq_init();
 
-- 
1.7.0.4




More information about the devel mailing list