This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM437X: Disable wake-up from UART0

Part Number: PROCESSOR-SDK-AM437X
Other Parts Discussed in Thread: AM4376

Tool/software:

Hi

We are developing the custom board with AM4376 based on AM437x-EVM.

SDK : PROCESSOR-SDK-AM437X-06.03.00.106

We can use suspend and resume functon.
UART0 and GPIO0 are enabled as wake sources from DeepSleep0.

We want to disable UART0 as wake source.
(Only GPIO0 will be enabled as wake source.)

How can I disable UART0 as wake source?

Thank you.

  • Hello,

    I am currently returning to office and will get back to you as soon as possible. Please ping this thread by Thursday if you haven't received a response.

    Thanks,

    Anshu

  • Hello,

    I'm not very familiar with this SDK version since this is an older Linux Kernel. Can you try the following:

    @@ -587,15 +587,6 @@ AM4372_IOPAD(0x974, PIN_INPUT | PULL_DISABLE | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_
                    >;
            };
     
    -       uart0_pins_sleep: uart0-sleep-pins {
    -               pinctrl-single,pins = <
    -                       AM4372_IOPAD(0x968, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE7) /* uart0_ctsn.uart0_ctsn */
    -                       AM4372_IOPAD(0x96C, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE7) /* uart0_rtsn.uart0_rtsn */
    -                       AM4372_IOPAD(0x970, PIN_INPUT_PULLUP | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart0_rxd.uart0_rxd */
    -                       AM4372_IOPAD(0x974, PIN_INPUT_PULLDOWN | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart0_txd.uart0_txd */
    -               >;
    -       };
    -
            matrix_keypad_default: matrix-keypad-default-pins {
                    pinctrl-single,pins = <
                            AM4372_IOPAD(0x9a4, PIN_OUTPUT | MUX_MODE7)
    @@ -617,9 +608,8 @@ AM4372_IOPAD(0x954, PIN_INPUT_PULLDOWN | MUX_MODE0)
     
     &uart0 {
            status = "okay";
    -       pinctrl-names = "default", "sleep";
    +       pinctrl-names = "default";
            pinctrl-0 = <&uart0_pins_default>;
    -       pinctrl-1 = <&uart0_pins_sleep>;
     };
    

     This is modifying the AM437x EVM device tree: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm/boot/dts/am437x-gp-evm.dts?h=ti-linux-4.19.y

    Best Regards,
    Anshu

  • Hi,

    Thank you for providing your solution.

    We could not solve our problem even if we applied your solution.
    UART0 is still used as wake sources.

    When we type any key on UART0 console, suspend mode is exited.
    -------------------------------------------------------

    root@am437x-evm:~# echo mem > /sys/power/state
    [ 54.160445] PM: suspend entry (deep)
    [ 54.164054] PM: Syncing filesystems ... done.
    [ 54.200131] Freezing user space processes ... (elapsed 0.001 seconds) done.
    [ 54.209135] OOM killer disabled.
    [ 54.212507] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    [ 54.221339] Suspending console(s) (use no_console_suspend to debug)
    [ 54.767146] cpsw 4a100000.ethernet eth0: Link is Down
    [ 54.779241] pm33xx pm33xx: PM: Successfully put all powerdomains to target state
    [ 54.779241] PM: Wakeup source UART
    [ 54.805183] net eth0: initializing cpsw version 1.15 (0)
    [ 54.904364] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
    [ 54.941039] usb usb1: root hub lost power or was reset
    [ 54.941060] usb usb2: root hub lost power or was reset
    [ 54.945021] usb usb3: root hub lost power or was reset
    [ 54.945044] usb usb4: root hub lost power or was reset
    [ 55.120344] OOM killer enabled.
    [ 55.123507] Restarting tasks ... done.
    [ 55.182911] PM: suspend exit

    -------------------------------------------------------

    Could you please provide another solution?

    Thank you.

  • Hello,

    In the AM437x TRM (https://www.ti.com/lit/ug/spruhl7i/spruhl7i.pdf), for the UART0 module there is a SYSC register which enables/disable wakeup. See section 21.5.1.42 UART_SYSC Register for the register's bit fields.

    You can read the register to see what that bit is. For a quick fix, you can write 0 to the register's ENAWAKEUP to disable wakeup.

    You can also look into this existing patch to enable/disable UART wakeup: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/drivers/tty/serial/8250/8250_omap.c?h=ti-linux-4.19.y&id=09d8b2bdbc5c61dd6289d78ab4cb57d22dd5e0e6

    Best Regards,

    Anshu

  • Hi,

    Thank you for providing the solution.

    I have a question about the patch to enable/disable UART wakeup.
    It seems that we can control UART wakeup capability via sysf.
    I don't know why UART0 wakeup is enabled even if "/sys/class/tty/ttyS0/device/power/wakeup" value is already "disabled" in our board.

    Could you please let us know this reason?

    Thank you.

  • Hello,

    I'm not sure the reason. I will file a bug on this issue, but this was likely fixed in newer Linux SDK versions.

    Thanks,

    Anshu

  • Hi,

    Thank you for your reply.

    We understood that we cannot control UART wakeup capability via sysf.
    So, we changed as below to disable UART wakeup capability.
    Please check it and give us feedback.

    --- a/drivers/tty/serial/8250/8250_omap.c
    +++ b/drivers/tty/serial/8250/8250_omap.c
    @@ -1336,6 +1336,7 @@ static int omap8250_probe(struct platform_device *pdev)
     	spin_lock_init(&priv->rx_dma_lock);
     
     	device_init_wakeup(&pdev->dev, true);
    +	device_set_wakeup_capable(&pdev->dev, false);
     	pm_runtime_use_autosuspend(&pdev->dev);
     	pm_runtime_set_autosuspend_delay(&pdev->dev, -1);

    Thank you.

  • Hello,

    We cannot provide assistance with changing or customizing drivers on the E2E Forums.

    Best Regards,

    Anshu