crt0_ram.S 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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: EDOSK-2674
  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. bclr #0,@IER+1:16
  38. bset #1,@ISCRL+1:16 /* IRQ0 Positive Edge */
  39. bclr #0,@ISCRL+1:16
  40. #if defined(CONFIG_MTD_UCLINUX)
  41. /* move romfs image */
  42. jsr @__move_romfs
  43. #endif
  44. /* .bss clear */
  45. mov.l #__sbss,er5
  46. mov.l er5,er6
  47. mov.l #__ebss,er4
  48. sub.l er5,er4
  49. shlr #2,er4
  50. sub.l er0,er0
  51. 1:
  52. mov.l er0,@er5
  53. adds #4,er5
  54. dec.l #1,er4
  55. bne 1b
  56. /* copy kernel commandline */
  57. mov.l #COMMAND_START,er5
  58. mov.l #SYMBOL_NAME(command_line),er6
  59. mov.w #512,r4
  60. eepmov.w
  61. /* uClinux kernel start */
  62. ldc #0x90,ccr /* running kernel */
  63. mov.l #SYMBOL_NAME(init_thread_union),sp
  64. add.l #0x2000,sp
  65. jsr @_start_kernel
  66. _exit:
  67. jmp _exit
  68. rts
  69. /* I/O port assign information */
  70. __platform_gpio_table:
  71. mov.l #gpio_table,er0
  72. rts
  73. gpio_table:
  74. ;; P1DDR
  75. ;; used,ddr
  76. .byte 0x00,0x00
  77. ;; P2DDR
  78. .byte 0x00,0x00
  79. ;; P3DDR
  80. .byte 0x3f,0x3a
  81. ;; dummy
  82. .byte 0x00,0x00
  83. ;; P5DDR
  84. .byte 0x00,0x00
  85. ;; P6DDR
  86. .byte 0x00,0x00
  87. ;; P7DDR
  88. .byte 0x00,0x00
  89. ;; P8DDR
  90. .byte 0x00,0x00
  91. ;; dummy
  92. .byte 0x00,0x00
  93. ;; PADDR
  94. .byte 0xff,0xff
  95. ;; PBDDR
  96. .byte 0xff,0x00
  97. ;; PCDDR
  98. .byte 0xff,0x00
  99. ;; PDDDR
  100. .byte 0xff,0x00
  101. ;; PEDDR
  102. .byte 0xff,0x00
  103. ;; PFDDR
  104. .byte 0xff,0xff
  105. ;; PGDDR
  106. .byte 0x0f,0x0f
  107. ;; PHDDR
  108. .byte 0x0f,0x0f
  109. __target_name:
  110. .asciz "EDOSK-2674"
  111. .section .bootvec,"ax"
  112. jmp @SYMBOL_NAME(_start)