[U-Boot] [PATCH 0/5] omap_hsmmc: add cd/wp gpio request, mmc dt fixes and enable mmc dm for dra74/dra72 evms

When omap_hsmmc was converted to DM, card detect and write protect gpios request were not implemented due to gpio failures [3], now as it is working adding cd/wp gpio request in probe. Also fixing the gpio active level in DT as done in kernel DT and enabling of DM_MMC for dra74 amd dra72 evm configs
With this patch when card is remove and trying mmc rescan gives error message like card is not present instead of select voltage failed as earlier.
Pushed a branch for others for testing [1] and logs at [2]
[1] - git://git.ti.com/~mugunthanvnm/ti-u-boot/mugunth-ti-u-boot.git dm-mmc-gpio [2] - http://pastebin.ubuntu.com/15611123/ [3] - http://lists.denx.de/pipermail/u-boot/2015-September/227962.html
Mugunthan V N (5): drivers: mmc: omap_hsmmc: request cd and wp gpios when DM_MMC is defined ARM: dts: am43xx: fix cd-gpios definition as per hardware design and dt binding docs ARM: dts: dra7xx: am57xx: fix cd-gpios definition as per hardware design and dt binding docs configs: dra72_evm: enable mmc driver model configs: dra74_evm: enable mmc driver model
arch/arm/dts/am437x-gp-evm.dts | 2 +- arch/arm/dts/am437x-sk-evm.dts | 2 +- arch/arm/dts/am57xx-beagle-x15.dts | 2 +- arch/arm/dts/dra7-evm.dts | 5 +++++ arch/arm/dts/dra72-evm.dts | 2 +- configs/dra72_evm_defconfig | 1 + configs/dra74_evm_defconfig | 1 + drivers/mmc/omap_hsmmc.c | 5 +++++ 8 files changed, 16 insertions(+), 4 deletions(-)

Add request gpio for CD and WP gpios, so that the gpio can be used for the respective purposes.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com --- drivers/mmc/omap_hsmmc.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 1071314..85a832b 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -820,6 +820,11 @@ static int omap_hsmmc_probe(struct udevice *dev) if (mmc == NULL) return -1;
+#ifdef OMAP_HSMMC_USE_GPIO + gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN); + gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN); +#endif + upriv->mmc = mmc;
return 0;

On Mon, Apr 04, 2016 at 05:28:01PM +0530, Mugunthan V N wrote:
Add request gpio for CD and WP gpios, so that the gpio can be used for the respective purposes.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

Hi Muganthan,
On 4 April 2016 at 05:58, Mugunthan V N mugunthanvnm@ti.com wrote:
Add request gpio for CD and WP gpios, so that the gpio can be used for the respective purposes.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com
drivers/mmc/omap_hsmmc.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 1071314..85a832b 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -820,6 +820,11 @@ static int omap_hsmmc_probe(struct udevice *dev) if (mmc == NULL) return -1;
+#ifdef OMAP_HSMMC_USE_GPIO
gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN);
Please check errors here.
+#endif
upriv->mmc = mmc; return 0;
-- 2.8.0.rc3.9.g44915db
Regards, Simon

On Wed, Apr 20, 2016 at 08:40:01AM -0600, Simon Glass wrote:
Hi Muganthan,
On 4 April 2016 at 05:58, Mugunthan V N mugunthanvnm@ti.com wrote:
Add request gpio for CD and WP gpios, so that the gpio can be used for the respective purposes.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com
drivers/mmc/omap_hsmmc.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index 1071314..85a832b 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -820,6 +820,11 @@ static int omap_hsmmc_probe(struct udevice *dev) if (mmc == NULL) return -1;
+#ifdef OMAP_HSMMC_USE_GPIO
gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN);
Please check errors here.
... in a follow-up patch, I have this queued currently. Thanks!

On Mon, Apr 04, 2016 at 05:28:01PM +0530, Mugunthan V N wrote:
Add request gpio for CD and WP gpios, so that the gpio can be used for the respective purposes.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

