Index: c/src/lib/libbsp/sparc/shared/ChangeLog
===================================================================
--- c/src/lib/libbsp/sparc/shared/ChangeLog	(revision e75e10dcac9b6e049f1342ca28e293da6c252dec)
+++ c/src/lib/libbsp/sparc/shared/ChangeLog	(revision d490fff3c16c83205e7beb7a83fb4d8ca70485a7)
@@ -1,2 +1,11 @@
+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>
 
Index: c/src/lib/libbsp/sparc/shared/Makefile.am
===================================================================
--- c/src/lib/libbsp/sparc/shared/Makefile.am	(revision e75e10dcac9b6e049f1342ca28e293da6c252dec)
+++ c/src/lib/libbsp/sparc/shared/Makefile.am	(revision d490fff3c16c83205e7beb7a83fb4d8ca70485a7)
@@ -4,5 +4,5 @@
 
 
-EXTRA_DIST = bspclean.c bspstart.c gnatcommon.c start.S
+EXTRA_DIST = bspclean.c gnatcommon.c start.S
 
 include $(top_srcdir)/../../../../../automake/local.am
Index: c/src/lib/libbsp/sparc/shared/bspstart.c
===================================================================
--- c/src/lib/libbsp/sparc/shared/bspstart.c	(revision e75e10dcac9b6e049f1342ca28e293da6c252dec)
+++ c/src/lib/libbsp/sparc/shared/bspstart.c	(revision d490fff3c16c83205e7beb7a83fb4d8ca70485a7)
@@ -199,6 +199,6 @@
   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 ) {
Index: c/src/lib/libbsp/sparc/shared/gnatcommon.c
===================================================================
--- c/src/lib/libbsp/sparc/shared/gnatcommon.c	(revision e75e10dcac9b6e049f1342ca28e293da6c252dec)
+++ c/src/lib/libbsp/sparc/shared/gnatcommon.c	(revision d490fff3c16c83205e7beb7a83fb4d8ca70485a7)
@@ -4,4 +4,5 @@
  * Jiri Gaisler, ESA/ESTEC, 17-02-1999.
  *
+ *  $Id$
  */
 
Index: c/src/lib/libbsp/sparc/shared/start.S
===================================================================
--- c/src/lib/libbsp/sparc/shared/start.S	(revision e75e10dcac9b6e049f1342ca28e293da6c252dec)
+++ c/src/lib/libbsp/sparc/shared/start.S	(revision d490fff3c16c83205e7beb7a83fb4d8ca70485a7)
@@ -12,4 +12,5 @@
 
 #include <asm.h>
+#include <bspopts.h>
 
 /*
@@ -217,8 +218,4 @@
         nop
 
-	call	__bsp_board_init
-	nop
-
-
 	set	(SYM(rdb_start)), %g6	! End of work-space area
 	st	%sp, [%g6]
@@ -230,4 +227,60 @@
         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	
 
         /*
