x86-power-control
Vijay Khemka
vijaykhemka at fb.com
Thu Oct 17 12:13:53 AEDT 2019
Hi Ed,
I am trying to use x86-power-control and see there are lots of hard coded values which needs to be configurable as per platform.
1. Name of GPIO line, this should be configurable and should also support GPIO number if user doesn’t want to define line name in DTS.
2. All delay time as it varies for us per platform like powerPulseTimeMs is 1 sec instead of 200 ms and powerPulseTimeMs is 6 sec instead of 15 sec and these varies for different FB platforms.
3. GPIO lines to be monitored, not everyone needs SIO_S5 monitoring or NMI_OUT etc.
4. Enable/disable passthrough
Please suggest what is the best way to make these changes. I am ready to work on this to make required change. We can have these config option defined in entity manager or we can accept a new json file for this configuration.
One more question on code, I see following code requires powerButtonMask to be set before aquiring GPIO line. Please let me know who sets this powerButtonMask to true. I know this is related to GPIO passthrough but still couldn’t understand where in code it gets set until someone call set-property of dbus.
power_control::powerButtonIface->register_property(
"ButtonMasked", false, [](const bool requested, bool& current) {
if (requested)
{
if (power_control::powerButtonMask)
{
return 1;
}
if (!power_control::setGPIOOutput(
"POWER_OUT", 1, power_control::powerButtonMask))
{
throw std::runtime_error("Failed to request GPIO");
return 0;
}
std::cerr << "Power Button Masked.\n";
}
else
{
if (!power_control::powerButtonMask)
{
return 1;
}
std::cerr << "Power Button Un-masked\n";
power_control::powerButtonMask.reset();
}
Regards
-Vijay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20191017/2e48848d/attachment.htm>
More information about the openbmc
mailing list