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