Skip to content

Commit a9c1ace

Browse files
shawn1221mmind
authored andcommitted
arm64: dts: rockchip: Fix SD card support for RK3576 Nanopi R76s
When runtime suspend is enabled, the associated power domain is powered off, which resets the registers, including the power control bit. As a result, the card loses power during runtime suspend. The card should still be able to process I/O with the help of mmc_blk_mq_rw_recovery(), which is suboptimal. To address this issue, we must use vmmc-supply with a GPIO based method to maintain power to the card and store valid tuning phases. Also, add cd-gpios method to make hot-plug work correctly during idle periods. Fixes: 7fee888 ("arm64: dts: rockchip: Add devicetree for the FriendlyElec NanoPi R76S") Cc: stable@vger.kernel.org Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Tested-by: Marco Schirrmeister <mschirrmeister@gmail.com> Link: https://patch.msgid.link/1768524932-163929-6-git-send-email-shawn.lin@rock-chips.com Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent 7226664 commit a9c1ace

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

arch/arm64/boot/dts/rockchip/rk3576-nanopi-r76s.dts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@
192192
regulator-name = "vcc_3v3_s0";
193193
vin-supply = <&vcc_3v3_s3>;
194194
};
195+
196+
vcc3v3_sd: regulator-vcc-3v3-sd {
197+
compatible = "regulator-fixed";
198+
enable-active-high;
199+
gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
200+
pinctrl-names = "default";
201+
pinctrl-0 = <&sdmmc_pwren>;
202+
regulator-name = "vcc3v3_sd";
203+
regulator-min-microvolt = <3300000>;
204+
regulator-max-microvolt = <3300000>;
205+
vin-supply = <&vcc_3v3_s0>;
206+
};
195207
};
196208

197209
&combphy0_ps {
@@ -726,6 +738,12 @@
726738
};
727739
};
728740

741+
sdmmc {
742+
sdmmc_pwren: sdmmc-pwren {
743+
rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
744+
};
745+
};
746+
729747
usb {
730748
usb_otg0_pwren_h: usb-otg0-pwren-h {
731749
rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
@@ -751,11 +769,14 @@
751769
bus-width = <4>;
752770
cap-mmc-highspeed;
753771
cap-sd-highspeed;
772+
cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
754773
disable-wp;
755774
no-mmc;
756775
no-sdio;
776+
pinctrl-names = "default";
777+
pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
757778
sd-uhs-sdr104;
758-
vmmc-supply = <&vcc_3v3_s3>;
779+
vmmc-supply = <&vcc3v3_sd>;
759780
vqmmc-supply = <&vccio_sd_s0>;
760781
status = "okay";
761782
};

0 commit comments

Comments
 (0)