8d64dda268e4a46a9538fd3e9440e0851ea919c1
[linux-flexiantxendom0-3.2.10.git] / arch / h8300 / platform / h8300h / h8max / crt0_ram.S
1 /*
2  *  linux/arch/h8300/platform/h8300h/h8max/crt0_ram.S
3  *
4  *  Yoshinori Sato <ysato@users.sourceforge.jp>
5  *
6  *  Platform depend startup for uClinux-2.4.x
7  *  Target Archtecture: H8MAX
8  *  Memory Layout     : RAM
9  */
10
11 #define ASSEMBLY
12
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
23         .section .text
24         .file   "crt0_ram.S"
25
26         /* CPU Reset entry */
27 SYMBOL_NAME_LABEL(_start)
28         mov.l   #__ramend,sp
29         ldc     #0x80,ccr
30
31         /* Peripheral Setup */
32         
33         /* .bss clear */
34         mov.l   #__sbss,er5
35         mov.l   er5,er6
36         inc.l   #1,er6
37         mov.l   #__ebss,er4
38         sub.l   er5,er4
39         sub.w   r0,r0
40         mov.b   r0l,@er5
41 1:      
42         eepmov.w
43         dec.w   #1,e4
44         bpl     1b
45
46         /* copy kernel commandline */
47         mov.l   #COMMAND_START,er5
48         mov.l   #SYMBOL_NAME(command_line),er6
49         mov.w   #512,r4
50         eepmov.w
51
52         /* RAM Interrupt Vector Table Setup */
53 #if defined(CONFIG_GDB_DEBUG)
54         mov.l   @SYMBOL_NAME(interrupt_redirect_table)+11*4,er0
55 #endif
56         mov.l   #SYMBOL_NAME(_vector_lma),er5
57         mov.l   #SYMBOL_NAME(interrupt_redirect_table),er6
58         mov.w   #0x100,r4
59         eepmov.w
60 #if defined(CONFIG_GDB_DEBUG)
61         mov.l   er0,@SYMBOL_NAME(interrupt_redirect_table)+11*4
62 #endif
63
64         /* uClinux kernel start */
65         ldc     #0x90,ccr       /* running kernel */
66         mov.l   #SYMBOL_NAME(init_task_union),sp
67         mov.l   sp,@SYMBOL_NAME(_current_task)
68         add.l   #0x2000,sp
69         jsr     @_start_kernel
70 _exit:
71
72         jmp     _exit
73
74         rts
75
76         /* I/O port assign information */
77 __platform_gpio_table:  
78         mov.l   #gpio_table,er0
79         rts
80
81 gpio_table:
82         ;; P1DDR
83         .byte   0xff,0xff
84         ;; P2DDR
85         .byte   0xff,0xff
86         ;; P3DDR
87         .byte   0x00,0x00
88         ;; P4DDR
89         .byte   0x00,0x00
90         ;; P5DDR
91         .byte   0x01,0x01
92         ;; P6DDR
93         .byte   0xf6,0xf6
94         ;; dummy
95         .byte   0x00,0x00
96         ;; P8DDR
97         .byte   0xee,0xee
98         ;; P9DDR
99         .byte   0x00,0x00
100         ;; PADDR
101         .byte   0x00,0x00
102         ;; PBDDR
103         .byte   0x30,0x30
104
105 __target_name:  
106         .asciz  "H8MAX"
107         
108         .section .bootvec,"ax"
109         jmp     @SYMBOL_NAME(_start)