Skip to content

Commit 8524afd

Browse files
committed
feat(pm_wakeup_sources): Add Main GPIO wakeup source for AM62L
Add the Main GPIO wakeup example for AM62L. Since this wakeup source is enabled in the AM62L device tree by default, use the example that is configured for AM62L. Move the AM62X/A/P specific example into an ifconfig. Signed-off-by: Kendall Willis <[email protected]>
1 parent d0935ea commit 8524afd

File tree

1 file changed

+87
-51
lines changed

1 file changed

+87
-51
lines changed

source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst

Lines changed: 87 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ valid for given low power modes:
5353

5454
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
5555

56-
+----------------------------------+------------+----------------+
57-
| Wakeup Source | Deep Sleep | RTC Only + DDR |
58-
+==================================+============+================+
59-
| Real-Time Clock (RTC) | Yes | Yes |
60-
+----------------------------------+------------+----------------+
61-
| WKUP GPIO | Yes | No |
62-
+----------------------------------+------------+----------------+
63-
| Main I/O Daisy Chain (Main UART) | Yes | No |
64-
+----------------------------------+------------+----------------+
65-
| USB Wakeup | Yes | No |
66-
+----------------------------------+------------+----------------+
67-
| RTC Ext Pin | Yes | Yes |
68-
+----------------------------------+------------+----------------+
56+
+------------------------------------------------+------------+----------------+
57+
| Wakeup Source | Deep Sleep | RTC Only + DDR |
58+
+================================================+============+================+
59+
| Real-Time Clock (RTC) | Yes | Yes |
60+
+------------------------------------------------+------------+----------------+
61+
| WKUP GPIO | Yes | No |
62+
+------------------------------------------------+------------+----------------+
63+
| Main I/O Daisy Chain (Main GPIO and Main UART) | Yes | No |
64+
+------------------------------------------------+------------+----------------+
65+
| USB Wakeup | Yes | No |
66+
+------------------------------------------------+------------+----------------+
67+
| RTC Ext Pin | Yes | Yes |
68+
+------------------------------------------------+------------+----------------+
6969

7070
*********************
7171
Real-Time Clock (RTC)
@@ -509,26 +509,27 @@ I/O Power Management and Daisy Chaining section in the TRM.
509509

510510
.. note::
511511

512-
|__PART_FAMILY_DEVICE_NAMES__| supports the ability to wakeup using pad based wake event ONLY in Deep Sleep or MCU Only Mode.
513-
During active system usage, even if the wake_enable bit is set the system will be unresponsive to any wakeup
514-
activity on that pad.
515-
516-
To demonstrate I/O daisy chain wakeup as part of |__PART_FAMILY_DEVICE_NAMES__| offering, two reference examples are provided:
517-
518-
#. main_uart0 is used where a key press on the Linux console can wakeup the system.
519-
#. main_gpio is used where activity on configured GPIO pin can wakeup the system.
512+
|__PART_FAMILY_DEVICE_NAMES__| supports the ability to wakeup using pad
513+
based wake event ONLY in Deep Sleep or MCU Only Mode. During active
514+
system usage, even if the wake_enable bit is set the system will be
515+
unresponsive to any wakeup activity on that pad.
520516

521517
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
522518

523519
.. note::
524520

525-
|__PART_FAMILY_DEVICE_NAMES__| supports the ability to wakeup using pad based wake event ONLY in Deep Sleep.
526-
During active system usage, even if the wake_enable bit is set the system will be unresponsive to any wakeup
521+
|__PART_FAMILY_DEVICE_NAMES__| supports the ability to wakeup using pad
522+
based wake event ONLY in Deep Sleep. During active system usage, even if
523+
the wake_enable bit is set the system will be unresponsive to any wakeup
527524
activity on that pad.
528525

529-
To demonstrate I/O daisy chain wakeup as part of |__PART_FAMILY_DEVICE_NAMES__| offering, a reference example is provided:
526+
To demonstrate I/O daisy chain wakeup as part of |__PART_FAMILY_DEVICE_NAMES__|
527+
offering, two reference examples are provided:
530528

531-
#. main_uart0 is used where a key press on the Linux console can wakeup the system.
529+
#. main_uart0 is used where a key press on the Linux console can wakeup the
530+
system.
531+
#. main_gpio is used where activity on configured GPIO pin can wakeup the
532+
system.
532533

533534

534535
Main UART
@@ -707,36 +708,32 @@ Any UART can be chosen according to application requirements.
707708
Main GPIO
708709
=========
709710

