aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-09-19 13:44:56 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-09-20 02:09:48 -0400
commit817c21ad9a1f00926f080265493923ada3458c63 (patch)
tree84733af08a403e6f1c1846a2e9a21cf49276660d
parent27f4488872d9ef2a4b9aa2be58fb0789d6c0ba84 (diff)
powerpc/powernv: Get kernel command line accross OPAL takeover
We stash it in boot_command_line which isn't in BSS and so won't be overwritten. We then use that as a default cmd_line before we walk the device-tree. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/kernel/prom.c7
-rw-r--r--arch/powerpc/kernel/prom_init.c4
-rw-r--r--arch/powerpc/kernel/prom_init_check.sh3
3 files changed, 13 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 174e1e96175e..7b90c564e932 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -712,6 +712,13 @@ void __init early_init_devtree(void *params)
712 of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL); 712 of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL);
713#endif 713#endif
714 714
715 /* Pre-initialize the cmd_line with the content of boot_commmand_line,
716 * which will be empty except when the content of the variable has
717 * been overriden by a bootloading mechanism. This happens typically
718 * with HAL takeover
719 */
720 strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
721
715 /* Retrieve various informations from the /chosen node of the 722 /* Retrieve various informations from the /chosen node of the
716 * device-tree, including the platform type, initrd location and 723 * device-tree, including the platform type, initrd location and
717 * size, TCE reserve, and more ... 724 * size, TCE reserve, and more ...
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 9369287aa8c2..e3f390427216 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1449,6 +1449,10 @@ static void prom_opal_takeover(void)
1449 opal_addr = top_addr; 1449 opal_addr = top_addr;
1450 args->hal_addr = opal_addr; 1450 args->hal_addr = opal_addr;
1451 1451
1452 /* Copy the command line to the kernel image */
1453 strlcpy(RELOC(boot_command_line), RELOC(prom_cmd_line),
1454 COMMAND_LINE_SIZE);
1455
1452 prom_debug(" k_image = 0x%lx\n", args->k_image); 1456 prom_debug(" k_image = 0x%lx\n", args->k_image);
1453 prom_debug(" k_size = 0x%lx\n", args->k_size); 1457 prom_debug(" k_size = 0x%lx\n", args->k_size);
1454 prom_debug(" k_entry = 0x%lx\n", args->k_entry); 1458 prom_debug(" k_entry = 0x%lx\n", args->k_entry);
diff --git a/arch/powerpc/kernel/prom_init_check.sh b/arch/powerpc/kernel/prom_init_check.sh
index 20af6aada517..70f4286eaa7a 100644
--- a/arch/powerpc/kernel/prom_init_check.sh
+++ b/arch/powerpc/kernel/prom_init_check.sh
@@ -21,7 +21,8 @@ _end enter_prom memcpy memset reloc_offset __secondary_hold
21__secondary_hold_acknowledge __secondary_hold_spinloop __start 21__secondary_hold_acknowledge __secondary_hold_spinloop __start
22strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224 22strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224
23reloc_got2 kernstart_addr memstart_addr linux_banner _stext 23reloc_got2 kernstart_addr memstart_addr linux_banner _stext
24opal_query_takeover opal_do_takeover opal_enter_rtas opal_secondary_entry" 24opal_query_takeover opal_do_takeover opal_enter_rtas opal_secondary_entry
25boot_command_line"
25 26
26NM="$1" 27NM="$1"
27OBJ="$2" 28OBJ="$2"