mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] dt-bindings: pinctrl: rockchip: document io-1v8-domains
       [not found] <20261129071403.4890-1-daabu@qq.com>
@ 2026-11-29  7:14 ` Abduwaris Nurmemet
  2026-11-29 16:14   ` Heiko Stuebner
  2026-11-29  7:14 ` [PATCH 2/3] pinctrl: rockchip: program RK3308 I/O domains before SDIO probes Abduwaris Nurmemet
  2026-11-29  7:14 ` [PATCH 3/3] arm64: dts: rockchip: fix SDIO WiFi on the Sakura Pi RK3308B Abduwaris Nurmemet
  2 siblings, 1 reply; 5+ messages in thread
From: Abduwaris Nurmemet @ 2026-11-29  7:14 UTC (permalink / raw)
  To: linux-rockchip
  Cc: Heiko Stuebner, Linus Walleij, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, devicetree, linux-gpio, linux-arm-kernel,
	linux-kernel

Add the io-1v8-domains bitmask property.  It tells the pinctrl driver
which I/O domains are supplied with 1.8V instead of 3.3V.

Signed-off-by: Abduwaris Nurmemet <daabu@qq.com>
---
 .../devicetree/bindings/pinctrl/rockchip,pinctrl.yaml    | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.yaml
index 81747bb..0aaea2c 100644
--- a/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/rockchip,pinctrl.yaml
@@ -76,6 +76,15 @@ properties:
 
   ranges: true
 
+  io-1v8-domains:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Bitmask of I/O domains supplied with 1.8V instead of 3.3V.  Each set
+      bit selects the corresponding I/O domain (bit 0 is domain 0).  If
+      omitted, all domains are assumed to run at 3.3V.  Currently only
+      implemented for the RK3308, where the mask is programmed into
+      GRF_SOC_CON0 before the SDIO controller probes.
+
 allOf:
   - $ref: pinctrl.yaml#
 
-- 
2.47.3


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

* [PATCH 2/3] pinctrl: rockchip: program RK3308 I/O domains before SDIO probes
       [not found] <20261129071403.4890-1-daabu@qq.com>
  2026-11-29  7:14 ` [PATCH 1/3] dt-bindings: pinctrl: rockchip: document io-1v8-domains Abduwaris Nurmemet
@ 2026-11-29  7:14 ` Abduwaris Nurmemet
  2026-11-29 16:15   ` Heiko Stuebner
  2026-11-29  7:14 ` [PATCH 3/3] arm64: dts: rockchip: fix SDIO WiFi on the Sakura Pi RK3308B Abduwaris Nurmemet
  2 siblings, 1 reply; 5+ messages in thread
From: Abduwaris Nurmemet @ 2026-11-29  7:14 UTC (permalink / raw)
  To: linux-rockchip
  Cc: Heiko Stuebner, Linus Walleij, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, devicetree, linux-gpio, linux-arm-kernel,
	linux-kernel

The RK3308 SDIO controller is only reliable at 50 MHz when the I/O
domain feeding its pins is switched to 1.8V.  The generic io-domain
driver probes after the MMC controllers, which is too late: the SDIO
card is already being enumerated, so the bus either fails with
-84 or stays at a very low clock.

Program the domain selection from the pinctrl driver instead, which
probes before the MMC host.  Boards opt in with an io-1v8-domains
bitmask property on the pinctrl node, where each set bit marks an I/O
domain that runs at 1.8V.

This follows the approach used for the Rock Pi-S by Brent Roman.

Signed-off-by: Abduwaris Nurmemet <daabu@qq.com>
---
 drivers/pinctrl/pinctrl-rockchip.c | 37 ++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index ba47b6f..c9c888b 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -4761,6 +4761,40 @@ static int rk3308_soc_data_init(struct rockchip_pinctrl *info)
 	return 0;
 }
 
