forked from Imagelibrary/rtems
bsp/gen5200: Add and use mpc5200_fatal()
This commit is contained in:
@@ -222,6 +222,19 @@ void BSP_IRQ_Benchmarking_Report(void);
|
||||
|
||||
void cpu_init(void);
|
||||
|
||||
typedef enum {
|
||||
MPC5200_FATAL_PCF8563_INVALID_YEAR,
|
||||
MPC5200_FATAL_SLICETIMER_0_IRQ_INSTALL,
|
||||
MPC5200_FATAL_SLICETIMER_1_IRQ_INSTALL,
|
||||
MPC5200_FATAL_TM27_IRQ_INSTALL,
|
||||
MPC5200_FATAL_MSCAN_A_INIT,
|
||||
MPC5200_FATAL_MSCAN_B_INIT,
|
||||
MPC5200_FATAL_MSCAN_A_SET_MODE,
|
||||
MPC5200_FATAL_MSCAN_B_SET_MODE
|
||||
} mpc5200_fatal_code;
|
||||
|
||||
void mpc5200_fatal(mpc5200_fatal_code code) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -33,7 +33,7 @@ void Install_tm27_vector(void (*_handler)())
|
||||
clockIrqData.hdl = _handler;
|
||||
if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
|
||||
printk("Error installing clock interrupt handler!\n");
|
||||
rtems_fatal_error_occurred(1);
|
||||
mpc5200_fatal(MPC5200_FATAL_TM27_IRQ_INSTALL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -770,20 +770,20 @@ rtems_device_driver mscan_initialize(rtems_device_major_number major,
|
||||
|
||||
/* Initialization requested via RTEMS */
|
||||
if ((status = mscan_channel_initialize(major, MSCAN_A)) != RTEMS_SUCCESSFUL)
|
||||
rtems_fatal_error_occurred(status);
|
||||
mpc5200_fatal(MPC5200_FATAL_MSCAN_A_INIT);
|
||||
|
||||
if ((status = mscan_channel_initialize(major, MSCAN_B)) != RTEMS_SUCCESSFUL)
|
||||
rtems_fatal_error_occurred(status);
|
||||
mpc5200_fatal(MPC5200_FATAL_MSCAN_B_INIT);
|
||||
|
||||
if ((status =
|
||||
mpc5200_mscan_set_mode(MSCAN_A,
|
||||
MSCAN_INIT_NORMAL_MODE)) != RTEMS_SUCCESSFUL)
|
||||
rtems_fatal_error_occurred(status);
|
||||
mpc5200_fatal(MPC5200_FATAL_MSCAN_A_SET_MODE);
|
||||
|
||||
if ((status =
|
||||
mpc5200_mscan_set_mode(MSCAN_B,
|
||||
MSCAN_INIT_NORMAL_MODE)) != RTEMS_SUCCESSFUL)
|
||||
rtems_fatal_error_occurred(status);
|
||||
mpc5200_fatal(MPC5200_FATAL_MSCAN_B_SET_MODE);
|
||||
|
||||
return status;
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ rtems_device_driver slt_initialize
|
||||
{
|
||||
|
||||
printk("Unable to connect PSC Irq handler\n");
|
||||
rtems_fatal_error_occurred(1);
|
||||
mpc5200_fatal(MPC5200_FATAL_SLICETIMER_0_IRQ_INSTALL);
|
||||
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ rtems_device_driver slt_initialize
|
||||
{
|
||||
|
||||
printk("Unable to connect PSC Irq handler\n");
|
||||
rtems_fatal_error_occurred(1);
|
||||
mpc5200_fatal(MPC5200_FATAL_SLICETIMER_1_IRQ_INSTALL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,11 @@ void _BSP_Fatal_error(unsigned int v)
|
||||
__asm__ __volatile ("sc");
|
||||
}
|
||||
|
||||
void mpc5200_fatal(mpc5200_fatal_code code)
|
||||
{
|
||||
rtems_fatal(RTEMS_FATAL_SOURCE_BSP_SPECIFIC, code);
|
||||
}
|
||||
|
||||
void bsp_start(void)
|
||||
{
|
||||
ppc_cpu_id_t myCpu;
|
||||
|
||||
@@ -184,9 +184,8 @@ pcf8563_set_time(int minor, const rtems_time_of_day *time)
|
||||
bus = RTC_Table[minor].ulCtrlPort1;
|
||||
addr = RTC_Table[minor].ulDataPort;
|
||||
|
||||
if ((time->year >= 2100) ||
|
||||
(time->year < 1900)) {
|
||||
rtems_fatal_error_occurred(RTEMS_INVALID_NUMBER);
|
||||
if ((time->year >= 2100) || (time->year < 1900)) {
|
||||
mpc5200_fatal(MPC5200_FATAL_PCF8563_INVALID_YEAR);
|
||||
}
|
||||
info[0] = PCF8563_SECOND_ADR;
|
||||
info[1 + PCF8563_YEAR_ADR -PCF8563_SECOND_ADR] = To_BCD(time->year % 100);
|
||||
|
||||
Reference in New Issue
Block a user