Skip to contentSkip to conversation

Add RAUC boot logic for phycore_imx8mp

PATCH Superseded Leonard Anderweit 3 participants 12 messages Mar 12, 2024 – Mar 17, 2024 Arm i.MX and Layerscape

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add RAUC boot logic for phycore_imx8mp

This series adds RAUC boot logic for the phycore_imx8mp.
The first patch converts the environment from a CFG_EXTRA_ENV_SETTINGS #define to a text environment for better readability and maintainability. The second patch moves the default bootcmd from the defconfig to the board environment.
The third patch enables the redundant environment on phycore_imx8mp. Patch 4 adds RAUC boot logic common to all phytec boards.
Patch 5 adds the RAUC boot logic to phycore_imx8mp.

v2:
- rebase on next

Leonard Anderweit (5):
phycore_imx8mp: Move environment from include/config to board
phycore_imx8mp: Move default bootcmd to board env
configs: phycore-imx8mp_defconfig: Use redundant environment
include: env: Add phytec RAUC boot logic
board: phytec: phycore_imx8mp: Add RAUC boot logic to environment

 .../phytec/phycore_imx8mp/phycore_imx8mp.env  | 62 +++++++++++++++++++
 configs/phycore-imx8mp_defconfig              |  4 +-
 include/configs/phycore_imx8mp.h              | 43 -------------
 include/env/phytec/rauc.env                   | 52 ++++++++++++++++
 4 files changed, 116 insertions(+), 45 deletions(-)
 create mode 100644 board/phytec/phycore_imx8mp/phycore_imx8mp.env
 create mode 100644 include/env/phytec/rauc.env
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/5 phycore_imx8mp: Move environment from include/config to board

Move the environment into the board directory and convert it from a C header to a text file. Sort the variables alphabetically. No functional changes.

---
 .../phytec/phycore_imx8mp/phycore_imx8mp.env  | 45 +++++++++++++++++++
 include/configs/phycore_imx8mp.h              | 43 ------------------
 2 files changed, 45 insertions(+), 43 deletions(-)
 create mode 100644 board/phytec/phycore_imx8mp/phycore_imx8mp.env
board/phytec/phycore_imx8mp/phycore_imx8mp.env new file +45 -0
new file mode 100644
index 000000000000..6d15b7f3dc9f
@@ -0,0 +1,45 @@
+console=ttymxc0,115200
+dofastboot=0
+emmc_dev=2
+fastboot_raw_partition_all=0 4194304
+fastboot_raw_partition_bootloader=64 8128
+fdt_addr=0x48000000
+fdt_file=CONFIG_DEFAULT_FDT_FILE
+image=Image
+ip_dyn=yes
+loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
+loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
+mmcargs=
+	setenv bootargs console=${console}
+	root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw
+mmcautodetect=yes
+mmcboot=
+	echo Booting from mmc ...;
+	run mmcargs;
+	if run loadfdt; then
+		booti ${loadaddr} - ${fdt_addr};
+	else
+		echo WARN: Cannot load the DT;
+	fi;
+mmcdev=CONFIG_SYS_MMC_ENV_DEV
+mmcpart=1
+mmcroot=2
+netargs=
+	setenv bootargs console=${console} root=/dev/nfs ip=dhcp
+	nfsroot=${serverip}:${nfsroot},v3,tcp
+netboot=
+	echo Booting from net ...;
+	run netargs;
+	if test ${ip_dyn} = yes; then
+		setenv get_cmd dhcp;
+	else
+		setenv get_cmd tftp;
+	fi;
+	${get_cmd} ${loadaddr} ${image};
+	if ${get_cmd} ${fdt_addr} ${fdt_file}; then
+		booti ${loadaddr} - ${fdt_addr};
+	else
+		echo WARN: Cannot load the DT;
+	fi;
+nfsroot=/nfs
+sd_dev=1
include/configs/phycore_imx8mp.h +0 -43

49 lines not on this page · raw message

Signature · 1 line
2.25.1
Reviewed-by Tested-by on v2 1/5
#2 lore raw

Re: [PATCH v2 1/5] phycore_imx8mp: Move environment from include/config to board

Hello Leonard,

