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>
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index a5d5a33..9b3ecea 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -127,6 +127,15 @@
 	  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