public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/2] arm: mvebu: Espressobin: Add support for SD card
@ 2020-08-19 14:19 Pali Rohár
  2020-08-19 14:19 ` [PATCH 1/2] mmc: xenon: set signal voltage and max base clock Pali Rohár
  2020-08-19 14:19 ` [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin Pali Rohár
  0 siblings, 2 replies; 11+ messages in thread
From: Pali Rohár @ 2020-08-19 14:19 UTC (permalink / raw)
  To: u-boot

This patch series contains two patches from Marvell's U-Boot repository
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/ which add
support for SD card on Espressobin board. I slightly modified them for
current mainline U-Boot version.

It allows U-Boot to load and boot Linux kernel from uSD card.

Evan Wang (1):
  mmc: xenon: set signal voltage and max base clock

Wilson Ding (1):
  arm: dts: a37x0: enable sd card support on espressobin

 arch/arm/dts/armada-3720-espressobin.dts    | 20 ++++++
 configs/mvebu_espressobin-88f3720_defconfig |  1 +
 drivers/mmc/xenon_sdhci.c                   | 79 ++++++++++++++++++++-
 3 files changed, 99 insertions(+), 1 deletion(-)

-- 
2.20.1

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

* [PATCH 1/2] mmc: xenon: set signal voltage and max base clock
  2020-08-19 14:19 [PATCH 0/2] arm: mvebu: Espressobin: Add support for SD card Pali Rohár
@ 2020-08-19 14:19 ` Pali Rohár
  2020-08-19 17:58   ` [EXT] " Kostya Porotchkin
                     ` (3 more replies)
  2020-08-19 14:19 ` [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin Pali Rohár
  1 sibling, 4 replies; 11+ messages in thread
From: Pali Rohár @ 2020-08-19 14:19 UTC (permalink / raw)
  To: u-boot

From: Evan Wang <xswang@marvell.com>

- The SDIO signal voltage and max base clock frequency
  setting are missing in driver, which causes SDIO
  not working.
- The patch adds SDIO signal voltage switch support,
  which is based on regulator-gpio of vqmmc-supply, and
  sets the max base clock frequency.
- Fix the zero clock value in call to sdhci_setup_cfg()
  function.

Change-Id: I79c8860c65b8db166f4f70db56ede4097f71f1fa
Signed-off-by: Evan Wang <xswang@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/53589
Reviewed-by: Hua Jing <jinghua@marvell.com>
Tested-by: Hua Jing <jinghua@marvell.com>
[pali: Amended fixup patch]
Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 drivers/mmc/xenon_sdhci.c | 79 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 78 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
index 356dd9846d..7f9a579c83 100644
--- a/drivers/mmc/xenon_sdhci.c
+++ b/drivers/mmc/xenon_sdhci.c
@@ -22,6 +22,7 @@
 #include <linux/libfdt.h>
 #include <malloc.h>
 #include <sdhci.h>
+#include <power/regulator.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,6 +43,14 @@ DECLARE_GLOBAL_DATA_PTR;
 #define SDHC_SYS_EXT_OP_CTRL			0x010C
 #define MASK_CMD_CONFLICT_ERROR			BIT(8)
 
+#define SDHC_SLOT_EMMC_CTRL			0x0130
+#define ENABLE_DATA_STROBE_SHIFT		24
+#define SET_EMMC_RSTN_SHIFT			16
+#define EMMC_VCCQ_MASK				0x3
+#define EMMC_VCCQ_1_8V				0x1
+#define EMMC_VCCQ_1_2V				0x2
+#define	EMMC_VCCQ_3_3V				0x3
+
 #define SDHC_SLOT_RETUNING_REQ_CTRL		0x0144
 /* retuning compatible */
 #define RETUNING_COMPATIBLE			0x1
@@ -108,6 +117,8 @@ DECLARE_GLOBAL_DATA_PTR;
 #define MMC_TIMING_MMC_HS400	10
 
 #define XENON_MMC_MAX_CLK	400000000
+#define XENON_MMC_3V3_UV	3300000
+#define XENON_MMC_1V8_UV	1800000
 
 enum soc_pad_ctrl_type {
 	SOC_PAD_SD,
@@ -128,6 +139,8 @@ struct xenon_sdhci_priv {
 
 	void *pad_ctrl_reg;
 	int pad_type;
+
+	struct udevice *vqmmc;
 };
 
 static int xenon_mmc_phy_init(struct sdhci_host *host)
@@ -208,6 +221,51 @@ static void armada_3700_soc_pad_voltage_set(struct sdhci_host *host)
 		writel(ARMADA_3700_SOC_PAD_3_3V, priv->pad_ctrl_reg);
 }
 
+static int xenon_mmc_start_signal_voltage_switch(struct sdhci_host *host)
+{
+	struct xenon_sdhci_priv *priv = host->mmc->priv;
+	u8 voltage;
+	u32 ctrl;
+	int ret = 0;
+
+	/* If there is no vqmmc regulator, return */
+	if (!priv->vqmmc)
+		return 0;
+
+	if (priv->pad_type == SOC_PAD_FIXED_1_8V) {
+		/* Switch to 1.8v */
+		ret = regulator_set_value(priv->vqmmc,
+					  XENON_MMC_1V8_UV);
+	} else if (priv->pad_type == SOC_PAD_SD) {
+		/* Get voltage info */
+		voltage = sdhci_readb(host, SDHCI_POWER_CONTROL);
+		voltage &= ~SDHCI_POWER_ON;
+
+		if (voltage == SDHCI_POWER_330) {
+			/* Switch to 3.3v */
+			ret = regulator_set_value(priv->vqmmc,
+						  XENON_MMC_3V3_UV);
+		} else {
+			/* Switch to 1.8v */
+			ret = regulator_set_value(priv->vqmmc,
+						  XENON_MMC_1V8_UV);
+		}
+	}
+
+	/* Set VCCQ, eMMC mode: 1.8V; SD/SDIO mode: 3.3V */
+	ctrl = sdhci_readl(host, SDHC_SLOT_EMMC_CTRL);
+	if (IS_SD(host->mmc))
+		ctrl |= EMMC_VCCQ_3_3V;
+	else
+		ctrl |= EMMC_VCCQ_1_8V;
+	sdhci_writel(host, ctrl, SDHC_SLOT_EMMC_CTRL);
+
+	if (ret)
+		printf("Signal voltage switch fail\n");
+
+	return ret;
+}
+
 static void xenon_mmc_phy_set(struct sdhci_host *host)
 {
 	struct xenon_sdhci_priv *priv = host->mmc->priv;
@@ -334,6 +392,13 @@ static int xenon_sdhci_set_ios_post(struct sdhci_host *host)
 	uint speed = host->mmc->tran_speed;
 	int pwr_18v = 0;
 
+	/*
+	 * Signal Voltage Switching is only applicable for Host Controllers
+	 * v3.00 and above.
+	 */
+	if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300)
+		xenon_mmc_start_signal_voltage_switch(host);
+
 	if ((sdhci_readb(host, SDHCI_POWER_CONTROL) & ~SDHCI_POWER_ON) ==
 	    SDHCI_POWER_180)
 		pwr_18v = 1;
@@ -394,6 +459,18 @@ static int xenon_sdhci_probe(struct udevice *dev)
 	/* Set default timing */
 	priv->timing = MMC_TIMING_LEGACY;
 
+	/* Get the vqmmc regulator if there is */
+	device_get_supply_regulator(dev, "vqmmc-supply", &priv->vqmmc);
+	/* Set the initial voltage value to 3.3V if there is regulator */
+	if (priv->vqmmc) {
+		ret = regulator_set_value(priv->vqmmc,
+					  XENON_MMC_3V3_UV);
+		if (ret) {
+			printf("Failed to set VQMMC regulator to 3.3V\n");
+			return ret;
+		}
+	}
+
 	/* Disable auto clock gating during init */
 	xenon_mmc_set_acg(host, false);
 
@@ -426,7 +503,7 @@ static int xenon_sdhci_probe(struct udevice *dev)
 	host->ops = &xenon_sdhci_ops;
 
 	host->max_clk = XENON_MMC_MAX_CLK;
-	ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
+	ret = sdhci_setup_cfg(&plat->cfg, host, XENON_MMC_MAX_CLK, 0);
 	if (ret)
 		return ret;
 
-- 
2.20.1

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

* [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin
  2020-08-19 14:19 [PATCH 0/2] arm: mvebu: Espressobin: Add support for SD card Pali Rohár
  2020-08-19 14:19 ` [PATCH 1/2] mmc: xenon: set signal voltage and max base clock Pali Rohár
@ 2020-08-19 14:19 ` Pali Rohár
  2020-08-19 17:57   ` [EXT] " Kostya Porotchkin
                     ` (3 more replies)
  1 sibling, 4 replies; 11+ messages in thread
From: Pali Rohár @ 2020-08-19 14:19 UTC (permalink / raw)
  To: u-boot

From: Wilson Ding <dingwei@marvell.com>

Enabled SDIO slot 0 (south bridge) for SD card on
Espressobin board.

Change-Id: I51a2debf9fba276b9c4a2bc6da91328d47f443e3
Signed-off-by: Wilson Ding <dingwei@marvell.com>
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-on: http://vgitil04.il.marvell.com:8080/60945
Tested-by: iSoC Platform CI <ykjenk@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
[pali: Define cd-gpios and enable CONFIG_DM_REGULATOR_GPIO]
Signed-off-by: Pali Roh?r <pali@kernel.org>
---
 arch/arm/dts/armada-3720-espressobin.dts    | 20 ++++++++++++++++++++
 configs/mvebu_espressobin-88f3720_defconfig |  1 +
 2 files changed, 21 insertions(+)

diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts
index f10a953ec5..92eddca6c0 100644
--- a/arch/arm/dts/armada-3720-espressobin.dts
+++ b/arch/arm/dts/armada-3720-espressobin.dts
@@ -67,6 +67,17 @@
 		device_type = "memory";
 		reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
 	};
+
+	vcc_sd_reg0: regulator at 0 {
+		compatible = "regulator-gpio";
+		regulator-name = "vcc_sd0";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-type = "voltage";
+		states = <1800000 0x1
+			  3300000 0x0>;
+		gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
+	};
 };
 
 &comphy {
@@ -110,6 +121,15 @@
 	status = "okay";
 };
 
+&sdhci0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdio_pins>;
+	bus-width = <4>;
+	cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>;
+	vqmmc-supply = <&vcc_sd_reg0>;
+	status = "okay";
+};
+
 &spi0 {
 	status = "okay";
 	pinctrl-names = "default";
diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig
index 495faf43a3..933592af88 100644
--- a/configs/mvebu_espressobin-88f3720_defconfig
+++ b/configs/mvebu_espressobin-88f3720_defconfig
@@ -81,3 +81,4 @@ CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_SHA1=y
 CONFIG_SHA256=y
 CONFIG_MVNETA=y
+CONFIG_DM_REGULATOR_GPIO=y
-- 
2.20.1

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

* [EXT] [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin
  2020-08-19 14:19 ` [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin Pali Rohár
@ 2020-08-19 17:57   ` Kostya Porotchkin
  2020-08-20  4:58   ` Stefan Roese
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Kostya Porotchkin @ 2020-08-19 17:57 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Pali Roh?r <pali@kernel.org>
> Sent: Wednesday, August 19, 2020 17:20
> To: Peng Fan <peng.fan@nxp.com>; Kostya Porotchkin
> <kostap@marvell.com>; Stefan Roese <sr@denx.de>
> Cc: u-boot at lists.denx.de
> Subject: [EXT] [PATCH 2/2] arm: dts: a37x0: enable sd card support on
> espressobin
> 
> External Email
> 
> ----------------------------------------------------------------------
> From: Wilson Ding <dingwei@marvell.com>
> 
> Enabled SDIO slot 0 (south bridge) for SD card on Espressobin board.
> 
> Change-Id: I51a2debf9fba276b9c4a2bc6da91328d47f443e3
> Signed-off-by: Wilson Ding <dingwei@marvell.com>
> Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/60945
> Tested-by: iSoC Platform CI <ykjenk@marvell.com>
> Reviewed-by: Igal Liberman <igall@marvell.com>
> [pali: Define cd-gpios and enable CONFIG_DM_REGULATOR_GPIO]
> Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
> ---
>  arch/arm/dts/armada-3720-espressobin.dts    | 20 ++++++++++++++++++++
>  configs/mvebu_espressobin-88f3720_defconfig |  1 +
>  2 files changed, 21 insertions(+)
> 
> diff --git a/arch/arm/dts/armada-3720-espressobin.dts
> b/arch/arm/dts/armada-3720-espressobin.dts
> index f10a953ec5..92eddca6c0 100644
> --- a/arch/arm/dts/armada-3720-espressobin.dts
> +++ b/arch/arm/dts/armada-3720-espressobin.dts
> @@ -67,6 +67,17 @@
>  		device_type = "memory";
>  		reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
>  	};
> +
> +	vcc_sd_reg0: regulator at 0 {
> +		compatible = "regulator-gpio";
> +		regulator-name = "vcc_sd0";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3300000>;
> +		regulator-type = "voltage";
> +		states = <1800000 0x1
> +			  3300000 0x0>;
> +		gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
> +	};
>  };
> 
>  &comphy {
> @@ -110,6 +121,15 @@
>  	status = "okay";
>  };
> 
> +&sdhci0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&sdio_pins>;
> +	bus-width = <4>;
> +	cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>;
> +	vqmmc-supply = <&vcc_sd_reg0>;
> +	status = "okay";
> +};
> +
>  &spi0 {
>  	status = "okay";
>  	pinctrl-names = "default";
> diff --git a/configs/mvebu_espressobin-88f3720_defconfig
> b/configs/mvebu_espressobin-88f3720_defconfig
> index 495faf43a3..933592af88 100644
> --- a/configs/mvebu_espressobin-88f3720_defconfig
> +++ b/configs/mvebu_espressobin-88f3720_defconfig
> @@ -81,3 +81,4 @@ CONFIG_USB_ETHER_SMSC95XX=y  CONFIG_SHA1=y
> CONFIG_SHA256=y  CONFIG_MVNETA=y
> +CONFIG_DM_REGULATOR_GPIO=y
> --
> 2.20.1

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

* [EXT] [PATCH 1/2] mmc: xenon: set signal voltage and max base clock
  2020-08-19 14:19 ` [PATCH 1/2] mmc: xenon: set signal voltage and max base clock Pali Rohár
@ 2020-08-19 17:58   ` Kostya Porotchkin
  2020-08-20  4:58   ` Stefan Roese
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Kostya Porotchkin @ 2020-08-19 17:58 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Pali Roh?r <pali@kernel.org>
> Sent: Wednesday, August 19, 2020 17:20
> To: Peng Fan <peng.fan@nxp.com>; Kostya Porotchkin
> <kostap@marvell.com>; Stefan Roese <sr@denx.de>
> Cc: u-boot at lists.denx.de
> Subject: [EXT] [PATCH 1/2] mmc: xenon: set signal voltage and max base
> clock
> 
> External Email
> 
> ----------------------------------------------------------------------
> From: Evan Wang <xswang@marvell.com>
> 
> - The SDIO signal voltage and max base clock frequency
>   setting are missing in driver, which causes SDIO
>   not working.
> - The patch adds SDIO signal voltage switch support,
>   which is based on regulator-gpio of vqmmc-supply, and
>   sets the max base clock frequency.
> - Fix the zero clock value in call to sdhci_setup_cfg()
>   function.
> 
> Change-Id: I79c8860c65b8db166f4f70db56ede4097f71f1fa
> Signed-off-by: Evan Wang <xswang@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/53589
> Reviewed-by: Hua Jing <jinghua@marvell.com>
> Tested-by: Hua Jing <jinghua@marvell.com>
> [pali: Amended fixup patch]
> Signed-off-by: Pali Roh?r <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>

> ---
>  drivers/mmc/xenon_sdhci.c | 79
> ++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 78 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c index
> 356dd9846d..7f9a579c83 100644
> --- a/drivers/mmc/xenon_sdhci.c
> +++ b/drivers/mmc/xenon_sdhci.c
> @@ -22,6 +22,7 @@
>  #include <linux/libfdt.h>
>  #include <malloc.h>
>  #include <sdhci.h>
> +#include <power/regulator.h>
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> @@ -42,6 +43,14 @@ DECLARE_GLOBAL_DATA_PTR;
>  #define SDHC_SYS_EXT_OP_CTRL			0x010C
>  #define MASK_CMD_CONFLICT_ERROR			BIT(8)
> 
> +#define SDHC_SLOT_EMMC_CTRL			0x0130
> +#define ENABLE_DATA_STROBE_SHIFT		24
> +#define SET_EMMC_RSTN_SHIFT			16
> +#define EMMC_VCCQ_MASK				0x3
> +#define EMMC_VCCQ_1_8V				0x1
> +#define EMMC_VCCQ_1_2V				0x2
> +#define	EMMC_VCCQ_3_3V				0x3
> +
>  #define SDHC_SLOT_RETUNING_REQ_CTRL		0x0144
>  /* retuning compatible */
>  #define RETUNING_COMPATIBLE			0x1
> @@ -108,6 +117,8 @@ DECLARE_GLOBAL_DATA_PTR;
>  #define MMC_TIMING_MMC_HS400	10
> 
>  #define XENON_MMC_MAX_CLK	400000000
> +#define XENON_MMC_3V3_UV	3300000
> +#define XENON_MMC_1V8_UV	1800000
> 
>  enum soc_pad_ctrl_type {
>  	SOC_PAD_SD,
> @@ -128,6 +139,8 @@ struct xenon_sdhci_priv {
> 
>  	void *pad_ctrl_reg;
>  	int pad_type;
> +
> +	struct udevice *vqmmc;
>  };
> 
>  static int xenon_mmc_phy_init(struct sdhci_host *host) @@ -208,6 +221,51
> @@ static void armada_3700_soc_pad_voltage_set(struct sdhci_host *host)
>  		writel(ARMADA_3700_SOC_PAD_3_3V, priv->pad_ctrl_reg);
> }
> 
> +static int xenon_mmc_start_signal_voltage_switch(struct sdhci_host
> +*host) {
> +	struct xenon_sdhci_priv *priv = host->mmc->priv;
> +	u8 voltage;
> +	u32 ctrl;
> +	int ret = 0;
> +
> +	/* If there is no vqmmc regulator, return */
> +	if (!priv->vqmmc)
> +		return 0;
> +
> +	if (priv->pad_type == SOC_PAD_FIXED_1_8V) {
> +		/* Switch to 1.8v */
> +		ret = regulator_set_value(priv->vqmmc,
> +					  XENON_MMC_1V8_UV);
> +	} else if (priv->pad_type == SOC_PAD_SD) {
> +		/* Get voltage info */
> +		voltage = sdhci_readb(host, SDHCI_POWER_CONTROL);
> +		voltage &= ~SDHCI_POWER_ON;
> +
> +		if (voltage == SDHCI_POWER_330) {
> +			/* Switch to 3.3v */
> +			ret = regulator_set_value(priv->vqmmc,
> +						  XENON_MMC_3V3_UV);
> +		} else {
> +			/* Switch to 1.8v */
> +			ret = regulator_set_value(priv->vqmmc,
> +						  XENON_MMC_1V8_UV);
> +		}
> +	}
> +
> +	/* Set VCCQ, eMMC mode: 1.8V; SD/SDIO mode: 3.3V */
> +	ctrl = sdhci_readl(host, SDHC_SLOT_EMMC_CTRL);
> +	if (IS_SD(host->mmc))
> +		ctrl |= EMMC_VCCQ_3_3V;
> +	else
> +		ctrl |= EMMC_VCCQ_1_8V;
> +	sdhci_writel(host, ctrl, SDHC_SLOT_EMMC_CTRL);
> +
> +	if (ret)
> +		printf("Signal voltage switch fail\n");
> +
> +	return ret;
> +}
> +
>  static void xenon_mmc_phy_set(struct sdhci_host *host)  {
>  	struct xenon_sdhci_priv *priv = host->mmc->priv; @@ -334,6
> +392,13 @@ static int xenon_sdhci_set_ios_post(struct sdhci_host *host)
>  	uint speed = host->mmc->tran_speed;
>  	int pwr_18v = 0;
> 
> +	/*
> +	 * Signal Voltage Switching is only applicable for Host Controllers
> +	 * v3.00 and above.
> +	 */
> +	if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300)
> +		xenon_mmc_start_signal_voltage_switch(host);
> +
>  	if ((sdhci_readb(host, SDHCI_POWER_CONTROL) &
> ~SDHCI_POWER_ON) ==
>  	    SDHCI_POWER_180)
>  		pwr_18v = 1;
> @@ -394,6 +459,18 @@ static int xenon_sdhci_probe(struct udevice *dev)
>  	/* Set default timing */
>  	priv->timing = MMC_TIMING_LEGACY;
> 
> +	/* Get the vqmmc regulator if there is */
> +	device_get_supply_regulator(dev, "vqmmc-supply", &priv-
> >vqmmc);
> +	/* Set the initial voltage value to 3.3V if there is regulator */
> +	if (priv->vqmmc) {
> +		ret = regulator_set_value(priv->vqmmc,
> +					  XENON_MMC_3V3_UV);
> +		if (ret) {
> +			printf("Failed to set VQMMC regulator to 3.3V\n");
> +			return ret;
> +		}
> +	}
> +
>  	/* Disable auto clock gating during init */
>  	xenon_mmc_set_acg(host, false);
> 
> @@ -426,7 +503,7 @@ static int xenon_sdhci_probe(struct udevice *dev)
>  	host->ops = &xenon_sdhci_ops;
> 
>  	host->max_clk = XENON_MMC_MAX_CLK;
> -	ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
> +	ret = sdhci_setup_cfg(&plat->cfg, host, XENON_MMC_MAX_CLK, 0);
>  	if (ret)
>  		return ret;
> 
> --
> 2.20.1

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

* [PATCH 1/2] mmc: xenon: set signal voltage and max base clock
  2020-08-19 14:19 ` [PATCH 1/2] mmc: xenon: set signal voltage and max base clock Pali Rohár
  2020-08-19 17:58   ` [EXT] " Kostya Porotchkin
@ 2020-08-20  4:58   ` Stefan Roese
  2020-08-27 16:28   ` Andre Heider
  2020-08-31 13:04   ` Stefan Roese
  3 siblings, 0 replies; 11+ messages in thread
From: Stefan Roese @ 2020-08-20  4:58 UTC (permalink / raw)
  To: u-boot

On 19.08.20 16:19, Pali Roh?r wrote:
> From: Evan Wang <xswang@marvell.com>
> 
> - The SDIO signal voltage and max base clock frequency
>    setting are missing in driver, which causes SDIO
>    not working.
> - The patch adds SDIO signal voltage switch support,
>    which is based on regulator-gpio of vqmmc-supply, and
>    sets the max base clock frequency.
> - Fix the zero clock value in call to sdhci_setup_cfg()
>    function.
> 
> Change-Id: I79c8860c65b8db166f4f70db56ede4097f71f1fa
> Signed-off-by: Evan Wang <xswang@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/53589
> Reviewed-by: Hua Jing <jinghua@marvell.com>
> Tested-by: Hua Jing <jinghua@marvell.com>
> [pali: Amended fixup patch]
> Signed-off-by: Pali Roh?r <pali@kernel.org>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   drivers/mmc/xenon_sdhci.c | 79 ++++++++++++++++++++++++++++++++++++++-
>   1 file changed, 78 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
> index 356dd9846d..7f9a579c83 100644
> --- a/drivers/mmc/xenon_sdhci.c
> +++ b/drivers/mmc/xenon_sdhci.c
> @@ -22,6 +22,7 @@
>   #include <linux/libfdt.h>
>   #include <malloc.h>
>   #include <sdhci.h>
> +#include <power/regulator.h>
>   
>   DECLARE_GLOBAL_DATA_PTR;
>   
> @@ -42,6 +43,14 @@ DECLARE_GLOBAL_DATA_PTR;
>   #define SDHC_SYS_EXT_OP_CTRL			0x010C
>   #define MASK_CMD_CONFLICT_ERROR			BIT(8)
>   
> +#define SDHC_SLOT_EMMC_CTRL			0x0130
> +#define ENABLE_DATA_STROBE_SHIFT		24
> +#define SET_EMMC_RSTN_SHIFT			16
> +#define EMMC_VCCQ_MASK				0x3
> +#define EMMC_VCCQ_1_8V				0x1
> +#define EMMC_VCCQ_1_2V				0x2
> +#define	EMMC_VCCQ_3_3V				0x3
> +
>   #define SDHC_SLOT_RETUNING_REQ_CTRL		0x0144
>   /* retuning compatible */
>   #define RETUNING_COMPATIBLE			0x1
> @@ -108,6 +117,8 @@ DECLARE_GLOBAL_DATA_PTR;
>   #define MMC_TIMING_MMC_HS400	10
>   
>   #define XENON_MMC_MAX_CLK	400000000
> +#define XENON_MMC_3V3_UV	3300000
> +#define XENON_MMC_1V8_UV	1800000
>   
>   enum soc_pad_ctrl_type {
>   	SOC_PAD_SD,
> @@ -128,6 +139,8 @@ struct xenon_sdhci_priv {
>   
>   	void *pad_ctrl_reg;
>   	int pad_type;
> +
> +	struct udevice *vqmmc;
>   };
>   
>   static int xenon_mmc_phy_init(struct sdhci_host *host)
> @@ -208,6 +221,51 @@ static void armada_3700_soc_pad_voltage_set(struct sdhci_host *host)
>   		writel(ARMADA_3700_SOC_PAD_3_3V, priv->pad_ctrl_reg);
>   }
>   
> +static int xenon_mmc_start_signal_voltage_switch(struct sdhci_host *host)
> +{
> +	struct xenon_sdhci_priv *priv = host->mmc->priv;
> +	u8 voltage;
> +	u32 ctrl;
> +	int ret = 0;
> +
> +	/* If there is no vqmmc regulator, return */
> +	if (!priv->vqmmc)
> +		return 0;
> +
> +	if (priv->pad_type == SOC_PAD_FIXED_1_8V) {
> +		/* Switch to 1.8v */
> +		ret = regulator_set_value(priv->vqmmc,
> +					  XENON_MMC_1V8_UV);
> +	} else if (priv->pad_type == SOC_PAD_SD) {
> +		/* Get voltage info */
> +		voltage = sdhci_readb(host, SDHCI_POWER_CONTROL);
> +		voltage &= ~SDHCI_POWER_ON;
> +
> +		if (voltage == SDHCI_POWER_330) {
> +			/* Switch to 3.3v */
> +			ret = regulator_set_value(priv->vqmmc,
> +						  XENON_MMC_3V3_UV);
> +		} else {
> +			/* Switch to 1.8v */
> +			ret = regulator_set_value(priv->vqmmc,
> +						  XENON_MMC_1V8_UV);
> +		}
> +	}
> +
> +	/* Set VCCQ, eMMC mode: 1.8V; SD/SDIO mode: 3.3V */
> +	ctrl = sdhci_readl(host, SDHC_SLOT_EMMC_CTRL);
> +	if (IS_SD(host->mmc))
> +		ctrl |= EMMC_VCCQ_3_3V;
> +	else
> +		ctrl |= EMMC_VCCQ_1_8V;
> +	sdhci_writel(host, ctrl, SDHC_SLOT_EMMC_CTRL);
> +
> +	if (ret)
> +		printf("Signal voltage switch fail\n");
> +
> +	return ret;
> +}
> +
>   static void xenon_mmc_phy_set(struct sdhci_host *host)
>   {
>   	struct xenon_sdhci_priv *priv = host->mmc->priv;
> @@ -334,6 +392,13 @@ static int xenon_sdhci_set_ios_post(struct sdhci_host *host)
>   	uint speed = host->mmc->tran_speed;
>   	int pwr_18v = 0;
>   
> +	/*
> +	 * Signal Voltage Switching is only applicable for Host Controllers
> +	 * v3.00 and above.
> +	 */
> +	if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300)
> +		xenon_mmc_start_signal_voltage_switch(host);
> +
>   	if ((sdhci_readb(host, SDHCI_POWER_CONTROL) & ~SDHCI_POWER_ON) ==
>   	    SDHCI_POWER_180)
>   		pwr_18v = 1;
> @@ -394,6 +459,18 @@ static int xenon_sdhci_probe(struct udevice *dev)
>   	/* Set default timing */
>   	priv->timing = MMC_TIMING_LEGACY;
>   
> +	/* Get the vqmmc regulator if there is */
> +	device_get_supply_regulator(dev, "vqmmc-supply", &priv->vqmmc);
> +	/* Set the initial voltage value to 3.3V if there is regulator */
> +	if (priv->vqmmc) {
> +		ret = regulator_set_value(priv->vqmmc,
> +					  XENON_MMC_3V3_UV);
> +		if (ret) {
> +			printf("Failed to set VQMMC regulator to 3.3V\n");
> +			return ret;
> +		}
> +	}
> +
>   	/* Disable auto clock gating during init */
>   	xenon_mmc_set_acg(host, false);
>   
> @@ -426,7 +503,7 @@ static int xenon_sdhci_probe(struct udevice *dev)
>   	host->ops = &xenon_sdhci_ops;
>   
>   	host->max_clk = XENON_MMC_MAX_CLK;
> -	ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
> +	ret = sdhci_setup_cfg(&plat->cfg, host, XENON_MMC_MAX_CLK, 0);
>   	if (ret)
>   		return ret;
>   
> 


Viele Gr??e,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de

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

* [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin
  2020-08-19 14:19 ` [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin Pali Rohár
  2020-08-19 17:57   ` [EXT] " Kostya Porotchkin
@ 2020-08-20  4:58   ` Stefan Roese
  2020-08-27 16:28   ` Andre Heider
  2020-08-31 13:04   ` Stefan Roese
  3 siblings, 0 replies; 11+ messages in thread
From: Stefan Roese @ 2020-08-20  4:58 UTC (permalink / raw)
  To: u-boot

On 19.08.20 16:19, Pali Roh?r wrote:
> From: Wilson Ding <dingwei@marvell.com>
> 
> Enabled SDIO slot 0 (south bridge) for SD card on
> Espressobin board.
> 
> Change-Id: I51a2debf9fba276b9c4a2bc6da91328d47f443e3
> Signed-off-by: Wilson Ding <dingwei@marvell.com>
> Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/60945
> Tested-by: iSoC Platform CI <ykjenk@marvell.com>
> Reviewed-by: Igal Liberman <igall@marvell.com>
> [pali: Define cd-gpios and enable CONFIG_DM_REGULATOR_GPIO]
> Signed-off-by: Pali Roh?r <pali@kernel.org>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   arch/arm/dts/armada-3720-espressobin.dts    | 20 ++++++++++++++++++++
>   configs/mvebu_espressobin-88f3720_defconfig |  1 +
>   2 files changed, 21 insertions(+)
> 
> diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts
> index f10a953ec5..92eddca6c0 100644
> --- a/arch/arm/dts/armada-3720-espressobin.dts
> +++ b/arch/arm/dts/armada-3720-espressobin.dts
> @@ -67,6 +67,17 @@
>   		device_type = "memory";
>   		reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
>   	};
> +
> +	vcc_sd_reg0: regulator at 0 {
> +		compatible = "regulator-gpio";
> +		regulator-name = "vcc_sd0";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3300000>;
> +		regulator-type = "voltage";
> +		states = <1800000 0x1
> +			  3300000 0x0>;
> +		gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
> +	};
>   };
>   
>   &comphy {
> @@ -110,6 +121,15 @@
>   	status = "okay";
>   };
>   
> +&sdhci0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&sdio_pins>;
> +	bus-width = <4>;
> +	cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>;
> +	vqmmc-supply = <&vcc_sd_reg0>;
> +	status = "okay";
> +};
> +
>   &spi0 {
>   	status = "okay";
>   	pinctrl-names = "default";
> diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig
> index 495faf43a3..933592af88 100644
> --- a/configs/mvebu_espressobin-88f3720_defconfig
> +++ b/configs/mvebu_espressobin-88f3720_defconfig
> @@ -81,3 +81,4 @@ CONFIG_USB_ETHER_SMSC95XX=y
>   CONFIG_SHA1=y
>   CONFIG_SHA256=y
>   CONFIG_MVNETA=y
> +CONFIG_DM_REGULATOR_GPIO=y
> 


Viele Gr??e,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de

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

* [PATCH 1/2] mmc: xenon: set signal voltage and max base clock
  2020-08-19 14:19 ` [PATCH 1/2] mmc: xenon: set signal voltage and max base clock Pali Rohár
  2020-08-19 17:58   ` [EXT] " Kostya Porotchkin
  2020-08-20  4:58   ` Stefan Roese
@ 2020-08-27 16:28   ` Andre Heider
  2020-08-31 13:04   ` Stefan Roese
  3 siblings, 0 replies; 11+ messages in thread
From: Andre Heider @ 2020-08-27 16:28 UTC (permalink / raw)
  To: u-boot

On 19/08/2020 16:19, Pali Roh?r wrote:
> From: Evan Wang <xswang@marvell.com>
> 
> - The SDIO signal voltage and max base clock frequency
>    setting are missing in driver, which causes SDIO
>    not working.
> - The patch adds SDIO signal voltage switch support,
>    which is based on regulator-gpio of vqmmc-supply, and
>    sets the max base clock frequency.
> - Fix the zero clock value in call to sdhci_setup_cfg()
>    function.
> 
> Change-Id: I79c8860c65b8db166f4f70db56ede4097f71f1fa
> Signed-off-by: Evan Wang <xswang@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/53589
> Reviewed-by: Hua Jing <jinghua@marvell.com>
> Tested-by: Hua Jing <jinghua@marvell.com>
> [pali: Amended fixup patch]
> Signed-off-by: Pali Roh?r <pali@kernel.org>

Tested-by: Andre Heider <a.heider@gmail.com>

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

* [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin
  2020-08-19 14:19 ` [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin Pali Rohár
  2020-08-19 17:57   ` [EXT] " Kostya Porotchkin
  2020-08-20  4:58   ` Stefan Roese
@ 2020-08-27 16:28   ` Andre Heider
  2020-08-31 13:04   ` Stefan Roese
  3 siblings, 0 replies; 11+ messages in thread
From: Andre Heider @ 2020-08-27 16:28 UTC (permalink / raw)
  To: u-boot

On 19/08/2020 16:19, Pali Roh?r wrote:
> From: Wilson Ding <dingwei@marvell.com>
> 
> Enabled SDIO slot 0 (south bridge) for SD card on
> Espressobin board.
> 
> Change-Id: I51a2debf9fba276b9c4a2bc6da91328d47f443e3
> Signed-off-by: Wilson Ding <dingwei@marvell.com>
> Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/60945
> Tested-by: iSoC Platform CI <ykjenk@marvell.com>
> Reviewed-by: Igal Liberman <igall@marvell.com>
> [pali: Define cd-gpios and enable CONFIG_DM_REGULATOR_GPIO]
> Signed-off-by: Pali Roh?r <pali@kernel.org>

Tested-by: Andre Heider <a.heider@gmail.com>

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

* [PATCH 1/2] mmc: xenon: set signal voltage and max base clock
  2020-08-19 14:19 ` [PATCH 1/2] mmc: xenon: set signal voltage and max base clock Pali Rohár
                     ` (2 preceding siblings ...)
  2020-08-27 16:28   ` Andre Heider
@ 2020-08-31 13:04   ` Stefan Roese
  3 siblings, 0 replies; 11+ messages in thread
From: Stefan Roese @ 2020-08-31 13:04 UTC (permalink / raw)
  To: u-boot

On 19.08.20 16:19, Pali Roh?r wrote:
> From: Evan Wang <xswang@marvell.com>
> 
> - The SDIO signal voltage and max base clock frequency
>    setting are missing in driver, which causes SDIO
>    not working.
> - The patch adds SDIO signal voltage switch support,
>    which is based on regulator-gpio of vqmmc-supply, and
>    sets the max base clock frequency.
> - Fix the zero clock value in call to sdhci_setup_cfg()
>    function.
> 
> Change-Id: I79c8860c65b8db166f4f70db56ede4097f71f1fa
> Signed-off-by: Evan Wang <xswang@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/53589
> Reviewed-by: Hua Jing <jinghua@marvell.com>
> Tested-by: Hua Jing <jinghua@marvell.com>
> [pali: Amended fixup patch]
> Signed-off-by: Pali Roh?r <pali@kernel.org>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
>   drivers/mmc/xenon_sdhci.c | 79 ++++++++++++++++++++++++++++++++++++++-
>   1 file changed, 78 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
> index 356dd9846d..7f9a579c83 100644
> --- a/drivers/mmc/xenon_sdhci.c
> +++ b/drivers/mmc/xenon_sdhci.c
> @@ -22,6 +22,7 @@
>   #include <linux/libfdt.h>
>   #include <malloc.h>
>   #include <sdhci.h>
> +#include <power/regulator.h>
>   
>   DECLARE_GLOBAL_DATA_PTR;
>   
> @@ -42,6 +43,14 @@ DECLARE_GLOBAL_DATA_PTR;
>   #define SDHC_SYS_EXT_OP_CTRL			0x010C
>   #define MASK_CMD_CONFLICT_ERROR			BIT(8)
>   
> +#define SDHC_SLOT_EMMC_CTRL			0x0130
> +#define ENABLE_DATA_STROBE_SHIFT		24
> +#define SET_EMMC_RSTN_SHIFT			16
> +#define EMMC_VCCQ_MASK				0x3
> +#define EMMC_VCCQ_1_8V				0x1
> +#define EMMC_VCCQ_1_2V				0x2
> +#define	EMMC_VCCQ_3_3V				0x3
> +
>   #define SDHC_SLOT_RETUNING_REQ_CTRL		0x0144
>   /* retuning compatible */
>   #define RETUNING_COMPATIBLE			0x1
> @@ -108,6 +117,8 @@ DECLARE_GLOBAL_DATA_PTR;
>   #define MMC_TIMING_MMC_HS400	10
>   
>   #define XENON_MMC_MAX_CLK	400000000
> +#define XENON_MMC_3V3_UV	3300000
> +#define XENON_MMC_1V8_UV	1800000
>   
>   enum soc_pad_ctrl_type {
>   	SOC_PAD_SD,
> @@ -128,6 +139,8 @@ struct xenon_sdhci_priv {
>   
>   	void *pad_ctrl_reg;
>   	int pad_type;
> +
> +	struct udevice *vqmmc;
>   };
>   
>   static int xenon_mmc_phy_init(struct sdhci_host *host)
> @@ -208,6 +221,51 @@ static void armada_3700_soc_pad_voltage_set(struct sdhci_host *host)
>   		writel(ARMADA_3700_SOC_PAD_3_3V, priv->pad_ctrl_reg);
>   }
>   
> +static int xenon_mmc_start_signal_voltage_switch(struct sdhci_host *host)
> +{
> +	struct xenon_sdhci_priv *priv = host->mmc->priv;
> +	u8 voltage;
> +	u32 ctrl;
> +	int ret = 0;
> +
> +	/* If there is no vqmmc regulator, return */
> +	if (!priv->vqmmc)
> +		return 0;
> +
> +	if (priv->pad_type == SOC_PAD_FIXED_1_8V) {
> +		/* Switch to 1.8v */
> +		ret = regulator_set_value(priv->vqmmc,
> +					  XENON_MMC_1V8_UV);
> +	} else if (priv->pad_type == SOC_PAD_SD) {
> +		/* Get voltage info */
> +		voltage = sdhci_readb(host, SDHCI_POWER_CONTROL);
> +		voltage &= ~SDHCI_POWER_ON;
> +
> +		if (voltage == SDHCI_POWER_330) {
> +			/* Switch to 3.3v */
> +			ret = regulator_set_value(priv->vqmmc,
> +						  XENON_MMC_3V3_UV);
> +		} else {
> +			/* Switch to 1.8v */
> +			ret = regulator_set_value(priv->vqmmc,
> +						  XENON_MMC_1V8_UV);
> +		}
> +	}
> +
> +	/* Set VCCQ, eMMC mode: 1.8V; SD/SDIO mode: 3.3V */
> +	ctrl = sdhci_readl(host, SDHC_SLOT_EMMC_CTRL);
> +	if (IS_SD(host->mmc))
> +		ctrl |= EMMC_VCCQ_3_3V;
> +	else
> +		ctrl |= EMMC_VCCQ_1_8V;
> +	sdhci_writel(host, ctrl, SDHC_SLOT_EMMC_CTRL);
> +
> +	if (ret)
> +		printf("Signal voltage switch fail\n");
> +
> +	return ret;
> +}
> +
>   static void xenon_mmc_phy_set(struct sdhci_host *host)
>   {
>   	struct xenon_sdhci_priv *priv = host->mmc->priv;
> @@ -334,6 +392,13 @@ static int xenon_sdhci_set_ios_post(struct sdhci_host *host)
>   	uint speed = host->mmc->tran_speed;
>   	int pwr_18v = 0;
>   
> +	/*
> +	 * Signal Voltage Switching is only applicable for Host Controllers
> +	 * v3.00 and above.
> +	 */
> +	if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300)
> +		xenon_mmc_start_signal_voltage_switch(host);
> +
>   	if ((sdhci_readb(host, SDHCI_POWER_CONTROL) & ~SDHCI_POWER_ON) ==
>   	    SDHCI_POWER_180)
>   		pwr_18v = 1;
> @@ -394,6 +459,18 @@ static int xenon_sdhci_probe(struct udevice *dev)
>   	/* Set default timing */
>   	priv->timing = MMC_TIMING_LEGACY;
>   
> +	/* Get the vqmmc regulator if there is */
> +	device_get_supply_regulator(dev, "vqmmc-supply", &priv->vqmmc);
> +	/* Set the initial voltage value to 3.3V if there is regulator */
> +	if (priv->vqmmc) {
> +		ret = regulator_set_value(priv->vqmmc,
> +					  XENON_MMC_3V3_UV);
> +		if (ret) {
> +			printf("Failed to set VQMMC regulator to 3.3V\n");
> +			return ret;
> +		}
> +	}
> +
>   	/* Disable auto clock gating during init */
>   	xenon_mmc_set_acg(host, false);
>   
> @@ -426,7 +503,7 @@ static int xenon_sdhci_probe(struct udevice *dev)
>   	host->ops = &xenon_sdhci_ops;
>   
>   	host->max_clk = XENON_MMC_MAX_CLK;
> -	ret = sdhci_setup_cfg(&plat->cfg, host, 0, 0);
> +	ret = sdhci_setup_cfg(&plat->cfg, host, XENON_MMC_MAX_CLK, 0);
>   	if (ret)
>   		return ret;
>   
> 


Viele Gr??e,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de

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

* [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin
  2020-08-19 14:19 ` [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin Pali Rohár
                     ` (2 preceding siblings ...)
  2020-08-27 16:28   ` Andre Heider
@ 2020-08-31 13:04   ` Stefan Roese
  3 siblings, 0 replies; 11+ messages in thread
From: Stefan Roese @ 2020-08-31 13:04 UTC (permalink / raw)
  To: u-boot

On 19.08.20 16:19, Pali Roh?r wrote:
> From: Wilson Ding <dingwei@marvell.com>
> 
> Enabled SDIO slot 0 (south bridge) for SD card on
> Espressobin board.
> 
> Change-Id: I51a2debf9fba276b9c4a2bc6da91328d47f443e3
> Signed-off-by: Wilson Ding <dingwei@marvell.com>
> Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
> Reviewed-on: http://vgitil04.il.marvell.com:8080/60945
> Tested-by: iSoC Platform CI <ykjenk@marvell.com>
> Reviewed-by: Igal Liberman <igall@marvell.com>
> [pali: Define cd-gpios and enable CONFIG_DM_REGULATOR_GPIO]
> Signed-off-by: Pali Roh?r <pali@kernel.org>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
>   arch/arm/dts/armada-3720-espressobin.dts    | 20 ++++++++++++++++++++
>   configs/mvebu_espressobin-88f3720_defconfig |  1 +
>   2 files changed, 21 insertions(+)
> 
> diff --git a/arch/arm/dts/armada-3720-espressobin.dts b/arch/arm/dts/armada-3720-espressobin.dts
> index f10a953ec5..92eddca6c0 100644
> --- a/arch/arm/dts/armada-3720-espressobin.dts
> +++ b/arch/arm/dts/armada-3720-espressobin.dts
> @@ -67,6 +67,17 @@
>   		device_type = "memory";
>   		reg = <0x00000000 0x00000000 0x00000000 0x20000000>;
>   	};
> +
> +	vcc_sd_reg0: regulator at 0 {
> +		compatible = "regulator-gpio";
> +		regulator-name = "vcc_sd0";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <3300000>;
> +		regulator-type = "voltage";
> +		states = <1800000 0x1
> +			  3300000 0x0>;
> +		gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>;
> +	};
>   };
>   
>   &comphy {
> @@ -110,6 +121,15 @@
>   	status = "okay";
>   };
>   
> +&sdhci0 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&sdio_pins>;
> +	bus-width = <4>;
> +	cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>;
> +	vqmmc-supply = <&vcc_sd_reg0>;
> +	status = "okay";
> +};
> +
>   &spi0 {
>   	status = "okay";
>   	pinctrl-names = "default";
> diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig
> index 495faf43a3..933592af88 100644
> --- a/configs/mvebu_espressobin-88f3720_defconfig
> +++ b/configs/mvebu_espressobin-88f3720_defconfig
> @@ -81,3 +81,4 @@ CONFIG_USB_ETHER_SMSC95XX=y
>   CONFIG_SHA1=y
>   CONFIG_SHA256=y
>   CONFIG_MVNETA=y
> +CONFIG_DM_REGULATOR_GPIO=y
> 


Viele Gr??e,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de

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

end of thread, other threads:[~2020-08-31 13:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-19 14:19 [PATCH 0/2] arm: mvebu: Espressobin: Add support for SD card Pali Rohár
2020-08-19 14:19 ` [PATCH 1/2] mmc: xenon: set signal voltage and max base clock Pali Rohár
2020-08-19 17:58   ` [EXT] " Kostya Porotchkin
2020-08-20  4:58   ` Stefan Roese
2020-08-27 16:28   ` Andre Heider
2020-08-31 13:04   ` Stefan Roese
2020-08-19 14:19 ` [PATCH 2/2] arm: dts: a37x0: enable sd card support on espressobin Pali Rohár
2020-08-19 17:57   ` [EXT] " Kostya Porotchkin
2020-08-20  4:58   ` Stefan Roese
2020-08-27 16:28   ` Andre Heider
2020-08-31 13:04   ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox