From d0935ea414142579eab848802e6e129c9665ef81 Mon Sep 17 00:00:00 2001 From: Kendall Willis Date: Mon, 24 Nov 2025 16:37:20 -0600 Subject: [PATCH 1/5] feat(pm_wakeup_sources): Add WKUP GPIO wakeup source for AM62L When AM62L enters Deep Sleep, WKUP GPIO pins can wakeup the system if they are configured. Detail how to configure the WKUP GPIO to wakeup the system and give an example that is used in the device tree. Signed-off-by: Kendall Willis --- .../Power_Management/pm_wakeup_sources.rst | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst b/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst index 24862b1ce..7a766c655 100644 --- a/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst +++ b/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst @@ -58,6 +58,8 @@ valid for given low power modes: +==================================+============+================+ | Real-Time Clock (RTC) | Yes | Yes | +----------------------------------+------------+----------------+ + | WKUP GPIO | Yes | No | + +----------------------------------+------------+----------------+ | Main I/O Daisy Chain (Main UART) | Yes | No | +----------------------------------+------------+----------------+ | USB Wakeup | Yes | No | @@ -399,6 +401,92 @@ MCU GPIO :ref:`LPM section`, wakeup from MCU_SPI0_D1 can be triggered by grounding Pin 4 on J8 MCU Header. +********* +WKUP GPIO +********* + +.. ifconfig:: CONFIG_part_variant in ('AM62LX') + + One of the most common ways to wakeup a system is by using some I/O activity. + I/O activity on the WKUP GPIOs can wakeup the system when the WKUP GPIO + controller is configured as a wakeup source. Refer to the wkup_gpio_key node + in + `k3-am62l3-evm-lpm-wkup-sources.dtso `__ + to use as a template to configure the desired WKUP GPIO as a wakeup capable + GPIO. + + A brief guide to configuring an WKUP GPIO as wakeup: + + First, add gpio-keys as a compatible string, refer to + `gpio_keys kernel documentation `__ + for details. + + .. code-block:: dts + + compatible = "gpio-keys"; + + Set the desired pinctrl, + + .. code-block:: dts + + pinctrl-names = "default"; + pinctrl-0 = <&wake_wkupgpio0_pins_default>; + + Setup the interrupt parent and interrupt as WKUP_GPIO0, + + .. code-block:: dts + + interrupt-parent = <&wkup_gpio0>; + interrupts = <0 IRQ_TYPE_EDGE_RISING>; + + Now, under the switch node, add the following: + + .. code-block:: dts + + switch { + label = "WKUPGPIO"; + linux,code = <143>; + gpios = <&wkup_gpio0 0 GPIO_ACTIVE_LOW>; + wakeup-source; + }; + + #. label: Descriptive name of the switch node. If the WKUP GPIO node is setup + correctly, the label will appear under /proc/interrupts. + #. linux,code: Keycode to emit. + #. gpios: the gpio required to be used as the gpio-key. + #. wakeup-source: + `wakeup-source `__ + property describes devices which have wakeup capability. + + To confirm that gpio_keys can wakeup the system from Deep Sleep, check + /proc/interrupts for the label: + + .. code-block:: console + + root@:~# cat /proc/interrupts | grep "WKUPGPIO" + 23: 0 0 GPIO 0 Edge -davinci_gpio WKUPGPIO + + The WKUP GPIOs can be used to wakeup the system from Deep Sleep because WKUP + GPIOs are in a power domain that stays ON when the SoC is in Deep Sleep. + Hence, the GPIO controller is able to act as a wakeup source and send a + wakeup interrupt to the system. + + WKUP GPIO wakeup can only be tested when + `k3-am62l3-evm-lpm-wkup-sources.dtso `__ + overlay is loaded. Refer to :ref:`How to enable DT overlays` for more details. + The WKUP GPIO in the overlay is routed from the WKUP UART. With this + configuration the WKUP UART is not available as a wakeup source. + + Once the system has entered Deep Sleep as shown in the + :ref:`LPM section`, wakeup from WKUP_UART0_RXD can be triggered + by entering a keypress on the WKUP UART (/dev/ttyUSB2). + +.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX') + + Setup of WKUP GPIO is the same process of MCU GPIO. Refer to the MCU GPIO + section on how to configure wakeup from WKUP GPIO. + + ******************** Main I/O Daisy Chain ******************** From 8524afd4204865f558a247e2c8ece10db7134658 Mon Sep 17 00:00:00 2001 From: Kendall Willis Date: Tue, 25 Nov 2025 14:24:46 -0600 Subject: [PATCH 2/5] 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 --- .../Power_Management/pm_wakeup_sources.rst | 138 +++++++++++------- 1 file changed, 87 insertions(+), 51 deletions(-) diff --git a/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst b/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst index 7a766c655..40e04c62e 100644 --- a/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst +++ b/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst @@ -53,19 +53,19 @@ valid for given low power modes: .. ifconfig:: CONFIG_part_variant in ('AM62LX') - +----------------------------------+------------+----------------+ - | Wakeup Source | Deep Sleep | RTC Only + DDR | - +==================================+============+================+ - | Real-Time Clock (RTC) | Yes | Yes | - +----------------------------------+------------+----------------+ - | WKUP GPIO | Yes | No | - +----------------------------------+------------+----------------+ - | Main I/O Daisy Chain (Main UART) | Yes | No | - +----------------------------------+------------+----------------+ - | USB Wakeup | Yes | No | - +----------------------------------+------------+----------------+ - | RTC Ext Pin | Yes | Yes | - +----------------------------------+------------+----------------+ + +------------------------------------------------+------------+----------------+ + | Wakeup Source | Deep Sleep | RTC Only + DDR | + +================================================+============+================+ + | Real-Time Clock (RTC) | Yes | Yes | + +------------------------------------------------+------------+----------------+ + | WKUP GPIO | Yes | No | + +------------------------------------------------+------------+----------------+ + | Main I/O Daisy Chain (Main GPIO and Main UART) | Yes | No | + +------------------------------------------------+------------+----------------+ + | USB Wakeup | Yes | No | + +------------------------------------------------+------------+----------------+ + | RTC Ext Pin | Yes | Yes | + +------------------------------------------------+------------+----------------+ ********************* Real-Time Clock (RTC) @@ -509,26 +509,27 @@ I/O Power Management and Daisy Chaining section in the TRM. .. note:: - |__PART_FAMILY_DEVICE_NAMES__| supports the ability to wakeup using pad based wake event ONLY in Deep Sleep or MCU Only Mode. - During active system usage, even if the wake_enable bit is set the system will be unresponsive to any wakeup - activity on that pad. - - To demonstrate I/O daisy chain wakeup as part of |__PART_FAMILY_DEVICE_NAMES__| offering, two reference examples are provided: - - #. main_uart0 is used where a key press on the Linux console can wakeup the system. - #. main_gpio is used where activity on configured GPIO pin can wakeup the system. + |__PART_FAMILY_DEVICE_NAMES__| supports the ability to wakeup using pad + based wake event ONLY in Deep Sleep or MCU Only Mode. During active + system usage, even if the wake_enable bit is set the system will be + unresponsive to any wakeup activity on that pad. .. ifconfig:: CONFIG_part_variant in ('AM62LX') .. note:: - |__PART_FAMILY_DEVICE_NAMES__| supports the ability to wakeup using pad based wake event ONLY in Deep Sleep. - During active system usage, even if the wake_enable bit is set the system will be unresponsive to any wakeup + |__PART_FAMILY_DEVICE_NAMES__| supports the ability to wakeup using pad + based wake event ONLY in Deep Sleep. During active system usage, even if + the wake_enable bit is set the system will be unresponsive to any wakeup activity on that pad. - To demonstrate I/O daisy chain wakeup as part of |__PART_FAMILY_DEVICE_NAMES__| offering, a reference example is provided: +To demonstrate I/O daisy chain wakeup as part of |__PART_FAMILY_DEVICE_NAMES__| +offering, two reference examples are provided: - #. main_uart0 is used where a key press on the Linux console can wakeup the system. +#. main_uart0 is used where a key press on the Linux console can wakeup the + system. +#. main_gpio is used where activity on configured GPIO pin can wakeup the + system. Main UART @@ -707,36 +708,32 @@ Any UART can be chosen according to application requirements. Main GPIO ========= -.. ifconfig:: CONFIG_part_variant in ('AM62LX') - - Main GPIO wakeup is not yet supported on AM62LX. +Configuring Main GPIO as an I/O daisy chain wakeup source requires a +combination of gpio-keys with chained IRQ in the pinctrl driver. To briefly +explain, setting the 29th bit in the desired padconfig register, allows the +pad to act as a wakeup source by triggering a wake IRQ in Deep Sleep states. .. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX') - Configuring Main GPIO as an I/O daisy chain wakeup source requires a - combination of gpio-keys with chained IRQ in the pinctrl driver. To briefly - explain, setting the 29th bit in the desired padconfig register, allows the - pad to act as a wakeup source by triggering a wake IRQ to the DM R5 in Deep - Sleep states. - The reference configuration for Main GPIO wakeup can be found under - gpio_key node in `k3-am62x-sk-lpm-wkup-sources.dtso `__ - - .. code-block:: console - - gpio_key { - compatible = "gpio-keys"; - autorepeat; - pinctrl-names = "default"; - pinctrl-0 = <&main_gpio1_pins_default>; - switch { - label = "WKGPIO"; - linux,code = ; - interrupts-extended = <&main_gpio1 10 IRQ_TYPE_EDGE_RISING>, - <&main_pmx0 0x1a0>; - interrupt-names = "irq", "wakeup"; - }; - }; + gpio_key node in + `k3-am62x-sk-lpm-wkup-sources.dtso `__ + + .. code-block:: console + + gpio_key { + compatible = "gpio-keys"; + autorepeat; + pinctrl-names = "default"; + pinctrl-0 = <&main_gpio1_pins_default>; + switch { + label = "WKGPIO"; + linux,code = ; + interrupts-extended = <&main_gpio1 10 IRQ_TYPE_EDGE_RISING>, + <&main_pmx0 0x1a0>; + interrupt-names = "irq", "wakeup"; + }; + }; Here, we chain the IRQ to the pinctrl driver using the second interrupts-extended entry. The wake IRQ framework in Linux works in such a @@ -759,6 +756,45 @@ Main GPIO :ref:`LPM section`, wakeup from MAIN GPIO1_10 can be triggered by grounding Pin 33 on J3 User Expansion Connector. +.. ifconfig:: CONFIG_part_variant in ('AM62LX') + + The reference configuration for Main GPIO wakeup can be found under + gpio_key node in + `k3-am62l3-evm.dts `__ + + .. code-block:: console + + gpio_key { + compatible = "gpio-keys"; + autorepeat; + pinctrl-names = "default"; + pinctrl-0 = <&usr_button_pins_default>; + switch { + label = "User Key"; + linux,code = ; + interrupts-extended = <&main_gpio0 90 IRQ_TYPE_EDGE_RISING>, + <&main_pmx0 0x1ac>; + interrupt-names = "irq", "wakeup"; + }; + }; + + Here, we chain the IRQ to the pinctrl driver using the second + interrupts-extended entry. The wake IRQ framework in Linux works in such a + way that the second entry gets marked as a wakeup source, and then the + pinctrl driver is informed that the pad 0x1ac in this case is to be + configured as a wakeup pad when system enters Deep Sleep. + + To use main_gpio as a wakeup source, ensure gpio is a wake-irq in /proc/interrupts: + + .. code-block:: console + + root@:~# grep wakeup /proc/interrupts + 299: 0 0 pinctrl 428 Edge User Key:wakeup + + Once the system has entered Deep Sleep as shown in the + :ref:`LPM section`, wakeup from MAIN GPIO0_90 can be triggered + by pressing button SW5. + ********* WKUP UART ********* From be5dca5809ea02d1fb8ee337c35f2f1ea9914e6d Mon Sep 17 00:00:00 2001 From: Kendall Willis Date: Mon, 24 Nov 2025 16:45:19 -0600 Subject: [PATCH 3/5] feat(pm_wakeup_sources): Add WKUP UART wakeup source for AM62L Remove the ifconfig for AM62L that says that WKUP UART is not supported. Add in any specific AM62L information for WKUP UART. Signed-off-by: Kendall Willis --- .../Power_Management/pm_wakeup_sources.rst | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst b/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst index 40e04c62e..f56a723af 100644 --- a/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst +++ b/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst @@ -62,6 +62,8 @@ valid for given low power modes: +------------------------------------------------+------------+----------------+ | Main I/O Daisy Chain (Main GPIO and Main UART) | Yes | No | +------------------------------------------------+------------+----------------+ + | WKUP UART | Yes | No | + +------------------------------------------------+------------+----------------+ | USB Wakeup | Yes | No | +------------------------------------------------+------------+----------------+ | RTC Ext Pin | Yes | Yes | @@ -799,28 +801,28 @@ pad to act as a wakeup source by triggering a wake IRQ in Deep Sleep states. WKUP UART ********* -.. ifconfig:: CONFIG_part_variant in ('AM62LX') +The UART in WKUP domain is capable of waking up the system. - WKUP UART wakeup is not yet supported on AM62LX. +In order to use WKUP UART as a wakeup source, it needs to be configured +in a generic way using the ti-sysc interconnect target module driver. +The reference configuration can be found under target-module in +`k3-am62-wakeup.dtsi `__ .. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX') - The UART in WKUP domain is capable of waking up the system from Deep - Sleep and MCU Only modes. + WKUP UART is generally available on the third serial port + (/dev/ttyUSB2) and by default it only shows output from DM R5. - In order to use WKUP UART as a wakeup source, it needs to be configured - in a generic way using the ti-sysc interconnect target module driver. - The reference configuration can be found under target-module in - `k3-am62-wakeup.dtsi `__ +.. ifconfig:: CONFIG_part_variant in ('AM62LX') WKUP UART is generally available on the third serial port - (/dev/ttyUSB2) and by default it only shows output from DM R5. + (/dev/ttyUSB2). - Once the system has entered Deep Sleep or MCU Only mode as shown in the - :ref:`LPM section`, wakeup from WKUP UART can be triggered - by doing *any key press* on the WKUP UART terminal. No output will be - visible on the WKUP UART terminal, but Linux resume messages will be - printed on the MAIN UART terminal. +Once the system has entered the specified low power mode as shown in the +:ref:`LPM section`, wakeup from WKUP UART can be triggered +by doing *any key press* on the WKUP UART terminal. No output will be +visible on the WKUP UART terminal, but Linux resume messages will be +printed on the MAIN UART terminal. ****************** From 6141849490327aefd1c6fca40eeeff8e3d16a8a0 Mon Sep 17 00:00:00 2001 From: Kendall Willis Date: Tue, 25 Nov 2025 14:59:27 -0600 Subject: [PATCH 4/5] style(pm_wakeup_sources): Reword Main I/O Daisy Chain section Reword the Main I/O Daisy Chain section to remove passive language. Signed-off-by: Kendall Willis --- .../Power_Management/pm_wakeup_sources.rst | 61 ++++++++++--------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst b/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst index f56a723af..eb4ab3195 100644 --- a/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst +++ b/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst @@ -493,19 +493,22 @@ WKUP GPIO Main I/O Daisy Chain ******************** -The main domain is powered-off when the SoC enters low power mode. This includes controllers like -Main UART, GPIO, I2C, etc. The question then arises how to wakeup the SoC from peripherals connected -to these controllers (for example main UART)? Here's where the role of I/O Daisy Chaining comes in. -At the hardware level, all the pads in an SoC have to be pinmuxed to dedicated controllers like UART or GPIO. - -For example, if a key press on Main UART (which is used for Linux console logs) -were to wakeup the system from Deep Sleep then simply configuring the Main UART controller as a -wakeup source wouldn't suffice. This is because the UART controller is powered off and wouldn't be able to -register any key press as such. However, at the "pad" level we are still connected, and the pads have -a specific way to be configured as wakeup sources. - -For detailed information and sequence please refer to -I/O Power Management and Daisy Chaining section in the TRM. +When the SoC enters a low power mode, the main domain is powered-off. The main +domain includes controllers like Main UART, GPIO, I2C, etc. I/O daisy chaining +is used in order to wakeup the SoC from peripherals that are connected to +powered-off controllers. At the hardware level, all the pads in an SoC are +pinmuxed to dedicated controllers, such as UART or GPIO. + +For example, to wakeup the system from Deep Sleep via a key press on Main UART +(used for Linux console logs), then simply configuring the Main UART +controller as a wakeup source wouldn't work. This is because the UART +controller is powered off and wouldn't be able to register any key press as +a wakeup event. However, the UART is still connected at the "pad" level and the +pads can be configured as wakeup sources by setting a specific bit in the pad +register. + +For detailed information and sequence please refer to I/O Power Management and +Daisy Chaining section in the TRM. .. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX') @@ -711,9 +714,9 @@ Main GPIO ========= Configuring Main GPIO as an I/O daisy chain wakeup source requires a -combination of gpio-keys with chained IRQ in the pinctrl driver. To briefly -explain, setting the 29th bit in the desired padconfig register, allows the -pad to act as a wakeup source by triggering a wake IRQ in Deep Sleep states. +combination of gpio-keys with a chained IRQ in the pinctrl driver. Setting the +29th bit in the desired padconfig register, allows the pad to act as a wakeup +source by triggering a wake IRQ in Deep Sleep states. .. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX') @@ -737,17 +740,18 @@ pad to act as a wakeup source by triggering a wake IRQ in Deep Sleep states. }; }; - Here, we chain the IRQ to the pinctrl driver using the second - interrupts-extended entry. The wake IRQ framework in Linux works in such a - way that the second entry gets marked as a wakeup source, and then the - pinctrl driver is informed that the pad 0x1a0 in this case is to be - configured as a wakeup pad when system enters Deep Sleep. + The IRQ is chained to the pinctrl driver using the second + interrupts-extended entry. The wake IRQ framework in Linux works so that the + second entry gets marked as a wakeup source, and then the pinctrl driver is + informed that the pad, 0x1a0 in this case, is to be configured as a wakeup + pad when system enters Deep Sleep. Main GPIO wakeup can only be tested when `k3-am62x-sk-lpm-wkup-sources.dtso `__ overlay is loaded. Please refer to :ref:`How to enable DT overlays` for more details. - To use main_gpio as a wakeup source, ensure gpio is a wake-irq in /proc/interrupts: + To use main_gpio as a wakeup source, ensure gpio is a wake-irq in + /proc/interrupts: .. code-block:: console @@ -780,13 +784,14 @@ pad to act as a wakeup source by triggering a wake IRQ in Deep Sleep states. }; }; - Here, we chain the IRQ to the pinctrl driver using the second - interrupts-extended entry. The wake IRQ framework in Linux works in such a - way that the second entry gets marked as a wakeup source, and then the - pinctrl driver is informed that the pad 0x1ac in this case is to be - configured as a wakeup pad when system enters Deep Sleep. + The IRQ is chained to the pinctrl driver using the second + interrupts-extended entry. The wake IRQ framework in Linux works so that the + second entry gets marked as a wakeup source, and then the pinctrl driver is + informed that the pad, 0x1ac in this case, is to be configured as a wakeup + pad when system enters Deep Sleep. - To use main_gpio as a wakeup source, ensure gpio is a wake-irq in /proc/interrupts: + To use main_gpio as a wakeup source, ensure gpio is a wake-irq in + /proc/interrupts: .. code-block:: console From 16d5ed80b04ccf6eab95e78ce4864e8beab52af6 Mon Sep 17 00:00:00 2001 From: Kendall Willis Date: Tue, 25 Nov 2025 15:46:49 -0600 Subject: [PATCH 5/5] chore(owners): Update Power Management component owners Add myself as a component owner for Power Management. Signed-off-by: Kendall Willis --- .github/component-owners.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/component-owners.yml b/.github/component-owners.yml index 70b547c5a..7f344f151 100644 --- a/.github/component-owners.yml +++ b/.github/component-owners.yml @@ -88,6 +88,7 @@ components: source/linux/Foundational_Components/Power_Management: - DhruvaG2000 - vishalmti + - kwillis01 source/linux/Foundational_Components/Graphics: - Antonios-C