Am Dienstag, dem 12.03.2024 um 09:59 +0100 schrieb Leonard Anderweit:

Quoted 21 lines

Move the environment into the board directory and convert it from a C header to a text file. Sort the variables alphabetically. No functional changes.

---
 .../phytec/phycore_imx8mp/phycore_imx8mp.env  | 45
+++++++++++++++++++
 include/configs/phycore_imx8mp.h              | 43 ----------------- -

 2 files changed, 45 insertions(+), 43 deletions(-)

 create mode 100644 board/phytec/phycore_imx8mp/phycore_imx8mp.env

board/phytec/phycore_imx8mp/phycore_imx8mp.env new file +1 -0
new file mode 100644
index 000000000000..6d15b7f3dc9f
@@ -0,0 +1,45 @@
+console=ttymxc0,115200

board/phytec/phycore_imx8mp/phycore_imx8mp.env line 11

Quoted 10 lines
board/phytec/phycore_imx8mp/phycore_imx8mp.env new file +10 -0
+dofastboot=0
+emmc_dev=2
+fastboot_raw_partition_all=0 4194304
+fastboot_raw_partition_bootloader=64 8128
+fdt_addr=0x48000000
+fdt_file=CONFIG_DEFAULT_FDT_FILE
+image=Image
+ip_dyn=yes
+loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
+loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}

a small nit here as you sort them alphabetically. "loadimage" and "loadfdt" needs to be swapped.

besides of this:

Thanks!
Teresa

Quoted 94 lines
board/phytec/phycore_imx8mp/phycore_imx8mp.env new file +34 -0
+mmcargs=
+       setenv bootargs console=${console}
+       root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw
+mmcautodetect=yes
+mmcboot=
+       echo Booting from mmc ...;
+       run mmcargs;
+       if run loadfdt; then
+               booti ${loadaddr} - ${fdt_addr};
+       else
+               echo WARN: Cannot load the DT;
+       fi;
+mmcdev=CONFIG_SYS_MMC_ENV_DEV
+mmcpart=1
+mmcroot=2
+netargs=
+       setenv bootargs console=${console} root=/dev/nfs ip=dhcp
+       nfsroot=${serverip}:${nfsroot},v3,tcp
+netboot=
+       echo Booting from net ...;
+       run netargs;
+       if test ${ip_dyn} = yes; then
+               setenv get_cmd dhcp;
+       else
+               setenv get_cmd tftp;
+       fi;
+       ${get_cmd} ${loadaddr} ${image};
+       if ${get_cmd} ${fdt_addr} ${fdt_file}; then
+               booti ${loadaddr} - ${fdt_addr};
+       else
+               echo WARN: Cannot load the DT;
+       fi;
+nfsroot=/nfs
+sd_dev=1
include/configs/phycore_imx8mp.h +0 -0
index 11a17be7fe1d..206c4d50d276 100644
@@ -13,49 +13,6 @@
  #define CFG_SYS_UBOOT_BASE \

                (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)

-#define CFG_EXTRA_ENV_SETTINGS \
-       "image=Image\0" \
-       "console=ttymxc0,115200\0" \
-       "fdt_addr=0x48000000\0" \
-       "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
-       "ip_dyn=yes\0" \
-       "dofastboot=0\0" \
-       "fastboot_raw_partition_bootloader=64 8128\0" \
-       "fastboot_raw_partition_all=0 4194304\0" \
-       "emmc_dev=2\0" \
-       "sd_dev=1\0" \
-       "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
-       "mmcpart=1\0" \
-       "mmcroot=2\0" \
-       "mmcautodetect=yes\0" \
-       "mmcargs=setenv bootargs console=${console} " \
-               "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \
-       "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
-       "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
-       "mmcboot=echo Booting from mmc ...; " \
-               "run mmcargs; " \
-               "if run loadfdt; then " \
-                       "booti ${loadaddr} - ${fdt_addr}; " \
-               "else " \
-                       "echo WARN: Cannot load the DT; " \
-               "fi;\0 " \
-       "nfsroot=/nfs\0" \
-       "netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp " \
-               "nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
-       "netboot=echo Booting from net ...; " \
-               "run netargs; " \
-               "if test ${ip_dyn} = yes; then " \
-                       "setenv get_cmd dhcp; " \
-               "else " \
-                       "setenv get_cmd tftp; " \
-               "fi; " \
-               "${get_cmd} ${loadaddr} ${image}; " \
-               "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
-                       "booti ${loadaddr} - ${fdt_addr}; " \
-               "else " \
-                       "echo WARN: Cannot load the DT; " \
-               "fi;\0" \
-
 /* Link Definitions */

 #define CFG_SYS_INIT_RAM_ADDR  0x40000000

