* [PATCH 0/2] fix eMMC/SPI flash corruption when audio has been used on RK3399 Puma
@ 2024-07-31 11:05 Quentin Schulz
2024-07-31 11:05 ` [PATCH 1/2] arm64: dts: rockchip: fix eMMC/SPI " Quentin Schulz
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Quentin Schulz @ 2024-07-31 11:05 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Judy Hsiao, Brian Norris
Cc: stable, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, Quentin Schulz, foss+kernel
In commit 91419ae0420f ("arm64: dts: rockchip: use BCLK to GPIO switch
on rk3399"), an additional pinctrl state was added whose default pinmux
is for 8ch i2s0. However, Puma only has 2ch i2s0. It's been overriding
the pinctrl-0 property but the second property override was missed in
the aforementioned commit.
On Puma, a hardware slider called "BIOS Disable/Normal Boot" can disable
eMMC and SPI to force booting from SD card. Another software-controlled
GPIO is then configured to override this behavior to make eMMC and SPI
available without human intervention. This is currently done in U-Boot
and it was enough until the aforementioned commit.
Indeed, because of this additional not-yet-overridden property, this
software-controlled GPIO is now muxed in a state that does not override
this hardware slider anymore, rendering SPI and eMMC flashes unusable.
Let's override the property with the 2ch pinmux to fix this.
While at it, add a GPIO hog for this software-controlled GPIO to make it
explicit and also make it reserve the pin through the pinctrl subsystem
to make sure nobody can mistakenly request it for something else: better
have a non-working feature than eMMC/SPI being corrupted "randomly"!
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
Quentin Schulz (2):
arm64: dts: rockchip: fix eMMC/SPI corruption when audio has been used on RK3399 Puma
arm64: dts: rockchip: override BIOS_DISABLE signal via GPIO hog on RK3399 Puma
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 36 ++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
---
base-commit: e4fc196f5ba36eb7b9758cf2c73df49a44199895
change-id: 20240731-puma-emmc-6-c141e891220b
Best regards,
--
Quentin Schulz <quentin.schulz@cherry.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] arm64: dts: rockchip: fix eMMC/SPI corruption when audio has been used on RK3399 Puma
2024-07-31 11:05 [PATCH 0/2] fix eMMC/SPI flash corruption when audio has been used on RK3399 Puma Quentin Schulz
@ 2024-07-31 11:05 ` Quentin Schulz
2024-07-31 11:05 ` [PATCH 2/2] arm64: dts: rockchip: override BIOS_DISABLE signal via GPIO hog " Quentin Schulz
2024-07-31 11:35 ` [PATCH 0/2] fix eMMC/SPI flash corruption when audio has been used " Heiko Stuebner
2 siblings, 0 replies; 4+ messages in thread
From: Quentin Schulz @ 2024-07-31 11:05 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Judy Hsiao, Brian Norris
Cc: stable, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, Quentin Schulz, foss+kernel
From: Quentin Schulz <quentin.schulz@cherry.de>
In commit 91419ae0420f ("arm64: dts: rockchip: use BCLK to GPIO switch
on rk3399"), an additional pinctrl state was added whose default pinmux
is for 8ch i2s0. However, Puma only has 2ch i2s0. It's been overriding
the pinctrl-0 property but the second property override was missed in
the aforementioned commit.
On Puma, a hardware slider called "BIOS Disable/Normal Boot" can disable
eMMC and SPI to force booting from SD card. Another software-controlled
GPIO is then configured to override this behavior to make eMMC and SPI
available without human intervention. This is currently done in U-Boot
and it was enough until the aforementioned commit.
Indeed, because of this additional not-yet-overridden property, this
software-controlled GPIO is now muxed in a state that does not override
this hardware slider anymore, rendering SPI and eMMC flashes unusable.
Let's override the property with the 2ch pinmux to fix this.
Fixes: 91419ae0420f ("arm64: dts: rockchip: use BCLK to GPIO switch on rk3399")
Cc: stable@vger.kernel.org
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index ccbe3a7a1d2c2..a782e614d9bba 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -409,6 +409,7 @@ vdd_cpu_b: regulator@60 {
&i2s0 {
pinctrl-0 = <&i2s0_2ch_bus>;
+ pinctrl-1 = <&i2s0_2ch_bus_bclk_off>;
rockchip,playback-channels = <2>;
rockchip,capture-channels = <2>;
status = "okay";
@@ -417,8 +418,8 @@ &i2s0 {
/*
* As Q7 does not specify neither a global nor a RX clock for I2S these
* signals are not used. Furthermore I2S0_LRCK_RX is used as GPIO.
- * Therefore we have to redefine the i2s0_2ch_bus definition to prevent
- * conflicts.
+ * Therefore we have to redefine the i2s0_2ch_bus and i2s0_2ch_bus_bclk_off
+ * definitions to prevent conflicts.
*/
&i2s0_2ch_bus {
rockchip,pins =
@@ -428,6 +429,14 @@ &i2s0_2ch_bus {
<3 RK_PD7 1 &pcfg_pull_none>;
};
+&i2s0_2ch_bus_bclk_off {
+ rockchip,pins =
+ <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>,
+ <3 RK_PD2 1 &pcfg_pull_none>,
+ <3 RK_PD3 1 &pcfg_pull_none>,
+ <3 RK_PD7 1 &pcfg_pull_none>;
+};
+
&io_domains {
status = "okay";
bt656-supply = <&vcc_1v8>;
--
2.45.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] arm64: dts: rockchip: override BIOS_DISABLE signal via GPIO hog on RK3399 Puma
2024-07-31 11:05 [PATCH 0/2] fix eMMC/SPI flash corruption when audio has been used on RK3399 Puma Quentin Schulz
2024-07-31 11:05 ` [PATCH 1/2] arm64: dts: rockchip: fix eMMC/SPI " Quentin Schulz
@ 2024-07-31 11:05 ` Quentin Schulz
2024-07-31 11:35 ` [PATCH 0/2] fix eMMC/SPI flash corruption when audio has been used " Heiko Stuebner
2 siblings, 0 replies; 4+ messages in thread
From: Quentin Schulz @ 2024-07-31 11:05 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Judy Hsiao, Brian Norris
Cc: stable, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, Quentin Schulz, foss+kernel
From: Quentin Schulz <quentin.schulz@cherry.de>
The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module eMMC
and SPI flash powered-down initially (in fact it keeps the reset signal
asserted). BIOS_DISABLE_OVERRIDE pin allows to override that signal so
that eMMC and SPI can be used regardless of the state of the signal.
Let's make this GPIO a hog so that it's reserved and locked in the
proper state.
At the same time, make sure the pin is reserved for the hog and cannot
be requested by another node.
Cc: stable@vger.kernel.org
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index a782e614d9bba..d24444cdf54af 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -154,6 +154,22 @@ bios-disable-hog {
};
};
+&gpio3 {
+ /*
+ * The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module
+ * eMMC and SPI flash powered-down initially (in fact it keeps the
+ * reset signal asserted). BIOS_DISABLE_OVERRIDE pin allows to override
+ * that signal so that eMMC and SPI can be used regardless of the state
+ * of the signal.
+ */
+ bios-disable-override-hog {
+ gpios = <RK_PD5 GPIO_ACTIVE_LOW>;
+ gpio-hog;
+ line-name = "bios_disable_override";
+ output-high;
+ };
+};
+
&gmac {
assigned-clocks = <&cru SCLK_RMII_SRC>;
assigned-clock-parents = <&clkin_gmac>;
@@ -458,9 +474,14 @@ &pcie_clkreqn_cpm {
&pinctrl {
pinctrl-names = "default";
- pinctrl-0 = <&q7_thermal_pin>;
+ pinctrl-0 = <&q7_thermal_pin &bios_disable_override_hog_pin>;
gpios {
+ bios_disable_override_hog_pin: bios-disable-override-hog-pin {
+ rockchip,pins =
+ <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;
+ };
+
q7_thermal_pin: q7-thermal-pin {
rockchip,pins =
<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
--
2.45.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] fix eMMC/SPI flash corruption when audio has been used on RK3399 Puma
2024-07-31 11:05 [PATCH 0/2] fix eMMC/SPI flash corruption when audio has been used on RK3399 Puma Quentin Schulz
2024-07-31 11:05 ` [PATCH 1/2] arm64: dts: rockchip: fix eMMC/SPI " Quentin Schulz
2024-07-31 11:05 ` [PATCH 2/2] arm64: dts: rockchip: override BIOS_DISABLE signal via GPIO hog " Quentin Schulz
@ 2024-07-31 11:35 ` Heiko Stuebner
2 siblings, 0 replies; 4+ messages in thread
From: Heiko Stuebner @ 2024-07-31 11:35 UTC (permalink / raw)
To: Krzysztof Kozlowski, Brian Norris, Conor Dooley, Quentin Schulz,
Rob Herring, Judy Hsiao
Cc: Heiko Stuebner, Quentin Schulz, linux-arm-kernel, linux-kernel,
linux-rockchip, stable, devicetree
On Wed, 31 Jul 2024 13:05:27 +0200, Quentin Schulz wrote:
> In commit 91419ae0420f ("arm64: dts: rockchip: use BCLK to GPIO switch
> on rk3399"), an additional pinctrl state was added whose default pinmux
> is for 8ch i2s0. However, Puma only has 2ch i2s0. It's been overriding
> the pinctrl-0 property but the second property override was missed in
> the aforementioned commit.
>
> On Puma, a hardware slider called "BIOS Disable/Normal Boot" can disable
> eMMC and SPI to force booting from SD card. Another software-controlled
> GPIO is then configured to override this behavior to make eMMC and SPI
> available without human intervention. This is currently done in U-Boot
> and it was enough until the aforementioned commit.
>
> [...]
Applied, thanks!
[1/2] arm64: dts: rockchip: fix eMMC/SPI corruption when audio has been used on RK3399 Puma
commit: bb94a157b37ec23f53906a279320f6ed64300eba
[2/2] arm64: dts: rockchip: override BIOS_DISABLE signal via GPIO hog on RK3399 Puma
commit: 741f5ba7ccba5d7ae796dd11c320e28045524771
Best regards,
--
Heiko Stuebner <heiko@sntech.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-31 11:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-31 11:05 [PATCH 0/2] fix eMMC/SPI flash corruption when audio has been used on RK3399 Puma Quentin Schulz
2024-07-31 11:05 ` [PATCH 1/2] arm64: dts: rockchip: fix eMMC/SPI " Quentin Schulz
2024-07-31 11:05 ` [PATCH 2/2] arm64: dts: rockchip: override BIOS_DISABLE signal via GPIO hog " Quentin Schulz
2024-07-31 11:35 ` [PATCH 0/2] fix eMMC/SPI flash corruption when audio has been used " Heiko Stuebner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®