Linux-2.6.12-rc2
[safe/jmp/linux-2.6] / arch / h8300 / platform / h8s / generic / crt0_ram.S
1 /*
2  *  linux/arch/h8300/platform/h8s/edosk2674/crt0_ram.S
3  *
4  *  Yoshinori Sato <ysato@users.sourceforge.jp>
5  *
6  *  Platform depend startup
7  *  Target Archtecture: generic
8  *  Memory Layout     : RAM
9  */
10
11 #define ASSEMBLY
12
13 #include <linux/config.h>
14 #include <asm/linkage.h>
15 #include <asm/regs267x.h>
16                         
17 #if !defined(CONFIG_BLKDEV_RESERVE)
18 #if defined(CONFIG_GDB_DEBUG)
19 #define RAMEND (__ramend - 0xc000)
20 #else
21 #define RAMEND __ramend
22 #endif
23 #else
24 #define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
25 #endif
26         
27         .global SYMBOL_NAME(_start)
28         .global SYMBOL_NAME(_command_line)
29         .global SYMBOL_NAME(_platform_gpio_table)
30         .global SYMBOL_NAME(_target_name)
31         
32         .h8300s
33
34         .section .text
35         .file   "crt0_ram.S"
36
37         /* CPU Reset entry */
38 SYMBOL_NAME_LABEL(_start)
39         mov.l   #RAMEND,sp
40         ldc     #0x80,ccr
41         ldc     #0x00,exr
42
43         /* Peripheral Setup */
44         bclr    #4,@INTCR:8     /* interrupt mode 2 */
45         bset    #5,@INTCR:8
46
47 #if defined(CONFIG_MTD_UCLINUX)
48         /* move romfs image */
49         jsr     @__move_romfs   
50 #endif
51         
52         /* .bss clear */
53         mov.l   #__sbss,er5
54         mov.l   er5,er6
55         mov.l   #__ebss,er4
56         sub.l   er5,er4
57         shlr    #2,er4
58         sub.l   er0,er0
59 1:      
60         mov.l   er0,@er5
61         adds    #4,er5
62         dec.l   #1,er4
63         bne     1b
64
65         /* copy kernel commandline */
66         mov.l   #COMMAND_START,er5
67         mov.l   #SYMBOL_NAME(command_line),er6
68         mov.w   #512,r4
69         eepmov.w
70
71         /* uClinux kernel start */
72         ldc     #0x90,ccr       /* running kernel */
73         mov.l   #SYMBOL_NAME(init_thread_union),sp
74         add.l   #0x2000,sp
75         jsr     @_start_kernel
76 _exit:
77
78         jmp     _exit
79
80         rts
81
82         /* I/O port assign information */
83 __platform_gpio_table:  
84         mov.l   #gpio_table,er0
85         rts
86
87 gpio_table:
88         ;; P1DDR
89         ;;      used,ddr
90         .byte   0x00,0x00
91         ;; P2DDR
92         .byte   0x00,0x00
93         ;; P3DDR
94         .byte   0x00,0x00
95         ;; dummy
96         .byte   0x00,0x00
97         ;; P5DDR
98         .byte   0x00,0x00
99         ;; P6DDR
100         .byte   0x00,0x00
101         ;; P7DDR
102         .byte   0x00,0x00
103         ;; P8DDR
104         .byte   0x00,0x00
105         ;; dummy
106         .byte   0x00,0x00
107         ;; PADDR
108         .byte   0x00,0x00
109         ;; PBDDR
110         .byte   0x00,0x00
111         ;; PCDDR
112         .byte   0x00,0x00
113         ;; PDDDR
114         .byte   0x00,0x00
115         ;; PEDDR
116         .byte   0x00,0x00
117         ;; PFDDR
118         .byte   0x00,0x00
119         ;; PGDDR
120         .byte   0x00,0x00
121         ;; PHDDR
122         .byte   0x00,0x00
123
124 __target_name:  
125         .asciz  "generic"
126         
127         .section .bootvec,"ax"
128         jmp     @SYMBOL_NAME(_start)