commented early_printk patch because of rejects.
[linux-flexiantxendom0-3.2.10.git] / arch / h8300 / platform / h8s / generic / crt0_rom.S
1 /*
2  *  linux/arch/h8300/platform/h8s/generic/crt0_rom.S
3  *
4  *  Yoshinori Sato <ysato@users.sourceforge.jp>
5  *
6  *  Platform depend startup 
7  *  Target Archtecture: generic
8  *  Memory Layout     : ROM
9  */
10
11 #define ASSEMBLY
12
13 #include <linux/config.h>
14 #include <asm/linkage.h>
15 #include <asm/regs267x.h>
16         
17         .global SYMBOL_NAME(_start)
18         .global SYMBOL_NAME(_command_line)
19         .global SYMBOL_NAME(_platform_gpio_table)
20         .global SYMBOL_NAME(_target_name)
21         
22         .h8300s
23         .section .text
24         .file   "crt0_rom.S"
25
26         /* CPU Reset entry */
27 SYMBOL_NAME_LABEL(_start)
28         mov.l   #__ramend,sp
29         ldc     #0x80,ccr
30         ldc     #0,exr
31         bclr    #4,@INTCR:8
32         bset    #5,@INTCR:8     /* Interrupt mode 2 */
33         
34         /* Peripheral Setup */
35         
36         /* .bss clear */
37         mov.l   #__sbss,er5
38         mov.l   er5,er6
39         inc.l   #1,er6
40         mov.l   #__ebss,er4
41         sub.l   er5,er4
42         sub.w   r0,r0
43         mov.b   r0l,@er5
44 1:      
45         eepmov.w
46         dec.w   #1,e4
47         bpl     1b
48
49         /* copy .data */
50 #if !defined(CONFIG_H8S_SIM)
51         mov.l   #__begin_data,er5
52         mov.l   #__sdata,er6
53         mov.l   #__edata,er4
54         sub.l   er6,er4         
55 1:      
56         eepmov.w        
57         dec.w   #1,e4
58         bpl     1b      
59 #endif
60
61         /* copy kernel commandline */
62         mov.l   #COMMAND_START,er5
63         mov.l   #SYMBOL_NAME(_command_line),er6
64         mov.w   #512,r4
65         eepmov.w
66
67         /* linux kernel start */
68         ldc     #0x90,ccr       /* running kernel */
69         mov.l   #SYMBOL_NAME(init_thread_union),sp
70         add.l   #0x2000,sp
71         jsr     @_start_kernel
72 _exit:
73
74         jmp     _exit
75
76         rts
77
78         /* I/O port assign information */
79 __platform_gpio_table:  
80         mov.l   #gpio_table,er0
81         rts
82
83 gpio_table:
84         ;; P1DDR
85         .byte   0x00,0x00
86         ;; P2DDR
87         .byte   0x00,0x00
88         ;; P3DDR
89         .byte   0x00,0x00
90         ;; P4DDR
91         .byte   0x00,0x00
92         ;; P5DDR
93         .byte   0x00,0x00
94         ;; P6DDR
95         .byte   0x00,0x00
96         ;; dummy
97         .byte   0x00,0x00
98         ;; P8DDR
99         .byte   0x00,0x00
100         ;; PADDR
101         .byte   0x00,0x00
102         ;; PBDDR
103         .byte   0x00,0x00
104         ;; PCDDR
105         .byte   0x00,0x00
106         ;; PDDDR
107         .byte   0x00,0x00
108         ;; PEDDR
109         .byte   0x00,0x00
110         ;; PFDDR
111         .byte   0x00,0x00
112         ;; PGDDR
113         .byte   0x00,0x00
114         ;; PHDDR
115         .byte   0x00,0x00
116
117 __target_name:  
118         .asciz  "generic"
119         
120         .section .bss
121 __command_line: 
122         .space  512
123
124         /* interrupt vector */
125         .section .vectors,"ax"
126         .long   __start
127         .long   __start
128 vector  =       2
129         .rept   126-1
130         .long   _interrupt_redirect_table+vector*4
131 vector  =       vector + 1
132         .endr