+#define RK3308_SOC_CON0			0x300
+#define RK3308_SOC_CON0_DOMAINS		GENMASK(5, 0)
+
+/*
+ * The RK3308 SDIO controller is only reliable at high clock rates when the
+ * I/O domain feeding its pins is configured for 1.8V. That setup has to
+ * happen before the SDIO controller probes, so do it here from the pinctrl
+ * driver rather than from the (later probing) io-domain driver.
+ *
+ * Boards opt in with an "io-1v8-domains" bitmask property on the pinctrl
+ * node, where each set bit marks an I/O domain that runs at 1.8V.
+ */
+static void rk3308_io_voltage_domains(struct rockchip_pinctrl *info)
+{
+	struct device *dev = info->dev;
+	u32 io_volt_select;
+	int ret;
+
+	if (device_property_read_u32(dev, "io-1v8-domains", &io_volt_select))
+		return;
+
+	if (io_volt_select & ~RK3308_SOC_CON0_DOMAINS) {
+		dev_warn(dev, "ignored invalid io-1v8-domains\n");
+		return;
+	}
+
+	ret = regmap_write(info->regmap_base, RK3308_SOC_CON0,
+			   io_volt_select | (RK3308_SOC_CON0_DOMAINS << 16));
+	if (ret < 0)
+		dev_warn(dev, "Couldn't update 1.8V I/O domains\n");
+	else
+		dev_info(dev, "1.8V I/O domains assigned 0x%03x\n", io_volt_select);
+}
+
 static int rockchip_pinctrl_probe(struct platform_device *pdev)
 {
 	struct rockchip_pinctrl *info;
@@ -4824,6 +4858,9 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
 	/* try to find the optional reference to the ioc1 syscon */
 	info->regmap_ioc1 = syscon_regmap_lookup_by_phandle_optional(np, "rockchip,ioc1");
 
+	if (ctrl->type == RK3308)
+		rk3308_io_voltage_domains(info);
+
 	if (ctrl->type == RK3308) {
 		ret = rk3308_soc_data_init(info);
 		if (ret)
-- 
2.47.3


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

* [PATCH 3/3] arm64: dts: rockchip: fix SDIO WiFi on the Sakura Pi RK3308B
       [not found] <20261129071403.4890-1-daabu@qq.com>
  2026-11-29  7:14 ` [PATCH 1/3] dt-bindings: pinctrl: rockchip: document io-1v8-domains Abduwaris Nurmemet
  2026-11-29  7:14 ` [PATCH 2/3] pinctrl: rockchip: program RK3308 I/O domains before SDIO probes Abduwaris Nurmemet
@ 2026-11-29  7:14 ` Abduwaris Nurmemet
  2 siblings, 0 replies; 5+ messages in thread
From: Abduwaris Nurmemet @ 2026-11-29  7:14 UTC (permalink / raw)
  To: linux-rockchip
  Cc: Heiko Stuebner, Linus Walleij, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, devicetree, linux-gpio, linux-arm-kernel,
	linux-kernel

The AP6255 (BCM43455) SDIO WiFi module is connected to I/O domain 4,
which is supplied with 1.8V on this board.  Without describing that,
the bus is left at 3.3V and either fails to enumerate (mmc2: error
-84) or only works at a very low clock.

Describe the 1.8V domain in the pinctrl node so the Rockchip pinctrl
driver programs it before the SDIO controller probes, and allow the
bus to run at 50 MHz.

Signed-off-by: Abduwaris Nurmemet <daabu@qq.com>
---
 arch/arm64/boot/dts/rockchip/rk3308-sakurapi-rk3308b.dts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3308-sakurapi-rk3308b.dts b/arch/arm64/boot/dts/rockchip/rk3308-sakurapi-rk3308b.dts
index 3473db0..e0c1c8e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3308-sakurapi-rk3308b.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3308-sakurapi-rk3308b.dts
@@ -135,6 +135,8 @@
 &pinctrl {
 	pinctrl-names = "default";
 	pinctrl-0 = <&rtc_32k>;
+	/* I/O domain 4 (SDIO) is supplied with 1.8V on this board */
+	io-1v8-domains = <0x10>;
 
 	bluetooth {
 		bt_reg_on: bt-reg-on {
@@ -193,6 +195,7 @@
 	non-removable;
 	no-mmc;
 	no-sd;
+	max-frequency = <50000000>;
 	status = "okay";
 
 	brcmf: wifi@1 {
-- 
2.47.3


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

* Re: [PATCH 1/3] dt-bindings: pinctrl: rockchip: document io-1v8-domains
  2026-11-29  7:14 ` [PATCH 1/3] dt-bindings: pinctrl: rockchip: document io-1v8-domains Abduwaris Nurmemet
@ 2026-11-29 16:14   ` Heiko Stuebner
  0 siblings, 0 replies; 5+ messages in thread
From: Heiko Stuebner @ 2026-11-29 16:14 UTC (permalink / raw)
  To: linux-rockchip, Abduwaris Nurmemet
  Cc: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	devicetree, linux-gpio, linux-arm-kernel, linux-kernel

Am Sonntag, 29. November 2026, 08:14:01 Mitteleuropäische Normalzeit schrieb Abduwaris Nurmemet:
> Add the io-1v8-domains bitmask property.  It tells the pinctrl driver
> which I/O domains are supplied with 1.8V instead of 3.3V.
> 
> Signed-off-by: Abduwaris Nurmemet <daabu@qq.com>

v2 [0] sent 2 hours later, dropped this patch


[0] https://lore.kernel.org/linux-rockchip/tencent_8CBF26AEE0A30976D669C6FF243C03645907@qq.com/




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

* Re: [PATCH 2/3] pinctrl: rockchip: program RK3308 I/O domains before SDIO probes
  2026-11-29  7:14 ` [PATCH 2/3] pinctrl: rockchip: program RK3308 I/O domains before SDIO probes Abduwaris Nurmemet
@ 2026-11-29 16:15   ` Heiko Stuebner
  0 siblings, 0 replies; 5+ messages in thread
From: Heiko Stuebner @ 2026-11-29 16:15 UTC (permalink / raw)
  To: linux-rockchip, Abduwaris Nurmemet
  Cc: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	devicetree, linux-gpio, linux-arm-kernel, linux-kernel

Am Sonntag, 29. November 2026, 08:14:02 Mitteleuropäische Normalzeit schrieb Abduwaris Nurmemet:
> The RK3308 SDIO controller is only reliable at 50 MHz when the I/O
> domain feeding its pins is switched to 1.8V.  The generic io-domain
> driver probes after the MMC controllers, which is too late: the SDIO
> card is already being enumerated, so the bus either fails with
> -84 or stays at a very low clock.
> 
> Program the domain selection from the pinctrl driver instead, which
> probes before the MMC host.  Boards opt in with an io-1v8-domains
> bitmask property on the pinctrl node, where each set bit marks an I/O
> domain that runs at 1.8V.
> 
> This follows the approach used for the Rock Pi-S by Brent Roman.
> 
> Signed-off-by: Abduwaris Nurmemet <daabu@qq.com>


v2 [0] sent 2 hours later, dropped this patch


[0] https://lore.kernel.org/linux-rockchip/tencent_8CBF26AEE0A30976D669C6FF243C03645907@qq.com/




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

end of thread, other threads:[~2026-11-29 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20261129071403.4890-1-daabu@qq.com>
2026-11-29  7:14 ` [PATCH 1/3] dt-bindings: pinctrl: rockchip: document io-1v8-domains Abduwaris Nurmemet
2026-11-29 16:14   ` Heiko Stuebner
2026-11-29  7:14 ` [PATCH 2/3] pinctrl: rockchip: program RK3308 I/O domains before SDIO probes Abduwaris Nurmemet
2026-11-29 16:15   ` Heiko Stuebner
2026-11-29  7:14 ` [PATCH 3/3] arm64: dts: rockchip: fix SDIO WiFi on the Sakura Pi RK3308B Abduwaris Nurmemet

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®