summaryrefslogtreecommitdiffstats
path: root/bsps/m68k/mrm332/start/start.S
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/m68k/mrm332/start/start.S')
-rw-r--r--bsps/m68k/mrm332/start/start.S71
1 files changed, 71 insertions, 0 deletions
diff --git a/bsps/m68k/mrm332/start/start.S b/bsps/m68k/mrm332/start/start.S
new file mode 100644
index 0000000000..5e2bbebc8e
--- /dev/null
+++ b/bsps/m68k/mrm332/start/start.S
@@ -0,0 +1,71 @@
+/**
+ * @file
+ *
+ * MRM332 Assembly Start Up Code
+ */
+
+/*
+ * COPYRIGHT (c) 2000.
+ * Matt Cross <profesor@gweep.net>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ *
+ */
+
+#include "mrm332.h"
+#include <rtems/asm.h>
+#include <rtems/m68k/sim.h>
+
+BEGIN_CODE
+
+ /* Put the header necessary for the modified CPU32bug to automatically
+ start up rtems: */
+#if 1
+.long 0xbeefbeef ;
+#endif
+.long 0 ;
+.long start ;
+
+.global start
+ start:
+
+ oriw #0x0700,sr /* Mask off interupts */
+
+ // Set VBR to CPU32Bug vector table address
+ movel #0x0,d0 /* Use the initial vectors until we get going */
+ movecl d0,vbr
+
+ movel #end, d0 /* Next 3 instructions set stack pointer */
+ addl #_StackSize,d0 /* sp = end + _StackSize from linker script */
+ movel d0,sp
+ movel d0,a6
+
+ /* include in ram_init.S */
+ /*
+ * Initalize the SIM module.
+ * The stack pointer is not usable until the RAM chip select lines
+ * are configured. The following code must remain inline.
+ */
+
+ /* Module Configuration Register */
+ /* see section(s) 3.1.3-3.1.6 of the SIM Reference Manual */
+ /* SIMCR etc and SAM macro all defined in sim.h found at */
+ /* /cpukit/score/cpu/m68k/rtems/m68k/sim.h */
+ /* The code below does the following: */
+ /* - Sets Freeze Software Enable */
+ /* - Turns off Show Cycle Enable */
+ /* - Sets the location of SIM module mapping */
+ /* - Sets the SIM Interrupt Arbitration Field */
+ lea SIMCR, a0
+ movew #FRZSW,d0
+ oriw #SAM(0,8,SHEN),d0
+ oriw #(MM*SIM_MM),d0
+ oriw #SAM(SIM_IARB,0,IARB),d0
+ movew d0, a0@
+
+ jsr start_c /* Jump to the C startup code */
+
+END_CODE
+