sun3-head.S 2.0 KB

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