diff options
author | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2009-10-23 07:32:46 +0000 |
---|---|---|
committer | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2009-10-23 07:32:46 +0000 |
commit | 2d2de4eba16374ea05fc7ee9cd257ad0d4ebf2ca (patch) | |
tree | 45161e8d9a9d0a9c483b84d915085c0230b09ea0 /c/src/lib/libbsp/powerpc/mbx8xx/startup | |
parent | 2009-10-23 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-2d2de4eba16374ea05fc7ee9cd257ad0d4ebf2ca.tar.bz2 |
Update for exception support changes.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/mbx8xx/startup')
-rw-r--r-- | c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c | 39 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds | 80 |
2 files changed, 60 insertions, 59 deletions
diff --git a/c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c index b04323b118..2450f4f83f 100644 --- a/c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/mbx8xx/startup/bspstart.c @@ -18,8 +18,6 @@ * $Id$ */ -#warning The interrupt disable mask is now stored in SPRG0, please verify that this is compatible to this BSP (see also bootcard.c). - #include <bsp.h> #include <bsp/irq.h> #include <rtems/bspIo.h> @@ -29,8 +27,6 @@ SPR_RW(SPRG1) -extern unsigned long intrStackPtr; - /* * Driver configuration parameters */ @@ -45,6 +41,9 @@ uint32_t bsp_timer_average_overhead; /* Average overhead of timer in ticks */ uint32_t bsp_timer_least_valid; /* Least valid number from timer */ bool bsp_timer_internal_clock; /* TRUE, when timer runs with CPU clk */ +extern char IntrStack_start []; +extern char intrStack []; + void BSP_panic(char *s) { printk("%s PANIC %s\n",_RTEMS_version, s); @@ -83,9 +82,9 @@ void _BSP_Fatal_error(unsigned int v) */ void bsp_start(void) { + rtems_status_code sc = RTEMS_SUCCESSFUL; ppc_cpu_id_t myCpu; ppc_cpu_revision_t myCpuRevision; - register unsigned char* intrStack; /* * Get CPU identification dynamically. Note that the get_ppc_cpu_type() function @@ -112,17 +111,22 @@ void bsp_start(void) rtems_cache_enable_data(); #endif #endif - /* - * Initialize some SPRG registers related to irq handling - */ - intrStack = (((unsigned char*)&intrStackPtr) - PPC_MINIMUM_STACK_FRAME_SIZE); - _write_SPRG1((unsigned int)intrStack); - - /* - * Install our own set of exception vectors - */ - initialize_exceptions(); + /* Initialize exception handler */ + sc = ppc_exc_initialize( + PPC_INTERRUPT_DISABLE_MASK_DEFAULT, + (uintptr_t) IntrStack_start, + (uintptr_t) intrStack - (uintptr_t) IntrStack_start + ); + if ( sc != RTEMS_SUCCESSFUL ) { + BSP_panic( "cannot initialize exceptions" ); + } + + /* Initalize interrupt support */ + sc = bsp_interrupt_initialize(); + if ( sc != RTEMS_SUCCESSFUL ) { + BSP_panic( "cannot initialize interrupts" ); + } /* * initialize the device driver parameters @@ -165,10 +169,7 @@ void bsp_start(void) m8xx.scc2p.rbase=0; m8xx.scc2p.tbase=0; m8xx_cp_execute_cmd( M8xx_CR_OP_STOP_TX | M8xx_CR_CHAN_SCC2 ); - /* - * Initalize RTEMS IRQ system - */ - BSP_rtems_irq_mng_init(0); + #ifdef SHOW_MORE_INIT_SETTINGS printk("Exit from bspstart\n"); #endif diff --git a/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds b/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds index a090366a4d..85b0b133b5 100644 --- a/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds +++ b/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds @@ -21,13 +21,13 @@ RamSize = DEFINED(RamSize) ? RamSize : 4M; HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; MEMORY - { - ram : org = 0x0, l = 4M - nvram : org = 0xfa000000, l = 32K - dpram : org = 0xfa200000, l = 16K - flash : org = 0xfc000000, l = 2M - immr : org = 0xfa200000, l = 16K - } + { + ram : org = 0x0, l = 4M + nvram : org = 0xfa000000, l = 32K + dpram : org = 0xfa200000, l = 16K + flash : org = 0xfc000000, l = 2M + immr : org = 0xfa200000, l = 16K + } SECTIONS @@ -45,7 +45,7 @@ SECTIONS * The stack will live in this area - between the vectors and * the text section. */ - + .text 0x10000: { /* Read-only sections, merged into text segment: */ @@ -58,10 +58,10 @@ SECTIONS /* Actual code */ *(.text*) - + /* C++ constructors/destructors */ *(.gnu.linkonce.t*) - + /* Initialization and finalization code. * * Various files can provide initialization and finalization functions. @@ -91,14 +91,14 @@ SECTIONS * end terminate with a NULL entry. */ - PROVIDE (__CTOR_LIST__ = .); + PROVIDE (__CTOR_LIST__ = .); /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */ *crtbegin.o(.ctors) *(.ctors) *crtend.o(.ctors) LONG(0) PROVIDE (__CTOR_END__ = .); - + PROVIDE (__DTOR_LIST__ = .); /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */ *crtbegin.o(.dtors) @@ -106,7 +106,7 @@ SECTIONS *crtend.o(.dtors) LONG(0) PROVIDE (__DTOR_END__ = .); - + /* * Special FreeBSD sysctl sections. */ @@ -192,12 +192,6 @@ SECTIONS *(.data.*) *(.data1) - PROVIDE (__SDATA_START__ = .); - *(.sdata*) - *(.gnu.linkonce.d*) - *(.gnu.linkonce.s.*) - PROVIDE (__SDATA_END__ = .); - PROVIDE (__EXCEPT_START__ = .); *(.gcc_except_table*) PROVIDE (__EXCEPT_END__ = .); @@ -206,7 +200,7 @@ SECTIONS *(.got.plt) *(.got) PROVIDE(__GOT_END__ = .); - + *(.got1) PROVIDE (__GOT2_START__ = .); @@ -214,40 +208,46 @@ SECTIONS *(.got2) PROVIDE (__GOT2_END__ = .); PROVIDE (_GOT2_END_ = .); - + PROVIDE (__FIXUP_START__ = .); PROVIDE (_FIXUP_START_ = .); *(.fixup) PROVIDE (_FIXUP_END_ = .); PROVIDE (__FIXUP_END__ = .); + } > ram + + .sdata : { + PROVIDE (_SDA_BASE_ = 32768); + *(.sdata .sdata.* .gnu.linkonce.s.*) + } > ram - /* We want the small data sections together, so single-instruction offsets - * can access them all. - */ - PROVIDE (__SDATA2_START__ = .); - *(.sdata2) - *(.gnu.linkonce.s2.*) - *(.sbss2) - PROVIDE (__SDATA2_END__ = .); + .sbss : { + __bss_start = .; + + PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .); + *(.scommon) + *(.dynsbss) + *(.sbss .sbss.* .gnu.linkonce.sb.*) + PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); } > ram - - + + .sdata2 : { + PROVIDE (_SDA2_BASE_ = 32768); + + *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) + } > ram =0 + + .sbss2 : { + *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) + } > ram =0 + .bss : { - PROVIDE (__SBSS_START__ = .); - - PROVIDE (__SBSS2_START__ = .); - *(.sbss2) - PROVIDE (__SBSS2_END__ = .); - bss.start = .; *(.bss .bss* .gnu.linkonce.b*) - *(.sbss*) *(COMMON) . = ALIGN(4); bss.end = .; - - PROVIDE (__SBSS_END__ = .); } > ram |