crt0_ram.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * linux/arch/h8300/platform/h8s/edosk2674/crt0_ram.S
  3. *
  4. * Yoshinori Sato <ysato@users.sourceforge.jp>
  5. *
  6. * Platform depend startup
  7. * Target Archtecture: generic
  8. * Memory Layout : RAM
  9. */
  10. #define ASSEMBLY
  11. #include <asm/linkage.h>
  12. #include <asm/regs267x.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. .h8300s
  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. ldc #0x00,exr
  34. /* Peripheral Setup */
  35. bclr #4,@INTCR:8 /* interrupt mode 2 */
  36. bset #5,@INTCR:8
  37. #if defined(CONFIG_MTD_UCLINUX)
  38. /* move romfs image */
  39. jsr @__move_romfs
  40. #endif
  41. /* .bss clear */
  42. mov.l #__sbss,er5
  43. mov.l er5,er6
  44. mov.l #__ebss,er4
  45. sub.l er5,er4
  46. shlr #2,er4
  47. sub.l er0,er0
  48. 1:
  49. mov.l er0,@er5
  50. adds #4,er5
  51. dec.l #1,er4
  52. bne 1b
  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. /* uClinux 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. ;; used,ddr
  73. .byte 0x00,0x00
  74. ;; P2DDR
  75. .byte 0x00,0x00
  76. ;; P3DDR
  77. .byte 0x00,0x00
  78. ;; dummy
  79. .byte 0x00,0x00
  80. ;; P5DDR
  81. .byte 0x00,0x00
  82. ;; P6DDR
  83. .byte 0x00,0x00
  84. ;; P7DDR
  85. .byte 0x00,0x00
  86. ;; P8DDR
  87. .byte 0x00,0x00
  88. ;; dummy
  89. .byte 0x00,0x00
  90. ;; PADDR
  91. .byte 0x00,0x00
  92. ;; PBDDR
  93. .byte 0x00,0x00
  94. ;; PCDDR
  95. .byte 0x00,0x00
  96. ;; PDDDR
  97. .byte 0x00,0x00
  98. ;; PEDDR
  99. .byte 0x00,0x00
  100. ;; PFDDR
  101. .byte 0x00,0x00
  102. ;; PGDDR
  103. .byte 0x00,0x00
  104. ;; PHDDR
  105. .byte 0x00,0x00
  106. __target_name:
  107. .asciz "generic"
  108. .section .bootvec,"ax"
  109. jmp @SYMBOL_NAME(_start)