Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #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 | |
| 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 | |
| 29 | .globl kernel_pg_dir |
| 30 | .equ kernel_pg_dir,kernel_pmd_table |
| 31 | |
| 32 | .section .head |
| 33 | ENTRY(_stext) |
| 34 | ENTRY(_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 |
| 50 | 1: |
| 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 | |
| 59 | 2: |
| 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). */ |
| 67 | 1: lea init_task,%curptr | get initial thread... |
| 68 | lea init_thread_union+THREAD_SIZE,%sp | ...and its stack. |
| 69 | |
| 70 | /* copy bootinfo records from the loader to _end */ |
| 71 | lea _end, %a1 |
| 72 | lea BI_START, %a0 |
| 73 | /* number of longs to copy */ |
| 74 | movel %a0@, %d0 |
| 75 | 1: addl #4, %a0 |
| 76 | movel %a0@, %a1@ |
| 77 | addl #4, %a1 |
| 78 | dbf %d0, 1b |
| 79 | |
| 80 | /* Point MSP at an invalid page to trap if it's used. --m */ |
| 81 | movl #(PAGESIZE),%d0 |
| 82 | movc %d0,%msp |
| 83 | moveq #-1,%d0 |
| 84 | movsb %d0,(AC_SEGMAP+0x0) |
| 85 | |
| 86 | jbsr sun3_init |
| 87 | |
| 88 | jbsr base_trap_init |
| 89 | |
| 90 | jbsr start_kernel |
| 91 | trap #15 |
| 92 | |
| 93 | .data |
| 94 | .even |
| 95 | kpt: |
| 96 | .long 0 |
| 97 | availmem: |
| 98 | .long 0 |
| 99 | | todo: remove next two. --m |
| 100 | is_medusa: |
| 101 | .long 0 |
| 102 | m68k_pgtable_cachemode: |
| 103 | .long 0 |
| 104 | |