* [U-Boot] [PATCH v2] sunxi: Add a bootcmd_sunxi_compat to the default environment to boot old kernels
@ 2015-10-11 10:47 Hans de Goede
2015-10-11 11:07 ` Ian Campbell
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2015-10-11 10:47 UTC (permalink / raw)
To: u-boot
Add a bootcmd_sunxi_compat 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_sunxi_compat"
rather then needing to have 2 separate setups / sdcards for old and
new kernels.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Rename env variable from bootcmd_old to bootcmd_sunxi_compat
-Set the default root environment value used from the bootcmd_sunxi_compat
script rather then polluting the default environment with a "root" value
---
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..c7729d1 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_SUNXI_COMPAT \
+ "bootcmd_sunxi_compat=" \
+ "setenv root /dev/mmcblk0p3 rootwait; " \
+ "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_SUNXI_COMPAT
+#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_SUNXI_COMPAT \
BOOTENV
#else /* ifndef CONFIG_SPL_BUILD */
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH v2] sunxi: Add a bootcmd_sunxi_compat to the default environment to boot old kernels
2015-10-11 10:47 [U-Boot] [PATCH v2] sunxi: Add a bootcmd_sunxi_compat to the default environment to boot old kernels Hans de Goede
@ 2015-10-11 11:07 ` Ian Campbell
0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2015-10-11 11:07 UTC (permalink / raw)
To: u-boot
On Sun, 2015-10-11 at 12:47 +0200, Hans de Goede wrote:
> Add a bootcmd_sunxi_compat 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_sunxi_compat"
> rather then needing to have 2 separate setups / sdcards for old and
> new kernels.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-11 11:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-11 10:47 [U-Boot] [PATCH v2] sunxi: Add a bootcmd_sunxi_compat to the default environment to boot old kernels Hans de Goede
2015-10-11 11:07 ` Ian Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox