sun3-head.S 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #include <linux/linkage.h>
  2. #include <asm/entry.h>
  3. #include <asm/page.h>
  4. #include <asm/contregs.h>
  5. #include <asm/sun3-head.h>
  6. PSL_HIGHIPL = 0x2700
  7. NBSG = 0x20000
  8. ICACHE_ONLY = 0x00000009
  9. CACHES_OFF = 0x00000008 | actually a clear and disable --m
  10. #define MAS_STACK INT_STACK
  11. ROOT_TABLE_SIZE = 128
  12. PAGESIZE = 8192
  13. SUN3_INVALID_PMEG = 255
  14. .globl bootup_user_stack
  15. .globl bootup_kernel_stack
  16. .globl pg0
  17. .globl swapper_pg_dir
  18. .globl kernel_pmd_table
  19. .globl availmem
  20. .global m68k_pgtable_cachemode
  21. .global kpt
  22. | todo: all these should be in bss!
  23. swapper_pg_dir: .skip 0x2000
  24. pg0: .skip 0x2000
  25. kernel_pmd_table: .skip 0x2000
  26. .globl kernel_pg_dir
  27. .equ kernel_pg_dir,kernel_pmd_table
  28. .section .head
  29. ENTRY(_stext)
  30. ENTRY(_start)
  31. /* Firstly, disable interrupts and set up function codes. */
  32. movew #PSL_HIGHIPL, %sr
  33. moveq #FC_CONTROL, %d0
  34. movec %d0, %sfc
  35. movec %d0, %dfc
  36. /* Make sure we're in context zero. */
  37. moveq #0, %d0
  38. movsb %d0, AC_CONTEXT
  39. /* map everything the bootloader left us into high memory, clean up the
  40. excess later */
  41. lea (AC_SEGMAP+0),%a0
  42. lea (AC_SEGMAP+KERNBASE),%a1
  43. 1:
  44. movsb %a0@, %d1
  45. movsb %d1, %a1@
  46. cmpib #SUN3_INVALID_PMEG, %d1
  47. beq 2f
  48. addl #NBSG,%a0
  49. addl #NBSG,%a1
  50. jmp 1b
  51. 2:
  52. /* Disable caches and jump to high code. */
  53. moveq #ICACHE_ONLY,%d0 | Cache disabled until we're ready to enable it
  54. movc %d0, %cacr | is this the right value? (yes --m)
  55. jmp 1f:l
  56. /* Following code executes at high addresses (0xE000xxx). */
  57. 1: lea init_task,%curptr | get initial thread...
  58. lea init_thread_union+THREAD_SIZE,%sp | ...and its stack.
  59. /* copy bootinfo records from the loader to _end */
  60. lea _end, %a1
  61. lea BI_START, %a0
  62. /* number of longs to copy */
  63. movel %a0@, %d0
  64. 1: addl #4, %a0
  65. movel %a0@, %a1@
  66. addl #4, %a1
  67. dbf %d0, 1b
  68. /* Point MSP at an invalid page to trap if it's used. --m */
  69. movl #(PAGESIZE),%d0
  70. movc %d0,%msp
  71. moveq #-1,%d0
  72. movsb %d0,(AC_SEGMAP+0x0)
  73. jbsr sun3_init
  74. jbsr base_trap_init
  75. jbsr start_kernel
  76. trap #15
  77. .data
  78. .even
  79. kpt:
  80. .long 0
  81. availmem:
  82. .long 0
  83. | todo: remove next two. --m
  84. is_medusa:
  85. .long 0
  86. m68k_pgtable_cachemode:
  87. .long 0