]> nv-tegra.nvidia Code Review - linux-2.6.git/blob - arch/m68knommu/platform/68328/head-ram.S
6bdc9bce43f2c11ca9821bebe88d1bcc65f1340e
[linux-2.6.git] / arch / m68knommu / platform / 68328 / head-ram.S
1 #include <linux/config.h>
2
3         .global __main
4         .global __ram_start
5         .global __ram_end
6         .global __rom_start
7         .global __rom_end
8
9         .global _rambase
10         .global _ramstart
11         
12         .global splash_bits
13         .global _start
14         .global _stext
15
16 #define DEBUG
17 #define ROM_OFFSET 0x10C00000
18 #define STACK_GAURD 0x10
19
20         .text
21         
22 _start:
23 _stext:
24         movew   #0x2700, %sr            /* Exceptions off! */
25
26 #if 0
27         /* Init chip registers.  uCsimm specific */
28         moveb   #0x00,   0xfffffb0b     /* Watchdog off */
29         moveb   #0x10,   0xfffff000     /* SCR */
30
31         movew   #0x2400, 0xfffff200     /* PLLCR */
32         movew   #0x0123, 0xfffff202     /* PLLFSR */
33
34         moveb   #0x00,   0xfffff40b     /* enable chip select */
35         moveb   #0x00,   0xfffff423     /* enable /DWE */
36         moveb   #0x08,   0xfffffd0d     /* disable hardmap */
37         moveb   #0x07,   0xfffffd0e     /* level 7 interrupt clear */
38
39         movew   #0x8600, 0xfffff100     /* FLASH at 0x10c00000 */
40         movew   #0x018b, 0xfffff110     /* 2Meg, enable, 0ws */
41
42         movew   #0x8f00, 0xfffffc00     /* DRAM configuration */
43         movew   #0x9667, 0xfffffc02     /* DRAM control */
44         movew   #0x0000, 0xfffff106     /* DRAM at 0x00000000 */
45         movew   #0x068f, 0xfffff116     /* 8Meg, enable, 0ws */
46
47         moveb   #0x40,   0xfffff300     /* IVR */
48         movel   #0x007FFFFF, %d0        /* IMR */
49         movel   %d0,     0xfffff304
50
51         moveb   0xfffff42b, %d0
52         andb    #0xe0,   %d0
53         moveb   %d0,     0xfffff42b
54
55         moveb   #0x08,   0xfffff907     /* Ignore CTS */
56         movew   #0x010b, 0xfffff902     /* BAUD to 9600 */
57         movew   #0xe100, 0xfffff900     /* enable */
58 #endif
59
60         movew   #16384, %d0  /* PLL settle wait loop */
61 L0:
62         subw    #1, %d0
63         bne     L0
64 #ifdef DEBUG
65         moveq   #70, %d7                /* 'F' */
66         moveb   %d7,0xfffff907          /* No absolute addresses */
67 pclp1:
68         movew   0xfffff906, %d7
69         andw    #0x2000, %d7
70         beq     pclp1
71 #endif /* DEBUG */
72
73 #ifdef CONFIG_RELOCATE
74         /* Copy me to RAM */
75         moveal  #__rom_start, %a0
76         moveal  #__ram_start, %a1
77         moveal  #_edata, %a2
78
79         /* Copy %a0 to %a1 until %a1 == %a2 */
80 LD1:
81         movel   %a0@+, %d0
82         movel   %d0, %a1@+
83         cmpal   %a1, %a2
84         bhi     LD1
85         
86 #ifdef DEBUG
87         moveq   #74, %d7                /* 'J' */
88         moveb   %d7,0xfffff907          /* No absolute addresses */
89 pclp2:
90         movew   0xfffff906, %d7
91         andw    #0x2000, %d7
92         beq     pclp2
93 #endif /* DEBUG */
94         /* jump into the RAM copy */
95         jmp     ram_jump
96 ram_jump:
97
98 #endif /* CONFIG_RELOCATE */
99
100 #ifdef DEBUG
101         moveq   #82, %d7                /* 'R' */
102         moveb   %d7,0xfffff907          /* No absolute addresses */
103 pclp3:
104         movew   0xfffff906, %d7
105         andw    #0x2000, %d7
106         beq     pclp3
107 #endif /* DEBUG */
108         moveal  #0x007ffff0, %ssp
109         moveal  #_sbss, %a0
110         moveal  #_ebss, %a1
111
112         /* Copy 0 to %a0 until %a0 >= %a1 */
113 L1:
114         movel   #0, %a0@+
115         cmpal   %a0, %a1
116         bhi     L1
117
118 #ifdef DEBUG
119         moveq   #67, %d7                /* 'C' */
120         jsr     putc
121 #endif /* DEBUG */
122
123         pea     0
124         pea     env
125         pea     %sp@(4)
126         pea     0
127
128 #ifdef DEBUG
129         moveq   #70, %d7                /* 'F' */
130         jsr     putc
131 #endif /* DEBUG */
132
133 lp:
134         jsr     start_kernel
135         jmp lp
136 _exit:
137
138         jmp     _exit
139
140 __main:
141         /* nothing */
142         rts
143
144 #ifdef DEBUG
145 putc:
146         moveb   %d7,0xfffff907
147 pclp:
148         movew   0xfffff906, %d7
149         andw    #0x2000, %d7
150         beq     pclp
151         rts
152 #endif /* DEBUG */
153
154         .data
155
156 /*
157  *      Set up the usable of RAM stuff. Size of RAM is determined then
158  *      an initial stack set up at the end.
159  */
160 .align 4
161 _ramvec:
162 .long   0
163 _rambase:
164 .long   0
165 _ramstart:
166 .long   0
167 _ramend:
168 .long   0
169
170 env:
171         .long   0