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 a791bb4463 for the ccmp1
but not for the rest of platforms.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
(cherry picked from commit 961acf48de)
This commit is contained in:
Hector Palacios 2023-10-11 17:56:35 +02:00
parent 70476bb455
commit 5a8d1fddae
19 changed files with 50 additions and 1 deletions

View File

@ -260,6 +260,7 @@ setenv bootcmd "
setenv boot_recovery yes; setenv boot_recovery yes;
setenv recovery_command wipe_update; setenv recovery_command wipe_update;
fi; fi;
setenv bootcount 0;
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -273,5 +274,6 @@ setenv bootcmd "
reset; reset;
" "
setenv bootcount 0
saveenv saveenv
reset reset

View File

@ -263,6 +263,7 @@ setenv bootcmd "
setenv boot_recovery yes; setenv boot_recovery yes;
setenv recovery_command wipe_update; setenv recovery_command wipe_update;
fi; fi;
setenv bootcount 0;
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -276,5 +277,6 @@ setenv bootcmd "
reset; reset;
" "
setenv bootcount 0
saveenv saveenv
reset reset

View File

@ -240,6 +240,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
# Set 'bootcmd' for the second part of the script that will # Set 'bootcmd' for the second part of the script that will
# - Reset environment to defaults # - Reset environment to defaults
# - Reset the bootcount
# - Save the environment # - Save the environment
# - Partition the eMMC user data area for Linux # - Partition the eMMC user data area for Linux
# - Update the 'linux' partition # - Update the 'linux' partition
@ -248,6 +249,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot}; setenv dualboot \${dualboot};
setenv bootcount 0
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -315,6 +317,8 @@ if [ "${DUALBOOT}" != true ]; then
uuu fb: ucmd setenv boot_recovery yes uuu fb: ucmd setenv boot_recovery yes
uuu fb: ucmd setenv recovery_command wipe_update uuu fb: ucmd setenv recovery_command wipe_update
fi fi
# Reset the bootcount
uuu fb: ucmd setenv bootcount 0
uuu fb: ucmd saveenv uuu fb: ucmd saveenv
# Reset the target # Reset the target

View File

@ -271,6 +271,7 @@ setenv bootcmd "
setenv boot_recovery yes; setenv boot_recovery yes;
setenv recovery_command wipe_update; setenv recovery_command wipe_update;
fi; fi;
setenv bootcount 0;
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -284,5 +285,6 @@ setenv bootcmd "
reset; reset;
" "
setenv bootcount 0
saveenv saveenv
reset reset

View File

@ -274,6 +274,7 @@ setenv bootcmd "
setenv boot_recovery yes; setenv boot_recovery yes;
setenv recovery_command wipe_update; setenv recovery_command wipe_update;
fi; fi;
setenv bootcount 0;
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -287,5 +288,6 @@ setenv bootcmd "
reset; reset;
" "
setenv bootcount 0
saveenv saveenv
reset reset

View File

@ -258,6 +258,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
# Set 'bootcmd' for the second part of the script that will # Set 'bootcmd' for the second part of the script that will
# - Reset environment to defaults # - Reset environment to defaults
# - Reset the bootcount
# - Save the environment # - Save the environment
# - Partition the eMMC user data area for Linux # - Partition the eMMC user data area for Linux
# - Update the 'linux' partition # - Update the 'linux' partition
@ -266,6 +267,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot}; setenv dualboot \${dualboot};
setenv bootcount 0
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -333,6 +335,8 @@ if [ "${DUALBOOT}" != true ]; then
uuu fb: ucmd setenv boot_recovery yes uuu fb: ucmd setenv boot_recovery yes
uuu fb: ucmd setenv recovery_command wipe_update uuu fb: ucmd setenv recovery_command wipe_update
fi fi
# Reset the bootcount
uuu fb: ucmd setenv bootcount 0
uuu fb: ucmd saveenv uuu fb: ucmd saveenv
# Reset the target # Reset the target

View File

@ -276,8 +276,10 @@ setenv bootcmd "
echo \"\"; echo \"\";
echo \"\"; echo \"\";
sleep 1; sleep 1;
bootcount reset;
reset; reset;
" "
bootcount reset
saveenv saveenv
reset reset

View File

@ -279,8 +279,10 @@ setenv bootcmd "
echo \"\"; echo \"\";
echo \"\"; echo \"\";
sleep 1; sleep 1;
bootcount reset;
reset; reset;
" "
bootcount reset
saveenv saveenv
reset reset

View File

@ -249,6 +249,7 @@ part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000
# Set 'bootcmd' for the second part of the script that will # Set 'bootcmd' for the second part of the script that will
# - Reset environment to defaults # - Reset environment to defaults
# - Reset the bootcount
# - Save the environment # - Save the environment
# - Update the 'linux' partition # - Update the 'linux' partition
# - Update the 'recovery' partition # - Update the 'recovery' partition
@ -257,6 +258,7 @@ part_update "uboot" "${INSTALL_UBOOT_FILENAME}" 5000
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot}; setenv dualboot \${dualboot};
bootcount reset;
setenv singlemtdsys \${singlemtdsys}; setenv singlemtdsys \${singlemtdsys};
saveenv; saveenv;
echo \"\"; echo \"\";
@ -324,6 +326,8 @@ fi
uuu fb: ucmd saveenv uuu fb: ucmd saveenv
# Reset the bootcount
uuu fb: ucmd bootcount reset
# Reset the target # Reset the target
uuu fb: acmd reset uuu fb: acmd reset

