1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * MRM332 Assembly Start Up Code |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * COPYRIGHT (c) 2000. |
---|
9 | * Matt Cross <profesor@gweep.net> |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.org/license/LICENSE. |
---|
14 | * |
---|
15 | */ |
---|
16 | |
---|
17 | #include "mrm332.h" |
---|
18 | #include <rtems/asm.h> |
---|
19 | #include <rtems/m68k/sim.h> |
---|
20 | |
---|
21 | BEGIN_CODE |
---|
22 | |
---|
23 | /* Put the header necessary for the modified CPU32bug to automatically |
---|
24 | start up rtems: */ |
---|
25 | #if 1 |
---|
26 | .long 0xbeefbeef ; |
---|
27 | #endif |
---|
28 | .long 0 ; |
---|
29 | .long start ; |
---|
30 | |
---|
31 | .global start |
---|
32 | start: |
---|
33 | |
---|
34 | oriw #0x0700,sr /* Mask off interupts */ |
---|
35 | |
---|
36 | // Set VBR to CPU32Bug vector table address |
---|
37 | movel #0x0,d0 /* Use the initial vectors until we get going */ |
---|
38 | movecl d0,vbr |
---|
39 | |
---|
40 | movel #end, d0 /* Next 3 instructions set stack pointer */ |
---|
41 | addl #_StackSize,d0 /* sp = end + _StackSize from linker script */ |
---|
42 | movel d0,sp |
---|
43 | movel d0,a6 |
---|
44 | |
---|
45 | /* include in ram_init.S */ |
---|
46 | /* |
---|
47 | * Initalize the SIM module. |
---|
48 | * The stack pointer is not usable until the RAM chip select lines |
---|
49 | * are configured. The following code must remain inline. |
---|
50 | */ |
---|
51 | |
---|
52 | /* Module Configuration Register */ |
---|
53 | /* see section(s) 3.1.3-3.1.6 of the SIM Reference Manual */ |
---|
54 | /* SIMCR etc and SAM macro all defined in sim.h found at */ |
---|
55 | /* /cpukit/score/cpu/m68k/rtems/m68k/sim.h */ |
---|
56 | /* The code below does the following: */ |
---|
57 | /* - Sets Freeze Software Enable */ |
---|
58 | /* - Turns off Show Cycle Enable */ |
---|
59 | /* - Sets the location of SIM module mapping */ |
---|
60 | /* - Sets the SIM Interrupt Arbitration Field */ |
---|
61 | lea SIMCR, a0 |
---|
62 | movew #FRZSW,d0 |
---|
63 | oriw #SAM(0,8,SHEN),d0 |
---|
64 | oriw #(MM*SIM_MM),d0 |
---|
65 | oriw #SAM(SIM_IARB,0,IARB),d0 |
---|
66 | movew d0, a0@ |
---|
67 | |
---|
68 | jsr start_c /* Jump to the C startup code */ |
---|
69 | |
---|
70 | END_CODE |
---|
71 | |
---|