forked from Imagelibrary/rtems
2008-06-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/bsp.h, irq/irq.c, irq/irq_init.c, startup/bspclean.c, startup/bspstart.c: Slightly better names for IRQ benchmarking. Make sure the routines are present all the time.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2008-06-06 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* include/bsp.h, irq/irq.c, irq/irq_init.c, startup/bspclean.c,
|
||||
startup/bspstart.c: Slightly better names for IRQ benchmarking. Make
|
||||
sure the routines are present all the time.
|
||||
|
||||
2008-05-22 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||
|
||||
* console/console.c: Remove explicit switch and call
|
||||
|
||||
@@ -258,6 +258,9 @@ void bsp_cleanup(void);
|
||||
Thread _Thread_Idle_body(uint32_t ignored);
|
||||
#define BSP_IDLE_TASK_BODY _Thread_Idle_body
|
||||
|
||||
/* BSP specific IRQ Benchmarking support */
|
||||
void BSP_IRQ_Benchmarking_Reset(void);
|
||||
void BSP_IRQ_Benchmarking_Report(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -631,7 +631,14 @@ int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if (BENCHMARK_IRQ_PROCESSING == 1)
|
||||
#if (BENCHMARK_IRQ_PROCESSING == 0)
|
||||
void BSP_IRQ_Benchmarking_Reset(void)
|
||||
{
|
||||
}
|
||||
void BSP_IRQ_Benchmarking_Report(void)
|
||||
{
|
||||
}
|
||||
#else
|
||||
#include <stdio.h>
|
||||
uint64_t BSP_Starting_TBR;
|
||||
uint64_t BSP_Total_in_ISR;
|
||||
@@ -640,7 +647,7 @@ uint32_t BSP_Worst_ISR;
|
||||
#define BSP_COUNTED_IRQ 16
|
||||
uint32_t BSP_ISR_Count_Per[BSP_COUNTED_IRQ + 1];
|
||||
|
||||
void BSP_initialize_IRQ_Timing(void)
|
||||
void BSP_IRQ_Benchmarking_Reset(void)
|
||||
{
|
||||
int i;
|
||||
BSP_Starting_TBR = PPC_Get_timebase_register();
|
||||
@@ -659,7 +666,8 @@ static const char * u64tostring(
|
||||
sprintf( buffer, "%lld %lld usecs", v, (v / 33) );
|
||||
return buffer;
|
||||
}
|
||||
void BSP_report_IRQ_Timing(void)
|
||||
|
||||
void BSP_IRQ_Benchmarking_Report(void)
|
||||
{
|
||||
uint64_t now;
|
||||
char buffer[96];
|
||||
|
||||
@@ -231,35 +231,42 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
|
||||
{
|
||||
rtems_raw_except_connect_data vectorDesc;
|
||||
int i;
|
||||
#if (BENCHMARK_IRQ_PROCESSING == 1)
|
||||
extern void BSP_initialize_IRQ_Timing(void);
|
||||
|
||||
void BSP_initialize_IRQ_Timing(void);
|
||||
#endif
|
||||
|
||||
BSP_SIU_irq_init();
|
||||
|
||||
/*
|
||||
* Initialize Rtems management interrupt table
|
||||
*/
|
||||
|
||||
/*
|
||||
* re-init the rtemsIrq table
|
||||
*/
|
||||
for (i = 0; i < BSP_IRQ_NUMBER; i++)
|
||||
{
|
||||
for (i = 0; i < BSP_IRQ_NUMBER; i++) {
|
||||
rtemsIrq[i] = defaultIrq;
|
||||
rtemsIrq[i].name = i;
|
||||
}
|
||||
/*
|
||||
* Init initial Interrupt management config
|
||||
*/
|
||||
}
|
||||
/*
|
||||
* Init initial Interrupt management config
|
||||
*/
|
||||
initial_config.irqNb = BSP_IRQ_NUMBER;
|
||||
initial_config.defaultEntry = defaultIrq;
|
||||
initial_config.irqHdlTbl = rtemsIrq;
|
||||
initial_config.irqBase = BSP_LOWEST_OFFSET;
|
||||
initial_config.irqPrioTbl = irqPrioTable;
|
||||
|
||||
if (!BSP_rtems_irq_mngt_set(&initial_config))
|
||||
{
|
||||
if (!BSP_rtems_irq_mngt_set(&initial_config)) {
|
||||
/*
|
||||
* put something here that will show the failure...
|
||||
*/
|
||||
BSP_panic("Unable to initialize RTEMS interrupt Management!!! System locked\n");
|
||||
}
|
||||
BSP_panic(
|
||||
"Unable to initialize RTEMS interrupt Management!!! System locked\n"
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* We must connect the raw irq handler for the two
|
||||
@@ -273,30 +280,26 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
|
||||
vectorDesc.off = nop_func;
|
||||
vectorDesc.isOn = connected;
|
||||
|
||||
if (!ppc_set_exception (&vectorDesc))
|
||||
{
|
||||
BSP_panic("Unable to initialize RTEMS decrementer raw exception\n");
|
||||
}
|
||||
if (!ppc_set_exception (&vectorDesc)) {
|
||||
BSP_panic("Unable to initialize RTEMS decrementer raw exception\n");
|
||||
}
|
||||
|
||||
vectorDesc.exceptIndex = ASM_EXT_VECTOR;
|
||||
vectorDesc.hdl.vector = ASM_EXT_VECTOR;
|
||||
vectorDesc.hdl.raw_hdl = external_exception_vector_prolog_code;
|
||||
vectorDesc.hdl.raw_hdl_size = (unsigned) &external_exception_vector_prolog_code_size;
|
||||
|
||||
if (!ppc_set_exception (&vectorDesc))
|
||||
{
|
||||
if (!ppc_set_exception (&vectorDesc)) {
|
||||
BSP_panic("Unable to initialize RTEMS external raw exception\n");
|
||||
}
|
||||
}
|
||||
|
||||
vectorDesc.exceptIndex = ASM_60X_SYSMGMT_VECTOR;
|
||||
vectorDesc.hdl.vector = ASM_60X_SYSMGMT_VECTOR;
|
||||
vectorDesc.hdl.raw_hdl = system_management_exception_vector_prolog_code;
|
||||
vectorDesc.hdl.raw_hdl_size = (unsigned) &system_management_exception_vector_prolog_code_size;
|
||||
|
||||
if (!ppc_set_exception (&vectorDesc))
|
||||
{
|
||||
if (!ppc_set_exception (&vectorDesc)) {
|
||||
BSP_panic("Unable to initialize RTEMS system management raw exception\n");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,7 @@ void bsp_cleanup( void )
|
||||
|
||||
#if (BENCHMARK_IRQ_PROCESSING == 1)
|
||||
{
|
||||
extern void BSP_report_IRQ_Timing(void);
|
||||
BSP_report_IRQ_Timing();
|
||||
BSP_IRQ_Benchmarking_Report();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -224,23 +224,24 @@ void bsp_start(void)
|
||||
register unsigned char* intrStack;
|
||||
|
||||
/*
|
||||
* Get CPU identification dynamically. Note that the get_ppc_cpu_type() function
|
||||
* store the result in global variables so that it can be used latter...
|
||||
* Get CPU identification dynamically. Note that the get_ppc_cpu_type()
|
||||
* function store the result in global variables so that it can be used
|
||||
* later...
|
||||
*/
|
||||
myCpu = get_ppc_cpu_type();
|
||||
myCpuRevision = get_ppc_cpu_revision();
|
||||
|
||||
#if defined(HAS_UBOOT)
|
||||
uboot_bdinfo_copy = *uboot_bdinfo_ptr;
|
||||
uboot_bdinfo_ptr = &uboot_bdinfo_copy;
|
||||
#endif
|
||||
#if defined(HAS_UBOOT)
|
||||
uboot_bdinfo_copy = *uboot_bdinfo_ptr;
|
||||
uboot_bdinfo_ptr = &uboot_bdinfo_copy;
|
||||
#endif
|
||||
|
||||
#if defined(HAS_UBOOT) && defined(SHOW_MORE_INIT_SETTINGS)
|
||||
{
|
||||
void dumpUBootBDInfo( bd_t * );
|
||||
dumpUBootBDInfo( uboot_bdinfo_ptr );
|
||||
}
|
||||
#endif
|
||||
#if defined(HAS_UBOOT) && defined(SHOW_MORE_INIT_SETTINGS)
|
||||
{
|
||||
void dumpUBootBDInfo( bd_t * );
|
||||
dumpUBootBDInfo( uboot_bdinfo_ptr );
|
||||
}
|
||||
#endif
|
||||
|
||||
cpu_init();
|
||||
|
||||
@@ -266,12 +267,12 @@ void bsp_start(void)
|
||||
/*
|
||||
* Enable instruction and data caches. Do not force writethrough mode.
|
||||
*/
|
||||
#if INSTRUCTION_CACHE_ENABLE
|
||||
rtems_cache_enable_instruction();
|
||||
#endif
|
||||
#if DATA_CACHE_ENABLE
|
||||
rtems_cache_enable_data();
|
||||
#endif
|
||||
#if INSTRUCTION_CACHE_ENABLE
|
||||
rtems_cache_enable_instruction();
|
||||
#endif
|
||||
#if DATA_CACHE_ENABLE
|
||||
rtems_cache_enable_data();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Need to "allocate" the memory for the RTEMS Workspace and
|
||||
@@ -279,28 +280,29 @@ void bsp_start(void)
|
||||
* not malloc'ed. It is just "pulled from the air".
|
||||
*/
|
||||
Configuration.work_space_start = (void *)&_WorkspaceBase;
|
||||
#ifdef SHOW_MORE_INIT_SETTINGS
|
||||
printk( "workspace=%p\n", Configuration.work_space_start );
|
||||
printk( "workspace size=%d\n", Configuration.work_space_size );
|
||||
#endif
|
||||
#ifdef SHOW_MORE_INIT_SETTINGS
|
||||
printk( "workspace=%p\n", Configuration.work_space_start );
|
||||
printk( "workspace size=%d\n", Configuration.work_space_size );
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initalize RTEMS IRQ system
|
||||
*/
|
||||
BSP_rtems_irq_mng_init(0);
|
||||
|
||||
#if (BENCHMARK_IRQ_PROCESSING == 1)
|
||||
{
|
||||
void BSP_initialize_IRQ_Timing(void);
|
||||
BSP_initialize_IRQ_Timing();
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* If the BSP was built with IRQ benchmarking enabled,
|
||||
* then intialize it.
|
||||
*/
|
||||
#if (BENCHMARK_IRQ_PROCESSING == 1)
|
||||
BSP_IRQ_Benchmarking_Reset();
|
||||
#endif
|
||||
|
||||
#ifdef SHOW_MORE_INIT_SETTINGS
|
||||
printk("Exit from bspstart\n");
|
||||
#endif
|
||||
#ifdef SHOW_MORE_INIT_SETTINGS
|
||||
printk("Exit from bspstart\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user