summaryrefslogtreecommitdiff
path: root/meta-ampere/meta-jade
diff options
context:
space:
mode:
authorThang Q. Nguyen <thang@os.amperecomputing.com>2022-02-22 13:48:32 +0300
committerThang Q. Nguyen <thang@os.amperecomputing.com>2022-03-01 05:27:22 +0300
commited818137f8ea071077b45a43b65708b23b2670e1 (patch)
treef1d0bd8f97fff5c30d1e16a01731e583ea4982fb /meta-ampere/meta-jade
parent29bb6a3cdde50f0ee93dfb8250ee0e7536e8573e (diff)
downloadopenbmc-ed818137f8ea071077b45a43b65708b23b2670e1.tar.xz
meta-ampere: use watchdog status to check A/C power
With the removal of u-boot patch that adds resetreason to /proc/cmdline no information to check if the BMC is booted from A/C power or cold reboot. This commit removes the dependency of resetreason on the phosphor-discover-system-state application and updates the A/C power check in the ampere_platform_init.sh script to use information from /sys/class/watchdog/watchdog0/bootstatus. Tested: 1. Check power restore policy feature work well. 2. Check ampere_platform_init.sh works properly in both A/C and D/C power. Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com> Change-Id: I4f2e7a241f9ddebf21b2b8c021b9ce87a1c8b26c
Diffstat (limited to 'meta-ampere/meta-jade')
-rw-r--r--meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
index c3772fb9af..4b448ef159 100644
--- a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
+++ b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-platform-init/ampere_platform_init.sh
@@ -30,8 +30,8 @@ gpio_configure_output 229 1
# =======================================================
# Below GPIOs are controlled by other services so just
# initialize in A/C power only.
-cmdline=$(cat /proc/cmdline)
-if [[ $cmdline == *resetreason=power* ]]; then
+bootstatus=$(cat /sys/class/watchdog/watchdog0/bootstatus)
+if [ "$bootstatus" == '32' ]; then
# BMC_GPIOR2_EXT_HIGHTEMP_L
gpio_configure_output 138 1