Signature · 5 lines
PHYTEC Messtechnik GmbH | Barcelona-Allee 1 | 55129 Mainz, Germany

Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber,
Dipl.-Ing. (FH) Markus Lickes | Handelsregister Mainz HRB 4656 |
Finanzamt Mainz | St.Nr. 266500608, DE 149059855
#3 lore raw

PATCH v2 2/5 phycore_imx8mp: Move default bootcmd to board env

In reply to Leonard Anderweit

Move the default bootcmd from the defconfig to the board environment. No change in functionality.

---
 board/phytec/phycore_imx8mp/phycore_imx8mp.env | 12 ++++++++++++
 configs/phycore-imx8mp_defconfig               |  2 --
 2 files changed, 12 insertions(+), 2 deletions(-)
board/phytec/phycore_imx8mp/phycore_imx8mp.env +12 -0
index 6d15b7f3dc9f..73202c3b129a 100644
@@ -1,3 +1,15 @@
+bootcmd=
+	if test ${dofastboot} = 1; then
+		fastboot 0;
+	fi;
+	mmc dev ${mmcdev};
+	if mmc rescan; then
+		if run loadimage; then
+			run mmcboot;
+		else
+			run netboot;
+		fi;
+	fi;
 console=ttymxc0,115200
 dofastboot=0
 emmc_dev=2
configs/phycore-imx8mp_defconfig +0 -2
index b3a7bbd79bb6..fd492eba3c10 100644
@@ -25,8 +25,6 @@ CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_SYSTEM_SETUP=y
-CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="if test ${dofastboot} = 1; then fastboot 0; fi; mmc dev ${mmcdev}; if mmc rescan; then if run loadimage; then run mmcboot; else run netboot; fi; fi;"
 CONFIG_DEFAULT_FDT_FILE="oftree"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074
Signature · 1 line
2.25.1
Tested-by on v2 2/5
#4 lore raw

Re: [PATCH v2 2/5] phycore_imx8mp: Move default bootcmd to board env

Am Dienstag, dem 12.03.2024 um 09:59 +0100 schrieb Leonard Anderweit:

Quoted 4 lines

Move the default bootcmd from the defconfig to the board environment. No change in functionality.

Quoted 42 lines

---
 board/phytec/phycore_imx8mp/phycore_imx8mp.env | 12 ++++++++++++ configs/phycore-imx8mp_defconfig               |  2 --

 2 files changed, 12 insertions(+), 2 deletions(-)
board/phytec/phycore_imx8mp/phycore_imx8mp.env +12 -0
index 6d15b7f3dc9f..73202c3b129a 100644
@@ -1,3 +1,15 @@
+bootcmd=
+       if test ${dofastboot} = 1; then
+               fastboot 0;
+       fi;
+       mmc dev ${mmcdev};
+       if mmc rescan; then
+               if run loadimage; then
+                       run mmcboot;
+               else
+                       run netboot;
+               fi;
+       fi;

 console=ttymxc0,115200
 dofastboot=0
 emmc_dev=2

configs/phycore- renamed from configs/phycore-imx8mp_defconfig +0 -0

imx8mp_defconfig
index b3a7bbd79bb6..fd492eba3c10 100644

configs/phycore-imx8mp_defconfig +0 -0
@@ -25,8 +25,6 @@ CONFIG_FIT=y

 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_SYSTEM_SETUP=y

configs/phycore-imx8mp_defconfig +0 -2
-CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="if test ${dofastboot} = 1; then fastboot 0; fi;

mmc dev ${mmcdev}; if mmc rescan; then if run loadimage; then run mmcboot; else run netboot; fi; fi;" CONFIG_DEFAULT_FDT_FILE="oftree" CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2074

