Re: [PATCH] ARM: dts: imx51-zii-rdu1: Make sure SD1_WP is low

From: Lucas Stach
Date: Fri May 25 2018 - 10:17:06 EST


Am Donnerstag, den 24.05.2018, 20:01 -0700 schrieb Andrey Smirnov:
> Make sure that MX51_PAD_GPIO1_1 does not remain configure as
> ALT0/SD1_WP (it is out of reset). This is needed because of external
> pull-up resistor attached to that pad that, when left unchanged, will
> drive SD1_WP high preventing eSDHC1/eMMC from working correctly.
>
> To fix that add a pinmux configuration line configureing the pad to
> function as a GPIO. While we are at it, add a corresponding input GPIO
> hog in an effort to minimize current consumption.

Enabling the input part of the pad also consumes (a small amount of)
power, if you are after minimizing power consumption, better configure
the pin as output and drive it in the pull direction.

>
> > Cc: Nikita Yushchenko <nikita.yoush@xxxxxxxxxxxxxxxxxx>
> > Cc: Shawn Guo <shawnguo@xxxxxxxxxx>
> > Cc: Fabio Estevam <fabio.estevam@xxxxxxx>
> > Cc: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
> > Cc: Chris Healy <cphealy@xxxxxxxxx>
> > Cc: Rob Herring <robh+dt@xxxxxxxxxx>
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> Cc: devicetree@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
> ---
> Âarch/arm/boot/dts/imx51-zii-rdu1.dts | 28 ++++++++++++++++++++++++++++
> Â1 file changed, 28 insertions(+)
>
> diff --git a/arch/arm/boot/dts/imx51-zii-rdu1.dts b/arch/arm/boot/dts/imx51-zii-rdu1.dts
> index df9eca94d812..d484e7e46b27 100644
> --- a/arch/arm/boot/dts/imx51-zii-rdu1.dts
> +++ b/arch/arm/boot/dts/imx51-zii-rdu1.dts
> @@ -476,6 +476,17 @@
> > Â status = "okay";
> Â};
> Â
> +&gpio1 {
> > + unused-sd3-wp-gpio {
> > + /*
> > + Â* See pinctrl_esdhc1 below for more details on this
> > + Â*/
> > + gpio-hog;
> > + gpios = <1 GPIO_ACTIVE_HIGH>;
> > + input;
> > + };
> +};
> +
> Â&i2c2 {
> > Â pinctrl-names = "default";
> > Â pinctrl-0 = <&pinctrl_i2c2>;
> @@ -660,6 +671,23 @@
> > > Â MX51_PAD_SD1_DATA1__SD1_DATA1 0x20d5
> > > Â MX51_PAD_SD1_DATA2__SD1_DATA2 0x20d5
> > > Â MX51_PAD_SD1_DATA3__SD1_DATA3 0x20d5
> > + /*
> > + Â* GPIO1_1 is not directly used by eSDHC1 in
> > + Â* any capacity, but earlier versions of RDU1
> > + Â* used that pin as WP GPIO for eSDHC3 and
> > + Â* because of that that pad has an external
> > + Â* pull-up resistor. This is problematic
> > + Â* because out of reset the pad is configured
> > + Â* as ALT0 which serves as SD1_WP, which, when
> > + Â* pulled high by and external pull-up, will
> > + Â* inhibit execution of any write request to
> > + Â* attached eMMC device.
> > + Â*
> > + Â* To avoid this problem we configure the pad
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ Â* to ALT1/GPIO and avoid driving SD1_WP
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ Â* signal high.

Applying the patch complains about whitespace damage in the above 2
lines.

Regards,
Lucas