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.

AM335x 1.0 Linux SDK, resume from suspend on UART5 RX = GPIO0_0



Hi,

I need to resume my system from suspend after "echo mem > /sys/power/state".

Currently I can only get it by UART0 that I am using for serial console. I want to use a GPIO0 that I'm using for UART5 as wakeup source:

According to AM335X TRM, UART5 is not a DS0 wakeup source, but UART5_RXD is at pin GPIO0_0, and GPIO0 is a valid DS0 wake-up source. Since UART5_RXD could be configured as UART in active mode and GPIO in suspend mode, I am trying to modify my device tree to add a gpio-keys at GPIO0_0 with wakeup-source property but it does not resume when something arrives at UART5_RXD (now gpio0_0).

I have no experience with device tree, could anybody help me to configure AM335x to wake up when it receives a command by UART5 while it uses the same pin as UART5 while normal execution?

Best regards

  • Hi,

    Sorry for the delayed response.

    I'll use device ball M17, which padconf address is: 0x44E10948 => dts will use offset 0x148.

    So you can try the following configuration for the pinmux settings:

    uart5_pins_default: uart5_pins_default {
    pinctrl-single,pins = <
    0x148 (PIN_INPUT_PULLUP | MUX_MODE2) /*mdio.uart5_rxd -> use device ball as UART5 RXD in normal operation*/
    0x14C (PIN_PULLUP | MUX_MODE2) /*mdc.uart5_txt -> use device ball as UART5 TXD in normal operation*/
    >;
    }

    uart5_pins_sleep: uart5_pins_sleep {
    pinctrl-single,pins = <
    0x148 (PIN_INPUT_PULLUP | MUX_MODE7) /*mdio.gpio0_0-> use device ball as GPIO0_0 in sleep mode*/
    0x14C (PIN_PULLDOWN | MUX_MODE7) /*mdc.gpio0_1-> use device ball as GPIO0_1 in sleep mode*/
    >;
    }

    Then add:

    &uart5 {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&uart5_pins_default>;
    pinctrl-1 = <&uart5_pins_sleep>;
    status = "okay";
    }

    This way your device should work with uart5 pins when in normal mode & when it enters sleep mode it should configure ball M17 as gpio0_0 & use it as input to receive wkups.

    Hope this helps.

    Best Regards,
    Yordan

  • I've edited my post.

    It should be &uart5, NOT &uart0

    Regards,
    Yordan
  • Hi Yordan,

    Thanks for your reply.

    That's actually the configuration I tried (just PIN_PULLUP and PIN_PULLDOWN replaced by PIN_OUTPUT_PULLUP and PIN_OUTPUT_PULLDOWN for pin 0x14C).

    It still does not wake up when something is received on uart5 rx GPIO pin.

    At the moment I interconnect uart0_rx with uart5_rx to be able to wake up. When I receive something on uart0 the am335x wakes up with the log: "PM: Wakeup source UART".

    This solution is not currently good for my design as I am also using uart0 for serial console.

    I wonder if any other configuration is needed to set gpio0 as wakeup source or if any other issue could be messing things up.


    Thanks in advance.
    Best regards.
  • Hi,

    Try adding:

    &uart5 {

          pinctrl-names = "default", "sleep";

          pinctrl-0 = <&uart5_pins_default>;

          pinctrl-1 = <&uart5_pins_sleep>;

          status = "okay";

          wakeup-source;                                                     /*or the legacy gpio-key,wakeup property */

    }; 

    Best Regards, 
    Yordan

  • Hi Yordan

    Unfortunately is doesn't work, wakeup-source is found in the gpio-keys binding documentacion, but there is no gpio-keys defined in my system. maybe a gpio-keys node should be defined in my system?, how should it be defined to wake-up the system while it is suspended and let the uart5 work while it is active?

    Thank you and best regards.