crt0_rom.S 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * linux/arch/h8300/platform/h8300h/generic/crt0_rom.S
  3. *
  4. * Yoshinori Sato <ysato@users.sourceforge.jp>
  5. *
  6. * Platform depend startup
  7. * Target Archtecture: generic
  8. * Memory Layout : ROM
  9. */
  10. #define ASSEMBLY
  11. #include <asm/linkage.h>
  12. .global SYMBOL_NAME(_start)
  13. .global SYMBOL_NAME(_command_line)
  14. .global SYMBOL_NAME(_platform_gpio_table)
  15. .global SYMBOL_NAME(_target_name)
  16. .h8300h
  17. .section .text
  18. .file "crt0_rom.S"
  19. /* CPU Reset entry */
  20. SYMBOL_NAME_LABEL(_start)
  21. mov.l #__ramend,sp
  22. ldc #0x80,ccr
  23. /* Peripheral Setup */
  24. /* .bss clear */
  25. mov.l #__sbss,er5
  26. mov.l #__ebss,er4
  27. sub.l er5,er4
  28. shlr er4
  29. shlr er4
  30. sub.l er0,er0
  31. 1:
  32. mov.l er0,@er5
  33. adds #4,er5
  34. dec.l #1,er4
  35. bne 1b
  36. /* copy .data */
  37. #if !defined(CONFIG_H8300H_SIM)
  38. /* copy .data */
  39. mov.l #__begin_data,er5
  40. mov.l #__sdata,er6
  41. mov.l #__edata,er4
  42. sub.l er6,er4
  43. shlr.l er4
  44. shlr.l er4
  45. 1:
  46. mov.l @er5+,er0
  47. mov.l er0,@er6
  48. adds #4,er6
  49. dec.l #1,er4
  50. bne 1b
  51. #endif
  52. /* copy kernel commandline */
  53. mov.l #COMMAND_START,er5
  54. mov.l #SYMBOL_NAME(_command_line),er6
  55. mov.w #512,r4
  56. eepmov.w
  57. /* linux kernel start */
  58. ldc #0x90,ccr /* running kernel */
  59. mov.l #SYMBOL_NAME(init_thread_union),sp
  60. add.l #0x2000,sp
  61. jsr @_start_kernel
  62. _exit:
  63. jmp _exit
  64. rts
  65. /* I/O port assign information */
  66. __platform_gpio_table:
  67. mov.l #gpio_table,er0
  68. rts
  69. gpio_table:
  70. ;; P1DDR
  71. .byte 0x00,0x00
  72. ;; P2DDR
  73. .byte 0x00,0x00
  74. ;; P3DDR
  75. .byte 0x00,0x00
  76. ;; P4DDR
  77. .byte 0x00,0x00
  78. ;; P5DDR
  79. .byte 0x00,0x00
  80. ;; P6DDR
  81. .byte 0x00,0x00
  82. ;; dummy
  83. .byte 0x00,0x00
  84. ;; P8DDR
  85. .byte 0x00,0x00
  86. ;; P9DDR
  87. .byte 0x00,0x00
  88. ;; PADDR
  89. .byte 0x00,0x00
  90. ;; PBDDR
  91. .byte 0x00,0x00
  92. .section .rodata
  93. __target_name:
  94. .asciz "generic"
  95. .section .bss
  96. __command_line:
  97. .space 512
  98. /* interrupt vector */
  99. .section .vectors,"ax"
  100. .long __start
  101. vector = 1
  102. .rept 64-1
  103. .long _interrupt_redirect_table+vector*4
  104. vector = vector + 1
  105. .endr