Linux-2.6.12-rc2
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / h8300 / platform / h8300h / generic / crt0_rom.S
blob2e32d8179db301ee8e9259523928e5a8e4b0889c
1 /*
2  *  linux/arch/h8300/platform/h8300h/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  */
11 #define ASSEMBLY
13 #include <linux/config.h>
14 #include <asm/linkage.h>
15         
16         .global SYMBOL_NAME(_start)
17         .global SYMBOL_NAME(_command_line)
18         .global SYMBOL_NAME(_platform_gpio_table)
19         .global SYMBOL_NAME(_target_name)
20         
21         .h8300h
22         .section .text
23         .file   "crt0_rom.S"
25         /* CPU Reset entry */
26 SYMBOL_NAME_LABEL(_start)
27         mov.l   #__ramend,sp
28         ldc     #0x80,ccr
30         /* Peripheral Setup */
31         
32         /* .bss clear */
33         mov.l   #__sbss,er5
34         mov.l   #__ebss,er4
35         sub.l   er5,er4
36         shlr    er4
37         shlr    er4
38         sub.l   er0,er0
39 1:      
40         mov.l   er0,@er5
41         adds    #4,er5
42         dec.l   #1,er4
43         bne     1b
45         /* copy .data */
46 #if !defined(CONFIG_H8300H_SIM)
47         /* copy .data */
48         mov.l   #__begin_data,er5
49         mov.l   #__sdata,er6
50         mov.l   #__edata,er4
51         sub.l   er6,er4
52         shlr.l  er4
53         shlr.l  er4
54 1:      
55         mov.l   @er5+,er0
56         mov.l   er0,@er6
57         adds    #4,er6
58         dec.l   #1,er4
59         bne     1b      
60 #endif
62         /* copy kernel commandline */
63         mov.l   #COMMAND_START,er5
64         mov.l   #SYMBOL_NAME(_command_line),er6
65         mov.w   #512,r4
66         eepmov.w
68         /* linux kernel start */
69         ldc     #0x90,ccr       /* running kernel */
70         mov.l   #SYMBOL_NAME(init_thread_union),sp
71         add.l   #0x2000,sp
72         jsr     @_start_kernel
73 _exit:
75         jmp     _exit
77         rts
79         /* I/O port assign information */
80 __platform_gpio_table:  
81         mov.l   #gpio_table,er0
82         rts
84 gpio_table:
85         ;; P1DDR
86         .byte   0x00,0x00
87         ;; P2DDR
88         .byte   0x00,0x00
89         ;; P3DDR
90         .byte   0x00,0x00
91         ;; P4DDR
92         .byte   0x00,0x00
93         ;; P5DDR
94         .byte   0x00,0x00
95         ;; P6DDR
96         .byte   0x00,0x00
97         ;; dummy
98         .byte   0x00,0x00
99         ;; P8DDR
100         .byte   0x00,0x00
101         ;; P9DDR
102         .byte   0x00,0x00
103         ;; PADDR
104         .byte   0x00,0x00
105         ;; PBDDR
106         .byte   0x00,0x00
108         .section .rodata
109 __target_name:  
110         .asciz  "generic"
111         
112         .section .bss
113 __command_line: 
114         .space  512
116         /* interrupt vector */
117         .section .vectors,"ax"
118         .long   __start
119 vector  =       1
120         .rept   64-1
121         .long   _interrupt_redirect_table+vector*4
122 vector  =       vector + 1
123         .endr