x86-power-control question: front panel buttons dont work

Bills, Jason M jason.m.bills at linux.intel.com
Thu Jun 9 01:01:53 AEST 2022


Hi Nikita,

Sorry for the delay on this as I was on leave.  Did this get resolved?

On 5/11/2022 2:05 AM, Nikita Pavlov wrote:
> Hi Jason,
> 
> Front panel stop working from there until the next reboot even after 
> stopping gpioset.
It sounds like something in the pinctrl muxing is not behaving as expected.

Do you use Aspeed?  What version of Aspeed chip are you using? (This 
will help find the pinctrl info in the kernel which is hardware-specific.)

> 
> I test it with getting POWER_OUT line value and then released line like 
> this:
> 
> #include <gpiod.hpp>
> 
> #include <iostream>
> 
> int main(int argc, char** argv)
> {
>      gpiod::line line = gpiod::find_line("POWER_OUT");
>      if (!line)
>      {
>          std::cerr << "find line error\n";
>          return -1;
>      }
> 
>      try
>      {
>          line.request({"pwr", gpiod::line_request::EVENT_BOTH_EDGES, {}});
>      }
>      catch (const std::exception& ec)
>      {
>          std::cerr << ec.what();
>      }
> 
>      int state = line.get_value();
>      std::cout << state << '\n';
>      line.release();
> 
>      return 0;
> }
> 
> 
> But front panel button also doesnt work with getting value.
> 
> --
> Best regards,
> Nikita Pavlov,
> NUST MISiS Student
> 
> 
> 
> понедельник, 2 мая 2022 г., 18:36:24 GMT+3, Bills, Jason M 
> <jason.m.bills at linux.intel.com> написал(-а):
> 
> 
> Hi Nikita,
> 
> On 4/30/2022 7:25 AM, Nikita Pavlov wrote:
>  > Hi Jason, thank you for your response. In my platform I have
>  > power-control gpios in GPIOD group like this:
>  >
>  > /*D0-D7*/ "POWER_BUTTON","POWER_OUT","RESET_BUTTON","RESET_OUT",
>  >
>  > Also I configurate pass-through mode in dts:
>  >
>  >          pinctrl-names = "pass-through";
>  >          pinctrl-0 = <&pinctrl_gpid0_default
>  >                              &pinctrl_gpid2_default>;
> 
> Could you please share what is your BMC hardware version?
>  >
>  > After update and reboot platform I have same problem - front panel
>  > buttons dont enable (front panel buttons dont enable if I use
>  > x86-power-control module or manually set gpio values by gpioset utility).
>  > But if I dont use any impacts on gpio (disable x86-power-control module
>  > and dont use gpio utilities like gpioset/get) front panel buttons 
> work well.
>  >
>  > What are your assumptions about this ?
> 
> The pass-through is set up as a mux in pinctrl.  If I remember
> correctly, the output pin has GPIO output and pass-through mode as two
> different options in the pinctrl mux.
> 
> So, when you request the output pin using libgpiod, it automatically
> configures the pinctrl to disable the pass-through. You should be able
> to re-enable pass-through by simply releasing control of the output pin
> in libgpiod.
> 
> For simplicity, let's work with just the gpioset utility and not use
> x86-power-control.  So, when you initially boot, the pass-through is
> working. You then use gpioset to change the output pin (which will
> switch the pinctrl mux and disable pass-through mode causing the front
> panel to stop working). When you stop gpioset, it should release the
> gpio and switch the mux back to enable pass-through mode for the front
> panel to work again.
> 
> In your test does the front panel start working again after stopping
> gpioset? Or does the front panel stop working from there until the next
> reboot even after stopping gpioset?
> 
> Thanks,
> 
> -Jason
> 
>  >
>  >
>  >
>  > --
>  > Best regards,
>  > Nikita Pavlov,
>  > NUST MISiS Student
>  >
>  >
>  >
>  > четверг, 28 апреля 2022 г., 23:01:13 GMT+3, Bills, Jason M
>  > <jason.m.bills at intel.com <mailto:jason.m.bills at intel.com>> написал(-а):
>  >
>  >
>  > Hi Nikita,
>  >
>  > In the hardware, we have the power button routed through a GPIO
>  > pass-through on the Aspeed chip.  If that pass-through is disabled, it
>  > will prevent the physical front panel button signal from getting past
>  > the BMC.  That is the first thing I would check.
>  >
>  > Also, it is better to send these kinds of questions to the OpenBMC
>  > mailing list as there may be others in the community in a similar 
> situation.
>  >
>  > Thanks,
>  >
>  > -Jason
>  >
>  > *From:* Nikita Pavlov <niikita at yahoo.com <mailto:niikita at yahoo.com>>
>  > *Sent:* Thursday, April 28, 2022 8:58 AM
>  > *To:* Bills, Jason M <jason.m.bills at intel.com 
> <mailto:jason.m.bills at intel.com>>; kuiying.wang at intel.com 
> <mailto:kuiying.wang at intel.com>
>  > *Subject:* x86-power-control question: front panel buttons dont work
>  >
>  > Hi, I user x86-power-control module for my test intel platform. Its
>  > module works in webui but front panel physical buttons doesnt work. I
>  > think that it interface describe in this fragment
>  > 
> https://github.com/openbmc/x86-power-control/blob/master/src/power_control.cpp#L3072 
> <https://github.com/openbmc/x86-power-control/blob/master/src/power_control.cpp#L3072 
>  >
>  > 
> <https://github.com/openbmc/x86-power-control/blob/master/src/power_control.cpp#L3072 
> <https://github.com/openbmc/x86-power-control/blob/master/src/power_control.cpp#L3072>> but 
> 
>  > I cant understand this logic.
>  >
>  > Say me pls, why front panel buttons dont work ?
>  >
>  > --
>  > Best regards,
>  > Nikita Pavlov,
>  > NUST MISiS Student
>  >


More information about the openbmc mailing list