UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor vvanbeveren
Visitor
376 Views
Registered: ‎09-27-2018

Petalinux on ZYNQ7030 and power button with LTC2953

Hi,

We would like to have a proper power button on our ZYNQ & Petalinux design, using the button + LTC2953 On/Off controller to gracefully shutdown linux. However, I can find very little information on how to achieve this. Apparently the OS needs set a GPIO high, connected to the 'not kill' of the On/Off controller.

Then, when the power button is pressed again, an IRQ signal is send to the OS and needs to shut-down gracefully. Once the OS is shutdown, it pulls the kill signal low (or tristates with a pull down resistor) and LTC2953 will disable the DC/DC converter.

However, I have no idea how to configure this for Petalinux. Any insights on how to achieve this? Thanks!

Vincent

0 Kudos
3 Replies
Highlighted
Visitor kellyjp
Visitor
339 Views
Registered: ‎04-26-2018

Re: Petalinux on ZYNQ7030 and power button with LTC2953

HI Vincent,

The Linux kernel includes a driver that *might* be adaptable to your needs.  The driver is for the LTC2952 which is similar to the LTC2953 in that it uses an INT trigger signal to indicate to the CPU that a shutdown is required and a KILL signal for the CPU to indicate to the power controller that the shutdown is complete and the power can be removed.  The LTC2953 doesn't have a WDE signal so the watchdog output generated by the LTC2952 driver would not be used with a LTC2953.

When the LTC2952 driver receives the INT trigger interrupt via a GPIO it starts a timer and once the timer expires it calls the kernel orderly_poweroff API to initiate a shutdown.  Once the shutdown is complete the kernel calls pm_power_off which the driver handles and then sends the KILL signal to the power controller via a GPIO.  Note that if any other driver in your kernel configuration claims pm_power_off this won't work - the LTC2952 driver will tell you this when it is loaded via a kernel message.  In that case you will need to figure out what driver has already claimed pm_power_off and see if you really need that driver.

To use the LTC2952 driver you need to modify the Linux kernel configuration to include the driver.  The configuration option required is CONFIG_POWER_RESET_LTC2952.  You can select this option when configuring petalinux using the command:

petalinux-config -c kernel

The source for the driver can be found at https://github.com/Xilinx/linux-xlnx/blob/xilinx-v2018.3/drivers/power/reset/ltc2952-poweroff.c.  The source code includes some limited documentation.

The driver requires configuration via the device tree to specify what GPIO ports are used for the INT and KILL connections to the power controller and their polarity.  The device tree binding for the driver is documented at https://github.com/Xilinx/linux-xlnx/blob/xilinx-v2018.3/Documentation/devicetree/bindings/power/reset/ltc2952-poweroff.txt.

Hopefully the above gives you some ideas.

Note that the LTC2952 driver shouldn't be used with a ZynqMP as Xilinx already has code in their ZynqMP PMU firmware to handle a LTC295X style power controller.

James

0 Kudos
Visitor vvanbeveren
Visitor
320 Views
Registered: ‎09-27-2018

Re: Petalinux on ZYNQ7030 and power button with LTC2953

Hi James,

Thanks for your reply. That is an excellent idea! I'll try that, or maybe I could even adapt the driver for the KTC2953. I'm on holiday now for a week or so, but I will try it once I get back!  Thanks!

Cheers,
Vincent

0 Kudos
Explorer
Explorer
291 Views
Registered: ‎10-21-2015

Re: Petalinux on ZYNQ7030 and power button with LTC2953

0 Kudos