710-
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
711-
712-
Main GPIO wakeup is not yet supported on AM62LX.
711+
Configuring Main GPIO as an I/O daisy chain wakeup source requires a
712+
combination of gpio-keys with chained IRQ in the pinctrl driver. To briefly
713+
explain, setting the 29th bit in the desired padconfig register, allows the
714+
pad to act as a wakeup source by triggering a wake IRQ in Deep Sleep states.
713715

714716
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX')
715717

716-
Configuring Main GPIO as an I/O daisy chain wakeup source requires a
717-
combination of gpio-keys with chained IRQ in the pinctrl driver. To briefly
718-
explain, setting the 29th bit in the desired padconfig register, allows the
719-
pad to act as a wakeup source by triggering a wake IRQ to the DM R5 in Deep
720-
Sleep states.
721-
722718
The reference configuration for Main GPIO wakeup can be found under
723-
gpio_key node in `k3-am62x-sk-lpm-wkup-sources.dtso <https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-lpm-wkup-sources.dtso?h=11.01.05#n21>`__
724-
725-
.. code-block:: console
726-
727-
gpio_key {
728-
compatible = "gpio-keys";
729-
autorepeat;
730-
pinctrl-names = "default";
731-
pinctrl-0 = <&main_gpio1_pins_default>;
732-
switch {
733-
label = "WKGPIO";
734-
linux,code = <KEY_WAKEUP>;
735-
interrupts-extended = <&main_gpio1 10 IRQ_TYPE_EDGE_RISING>,
736-
<&main_pmx0 0x1a0>;
737-
interrupt-names = "irq", "wakeup";
738-
};
739-
};
719+
gpio_key node in
720+
`k3-am62x-sk-lpm-wkup-sources.dtso <https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-lpm-wkup-sources.dtso?h=11.01.05#n21>`__
721+
722+
.. code-block:: console
723+
724+
gpio_key {
725+
compatible = "gpio-keys";
726+
autorepeat;
727+
pinctrl-names = "default";
728+
pinctrl-0 = <&main_gpio1_pins_default>;
729+
switch {
730+
label = "WKGPIO";
731+
linux,code = <KEY_WAKEUP>;
732+
interrupts-extended = <&main_gpio1 10 IRQ_TYPE_EDGE_RISING>,
733+
<&main_pmx0 0x1a0>;
734+
interrupt-names = "irq", "wakeup";
735+
};
736+
};
740737
741738
Here, we chain the IRQ to the pinctrl driver using the second
742739
interrupts-extended entry. The wake IRQ framework in Linux works in such a
@@ -759,6 +756,45 @@ Main GPIO
759756
:ref:`LPM section<lpm_modes>`, wakeup from MAIN GPIO1_10 can be triggered
760757
by grounding Pin 33 on J3 User Expansion Connector.
761758

759+
.. ifconfig:: CONFIG_part_variant in ('AM62LX')
760+
761+
The reference configuration for Main GPIO wakeup can be found under
762+
gpio_key node in
763+
`k3-am62l3-evm.dts <https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62l3-evm.dts?h=11.02.06#n50>`__
764+
765+
.. code-block:: console
766+
767+
gpio_key {
768+
compatible = "gpio-keys";
769+
autorepeat;
770+
pinctrl-names = "default";
771+
pinctrl-0 = <&usr_button_pins_default>;
772+
switch {
773+
label = "User Key";
774+
linux,code = <BTN_0>;
775+
interrupts-extended = <&main_gpio0 90 IRQ_TYPE_EDGE_RISING>,
776+
<&main_pmx0 0x1ac>;
777+
interrupt-names = "irq", "wakeup";
778+
};
779+
};
780+
781+
Here, we chain the IRQ to the pinctrl driver using the second
782+
interrupts-extended entry. The wake IRQ framework in Linux works in such a
783+
way that the second entry gets marked as a wakeup source, and then the
784+
pinctrl driver is informed that the pad 0x1ac in this case is to be
785+
configured as a wakeup pad when system enters Deep Sleep.
786+
787+
To use main_gpio as a wakeup source, ensure gpio is a wake-irq in /proc/interrupts:
788+
789+
.. code-block:: console
790+
791+
root@<machine>:~# grep wakeup /proc/interrupts
792+
299: 0 0 pinctrl 428 Edge User Key:wakeup
793+
794+
Once the system has entered Deep Sleep as shown in the
795+
:ref:`LPM section<lpm_modes>`, wakeup from MAIN GPIO0_90 can be triggered
796+
by pressing button SW5.
797+
762798
*********
763799
WKUP UART
764800
*********

0 commit comments

Comments
 (0)