forked from Imagelibrary/rtems
2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the remaining CPU Table fields to the Configuration Table. This included pretasking_hook, predriver_hook, postdriver_hook, idle_task, do_zero_of_workspace, extra_mpci_receive_server_stack, stack_allocate_hook, and stack_free_hook. As a side-effect of this effort some multiprocessing code was made conditional and some style clean up occurred.
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the
|
||||
remaining CPU Table fields to the Configuration Table. This included
|
||||
pretasking_hook, predriver_hook, postdriver_hook, idle_task,
|
||||
do_zero_of_workspace, extra_mpci_receive_server_stack,
|
||||
stack_allocate_hook, and stack_free_hook. As a side-effect of this
|
||||
effort some multiprocessing code was made conditional and some style
|
||||
clean up occurred.
|
||||
|
||||
2007-09-12 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
PR 1257/bsps
|
||||
|
||||
@@ -28,6 +28,7 @@ dist_project_lib_DATA += startup/linkcmds
|
||||
|
||||
noinst_PROGRAMS += startup.rel
|
||||
startup_rel_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
|
||||
../../shared/bsppredriverhook.c \
|
||||
startup/bspstart.c startup/exit.c startup/memmap.c \
|
||||
../../shared/bootcard.c ../../shared/sbrk.c \
|
||||
../../shared/gnatinstallhandler.c
|
||||
|
||||
@@ -64,6 +64,15 @@ void gp32_setPalette( unsigned char pos, uint16_t color);
|
||||
/* How big should the interrupt stack be? */
|
||||
#define CONFIGURE_INTERRUPT_STACK_MEMORY (16 * 1024)
|
||||
|
||||
/*
|
||||
* This BSP provides its own IDLE task to override the RTEMS one.
|
||||
* So we prototype it and define the constant confdefs.h expects
|
||||
* to configure a BSP specific one.
|
||||
*/
|
||||
void bsp_idle_task(void);
|
||||
|
||||
#define BSP_IDLE_TASK_BODY bsp_idle_task
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -99,14 +99,6 @@ void bsp_start_default( void )
|
||||
uint32_t pend,last;
|
||||
uint32_t REFCNT;
|
||||
int i;
|
||||
/* If we don't have command line arguments set default program name. */
|
||||
|
||||
Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
|
||||
Cpu_table.predriver_hook = NULL; /* use system's */
|
||||
Cpu_table.postdriver_hook = bsp_postdriver_hook;
|
||||
Cpu_table.idle_task = bsp_idle_task;
|
||||
Cpu_table.interrupt_stack_size = 4096;
|
||||
Cpu_table.extra_mpci_receive_server_stack = 0;
|
||||
|
||||
/* stop RTC */
|
||||
rTICINT=0x0;
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the
|
||||
remaining CPU Table fields to the Configuration Table. This included
|
||||
pretasking_hook, predriver_hook, postdriver_hook, idle_task,
|
||||
do_zero_of_workspace, extra_mpci_receive_server_stack,
|
||||
stack_allocate_hook, and stack_free_hook. As a side-effect of this
|
||||
effort some multiprocessing code was made conditional and some style
|
||||
clean up occurred.
|
||||
|
||||
2007-11-03 Ray Xu <rayx.cn@gmail.com>
|
||||
|
||||
* start/start.S, startup/bspclean.c: Add veneer between ARM and
|
||||
|
||||
@@ -29,9 +29,9 @@ dist_project_lib_DATA += startup/linkcmds
|
||||
noinst_PROGRAMS += startup.rel
|
||||
include_HEADERS += ../../arm/shared/comm/uart.h
|
||||
startup_rel_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
|
||||
../../shared/bsppredriverhook.c \
|
||||
startup/bspstart.c startup/bspclean.c ../../shared/bootcard.c \
|
||||
../../shared/sbrk.c \
|
||||
../../shared/gnatinstallhandler.c
|
||||
../../shared/sbrk.c ../../shared/gnatinstallhandler.c
|
||||
startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
|
||||
|
||||
@@ -75,6 +75,7 @@ startup_rel-bootcard.o \
|
||||
startup_rel-bspclean.o \
|
||||
startup_rel-bsplibc.o \
|
||||
startup_rel-bsppost.o \
|
||||
startup_rel-bsppredriverhook.o \
|
||||
startup_rel-bspstart.o \
|
||||
startup_rel-sbrk.o
|
||||
|
||||
|
||||
@@ -121,15 +121,6 @@ extern "C" {
|
||||
// RTL8019AS definition
|
||||
#define RTL8019AS_BASE 0x82000000 //
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Define the interrupt mechanism for Time Test 27
|
||||
*
|
||||
* NOTE: Following are not defined and are board independent
|
||||
*
|
||||
*/
|
||||
struct rtems_bsdnet_ifconfig;
|
||||
int cs8900_driver_attach (struct rtems_bsdnet_ifconfig *config,
|
||||
int attaching);
|
||||
@@ -145,6 +136,11 @@ extern rtems_configuration_table BSP_Configuration;
|
||||
#define RTEMS_BSP_NETWORK_DRIVER_NAME "eth0"
|
||||
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH cs8900_driver_attach
|
||||
|
||||
/*
|
||||
* BSP Configuration Default Overrides
|
||||
*/
|
||||
#define BSP_ZERO_WORKSPACE_AUTOMATICALLY TRUE
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -184,11 +184,6 @@ void bsp_start_default( void )
|
||||
/* Setup interrupt controller.*/
|
||||
VICProtection = 0;
|
||||
|
||||
|
||||
Cpu_table.pretasking_hook = bsp_pretasking_hook;
|
||||
Cpu_table.postdriver_hook = bsp_postdriver_hook;
|
||||
Cpu_table.do_zero_of_workspace = TRUE;
|
||||
BSP_Configuration.microseconds_per_tick=100000;
|
||||
/* Place RTEMS workspace at beginning of free memory. */
|
||||
BSP_Configuration.work_space_start = (void *)&_bss_free_start;
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
2007-12-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am, include/bsp.h, startup/bspstart.c: Moved most of the
|
||||
remaining CPU Table fields to the Configuration Table. This included
|
||||
pretasking_hook, predriver_hook, postdriver_hook, idle_task,
|
||||
do_zero_of_workspace, extra_mpci_receive_server_stack,
|
||||
stack_allocate_hook, and stack_free_hook. As a side-effect of this
|
||||
effort some multiprocessing code was made conditional and some style
|
||||
clean up occurred.
|
||||
|
||||
2007-11-30 Till Straumann <strauman@slac.stanford.edu>
|
||||
|
||||
* startup/bspstart: removed _Cpu_table.exceptions_in_RAM.
|
||||
|
||||
@@ -34,7 +34,8 @@ startup_rel_SOURCES = startup/bspstart.c \
|
||||
../../powerpc/shared/startup/pgtbl_setup.c startup/pgtbl_activate.c \
|
||||
../../powerpc/shared/startup/pretaskinghook.c \
|
||||
../../powerpc/shared/startup/sbrk.c ../../shared/bootcard.c \
|
||||
startup/bspclean.c ../../shared/bsplibc.c ../../shared/bsppost.c \
|
||||
../../shared/bsppredriverhook.c startup/bspclean.c \
|
||||
../../shared/bsplibc.c ../../shared/bsppost.c \
|
||||
../../shared/gnatinstallhandler.c startup/reboot.c
|
||||
startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
|
||||
startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
|
||||
|
||||
@@ -123,6 +123,11 @@ extern unsigned int BSP_heap_start;
|
||||
extern int
|
||||
RTEMS_BSP_NETWORK_DRIVER_ATTACH(/* struct rtems_bsdnet_ifconfig * */);
|
||||
|
||||
/*
|
||||
* BSP Configuration Default Overrides
|
||||
*/
|
||||
#define BSP_ZERO_WORKSPACE_AUTOMATICALLY TRUE
|
||||
|
||||
/* As per Linux, This should be in the ppc/system.h */
|
||||
|
||||
static inline void memBar()
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*
|
||||
* Modified to support the MVME5500 board.
|
||||
* Also, the settings of L1, L2, and L3 caches is not necessary here.
|
||||
* (C) by Brookhaven National Lab., S. Kate Feng <feng1@bnl.gov>, 2003, 2004, 2005
|
||||
* (C) by Brookhaven National Lab., S. Kate Feng <feng1@bnl.gov>, 2003-2007
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
@@ -78,19 +78,19 @@ SPR_RW(SPRG0)
|
||||
SPR_RW(SPRG1)
|
||||
|
||||
typedef struct CmdLineRec_ {
|
||||
unsigned long size;
|
||||
char buf[0];
|
||||
unsigned long size;
|
||||
char buf[0];
|
||||
} CmdLineRec, *CmdLine;
|
||||
|
||||
|
||||
#define mtspr(reg, val) \
|
||||
__asm __volatile("mtspr %0,%1" : : "K"(reg), "r"(val))
|
||||
#define mtspr(reg, val) \
|
||||
__asm __volatile("mtspr %0,%1" : : "K"(reg), "r"(val))
|
||||
|
||||
|
||||
#define mfspr(reg) \
|
||||
( { unsigned val; \
|
||||
__asm __volatile("mfspr %0,%1" : "=r"(val) : "K"(reg)); \
|
||||
val; } )
|
||||
#define mfspr(reg) \
|
||||
( { unsigned val; \
|
||||
__asm __volatile("mfspr %0,%1" : "=r"(val) : "K"(reg)); \
|
||||
val; } )
|
||||
|
||||
/*
|
||||
* Copy Additional boot param passed by boot loader
|
||||
@@ -121,7 +121,7 @@ unsigned int BSP_processor_frequency;
|
||||
unsigned int BSP_time_base_divisor;
|
||||
unsigned char ConfVPD_buff[200];
|
||||
|
||||
#define CMDLINE_BUF_SIZE 2048
|
||||
#define CMDLINE_BUF_SIZE 2048
|
||||
|
||||
static char cmdline_buf[CMDLINE_BUF_SIZE];
|
||||
char *BSP_commandline_string = cmdline_buf;
|
||||
@@ -172,9 +172,22 @@ void zero_bss()
|
||||
/* prevent these from being accessed in the short data areas */
|
||||
extern unsigned long __bss_start[], __SBSS_START__[], __SBSS_END__[];
|
||||
extern unsigned long __SBSS2_START__[], __SBSS2_END__[];
|
||||
memset(__SBSS_START__, 0, ((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__));
|
||||
memset(__SBSS2_START__, 0, ((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__));
|
||||
memset(__bss_start, 0, ((unsigned) __rtems_end) - ((unsigned)__bss_start));
|
||||
|
||||
memset(
|
||||
__SBSS_START__,
|
||||
0,
|
||||
((unsigned) __SBSS_END__) - ((unsigned)__SBSS_START__)
|
||||
);
|
||||
memset(
|
||||
__SBSS2_START__,
|
||||
0,
|
||||
((unsigned) __SBSS2_END__) - ((unsigned)__SBSS2_START__)
|
||||
);
|
||||
memset(
|
||||
__bss_start,
|
||||
0,
|
||||
((unsigned) __rtems_end) - ((unsigned)__bss_start)
|
||||
);
|
||||
}
|
||||
|
||||
/* NOTE: we cannot simply malloc the commandline string;
|
||||
@@ -213,15 +226,23 @@ void zero_bss()
|
||||
* and must be safe with a not properly aligned stack
|
||||
*/
|
||||
void
|
||||
save_boot_params(void *r3, void *r4, void* r5, char *cmdline_start, char *cmdline_end)
|
||||
save_boot_params(
|
||||
void *r3,
|
||||
void *r4,
|
||||
void* r5,
|
||||
char *cmdline_start,
|
||||
char *cmdline_end
|
||||
)
|
||||
{
|
||||
int i=cmdline_end-cmdline_start;
|
||||
if ( i >= CMDLINE_BUF_SIZE )
|
||||
i = CMDLINE_BUF_SIZE-1;
|
||||
else if ( i < 0 )
|
||||
i = 0;
|
||||
memmove(cmdline_buf, cmdline_start, i);
|
||||
cmdline_buf[i]=0;
|
||||
int i=cmdline_end-cmdline_start;
|
||||
|
||||
if ( i >= CMDLINE_BUF_SIZE )
|
||||
i = CMDLINE_BUF_SIZE-1;
|
||||
else if ( i < 0 )
|
||||
i = 0;
|
||||
|
||||
memmove(cmdline_buf, cmdline_start, i);
|
||||
cmdline_buf[i]=0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -236,7 +257,7 @@ void bsp_start( void )
|
||||
int i;
|
||||
#endif
|
||||
unsigned char *stack;
|
||||
unsigned long *r1sp;
|
||||
unsigned long *r1sp;
|
||||
#ifdef SHOW_LCR1_REGISTER
|
||||
unsigned l1cr;
|
||||
#endif
|
||||
@@ -251,7 +272,7 @@ void bsp_start( void )
|
||||
unsigned char *work_space_start;
|
||||
ppc_cpu_id_t myCpu;
|
||||
ppc_cpu_revision_t myCpuRevision;
|
||||
Triv121PgTbl pt=0;
|
||||
Triv121PgTbl pt=0;
|
||||
|
||||
/* Till Straumann: 4/2005
|
||||
* Need to map the system registers early, so we can printk...
|
||||
@@ -274,7 +295,7 @@ void bsp_start( void )
|
||||
* 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...
|
||||
*/
|
||||
myCpu = get_ppc_cpu_type();
|
||||
myCpu = get_ppc_cpu_type();
|
||||
myCpuRevision = get_ppc_cpu_revision();
|
||||
|
||||
#ifdef SHOW_LCR1_REGISTER
|
||||
@@ -287,15 +308,16 @@ void bsp_start( void )
|
||||
* so there is no need to set it in r1 again... It is just for info
|
||||
* so that it can be printed without accessing R1.
|
||||
*/
|
||||
stack = ((unsigned char*) __rtems_end) + INIT_STACK_SIZE - PPC_MINIMUM_STACK_FRAME_SIZE;
|
||||
stack = ((unsigned char*) __rtems_end) +
|
||||
INIT_STACK_SIZE - PPC_MINIMUM_STACK_FRAME_SIZE;
|
||||
|
||||
/* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
|
||||
/* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
|
||||
*((uint32_t *)stack) = 0;
|
||||
|
||||
/* fill stack with pattern for debugging */
|
||||
__asm__ __volatile__("mr %0, %%r1":"=r"(r1sp));
|
||||
while (--r1sp >= (unsigned long*)__rtems_end)
|
||||
*r1sp=0xeeeeeeee;
|
||||
*r1sp=0xeeeeeeee;
|
||||
|
||||
/*
|
||||
* Initialize the interrupt related settings
|
||||
@@ -323,6 +345,7 @@ void bsp_start( void )
|
||||
* Initialize default raw exception hanlders. See vectors/vectors_init.c
|
||||
*/
|
||||
initialize_exceptions();
|
||||
|
||||
/*
|
||||
* Init MMU block address translation to enable hardware
|
||||
* access
|
||||
@@ -354,12 +377,15 @@ void bsp_start( void )
|
||||
__asm__ __volatile ("sc");
|
||||
#endif
|
||||
|
||||
BSP_mem_size = _512M;
|
||||
/* TODO: calculate the BSP_bus_frequency using the REF_CLK bit of System Status register */
|
||||
BSP_mem_size = _512M;
|
||||
/* TODO: calculate the BSP_bus_frequency using the REF_CLK bit
|
||||
* of System Status register
|
||||
*/
|
||||
/* rtems_bsp_delay_in_bus_cycles are defined in registers.h */
|
||||
BSP_bus_frequency = 133333333;
|
||||
BSP_processor_frequency = 1000000000;
|
||||
BSP_time_base_divisor = 4000;/* P94 : 7455 clocks the TB/DECR at 1/4 of the system bus clock frequency */
|
||||
BSP_bus_frequency = 133333333;
|
||||
BSP_processor_frequency = 1000000000;
|
||||
/* P94 : 7455 clocks the TB/DECR at 1/4 of the system bus clock frequency */
|
||||
BSP_time_base_divisor = 4000;
|
||||
|
||||
|
||||
/* Maybe not setup yet becuase of the warning message */
|
||||
@@ -382,19 +408,21 @@ void bsp_start( void )
|
||||
* they can use atexit()
|
||||
*/
|
||||
|
||||
Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
|
||||
Cpu_table.postdriver_hook = bsp_postdriver_hook;
|
||||
Cpu_table.do_zero_of_workspace = TRUE;
|
||||
Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
|
||||
/* P94 : 7455 TB/DECR is clocked by the system bus clock frequency */
|
||||
_CPU_Table = Cpu_table;/* S. Kate Feng <feng1@bnl.gov>, for rtems_bsp_delay() */
|
||||
|
||||
bsp_clicks_per_usec = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
|
||||
printk("BSP_Configuration.work_space_size = %x\n", BSP_Configuration.work_space_size);
|
||||
bsp_clicks_per_usec = BSP_bus_frequency/(BSP_time_base_divisor * 1000);
|
||||
|
||||
printk(
|
||||
"BSP_Configuration.work_space_size = %x\n",
|
||||
BSP_Configuration.work_space_size
|
||||
);
|
||||
|
||||
work_space_start =
|
||||
(unsigned char *)BSP_mem_size - BSP_Configuration.work_space_size;
|
||||
|
||||
if ( work_space_start <= ((unsigned char *)__rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE) {
|
||||
if ( work_space_start <=
|
||||
((unsigned char *)__rtems_end) + INIT_STACK_SIZE + INTR_STACK_SIZE) {
|
||||
printk( "bspstart: Not enough RAM!!!\n" );
|
||||
bsp_cleanup();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user