summaryrefslogtreecommitdiff
path: root/arch/mips/lib
diff options
context:
space:
mode:
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2015-01-14 21:44:13 +0100
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2015-01-21 14:02:48 +0100
commitca65e5851fb60ae58b46e2ad76a90b39d9c378c3 (patch)
treec7a7a51f2c161760bea77581f7513dcfcaa62c1d /arch/mips/lib
parent25fc664f408e2e78623d03071884bafc62251553 (diff)
MIPS: bootm: refactor preparation of Linux kernel environment
Move preparation of Linux kernel environment 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/lib')
-rw-r--r--arch/mips/lib/bootm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index a028a47ab9..fa579b36e4 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -26,6 +26,12 @@ DECLARE_GLOBAL_DATA_PTR;
#define mips_boot_cmdline_legacy 0
#endif
+#if defined(CONFIG_MIPS_BOOT_ENV_LEGACY)
+#define mips_boot_env_legacy 1
+#else
+#define mips_boot_env_legacy 0
+#endif
+
static int linux_argc;
static char **linux_argv;
static char *linux_argp;
@@ -177,7 +183,7 @@ static void linux_env_set(const char *env_name, const char *env_val)
}
}
-static void boot_prep_linux(bootm_headers_t *images)
+static void linux_env_legacy(bootm_headers_t *images)
{
char env_buf[12];
const char *cp;
@@ -225,6 +231,12 @@ static void boot_prep_linux(bootm_headers_t *images)
}
}
+static void boot_prep_linux(bootm_headers_t *images)
+{
+ if (mips_boot_env_legacy)
+ linux_env_legacy(images);
+}
+
static void boot_jump_linux(bootm_headers_t *images)
{
typedef void __noreturn (*kernel_entry_t)(int, ulong, ulong, ulong);