diff mbox series

[v4] config: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm

Message ID 20240809165332.1898756-1-lukma@denx.de
State Accepted
Delegated to: Fabio Estevam
Headers show
Series [v4] config: Add 'update_bootimg' command to update flash.bin on Phytec's imx8mm | expand

Commit Message

Lukasz Majewski Aug. 9, 2024, 4:53 p.m. UTC
This command allows easy update on SD card or eMMC of the flash.bin
generated (with binman) during u-boot build.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Remove 'update_mmc_part' variable
- Change path for hostname
- Use full version of dhcp command (${loadaddr} added)

Changes for v3:
- Remove +1 when calculating the size of binary to be written

Changes for v4:
- Replace ${hostname} with ${update_filepath}
---
 include/configs/phycore_imx8mm.h | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Benjamin Hahn Aug. 15, 2024, 8:58 a.m. UTC | #1
On 09.08.24 18:53, Lukasz Majewski wrote:
> This command allows easy update on SD card or eMMC of the flash.bin
> generated (with binman) during u-boot build.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Benjamin Hahn <B.Hahn@phytec.de>
> ---
> Changes for v2:
> - Remove 'update_mmc_part' variable
> - Change path for hostname
> - Use full version of dhcp command (${loadaddr} added)
>
> Changes for v3:
> - Remove +1 when calculating the size of binary to be written
>
> Changes for v4:
> - Replace ${hostname} with ${update_filepath}
> ---
>   include/configs/phycore_imx8mm.h | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/include/configs/phycore_imx8mm.h b/include/configs/phycore_imx8mm.h
> index dd7cfdba52..0910ae2d87 100644
> --- a/include/configs/phycore_imx8mm.h
> +++ b/include/configs/phycore_imx8mm.h
> @@ -29,6 +29,14 @@
>   	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
>   	"mmcpart=1\0" \
>   	"mmcroot=2\0" \
> +	"update_offset=0x42\0" \
> +	"update_filename=flash.bin\0" \
> +	"update_bootimg="						\
> +		"mmc dev ${mmcdev} ; "		\
> +		"if dhcp ${loadaddr} ${update_filepath}/${update_filename} ; then "	\
> +		"setexpr fw_sz ${filesize} / 0x200 ; "	/* SD block size */ \
> +		"mmc write ${loadaddr} ${update_offset} ${fw_sz} ; "	\
> +		"fi\0" \
>   	"mmcautodetect=yes\0" \
>   	"mmcargs=setenv bootargs console=${console} " \
>   		"root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \
Teresa Remmet Aug. 15, 2024, 11:23 a.m. UTC | #2
Am Freitag, dem 09.08.2024 um 18:53 +0200 schrieb Lukasz Majewski:
> This command allows easy update on SD card or eMMC of the flash.bin
> generated (with binman) during u-boot build.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Tested-by: Teresa Remmet <t.remmet@phytec.de>

> ---
> Changes for v2:
> - Remove 'update_mmc_part' variable
> - Change path for hostname
> - Use full version of dhcp command (${loadaddr} added)
> 
> Changes for v3:
> - Remove +1 when calculating the size of binary to be written
> 
> Changes for v4:
> - Replace ${hostname} with ${update_filepath}
> ---
>  include/configs/phycore_imx8mm.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/configs/phycore_imx8mm.h
> b/include/configs/phycore_imx8mm.h
> index dd7cfdba52..0910ae2d87 100644
> --- a/include/configs/phycore_imx8mm.h
> +++ b/include/configs/phycore_imx8mm.h
> @@ -29,6 +29,14 @@
>         "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
>         "mmcpart=1\0" \
>         "mmcroot=2\0" \
> +       "update_offset=0x42\0" \
> +       "update_filename=flash.bin\0" \
> +       "update_bootimg="                                            
>    \
> +               "mmc dev ${mmcdev} ; "          \
> +               "if dhcp ${loadaddr}
> ${update_filepath}/${update_filename} ; then "     \
> +               "setexpr fw_sz ${filesize} / 0x200 ; "  /* SD block
> size */ \
> +               "mmc write ${loadaddr} ${update_offset} ${fw_sz} ;
> "    \
> +               "fi\0" \
>         "mmcautodetect=yes\0" \
>         "mmcargs=setenv bootargs console=${console} " \
>                 "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0"
> \
Fabio Estevam Aug. 15, 2024, 12:26 p.m. UTC | #3
On Fri, Aug 9, 2024 at 1:53 PM Lukasz Majewski <lukma@denx.de> wrote:
>
> This command allows easy update on SD card or eMMC of the flash.bin
> generated (with binman) during u-boot build.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Fabio Estevam Aug. 23, 2024, 7:14 p.m. UTC | #4
On Fri, Aug 9, 2024 at 1:53 PM Lukasz Majewski <lukma@denx.de> wrote:
>
> This command allows easy update on SD card or eMMC of the flash.bin
> generated (with binman) during u-boot build.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Applied, thanks.
diff mbox series

Patch

diff --git a/include/configs/phycore_imx8mm.h b/include/configs/phycore_imx8mm.h
index dd7cfdba52..0910ae2d87 100644
--- a/include/configs/phycore_imx8mm.h
+++ b/include/configs/phycore_imx8mm.h
@@ -29,6 +29,14 @@ 
 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
 	"mmcpart=1\0" \
 	"mmcroot=2\0" \
+	"update_offset=0x42\0" \
+	"update_filename=flash.bin\0" \
+	"update_bootimg="						\
+		"mmc dev ${mmcdev} ; "		\
+		"if dhcp ${loadaddr} ${update_filepath}/${update_filename} ; then "	\
+		"setexpr fw_sz ${filesize} / 0x200 ; "	/* SD block size */ \
+		"mmc write ${loadaddr} ${update_offset} ${fw_sz} ; "	\
+		"fi\0" \
 	"mmcautodetect=yes\0" \
 	"mmcargs=setenv bootargs console=${console} " \
 		"root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \