sun3-head.S 2.0 KB

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