aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/setup.c108
1 files changed, 45 insertions, 63 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 24f62f16c0e5..0a04e4a564b2 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -78,8 +78,6 @@ extern int _text,_etext, _edata, _end;
78 78
79#include <asm/setup.h> 79#include <asm/setup.h>
80 80
81static char command_line[COMMAND_LINE_SIZE] = { 0, };
82
83static struct resource code_resource = { 81static struct resource code_resource = {
84 .name = "Kernel code", 82 .name = "Kernel code",
85 .start = (unsigned long) &_text, 83 .start = (unsigned long) &_text,
@@ -335,63 +333,38 @@ add_memory_hole(unsigned long start, unsigned long end)
335 } 333 }
336} 334}
337 335
338static void __init 336static int __init early_parse_mem(char *p)
339parse_cmdline_early(char **cmdline_p) 337{
338 memory_end = memparse(p, &p);
339 return 0;
340}
341early_param("mem", early_parse_mem);
342
343/*
344 * "ipldelay=XXX[sm]" sets ipl delay in seconds or minutes
345 */
346static int __init early_parse_ipldelay(char *p)
340{ 347{
341 char c = ' ', cn, *to = command_line, *from = COMMAND_LINE;
342 unsigned long delay = 0; 348 unsigned long delay = 0;
343 349
344 /* Save unparsed command line copy for /proc/cmdline */ 350 delay = simple_strtoul(p, &p, 0);
345 memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
346 saved_command_line[COMMAND_LINE_SIZE-1] = '\0';
347 351
348 for (;;) { 352 switch (*p) {
349 /* 353 case 's':
350 * "mem=XXX[kKmM]" sets memsize 354 case 'S':
351 */ 355 delay *= 1000000;
352 if (c == ' ' && strncmp(from, "mem=", 4) == 0) { 356 break;
353 memory_end = simple_strtoul(from+4, &from, 0); 357 case 'm':
354 if ( *from == 'K' || *from == 'k' ) { 358 case 'M':
355 memory_end = memory_end << 10; 359 delay *= 60 * 1000000;
356 from++;
357 } else if ( *from == 'M' || *from == 'm' ) {
358 memory_end = memory_end << 20;
359 from++;
360 }
361 }
362 /*
363 * "ipldelay=XXX[sm]" sets ipl delay in seconds or minutes
364 */
365 if (c == ' ' && strncmp(from, "ipldelay=", 9) == 0) {
366 delay = simple_strtoul(from+9, &from, 0);
367 if (*from == 's' || *from == 'S') {
368 delay = delay*1000000;
369 from++;
370 } else if (*from == 'm' || *from == 'M') {
371 delay = delay*60*1000000;
372 from++;
373 }
374 /* now wait for the requested amount of time */
375 udelay(delay);
376 }
377 cn = *(from++);
378 if (!cn)
379 break;
380 if (cn == '\n')
381 cn = ' '; /* replace newlines with space */
382 if (cn == 0x0d)
383 cn = ' '; /* replace 0x0d with space */
384 if (cn == ' ' && c == ' ')
385 continue; /* remove additional spaces */
386 c = cn;
387 if (to - command_line >= COMMAND_LINE_SIZE)
388 break;
389 *(to++) = c;
390 } 360 }
391 if (c == ' ' && to > command_line) to--; 361
392 *to = '\0'; 362 /* now wait for the requested amount of time */
393 *cmdline_p = command_line; 363 udelay(delay);
364
365 return 0;
394} 366}
367early_param("ipldelay", early_parse_ipldelay);
395 368
396static void __init 369static void __init
397setup_lowcore(void) 370setup_lowcore(void)
@@ -580,9 +553,26 @@ setup_arch(char **cmdline_p)
580 "We are running native (64 bit mode)\n"); 553 "We are running native (64 bit mode)\n");
581#endif /* CONFIG_64BIT */ 554#endif /* CONFIG_64BIT */
582 555
556 /* Save unparsed command line copy for /proc/cmdline */
557 strlcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
558
559 *cmdline_p = COMMAND_LINE;
560 *(*cmdline_p + COMMAND_LINE_SIZE - 1) = '\0';
561
583 ROOT_DEV = Root_RAM0; 562 ROOT_DEV = Root_RAM0;
563
564 init_mm.start_code = PAGE_OFFSET;
565 init_mm.end_code = (unsigned long) &_etext;
566 init_mm.end_data = (unsigned long) &_edata;
567 init_mm.brk = (unsigned long) &_end;
568
569 memory_end = memory_size;
570
571 parse_early_param();
572
584#ifndef CONFIG_64BIT 573#ifndef CONFIG_64BIT
585 memory_end = memory_size & ~0x400000UL; /* align memory end to 4MB */ 574 memory_end &= ~0x400000UL;
575
586 /* 576 /*
587 * We need some free virtual space to be able to do vmalloc. 577 * We need some free virtual space to be able to do vmalloc.
588 * On a machine with 2GB memory we make sure that we have at 578 * On a machine with 2GB memory we make sure that we have at
@@ -591,17 +581,9 @@ setup_arch(char **cmdline_p)
591 if (memory_end > 1920*1024*1024) 581 if (memory_end > 1920*1024*1024)
592 memory_end = 1920*1024*1024; 582 memory_end = 1920*1024*1024;
593#else /* CONFIG_64BIT */ 583#else /* CONFIG_64BIT */
594 memory_end = memory_size & ~0x200000UL; /* detected in head.s */ 584 memory_end &= ~0x200000UL;
595#endif /* CONFIG_64BIT */ 585#endif /* CONFIG_64BIT */
596 586
597 init_mm.start_code = PAGE_OFFSET;
598 init_mm.end_code = (unsigned long) &_etext;
599 init_mm.end_data = (unsigned long) &_edata;
600 init_mm.brk = (unsigned long) &_end;
601
602 parse_cmdline_early(cmdline_p);
603 parse_early_param();
604
605 setup_memory(); 587 setup_memory();
606 setup_resources(); 588 setup_resources();
607 setup_lowcore(); 589 setup_lowcore();