crt0_ram.S 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. #define ASSEMBLY
  11. #include <linux/config.h>
  12. #include <asm/linkage.h>
  13. #if !defined(CONFIG_BLKDEV_RESERVE)
  14. #if defined(CONFIG_GDB_DEBUG)
  15. #define RAMEND (__ramend - 0xc000)
  16. #else
  17. #define RAMEND __ramend
  18. #endif
  19. #else
  20. #define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
  21. #endif
  22. .global SYMBOL_NAME(_start)
  23. .global SYMBOL_NAME(command_line)
  24. .global SYMBOL_NAME(_platform_gpio_table)
  25. .global SYMBOL_NAME(_target_name)
  26. .h8300h
  27. .section .text
  28. .file "crt0_ram.S"
  29. /* CPU Reset entry */
  30. SYMBOL_NAME_LABEL(_start)
  31. mov.l #RAMEND,sp
  32. ldc #0x80,ccr
  33. /* Peripheral Setup */
  34. #if defined(CONFIG_BLK_DEV_BLKMEM)
  35. /* move romfs image */
  36. jsr @__move_romfs
  37. #endif
  38. /* .bss clear */
  39. mov.l #__sbss,er5
  40. mov.l #__ebss,er4
  41. sub.l er5,er4
  42. shlr er4
  43. shlr er4
  44. sub.l er0,er0
  45. 1:
  46. mov.l er0,@er5
  47. adds #4,er5
  48. dec.l #1,er4
  49. bne 1b
  50. /* copy kernel commandline */
  51. mov.l #COMMAND_START,er5
  52. mov.l #SYMBOL_NAME(command_line),er6
  53. mov.w #512,r4
  54. eepmov.w
  55. /* uClinux kernel start */
  56. ldc #0x90,ccr /* running kernel */
  57. mov.l #SYMBOL_NAME(init_thread_union),sp
  58. add.l #0x2000,sp
  59. jsr @_start_kernel
  60. _exit:
  61. jmp _exit
  62. rts
  63. /* I/O port assign information */
  64. __platform_gpio_table:
  65. mov.l #gpio_table,er0
  66. rts
  67. gpio_table:
  68. ;; P1DDR
  69. .byte 0x00,0x00
  70. ;; P2DDR
  71. .byte 0x00,0x00
  72. ;; P3DDR
  73. .byte 0x00,0x00
  74. ;; P4DDR
  75. .byte 0x00,0x00
  76. ;; P5DDR
  77. .byte 0x00,0x00
  78. ;; P6DDR
  79. .byte 0x00,0x00
  80. ;; dummy
  81. .byte 0x00,0x00
  82. ;; P8DDR
  83. .byte 0x00,0x00
  84. ;; P9DDR
  85. .byte 0x00,0x00
  86. ;; PADDR
  87. .byte 0x00,0x00
  88. ;; PBDDR
  89. .byte 0x00,0x00
  90. __target_name:
  91. .asciz "generic"