refactor power restore controller
Currently PowerRestorePolicy handling code uses two undocumented
interfaces:
* `xyz.openbmc_project.Control.Power.RestoreDelay`
* `xyz.openbmc_project.Common.ACBoot`
Power Restore Delay seems to be logical part of
`xyz.openbmc_project.Control.Power.RestorePolicy` interface and has
been moved there.
ACBoot depends on some custom logic that can be found only in Intel-BMC
fork.
This commit reorganize PowerRestorePolicy-related code to be more clear
and flexible, fixes interface for RestoreDelay. Use of ACBoot feature is
now optional and can be compile-time enabled.
Tested: Model power loss event with Off, On and Restore policy, verify,
that power restored as expected.
Test On policy with Delay set to 300000000 - ensure, power on
delayed by 5 minutes.
Test with ACBoot interface emulated.
Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
Change-Id: Id8b42d2085f44418e02a7f52836cc1a6f55f50db
diff --git a/meson.build b/meson.build
index 4507df2..c1cc9b8 100644
--- a/meson.build
+++ b/meson.build
@@ -29,6 +29,9 @@
if get_option('use-plt-rst').enabled()
cpp_args += '-DUSE_PLT_RST'
endif
+if get_option('use-acboot').enabled()
+ cpp_args += '-DUSE_ACBOOT'
+endif
deps = [
dependency('libgpiodcxx', fallback: ['libgpiod', 'gpiodcxx_dep'], default_options: ['bindings=cxx']),