crt0_ram.S 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 <linux/config.h>
  12. #include <asm/linkage.h>
  13. #include <asm/regs267x.h>
  14. #if !defined(CONFIG_BLKDEV_RESERVE)
  15. #if defined(CONFIG_GDB_DEBUG)
  16. #define RAMEND (__ramend - 0xc000)
  17. #else
  18. #define RAMEND __ramend
  19. #endif
  20. #else
  21. #define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
  22. #endif
  23. .global SYMBOL_NAME(_start)
  24. .global SYMBOL_NAME(_command_line)
  25. .global SYMBOL_NAME(_platform_gpio_table)
  26. .global SYMBOL_NAME(_target_name)
  27. .h8300s
  28. .section .text
  29. .file "crt0_ram.S"
  30. /* CPU Reset entry */
  31. SYMBOL_NAME_LABEL(_start)
  32. mov.l #RAMEND,sp
  33. ldc #0x80,ccr
  34. ldc #0x00,exr
  35. /* Peripheral Setup */
  36. bclr #4,@INTCR:8 /* interrupt mode 2 */
  37. bset #5,@INTCR:8
  38. bclr #0,@IER+1:16
  39. bset #1,@ISCRL+1:16 /* IRQ0 Positive Edge */
  40. bclr #0,@ISCRL+1:16
  41. #if defined(CONFIG_MTD_UCLINUX)
  42. /* move romfs image */
  43. jsr @__move_romfs
  44. #endif
  45. /* .bss clear */
  46. mov.l #__sbss,er5
  47. mov.l er5,er6
  48. mov.l #__ebss,er4
  49. sub.l er5,er4
  50. shlr #2,er4
  51. sub.l er0,er0
  52. 1:
  53. mov.l er0,@er5
  54. adds #4,er5
  55. dec.l #1,er4
  56. bne 1b
  57. /* copy kernel commandline */
  58. mov.l #COMMAND_START,er5
  59. mov.l #SYMBOL_NAME(command_line),er6
  60. mov.w #512,r4
  61. eepmov.w
  62. /* uClinux kernel start */
  63. ldc #0x90,ccr /* running kernel */
  64. mov.l #SYMBOL_NAME(init_thread_union),sp
  65. add.l #0x2000,sp
  66. jsr @_start_kernel
  67. _exit:
  68. jmp _exit
  69. rts
  70. /* I/O port assign information */
  71. __platform_gpio_table:
  72. mov.l #gpio_table,er0
  73. rts
  74. gpio_table:
  75. ;; P1DDR
  76. ;; used,ddr
  77. .byte 0x00,0x00
  78. ;; P2DDR
  79. .byte 0x00,0x00
  80. ;; P3DDR
  81. .byte 0x3f,0x3a
  82. ;; dummy
  83. .byte 0x00,0x00
  84. ;; P5DDR
  85. .byte 0x00,0x00
  86. ;; P6DDR
  87. .byte 0x00,0x00
  88. ;; P7DDR
  89. .byte 0x00,0x00
  90. ;; P8DDR
  91. .byte 0x00,0x00
  92. ;; dummy
  93. .byte 0x00,0x00
  94. ;; PADDR
  95. .byte 0xff,0xff
  96. ;; PBDDR
  97. .byte 0xff,0x00
  98. ;; PCDDR
  99. .byte 0xff,0x00
  100. ;; PDDDR
  101. .byte 0xff,0x00
  102. ;; PEDDR
  103. .byte 0xff,0x00
  104. ;; PFDDR
  105. .byte 0xff,0xff
  106. ;; PGDDR
  107. .byte 0x0f,0x0f
  108. ;; PHDDR
  109. .byte 0x0f,0x0f
  110. __target_name:
  111. .asciz "EDOSK-2674"
  112. .section .bootvec,"ax"
  113. jmp @SYMBOL_NAME(_start)