aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/head31.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/head31.S')
-rw-r--r--arch/s390/kernel/head31.S164
1 files changed, 3 insertions, 161 deletions
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index b3dcdcdc80c0..453fd3b4edea 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -58,145 +58,6 @@ startup_continue:
58 l %r14,.Lstartup_init-.LPG1(%r13) 58 l %r14,.Lstartup_init-.LPG1(%r13)
59 basr %r14,%r14 59 basr %r14,%r14
60 60
61 l %r2,.Lrcp-.LPG1(%r13) # Read SCP forced command word
62.Lservicecall:
63 stosm .Lpmask-.LPG1(%r13),0x01 # authorize ext interrupts
64
65 stctl %r0, %r0,.Lcr-.LPG1(%r13) # get cr0
66 la %r1,0x200 # set bit 22
67 o %r1,.Lcr-.LPG1(%r13) # or old cr0 with r1
68 st %r1,.Lcr-.LPG1(%r13)
69 lctl %r0, %r0,.Lcr-.LPG1(%r13) # load modified cr0
70
71 mvc __LC_EXT_NEW_PSW(8),.Lpcext-.LPG1(%r13) # set postcall psw
72 la %r1, .Lsclph-.LPG1(%r13)
73 a %r1,__LC_EXT_NEW_PSW+4 # set handler
74 st %r1,__LC_EXT_NEW_PSW+4
75
76 l %r4,.Lsccbaddr-.LPG1(%r13) # %r4 is our index for sccb stuff
77 lr %r1,%r4 # our sccb
78 .insn rre,0xb2200000,%r2,%r1 # service call
79 ipm %r1
80 srl %r1,28 # get cc code
81 xr %r3, %r3
82 chi %r1,3
83 be .Lfchunk-.LPG1(%r13) # leave
84 chi %r1,2
85 be .Lservicecall-.LPG1(%r13)
86 lpsw .Lwaitsclp-.LPG1(%r13)
87.Lsclph:
88 lh %r1,.Lsccbr-.Lsccb(%r4)
89 chi %r1,0x10 # 0x0010 is the sucess code
90 je .Lprocsccb # let's process the sccb
91 chi %r1,0x1f0
92 bne .Lfchunk-.LPG1(%r13) # unhandled error code
93 c %r2, .Lrcp-.LPG1(%r13) # Did we try Read SCP forced
94 bne .Lfchunk-.LPG1(%r13) # if no, give up
95 l %r2, .Lrcp2-.LPG1(%r13) # try with Read SCP
96 b .Lservicecall-.LPG1(%r13)
97.Lprocsccb:
98 lhi %r1,0
99 icm %r1,3,.Lscpincr1-.Lsccb(%r4) # use this one if != 0
100 jnz .Lscnd
101 lhi %r1,0x800 # otherwise report 2GB
102.Lscnd:
103 lhi %r3,0x800 # limit reported memory size to 2GB
104 cr %r1,%r3
105 jl .Lno2gb
106 lr %r1,%r3
107.Lno2gb:
108 xr %r3,%r3 # same logic
109 ic %r3,.Lscpa1-.Lsccb(%r4)
110 chi %r3,0x00
111 jne .Lcompmem
112 l %r3,.Lscpa2-.Lsccb(%r4)
113.Lcompmem:
114 mr %r2,%r1 # mem in MB on 128-bit
115 l %r1,.Lonemb-.LPG1(%r13)
116 mr %r2,%r1 # mem size in bytes in %r3
117 b .Lfchunk-.LPG1(%r13)
118
119 .align 4
120.Linittu:
121 .long init_thread_union
122.Lstartup_init:
123 .long startup_init
124.Lpmask:
125 .byte 0
126 .align 8
127.Lpcext:.long 0x00080000,0x80000000
128.Lcr:
129 .long 0x00 # place holder for cr0
130 .align 8
131.Lwaitsclp:
132 .long 0x010a0000,0x80000000 + .Lsclph
133.Lrcp:
134 .int 0x00120001 # Read SCP forced code
135.Lrcp2:
136 .int 0x00020001 # Read SCP code
137.Lonemb:
138 .int 0x100000
139.Lfchunk:
140
141#
142# find memory chunks.
143#
144 lr %r9,%r3 # end of mem
145 mvc __LC_PGM_NEW_PSW(8),.Lpcmem-.LPG1(%r13)
146 la %r1,1 # test in increments of 128KB
147 sll %r1,17
148 l %r3,.Lmchunk-.LPG1(%r13) # get pointer to memory_chunk array
149 slr %r4,%r4 # set start of chunk to zero
150 slr %r5,%r5 # set end of chunk to zero
151 slr %r6,%r6 # set access code to zero
152 la %r10,MEMORY_CHUNKS # number of chunks
153.Lloop:
154 tprot 0(%r5),0 # test protection of first byte
155 ipm %r7
156 srl %r7,28
157 clr %r6,%r7 # compare cc with last access code
158 be .Lsame-.LPG1(%r13)
159 lhi %r8,0 # no program checks
160 b .Lsavchk-.LPG1(%r13)
161.Lsame:
162 ar %r5,%r1 # add 128KB to end of chunk
163 bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop
164.Lchkmem: # > 2GB or tprot got a program check
165 lhi %r8,1 # set program check flag
166.Lsavchk:
167 clr %r4,%r5 # chunk size > 0?
168 be .Lchkloop-.LPG1(%r13)
169 st %r4,0(%r3) # store start address of chunk
170 lr %r0,%r5
171 slr %r0,%r4
172 st %r0,4(%r3) # store size of chunk
173 st %r6,8(%r3) # store type of chunk
174 la %r3,12(%r3)
175 ahi %r10,-1 # update chunk number
176.Lchkloop:
177 lr %r6,%r7 # set access code to last cc
178 # we got an exception or we're starting a new
179 # chunk , we must check if we should
180 # still try to find valid memory (if we detected
181 # the amount of available storage), and if we
182 # have chunks left
183 xr %r0,%r0
184 clr %r0,%r9 # did we detect memory?
185 je .Ldonemem # if not, leave
186 chi %r10,0 # do we have chunks left?
187 je .Ldonemem
188 chi %r8,1 # program check ?
189 je .Lpgmchk
190 lr %r4,%r5 # potential new chunk
191 alr %r5,%r1 # add 128KB to end of chunk
192 j .Llpcnt
193.Lpgmchk:
194 alr %r5,%r1 # add 128KB to end of chunk
195 lr %r4,%r5 # potential new chunk
196.Llpcnt:
197 clr %r5,%r9 # should we go on?
198 jl .Lloop
199.Ldonemem:
200 l %r12,.Lmflags-.LPG1(%r13) # get address of machine_flags 61 l %r12,.Lmflags-.LPG1(%r13) # get address of machine_flags
201# 62#
202# find out if we have an IEEE fpu 63# find out if we have an IEEE fpu
@@ -273,7 +134,6 @@ startup_continue:
273 .long 0 # cr15: linkage stack operations 134 .long 0 # cr15: linkage stack operations
274.Lduct: .long 0,0,0,0,0,0,0,0 135.Lduct: .long 0,0,0,0,0,0,0,0
275 .long 0,0,0,0,0,0,0,0 136 .long 0,0,0,0,0,0,0,0
276.Lpcmem:.long 0x00080000,0x80000000 + .Lchkmem
277.Lpcfpu:.long 0x00080000,0x80000000 + .Lchkfpu 137.Lpcfpu:.long 0x00080000,0x80000000 + .Lchkfpu
278.Lpccsp:.long 0x00080000,0x80000000 + .Lchkcsp 138.Lpccsp:.long 0x00080000,0x80000000 + .Lchkcsp
279.Lpcmvpg:.long 0x00080000,0x80000000 + .Lchkmvpg 139.Lpcmvpg:.long 0x00080000,0x80000000 + .Lchkmvpg
@@ -284,7 +144,9 @@ startup_continue:
284.Lbss_bgn: .long __bss_start 144.Lbss_bgn: .long __bss_start
285.Lbss_end: .long _end 145.Lbss_end: .long _end
286.Lparmaddr: .long PARMAREA 146.Lparmaddr: .long PARMAREA
287.Lsccbaddr: .long .Lsccb 147.Linittu: .long init_thread_union
148.Lstartup_init:
149 .long startup_init
288 150
289 .globl ipl_schib 151 .globl ipl_schib
290ipl_schib: 152ipl_schib:
@@ -300,26 +162,6 @@ ipl_devno:
300 .word 0 162 .word 0
301 163
302 .org 0x12000 164 .org 0x12000
303.globl s390_readinfo_sccb
304s390_readinfo_sccb:
305.Lsccb:
306 .hword 0x1000 # length, one page
307 .byte 0x00,0x00,0x00
308 .byte 0x80 # variable response bit set
309.Lsccbr:
310 .hword 0x00 # response code
311.Lscpincr1:
312 .hword 0x00
313.Lscpa1:
314 .byte 0x00
315 .fill 89,1,0
316.Lscpa2:
317 .int 0x00
318.Lscpincr2:
319 .quad 0x00
320 .fill 3984,1,0
321 .org 0x13000
322
323#ifdef CONFIG_SHARED_KERNEL 165#ifdef CONFIG_SHARED_KERNEL
324 .org 0x100000 166 .org 0x100000
325#endif 167#endif