pinctrl: single: Add compatible for ti,am625-padconf
Subsystems (3)
PATCH 1/1 pinctrl: single: Add compatible for ti,am625-padconf
From: Tony Lindgren <[email protected]>
Add compatible for ti,am625-padconf to enable the use of wake-up events.
---
Base:
*****
tag: next-20230731 + below "depends on" patches
Depends on:
***********
[0] Update pinctrl-single to use yaml
[1] dt-binding: pinctrl-single: add am625 compatible
Links:
******
[0] https://lore.kernel.org/linux-omap/[email protected]/T/
[1] https://lore.kernel.org/all/[email protected]/
Link to this patch:
******************
https://lore.kernel.org/all/[email protected]
drivers/pinctrl/pinctrl-single.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/pinctrl/pinctrl-single.c +7 -0
@@ -1954,6 +1954,12 @@ static const struct pcs_soc_data pinctrl_single_am437x = { .irq_status_mask = (1 << 30), /* OMAP_WAKEUP_EVENT */ }; +static const struct pcs_soc_data pinctrl_single_am625 = { + .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 pcs_soc_data pinctrl_single = { };
@@ -1962,6 +1968,7 @@ static const struct pcs_soc_data pinconf_single = { };static const struct of_device_id pcs_of_match[] = { + { .compatible ="ti,am625-padconf" , .data = &pinctrl_single_am625 }, { .compatible ="ti,omap3-padconf" , .data = &pinctrl_single_omap_wkup }, { .compatible ="ti,omap4-padconf" , .data = &pinctrl_single_omap_wkup }, { .compatible ="ti,omap5-padconf" , .data = &pinctrl_single_omap_wkup },
Signature · 1 line
2.34.1
Quoted 37 lines · Dhruva Gole
From: Tony Lindgren <[email protected]>
Add compatible for ti,am625-padconf to enable the use of wake-up events.
Signed-off-by Tony Lindgren <[email protected]>Signed-off-by Dhruva Gole <[email protected]>---
Base:
*****
tag: next-20230731 + below "depends on" patchesDepends on:
***********
[0] Update pinctrl-single to use yaml
[1] dt-binding: pinctrl-single: add am625 compatibleLinks:
******
[0] https://lore.kernel.org/linux-omap/[email protected]/T/
[1] https://lore.kernel.org/all/[email protected]/Cc Nishanth Menon <[email protected]>Cc Vignesh Raghavendra <[email protected]>Link to this patch:
******************
https://lore.kernel.org/all/[email protected]drivers/pinctrl/pinctrl-single.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/pinctrl/pinctrl-single.c +0
-0
drivers/pinctrl/pinctrl-single.c static const struct pcs_soc_data pinctrl_single_am437x = { · line 1962
Quoted 9 lines
drivers/pinctrl/pinctrl-single.c +6
-0@@ -1954,6 +1954,12 @@ static const struct pcs_soc_data pinctrl_single_am437x = { .irq_status_mask = (1 << 30), /* OMAP_WAKEUP_EVENT */ }; +static const struct pcs_soc_data pinctrl_single_am625 = { + .flags =PCS_QUIRK_SHARED_IRQ |PCS_CONTEXT_LOSS_OFF , + .irq_enable_mask = (1 <<29 ),/* WKUP_EN */ + .irq_status_mask = (1 <<30 ),/* WKUP_EVT */ +}; +
Why cant we set this in the k3-pinctrl.h and set it once?
The event will not be generated until wakeup daisy chain is triggered anyways.
Have you looked at all the padconf registers across devices to ensure the WKUP_EN/EVT bits are present? daisy chain feature is used elsewhere as well.
Quoted 14 lines
drivers/pinctrl/pinctrl-single.c +1
-0static const struct pcs_soc_data pinctrl_single = { };@@ -1962,6 +1968,7 @@ static const struct pcs_soc_data pinconf_single = { };static const struct of_device_id pcs_of_match[] = { + { .compatible ="ti,am625-padconf" , .data = &pinctrl_single_am625 }, { .compatible ="ti,omap3-padconf" , .data = &pinctrl_single_omap_wkup }, { .compatible ="ti,omap4-padconf" , .data = &pinctrl_single_omap_wkup }, { .compatible ="ti,omap5-padconf" , .data = &pinctrl_single_omap_wkup },Signature · 1 line
2.34.1
Signature · 3 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
Tony Lindgren
maintainerQuoted 10 lines · Nishanth Menon
drivers/pinctrl/pinctrl-single.c static const struct pcs_soc_data pinctrl_single_am437x = { · line 1962
Quoted 7 lines · Dhruva Gole
From: Tony Lindgren <[email protected]>
drivers/pinctrl/pinctrl-single.c +6
-0+static const struct pcs_soc_data pinctrl_single_am625 = { + .flags =PCS_QUIRK_SHARED_IRQ |PCS_CONTEXT_LOSS_OFF , + .irq_enable_mask = (1 <<29 ),/* WKUP_EN */ + .irq_status_mask = (1 <<30 ),/* WKUP_EVT */ +}; +Why cant we set this in the
k3-pinctrl.hand set it once?
Good idea to define the bit offsets k3-pinctrl.h instead of magic numbers here :)
Quoted 2 lines
The event will not be generated until wakeup daisy chain is triggered anyways.
Yup, and having that happen is enough to show the wake-up reason with grep wakeup /proc/interrupts :)
Quoted 3 lines
Have you looked at all the padconf registers across devices to ensure the WKUP_EN/EVT bits are present? daisy chain feature is used elsewhere as well.
The lack of bits at least earlier just meant that attempting to use a wake-up interrupt would just never trigger. Worth checking though. Dhruva, care to check if some padconf register have reserved bits for 29 and 30 that might be set high by default?
Regards,
Tony
Quoted 11 lines · Tony Lindgren
Quoted 10 lines · Nishanth Menon
drivers/pinctrl/pinctrl-single.c static const struct pcs_soc_data pinctrl_single_am437x = { · line 1962
Quoted 7 lines · Dhruva Gole
From: Tony Lindgren <[email protected]>
drivers/pinctrl/pinctrl-single.c +6
-0+static const struct pcs_soc_data pinctrl_single_am625 = { + .flags =PCS_QUIRK_SHARED_IRQ |PCS_CONTEXT_LOSS_OFF , + .irq_enable_mask = (1 <<29 ),/* WKUP_EN */ + .irq_status_mask = (1 <<30 ),/* WKUP_EVT */ +}; +Why cant we set this in the
k3-pinctrl.hand set it once?
Do you mean that I set 1 << 29 and 30 as sort of macros in the k3-pinctrl.h file and then include it in pinctrl-single.c?
Are we okay to #include a header from arch/arm64/boot/dts/ti?
Quoted 3 lines
Good idea to define the bit offsets
k3-pinctrl.hinstead of magic numbers here :)
If I understand what Nishanth is saying correctly, are we expected to set the wake_en bit on every single K3 SoC's every single padconf reg?
I am a little sceptical with this approach, because what is people _don't_ want to wakeup from certain pads? What would be the right way to disable wakeup on those pads then?
Quoted 3 lines
Quoted 3 lines
The event will not be generated until wakeup daisy chain is triggered anyways.
Any voltage level shift can potentially trigger a daisychain and I don't think that's really such a good idea?
Quoted 7 lines
Yup, and having that happen is enough to show the wake-up reason with grep wakeup
/proc/interrupts:)Quoted 3 lines
Have you looked at all the padconf registers across devices to ensure the WKUP_EN/EVT bits are present? daisy chain feature is used elsewhere as well.
In my limited experience, I have only seen daisychain wakeups being enabled on AM62x SOC. This is because this is one of the first K3 devices to implement deepsleep, and I think IO daisychain only applies for wakeups in the case of deepsleep kind of scenarios.
Quoted 5 lines
The lack of bits at least earlier just meant that attempting to use a wake-up interrupt would just never trigger. Worth checking though. Dhruva, care to check if some padconf register have reserved bits for 29 and 30 that might be set high by default?
Sure, I could take a look, but setting wake_en on all pads still doesn't feel right to me.
Quoted 4 lines
Regards,
Tony
To summarise, I don't think any other devices are using daisychain atleast today, and even if there is possibility of using in future I think the same compatible I have used here can be used to set wake_en wherever applicable, for eg. whenever AM62A would want to use daisychain it can use this quirk in it's DT node.
I believe that we shouldn't set every pad as daisychain enabled otherwise in deepsleep it may result in unintended wakeups. And the way I thought we can give this choice to the user is using wakeirq chained interrupt along with this quirk,
compatible = "ti,am6-padconf";
Signature · 2 lines
Best regards, Dhruva Gole <[email protected]>
Tony Lindgren
maintainerQuoted 13 lines · Dhruva Gole
Quoted 11 lines · Tony Lindgren
Quoted 10 lines · Nishanth Menon
drivers/pinctrl/pinctrl-single.c static const struct pcs_soc_data pinctrl_single_am437x = { · line 1962
Quoted 7 lines · Dhruva Gole
From: Tony Lindgren <[email protected]>
drivers/pinctrl/pinctrl-single.c +6
-0+static const struct pcs_soc_data pinctrl_single_am625 = { + .flags =PCS_QUIRK_SHARED_IRQ |PCS_CONTEXT_LOSS_OFF , + .irq_enable_mask = (1 <<29 ),/* WKUP_EN */ + .irq_status_mask = (1 <<30 ),/* WKUP_EVT */ +}; +Why cant we set this in the
k3-pinctrl.hand set it once?
Quoted 4 lines
Do you mean that I set 1 << 29 and 30 as sort of macros in the
k3-pinctrl.hfile and then include it inpinctrl-single.c?Are we okay to #include a header from
arch/arm64/boot/dts/ti?
Yes, but SoC specific defines needs to start with a SoC specific prefix as multiple files may be included for various SoCs.
Quoted 6 lines
If I understand what Nishanth is saying correctly, are we expected to set the
wake_enbit on every single K3 SoC's every single padconf reg?I am a little sceptical with this approach, because what is people _don't_ want to wakeup from certain pads? What would be the right way to disable wakeup on those pads then?
The wake_en only gets set when some driver does request_irq() on the wakeirq. No need to set them all.
Quoted 2 lines
Sure, I could take a look, but setting
wake_enon all pads still doesn't feel right to me.
No need to set all wake_en pads, just checking that if request_irq() is done for some pin that does not have wake_en capability does not cause eternal interrupts if a reserved bit is high all the time :)
Regards,
Tony