From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=162.62.57.87 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795936459; b=VxIWEPll/P9AqSGjyhe0iCz0xvJcavEXBTnafXwsHPB42/dVodUEq5gH7m3d0/ZDZc1A oFWpZJSL5SYL5M9WnqcJ7mJ5l3CjjA8CF4E7/sg+8mqNe1ezZPaufmC+tcQDqkPxNsUJ1 sFVmuEvcptbGtvMSAag/zi4tgn2DsgEmMUdKgG91s/rIMJL0N4YAm40GLMC7lONnQnBoh ve6w5zSS6gO6FAMrI7FAVdqVjbyE8PVwK/ngnv2LmC395NNe/8rXBzAYlOVeh3pyJ778B euyG4hO2YMrriKJI7V7GGK2BYybu7zRKQyAgYUXtihojq72GusEkg38shJ+B9x3zGrg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795936459; h=DMARC-Filter:DKIM-Signature:Received:X-QQ-mid:Message-ID: X-QQ-XMAILINFO:X-QQ-XMRINFO:From:To:Cc:Subject:Date:X-OQ-MSGID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=Gbp3LWZGC40CqoFynxeakcvagdw0q4Ski9XSwlpLUyw=; b=evrHWWf8ljuyD+bk1h4GMJUoV3zKFFnD7g/o/VniggIAjCGAO4eDzZ8SYIrw+sJZbCOw KLaY7ai99WhHB3y4OydZC/HmrccGgrAb2OQjsQMQZUsQjyyawDERvB6l66M6yK5FuwCqU h/tkSEyCEUxuJkKtspwlb+mgFZ1e2OW+DjlfjnGkeu6A0p1P4sHn9nutc+Tgoqiij5Al2 QtLZPcU9Rl2KOADS67AI/dOjgO7jevOJIPTDx4X4+67npLs92nQUyc1IQZg4lG+1bjoE3 TRTrLN+mRtPykpmVQ7JkJu7AJdUeloodV1T1vnSZLggHVtqXd02pyDqFS81IFgohLIQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass header.d=qq.com header.i=@qq.com header.a=rsa-sha256 header.s=s201512 header.b=XEe+AE84; arc=none smtp.remote-ip=162.62.57.87 Received: from out162-62-57-87.mail.qq.com (out162-62-57-87.mail.qq.com [162.62.57.87]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22065606A323; Sun, 29 Nov 2026 07:14:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 22065606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.a=rsa-sha256 header.s=s201512 header.b=XEe+AE84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1795936453; bh=Gbp3LWZGC40CqoFynxeakcvagdw0q4Ski9XSwlpLUyw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XEe+AE84/p2Mq0UptQR7WbRDzXVMk9fQ9fkh5+N6asnRpjMvgu5KW3GNDkXsA+YjU mATMJjcekjxD4ypsOPPQ4fFrZofyOv49B2snpnbB0FLuWiOKUpwpC4Yy8zYRTSu30i 2ZNMXpaULn8xRUWWIDszF4A+3dmfY78Q0UGb0BVk= Received: from radxa-dragon-q8b.lan ([2409:8a7c:822e:e151:387e:72f8:fd6d:7686]) by newxmesmtplogicsvrszb51-0.qq.com (NewEsmtp) with SMTP id 3839D4C8; Sun, 29 Nov 2026 15:14:03 +0800 X-QQ-mid: xmsmtpt1795936449t3uqnlnop Message-ID: X-QQ-XMAILINFO: MRMtjO3A6C9X3GDSrfgDjA1Q+MjWELmHfE3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sh+eUX+SAQV tFMlkU X-QQ-XMRINFO: Mp0Kj//9VHAxzExpfF+O8yhSrljjwrznVg== From: Abduwaris Nurmemet To: linux-rockchip@lists.infradead.org Cc: Heiko Stuebner , Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] pinctrl: rockchip: program RK3308 I/O domains before SDIO probes Date: Sun, 29 Nov 2026 15:14:02 +0800 X-OQ-MSGID: <20261129071403.4890-3-daabu@qq.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261129071403.4890-1-daabu@qq.com> References: <20261129071403.4890-1-daabu@qq.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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