Signature · 5 lines
PHYTEC Messtechnik GmbH | Barcelona-Allee 1 | 55129 Mainz, Germany

Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber,
Dipl.-Ing. (FH) Markus Lickes | Handelsregister Mainz HRB 4656 |
Finanzamt Mainz | St.Nr. 266500608, DE 149059855
#5 lore raw

PATCH v2 3/5 configs: phycore-imx8mp_defconfig: Use redundant environment

In reply to Leonard Anderweit

Add support for the redundant environment.

---
 configs/phycore-imx8mp_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/phycore-imx8mp_defconfig +2 -0
index fd492eba3c10..6c67f14b5559 100644
@@ -19,6 +19,7 @@ CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL_STACK=0x960000
 CONFIG_SPL=y
+CONFIG_ENV_OFFSET_REDUND=0x3e0000
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000
 CONFIG_SYS_LOAD_ADDR=0x40480000
 CONFIG_FIT=y
@@ -77,6 +78,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_DEV=2
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
Signature · 1 line
2.25.1
Tested-by on v2 3/5
#6 lore raw

Re: [PATCH v2 3/5] configs: phycore-imx8mp_defconfig: Use redundant environment

Am Dienstag, dem 12.03.2024 um 09:59 +0100 schrieb Leonard Anderweit:

Quoted 3 lines

Add support for the redundant environment.

Quoted 25 lines

---
 configs/phycore-imx8mp_defconfig | 2 ++

 1 file changed, 2 insertions(+)
configs/phycore- renamed from configs/phycore-imx8mp_defconfig +0 -0

imx8mp_defconfig
index fd492eba3c10..6c67f14b5559 100644

configs/phycore-imx8mp_defconfig +0 -0
@@ -19,6 +19,7 @@ CONFIG_SPL_SERIAL=y

 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL_STACK=0x960000
 CONFIG_SPL=y
+CONFIG_ENV_OFFSET_REDUND=0x3e0000
 CONFIG_SPL_IMX_ROMAPI_LOADADDR=0x48000000
 CONFIG_SYS_LOAD_ADDR=0x40480000
 CONFIG_FIT=y

configs/phycore-imx8mp_defconfig +0 -0
@@ -77,6 +78,7 @@ CONFIG_OF_CONTROL=y

 CONFIG_SPL_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_DEV=2
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y

Signature · 5 lines
PHYTEC Messtechnik GmbH | Barcelona-Allee 1 | 55129 Mainz, Germany

Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber,
Dipl.-Ing. (FH) Markus Lickes | Handelsregister Mainz HRB 4656 |
Finanzamt Mainz | St.Nr. 266500608, DE 149059855
#7 lore raw

PATCH v2 4/5 include: env: Add phytec RAUC boot logic

In reply to Leonard Anderweit

Add logic for booting systems with the RAUC update mechanism. This can be reused by other phytec boards.

---
 include/env/phytec/rauc.env | 52 +++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 include/env/phytec/rauc.env
