aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/early.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2007-07-10 05:24:09 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-07-10 05:24:42 -0400
commit05dd25307ca67cbfa0207bbba2e6c79fa97d125b (patch)
tree4601c5732e71883bffab31a4a786f838e8473f58 /arch/s390/kernel/early.c
parentbccdbdc9bd7db3a32c14d8a47f1fb66e3de3c92f (diff)
[S390] sclp: introduce some new interfaces.
Introduce some new interfaces so that random subsystems don't have to mess around with sclp internal structures. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/early.c')
-rw-r--r--arch/s390/kernel/early.c44
1 files changed, 11 insertions, 33 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 50538e545618..9fcf3f1f47b6 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -171,37 +171,6 @@ static inline int memory_fast_detect(void)
171} 171}
172#endif 172#endif
173 173
174#define ADDR2G (1UL << 31)
175
176static noinline __init unsigned long sclp_memory_detect(void)
177{
178 struct sclp_readinfo_sccb *sccb;
179 unsigned long long memsize;
180
181 sccb = &s390_readinfo_sccb;
182
183 if (sccb->header.response_code != 0x10)
184 return 0;
185
186 if (sccb->rnsize)
187 memsize = sccb->rnsize << 20;
188 else
189 memsize = sccb->rnsize2 << 20;
190 if (sccb->rnmax)
191 memsize *= sccb->rnmax;
192 else
193 memsize *= sccb->rnmax2;
194#ifndef CONFIG_64BIT
195 /*
196 * Can't deal with more than 2G in 31 bit addressing mode, so
197 * limit the value in order to avoid strange side effects.
198 */
199 if (memsize > ADDR2G)
200 memsize = ADDR2G;
201#endif
202 return (unsigned long) memsize;
203}
204
205static inline __init unsigned long __tprot(unsigned long addr) 174static inline __init unsigned long __tprot(unsigned long addr)
206{ 175{
207 int cc = -1; 176 int cc = -1;
@@ -218,6 +187,7 @@ static inline __init unsigned long __tprot(unsigned long addr)
218 187
219/* Checking memory in 128KB increments. */ 188/* Checking memory in 128KB increments. */
220#define CHUNK_INCR (1UL << 17) 189#define CHUNK_INCR (1UL << 17)
190#define ADDR2G (1UL << 31)
221 191
222static noinline __init void find_memory_chunks(unsigned long memsize) 192static noinline __init void find_memory_chunks(unsigned long memsize)
223{ 193{
@@ -293,7 +263,7 @@ static noinline __init void setup_lowcore_early(void)
293 */ 263 */
294void __init startup_init(void) 264void __init startup_init(void)
295{ 265{
296 unsigned long memsize; 266 unsigned long long memsize;
297 267
298 ipl_save_parameters(); 268 ipl_save_parameters();
299 clear_bss_section(); 269 clear_bss_section();
@@ -306,7 +276,15 @@ void __init startup_init(void)
306 setup_lowcore_early(); 276 setup_lowcore_early();
307 sclp_readinfo_early(); 277 sclp_readinfo_early();
308 memsize = sclp_memory_detect(); 278 memsize = sclp_memory_detect();
279#ifndef CONFIG_64BIT
280 /*
281 * Can't deal with more than 2G in 31 bit addressing mode, so
282 * limit the value in order to avoid strange side effects.
283 */
284 if (memsize > ADDR2G)
285 memsize = ADDR2G;
286#endif
309 if (memory_fast_detect() < 0) 287 if (memory_fast_detect() < 0)
310 find_memory_chunks(memsize); 288 find_memory_chunks((unsigned long) memsize);
311 lockdep_on(); 289 lockdep_on();
312} 290}