Discussion:
"Card stuck in programming state! __mmc_switch" problem on i.MX6 + eMMC
David Müller (ELSOFT AG)
2014-09-16 14:37:13 UTC
Permalink
Hello

I have a custom i.MX6Q based board with a Hynix eMMC chip attached to
USDHC3. OS is a vanilla Linux 3.16 with some patches.

Loading the iMX SDHC driver results in the following error:

modprobe sdhci-esdhc-imx
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: no vqmmc regulator found
mmc0: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card


Pin muxing looks ok nevertheless I played around with it to see if it
makes a difference. I also tried the "Add delay between CMD6 and CMD13
for Sandisk eMMC cards" workaround previously mentioned on this list.

As the whole thing is working under U-Boot as shown below, I tend to
rule out soldering problems and non-functional hardware.

=> ver
U-Boot 2014.07-00045-g0955ecc-dirty (Aug 26 2014 - 12:47:21)
=> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
=> mmc info
Device: FSL_SDHC
Manufacturer ID: 90
OEM: 14a
Name: H8G2d
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.41
High Capacity: Yes
Capacity: 7.2 GiB
Bus Width: 8-bit


Any idea what is going wrong?
Has anybody a Hynix eMMC working under Linux?

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Jean-Michel Hautbois
2014-09-16 15:14:14 UTC
Permalink
Hi David,
Post by David Müller (ELSOFT AG)
Hello
I have a custom i.MX6Q based board with a Hynix eMMC chip attached to
USDHC3. OS is a vanilla Linux 3.16 with some patches.
modprobe sdhci-esdhc-imx
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: no vqmmc regulator found
mmc0: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
Pin muxing looks ok nevertheless I played around with it to see if it
makes a difference. I also tried the "Add delay between CMD6 and CMD1=
3
Post by David Müller (ELSOFT AG)
for Sandisk eMMC cards" workaround previously mentioned on this list.
Can you show your DT (at least pinmux part and usdhc3 node) ?
-110 is a timeout error and I know there is some quirks in Freescale
repository I don't know if this is your best bet...

JM
PS: Sorry for double posting, forgot linux-mmc in cc
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
David Müller (ELSOFT AG)
2014-09-17 07:45:57 UTC
Permalink
Hi Jean-Michel
Post by Jean-Michel Hautbois
Can you show your DT (at least pinmux part and usdhc3 node) ?
pinctrl_usdhc3: usdhc3grp {
fsl,pins = <
MX6QDL_PAD_SD3_CMD__SD3_CMD 0x1b0b1
MX6QDL_PAD_SD3_CLK__SD3_CLK 0x100b1
MX6QDL_PAD_SD3_DAT0__SD3_DATA0 0x1b0b1
MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x1b0b1
MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x1b0b1
MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x1b0b1
MX6QDL_PAD_SD3_DAT4__SD3_DATA4 0x1b0b1
MX6QDL_PAD_SD3_DAT5__SD3_DATA5 0x1b0b1
MX6QDL_PAD_SD3_DAT6__SD3_DATA6 0x1b0b1
MX6QDL_PAD_SD3_DAT7__SD3_DATA7 0x1b0b1
MX6QDL_PAD_SD3_RST__SD3_RESET 0x1b070
Post by Jean-Michel Hautbois
;
};

&usdhc3 { /* eMMC */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc3>;
vmmc-supply = <&reg_3v15>;
non-removable;
no-1-8-v;
bus-width = <8>;
status = "okay";
};


I've tracked the problem down to the point were the MMC code tries to
switch the eMMC to 8bit bus width (mmc_select_bus_width()).

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Fabio Estevam
2014-09-30 00:35:58 UTC
Permalink
Hi David,

On Tue, Sep 16, 2014 at 11:37 AM, David M=C3=BCller (ELSOFT AG)
Post by David Müller (ELSOFT AG)
Hello
I have a custom i.MX6Q based board with a Hynix eMMC chip attached to
USDHC3. OS is a vanilla Linux 3.16 with some patches.
modprobe sdhci-esdhc-imx
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: no vqmmc regulator found
mmc0: SDHCI controller on 2198000.usdhc [2198000.usdhc] using ADMA
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
mmc0: BKOPS_EN bit is not set
mmc0: Card stuck in programming state! __mmc_switch
mmc0: error -110 whilst initialising MMC card
Pin muxing looks ok nevertheless I played around with it to see if it
makes a difference. I also tried the "Add delay between CMD6 and CMD1=
3
Post by David Müller (ELSOFT AG)
for Sandisk eMMC cards" workaround previously mentioned on this list.
As the whole thing is working under U-Boot as shown below, I tend to
rule out soldering problems and non-functional hardware.
=3D> ver
U-Boot 2014.07-00045-g0955ecc-dirty (Aug 26 2014 - 12:47:21)
=3D> mmc dev 1
switch to partitions #0, OK
mmc1(part 0) is current device
=3D> mmc info
Device: FSL_SDHC
Manufacturer ID: 90
OEM: 14a
Name: H8G2d
Tran Speed: 52000000
Rd Block Len: 512
MMC version 4.41
High Capacity: Yes
Capacity: 7.2 GiB
Bus Width: 8-bit
Any idea what is going wrong?
Has anybody a Hynix eMMC working under Linux?
I remember having similar issues and they were fixed by this series:
http://www.spinics.net/lists/linux-mmc/msg28260.html

You can try linux-next as this series is already applied there already.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Loading...