sun3-head.S 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 .text.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. /* Point MSP at an invalid page to trap if it's used. --m */
  60. movl #(PAGESIZE),%d0
  61. movc %d0,%msp
  62. moveq #-1,%d0
  63. movsb %d0,(AC_SEGMAP+0x0)
  64. jbsr sun3_init
  65. jbsr base_trap_init
  66. jbsr start_kernel
  67. trap #15
  68. .data
  69. .even
  70. kpt:
  71. .long 0
  72. availmem:
  73. .long 0
  74. | todo: remove next two. --m
  75. is_medusa:
  76. .long 0
  77. m68k_pgtable_cachemode:
  78. .long 0