2023-11-28 15:36:10

by Thomas Richard

[permalink] [raw]
Subject: [PATCH 0/3] pinctrl: pinctrl-single: fix suspend/resume on j7200

On j7200, during suspend to ram the SoC is powered-off. So the pinctrl
contexts are lost.
The flag PCS_CONTEXT_LOSS_OFF shall be set to restore the pinctrl
contexts.

A new compatible (ti,j7200-padconf) was created to enable this flag only
for j7200.

Signed-off-by: Thomas Richard <[email protected]>
---
Thomas Richard (3):
dt-bindings: pinctrl: pinctrl-single: add ti,j7200-padconf compatible
pinctrl: pinctrl-single: add ti,j7200-padconf compatible
arm64: dts: ti: k3-j7200: use ti,j7200-padconf compatible

.../devicetree/bindings/pinctrl/pinctrl-single.yaml | 1 +
arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 8 ++++----
arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi | 12 ++++++------
drivers/pinctrl/pinctrl-single.c | 5 +++++
4 files changed, 16 insertions(+), 10 deletions(-)
---
base-commit: 2a20795e4274c0d94c14fcb8309f72699e404d99
change-id: 20231128-j7200-pinctrl-s2r-95cb9c159a9e

Best regards,
--
Thomas Richard <[email protected]>


2023-11-28 15:36:27

by Thomas Richard

[permalink] [raw]
Subject: [PATCH 3/3] arm64: dts: ti: k3-j7200: use ti,j7200-padconf compatible

For suspend to ram on j7200, use ti,j7200-padconf compatible to save and
restore pinctrl contexts.

