How to configure PWR Wake-up pins

Revision as of 11:32, 18 August 2022 by Registered User
Applicable for STM32MP13x lines

1. Purpose[edit source]

This article describes the configuration of the PWR wake-up pins.
The PWR Wake-up pins are used to wake-up from Standby from an external peripheral source.

2. Overview[edit source]

schema

  • bloc1.
  • bloc2.
  • bloc3.


3. OP-TEE Wake-up pin configuration[edit source]

Wake-up pins are configured in OP-TEE via device-tree. A small driver named "pwr-irq-user" can be instantiated to handle the desired wake-up pin and send a OPTEE notification to Linux in case of event.

fixme need yaml.

4. Linux Wake-up pin usage[edit source]

Linux does not handle wake-up pin, but it can handle an OP-TEE notification as an interrupt. This is configured via device-tree.

fixme need yaml.

5. Example with wake-up pin 2[edit source]

In the example below, the wake-up pin number 2 is configured by OP-TEE, forwarded as notification number 4 to Linux, and used by "gpio-keys" driver in Linux to generate a key-press.

OP-TEE device tree:

   wakeup_button: wakeup-button {
       compatible = "st,stm32mp1,pwr-irq-user";
       st,wakeup-pin-number = <2>;
       st,notif-it-id = <4>;
       status = "okay";
   };

Linux device tree:

       wake_up {
               compatible = "gpio-keys";
               status = "okay";
               
               button {
                       label = "wake-up";
                       linux,code = <KEY_WAKEUP>;
                       interrupts-extended = <&optee 4>;
                       status = "okay";
               };
       };

6. References[edit source]