[Skiboot] [PATCH v2 5/7] core/init: take bootargs from nvram

Oliver O'Halloran oohall at gmail.com
Wed Aug 17 15:32:52 AEST 2016


Adds support for supplying the kernel boot arguments from the "bootargs"
configuration string in the ibm,skiboot partition.

Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
---
 core/init.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/core/init.c b/core/init.c
index 28e9401106c6..57f153869e0d 100644
--- a/core/init.c
+++ b/core/init.c
@@ -404,6 +404,7 @@ int64_t mem_dump_free(void);
 void __noreturn load_and_boot_kernel(bool is_reboot)
 {
 	const struct dt_property *memprop;
+	const char *cmdline;
 	uint64_t mem_top;
 	void *fdt;
 
@@ -449,9 +450,14 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
 	occ_pstates_init();
 
 	/* Set kernel command line argument if specified */
+	cmdline = nvram_query("bootargs");
 #ifdef KERNEL_COMMAND_LINE
-	dt_add_property_string(dt_chosen, "bootargs", KERNEL_COMMAND_LINE);
+	if (!cmdline)
+		cmdline = KERNEL_COMMAND_LINE;
 #endif
+	/* some platforms always pass bootargs through the fdt */
+	if (cmdline && !dt_find_property(dt_chosen, "bootargs"))
+		dt_add_property_string(dt_chosen, "bootargs", cmdline);
 
 	op_display(OP_LOG, OP_MOD_INIT, 0x000B);
 
-- 
2.5.5



More information about the Skiboot mailing list