bsp/leon3: Add and use fatal codes

This commit is contained in:
Sebastian Huber
2014-02-17 11:54:35 +01:00
parent 33cb8bf64d
commit 46d7fa5cd3
3 changed files with 7 additions and 3 deletions

View File

@@ -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),

View File

@@ -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;

View File

@@ -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;