diff options
author | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2015-01-14 21:44:13 +0100 |
---|---|---|
committer | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2015-01-21 14:02:48 +0100 |
commit | 25fc664f408e2e78623d03071884bafc62251553 (patch) | |
tree | 81e076263e7b5310dbd1974cfff8b2a504590899 /arch/mips | |
parent | 768f6096f9c389b5ed36bee2957bee16b085fc4a (diff) | |
download | u-boot-imx-25fc664f408e2e78623d03071884bafc62251553.zip u-boot-imx-25fc664f408e2e78623d03071884bafc62251553.tar.gz u-boot-imx-25fc664f408e2e78623d03071884bafc62251553.tar.bz2 |
MIPS: bootm: refactor preparation of Linux kernel command line
Move preparation of Linux kernel command line in a separate
function and mark it as legacy. Add a Kconfig option to make
that legacy mode configurable.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/Kconfig | 13 | ||||
-rw-r--r-- | arch/mips/lib/bootm.c | 16 |
2 files changed, 27 insertions, 2 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 4991da2..a5d5a33 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -116,6 +116,19 @@ config CPU_MIPS64_R2 endchoice +menu "OS boot interface" + +config MIPS_BOOT_CMDLINE_LEGACY + bool "Hand over legacy command line to Linux kernel" + default y + help + Enable this option if you want U-Boot to hand over the Yamon-style + command line to the kernel. All bootargs will be prepared as argc/argv + compatible list. The argument count (argc) is stored in register $a0. + The address of the argument list (argv) is stored in register $a1. + +endmenu + config SUPPORTS_BIG_ENDIAN bool diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index e0722d2..a028a47 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -20,6 +20,12 @@ DECLARE_GLOBAL_DATA_PTR; #define mips_boot_malta 0 #endif +#if defined(CONFIG_MIPS_BOOT_CMDLINE_LEGACY) +#define mips_boot_cmdline_legacy 1 +#else +#define mips_boot_cmdline_legacy 0 +#endif + static int linux_argc; static char **linux_argv; static char *linux_argp; @@ -92,7 +98,7 @@ static void linux_cmdline_dump(void) debug(" arg %03d: %s\n", i, linux_argv[i]); } -static void boot_cmdline_linux(bootm_headers_t *images) +static void linux_cmdline_legacy(bootm_headers_t *images) { const char *bootargs, *next, *quote; @@ -130,8 +136,14 @@ static void boot_cmdline_linux(bootm_headers_t *images) bootargs = next; } +} - linux_cmdline_dump(); +static void boot_cmdline_linux(bootm_headers_t *images) +{ + if (mips_boot_cmdline_legacy) { + linux_cmdline_legacy(images); + linux_cmdline_dump(); + } } static void linux_env_init(void) |