Add a bootcmd_old value to the default environment when building with
CONFIG_OLD_SUNXI_KERNEL_COMPAT, this way people who occasionally want
to boot an old kernel can do so by simply typing "run bootcmd_old"
rather then needing to have 2 separe setups / sdcards for old and
new kernels.

Signed-off-by: Hans de Goede <hdego...@redhat.com>
---
 include/configs/sunxi-common.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 29745fe..37e9c6b 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -464,6 +464,22 @@ extern int soft_i2c_gpio_scl;
        func(PXE, pxe, na) \
        func(DHCP, dhcp, na)
 
+#ifdef CONFIG_OLD_SUNXI_KERNEL_COMPAT
+#define BOOTCMD_OLD \
+       "root=/dev/mmcblk0p3 rootwait\0" \
+       "bootcmd_old=" \
+               "if ext2load mmc 0 0x44000000 uEnv.txt; then " \
+                       "echo Loaded environment from uEnv.txt; " \
+                       "env import -t 0x44000000 ${filesize}; " \
+               "fi; " \
+               "setenv bootargs console=${console} root=${root} ${extraargs}; 
" \
+               "ext2load mmc 0 0x43000000 script.bin && " \
+               "ext2load mmc 0 0x48000000 uImage && " \
+               "bootm 0x48000000\0"
+#else
+#define BOOTCMD_OLD
+#endif
+
 #include <config_distro_bootcmd.h>
 
 #ifdef CONFIG_USB_KEYBOARD
@@ -495,6 +511,7 @@ extern int soft_i2c_gpio_scl;
        MTD_ENV_SETTINGS \
        "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
        "console=ttyS0,115200\0" \
+       BOOTCMD_OLD \
        BOOTENV
 
 #else /* ifndef CONFIG_SPL_BUILD */
-- 
2.5.0

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to