As per mmc device tree binding documentation card detect gpio has to be active low signal. When a hardware is designed with active high card detect, gpio polarity has to be changed with cd-inverted dt property.
In AM43xx the card detect gpio is designed as active low gpio. So correcting the dt card detect gpio definition.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com --- arch/arm/dts/am437x-gp-evm.dts | 2 +- arch/arm/dts/am437x-sk-evm.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/am437x-gp-evm.dts b/arch/arm/dts/am437x-gp-evm.dts index 8e23b96..142bfc5 100644 --- a/arch/arm/dts/am437x-gp-evm.dts +++ b/arch/arm/dts/am437x-gp-evm.dts @@ -573,7 +573,7 @@ bus-width = <4>; pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; - cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; };
&mmc3 { diff --git a/arch/arm/dts/am437x-sk-evm.dts b/arch/arm/dts/am437x-sk-evm.dts index 260edb9..927d8d3 100644 --- a/arch/arm/dts/am437x-sk-evm.dts +++ b/arch/arm/dts/am437x-sk-evm.dts @@ -536,7 +536,7 @@
vmmc-supply = <&dcdc4>; bus-width = <4>; - cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; + cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; };
&usb2_phy1 {

On Mon, Apr 04, 2016 at 05:28:02PM +0530, Mugunthan V N wrote:
As per mmc device tree binding documentation card detect gpio has to be active low signal. When a hardware is designed with active high card detect, gpio polarity has to be changed with cd-inverted dt property.
In AM43xx the card detect gpio is designed as active low gpio. So correcting the dt card detect gpio definition.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Apr 04, 2016 at 05:28:02PM +0530, Mugunthan V N wrote:
As per mmc device tree binding documentation card detect gpio has to be active low signal. When a hardware is designed with active high card detect, gpio polarity has to be changed with cd-inverted dt property.
In AM43xx the card detect gpio is designed as active low gpio. So correcting the dt card detect gpio definition.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

As per mmc device tree binding documentation card detect gpio has to be active low signal. When a hardware is designed with active high card detect, gpio polarity has to be changed with cd-inverted dt property.
In DRA72x and AM57xx EVMs the card detect gpio is designed as active low gpio. So correcting the dt card detect gpio definition.
Also adding card-detect gpio for DRA74x EVM.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com --- arch/arm/dts/am57xx-beagle-x15.dts | 2 +- arch/arm/dts/dra7-evm.dts | 5 +++++ arch/arm/dts/dra72-evm.dts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/am57xx-beagle-x15.dts b/arch/arm/dts/am57xx-beagle-x15.dts index e424562..38b266a 100644 --- a/arch/arm/dts/am57xx-beagle-x15.dts +++ b/arch/arm/dts/am57xx-beagle-x15.dts @@ -586,7 +586,7 @@ vmmc_aux-supply = <&vdd_3v3>; pbias-supply = <&pbias_mmc_reg>; bus-width = <4>; - cd-gpios = <&gpio6 27 0>; /* gpio 219 */ + cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */ };
&mmc2 { diff --git a/arch/arm/dts/dra7-evm.dts b/arch/arm/dts/dra7-evm.dts index 242fd53..08ef04e 100644 --- a/arch/arm/dts/dra7-evm.dts +++ b/arch/arm/dts/dra7-evm.dts @@ -469,6 +469,11 @@ status = "okay"; vmmc-supply = <&ldo1_reg>; bus-width = <4>; + /* + * SDCD signal is not being used here - using the fact that GPIO mode + * is always hardwired. + */ + cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; };
&mmc2 { diff --git a/arch/arm/dts/dra72-evm.dts b/arch/arm/dts/dra72-evm.dts index fc2d167..205103e 100644 --- a/arch/arm/dts/dra72-evm.dts +++ b/arch/arm/dts/dra72-evm.dts @@ -503,7 +503,7 @@ * SDCD signal is not being used here - using the fact that GPIO mode * is a viable alternative */ - cd-gpios = <&gpio6 27 0>; + cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; };
&mmc2 {

On Mon, Apr 04, 2016 at 05:28:03PM +0530, Mugunthan V N wrote:
As per mmc device tree binding documentation card detect gpio has to be active low signal. When a hardware is designed with active high card detect, gpio polarity has to be changed with cd-inverted dt property.
In DRA72x and AM57xx EVMs the card detect gpio is designed as active low gpio. So correcting the dt card detect gpio definition.
Also adding card-detect gpio for DRA74x EVM.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Apr 04, 2016 at 05:28:03PM +0530, Mugunthan V N wrote:
As per mmc device tree binding documentation card detect gpio has to be active low signal. When a hardware is designed with active high card detect, gpio polarity has to be changed with cd-inverted dt property.
In DRA72x and AM57xx EVMs the card detect gpio is designed as active low gpio. So correcting the dt card detect gpio definition.
Also adding card-detect gpio for DRA74x EVM.
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

enable mmc driver model for dra72 evm as omap_hsmmc supports driver model
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com --- configs/dra72_evm_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/dra72_evm_defconfig b/configs/dra72_evm_defconfig index da24992..6626a1e 100644 --- a/configs/dra72_evm_defconfig +++ b/configs/dra72_evm_defconfig @@ -25,3 +25,4 @@ CONFIG_TIMER=y CONFIG_OMAP_TIMER=y CONFIG_USB=y CONFIG_USB_GADGET=y +CONFIG_DM_MMC=y

On Mon, Apr 04, 2016 at 05:28:04PM +0530, Mugunthan V N wrote:
enable mmc driver model for dra72 evm as omap_hsmmc supports driver model
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Apr 04, 2016 at 05:28:04PM +0530, Mugunthan V N wrote:
enable mmc driver model for dra72 evm as omap_hsmmc supports driver model
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

enable mmc driver model for dra74 evm as omap_hsmmc supports driver model
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com --- configs/dra74_evm_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/dra74_evm_defconfig b/configs/dra74_evm_defconfig index 9039b15..5f50004 100644 --- a/configs/dra74_evm_defconfig +++ b/configs/dra74_evm_defconfig @@ -24,3 +24,4 @@ CONFIG_TIMER=y CONFIG_OMAP_TIMER=y CONFIG_USB=y CONFIG_USB_GADGET=y +CONFIG_DM_MMC=y

On Mon, Apr 04, 2016 at 05:28:05PM +0530, Mugunthan V N wrote:
enable mmc driver model for dra74 evm as omap_hsmmc supports driver model
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com
Reviewed-by: Tom Rini trini@konsulko.com

On Mon, Apr 04, 2016 at 05:28:05PM +0530, Mugunthan V N wrote:
enable mmc driver model for dra74 evm as omap_hsmmc supports driver model
Signed-off-by: Mugunthan V N mugunthanvnm@ti.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!
participants (3)
-
Mugunthan V N
-
Simon Glass
-
Tom Rini