blob: 9e5c3e57c5985951de3d1901dbb055c8ed66e419 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/linkage.h>
2
3#include <asm/entry.h>
4#include <asm/page.h>
5#include <asm/contregs.h>
6#include <asm/sun3-head.h>
7
8PSL_HIGHIPL = 0x2700
9NBSG = 0x20000
10ICACHE_ONLY = 0x00000009
11CACHES_OFF = 0x00000008 | actually a clear and disable --m
12#define MAS_STACK INT_STACK
13ROOT_TABLE_SIZE = 128
14PAGESIZE = 8192
15SUN3_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!
25swapper_pg_dir: .skip 0x2000
26pg0: .skip 0x2000
27kernel_pmd_table: .skip 0x2000
28
29.globl kernel_pg_dir
30.equ kernel_pg_dir,kernel_pmd_table
31
Tim Abbott6f335ca2009-04-25 22:11:03 -040032 __HEAD
Linus Torvalds1da177e2005-04-16 15:20:36 -070033ENTRY(_stext)
34ENTRY(_start)
35
36/* Firstly, disable interrupts and set up function codes. */
37 movew #PSL_HIGHIPL, %sr
38 moveq #FC_CONTROL, %d0
39 movec %d0, %sfc
40 movec %d0, %dfc
41
42/* Make sure we're in context zero. */
43 moveq #0, %d0
44 movsb %d0, AC_CONTEXT
45
46/* map everything the bootloader left us into high memory, clean up the
47 excess later */
48 lea (AC_SEGMAP+0),%a0
49 lea (AC_SEGMAP+KERNBASE),%a1
501:
51 movsb %a0@, %d1
52 movsb %d1, %a1@
53 cmpib #SUN3_INVALID_PMEG, %d1
54 beq 2f
55 addl #NBSG,%a0
56 addl #NBSG,%a1
57 jmp 1b
58
592:
60
61/* Disable caches and jump to high code. */
62 moveq #ICACHE_ONLY,%d0 | Cache disabled until we're ready to enable it
63 movc %d0, %cacr | is this the right value? (yes --m)
64 jmp 1f:l
65
66/* Following code executes at high addresses (0xE000xxx). */
671: lea init_task,%curptr | get initial thread...
68 lea init_thread_union+THREAD_SIZE,%sp | ...and its stack.
69
Linus Torvalds1da177e2005-04-16 15:20:36 -070070/* Point MSP at an invalid page to trap if it's used. --m */
71 movl #(PAGESIZE),%d0
72 movc %d0,%msp
73 moveq #-1,%d0
74 movsb %d0,(AC_SEGMAP+0x0)
75
76 jbsr sun3_init
77
78 jbsr base_trap_init
79
80 jbsr start_kernel
81 trap #15
82
83 .data
84 .even
85kpt:
86 .long 0
87availmem:
88 .long 0
89| todo: remove next two. --m
90is_medusa:
91 .long 0
92m68k_pgtable_cachemode:
93 .long 0
94