i.MX7D LPSR resume from GPIO?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX7D LPSR resume from GPIO?

1,670 Views
mooreaa
Contributor II

We're working on a custom board based on the i.MX7D and have LPSR mode working mostly, but we have not been able to resume from GPIO. Currently from LPSR, we can resume from RTC and ONOFF button only. In suspend-to-memory, we are able to resume from RTC, ONOFF, as well as GPIOs without any issue.

For reference, NVCC_GPIO1/2 are valid during LPSR, VDD_LPSR and VDD_SNVS are also valid as well as the memory rails needed for self refresh. We do observe the GPIO toggling when probing it externally so it seems to be a configuration issue. 

In STM, we can wake from gpio using all the regular methods including: using device tree with gpio-keys using the wakeup flag, from system using /sys/class/gpio, as well as by requesting gpio/irq from another driver. However, none of these methods allow for LPSR based wakeup.

Since in LPSR mode the A7s are in an ALL_OFF state, I'm thinking it may be an issue with the GPCv2 configuration masking the GPIO wakeups.

I'm curious if someone could shed some light on this or could refer to an example code base where LPSR GPIO resume is functioning (such as on the arm2 board).

Thank you,

0 Kudos
5 Replies

897 Views
Yuri
NXP Employee
NXP Employee

Hello,

  The minimum power domains needs to be on for LPSR are VDD_SNVS, VDD_LPSR and NVCC_DRAM, then it supports RTC alarm wakeup and ON/OFF button wakeup, as these two wakeup sources are inside SNVS domain. If users need GPIO wakeup, then the dedicated GPIO bank power should be on, such as NVCC_GPIO1/NVCC_GPIO2, one for 1.8V and the other for 3.3V.

How to submit a new question for NXP Support 

Have a great day,

Yuri

 

------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct

Answer button. Thank you!

0 Kudos

897 Views
mooreaa
Contributor II

Hi Yuri,

As mentioned, those rails are already valid on our board but we are still not able to wake form GPIO.

0 Kudos

897 Views
billgessaman
Contributor IV

Hi Aaron,

Would it be fair to ask whether you ever were able to resolve this issue?  We are are also doing a custom i.MX7D design with DDR3L memory and have LPSR working but it does not exit LPSR on an interrupt transition from our Pcap touch panel (specifically GPIO1_IO07 input).  It appears that Yuri was encouraging you to create a support request, so I'm wondering if you were able to get any resolution through that channel?

Thanks,

Bill

0 Kudos

897 Views
jacobpostman
Contributor II

Hi Bill,

We did eventually resolve this and are able to wake from LPSR from GPIO by setting bit 7 in register 0x30370048.
I imagine this should be done in the gpio or interrupt controller, but may not be hooked up correctly for LPSR on the mx7 yet?

As a quick test, you can run this from uboot command line before booting:

mw 0x30370048 0x80 1

Or from code:

writel(0x80, 0x30370048);

Then proceed with your preferred configuration for waking from gpio from driver, fs or dts such as:

1. the gpio-keys driver
gpio-keys {
   compatible = "gpio-keys";
   hall_wake {
      label = "Sensor Up";
      gpios = <&gpio1 7 2>;
      linux,code = <116>; /* KEY_POWER */
      gpio-key,wakeup;
   };
};
2. setting up the gpio via file system from command line
echo 7 > /sys/class/gpio/export
echo falling > /sys/class/gpio/gpio7/edge
echo on > /sys/class/gpio/gpio7/power/control

Feel free to shoot me a PM if that doesn't work.

0 Kudos

897 Views
Yuri
NXP Employee
NXP Employee

Hello,

  For more details regarding Linux support, please create request

https://community.nxp.com/docs/DOC-329745  

Regards,

Yuri.

0 Kudos