diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-10-05 19:24:48 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-10-05 19:24:48 +0000 |
commit | d490fff3c16c83205e7beb7a83fb4d8ca70485a7 (patch) | |
tree | 5b985f3923f6adf70786a1142852b0b263a8ae2a | |
parent | 2005-10-05 Jiri Gaisler <jiri@gaisler.com> (diff) | |
download | rtems-d490fff3c16c83205e7beb7a83fb4d8ca70485a7.tar.bz2 |
2005-10-05 Jiri Gaisler <jiri@gaisler.com>
Edvin Catovic <edvin@gaisler.com>
Konrad Eisele <konrad@gaisler.com>
PR 827/bsps
* Makefile.am, bspstart.c, gnatcommon.c, start.S: Portion of large
update of SPARC BSPs. Includes addition of sis, leon2 and leon3 BSPs,
deletion of leon BSP, addition of SMC91111 NIC driver and much more.
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/ChangeLog | 9 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/Makefile.am | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/bspstart.c | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/gnatcommon.c | 1 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/start.S | 61 |
5 files changed, 70 insertions, 7 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/ChangeLog b/c/src/lib/libbsp/sparc/shared/ChangeLog index dcfa275684..2de0c41b99 100644 --- a/c/src/lib/libbsp/sparc/shared/ChangeLog +++ b/c/src/lib/libbsp/sparc/shared/ChangeLog @@ -1,3 +1,12 @@ +2005-10-05 Jiri Gaisler <jiri@gaisler.com> + Edvin Catovic <edvin@gaisler.com> + Konrad Eisele <konrad@gaisler.com> + + PR 827/bsps + * Makefile.am, bspstart.c, gnatcommon.c, start.S: Portion of large + update of SPARC BSPs. Includes addition of sis, leon2 and leon3 BSPs, + deletion of leon BSP, addition of SMC91111 NIC driver and much more. + 2003-09-04 Joel Sherrill <joel@OARcorp.com> * bspclean.c, bspstart.c: URL for license changed. diff --git a/c/src/lib/libbsp/sparc/shared/Makefile.am b/c/src/lib/libbsp/sparc/shared/Makefile.am index c005e618ff..0a57377727 100644 --- a/c/src/lib/libbsp/sparc/shared/Makefile.am +++ b/c/src/lib/libbsp/sparc/shared/Makefile.am @@ -3,6 +3,6 @@ ## -EXTRA_DIST = bspclean.c bspstart.c gnatcommon.c start.S +EXTRA_DIST = bspclean.c gnatcommon.c start.S include $(top_srcdir)/../../../../../automake/local.am diff --git a/c/src/lib/libbsp/sparc/shared/bspstart.c b/c/src/lib/libbsp/sparc/shared/bspstart.c index f37ea7b55f..26a0e5a684 100644 --- a/c/src/lib/libbsp/sparc/shared/bspstart.c +++ b/c/src/lib/libbsp/sparc/shared/bspstart.c @@ -198,8 +198,8 @@ void bsp_start( void ) Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY; - work_space_start = - (unsigned char *)rdb_start - BSP_Configuration.work_space_size; + work_space_start = (unsigned char *)rdb_start; + work_space_start -= BSP_Configuration.work_space_size; if ( work_space_start <= (unsigned char *)&end ) { DEBUG_puts( "bspstart: Not enough RAM!!!\n" ); diff --git a/c/src/lib/libbsp/sparc/shared/gnatcommon.c b/c/src/lib/libbsp/sparc/shared/gnatcommon.c index 522a5c8096..751f6f3ee8 100644 --- a/c/src/lib/libbsp/sparc/shared/gnatcommon.c +++ b/c/src/lib/libbsp/sparc/shared/gnatcommon.c @@ -3,6 +3,7 @@ * Support for gnat/rtems interrupts and exception handling. * Jiri Gaisler, ESA/ESTEC, 17-02-1999. * + * $Id$ */ #include <bsp.h> diff --git a/c/src/lib/libbsp/sparc/shared/start.S b/c/src/lib/libbsp/sparc/shared/start.S index 2d17a8a8b8..eb67eb358b 100644 --- a/c/src/lib/libbsp/sparc/shared/start.S +++ b/c/src/lib/libbsp/sparc/shared/start.S @@ -11,6 +11,7 @@ */ #include <asm.h> +#include <bspopts.h> /* * Unexpected trap will halt the processor by forcing it to error state @@ -216,10 +217,6 @@ SYM(hard_reset): nop nop - call __bsp_board_init - nop - - set (SYM(rdb_start)), %g6 ! End of work-space area st %sp, [%g6] set (SYM(Configuration)), %l1 @@ -230,6 +227,62 @@ SYM(hard_reset): mov %sp, %fp ! Set frame pointer nop +#if ENABLE_SIS_QUIRKS==1 + +#include <erc32.h> + +/* Check if MEC is initialised. If not, this means that we are + running on the simulator. Initiate some of the parameters + that are done by the boot-prom otherwise. +*/ + + set SYM(ERC32_MEC), %g3 ! g3 = base address of peripherals + ld [%g3], %g2 + set 0xfe080000, %g1 + andcc %g1, %g2, %g0 + bne 2f + + /* Set the correct memory size in MEC memory config register */ + + set SYM(PROM_SIZE), %l0 + set 0, %l1 + srl %l0, 18, %l0 +1: + tst %l0 + srl %l0, 1, %l0 + bne,a 1b + inc %l1 + sll %l1, 8, %l1 + + set SYM(RAM_SIZE), %l0 + srl %l0, 19, %l0 +1: + tst %l0 + srl %l0, 1, %l0 + bne,a 1b + inc %l1 + sll %l1, 10, %l1 + + ! set the Memory Configuration + st %l1, [ %g3 + ERC32_MEC_MEMORY_CONFIGURATION_OFFSET ] + !DISABLE THE HARDWARE WATCHDOG + st %g0, [ %g3 + ERC32_MEC_WATCHDOG_TRAP_DOOR_SET_OFFSET ] + !Reduce the number of wait states to 0 for all memory areas. + st %g0, [ %g3 + ERC32_MEC_WAIT_STATE_CONFIGURATION_OFFSET ] + + set SYM(RAM_START), %l1 ! Cannot use RAM_END due to bug in linker + set SYM(RAM_SIZE), %l2 + add %l1, %l2, %sp + st %sp, [%g6] + + + set SYM(CLOCK_SPEED), %g6 ! Use 14 MHz in simulator + set 14, %g1 + st %g1, [%g6] + +2: +#endif + /* * Copy the initialized data to RAM * |