[rtems commit] LEON3: halt boot if IRQ controller not found

Joel Sherrill joel at rtems.org
Fri Apr 6 14:03:52 UTC 2012


Module:    rtems
Branch:    master
Commit:    684b54a986d8093cc1bf679130630b47bba6d638
Changeset: http://git.rtems.org/rtems/commit/?id=684b54a986d8093cc1bf679130630b47bba6d638

Author:    Daniel Hellstrom <daniel at gaisler.com>
Date:      Thu Apr  5 10:23:20 2012 -0500

LEON3: halt boot if IRQ controller not found

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();
 




More information about the vc mailing list