From 46d7fa5cd336a7cf892e7ec8cd60c27882cb1225 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 17 Feb 2014 11:54:35 +0100 Subject: bsp/leon3: Add and use fatal codes --- c/src/lib/libbsp/shared/include/fatal.h | 2 ++ c/src/lib/libbsp/sparc/leon3/amba/amba.c | 3 ++- c/src/lib/libbsp/sparc/leon3/console/console.c | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/c/src/lib/libbsp/shared/include/fatal.h b/c/src/lib/libbsp/shared/include/fatal.h index 16d20b84b7..0bf0608af0 100644 --- a/c/src/lib/libbsp/shared/include/fatal.h +++ b/c/src/lib/libbsp/shared/include/fatal.h @@ -48,6 +48,8 @@ typedef enum { /* LEON3 fatal codes */ LEON3_FATAL_CPU_COUNTER_INIT = BSP_FATAL_CODE_BLOCK(2), + LEON3_FATAL_NO_IRQMP_CONTROLLER, + LEON3_FATAL_CONSOLE_REGISTER_DEV, /* LPC24XX fatal codes */ LPC24XX_FATAL_PL111_SET_UP = BSP_FATAL_CODE_BLOCK(3), diff --git a/c/src/lib/libbsp/sparc/leon3/amba/amba.c b/c/src/lib/libbsp/sparc/leon3/amba/amba.c index eb7b0f2a40..a4745d41ed 100644 --- a/c/src/lib/libbsp/sparc/leon3/amba/amba.c +++ b/c/src/lib/libbsp/sparc/leon3/amba/amba.c @@ -12,6 +12,7 @@ */ #include +#include #include /* AMBA Plug&Play information description. @@ -58,7 +59,7 @@ void amba_initialize(void) * * What else can we do but stop ... */ - asm volatile( "mov 1, %g1; ta 0x0" ); + bsp_fatal(LEON3_FATAL_NO_IRQMP_CONTROLLER); } LEON3_IrqCtrl_Regs = (volatile struct irqmp_regs *)DEV_TO_APB(adev)->start; diff --git a/c/src/lib/libbsp/sparc/leon3/console/console.c b/c/src/lib/libbsp/sparc/leon3/console/console.c index 7e726336b0..368c274b21 100644 --- a/c/src/lib/libbsp/sparc/leon3/console/console.c +++ b/c/src/lib/libbsp/sparc/leon3/console/console.c @@ -27,6 +27,7 @@ */ #include +#include #include #include #include @@ -297,14 +298,14 @@ rtems_device_driver console_initialize( if (syscon_uart_index < uarts) { status = rtems_io_register_name("/dev/console", major, 0); if (status != RTEMS_SUCCESSFUL) - rtems_fatal_error_occurred(status); + bsp_fatal(LEON3_FATAL_CONSOLE_REGISTER_DEV); } strcpy(console_name,"/dev/console_a"); for (i = 0; i < uarts; i++) { if (i == syscon_uart_index) continue; /* skip UART that is registered as /dev/console */ console_name[13] = 'a' + i; - status = rtems_io_register_name( console_name, major, i+1); + rtems_io_register_name( console_name, major, i+1); } return RTEMS_SUCCESSFUL; -- cgit v1.2.3