include/env/phytec/rauc.env new file +52 -0
new file mode 100644
index 000000000000..89e17ff70ec6
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+/* Logic to select a boot partition based on environment variables and switch
+ * to the other if the boot fails. */
+
+doraucboot=0
+
+raucbootpart0=1
+raucrootpart0=5
+raucbootpart1=2
+raucrootpart1=6
+
+raucinit=
+	echo Booting RAUC A/B system;
+	test -n "${BOOT_ORDER}" || env set BOOT_ORDER "system0 system1";
+	test -n "${BOOT_system0_LEFT}" || env set BOOT_system0_LEFT 3;
+	test -n "${BOOT_system1_LEFT}" || env set BOOT_system1_LEFT 3;
+	env set raucstatus;
+	for BOOT_SLOT in "${BOOT_ORDER}"; do
+		if test "x${raucstatus}" != "x"; then
+			echo Skipping remaing slots!;
+		elif test "x${BOOT_SLOT}" = "xsystem0"; then
+			if test ${BOOT_system0_LEFT} -gt 0; then
+				echo Found valid slot A, ${BOOT_system0_LEFT} attempts remaining;
+				setexpr BOOT_system0_LEFT ${BOOT_system0_LEFT} - 1;
+				env set mmcpart ${raucbootpart0};
+				env set mmcroot ${raucrootpart0};
+				env set raucargs rauc.slot=system0;
+				env set raucstatus success;
+			fi;
+		elif test "x${BOOT_SLOT}" = "xsystem1"; then
+			if test ${BOOT_system1_LEFT} -gt 0; then
+				echo Found valid slot B, ${BOOT_system1_LEFT} attempts remaining;
+				setexpr BOOT_system1_LEFT ${BOOT_system1_LEFT} - 1;
+				env set mmcpart ${raucbootpart1};
+				env set mmcroot ${raucrootpart1};
+				env set raucargs rauc.slot=system1;
+				env set raucstatus success;
+			fi;
+		fi;
+	done;
+	if test -n "${raucstatus}"; then
+		env delete raucstatus;
+		env save;
+	else
+		echo WARN: No valid slot found;
+		env set BOOT_system0_LEFT 3;
+		env set BOOT_system1_LEFT 3;
+		env delete raucstatus;
+		env save;
+		reset;
+	fi;
Signature · 1 line
2.25.1
Tested-by on v2 4/5
#8 lore raw

Re: [PATCH v2 4/5] include: env: Add phytec RAUC boot logic

Am Dienstag, dem 12.03.2024 um 09:59 +0100 schrieb Leonard Anderweit:

Quoted 5 lines

Add logic for booting systems with the RAUC update mechanism. This can
be reused by other phytec boards.

Quoted 73 lines

---
 include/env/phytec/rauc.env | 52
+++++++++++++++++++++++++++++++++++++

 1 file changed, 52 insertions(+)

 create mode 100644 include/env/phytec/rauc.env

include/env/phytec/rauc.env new file +3 -0
new file mode 100644
index 000000000000..89e17ff70ec6
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+/* Logic to select a boot partition based on environment variables

and switch
+ * to the other if the boot fails. */

include/env/phytec/rauc.env new file +11 -0
+
+doraucboot=0
+
+raucbootpart0=1
+raucrootpart0=5
+raucbootpart1=2
+raucrootpart1=6
+
+raucinit=
+       echo Booting RAUC A/B system;
+       test -n "${BOOT_ORDER}" || env set BOOT_ORDER "system0

system1";
+       test -n "${BOOT_system0_LEFT}" || env set BOOT_system0_LEFT 3;
+       test -n "${BOOT_system1_LEFT}" || env set BOOT_system1_LEFT 3;
+       env set raucstatus;
+       for BOOT_SLOT in "${BOOT_ORDER}"; do
+               if test "x${raucstatus}" != "x"; then
+                       echo Skipping remaing slots!;
+               elif test "x${BOOT_SLOT}" = "xsystem0"; then +                       if test ${BOOT_system0_LEFT} -gt 0; then +                               echo Found valid slot A, ${BOOT_system0_LEFT} attempts remaining;
+                               setexpr BOOT_system0_LEFT ${BOOT_system0_LEFT} - 1;
+                               env set mmcpart ${raucbootpart0}; +                               env set mmcroot ${raucrootpart0}; +                               env set raucargs rauc.slot=system0; +                               env set raucstatus success; +                       fi;
+               elif test "x${BOOT_SLOT}" = "xsystem1"; then +                       if test ${BOOT_system1_LEFT} -gt 0; then +                               echo Found valid slot B, ${BOOT_system1_LEFT} attempts remaining;
+                               setexpr BOOT_system1_LEFT ${BOOT_system1_LEFT} - 1;
+                               env set mmcpart ${raucbootpart1}; +                               env set mmcroot ${raucrootpart1}; +                               env set raucargs rauc.slot=system1; +                               env set raucstatus success; +                       fi;
+               fi;
+       done;
+       if test -n "${raucstatus}"; then
+               env delete raucstatus;
+               env save;
+       else
+               echo WARN: No valid slot found;
+               env set BOOT_system0_LEFT 3;
+               env set BOOT_system1_LEFT 3;
+               env delete raucstatus;
+               env save;
+               reset;
+       fi;

