diff mbox series

[v2,4/5] colibri-imx6ull: add update_uboot wrapper

Message ID 20191209103333.6754-5-igor.opaniuk@gmail.com
State Accepted
Commit ba195a9487c1bd52f1c58bb6aca4151ed3ae9e76
Delegated to: Stefano Babic
Headers show
Series toradex: imx: add update_uboot wrapper | expand

Commit Message

Igor Opaniuk Dec. 9, 2019, 10:33 a.m. UTC
From: Igor Opaniuk <igor.opaniuk@toradex.com>

Add universal update_uboot wrapper that helps to update
U-Boot image on internal storage.

Usage example:
> tftpboot ${loadaddr} ${board_name}/u-boot-nand.imx
> run update_uboot

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 include/configs/colibri-imx6ull.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Stefano Babic Dec. 29, 2019, 10:26 a.m. UTC | #1
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
> Add universal update_uboot wrapper that helps to update
> U-Boot image on internal storage.
> Usage example:
> > tftpboot ${loadaddr} ${board_name}/u-boot-nand.imx
> > run update_uboot
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Applied to u-boot-imx, -next, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h
index 0c36a57a0e..ea5ba6bfce 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -47,6 +47,12 @@ 
 	"ramdisk_addr_r=0x82200000\0" \
 	"scriptaddr=0x87000000\0"
 
+#define UBOOT_UPDATE \
+	"update_uboot=nand erase.part u-boot1 && " \
+		"nand write ${loadaddr} u-boot1 ${filesize} && " \
+		"nand erase.part u-boot2 && " \
+		"nand write ${loadaddr} u-boot2 ${filesize}\0"
+
 #define NFS_BOOTCMD \
 	"nfsargs=ip=:::::eth0: root=/dev/nfs\0" \
 	"nfsboot=run setup; " \
@@ -83,6 +89,7 @@ 
 	MEM_LAYOUT_ENV_SETTINGS \
 	NFS_BOOTCMD \
 	UBI_BOOTCMD \
+	UBOOT_UPDATE \
 	"console=ttymxc0\0" \
 	"defargs=user_debug=30\0" \
 	"dfu_alt_info=" DFU_ALT_NAND_INFO "\0" \