public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 0/5] toradex: imx: add update_uboot wrapper
@ 2019-12-09 10:33 Igor Opaniuk
  2019-12-09 10:33 ` [PATCH v2 1/5] colibri_imx7: " Igor Opaniuk
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Igor Opaniuk @ 2019-12-09 10:33 UTC (permalink / raw)
  To: u-boot

This patch series introduces universtal update_uboot
wrapper that helps to update U-Boot image on internal storage.

Example of usage:
> tftpboot ${loadaddr} ${board_name}/u-boot.img
> run update_uboot
> tftpboot ${loadaddr} ${board_name}/SPL
> run update_spl

v2:
- remove uboot_hwpart defition for NAND setups

Igor Opaniuk (5):
  colibri_imx7: add update_uboot wrapper
  apalis_imx6: add update_uboot wrapper
  colibri_imx6: add update_uboot wrapper
  colibri-imx6ull: add update_uboot wrapper
  colibri_vf: add update_uboot wrapper

 include/configs/apalis_imx6.h     | 12 ++++++++++++
 include/configs/colibri-imx6ull.h |  7 +++++++
 include/configs/colibri_imx6.h    | 12 ++++++++++++
 include/configs/colibri_imx7.h    | 17 +++++++++++++++++
 include/configs/colibri_vf.h      |  5 +++++
 5 files changed, 53 insertions(+)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 1/5] colibri_imx7: add update_uboot wrapper
  2019-12-09 10:33 [PATCH v2 0/5] toradex: imx: add update_uboot wrapper Igor Opaniuk
@ 2019-12-09 10:33 ` Igor Opaniuk
  2019-12-29 10:28   ` sbabic at denx.de
  2019-12-09 10:33 ` [PATCH v2 2/5] apalis_imx6: " Igor Opaniuk
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Igor Opaniuk @ 2019-12-09 10:33 UTC (permalink / raw)
  To: u-boot

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-dtb.imx
> run update_uboot

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

 include/configs/colibri_imx7.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h
index d92db7192e..88e1be1ef5 100644
--- a/include/configs/colibri_imx7.h
+++ b/include/configs/colibri_imx7.h
@@ -43,6 +43,22 @@
 #define CONFIG_NETMASK			255.255.255.0
 #define CONFIG_SERVERIP			192.168.10.1
 
+#if defined(CONFIG_TARGET_COLIBRI_IMX7_EMMC)
+#define UBOOT_UPDATE \
+	"uboot_hwpart=1\0" \
+	"uboot_blk=2\0" \
+	"set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && " \
+		"setexpr blkcnt ${blkcnt} / 0x200\0" \
+	"update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
+		"mmc write ${loadaddr} ${uboot_blk} ${blkcnt}\0"
+#elif defined(CONFIG_TARGET_COLIBRI_IMX7_NAND)
+#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"
+#endif
+
 #ifndef PARTS_DEFAULT
 /* Define the default GPT table for eMMC */
 #define PARTS_DEFAULT \
@@ -163,6 +179,7 @@
 	MEM_LAYOUT_ENV_SETTINGS \
 	NFS_BOOTCMD \
 	MODULE_EXTRA_ENV_SETTINGS \
+	UBOOT_UPDATE \
 	"boot_file=zImage\0" \
 	"console=ttymxc0\0" \
 	"defargs=\0" \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 2/5] apalis_imx6: add update_uboot wrapper
  2019-12-09 10:33 [PATCH v2 0/5] toradex: imx: add update_uboot wrapper Igor Opaniuk
  2019-12-09 10:33 ` [PATCH v2 1/5] colibri_imx7: " Igor Opaniuk
@ 2019-12-09 10:33 ` Igor Opaniuk
  2019-12-29 10:26   ` sbabic at denx.de
  2019-12-09 10:33 ` [PATCH v2 3/5] colibri_imx6: " Igor Opaniuk
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Igor Opaniuk @ 2019-12-09 10:33 UTC (permalink / raw)
  To: u-boot

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.img
> run update_uboot
> tftpboot ${loadaddr} ${board_name}/SPL
> run update_spl

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

 include/configs/apalis_imx6.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h
index 50a4391cd4..800f27ccbb 100644
--- a/include/configs/apalis_imx6.h
+++ b/include/configs/apalis_imx6.h
@@ -121,6 +121,17 @@
 	"imx6q-apalis-eval.dtb fat 0 1;" \
 	"imx6q-apalis-cam-eval.dtb fat 0 1"
 
