forked from Imagelibrary/rtems
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* amba/amba.c, clock/ckinit.c, console/console.c, include/bsp.h, startup/bspstart.c, timer/timer.c: Move interrupt_stack_size field from CPU Table to Configuration Table. Eliminate CPU Table from all ports. Delete references to CPU Table in all forms.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2007-12-04 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* amba/amba.c, clock/ckinit.c, console/console.c, include/bsp.h,
|
||||||
|
startup/bspstart.c, timer/timer.c: Move interrupt_stack_size field
|
||||||
|
from CPU Table to Configuration Table. Eliminate CPU Table from all
|
||||||
|
ports. Delete references to CPU Table in all forms.
|
||||||
|
|
||||||
2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* amba/amba.c, startup/bspstart.c: Moved most of the remaining CPU
|
* amba/amba.c, startup/bspstart.c: Moved most of the remaining CPU
|
||||||
|
|||||||
@@ -58,10 +58,12 @@ void bsp_predriver_hook(void)
|
|||||||
if ( i > 0 ){
|
if ( i > 0 ){
|
||||||
/* Found APB IRQ_MP Interrupt Controller */
|
/* Found APB IRQ_MP Interrupt Controller */
|
||||||
LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start;
|
LEON3_IrqCtrl_Regs = (volatile LEON3_IrqCtrl_Regs_Map *) dev.start;
|
||||||
if (Configuration.User_multiprocessing_table != NULL) {
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
tmp = getasr17();
|
if (rtems_configuration_get_user_multiprocessing_table() != NULL) {
|
||||||
LEON3_Cpu_Index = (tmp >> 28) & 3;
|
tmp = getasr17();
|
||||||
}
|
LEON3_Cpu_Index = (tmp >> 28) & 3;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find GP Timer */
|
/* find GP Timer */
|
||||||
|
|||||||
@@ -33,8 +33,13 @@
|
|||||||
|
|
||||||
extern rtems_configuration_table Configuration;
|
extern rtems_configuration_table Configuration;
|
||||||
|
|
||||||
#define LEON3_CLOCK_INDEX \
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
(Configuration.User_multiprocessing_table ? LEON3_Cpu_Index : 0)
|
#define LEON3_CLOCK_INDEX \
|
||||||
|
(rtems_configuration_get_user_multiprocessing_table() ? LEON3_Cpu_Index : 0)
|
||||||
|
#else
|
||||||
|
#define LEON3_CLOCK_INDEX 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
volatile LEON3_Timer_Regs_Map *LEON3_Timer_Regs = 0;
|
volatile LEON3_Timer_Regs_Map *LEON3_Timer_Regs = 0;
|
||||||
static int clkirq;
|
static int clkirq;
|
||||||
@@ -43,6 +48,17 @@ static int clkirq;
|
|||||||
|
|
||||||
#define Clock_driver_support_at_tick()
|
#define Clock_driver_support_at_tick()
|
||||||
|
|
||||||
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
|
#define Adjust_clkirq_for_node() \
|
||||||
|
do { \
|
||||||
|
if (rtems_configuration_get_user_multiprocessing_table() != NULL) { \
|
||||||
|
clkirq += LEON3_Cpu_Index; \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
#else
|
||||||
|
#define Adjust_clkirq_for_node()
|
||||||
|
#endif
|
||||||
|
|
||||||
#define Clock_driver_support_find_timer() \
|
#define Clock_driver_support_find_timer() \
|
||||||
do { \
|
do { \
|
||||||
int cnt; \
|
int cnt; \
|
||||||
@@ -55,9 +71,7 @@ static int clkirq;
|
|||||||
LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start; \
|
LEON3_Timer_Regs = (volatile LEON3_Timer_Regs_Map *) dev.start; \
|
||||||
clkirq = (LEON3_Timer_Regs->status & 0xfc) >> 3; \
|
clkirq = (LEON3_Timer_Regs->status & 0xfc) >> 3; \
|
||||||
\
|
\
|
||||||
if (Configuration.User_multiprocessing_table != NULL) { \
|
Adjust_clkirq_for_node(); \
|
||||||
clkirq += LEON3_Cpu_Index; \
|
|
||||||
} \
|
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|||||||
@@ -90,17 +90,18 @@ int uarts = 0;
|
|||||||
static int isinit = 0;
|
static int isinit = 0;
|
||||||
volatile LEON3_UART_Regs_Map *LEON3_Console_Uart[LEON3_APBUARTS];
|
volatile LEON3_UART_Regs_Map *LEON3_Console_Uart[LEON3_APBUARTS];
|
||||||
|
|
||||||
int scan_uarts() {
|
int scan_uarts() {
|
||||||
int i;
|
int i;
|
||||||
amba_apb_device apbuarts[LEON3_APBUARTS];
|
amba_apb_device apbuarts[LEON3_APBUARTS];
|
||||||
|
|
||||||
if (isinit == 0) {
|
if (isinit == 0) {
|
||||||
i = 0; uarts = 0;
|
i = 0; uarts = 0;
|
||||||
|
|
||||||
uarts = amba_find_apbslvs(&amba_conf,VENDOR_GAISLER,GAISLER_APBUART,apbuarts,LEON3_APBUARTS);
|
uarts = amba_find_apbslvs(
|
||||||
|
&amba_conf, VENDOR_GAISLER, GAISLER_APBUART, apbuarts, LEON3_APBUARTS);
|
||||||
for(i=0; i<uarts; i++){
|
for(i=0; i<uarts; i++){
|
||||||
LEON3_Console_Uart[i] = (volatile LEON3_UART_Regs_Map *)apbuarts[i].start;
|
LEON3_Console_Uart[i] = (volatile LEON3_UART_Regs_Map *)apbuarts[i].start;
|
||||||
}
|
}
|
||||||
isinit = 1;
|
isinit = 1;
|
||||||
}
|
}
|
||||||
return uarts;
|
return uarts;
|
||||||
@@ -121,11 +122,13 @@ rtems_device_driver console_initialize(
|
|||||||
|
|
||||||
/* Find UARTs */
|
/* Find UARTs */
|
||||||
scan_uarts();
|
scan_uarts();
|
||||||
|
|
||||||
if (Configuration.User_multiprocessing_table != NULL)
|
/* default to zero and override if multiprocessing */
|
||||||
uart0 = LEON3_Cpu_Index;
|
uart0 = 0;
|
||||||
else
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
uart0 = 0;
|
if (rtems_configuration_get_user_multiprocessing_table() != NULL)
|
||||||
|
uart0 = LEON3_Cpu_Index;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Register Device Names */
|
/* Register Device Names */
|
||||||
|
|
||||||
@@ -145,14 +148,17 @@ rtems_device_driver console_initialize(
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize Hardware
|
* Initialize Hardware if ONLY CPU or first CPU in MP system
|
||||||
*/
|
*/
|
||||||
if ((Configuration.User_multiprocessing_table == NULL) ||
|
|
||||||
((Configuration.User_multiprocessing_table)->node == 1))
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
|
if ((rtems_configuration_get_user_multiprocessing_table())->node == 1))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
for (i = uart0; i < uarts; i++)
|
for (i = uart0; i < uarts; i++)
|
||||||
{
|
{
|
||||||
LEON3_Console_Uart[i]->ctrl |= LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
|
LEON3_Console_Uart[i]->ctrl |=
|
||||||
|
LEON_REG_UART_CTRL_RE | LEON_REG_UART_CTRL_TE;
|
||||||
LEON3_Console_Uart[i]->status = 0;
|
LEON3_Console_Uart[i]->status = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2
|
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2
|
||||||
#define CONFIGURE_INTERRUPT_STACK_MEMORY (16 * 1024)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Network driver configuration
|
* Network driver configuration
|
||||||
@@ -122,8 +121,6 @@ void bsp_spurious_initialize( void );
|
|||||||
|
|
||||||
extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
|
extern rtems_configuration_table BSP_Configuration; /* owned by BSP */
|
||||||
|
|
||||||
extern rtems_cpu_table Cpu_table; /* owned by BSP */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -34,8 +34,6 @@
|
|||||||
extern rtems_configuration_table Configuration;
|
extern rtems_configuration_table Configuration;
|
||||||
rtems_configuration_table BSP_Configuration;
|
rtems_configuration_table BSP_Configuration;
|
||||||
|
|
||||||
rtems_cpu_table Cpu_table;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Tells us where to put the workspace in case remote debugger is present.
|
* Tells us where to put the workspace in case remote debugger is present.
|
||||||
*/
|
*/
|
||||||
@@ -112,11 +110,6 @@ void bsp_start( void )
|
|||||||
{
|
{
|
||||||
unsigned char *work_space_start;
|
unsigned char *work_space_start;
|
||||||
|
|
||||||
/*
|
|
||||||
* This should be enough interrupt stack.
|
|
||||||
*/
|
|
||||||
Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
|
|
||||||
|
|
||||||
work_space_start =
|
work_space_start =
|
||||||
(unsigned char *)rdb_start - BSP_Configuration.work_space_size;
|
(unsigned char *)rdb_start - BSP_Configuration.work_space_size;
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,13 @@
|
|||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
|
|
||||||
extern rtems_configuration_table Configuration;
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
|
#define LEON3_TIMER_INDEX \
|
||||||
#define LEON3_TIMER_INDEX \
|
(rtems_configuration_get_user_multiprocessing_table() ? : \
|
||||||
(Configuration.User_multiprocessing_table ? \
|
(rtems_configuration_get_user_multiprocessing_table()->node) - 1 : 1)
|
||||||
(Configuration.User_multiprocessing_table)->maximum_nodes + \
|
#else
|
||||||
(Configuration.User_multiprocessing_table)->node - 1 : 1)
|
#define LEON3_TIMER_INDEX 0
|
||||||
|
#endif
|
||||||
|
|
||||||
rtems_boolean Timer_driver_Find_average_overhead;
|
rtems_boolean Timer_driver_Find_average_overhead;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user