forked from Imagelibrary/rtems
bsps: Interrupt initialization error is fatal
This commit is contained in:
@@ -63,9 +63,7 @@ void bsp_start_default( void )
|
|||||||
/*
|
/*
|
||||||
* Init rtems interrupt management
|
* Init rtems interrupt management
|
||||||
*/
|
*/
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
} /* bsp_start */
|
} /* bsp_start */
|
||||||
|
|
||||||
/* Calcuate the frequency for perclk1 */
|
/* Calcuate the frequency for perclk1 */
|
||||||
|
|||||||
@@ -62,9 +62,7 @@ void bsp_start_default( void )
|
|||||||
/*
|
/*
|
||||||
* Init rtems interrupt management
|
* Init rtems interrupt management
|
||||||
*/
|
*/
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* bsp_start */
|
} /* bsp_start */
|
||||||
|
|
||||||
|
|||||||
@@ -43,9 +43,7 @@ void bsp_start_default( void )
|
|||||||
/*
|
/*
|
||||||
* Init rtems interrupt management
|
* Init rtems interrupt management
|
||||||
*/
|
*/
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
} /* bsp_start */
|
} /* bsp_start */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -46,9 +46,7 @@ void bsp_start_default( void )
|
|||||||
/* rtems_exception_init_mngt(); */
|
/* rtems_exception_init_mngt(); */
|
||||||
|
|
||||||
/* Init rtems interrupt management */
|
/* Init rtems interrupt management */
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -92,9 +92,7 @@ void bsp_start_default( void )
|
|||||||
/*
|
/*
|
||||||
* Init rtems interrupt management
|
* Init rtems interrupt management
|
||||||
*/
|
*/
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ void bsp_start_default( void )
|
|||||||
/* disable interrupts */
|
/* disable interrupts */
|
||||||
XSCALE_INT_ICMR = 0x0;
|
XSCALE_INT_ICMR = 0x0;
|
||||||
rtems_exception_init_mngt();
|
rtems_exception_init_mngt();
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
} /* bsp_start */
|
} /* bsp_start */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -20,7 +20,5 @@
|
|||||||
|
|
||||||
void bsp_start(void)
|
void bsp_start(void)
|
||||||
{
|
{
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,9 +87,7 @@ void bsp_start(void)
|
|||||||
initialize_console();
|
initialize_console();
|
||||||
|
|
||||||
/* Interrupts */
|
/* Interrupts */
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* DMA */
|
/* DMA */
|
||||||
lpc24xx_dma_initialize();
|
lpc24xx_dma_initialize();
|
||||||
|
|||||||
@@ -29,7 +29,5 @@
|
|||||||
|
|
||||||
void bsp_start(void)
|
void bsp_start(void)
|
||||||
{
|
{
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,9 +85,7 @@ void bsp_start_default( void )
|
|||||||
/*
|
/*
|
||||||
* Init rtems interrupt management
|
* Init rtems interrupt management
|
||||||
*/
|
*/
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
} /* bsp_start */
|
} /* bsp_start */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -22,7 +22,5 @@ void bsp_start(void)
|
|||||||
{
|
{
|
||||||
stm32f4_gpio_set_config_array(&stm32f4_start_config_gpio [0]);
|
stm32f4_gpio_set_config_array(&stm32f4_start_config_gpio [0]);
|
||||||
|
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
_CPU_Fatal_halt(0xe);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,13 +158,7 @@ void rtems_irq_mngt_init(void)
|
|||||||
/*
|
/*
|
||||||
* Init initial Interrupt management config
|
* Init initial Interrupt management config
|
||||||
*/
|
*/
|
||||||
if (bsp_interrupt_initialize() != RTEMS_SUCCESSFUL) {
|
bsp_interrupt_initialize();
|
||||||
/*
|
|
||||||
* put something here that will show the failure...
|
|
||||||
*/
|
|
||||||
printk("Unable to initialize RTEMS interrupt Management!!! System locked\n");
|
|
||||||
while (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* #define DEBUG
|
* #define DEBUG
|
||||||
|
|||||||
@@ -184,10 +184,7 @@ void bsp_start(void)
|
|||||||
ppc_exc_set_handler(ASM_ALIGN_VECTOR, ppc_exc_alignment_handler);
|
ppc_exc_set_handler(ASM_ALIGN_VECTOR, ppc_exc_alignment_handler);
|
||||||
|
|
||||||
/* Initalize interrupt support */
|
/* Initalize interrupt support */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
|
||||||
BSP_panic("cannot intitialize interrupts");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the BSP was built with IRQ benchmarking enabled,
|
* If the BSP was built with IRQ benchmarking enabled,
|
||||||
|
|||||||
@@ -150,10 +150,7 @@ void bsp_start( void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initalize interrupt support */
|
/* Initalize interrupt support */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
|
||||||
BSP_panic("cannot intitialize interrupts\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SHOW_MORE_INIT_SETTINGS
|
#ifdef SHOW_MORE_INIT_SETTINGS
|
||||||
printk("Exit from bspstart\n");
|
printk("Exit from bspstart\n");
|
||||||
|
|||||||
@@ -123,10 +123,7 @@ void bsp_start(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initalize interrupt support */
|
/* Initalize interrupt support */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if ( sc != RTEMS_SUCCESSFUL ) {
|
|
||||||
BSP_panic( "cannot initialize interrupts" );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize the device driver parameters
|
* initialize the device driver parameters
|
||||||
|
|||||||
@@ -130,10 +130,7 @@ void bsp_start(void)
|
|||||||
ppc_exc_set_handler(ASM_ALIGN_VECTOR, ppc_exc_alignment_handler);
|
ppc_exc_set_handler(ASM_ALIGN_VECTOR, ppc_exc_alignment_handler);
|
||||||
|
|
||||||
/* Initialize interrupts */
|
/* Initialize interrupts */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
|
||||||
BSP_panic( "Cannot initialize interrupts");
|
|
||||||
}
|
|
||||||
|
|
||||||
mpc55xx_edma_init();
|
mpc55xx_edma_init();
|
||||||
#ifdef MPC55XX_EMIOS_PRESCALER
|
#ifdef MPC55XX_EMIOS_PRESCALER
|
||||||
|
|||||||
@@ -183,11 +183,7 @@ void bsp_start(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initalize interrupt support */
|
/* Initalize interrupt support */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
|
||||||
BSP_panic("cannot intitialize interrupts");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
mmu_init();
|
mmu_init();
|
||||||
|
|||||||
@@ -107,10 +107,7 @@ void bsp_start( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initalize interrupt support */
|
/* Initalize interrupt support */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
|
||||||
BSP_panic("cannot intitialize interrupts");
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -126,10 +126,7 @@ void bsp_start(void)
|
|||||||
);
|
);
|
||||||
|
|
||||||
/* Initalize interrupt support */
|
/* Initalize interrupt support */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
|
||||||
BSP_panic("cannot intitialize interrupts\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Disable boot page translation */
|
/* Disable boot page translation */
|
||||||
qoriq.lcc.bptr &= ~BPTR_EN;
|
qoriq.lcc.bptr &= ~BPTR_EN;
|
||||||
|
|||||||
@@ -77,8 +77,5 @@ void bsp_start(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initalize interrupt support */
|
/* Initalize interrupt support */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
|
||||||
BSP_panic("cannot initialize interrupts\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,10 +192,7 @@ void bsp_start( void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initalize interrupt support */
|
/* Initalize interrupt support */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
|
||||||
BSP_panic("cannot intitialize interrupts");
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef SHOW_MORE_INIT_SETTINGS
|
#ifdef SHOW_MORE_INIT_SETTINGS
|
||||||
printk("Exit from bspstart\n");
|
printk("Exit from bspstart\n");
|
||||||
|
|||||||
@@ -50,6 +50,13 @@ extern "C" {
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Generic BSP fatal error codes.
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION
|
||||||
|
} bsp_generic_fatal_code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Global pointer to the command line of boot_card().
|
* @brief Global pointer to the command line of boot_card().
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -9,12 +9,13 @@
|
|||||||
/*
|
/*
|
||||||
* Based on concepts of Pavel Pisa, Till Straumann and Eric Valette.
|
* Based on concepts of Pavel Pisa, Till Straumann and Eric Valette.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2008, 2009, 2010
|
* Copyright (c) 2008-2012 embedded brains GmbH.
|
||||||
* embedded brains GmbH
|
*
|
||||||
* Obere Lagerstr. 30
|
* embedded brains GmbH
|
||||||
* D-82178 Puchheim
|
* Obere Lagerstr. 30
|
||||||
* Germany
|
* 82178 Puchheim
|
||||||
* <rtems@embedded-brains.de>
|
* Germany
|
||||||
|
* <rtems@embedded-brains.de>
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
||||||
@@ -163,11 +164,15 @@ void bsp_interrupt_handler_default(rtems_vector_number vector);
|
|||||||
* @brief Initialize BSP interrupt support.
|
* @brief Initialize BSP interrupt support.
|
||||||
*
|
*
|
||||||
* You must call this function before you can install, remove and dispatch
|
* You must call this function before you can install, remove and dispatch
|
||||||
* interrupt handlers. The BSP specific bsp_interrupt_facility_initialize()
|
* interrupt handlers. There is no protection against concurrent
|
||||||
* function will be called after all internals are initialized. Initialization
|
* initialization. This function must be called at most once. The BSP
|
||||||
* is complete if everything was successful.
|
* specific bsp_interrupt_facility_initialize() function will be called after
|
||||||
|
* all internals are initialized. If the BSP specific initialization fails,
|
||||||
|
* then this is a fatal error. The fatal error source is
|
||||||
|
* RTEMS_FATAL_SOURCE_BSP_GENERIC and the fatal error code is
|
||||||
|
* BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION.
|
||||||
*/
|
*/
|
||||||
rtems_status_code bsp_interrupt_initialize(void);
|
void bsp_interrupt_initialize(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief BSP specific initialization.
|
* @brief BSP specific initialization.
|
||||||
|
|||||||
@@ -9,12 +9,13 @@
|
|||||||
/*
|
/*
|
||||||
* Based on concepts of Pavel Pisa, Till Straumann and Eric Valette.
|
* Based on concepts of Pavel Pisa, Till Straumann and Eric Valette.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2008, 2009
|
* Copyright (c) 2008-2012 embedded brains GmbH.
|
||||||
* embedded brains GmbH
|
*
|
||||||
* Obere Lagerstr. 30
|
* embedded brains GmbH
|
||||||
* D-82178 Puchheim
|
* Obere Lagerstr. 30
|
||||||
* Germany
|
* 82178 Puchheim
|
||||||
* <rtems@embedded-brains.de>
|
* Germany
|
||||||
|
* <rtems@embedded-brains.de>
|
||||||
*
|
*
|
||||||
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
||||||
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <bsp/irq-generic.h>
|
#include <bsp/irq-generic.h>
|
||||||
|
#include <bsp/bootcard.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -155,18 +157,11 @@ static void bsp_interrupt_unlock(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rtems_status_code bsp_interrupt_initialize(void)
|
void bsp_interrupt_initialize(void)
|
||||||
{
|
{
|
||||||
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
rtems_status_code sc = RTEMS_SUCCESSFUL;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
bsp_interrupt_lock();
|
|
||||||
|
|
||||||
if (bsp_interrupt_is_initialized()) {
|
|
||||||
bsp_interrupt_unlock();
|
|
||||||
return RTEMS_INTERNAL_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialize handler table */
|
/* Initialize handler table */
|
||||||
for (i = 0; i < BSP_INTERRUPT_HANDLER_TABLE_SIZE; ++i) {
|
for (i = 0; i < BSP_INTERRUPT_HANDLER_TABLE_SIZE; ++i) {
|
||||||
bsp_interrupt_handler_table [i].handler = bsp_interrupt_handler_empty;
|
bsp_interrupt_handler_table [i].handler = bsp_interrupt_handler_empty;
|
||||||
@@ -175,15 +170,13 @@ rtems_status_code bsp_interrupt_initialize(void)
|
|||||||
|
|
||||||
sc = bsp_interrupt_facility_initialize();
|
sc = bsp_interrupt_facility_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
if (sc != RTEMS_SUCCESSFUL) {
|
||||||
bsp_interrupt_unlock();
|
rtems_fatal(
|
||||||
return sc;
|
RTEMS_FATAL_SOURCE_BSP_GENERIC,
|
||||||
|
BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
bsp_interrupt_set_initialized();
|
bsp_interrupt_set_initialized();
|
||||||
|
|
||||||
bsp_interrupt_unlock();
|
|
||||||
|
|
||||||
return RTEMS_SUCCESSFUL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ void *bsp_early_malloc(int size);
|
|||||||
typedef void (*bsp_shared_isr)(void *arg);
|
typedef void (*bsp_shared_isr)(void *arg);
|
||||||
|
|
||||||
/* Initializes the Shared System Interrupt service */
|
/* Initializes the Shared System Interrupt service */
|
||||||
extern int BSP_shared_interrupt_init(void);
|
extern void BSP_shared_interrupt_init(void);
|
||||||
|
|
||||||
/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
|
/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
|
||||||
* interrupt handlers may use the same IRQ number, all ISRs will be called
|
* interrupt handlers may use the same IRQ number, all ISRs will be called
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ void *bsp_early_malloc(int size);
|
|||||||
typedef void (*bsp_shared_isr)(void *arg);
|
typedef void (*bsp_shared_isr)(void *arg);
|
||||||
|
|
||||||
/* Initializes the Shared System Interrupt service */
|
/* Initializes the Shared System Interrupt service */
|
||||||
extern int BSP_shared_interrupt_init(void);
|
extern void BSP_shared_interrupt_init(void);
|
||||||
|
|
||||||
/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
|
/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
|
||||||
* interrupt handlers may use the same IRQ number, all ISRs will be called
|
* interrupt handlers may use the same IRQ number, all ISRs will be called
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ void *bsp_early_malloc(int size);
|
|||||||
typedef void (*bsp_shared_isr)(void *arg);
|
typedef void (*bsp_shared_isr)(void *arg);
|
||||||
|
|
||||||
/* Initializes the Shared System Interrupt service */
|
/* Initializes the Shared System Interrupt service */
|
||||||
extern int BSP_shared_interrupt_init(void);
|
extern void BSP_shared_interrupt_init(void);
|
||||||
|
|
||||||
/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
|
/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
|
||||||
* interrupt handlers may use the same IRQ number, all ISRs will be called
|
* interrupt handlers may use the same IRQ number, all ISRs will be called
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ static void BSP_ISR_handler(rtems_vector_number vector)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize interrupts */
|
/* Initialize interrupts */
|
||||||
int BSP_shared_interrupt_init(void)
|
void BSP_shared_interrupt_init(void)
|
||||||
{
|
{
|
||||||
rtems_vector_number vector;
|
rtems_vector_number vector;
|
||||||
rtems_isr_entry previous_isr;
|
rtems_isr_entry previous_isr;
|
||||||
@@ -37,11 +37,7 @@ int BSP_shared_interrupt_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initalize interrupt support */
|
/* Initalize interrupt support */
|
||||||
sc = bsp_interrupt_initialize();
|
bsp_interrupt_initialize();
|
||||||
if (sc != RTEMS_SUCCESSFUL)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Callback from bsp_interrupt_initialize() */
|
/* Callback from bsp_interrupt_initialize() */
|
||||||
|
|||||||
Reference in New Issue
Block a user