discover: support 3 options to run APR when BMC is rebooted
As defined in the PDIs [1], the RebootCause can be
Power-On-Reset, Watchdog, Pinhole, Software or Unknown. When BMC is
rebooted due to Power-On-Reset, BMC always runs APR feature. But other
RebootCause values, we don't have a clear specification to indicate the
behavior of BMC in those cases. This commit adds 3 more options to
support running APR when BMC rebooted or not.
- 'run-apr-on-pinhole-reset': Run APR when BMC is rebooted due to
pinhole action.
- 'run-apr-on-watchdog-reset': Run APR when BMC is rebooted due to
watchdog.
- 'run-apr-on-software-reset': Run APR when BMC is rebooted due to
software.
[1] https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/State/BMC.interface.yaml#L72
Tested:
Test case 1:
1. Enable run-apr-on-watchdog-reset option
2. Trigger watchdog to reboot BMC
3. BMC runs APR when booting done
4. Disable run-apr-on-watchdog-reset option
5. Trigger watchdog to reboot BMC
6. BMC does not run APR when booting done
Test case 2:
1. Enable run-apr-on-software-reset option
2. Call "reboot" command to reboot BMC
3. BMC runs APR when booting done
4. Disable run-apr-on-software-reset option
5. Trigger watchdog to reboot BMC
6. BMC does not run APR when booting done
Change-Id: I255f52a4008ae1dbf3db69e33471f9d23e0552a0
Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
diff --git a/meson.options b/meson.options
index f0221ea..f7a3efc 100644
--- a/meson.options
+++ b/meson.options
@@ -160,3 +160,24 @@
value: 'enabled',
description: 'Install the obmcutil script',
)
+
+option(
+ 'run-apr-on-pinhole-reset',
+ type: 'boolean',
+ value: true,
+ description: 'run APR when BMC has been rebooted due to pinhole action',
+)
+
+option(
+ 'run-apr-on-watchdog-reset',
+ type: 'boolean',
+ value: true,
+ description: 'run APR when BMC has been rebooted due to watchdog',
+)
+
+option(
+ 'run-apr-on-software-reset',
+ type: 'boolean',
+ value: true,
+ description: 'run APR when BMC has been rebooted due to software request',
+)