linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* TI am625 deepsleep wakeup from main domain
@ 2024-02-17 16:15 Fuzzey, Martin
  2024-02-19 15:14 ` Dhruva Gole
  0 siblings, 1 reply; 4+ messages in thread
From: Fuzzey, Martin @ 2024-02-17 16:15 UTC (permalink / raw)
  To: Nishanth Menon, linux-arm-kernel, Vignesh Raghavendra,
	Dhruva Gole, Tony Lindgren

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/

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-26 11:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-17 16:15 TI am625 deepsleep wakeup from main domain Fuzzey, Martin
2024-02-19 15:14 ` Dhruva Gole
2024-02-20 11:09   ` Fuzzey, Martin
2024-02-26 11:35     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).