]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
MIPS: bootm: refactor preparation of Linux kernel environment
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 14 Jan 2015 20:44:13 +0000 (21:44 +0100)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 21 Jan 2015 13:02:48 +0000 (14:02 +0100)
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>
arch/mips/Kconfig
arch/mips/lib/bootm.c

index a5d5a336d3b12e43520fa755fd091b09daa31b19..9b3ecea377db40f30966511a0f84194bad6fe762 100644 (file)
@@ -127,6 +127,15 @@ config MIPS_BOOT_CMDLINE_LEGACY
          compatible list. The argument count (argc) is stored in register $a0.
          The address of the argument list (argv) is stored in register $a1.
 
+config MIPS_BOOT_ENV_LEGACY
+       bool "Hand over legacy environment to Linux kernel"
+       default y
+       help
+         Enable this option if you want U-Boot to hand over the Yamon-style
+         environment to the kernel. Information like memory size, initrd
+         address and size will be prepared as zero-terminated key/value list.
+         The address of the enviroment is stored in register $a2.
+
 endmenu
 
 config SUPPORTS_BIG_ENDIAN
index a028a47ab9b5f32691ef354927fe818b92365bbf..fa579b36e49709fad660f09d82b82656e2fd1c85 100644 (file)
@@ -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);