linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH 09/20] powerpc/powernv: Get kernel command line accross OPAL takeover
Date: Tue, 20 Sep 2011 13:44:56 +1000	[thread overview]
Message-ID: <1316490307-28030-9-git-send-email-benh@kernel.crashing.org> (raw)
In-Reply-To: <1316490307-28030-1-git-send-email-benh@kernel.crashing.org>

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>
---
 arch/powerpc/kernel/prom.c             |    7 +++++++
 arch/powerpc/kernel/prom_init.c        |    4 ++++
 arch/powerpc/kernel/prom_init_check.sh |    3 ++-
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 174e1e9..7b90c56 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -712,6 +712,13 @@ void __init early_init_devtree(void *params)
 	of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL);
 #endif
 
+	/* Pre-initialize the cmd_line with the content of boot_commmand_line,
+	 * which will be empty except when the content of the variable has
+	 * been overriden by a bootloading mechanism. This happens typically
+	 * with HAL takeover
+	 */
+	strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
+
 	/* Retrieve various informations from the /chosen node of the
 	 * device-tree, including the platform type, initrd location and
 	 * size, TCE reserve, and more ...
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 9369287..e3f3904 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)
 		opal_addr = top_addr;
 	args->hal_addr = opal_addr;
 
+	/* Copy the command line to the kernel image */
+	strlcpy(RELOC(boot_command_line), RELOC(prom_cmd_line),
+		COMMAND_LINE_SIZE);
+
 	prom_debug("  k_image    = 0x%lx\n", args->k_image);
 	prom_debug("  k_size     = 0x%lx\n", args->k_size);
 	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 20af6aa..70f4286 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
 __secondary_hold_acknowledge __secondary_hold_spinloop __start
 strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224
 reloc_got2 kernstart_addr memstart_addr linux_banner _stext
-opal_query_takeover opal_do_takeover opal_enter_rtas opal_secondary_entry"
+opal_query_takeover opal_do_takeover opal_enter_rtas opal_secondary_entry
+boot_command_line"
 
 NM="$1"
 OBJ="$2"
-- 
1.7.4.1

  parent reply	other threads:[~2011-09-20  3:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20  3:44 [PATCH 01/20] powerpc/udbg: Fix Kconfig entry for avoiding 44x early debug with KVM Benjamin Herrenschmidt
2011-09-20  3:44 ` [PATCH 02/20] powerpc/smp: More generic support for "soft hotplug" Benjamin Herrenschmidt
2011-09-20  3:44 ` [PATCH 03/20] powerpc/pci: Call pcie_bus_configure_settings() Benjamin Herrenschmidt
2011-09-20  3:44 ` [PATCH 04/20] powerpc/powernv: Don't clobber r9 in relative_toc() Benjamin Herrenschmidt
2011-09-20  3:44 ` [PATCH 05/20] powerpc: Add skeleton PowerNV platform Benjamin Herrenschmidt
2011-09-20  3:44 ` [PATCH 06/20] of: Change logic to overwrite cmd_line with CONFIG_CMDLINE Benjamin Herrenschmidt
2011-09-20  4:30   ` Grant Likely
2011-09-20  4:37     ` Benjamin Herrenschmidt
2011-09-20  4:45     ` Grant Likely
2011-09-20  3:44 ` [PATCH 07/20] powerpc/powernv: Add CPU hotplug support Benjamin Herrenschmidt
2011-09-20  3:44 ` [PATCH 08/20] powerpc/powernv: Add OPAL takeover from PowerVM Benjamin Herrenschmidt
2011-09-20  3:44 ` Benjamin Herrenschmidt [this message]
2011-09-20  3:44 ` [PATCH 10/20] powerpc/powernv: Basic support for OPAL Benjamin Herrenschmidt
2011-09-20  3:44 ` [PATCH 11/20] powerpc/powernv: Add support for instanciating OPAL v2 from Open Firmware Benjamin Herrenschmidt
2011-09-20  3:44 ` [PATCH 12/20] powerpc/powernv: Support for OPAL console Benjamin Herrenschmidt
2011-09-20  3:45 ` [PATCH 13/20] powerpc/powernv: Hookup reboot and poweroff functions Benjamin Herrenschmidt
2011-09-20  3:45 ` [PATCH 14/20] powerpc/powernv: Add RTC and NVRAM support plus RTAS fallbacks Benjamin Herrenschmidt
2011-09-20  3:45 ` [PATCH 15/20] powerpc/powernv: Add OPAL ICS backend Benjamin Herrenschmidt
2011-09-20  3:45 ` [PATCH 16/20] powerpc/powernv: Register and handle OPAL interrupts Benjamin Herrenschmidt
2011-09-20  3:45 ` [PATCH 17/20] powerpc/powernv: Machine check and other system interrupts Benjamin Herrenschmidt
2011-09-20  3:45 ` [PATCH 18/20] powerpc/powernv: Add support for p5ioc2 PCI-X and PCIe Benjamin Herrenschmidt
2011-09-20  3:45 ` [PATCH 19/20] powerpc/powernv: Implement MSI support for p5ioc2 PCIe Benjamin Herrenschmidt
2011-09-20  3:45 ` [PATCH 20/20] powerpc/powernv: Handle PCI-X/PCIe reset delay Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316490307-28030-9-git-send-email-benh@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).