All of lore.kernel.org
 help / color / mirror / Atom feed
* x86-power-control
@ 2019-10-17  1:13 Vijay Khemka
  2019-10-17  9:56 ` x86-power-control Michael Richardson
  2019-10-17 16:01 ` x86-power-control Bills, Jason M
  0 siblings, 2 replies; 27+ messages in thread
From: Vijay Khemka @ 2019-10-17  1:13 UTC (permalink / raw)
  To: ed.tanous, James Feist, Amithash Prasad; +Cc: Sai Dasari, OpenBMC Maillist

[-- Attachment #1: Type: text/plain, Size: 2130 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 11453 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread
* x86-power-control
@ 2019-11-02  0:33 Vijay Khemka
  2019-11-04 19:52 ` x86-power-control Bills, Jason M
  0 siblings, 1 reply; 27+ messages in thread
From: Vijay Khemka @ 2019-11-02  0:33 UTC (permalink / raw)
  To: jason.m.bills, james.feist; +Cc: openbmc

Hi Jason/James,
I see some limitation in current x86-power-control as we don’t have NMI_OUT, NMI_BUTTON and ID_BUTTON usage. And I am not sure why these are being used. So if I don’t define these in DTS then this program fails. So Please how to disable these. These should be optional. I have following options to disable these.

1. No returning -1 if we don't find line name, simply move on. I have to see impact on rest of code.
2. Make it compile time flag and should be included through bbappend like -DNMI_OUT etc.
3. Have config Jason file and enable or disable gpio line to be used.


Please let us know your thought and how should we approach. I am fine with changing this code and submit patch.

Regards
-Vijay


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2019-11-05  0:33 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17  1:13 x86-power-control Vijay Khemka
2019-10-17  9:56 ` x86-power-control Michael Richardson
2019-10-17 13:38   ` x86-power-control Oskar Senft
2019-10-17 16:02     ` x86-power-control Bills, Jason M
2019-10-17 17:21       ` x86-power-control Oskar Senft
2019-10-17 19:05         ` x86-power-control Bills, Jason M
2019-10-17 22:13     ` x86-power-control Vijay Khemka
2019-10-17 22:08   ` x86-power-control Vijay Khemka
2019-10-18  6:43     ` x86-power-control Michael Richardson
2019-10-17 16:01 ` x86-power-control Bills, Jason M
2019-10-17 22:32   ` x86-power-control Vijay Khemka
2019-10-17 23:25     ` x86-power-control Bills, Jason M
2019-10-17 23:52       ` x86-power-control Vijay Khemka
2019-10-18 18:00         ` x86-power-control Bills, Jason M
2019-10-18 23:04           ` x86-power-control Vijay Khemka
2019-10-21 23:03             ` x86-power-control Bills, Jason M
2019-10-22  1:15               ` x86-power-control Vijay Khemka
2019-10-22 17:14                 ` x86-power-control Bills, Jason M
2019-10-22 17:46                   ` x86-power-control Vijay Khemka
2019-10-22 17:56                     ` x86-power-control James Feist
2019-10-22 18:04                       ` x86-power-control Johnathan Mantey
2019-10-22 19:06                         ` x86-power-control Johnathan Mantey
2019-10-22 19:12                           ` x86-power-control James Feist
2019-10-23 16:35                         ` x86-power-control Vijay Khemka
2019-11-02  0:33 x86-power-control Vijay Khemka
2019-11-04 19:52 ` x86-power-control Bills, Jason M
2019-11-05  0:33   ` x86-power-control Vijay Khemka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.