crt0_ram.S 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * linux/arch/h8300/platform/h8300h/h8max/crt0_ram.S
  3. *
  4. * Yoshinori Sato <ysato@users.sourceforge.jp>
  5. *
  6. * Platform depend startup
  7. * Target Archtecture: H8MAX
  8. * Memory Layout : RAM
  9. */
  10. #define ASSEMBLY
  11. #include <asm/linkage.h>
  12. #if !defined(CONFIG_BLKDEV_RESERVE)
  13. #if defined(CONFIG_GDB_DEBUG)
  14. #define RAMEND (__ramend - 0xc000)
  15. #else
  16. #define RAMEND __ramend
  17. #endif
  18. #else
  19. #define RAMEND CONFIG_BLKDEV_RESERVE_ADDRESS
  20. #endif
  21. .global SYMBOL_NAME(_start)
  22. .global SYMBOL_NAME(command_line)
  23. .global SYMBOL_NAME(_platform_gpio_table)
  24. .global SYMBOL_NAME(_target_name)
  25. .h8300h
  26. .section .text
  27. .file "crt0_ram.S"
  28. /* CPU Reset entry */
  29. SYMBOL_NAME_LABEL(_start)
  30. mov.l #RAMEND,sp
  31. ldc #0x80,ccr
  32. /* Peripheral Setup */
  33. #if defined(CONFIG_MTD_UCLINUX)
  34. /* move romfs image */
  35. jsr @__move_romfs
  36. #endif
  37. /* .bss clear */
  38. mov.l #__sbss,er5
  39. mov.l #__ebss,er4
  40. sub.l er5,er4
  41. shlr er4
  42. shlr er4
  43. sub.l er0,er0
  44. 1:
  45. mov.l er0,@er5
  46. adds #4,er5
  47. dec.l #1,er4
  48. bne 1b
  49. /* copy kernel commandline */
  50. mov.l #COMMAND_START,er5
  51. mov.l #SYMBOL_NAME(command_line),er6
  52. mov.w #512,r4
  53. eepmov.w
  54. /* uClinux kernel start */
  55. ldc #0x90,ccr /* running kernel */
  56. mov.l #SYMBOL_NAME(init_thread_union),sp
  57. add.l #0x2000,sp
  58. jsr @_start_kernel
  59. _exit:
  60. jmp _exit
  61. rts
  62. /* I/O port assign information */
  63. __platform_gpio_table:
  64. mov.l #gpio_table,er0
  65. rts
  66. gpio_table:
  67. ;; P1DDR
  68. .byte 0xff,0xff
  69. ;; P2DDR
  70. .byte 0xff,0xff
  71. ;; P3DDR
  72. .byte 0x00,0x00
  73. ;; P4DDR
  74. .byte 0x00,0x00
  75. ;; P5DDR
  76. .byte 0x01,0x01
  77. ;; P6DDR
  78. .byte 0xf6,0xf6
  79. ;; dummy
  80. .byte 0x00,0x00
  81. ;; P8DDR
  82. .byte 0xee,0xee
  83. ;; P9DDR
  84. .byte 0x00,0x00
  85. ;; PADDR
  86. .byte 0x00,0x00
  87. ;; PBDDR
  88. .byte 0x30,0x30
  89. __target_name:
  90. .asciz "H8MAX"
  91. .section .bootvec,"ax"
  92. jmp @SYMBOL_NAME(_start)