From b55cb439e7fb4c23f8448d38f2897def15f15385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 15 Oct 2013 22:12:30 +0200 Subject: [PATCH] U-Boot: pass around argv and /chosen/bootargs Not really handled correctly yet, but at least they are passed. --- src/system/boot/platform/u-boot/start.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/system/boot/platform/u-boot/start.cpp b/src/system/boot/platform/u-boot/start.cpp index e1dbee62aa..bdec391c36 100644 --- a/src/system/boot/platform/u-boot/start.cpp +++ b/src/system/boot/platform/u-boot/start.cpp @@ -184,6 +184,12 @@ start_raw(int argc, const char **argv) args.platform.fdt_data = NULL; args.platform.fdt_size = 0; + if (argv) { + // skip the kernel name + args.arguments = ++argv; + args.arguments_count = --argc; + } + // if we get passed a uimage, try to find the third blob only if we do not have FDT data yet if (gUImage != NULL && !gFDT @@ -211,7 +217,7 @@ start_raw(int argc, const char **argv) args.platform.fdt_size = fdt_totalsize(gFDT); } - // if we get passed an FDT, check /chosen for initrd + // if we get passed an FDT, check /chosen for initrd and bootargs if (gFDT != NULL) { int node = fdt_path_offset(gFDT, "/chosen"); const void *prop; @@ -231,6 +237,14 @@ start_raw(int argc, const char **argv) dprintf("Found boot tgz from FDT @ %p, %" B_PRIu32 " bytes\n", args.platform.boot_tgz_data, args.platform.boot_tgz_size); } + prop = fdt_getprop(gFDT, node, "bootargs", &len); + if (prop) { + dprintf("Found bootargs: %s\n", (const char *)prop); + static const char *sArgs[] = { NULL, NULL }; + sArgs[0] = (const char *)prop; + args.arguments = sArgs; + args.arguments_count = 1; + } } }