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