diff options
author | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2008-07-18 15:56:48 +0000 |
---|---|---|
committer | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2008-07-18 15:56:48 +0000 |
commit | d3c321367c659f195f1bf03efc2ce5487e1848de (patch) | |
tree | a99c57117499eff7a5532fdd966c10dbd18dbeb5 /c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c | |
parent | typos. (diff) | |
download | rtems-d3c321367c659f195f1bf03efc2ce5487e1848de.tar.bz2 |
Changed special purpose register inline functions to macros.
fixed some minors in mpc83xx support
added file for mpc55xx watchdog support
Diffstat (limited to 'c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c')
-rw-r--r-- | c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c index bf6aae74ae..cc8ade43bd 100644 --- a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspstart.c @@ -91,29 +91,6 @@ void bsp_pretasking_hook( void) bsp_libc_init( BSP_heap_start, BSP_heap_end - BSP_heap_start, 0); } -void bsp_calc_mem_layout() -{ - size_t workspace_size = rtems_configuration_get_work_space_size(); - - /* We clear the workspace here */ - Configuration.do_zero_of_workspace = 0; - /* - TODO - mpc83xx_zero_4( bsp_workspace_start, workspace_size); - */ - mpc83xx_zero_4( bsp_interrupt_stack_start, bsp_ram_end - bsp_interrupt_stack_start); - - Configuration.work_space_start = bsp_workspace_start; - - BSP_heap_start = (char *) Configuration.work_space_start + workspace_size; - -#ifdef HAS_UBOOT - BSP_heap_end = mpc83xx_uboot_board_info.bi_memstart + mpc83xx_uboot_board_info.bi_memsize; -#else /* HAS_UBOOT */ - BSP_heap_end = bsp_ram_end; -#endif /* HAS_UBOOT */ -} - void bsp_start( void) { ppc_cpu_id_t myCpu; @@ -122,6 +99,8 @@ void bsp_start( void) uint32_t interrupt_stack_start = (uint32_t) bsp_interrupt_stack_start; uint32_t interrupt_stack_size = (uint32_t) bsp_interrupt_stack_size; + size_t workspace_size = rtems_configuration_get_work_space_size(); + /* * 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... @@ -129,12 +108,37 @@ void bsp_start( void) myCpu = get_ppc_cpu_type(); myCpuRevision = get_ppc_cpu_revision(); - /* Determine heap and workspace placement */ - bsp_calc_mem_layout(); - + /* Basic CPU initialization */ cpu_init(); /* + * 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 + + /* Clear the workspace */ + Configuration.do_zero_of_workspace = 0; + mpc83xx_zero_4( bsp_workspace_start, workspace_size); + + /* Workspace start */ + Configuration.work_space_start = bsp_workspace_start; + + /* Heap area */ + BSP_heap_start = (char *) Configuration.work_space_start + workspace_size; +#ifdef HAS_UBOOT + BSP_heap_end = mpc83xx_uboot_board_info.bi_memstart + mpc83xx_uboot_board_info.bi_memsize; +#else /* HAS_UBOOT */ + BSP_heap_end = bsp_ram_end; +#endif /* HAS_UBOOT */ + + /* * This is evaluated during runtime, so it should be ok to set it * before we initialize the drivers. */ @@ -149,18 +153,6 @@ void bsp_start( void) bsp_clicks_per_usec = BSP_bus_frequency / 4000000; - /* - * 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 - /* Initialize exception handler */ ppc_exc_initialize( PPC_INTERRUPT_DISABLE_MASK_DEFAULT, |