Linux-2.6.12-rc2
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / h8300 / platform / h8300h / generic / crt0_ram.S
1 /*
2 * linux/arch/h8300/platform/h8300h/generic/crt0_ram.S
3 *
4 * Yoshinori Sato <ysato@users.sourceforge.jp>
5 *
6 * Platform depend startup
7 * Target Archtecture: AE-3068 (aka. aki3068net)
8 * Memory Layout : RAM
9 */
10
11 #define ASSEMBLY
12
13 #include <linux/config.h>
14 #include <asm/linkage.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 .h8300h
32
33 .section .text
34 .file "crt0_ram.S"
35
36 /* CPU Reset entry */
37 SYMBOL_NAME_LABEL(_start)
38 mov.l #RAMEND,sp
39 ldc #0x80,ccr
40
41 /* Peripheral Setup */
42
43 #if defined(CONFIG_BLK_DEV_BLKMEM)
44 /* move romfs image */
45 jsr @__move_romfs
46 #endif
47
48 /* .bss clear */
49 mov.l #__sbss,er5
50 mov.l #__ebss,er4
51 sub.l er5,er4
52 shlr er4
53 shlr er4
54 sub.l er0,er0
55 1:
56 mov.l er0,@er5
57 adds #4,er5
58 dec.l #1,er4
59 bne 1b
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 /* uClinux 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 ;; P9DDR
101 .byte 0x00,0x00
102 ;; PADDR
103 .byte 0x00,0x00
104 ;; PBDDR
105 .byte 0x00,0x00
106
107 __target_name:
108 .asciz "generic"