summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-17 11:54:35 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-19 09:59:40 +0100
commit46d7fa5cd336a7cf892e7ec8cd60c27882cb1225 (patch)
treeb659b6a2a9cc4bc63b6e60bbe80600b38ab80656
parentscore: Add RTEMS_FATAL_SOURCE_BSP (diff)
downloadrtems-46d7fa5cd336a7cf892e7ec8cd60c27882cb1225.tar.bz2
bsp/leon3: Add and use fatal codes
-rw-r--r--c/src/lib/libbsp/shared/include/fatal.h2
-rw-r--r--c/src/lib/libbsp/sparc/leon3/amba/amba.c3
-rw-r--r--c/src/lib/libbsp/sparc/leon3/console/console.c5
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 <bsp.h>
+#include <bsp/fatal.h>
#include <ambapp.h>
/* 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 <bsp.h>
+#include <bsp/fatal.h>
#include <rtems/libio.h>
#include <stdlib.h>
#include <assert.h>
@@ -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;