Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/h8300/platform/h8300h/aki3068net/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 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include <asm/linkage.h> |
| 14 | |
| 15 | #if !defined(CONFIG_BLKDEV_RESERVE) |
| 16 | #if defined(CONFIG_GDB_DEBUG) |
| 17 | #define RAMEND (__ramend - 0xc000) |
| 18 | #else |
| 19 | #define RAMEND __ramend |
| 20 | #endif |
| 21 | #else |
| 22 | #define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS |
| 23 | #endif |
| 24 | |
Geert Uytterhoeven | db5ede6 | 2013-05-06 21:32:46 +0200 | [diff] [blame] | 25 | .global __start |
| 26 | .global _command_line |
| 27 | .global __platform_gpio_table |
| 28 | .global __target_name |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
| 30 | .h8300h |
| 31 | |
| 32 | .section .text |
| 33 | .file "crt0_ram.S" |
| 34 | |
| 35 | /* CPU Reset entry */ |
Geert Uytterhoeven | db5ede6 | 2013-05-06 21:32:46 +0200 | [diff] [blame] | 36 | __start: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | mov.l #RAMEND,sp |
| 38 | ldc #0x80,ccr |
| 39 | |
| 40 | /* Peripheral Setup */ |
| 41 | |
| 42 | #if defined(CONFIG_MTD_UCLINUX) |
| 43 | /* move romfs image */ |
| 44 | jsr @__move_romfs |
| 45 | #endif |
| 46 | |
| 47 | /* .bss clear */ |
| 48 | mov.l #__sbss,er5 |
| 49 | mov.l #__ebss,er4 |
| 50 | sub.l er5,er4 |
| 51 | shlr er4 |
| 52 | shlr er4 |
| 53 | sub.l er0,er0 |
| 54 | 1: |
| 55 | mov.l er0,@er5 |
| 56 | adds #4,er5 |
| 57 | dec.l #1,er4 |
| 58 | bne 1b |
| 59 | |
| 60 | /* copy kernel commandline */ |
| 61 | mov.l #COMMAND_START,er5 |
Geert Uytterhoeven | db5ede6 | 2013-05-06 21:32:46 +0200 | [diff] [blame] | 62 | mov.l #_command_line,er6 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | mov.w #512,r4 |
| 64 | eepmov.w |
| 65 | |
| 66 | /* uClinux kernel start */ |
| 67 | ldc #0x90,ccr /* running kernel */ |
Geert Uytterhoeven | db5ede6 | 2013-05-06 21:32:46 +0200 | [diff] [blame] | 68 | mov.l #_init_thread_union,sp |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | add.l #0x2000,sp |
| 70 | jsr @_start_kernel |
| 71 | _exit: |
| 72 | |
| 73 | jmp _exit |
| 74 | |
| 75 | rts |
| 76 | |
| 77 | /* I/O port assign information */ |
| 78 | __platform_gpio_table: |
| 79 | mov.l #gpio_table,er0 |
| 80 | rts |
| 81 | |
| 82 | gpio_table: |
| 83 | ;; P1DDR |
| 84 | .byte 0xff,0xff |
| 85 | ;; P2DDR |
| 86 | .byte 0xff,0xff |
| 87 | ;; P3DDR |
| 88 | .byte 0xff,0x00 |
| 89 | ;; P4DDR |
| 90 | .byte 0x00,0x00 |
| 91 | ;; P5DDR |
| 92 | .byte 0x01,0x01 |
| 93 | ;; P6DDR |
| 94 | .byte 0x00,0x00 |
| 95 | ;; dummy |
| 96 | .byte 0x00,0x00 |
| 97 | ;; P8DDR |
| 98 | .byte 0x0c,0x0c |
| 99 | ;; P9DDR |
| 100 | .byte 0x00,0x00 |
| 101 | ;; PADDR |
| 102 | .byte 0x00,0x00 |
| 103 | ;; PBDDR |
| 104 | .byte 0x30,0x30 |
| 105 | |
| 106 | __target_name: |
| 107 | .asciz "AE-3068" |
| 108 | |
| 109 | .section .bootvec,"ax" |
Geert Uytterhoeven | db5ede6 | 2013-05-06 21:32:46 +0200 | [diff] [blame] | 110 | jmp @__start |