head-rom.S 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. .global _start
  2. .global _stext
  3. .global _rambase
  4. .global _ramvec
  5. .global _ramstart
  6. .global _ramend
  7. #ifdef CONFIG_INIT_LCD
  8. .global splash_bits
  9. #endif
  10. .data
  11. /*
  12. * Set up the usable of RAM stuff. Size of RAM is determined then
  13. * an initial stack set up at the end.
  14. */
  15. .align 4
  16. _ramvec:
  17. .long 0
  18. _rambase:
  19. .long 0
  20. _ramstart:
  21. .long 0
  22. _ramend:
  23. .long 0
  24. #define RAMEND (CONFIG_RAMBASE + CONFIG_RAMSIZE)
  25. #ifdef CONFIG_INIT_LCD
  26. splash_bits:
  27. #include "bootlogo.rh"
  28. #endif
  29. .text
  30. _start:
  31. _stext: movew #0x2700,%sr
  32. #ifdef CONFIG_INIT_LCD
  33. movel #splash_bits, 0xfffffA00 /* LSSA */
  34. moveb #0x28, 0xfffffA05 /* LVPW */
  35. movew #0x280, 0xFFFFFa08 /* LXMAX */
  36. movew #0x1df, 0xFFFFFa0a /* LYMAX */
  37. moveb #0, 0xfffffa29 /* LBAR */
  38. moveb #0, 0xfffffa25 /* LPXCD */
  39. moveb #0x08, 0xFFFFFa20 /* LPICF */
  40. moveb #0x01, 0xFFFFFA21 /* -ve pol */
  41. moveb #0x81, 0xfffffA27 /* LCKCON */
  42. movew #0xff00, 0xfffff412 /* LCD pins */
  43. #endif
  44. moveal #RAMEND-CONFIG_MEMORY_RESERVE*0x100000 - 0x10, %sp
  45. movew #32767, %d0 /* PLL settle wait loop */
  46. 1: subq #1, %d0
  47. bne 1b
  48. /* Copy data segment from ROM to RAM */
  49. moveal #_etext, %a0
  50. moveal #_sdata, %a1
  51. moveal #_edata, %a2
  52. /* Copy %a0 to %a1 until %a1 == %a2 */
  53. 1: movel %a0@+, %a1@+
  54. cmpal %a1, %a2
  55. bhi 1b
  56. moveal #_sbss, %a0
  57. moveal #_ebss, %a1
  58. /* Copy 0 to %a0 until %a0 == %a1 */
  59. 1:
  60. clrl %a0@+
  61. cmpal %a0, %a1
  62. bhi 1b
  63. movel #_sdata, %d0
  64. movel %d0, _rambase
  65. movel #_ebss, %d0
  66. movel %d0, _ramstart
  67. movel #RAMEND-CONFIG_MEMORY_RESERVE*0x100000, %d0
  68. movel %d0, _ramend
  69. movel #CONFIG_VECTORBASE, %d0
  70. movel %d0, _ramvec
  71. /*
  72. * load the current task pointer and stack
  73. */
  74. lea init_thread_union, %a0
  75. lea 0x2000(%a0), %sp
  76. 1: jsr start_kernel
  77. bra 1b
  78. _exit:
  79. jmp _exit
  80. putc:
  81. moveb %d7,0xfffff907
  82. 1:
  83. movew 0xfffff906, %d7
  84. andw #0x2000, %d7
  85. beq 1b
  86. rts
  87. .data
  88. env:
  89. .long 0
  90. .text