+#define UBOOT_UPDATE \
+	"uboot_hwpart=1\0" \
+	"uboot_blk=8a\0" \
+	"uboot_spl_blk=2\0" \
+	"set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && " \
+		"setexpr blkcnt ${blkcnt} / 0x200\0" \
+	"update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
+		"mmc write ${loadaddr} ${uboot_blk} ${blkcnt}\0" \
+	"update_spl=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
+		"mmc write ${loadaddr} ${uboot_spl_blk} ${blkcnt}\0"
+
 #define EMMC_BOOTCMD \
 	"set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} " \
 		"ro,noatime rootfstype=ext4 rootwait\0" \
@@ -178,6 +189,7 @@
 	"fdt_fixup=;\0" \
 	MEM_LAYOUT_ENV_SETTINGS \
 	NFS_BOOTCMD \
+	UBOOT_UPDATE \
 	"setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
 		"00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
 		"flash_eth.img && source ${loadaddr}\0" \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 3/5] colibri_imx6: add update_uboot wrapper
  2019-12-09 10:33 [PATCH v2 0/5] toradex: imx: add update_uboot wrapper Igor Opaniuk
  2019-12-09 10:33 ` [PATCH v2 1/5] colibri_imx7: " Igor Opaniuk
  2019-12-09 10:33 ` [PATCH v2 2/5] apalis_imx6: " Igor Opaniuk
@ 2019-12-09 10:33 ` Igor Opaniuk
  2019-12-29 10:25   ` sbabic at denx.de
  2019-12-09 10:33 ` [PATCH v2 4/5] colibri-imx6ull: " Igor Opaniuk
  2019-12-09 10:33 ` [PATCH v2 5/5] colibri_vf: " Igor Opaniuk
  4 siblings, 1 reply; 11+ messages in thread
From: Igor Opaniuk @ 2019-12-09 10:33 UTC (permalink / raw)
  To: u-boot

From: Igor Opaniuk <igor.opaniuk@toradex.com>

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

> tftpboot ${loadaddr} ${board_name}/u-boot.img
> run update_uboot
> tftpboot ${loadaddr} ${board_name}/SPL
> run update_spl

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

 include/configs/colibri_imx6.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h
index 95b5a14b59..750463ef47 100644
--- a/include/configs/colibri_imx6.h
+++ b/include/configs/colibri_imx6.h
@@ -110,6 +110,17 @@
 	"imx6dl-colibri-eval-v3.dtb fat 0 1;" \
 	"imx6dl-colibri-cam-eval-v3.dtb fat 0 1"
 
+#define UBOOT_UPDATE \
+	"uboot_hwpart=1\0" \
+	"uboot_blk=8a\0" \
+	"uboot_spl_blk=2\0" \
+	"set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && " \
+		"setexpr blkcnt ${blkcnt} / 0x200\0" \
+	"update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
+		"mmc write ${loadaddr} ${uboot_blk} ${blkcnt}\0" \
+	"update_spl=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && " \
+		"mmc write ${loadaddr} ${uboot_spl_blk} ${blkcnt}\0"
+
 #define EMMC_BOOTCMD \
 	"set_emmcargs=setenv emmcargs ip=off root=PARTUUID=${uuid} "\
 		"rw,noatime rootfstype=ext4 " \
@@ -163,6 +174,7 @@
 	"fdt_fixup=;\0" \
 	MEM_LAYOUT_ENV_SETTINGS \
 	NFS_BOOTCMD \
+	UBOOT_UPDATE \
 	"setethupdate=if env exists ethaddr; then; else setenv ethaddr " \
 		"00:14:2d:00:00:00; fi; tftpboot ${loadaddr} " \
 		"flash_eth.img && source ${loadaddr}\0" \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 4/5] colibri-imx6ull: add update_uboot wrapper
  2019-12-09 10:33 [PATCH v2 0/5] toradex: imx: add update_uboot wrapper Igor Opaniuk
                   ` (2 preceding siblings ...)
  2019-12-09 10:33 ` [PATCH v2 3/5] colibri_imx6: " Igor Opaniuk
