-
Notifications
You must be signed in to change notification settings - Fork 73
AM62L LPM: Add new wakeup sources #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d0935ea
8524afd
be5dca5
6141849
16d5ed8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -53,17 +53,21 @@ | |||||
|
|
||||||
| .. ifconfig:: CONFIG_part_variant in ('AM62LX') | ||||||
|
|
||||||
| +----------------------------------+------------+----------------+ | ||||||
| | Wakeup Source | Deep Sleep | RTC Only + DDR | | ||||||
| +==================================+============+================+ | ||||||
| | Real-Time Clock (RTC) | Yes | Yes | | ||||||
| +----------------------------------+------------+----------------+ | ||||||
| | 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 | | ||||||
|
Check warning on line 61 in source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst
|
||||||
| +------------------------------------------------+------------+----------------+ | ||||||
| | 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 | | ||||||
|
Check warning on line 69 in source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst
|
||||||
| +------------------------------------------------+------------+----------------+ | ||||||
|
|
||||||
| ********************* | ||||||
| Real-Time Clock (RTC) | ||||||
|
|
@@ -399,48 +403,138 @@ | |||||
| :ref:`LPM section<lpm_modes>`, wakeup from MCU_SPI0_D1 can be triggered | ||||||
| by grounding Pin 4 on J8 MCU Header. | ||||||
|
|
||||||
| ********* | ||||||
| WKUP GPIO | ||||||
|
Check warning on line 407 in source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst
|
||||||
| ********* | ||||||
|
|
||||||
| .. 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 <https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62l3-evm-lpm-wkup-sources.dtso?h=11.02.06>`__ | ||||||
| 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 <https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt>`__ | ||||||
| for details. | ||||||
|
|
||||||
| .. code-block:: dts | ||||||
| compatible = "gpio-keys"; | ||||||
| Set the desired pinctrl, | ||||||
|
Check warning on line 430 in source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst
|
||||||
|
|
||||||
| .. 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 <https://www.kernel.org/doc/Documentation/devicetree/bindings/power/wakeup-source.txt>`__ | ||||||
| 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@<machine>:~# 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 <https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62l3-evm-lpm-wkup-sources.dtso?h=11.02.06>`__ | ||||||
| overlay is loaded. Refer to :ref:`How to enable DT overlays<howto_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<lpm_modes>`, 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 | ||||||
|
Check warning on line 488 in source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst
|
||||||
| section on how to configure wakeup from 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. | ||||||
| When the SoC enters a low power mode, the main domain is powered-off. The main | ||||||
|
Check warning on line 496 in source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst
|
||||||
| domain includes controllers like Main UART, GPIO, I2C, etc. I/O daisy chaining | ||||||
|
Check warning on line 497 in source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst
|
||||||
| 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, 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 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. | ||||||
| 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') | ||||||
|
|
||||||
| .. 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 | ||||||
|
|
@@ -619,48 +713,45 @@ | |||||
| 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 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') | ||||||
|
|
||||||
| 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 <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>`__ | ||||||
|
|
||||||
| .. code-block:: console | ||||||
| gpio_key { | ||||||
| compatible = "gpio-keys"; | ||||||
| autorepeat; | ||||||
| pinctrl-names = "default"; | ||||||
| pinctrl-0 = <&main_gpio1_pins_default>; | ||||||
| switch { | ||||||
| label = "WKGPIO"; | ||||||
| linux,code = <KEY_WAKEUP>; | ||||||
| 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 <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>`__ | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| .. code-block:: console | ||||||
| gpio_key { | ||||||
| compatible = "gpio-keys"; | ||||||
| autorepeat; | ||||||
| pinctrl-names = "default"; | ||||||
| pinctrl-0 = <&main_gpio1_pins_default>; | ||||||
| switch { | ||||||
| label = "WKGPIO"; | ||||||
| linux,code = <KEY_WAKEUP>; | ||||||
| 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 | ||||||
| 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 <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>`__ | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| overlay is loaded. Please refer to :ref:`How to enable DT overlays<howto_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 | ||||||
|
|
@@ -671,32 +762,72 @@ | |||||
| :ref:`LPM section<lpm_modes>`, 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 <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>`__ | ||||||
|
|
||||||
| .. code-block:: console | ||||||
| gpio_key { | ||||||
| compatible = "gpio-keys"; | ||||||
| autorepeat; | ||||||
| pinctrl-names = "default"; | ||||||
| pinctrl-0 = <&usr_button_pins_default>; | ||||||
| switch { | ||||||
| label = "User Key"; | ||||||
| linux,code = <BTN_0>; | ||||||
| interrupts-extended = <&main_gpio0 90 IRQ_TYPE_EDGE_RISING>, | ||||||
| <&main_pmx0 0x1ac>; | ||||||
| interrupt-names = "irq", "wakeup"; | ||||||
| }; | ||||||
| }; | ||||||
| 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: | ||||||
|
|
||||||
| .. code-block:: console | ||||||
| root@<machine>:~# 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<lpm_modes>`, wakeup from MAIN GPIO0_90 can be triggered | ||||||
| by pressing button SW5. | ||||||
|
|
||||||
| ********* | ||||||
| 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 <https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi?h=11.01.05#n46>`__ | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| .. 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 <https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi?h=11.01.05#n46>`__ | ||||||
| .. 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<lpm_modes>`, 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<lpm_modes>`, 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. | ||||||
|
|
||||||
|
|
||||||
| ****************** | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/TexasInstruments/processor-sdk-doc/blob/master/CONTRIBUTING.md#indentation-and-whitespace