summaryrefslogtreecommitdiff
path: root/meta-phosphor/common/recipes-phosphor/flash
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-04-27 18:31:30 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-05-03 18:02:10 +0300
commitd4c3f23ea72231a0e9fd2f54292358d7e6504bd5 (patch)
treea02bc6a34954863528ff79255585b68f9e11bfa8 /meta-phosphor/common/recipes-phosphor/flash
parent84824f051fe9b1fa82d79946e7f9546b41251ad2 (diff)
downloadopenbmc-d4c3f23ea72231a0e9fd2f54292358d7e6504bd5.tar.xz
obmc-flash-bmc: Add set_wdt2bite
With commit https://gerrit.openbmc-project.xyz/#/c/10248/ a new u-boot env variable set was introduced to switch sides on failure to boot. Since a BMC update does not update the env variables, explicitly set them if they're not present. Tested: Verified the new env variables were set after activating the image and rebooting the BMC. Change-Id: I807c3e4f9a37d9d9d5f474ba4eb7c60351e3334e Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/flash')
-rw-r--r--meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc
index 4c69713405..8327ad92dd 100644
--- a/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc
+++ b/meta-phosphor/common/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc
@@ -94,6 +94,16 @@ findname() {
echo "${n}"
}
+# Set the u-boot envs that perform a side switch on failure to boot
+set_wdt2bite() {
+ if ! fw_printenv wdt2bite 2>/dev/null; then
+ fw_setenv wdt2bite "mw.l 0x1e785024 0xa 1; mw.b 0x1e78502c 0xb3 1"
+ fw_setenv bootalt "run wdt2bite"
+ fw_setenv obmc_bootcmd "ubi part obmc-ubi; run do_rwreset; ubi read \
+\${loadaddr} \${kernelname}; bootm \${loadaddr} || run bootalt"
+ fi
+}
+
# Make space on flash before creating new volumes. This can be enhanced
# determine current flash usage. For now only keep a "keepmax" number of them
ubi_remove_volumes()
@@ -282,6 +292,8 @@ remount_ubi() {
fi
done
done
+
+ set_wdt2bite
}
# Read the current env variable and set it on the alternate boot env