2 * arch/s390/kernel/head31.S
4 * Copyright (C) IBM Corp. 2005,2006
6 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
8 * Rob van der Heij <rvdhei@iae.nl>
9 * Heiko Carstens <heiko.carstens@de.ibm.com>
14 # startup-code at 0x10000, running in absolute addressing mode
15 # this is called either by the ipl loader or directly by PSW restart
16 # or linload or SALIPL
19 startup:basr %r13,0 # get base
20 .LPG0: l %r13,0f-.LPG0(%r13)
22 0: .long startup_continue
25 # params at 10400 (setup.h)
28 .long 0,0 # IPL_DEVICE
29 .long 0,0 # INITRD_START
30 .long 0,0 # INITRD_SIZE
33 .byte "root=/dev/ram0 ro"
39 basr %r13,0 # get base
40 .LPG1: mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0)
41 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
42 l %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
43 # move IPL device to lowcore
44 mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12)
48 l %r15,.Linittu-.LPG1(%r13)
49 mvc __LC_CURRENT(4),__TI_task(%r15)
50 ahi %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union+THREAD_SIZE
51 st %r15,__LC_KERNEL_STACK # set end of kernel stack
53 xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear backchain
55 # Save ipl parameters, clear bss memory, initialize storage key for kernel pages,
56 # and create a kernel NSS if the SAVESYS= parm is defined
58 l %r14,.Lstartup_init-.LPG1(%r13)
60 lpsw .Lentry-.LPG1(13) # jump to _stext in primary-space,
61 # virtual and never return ...
63 .Lentry:.long 0x00080000,0x80000000 + _stext
64 .Lctl: .long 0x04b50002 # cr0: various things
65 .long 0 # cr1: primary space segment table
66 .long .Lduct # cr2: dispatchable unit control table
67 .long 0 # cr3: instruction authorization
68 .long 0 # cr4: instruction authorization
69 .long .Lduct # cr5: primary-aste origin
70 .long 0 # cr6: I/O interrupts
71 .long 0 # cr7: secondary space segment table
72 .long 0 # cr8: access registers translation
73 .long 0 # cr9: tracing off
74 .long 0 # cr10: tracing off
75 .long 0 # cr11: tracing off
76 .long 0 # cr12: tracing off
77 .long 0 # cr13: home space segment table
78 .long 0xc0000000 # cr14: machine check handling off
79 .long 0 # cr15: linkage stack operations
80 .Lmchunk:.long memory_chunk
81 .Lbss_bgn: .long __bss_start
83 .Lparmaddr: .long PARMAREA
84 .Linittu: .long init_thread_union
88 .Lduct: .long 0,0,0,0,.Lduald,0,0,0
92 .long 0x80000000,0,0,0 # invalid access-list entries
98 #ifdef CONFIG_SHARED_KERNEL
103 # startup-code, running in absolute addressing mode
106 _stext: basr %r13,0 # get base
108 # check control registers
109 stctl %c0,%c15,0(%r15)
110 oi 2(%r15),0x40 # enable sigp emergency signal
111 oi 0(%r15),0x10 # switch on low address protection
112 lctl %c0,%c15,0(%r15)
115 lam 0,15,.Laregs-.LPG3(%r13) # load access regs needed by uaccess
116 l %r14,.Lstart-.LPG3(%r13)
117 basr %r14,%r14 # call start_kernel
119 # We returned from start_kernel ?!? PANIK
122 lpsw .Ldw-.(%r13) # load disabled wait psw
125 .Ldw: .long 0x000a0000,0x00000000
126 .Lstart:.long start_kernel
127 .Laregs:.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0