Merge branch 'master' of /home/sam/kernel/linux-2.6/
[pandora-kernel.git] / arch / m68knommu / platform / 68328 / head-rom.S
1         
2         .global _start
3         .global _stext
4
5         .global _rambase
6         .global _ramvec
7         .global _ramstart
8         .global _ramend
9
10 #ifdef CONFIG_INIT_LCD
11         .global splash_bits
12 #endif
13
14         .data
15
16 /*
17  *      Set up the usable of RAM stuff. Size of RAM is determined then
18  *      an initial stack set up at the end.
19  */
20 .align 4
21 _ramvec:
22 .long   0
23 _rambase:
24 .long   0
25 _ramstart:
26 .long   0
27 _ramend:
28 .long   0
29
30 #define RAMEND  (CONFIG_RAMBASE + CONFIG_RAMSIZE)
31
32 #ifdef CONFIG_INIT_LCD
33 splash_bits:
34 #include "bootlogo.rh"
35 #endif
36         
37         .text
38 _start:
39 _stext: movew   #0x2700,%sr
40 #ifdef CONFIG_INIT_LCD
41         movel   #splash_bits, 0xfffffA00 /* LSSA */
42         moveb   #0x28,   0xfffffA05     /* LVPW */
43         movew   #0x280,  0xFFFFFa08     /* LXMAX */
44         movew   #0x1df,  0xFFFFFa0a     /* LYMAX */
45         moveb   #0,      0xfffffa29     /* LBAR */
46         moveb   #0,      0xfffffa25     /* LPXCD */
47         moveb   #0x08,   0xFFFFFa20     /* LPICF */
48         moveb   #0x01,   0xFFFFFA21     /* -ve pol */
49         moveb   #0x81,   0xfffffA27     /* LCKCON */
50         movew   #0xff00, 0xfffff412     /* LCD pins */
51 #endif
52         moveal  #RAMEND-CONFIG_MEMORY_RESERVE*0x100000 - 0x10, %sp
53         movew   #32767, %d0  /* PLL settle wait loop */
54 1:      subq    #1, %d0
55         bne     1b
56
57         /* Copy data segment from ROM to RAM */
58         moveal  #_etext, %a0
59         moveal  #_sdata, %a1
60         moveal  #_edata, %a2
61
62         /* Copy %a0 to %a1 until %a1 == %a2 */
63 1:      movel   %a0@+, %a1@+
64         cmpal   %a1, %a2
65         bhi     1b
66
67         moveal  #_sbss, %a0
68         moveal  #_ebss, %a1
69         /* Copy 0 to %a0 until %a0 == %a1 */
70         
71 1:
72         clrl    %a0@+
73         cmpal   %a0, %a1
74         bhi     1b
75
76         movel   #_sdata, %d0    
77         movel   %d0, _rambase        
78         movel   #_ebss, %d0
79         movel   %d0, _ramstart
80         movel   #RAMEND-CONFIG_MEMORY_RESERVE*0x100000, %d0
81         movel   %d0, _ramend
82         movel   #CONFIG_VECTORBASE,     %d0
83         movel   %d0, _ramvec
84         
85 /*
86  * load the current task pointer and stack
87  */
88         lea     init_thread_union, %a0
89         lea     0x2000(%a0), %sp
90
91 1:      jsr     start_kernel
92         bra 1b
93 _exit:
94
95         jmp     _exit
96
97
98 putc:
99         moveb   %d7,0xfffff907
100 1:
101         movew   0xfffff906, %d7
102         andw    #0x2000, %d7
103         beq     1b
104         rts
105
106         .data
107 env:
108         .long   0
109         .text
110