TI am625 deepsleep wakeup from main domain

Fuzzey, Martin martin.fuzzey at flowbird.group
Sat Feb 17 08:15:39 PST 2024


Hi all,

I have deep sleep entry and exit working on TI AM625 using the RTC or
MCU domain GPIO using the upstream 6.6 kernel plus [0]
However I am unable to get it to work using a MAIN domain GPIO
(nothing happens and no measurable change in power consumption on
wakeup attempt).

To do that I also applied 3717194f2492 "Input: gpio-keys - add system
suspend support for dedicated wake irqs"
(which is already in mainline but not -6.6)

Then in DT (based on the TI docs)
&main_pmx0 {
    /* attempt at GPIO domain wakeup - when working move to SoC dtsi */
    compatible = "ti,am654-padconf";
    interrupt-parent = <&gic500>;
    interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
    interrupt-controller;
    #interrupt-cells = <1>;

    pinctrl_flb_carrier_gpio_keys: flb-gpiokeys-grp {
        pinctrl-single,pins = <
            AM62X_IOPAD(0x1a8, PIN_INPUT,  7) /*(D20)
MCASP0_AFSX.GPIO1_12 -  SODIMM 32 */
        >;
    };
};

gpio-keys {
    compatible = "gpio-keys";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_flb_carrier_gpio_keys>;

    key-gpio {
        interrupts-extended = <&main_gpio1 12 IRQ_TYPE_EDGE_BOTH>,
<&main_pmx0 0x1a8>;
        interrupt-names = "irq", "wakeup";
        label = "GPIO Button";
        linux,code = <KEY_WAKEUP>;
        wakeup-source;
    };
};

(The reason for overriding the compatible on the the pinmux mode is
that the pinctrl_single driver already has the appropriate bits for
that compatible
sure it's a hack but should be ok for testing):

static const struct pcs_soc_data pinctrl_single_am654 = {
    .flags = PCS_QUIRK_SHARED_IRQ | PCS_CONTEXT_LOSS_OFF,
    .irq_enable_mask = (1 << 29),   /* WKUP_EN */
    .irq_status_mask = (1 << 30),   /* WKUP_EVT */
};

static const struct of_device_id pcs_of_match[] = {
...
    { .compatible = "ti,am654-padconf", .data = &pinctrl_single_am654 },
...
};

With this I see that bit 29 (WKUP_EN) of the pad config register is
being set but it doesn't wake up..
I do get input events when not suspended (so that should eliminate bad
hardware) and have checked that the button GPIO line still has power
in suspend.

Am I missing any other pieces here?

One thing I don't really understand is how the DM firmware knows what
wakeup sources should be enabled.

Any help much appreciated,

Martin


[0] https://lore.kernel.org/all/20230804115037.754994-1-d-gole@ti.com/



More information about the linux-arm-kernel mailing list