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