From 961acf48dee99b9d5e70689301f977939f4c7d79 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 11 Oct 2023 17:56:35 +0200 Subject: [PATCH] install_linux_fw: reset bootcount before resetting target During firmware install, the target may be reset several times. We don't want the bootcount to count these as boot attempts. This was done in a791bb446396ef3c4868a1cf01b30a6c2bd2bc40 for the ccmp1 but not for the rest of platforms. Signed-off-by: Hector Palacios --- .../u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt | 2 ++ .../u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt | 2 ++ .../u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh | 4 ++++ .../u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt | 2 ++ .../u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt | 2 ++ .../u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh | 4 ++++ .../u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt | 2 ++ .../u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt | 2 ++ .../u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh | 4 ++++ .../u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt | 2 ++ .../u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt | 2 ++ .../u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh | 4 ++++ .../u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt | 2 ++ .../u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt | 2 ++ .../u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh | 4 ++++ .../u-boot/u-boot-dey/ccimx93/install_linux_fw_sd.txt | 2 ++ .../u-boot/u-boot-dey/ccimx93/install_linux_fw_usb.txt | 2 ++ .../u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh | 4 ++++ .../u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh | 3 ++- 19 files changed, 50 insertions(+), 1 deletion(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt index 13e499f6a..aaefeff57 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_sd.txt @@ -260,6 +260,7 @@ setenv bootcmd " setenv boot_recovery yes; setenv recovery_command wipe_update; fi; + setenv bootcount 0; saveenv; echo \"\"; echo \"\"; @@ -273,5 +274,6 @@ setenv bootcmd " reset; " +setenv bootcount 0 saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt index 1cf816465..b752e0aac 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_usb.txt @@ -263,6 +263,7 @@ setenv bootcmd " setenv boot_recovery yes; setenv recovery_command wipe_update; fi; + setenv bootcount 0; saveenv; echo \"\"; echo \"\"; @@ -276,5 +277,6 @@ setenv bootcmd " reset; " +setenv bootcount 0 saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh index 67116969b..5cf3788bb 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6qpsbc/install_linux_fw_uuu.sh @@ -240,6 +240,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults +# - Reset the bootcount # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -248,6 +249,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; + setenv bootcount 0 saveenv; echo \"\"; echo \"\"; @@ -315,6 +317,8 @@ if [ "${DUALBOOT}" != true ]; then uuu fb: ucmd setenv boot_recovery yes uuu fb: ucmd setenv recovery_command wipe_update fi +# Reset the bootcount +uuu fb: ucmd setenv bootcount 0 uuu fb: ucmd saveenv # Reset the target diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt index a7d67813b..b4c819221 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_sd.txt @@ -271,6 +271,7 @@ setenv bootcmd " setenv boot_recovery yes; setenv recovery_command wipe_update; fi; + setenv bootcount 0; saveenv; echo \"\"; echo \"\"; @@ -284,5 +285,6 @@ setenv bootcmd " reset; " +setenv bootcount 0 saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt index 3e93d5fb5..689669278 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_usb.txt @@ -274,6 +274,7 @@ setenv bootcmd " setenv boot_recovery yes; setenv recovery_command wipe_update; fi; + setenv bootcount 0; saveenv; echo \"\"; echo \"\"; @@ -287,5 +288,6 @@ setenv bootcmd " reset; " +setenv bootcount 0 saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh index d215a6b5f..655604812 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6sbc/install_linux_fw_uuu.sh @@ -258,6 +258,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults +# - Reset the bootcount # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -266,6 +267,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; + setenv bootcount 0 saveenv; echo \"\"; echo \"\"; @@ -333,6 +335,8 @@ if [ "${DUALBOOT}" != true ]; then uuu fb: ucmd setenv boot_recovery yes uuu fb: ucmd setenv recovery_command wipe_update fi +# Reset the bootcount +uuu fb: ucmd setenv bootcount 0 uuu fb: ucmd saveenv # Reset the target diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt index acc2e5fd4..35bceb6df 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_sd.txt @@ -276,8 +276,10 @@ setenv bootcmd " echo \"\"; echo \"\"; sleep 1; + bootcount reset; reset; " +bootcount reset saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt index bdad2f6da..36fdd73b4 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_usb.txt @@ -279,8 +279,10 @@ setenv bootcmd " echo \"\"; echo \"\"; sleep 1; + bootcount reset; reset; " +bootcount reset saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh index af1d48880..6ae7ed748 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx6ul/install_linux_fw_uuu.sh @@ -249,6 +249,7 @@ part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults +# - Reset the bootcount # - Save the environment # - Update the 'linux' partition # - Update the 'recovery' partition @@ -257,6 +258,7 @@ part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000 uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; + bootcount reset; setenv singlemtdsys \${singlemtdsys}; saveenv; echo \"\"; @@ -324,6 +326,8 @@ fi uuu fb: ucmd saveenv +# Reset the bootcount +uuu fb: ucmd bootcount reset # Reset the target uuu fb: acmd reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt index d4824c6ee..418d833c2 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_sd.txt @@ -248,8 +248,10 @@ setenv bootcmd " echo \"\"; echo \"\"; sleep 1; + bootcount reset; reset; " +bootcount reset saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt index 896eaf1e6..c870409fa 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_usb.txt @@ -249,8 +249,10 @@ setenv bootcmd " echo \"\"; echo \"\"; sleep 1; + bootcount reset; reset; " +bootcount reset saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh index 760268ff6..a20af2bf3 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8m/install_linux_fw_uuu.sh @@ -209,6 +209,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults +# - Reset the bootcount # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -217,6 +218,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; + bootcount reset; saveenv; echo \"\"; echo \"\"; @@ -286,6 +288,8 @@ if [ "${DUALBOOT}" != true ]; then fi uuu fb: ucmd saveenv +# Reset the bootcount +uuu fb: ucmd bootcount reset # Reset the target uuu fb: acmd reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt index 8322ffa99..9c75c13cf 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt @@ -260,8 +260,10 @@ setenv bootcmd " echo \"\"; echo \"\"; sleep 1; + bootcount reset; reset; " +bootcount reset saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt index 46dfbe340..f8b12076a 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt @@ -263,8 +263,10 @@ setenv bootcmd " echo \"\"; echo \"\"; sleep 1; + bootcount reset; reset; " +bootcount reset saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh index a5147e364..6d7ad5a4d 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh @@ -213,6 +213,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults +# - Reset the bootcount # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -221,6 +222,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; + bootcount reset; saveenv; echo \"\"; echo \"\"; @@ -290,6 +292,8 @@ if [ "${DUALBOOT}" != true ]; then fi uuu fb: ucmd saveenv +# Reset the bootcount +uuu fb: ucmd bootcount reset # Reset the target uuu fb: acmd reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_sd.txt index a5c969145..f43d6a2e5 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_sd.txt @@ -246,8 +246,10 @@ setenv bootcmd " echo \"\"; echo \"\"; sleep 1; + bootcount reset; reset; " +bootcount reset saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_usb.txt index 90e7e1f3d..256accf40 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_usb.txt @@ -247,8 +247,10 @@ setenv bootcmd " echo \"\"; echo \"\"; sleep 1; + bootcount reset; reset; " +bootcount reset saveenv reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh index 760268ff6..a20af2bf3 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx93/install_linux_fw_uuu.sh @@ -209,6 +209,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 # Set 'bootcmd' for the second part of the script that will # - Reset environment to defaults +# - Reset the bootcount # - Save the environment # - Partition the eMMC user data area for Linux # - Update the 'linux' partition @@ -217,6 +218,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1 uuu fb: ucmd setenv bootcmd " env default -a; setenv dualboot \${dualboot}; + bootcount reset; saveenv; echo \"\"; echo \"\"; @@ -286,6 +288,8 @@ if [ "${DUALBOOT}" != true ]; then fi uuu fb: ucmd saveenv +# Reset the bootcount +uuu fb: ucmd bootcount reset # Reset the target uuu fb: acmd reset diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh index 1b140d621..2538fe4c8 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp1/install_linux_fw_uuu.sh @@ -297,8 +297,9 @@ if [ "${SQUASHFS}" = true ]; then uuu fb: ucmd saveenv fi -# Reset the target +# Reset the bootcount uuu fb: ucmd bootcount reset +# Reset the target uuu fb: acmd reset echo "\033[32m"