head-pilot.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. /*
  2. * linux/arch/m68knommu/platform/68328/head-rom.S
  3. * - A startup file for the MC68328
  4. *
  5. * Copyright (C) 1998 D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
  6. * Kenneth Albanowski <kjahds@kjahds.com>,
  7. * The Silver Hammer Group, Ltd.
  8. *
  9. * (c) 1995, Dionne & Associates
  10. * (c) 1995, DKG Display Tech.
  11. */
  12. #define ASSEMBLY
  13. #define IMMED #
  14. #define DBG_PUTC(x) moveb IMMED x, 0xfffff907
  15. #include <linux/config.h>
  16. .global _stext
  17. .global _start
  18. .global _rambase
  19. .global _ramvec
  20. .global _ramstart
  21. .global _ramend
  22. .global penguin_bits
  23. #ifdef CONFIG_PILOT
  24. #define IMR 0xFFFFF304
  25. .data
  26. .align 16
  27. penguin_bits:
  28. #include "bootlogo.rh"
  29. #endif
  30. /*****************************************************************************/
  31. .data
  32. /*
  33. * Set up the usable of RAM stuff. Size of RAM is determined then
  34. * an initial stack set up at the end.
  35. */
  36. .align 4
  37. _ramvec:
  38. .long 0
  39. _rambase:
  40. .long 0
  41. _ramstart:
  42. .long 0
  43. _ramend:
  44. .long 0
  45. .text
  46. _start:
  47. _stext:
  48. #ifdef CONFIG_M68328
  49. #ifdef CONFIG_PILOT
  50. .byte 0x4e, 0xfa, 0x00, 0x0a /* Jmp +X bytes */
  51. .byte 'b', 'o', 'o', 't'
  52. .word 10000
  53. nop
  54. #endif
  55. moveq #0, %d0
  56. movew %d0, 0xfffff618 /* Watchdog off */
  57. movel #0x00011f07, 0xfffff114 /* CS A1 Mask */
  58. movew #0x0800, 0xfffff906 /* Ignore CTS */
  59. movew #0x010b, 0xfffff902 /* BAUD to 9600 */
  60. movew #0x2410, 0xfffff200 /* PLLCR */
  61. movew #0x123, 0xfffff202 /* PLLFSR */
  62. #ifdef CONFIG_PILOT
  63. moveb #0, 0xfffffA27 /* LCKCON */
  64. movel #_start, 0xfffffA00 /* LSSA */
  65. moveb #0xa, 0xfffffA05 /* LVPW */
  66. movew #0x9f, 0xFFFFFa08 /* LXMAX */
  67. movew #0x9f, 0xFFFFFa0a /* LYMAX */
  68. moveb #9, 0xfffffa29 /* LBAR */
  69. moveb #0, 0xfffffa25 /* LPXCD */
  70. moveb #0x04, 0xFFFFFa20 /* LPICF */
  71. moveb #0x58, 0xfffffA27 /* LCKCON */
  72. moveb #0x85, 0xfffff429 /* PFDATA */
  73. moveb #0xd8, 0xfffffA27 /* LCKCON */
  74. moveb #0xc5, 0xfffff429 /* PFDATA */
  75. moveb #0xd5, 0xfffff429 /* PFDATA */
  76. moveal #0x00100000, %a3
  77. moveal #0x100ffc00, %a4
  78. #endif /* CONFIG_PILOT */
  79. #endif /* CONFIG_M68328 */
  80. movew #0x2700, %sr
  81. lea %a4@(-4), %sp
  82. DBG_PUTC('\r')
  83. DBG_PUTC('\n')
  84. DBG_PUTC('A')
  85. moveq #0,%d0
  86. movew #16384, %d0 /* PLL settle wait loop */
  87. L0:
  88. subw #1, %d0
  89. bne L0
  90. DBG_PUTC('B')
  91. /* Copy command line from beginning of RAM (+16) to end of bss */
  92. movel #CONFIG_VECTORBASE, %d7
  93. addl #16, %d7
  94. moveal %d7, %a0
  95. moveal #_ebss, %a1
  96. lea %a1@(512), %a2
  97. DBG_PUTC('C')
  98. /* Copy %a0 to %a1 until %a1 == %a2 */
  99. L2:
  100. movel %a0@+, %d0
  101. movel %d0, %a1@+
  102. cmpal %a1, %a2
  103. bhi L2
  104. /* Copy data+init segment from ROM to RAM */
  105. moveal #_etext, %a0
  106. moveal #_sdata, %a1
  107. moveal #__init_end, %a2
  108. DBG_PUTC('D')
  109. /* Copy %a0 to %a1 until %a1 == %a2 */
  110. LD1:
  111. movel %a0@+, %d0
  112. movel %d0, %a1@+
  113. cmpal %a1, %a2
  114. bhi LD1
  115. DBG_PUTC('E')
  116. moveal #_sbss, %a0
  117. moveal #_ebss, %a1
  118. /* Copy 0 to %a0 until %a0 == %a1 */
  119. L1:
  120. movel #0, %a0@+
  121. cmpal %a0, %a1
  122. bhi L1
  123. DBG_PUTC('F')
  124. /* Copy command line from end of bss to command line */
  125. moveal #_ebss, %a0
  126. moveal #command_line, %a1
  127. lea %a1@(512), %a2
  128. DBG_PUTC('G')
  129. /* Copy %a0 to %a1 until %a1 == %a2 */
  130. L3:
  131. movel %a0@+, %d0
  132. movel %d0, %a1@+
  133. cmpal %a1, %a2
  134. bhi L3
  135. movel #_sdata, %d0
  136. movel %d0, _rambase
  137. movel #_ebss, %d0
  138. movel %d0, _ramstart
  139. movel %a4, %d0
  140. subl #4096, %d0 /* Reserve 4K of stack */
  141. moveq #79, %d7
  142. movel %d0, _ramend
  143. movel %a3, %d0
  144. movel %d0, rom_length
  145. pea 0
  146. pea env
  147. pea %sp@(4)
  148. pea 0
  149. DBG_PUTC('H')
  150. #ifdef CONFIG_PILOT
  151. movel #penguin_bits, 0xFFFFFA00
  152. moveb #10, 0xFFFFFA05
  153. movew #160, 0xFFFFFA08
  154. movew #160, 0xFFFFFA0A
  155. #endif /* CONFIG_PILOT */
  156. DBG_PUTC('I')
  157. lea init_thread_union, %a0
  158. lea 0x2000(%a0), %sp
  159. DBG_PUTC('J')
  160. DBG_PUTC('\r')
  161. DBG_PUTC('\n')
  162. jsr start_kernel
  163. _exit:
  164. jmp _exit
  165. .data
  166. env:
  167. .long 0