View File

@ -248,8 +248,10 @@ setenv bootcmd "
echo \"\"; echo \"\";
echo \"\"; echo \"\";
sleep 1; sleep 1;
bootcount reset;
reset; reset;
" "
bootcount reset
saveenv saveenv
reset reset

View File

@ -249,8 +249,10 @@ setenv bootcmd "
echo \"\"; echo \"\";
echo \"\"; echo \"\";
sleep 1; sleep 1;
bootcount reset;
reset; reset;
" "
bootcount reset
saveenv saveenv
reset reset

View File

@ -209,6 +209,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
# Set 'bootcmd' for the second part of the script that will # Set 'bootcmd' for the second part of the script that will
# - Reset environment to defaults # - Reset environment to defaults
# - Reset the bootcount
# - Save the environment # - Save the environment
# - Partition the eMMC user data area for Linux # - Partition the eMMC user data area for Linux
# - Update the 'linux' partition # - Update the 'linux' partition
@ -217,6 +218,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot}; setenv dualboot \${dualboot};
bootcount reset;
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -286,6 +288,8 @@ if [ "${DUALBOOT}" != true ]; then
fi fi
uuu fb: ucmd saveenv uuu fb: ucmd saveenv
# Reset the bootcount
uuu fb: ucmd bootcount reset
# Reset the target # Reset the target
uuu fb: acmd reset uuu fb: acmd reset

View File

@ -260,8 +260,10 @@ setenv bootcmd "
echo \"\"; echo \"\";
echo \"\"; echo \"\";
sleep 1; sleep 1;
bootcount reset;
reset; reset;
" "
bootcount reset
saveenv saveenv
reset reset

View File

@ -263,8 +263,10 @@ setenv bootcmd "
echo \"\"; echo \"\";
echo \"\"; echo \"\";
sleep 1; sleep 1;
bootcount reset;
reset; reset;
" "
bootcount reset
saveenv saveenv
reset reset

View File

@ -213,6 +213,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
# Set 'bootcmd' for the second part of the script that will # Set 'bootcmd' for the second part of the script that will
# - Reset environment to defaults # - Reset environment to defaults
# - Reset the bootcount
# - Save the environment # - Save the environment
# - Partition the eMMC user data area for Linux # - Partition the eMMC user data area for Linux
# - Update the 'linux' partition # - Update the 'linux' partition
@ -221,6 +222,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot}; setenv dualboot \${dualboot};
bootcount reset;
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -290,6 +292,8 @@ if [ "${DUALBOOT}" != true ]; then
fi fi
uuu fb: ucmd saveenv uuu fb: ucmd saveenv
# Reset the bootcount
uuu fb: ucmd bootcount reset
# Reset the target # Reset the target
uuu fb: acmd reset uuu fb: acmd reset

View File

@ -246,8 +246,10 @@ setenv bootcmd "
echo \"\"; echo \"\";
echo \"\"; echo \"\";
sleep 1; sleep 1;
bootcount reset;
reset; reset;
" "
bootcount reset
saveenv saveenv
reset reset

View File

@ -247,8 +247,10 @@ setenv bootcmd "
echo \"\"; echo \"\";
echo \"\"; echo \"\";
sleep 1; sleep 1;
bootcount reset;
reset; reset;
" "
bootcount reset
saveenv saveenv
reset reset

View File

@ -209,6 +209,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
# Set 'bootcmd' for the second part of the script that will # Set 'bootcmd' for the second part of the script that will
# - Reset environment to defaults # - Reset environment to defaults
# - Reset the bootcount
# - Save the environment # - Save the environment
# - Partition the eMMC user data area for Linux # - Partition the eMMC user data area for Linux
# - Update the 'linux' partition # - Update the 'linux' partition
@ -217,6 +218,7 @@ uuu fb: ucmd mmc partconf 0 1 1 1
uuu fb: ucmd setenv bootcmd " uuu fb: ucmd setenv bootcmd "
env default -a; env default -a;
setenv dualboot \${dualboot}; setenv dualboot \${dualboot};
bootcount reset;
saveenv; saveenv;
echo \"\"; echo \"\";
echo \"\"; echo \"\";
@ -286,6 +288,8 @@ if [ "${DUALBOOT}" != true ]; then
fi fi
uuu fb: ucmd saveenv uuu fb: ucmd saveenv
# Reset the bootcount
uuu fb: ucmd bootcount reset
# Reset the target # Reset the target
uuu fb: acmd reset uuu fb: acmd reset

View File

@ -297,8 +297,9 @@ if [ "${SQUASHFS}" = true ]; then
uuu fb: ucmd saveenv uuu fb: ucmd saveenv
fi fi
# Reset the target # Reset the bootcount
uuu fb: ucmd bootcount reset uuu fb: ucmd bootcount reset
# Reset the target
uuu fb: acmd reset uuu fb: acmd reset
echo "\033[32m" echo "\033[32m"