devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Vicente Bergas <vicencb@gmail.com>,
	Heiko Stuebner <heiko@sntech.de>, Sasha Levin <sashal@kernel.org>,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: [PATCH AUTOSEL 4.19 090/191] arm64: dts: rockchip: Fix microSD in rk3399 sapphire board
Date: Sat,  9 Nov 2019 21:38:32 -0500	[thread overview]
Message-ID: <20191110024013.29782-90-sashal@kernel.org> (raw)
In-Reply-To: <20191110024013.29782-1-sashal@kernel.org>

From: Vicente Bergas <vicencb@gmail.com>

[ Upstream commit 88a20edf76091ee7f1bb459b89d714d53f0f8940 ]

The microSD card slot in the Sapphire board is not working because of
several issues:
 1.- The vmmc power supply is missing in the DTS. It is capable of 3.0V
 and has a GPIO-based enable control.
 2.- The vqmmc power supply can provide up to 3.3V, but it is capped in
 the DTS to just 3.0V because of the vmmc capability. This results in a
 conflict from the mmc driver requesting an unsupportable voltage range
 from 3.3V to 3.0V (min > max) as reported in dmesg. So, extend the
 range up to 3.3V. The hw should be able to stand this 0.3V tolerance.
 See mmc_regulator_set_vqmmc in drivers/mmc/core/core.c.
 3.- The card detect signal is non-working. There is a known conflict
 with jtag, but the workaround in drivers/soc/rockchip/grf.c does not
 work. Adding the broken-cd attribute to the DTS fixes the issue.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../boot/dts/rockchip/rk3399-sapphire.dtsi    | 24 ++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
index 36b60791c156d..780e5e298d8bd 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
@@ -93,6 +93,19 @@
 		vin-supply = <&vcc_1v8>;
 	};
 
+	vcc3v0_sd: vcc3v0-sd {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&sdmmc0_pwr_h>;
+		regulator-always-on;
+		regulator-max-microvolt = <3000000>;
+		regulator-min-microvolt = <3000000>;
+		regulator-name = "vcc3v0_sd";
+		vin-supply = <&vcc3v3_sys>;
+	};
+
 	vcc3v3_sys: vcc3v3-sys {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc3v3_sys";
@@ -310,7 +323,7 @@
 				regulator-always-on;
 				regulator-boot-on;
 				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3000000>;
+				regulator-max-microvolt = <3300000>;
 				regulator-state-mem {
 					regulator-on-in-suspend;
 					regulator-suspend-microvolt = <3000000>;
@@ -469,6 +482,13 @@
 		};
 	};
 
+	sd {
+		sdmmc0_pwr_h: sdmmc0-pwr-h {
+			rockchip,pins =
+				<RK_GPIO0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	usb2 {
 		vcc5v0_host_en: vcc5v0-host-en {
 			rockchip,pins =
@@ -499,6 +519,7 @@
 };
 
 &sdmmc {
+	broken-cd;
 	bus-width = <4>;
 	cap-mmc-highspeed;
 	cap-sd-highspeed;
@@ -507,6 +528,7 @@
 	max-frequency = <150000000>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
+	vmmc-supply = <&vcc3v0_sd>;
 	vqmmc-supply = <&vcc_sdio>;
 	status = "okay";
 };
-- 
2.20.1


  parent reply	other threads:[~2019-11-10  3:12 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20191110024013.29782-1-sashal@kernel.org>
2019-11-10  2:37 ` [PATCH AUTOSEL 4.19 009/191] ARM: dts: xilinx: Fix I2C and SPI bus warnings Sasha Levin
2019-11-10  2:37 ` [PATCH AUTOSEL 4.19 014/191] arm64: dts: ti: k3-am65: Change #address-cells and #size-cells of interconnect to 2 Sasha Levin
2019-11-10  2:37 ` [PATCH AUTOSEL 4.19 033/191] ARM: dts: atmel: Fix I2C and SPI bus warnings Sasha Levin
2019-11-10  2:37 ` [PATCH AUTOSEL 4.19 035/191] of/unittest: Fix I2C bus unit-address error Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 062/191] ARM: dts: am335x-evm: fix number of cpsw Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 063/191] ARM: dts: ti: Fix SPI and I2C bus warnings Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 066/191] ARM: dts: ux500: Correct SCU unit address Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 067/191] ARM: dts: ux500: Fix LCDA clock line muxing Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 068/191] ARM: dts: ste: Fix SPI controller node names Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 073/191] ARM: dts: marvell: Fix SPI and I2C bus warnings Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 075/191] ARM: dts: stm32: enable display on stm32mp157c-ev1 board Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 076/191] ARM: dts: clearfog: fix sdhci supply property name Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 077/191] ARM: dts: stm32: Fix SPI controller node names Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 083/191] net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider Sasha Levin
2019-11-10  2:38 ` Sasha Levin [this message]
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 096/191] ARM: dts: rockchip: explicitly set vcc_sd0 pin to gpio on rk3188-radxarock Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 100/191] ARM: dts: exynos: Correct audio subsystem parent clock on Peach Chromebooks Sasha Levin
2019-11-10  2:38 ` [PATCH AUTOSEL 4.19 107/191] ARM: dts: imx6ull: update vdd_soc voltage for 900MHz operating point Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 130/191] ARM: dts: meson8b: odroidc1: enable the SAR ADC Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 131/191] arm64: dts: fsl: Fix I2C and SPI bus warnings Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 132/191] ARM: dts: imx51-zii-rdu1: Fix the rtc compatible string Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 136/191] arm64: tegra: I2C on Tegra194 is not compatible with Tegra114 Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 137/191] ARM: dts: tegra30: fix xcvr-setup-use-fuses Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 138/191] ARM: dts: tegra20: restore address order Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 139/191] ARM: tegra: apalis_t30: fix mmc1 cmd pull-up Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 140/191] ARM: tegra: apalis_t30: fix mcp2515 can controller interrupt polarity Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 141/191] ARM: tegra: colibri_t30: " Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 142/191] ARM: dts: paz00: fix wakeup gpio keycode Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 151/191] ARM: dts: realview: Fix SPI controller node names Sasha Levin
2019-11-10  2:39 ` [PATCH AUTOSEL 4.19 177/191] arm64: dts: amd: Fix SPI bus warnings Sasha Levin
2019-11-10  2:40 ` [PATCH AUTOSEL 4.19 178/191] arm64: dts: lg: Fix SPI controller node names Sasha Levin
2019-11-10  2:40 ` [PATCH AUTOSEL 4.19 179/191] ARM: dts: lpc32xx: " Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191110024013.29782-90-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=vicencb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).