Signature · 5 lines
PHYTEC Messtechnik GmbH | Barcelona-Allee 1 | 55129 Mainz, Germany

Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber,
Dipl.-Ing. (FH) Markus Lickes | Handelsregister Mainz HRB 4656 |
Finanzamt Mainz | St.Nr. 266500608, DE 149059855
#9 lore raw

PATCH v2 5/5 board: phytec: phycore_imx8mp: Add RAUC boot logic to environment

In reply to Leonard Anderweit

Add RAUC boot logic to the environment. This is the first board to utilize this environment.

---
 board/phytec/phycore_imx8mp/phycore_imx8mp.env | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
board/phytec/phycore_imx8mp/phycore_imx8mp.env +6 -1
index 73202c3b129a..d58d25476f6b 100644
@@ -1,9 +1,14 @@
+#include <env/phytec/rauc.env>
+
 bootcmd=
 	if test ${dofastboot} = 1; then
 		fastboot 0;
 	fi;
 	mmc dev ${mmcdev};
 	if mmc rescan; then
+		if test ${doraucboot} = 1; then
+			run raucinit;
+		fi;
 		if run loadimage; then
 			run mmcboot;
 		else
@@ -23,7 +28,7 @@ loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
 loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
 mmcargs=
 	setenv bootargs console=${console}
-	root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw
+	root=/dev/mmcblk${mmcdev}p${mmcroot} ${raucargs} rootwait rw
 mmcautodetect=yes
 mmcboot=
 	echo Booting from mmc ...;
Signature · 1 line
2.25.1
Tested-by on v2 5/5
#10 lore raw

Re: [PATCH v2 5/5] board: phytec: phycore_imx8mp: Add RAUC boot logic to environment

Am Dienstag, dem 12.03.2024 um 09:59 +0100 schrieb Leonard Anderweit:

Quoted 4 lines

Add RAUC boot logic to the environment. This is the first board to utilize this environment.

Quoted 34 lines

---
 board/phytec/phycore_imx8mp/phycore_imx8mp.env | 7 ++++++-

 1 file changed, 6 insertions(+), 1 deletion(-)
board/phytec/phycore_imx8mp/phycore_imx8mp.env +2 -0
index 73202c3b129a..d58d25476f6b 100644
@@ -1,9 +1,14 @@
+#include <env/phytec/rauc.env>
+

 bootcmd=
        if test ${dofastboot} = 1; then
                fastboot 0;
        fi;
        mmc dev ${mmcdev};
        if mmc rescan; then
+               if test ${doraucboot} = 1; then
+                       run raucinit;
+               fi;
                if run loadimage; then
                        run mmcboot;
                else

board/phytec/phycore_imx8mp/phycore_imx8mp.env +0 -0
@@ -23,7 +28,7 @@ loadimage=fatload mmc ${mmcdev}:${mmcpart}
 ${loadaddr} ${image}
  loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}

 mmcargs=
        setenv bootargs console=${console}
-       root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw +       root=/dev/mmcblk${mmcdev}p${mmcroot} ${raucargs} rootwait rw mmcautodetect=yes
 mmcboot=
        echo Booting from mmc ...;

Signature · 5 lines
PHYTEC Messtechnik GmbH | Barcelona-Allee 1 | 55129 Mainz, Germany

Geschäftsführer: Dipl.-Ing. Michael Mitezki, Dipl.-Ing. Bodo Huber,
Dipl.-Ing. (FH) Markus Lickes | Handelsregister Mainz HRB 4656 |
Finanzamt Mainz | St.Nr. 266500608, DE 149059855
reviewer
#11 lore raw
In reply to Leonard Anderweit
Quoted 10 lines · Leonard Anderweit

This series adds RAUC boot logic for the phycore_imx8mp.
The first patch converts the environment from a CFG_EXTRA_ENV_SETTINGS #define to a text environment for better readability and maintainability. The second patch moves the default bootcmd from the defconfig to the board environment.
The third patch enables the redundant environment on phycore_imx8mp. Patch 4 adds RAUC boot logic common to all phytec boards.
Patch 5 adds the RAUC boot logic to phycore_imx8mp.

Quoted 2 lines

v2:
- rebase on next

Applied series for u-boot-imx/next, thanks.