@ 2019-12-09 10:33 ` Igor Opaniuk
  2019-12-29 10:26   ` sbabic at denx.de
  2019-12-09 10:33 ` [PATCH v2 5/5] colibri_vf: " Igor Opaniuk
  4 siblings, 1 reply; 11+ messages in thread
From: Igor Opaniuk @ 2019-12-09 10:33 UTC (permalink / raw)
  To: u-boot

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(+)

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" \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 5/5] colibri_vf: add update_uboot wrapper
  2019-12-09 10:33 [PATCH v2 0/5] toradex: imx: add update_uboot wrapper Igor Opaniuk
                   ` (3 preceding siblings ...)
  2019-12-09 10:33 ` [PATCH v2 4/5] colibri-imx6ull: " Igor Opaniuk
@ 2019-12-09 10:33 ` Igor Opaniuk
  2019-12-29 10:26   ` sbabic at denx.de
  4 siblings, 1 reply; 11+ messages in thread
From: Igor Opaniuk @ 2019-12-09 10:33 UTC (permalink / raw)
  To: u-boot

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_vf.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 40c050a27e..1478ea844e 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -58,6 +58,10 @@
 	"ramdisk_addr_r=0x82100000\0" \
 	"scriptaddr=0x87000000\0"
 
+#define UBOOT_UPDATE \
+	"update_uboot=nand erase.part u-boot && " \
+		"nand write ${loadaddr} u-boot ${filesize}\0" \
+
 #define NFS_BOOTCMD \
 	"nfsargs=ip=:::::eth0: root=/dev/nfs\0"	\
 	"nfsboot=run setup; " \
@@ -112,6 +116,7 @@
 	NFS_BOOTCMD \
 	SD_BOOTCMD \
 	UBI_BOOTCMD \
+	UBOOT_UPDATE \
 	"console=ttyLP0\0" \
 	"defargs=user_debug=30\0" \
 	"dfu_alt_info=" DFU_ALT_NAND_INFO "\0" \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 3/5] colibri_imx6: add update_uboot wrapper
  2019-12-09 10:33 ` [PATCH v2 3/5] colibri_imx6: " Igor Opaniuk
@ 2019-12-29 10:25   ` sbabic at denx.de
  0 siblings, 0 replies; 11+ messages in thread
From: sbabic at denx.de @ 2019-12-29 10:25 UTC (permalink / raw)
  To: u-boot

> From: Igor Opaniuk <igor.opaniuk@toradex.com>
> Add universal update_uboot wrapper that helps to update
> U-Boot image on internal storage.
> > tftpboot ${loadaddr} ${board_name}/u-boot.img
> > run update_uboot
> > tftpboot ${loadaddr} ${board_name}/SPL
> > run update_spl
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Applied to u-boot-imx, -next, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 5/5] colibri_vf: add update_uboot wrapper
  2019-12-09 10:33 ` [PATCH v2 5/5] colibri_vf: " Igor Opaniuk
@ 2019-12-29 10:26   ` sbabic at denx.de
  0 siblings, 0 replies; 11+ messages in thread
From: sbabic at denx.de @ 2019-12-29 10:26 UTC (permalink / raw)
  To: u-boot

> 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

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 2/5] apalis_imx6: add update_uboot wrapper
  2019-12-09 10:33 ` [PATCH v2 2/5] apalis_imx6: " Igor Opaniuk
@ 2019-12-29 10:26   ` sbabic at denx.de
  0 siblings, 0 replies; 11+ messages in thread
From: sbabic at denx.de @ 2019-12-29 10:26 UTC (permalink / raw)
  To: u-boot

> 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.img
> > run update_uboot
> > tftpboot ${loadaddr} ${board_name}/SPL
> > run update_spl
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Applied to u-boot-imx, -next, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 4/5] colibri-imx6ull: add update_uboot wrapper
  2019-12-09 10:33 ` [PATCH v2 4/5] colibri-imx6ull: " Igor Opaniuk
@ 2019-12-29 10:26   ` sbabic at denx.de
  0 siblings, 0 replies; 11+ messages in thread
From: sbabic at denx.de @ 2019-12-29 10:26 UTC (permalink / raw)
  To: u-boot

> 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

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 1/5] colibri_imx7: add update_uboot wrapper
  2019-12-09 10:33 ` [PATCH v2 1/5] colibri_imx7: " Igor Opaniuk
@ 2019-12-29 10:28   ` sbabic at denx.de
  0 siblings, 0 replies; 11+ messages in thread
From: sbabic at denx.de @ 2019-12-29 10:28 UTC (permalink / raw)
  To: u-boot

> 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-dtb.imx
> > run update_uboot
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Applied to u-boot-imx, -next, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-12-29 10:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-09 10:33 [PATCH v2 0/5] toradex: imx: add update_uboot wrapper Igor Opaniuk
2019-12-09 10:33 ` [PATCH v2 1/5] colibri_imx7: " Igor Opaniuk
2019-12-29 10:28   ` sbabic at denx.de
2019-12-09 10:33 ` [PATCH v2 2/5] apalis_imx6: " Igor Opaniuk
2019-12-29 10:26   ` sbabic at denx.de
2019-12-09 10:33 ` [PATCH v2 3/5] colibri_imx6: " Igor Opaniuk
2019-12-29 10:25   ` sbabic at denx.de
2019-12-09 10:33 ` [PATCH v2 4/5] colibri-imx6ull: " Igor Opaniuk
2019-12-29 10:26   ` sbabic at denx.de
2019-12-09 10:33 ` [PATCH v2 5/5] colibri_vf: " Igor Opaniuk
2019-12-29 10:26   ` sbabic at denx.de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox