diff --git a/source/linux/Foundational_Components/Power_Management/pm_cpuidle.rst b/source/linux/Foundational_Components/Power_Management/pm_cpuidle.rst index 225c7abb1..13048eb81 100644 --- a/source/linux/Foundational_Components/Power_Management/pm_cpuidle.rst +++ b/source/linux/Foundational_Components/Power_Management/pm_cpuidle.rst @@ -32,7 +32,7 @@ transition to the selected state. .. rubric:: Enable Standby In order to enable Standby the `k3-am62x-sk-lpm-standby.dtso - `__ + `__ overlay should be applied. Refer to :ref:`How to enable DT overlays ` for more details. More information on what the overlay does is in the :ref:`linux-device-tree-label` section. @@ -112,7 +112,7 @@ transition to the selected state. In order to implement Standby in Linux, an idle-states node has to be added and then referenced by the CPU node. The `k3-am62x-sk-lpm-standby.dtso - `__ + `__ can be used as a reference. .. code-block:: dts diff --git a/source/linux/Foundational_Components/Power_Management/pm_low_power_modes.rst b/source/linux/Foundational_Components/Power_Management/pm_low_power_modes.rst index bea1efba1..1730092e8 100644 --- a/source/linux/Foundational_Components/Power_Management/pm_low_power_modes.rst +++ b/source/linux/Foundational_Components/Power_Management/pm_low_power_modes.rst @@ -48,16 +48,13 @@ wakeup event is triggered. Only AM62 LP-SK EVM supports Partial I/O mode. The reference implementation in this SDK implements Partial I/O as a -poweroff state. On poweroff, Linux ti_sci driver checks the potential -Partial I/O wakeup sources for being enabled. If one of the wakeup -sources is found to be enabled, Partial I/O is entered instead of poweroff. +poweroff state. On poweroff, Linux ti_sci driver checks if any potential +Partial I/O wakeup sources are enabled. If one of the wakeup sources is +enabled, Partial I/O is entered instead of poweroff. -The following wakeup sources have been configured for Partial I/O: -mcu_uart0, mcu_mcan0, and mcu_mcan1. Partial I/O mode 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. - -After Linux boots, the MCAN wakeup for Partial I/O is enabled. +Wakeup sources mcu_mcan0 and mcu_mcan1 have been configured for Partial +I/O. For more information on enabling CAN, refer to +:ref:`CAN I/O Daisy Chain`. Enter Partial I/O mode with the following command: @@ -70,10 +67,11 @@ the console output will stop at the following lines: .. code-block:: text - [ 51.698039] systemd-shutdown[1]: Powering off. - [ 51.769478] reboot: Power down + [ 74.310565] systemd-shutdown[1]: Powering off. + [ 74.396204] reboot: Power down + [ 74.399358] ti-sci 44043000.system-controller: Entering Partial-IO because a powered wakeup-enabled device was found. -The system has entered Partial I/O and can only be woken up with an +The system has entered Partial I/O and can only be woken up with activity on the I/O pin programmed for wakeup. For example, if mcu_mcan0 wakeup was enabled, grounding Pin 22 of J8 MCU Header will wakeup the system and it will go through a normal Linux boot process. @@ -113,13 +111,12 @@ I/O Only Plus DDR .. important:: Jumper J12 should be connected on SK to enable system to enter I/O Only plus DDR mode. - The wakeup sources that can be used to wake the system from I/O Only Plus - DDR are mcu_uart0, mcu_mcan0, mcu_mcan1 and wkup_uart0. To use the mcu_mcan0 - and mcu_mcan1 wakeup sources, apply the - `k3-am62x-sk-lpm-io-ddr-wkup-sources.dtso `__ - overlay. Please refer to :ref:`How to enable DT overlays` - for more details. To use the mcu_uart0 and wkup_uart0 wakeup sources, direct - register writes can be used to enable wakeup after Linux boots. + The wakeup sources that can be used to wake the system from I/O Only + Plus DDR are mcu_uart0, mcu_mcan0, mcu_mcan1 and wkup_uart0. To use the + mcu_mcan0 and mcu_mcan1 wakeup sources, refer to + :ref:`CAN I/O Daisy Chain`. + To use the mcu_uart0 and wkup_uart0 wakeup sources, direct register + writes can be used to enable wakeup after Linux boots. .. rubric:: Following commands set the wakeup EN bit, enable receive for pad in PADCONFIG register and can be used to enable wakeup from mcu_uart0 and wkup_uart0 pins respectively. diff --git a/source/linux/Foundational_Components/Power_Management/pm_sw_arch.rst b/source/linux/Foundational_Components/Power_Management/pm_sw_arch.rst index 66f150ee5..8590cc948 100644 --- a/source/linux/Foundational_Components/Power_Management/pm_sw_arch.rst +++ b/source/linux/Foundational_Components/Power_Management/pm_sw_arch.rst @@ -151,8 +151,8 @@ Specifically, checking of constraints is done at two levels: The code enabling the constraints framework can be found in: -#. TISCI PM Domain driver: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/drivers/pmdomain/ti/ti_sci_pm_domains.c?h=11.02.08 -#. TISCI driver: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/drivers/firmware/ti_sci.c?h=11.02.08 +#. TISCI PM Domain driver: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/drivers/pmdomain/ti/ti_sci_pm_domains.c?h=12.00.00.07 +#. TISCI driver: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/drivers/firmware/ti_sci.c?h=12.00.00.07 Examples of adding constraints from the remote core side are being implemented and will be enabled in future release. 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 89eb4ce7d..3261fac54 100644 --- a/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst +++ b/source/linux/Foundational_Components/Power_Management/pm_wakeup_sources.rst @@ -27,7 +27,7 @@ valid for given low power modes: +------------------------------------------------+------------+----------+-------------+ | MCU IPC (for MCU Only mode) | No | Yes | No | +------------------------------------------------+------------+----------+-------------+ - | CAN UART I/O Daisy Chain | Yes | Yes | Yes | + | CAN I/O Daisy Chain | Yes | Yes | Yes | +------------------------------------------------+------------+----------+-------------+ .. ifconfig:: CONFIG_part_variant in ('AM62AX', 'AM62PX') @@ -48,7 +48,7 @@ valid for given low power modes: +------------------------------------------------+-------+------+---------+----------+ | MCU IPC (for MCU Only mode) | No | Yes | No | No | +------------------------------------------------+-------+------+---------+----------+ - | CAN UART I/O Daisy Chain | Yes | Yes | Yes | Yes | + | CAN I/O Daisy Chain | Yes | Yes | Yes | Yes | +------------------------------------------------+-------+------+---------+----------+ .. ifconfig:: CONFIG_part_variant in ('AM62LX') @@ -334,7 +334,7 @@ MCU GPIO source. However, if the application design doesn't rely on the MCU firmware then Linux can be used to configure the MCU GPIOs as a wakeup source. Refer to the ``mcu_gpio_key`` node in - `k3-am62x-sk-lpm-wkup-sources.dtso `__ + `k3-am62x-sk-lpm-wkup-sources.dtso `__ to use as a template to configure the desired MCU GPIO as a wakeup capable GPIO. @@ -400,7 +400,7 @@ MCU GPIO :ref:`S/W Architecture of System Suspend` MCU GPIO wakeup can only be tested when - `k3-am62x-sk-lpm-wkup-sources.dtso `__ + `k3-am62x-sk-lpm-wkup-sources.dtso `__ overlay is loaded. Refer to :ref:`How to enable DT overlays` for more details. Once the system has entered Deep Sleep or MCU Only mode as shown in the @@ -417,7 +417,7 @@ WKUP GPIO 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 `__ + `k3-am62l3-evm-lpm-wkup-sources.dtso `__ to use as a template to configure the desired WKUP GPIO as a wakeup capable GPIO. @@ -478,7 +478,7 @@ WKUP GPIO wakeup interrupt to the system. WKUP GPIO wakeup can only be tested when - `k3-am62l3-evm-lpm-wkup-sources.dtso `__ + `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. @@ -547,28 +547,23 @@ Main UART .. ifconfig:: CONFIG_part_variant in ('AM62X') To configure UART as an I/O daisy chain wakeup, refer to the - main_uart0 node in `k3-am62x-sk-common.dtsi `_ + main_uart0 node in `k3-am62x-sk-common.dtsi `_ .. code-block:: dts &main_pmx0 { - main_uart0_tx_pins_default: main-uart0-tx-default-pins { - bootph-all; - pinctrl-single,pins = < - AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14/E11) UART0_TXD */ - >; - }; - - main_uart0_rx_pins_default: main-uart0-rx-default-pins { + main_uart0_pins_default: main-uart0-default-pins { bootph-all; pinctrl-single,pins = < AM62X_IOPAD(0x1c8, PIN_INPUT, 0) /* (D14/A13) UART0_RXD */ + AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14/E11) UART0_TXD */ >; }; - main_uart0_rx_pins_wakeup: main-uart0-rx-wakeup-pins { + main_uart0_pins_wakeup: main-uart0-wakeup-pins { pinctrl-single,pins = < AM62X_IOPAD(0x1c8, PIN_INPUT | PIN_WKUP_EN, 0) /* (D14/A13) UART0_RXD */ + AM62X_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (E14/E11) UART0_TXD */ >; }; }; @@ -577,38 +572,33 @@ Main UART bootph-all; status = "okay"; pinctrl-names = "default", "wakeup"; - pinctrl-0 = <&main_uart0_tx_pins_default>, <&main_uart0_rx_pins_default>; - pinctrl-1 = <&main_uart0_tx_pins_default>, <&main_uart0_rx_pins_wakeup>; + pinctrl-0 = <&main_uart0_pins_default>; + pinctrl-1 = <&main_uart0_pins_wakeup>; wakeup-source = <&system_deep_sleep>, - <&system_mcu_only>, - <&system_standby>; + <&system_mcu_only>, + <&system_standby>; }; .. ifconfig:: CONFIG_part_variant in ('AM62AX') To configure UART as an I/O daisy chain wakeup, refer to the - main_uart0 node in `k3-am62a7-sk.dts `_ + main_uart0 node in `k3-am62a7-sk.dts `_ .. code-block:: dts &main_pmx0 { - main_uart0_tx_pins_default: main-uart0-tx-default-pins { - pinctrl-single,pins = < - AM62AX_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (D15) UART0_TXD */ - >; - bootph-all; - }; - - main_uart0_rx_pins_default: main-uart0-rx-default-pins { + main_uart0_pins_default: main-uart0-default-pins { pinctrl-single,pins = < AM62AX_IOPAD(0x1c8, PIN_INPUT, 0) /* (E14) UART0_RXD */ + AM62AX_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (D15) UART0_TXD */ >; bootph-all; - }; + }; - main_uart0_rx_pins_wakeup: main-uart0-rx-wakeup-pins { + main_uart0_pins_wakeup: main-uart0-wakeup-pins { pinctrl-single,pins = < AM62AX_IOPAD(0x1c8, PIN_INPUT | PIN_WKUP_EN, 0) /* (E14) UART0_RXD */ + AM62AX_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (D15) UART0_TXD */ >; }; }; @@ -616,50 +606,44 @@ Main UART &main_uart0 { status = "okay"; pinctrl-names = "default", "wakeup"; - pinctrl-0 = <&main_uart0_tx_pins_default>, <&main_uart0_rx_pins_default>; - pinctrl-1 = <&main_uart0_tx_pins_default>, <&main_uart0_rx_pins_wakeup>; + pinctrl-0 = <&main_uart0_pins_default>; + pinctrl-1 = <&main_uart0_pins_wakeup>; wakeup-source = <&system_deep_sleep>, - <&system_mcu_only>, - <&system_standby>; + <&system_mcu_only>, + <&system_standby>; bootph-all; }; .. ifconfig:: CONFIG_part_variant in ('AM62PX') To configure UART as an I/O daisy chain wakeup, refer to the - main_uart0 node in `k3-am62p5-sk.dts `_ + main_uart0 node in `k3-am62p5-sk.dts `_ .. code-block:: dts &main_pmx0 { - main_uart0_tx_pins_default: main-uart0-tx-default-pins { + main_uart0_pins_default: main-uart0-default-pins { pinctrl-single,pins = < - AM62PX_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (B22) UART0_TXD */ + AM62PX_IOPAD(0x1c8, PIN_INPUT, 0) /* (A22) UART0_RXD */ + AM62PX_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (B22) UART0_TXD */ >; bootph-all; }; - main_uart0_rx_pins_default: main-uart0-rx-default-pins { + main_uart0_pins_wakeup: main-uart0-wakeup-pins { pinctrl-single,pins = < - AM62PX_IOPAD(0x1c8, PIN_INPUT, 0) /* (A22) UART0_RXD */ + AM62PX_IOPAD(0x1c8, PIN_INPUT | PIN_WKUP_EN, 0) /* (A22) UART0_RXD */ + AM62PX_IOPAD(0x1cc, PIN_OUTPUT, 0) /* (B22) UART0_TXD */ >; - bootph-all; }; - main_uart0_rx_pins_wakeup: main-uart0-rx-wakeup-pins { - pinctrl-single,pins = < - AM62PX_IOPAD(0x1c8, PIN_INPUT | PIN_WKUP_EN, 0) /* (A22) UART0_RXD */ - >; - }; - }; - &main_uart0 { pinctrl-names = "default", "wakeup"; - pinctrl-0 = <&main_uart0_tx_pins_default>, <&main_uart0_rx_pins_default>; - pinctrl-1 = <&main_uart0_tx_pins_default>, <&main_uart0_rx_pins_wakeup>; + pinctrl-0 = <&main_uart0_pins_default>; + pinctrl-1 = <&main_uart0_pins_wakeup>; wakeup-source = <&system_deep_sleep>, - <&system_mcu_only>, - <&system_standby>; + <&system_mcu_only>, + <&system_standby>; status = "okay"; bootph-all; }; @@ -667,37 +651,32 @@ Main UART .. ifconfig:: CONFIG_part_variant in ('AM62LX') To configure UART as an I/O daisy chain wakeup, refer to the - main_uart0 node in `k3-am62l3-evm.dts `_ + main_uart0 node in `k3-am62l3-evm.dts `_ .. code-block:: dts - &main_pmx0 { - main_uart0_tx_pins_default: main-uart0-tx-default-pins { - pinctrl-single,pins = < - AM62LX_IOPAD(0x01b8, PIN_OUTPUT, 0) /* (C13) UART0_TXD */ - >; - bootph-all; - }; - - main_uart0_rx_pins_default: main-uart0-rx-default-pins { + &pmx0 { + uart0_pins_default: uart0-default-pins { pinctrl-single,pins = < AM62LX_IOPAD(0x01b4, PIN_INPUT, 0) /* (D13) UART0_RXD */ + AM62LX_IOPAD(0x01b8, PIN_OUTPUT, 0) /* (C13) UART0_TXD */ >; bootph-all; }; - main_uart0_rx_pins_wakeup: main-uart0-rx-wakeup-pins { + uart0_pins_wakeup: uart0-wakeup-pins { pinctrl-single,pins = < AM62LX_IOPAD(0x01b4, PIN_INPUT | PIN_WKUP_EN, 0) /* (D13) UART0_RXD */ + AM62LX_IOPAD(0x01b8, PIN_OUTPUT, 0) /* (C13) UART0_TXD */ >; }; }; - &main_uart0 { + &uart0 { + pinctrl-0 = <&uart0_pins_default>; + pinctrl-1 = <&uart0_pins_wakeup>; pinctrl-names = "default", "wakeup"; - pinctrl-0 = <&main_uart0_tx_pins_default>, <&main_uart0_rx_pins_default>; - pinctrl-1 = <&main_uart0_tx_pins_default>, <&main_uart0_rx_pins_wakeup>; - wakeup-source = <&system_deep_sleep>; + wakeup-source; status = "okay"; bootph-all; }; @@ -726,7 +705,7 @@ source by triggering a wake IRQ 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 `__ + `k3-am62x-sk-lpm-wkup-sources.dtso `__ .. code-block:: dts @@ -751,7 +730,7 @@ source by triggering a wake IRQ in Deep Sleep states. pad when system enters Deep Sleep. Main GPIO wakeup can only be tested when - `k3-am62x-sk-lpm-wkup-sources.dtso `__ + `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 @@ -770,7 +749,7 @@ source by triggering a wake IRQ in Deep Sleep states. The reference configuration for Main GPIO wakeup can be found under gpio_key node in - `k3-am62l3-evm.dts `__ + `k3-am62l3-evm.dts `__ .. code-block:: dts @@ -815,7 +794,7 @@ The UART in WKUP domain is capable of waking up the system. 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 `__ +`k3-am62-wakeup.dtsi `__ .. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX') @@ -982,45 +961,30 @@ MCU IPC based Wakeup [IPC RPMSG ECHO] Main domain resumed due to MCU UART -************************ -CAN UART I/O Daisy Chain -************************ +.. _pm_wakeup_sources_can: + +******************* +CAN I/O Daisy Chain +******************* .. ifconfig:: CONFIG_part_variant in ('AM62LX') - CAN UART wakeup is not supported on AM62LX. + CAN wakeup is not supported on AM62LX. .. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62AX', 'AM62PX') - It is possible to wakeup the system from CAN UART pins in all supported low - power modes. This is possible once CAN UART is configured. + CAN pins can be used to wake the system from any supported low power mode. + To enable this, in the device tree configure a "wakeup" pinctrl state that sets + the WKUP_EN flag (29th bit) on the desired padconfig register. This allows the + mcan driver to switch to the wakeup state during suspend. - To set CAN UART as a wakeup source, a pinctrl state called "wakeup" needs to be - added to the device tree. The "wakeup" pinctrl state will set the WKUP_EN flag - on the desired padconfig register. When the WKUP_EN flag (29th bit) is set, it - allows the pad to act as a wakeup source. If CAN UART has the "wakeup" pinctrl - state defined, then the Linux mcan driver is able to switch to the pinctrl - "wakeup" state during suspend which enables CAN UART wakeup. + Refer to the mcu_mcan0 and mcu_mcan1 nodes in + `k3-am62x-sk-lpm-wkup-sources.dtso `__ + for a complete example: - The mcan_uart0 and mcan_uart1 nodes in - `k3-am62x-sk-lpm-io-ddr-wkup-sources.dtso `__ - can be used as a reference for enabling CAN UART wakeup. - - .. code-block:: text + .. code-block:: dts &mcu_pmx0 { - mcu_mcan0_tx_pins_default: mcu-mcan0-tx-pins-default { - pinctrl-single,pins = < - AM62X_IOPAD(0x034, PIN_OUTPUT, 0) /* (D6) MCU_MCAN0_TX */ - >; - }; - - mcu_mcan0_rx_pins_default: mcu-mcan0-rx-pins-default { - pinctrl-single,pins = < - AM62X_IOPAD(0x038, PIN_INPUT, 0) /* (B3) MCU_MCAN0_RX */ - >; - }; - mcu_mcan0_rx_pins_wakeup: mcu-mcan0-rx-pins-wakeup { pinctrl-single,pins = < AM62X_IOPAD(0x038, PIN_INPUT | WKUP_EN, 0) /* (B3) MCU_MCAN0_RX */ @@ -1035,16 +999,34 @@ CAN UART I/O Daisy Chain status = "okay"; }; - CAN UART wakeup can be tested by using either the - `k3-am62x-sk-lpm-wkup-sources.dtso `__ - or - `k3-am62x-sk-lpm-io-ddr-wkup-sources.dtso `__ - overlays. Please refer to :ref:`How to enable DT overlays` - for more details. - Once the system has entered any low power mode as shown in the - :ref:`LPM section`, wakeup from MCU_GPIO0_16 or MCU_MCAN0_RX can be - triggered by grounding Pin 11 or Pin 22 on J8 MCU Header, respectively. + .. ifconfig:: CONFIG_part_variant in ('AM62X') + + CAN wakeup is enabled by default for the AM62X LP-SK EVM. Otherwise, + the device tree overlay + `k3-am62x-sk-lpm-wkup-sources.dtso `__ + is needed for testing CAN wakeup. Refer to + :ref:`How to enable DT overlays` for details. + + .. ifconfig:: CONFIG_part_variant in ('AM62AX','AM62PX') + + Either device tree overlay + `k3-am62x-sk-lpm-wkup-sources.dtso `__ + or + `k3-am62x-sk-lpm-io-ddr-wkup-sources.dtso `__ + are needed for testing. Refer to + :ref:`How to enable DT overlays` for details. + + Before entering low power mode, enable CAN wakeup using ethtool: + + .. code-block:: console + + root@:~# ethtool -s mcu_mcan0 wol p + root@:~# ethtool -s mcu_mcan1 wol p + + Once the system enters a low power mode, wakeup from mcu_mcan0 or + mcu_mcan1 can be triggered by grounding Pin 22 or Pin 11 on J8 MCU + Header, respectively. *********** RTC Ext Pin