Signed-off-by: Thomas Richard <[email protected]>
---
arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 8 ++++----
arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi b/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
index 1ea809e41500..709081cd1e7f 100644
--- a/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j7200-main.dtsi
@@ -395,7 +395,7 @@ cpts@3d000 {

/* TIMERIO pad input CTRLMMR_TIMER*_CTRL registers */
main_timerio_input: pinctrl@104200 {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
reg = <0x0 0x104200 0x0 0x50>;
#pinctrl-cells = <1>;
pinctrl-single,register-width = <32>;
@@ -404,7 +404,7 @@ main_timerio_input: pinctrl@104200 {

/* TIMERIO pad output CTCTRLMMR_TIMERIO*_CTRL registers */
main_timerio_output: pinctrl@104280 {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
reg = <0x0 0x104280 0x0 0x20>;
#pinctrl-cells = <1>;
pinctrl-single,register-width = <32>;
@@ -412,7 +412,7 @@ main_timerio_output: pinctrl@104280 {
};

main_pmx0: pinctrl@11c000 {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
/* Proxy 0 addressing */
reg = <0x00 0x11c000 0x00 0x10c>;
#pinctrl-cells = <1>;
@@ -421,7 +421,7 @@ main_pmx0: pinctrl@11c000 {
};

main_pmx1: pinctrl@11c11c {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
/* Proxy 0 addressing */
reg = <0x00 0x11c11c 0x00 0xc>;
#pinctrl-cells = <1>;
diff --git a/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
index 3fc588b848c6..467970fab3a0 100644
--- a/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
@@ -185,7 +185,7 @@ chipid@43000014 {

/* MCU_TIMERIO pad input CTRLMMR_MCU_TIMER*_CTRL registers */
mcu_timerio_input: pinctrl@40f04200 {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
reg = <0x0 0x40f04200 0x0 0x28>;
#pinctrl-cells = <1>;
pinctrl-single,register-width = <32>;
@@ -195,7 +195,7 @@ mcu_timerio_input: pinctrl@40f04200 {

/* MCU_TIMERIO pad output CTRLMMR_MCU_TIMERIO*_CTRL registers */
mcu_timerio_output: pinctrl@40f04280 {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
reg = <0x0 0x40f04280 0x0 0x28>;
#pinctrl-cells = <1>;
pinctrl-single,register-width = <32>;
@@ -204,7 +204,7 @@ mcu_timerio_output: pinctrl@40f04280 {
};

wkup_pmx0: pinctrl@4301c000 {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
/* Proxy 0 addressing */
reg = <0x00 0x4301c000 0x00 0x34>;
#pinctrl-cells = <1>;
@@ -213,7 +213,7 @@ wkup_pmx0: pinctrl@4301c000 {
};

wkup_pmx1: pinctrl@4301c038 {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
/* Proxy 0 addressing */
reg = <0x00 0x4301c038 0x00 0x8>;
#pinctrl-cells = <1>;
@@ -222,7 +222,7 @@ wkup_pmx1: pinctrl@4301c038 {
};

wkup_pmx2: pinctrl@4301c068 {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
/* Proxy 0 addressing */
reg = <0x00 0x4301c068 0x00 0xec>;
#pinctrl-cells = <1>;
@@ -231,7 +231,7 @@ wkup_pmx2: pinctrl@4301c068 {
};

wkup_pmx3: pinctrl@4301c174 {
- compatible = "pinctrl-single";
+ compatible = "ti,j7200-padconf", "pinctrl-single";
/* Proxy 0 addressing */
reg = <0x00 0x4301c174 0x00 0x20>;
#pinctrl-cells = <1>;

--
2.39.2

2023-11-28 15:36:53

by Thomas Richard

[permalink] [raw]
Subject: [PATCH 2/3] pinctrl: pinctrl-single: add ti,j7200-padconf compatible

On j7200, during suspend to ram pinctrl contexts are lost. To save and
restore contexts during suspend/resume, the flag PCS_CONTEXT_LOSS_OFF
shall be set.

Signed-off-by: Thomas Richard <[email protected]>
---
drivers/pinctrl/pinctrl-single.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 8267be769635..19cc0db771a5 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1955,6 +1955,10 @@ static const struct pcs_soc_data pinctrl_single_am654 = {
.irq_status_mask = (1 << 30), /* WKUP_EVT */
};

+static const struct pcs_soc_data pinctrl_single_j7200 = {
+ .flags = PCS_CONTEXT_LOSS_OFF,
+};
+
static const struct pcs_soc_data pinctrl_single = {
};

@@ -1969,6 +1973,7 @@ static const struct of_device_id pcs_of_match[] = {
{ .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 },
+ { .compatible = "ti,j7200-padconf", .data = &pinctrl_single_j7200 },
{ .compatible = "pinctrl-single", .data = &pinctrl_single },
{ .compatible = "pinconf-single", .data = &pinconf_single },
{ },

--
2.39.2

2023-11-29 10:17:35

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH 2/3] pinctrl: pinctrl-single: add ti,j7200-padconf compatible

* Thomas Richard <[email protected]> [231128 15:35]:
> On j7200, during suspend to ram pinctrl contexts are lost. To save and
> restore contexts during suspend/resume, the flag PCS_CONTEXT_LOSS_OFF
> shall be set.

Reviewed-by: Tony Lindgren <[email protected]>

2023-11-29 10:19:58

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: dts: ti: k3-j7200: use ti,j7200-padconf compatible

* Thomas Richard <[email protected]> [231128 15:35]:
> For suspend to ram on j7200, use ti,j7200-padconf compatible to save and
> restore pinctrl contexts.

Hmm are the mcu registers lost too? Anyways presumably you looked at it:

Reviewed-by: Tony Lindgren <[email protected]>

2023-11-29 10:32:44

by Thomas Richard

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: dts: ti: k3-j7200: use ti,j7200-padconf compatible

On 11/29/23 11:19, Tony Lindgren wrote:
> * Thomas Richard <[email protected]> [231128 15:35]:
>> For suspend to ram on j7200, use ti,j7200-padconf compatible to save and
>> restore pinctrl contexts.
>
> Hmm are the mcu registers lost too? Anyways presumably you looked at it:

Hi Tony,

Thanks for the review.
Yes the mcu registers are lost too, as the SoC is fully powered-off.
And I did the test to confirm.

Regards,

>
> Reviewed-by: Tony Lindgren <[email protected]>
--
Thomas Richard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

2023-11-29 10:38:22

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: dts: ti: k3-j7200: use ti,j7200-padconf compatible

* Thomas Richard <[email protected]> [231129 10:32]:
> Thanks for the review.
> Yes the mcu registers are lost too, as the SoC is fully powered-off.
> And I did the test to confirm.

OK thanks for confirming it.

Tony

2023-12-04 09:53:27

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/3] pinctrl: pinctrl-single: fix suspend/resume on j7200

On Tue, Nov 28, 2023 at 4:35 PM Thomas Richard
<[email protected]> wrote:

> Thomas Richard (3):
> dt-bindings: pinctrl: pinctrl-single: add ti,j7200-padconf compatible
> pinctrl: pinctrl-single: add ti,j7200-padconf compatible

Patch 1 & 2 applied to the pin control tree, thanks!

> arm64: dts: ti: k3-j7200: use ti,j7200-padconf compatible

Please funnel this through the SoC tree.

Yours,
Linus Walleij

2023-12-04 09:54:05

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: dts: ti: k3-j7200: use ti,j7200-padconf compatible

On Tue, Nov 28, 2023 at 4:35 PM Thomas Richard
<[email protected]> wrote:

> For suspend to ram on j7200, use ti,j7200-padconf compatible to save and
> restore pinctrl contexts.
>
> Signed-off-by: Thomas Richard <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2024-02-06 04:44:40

by Vignesh Raghavendra

[permalink] [raw]
Subject: Re: (subset)[PATCH 0/3] pinctrl: pinctrl-single: fix suspend/resume on j7200

Hi Thomas Richard,

On Tue, 28 Nov 2023 16:34:58 +0100, Thomas Richard wrote:
> On j7200, during suspend to ram the SoC is powered-off. So the pinctrl
> contexts are lost.
> The flag PCS_CONTEXT_LOSS_OFF shall be set to restore the pinctrl
> contexts.
>
> A new compatible (ti,j7200-padconf) was created to enable this flag only
> for j7200.
>
> [...]

I have applied the following to branch ti-k3-dts-next on [1].
Thank you!

[3/3] arm64: dts: ti: k3-j7200: use ti,j7200-padconf compatible
commit: 4eb42afed5d488c4707be5362e8e0f0771f5218e

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--
Vignesh