Cannot interface an SDIO device with usdhc2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot interface an SDIO device with usdhc2

1,883 Views
eren_yilmaz
Contributor III

Hi!

I am trying to set up a WiFi module on the second SD interface, however, the process gets stuck in trying to initialise the card with different frequencies. The messages I am getting are

mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
mmc1: mmc_rescan_try_freq: trying to init card at 300000 Hz
mmc1: mmc_rescan_try_freq: trying to init card at 200000 Hz
mmc1: mmc_rescan_try_freq: trying to init card at 100000 Hz

The WiFi SD interface works perfectly fine with the first SD interface i.e. usdhc1, I have double checked for any overlapping key assignments for SD2, also tinkered with PAD drive characteristics,but no luck.

My device tree entry for usdhc2 is

&usdhc2 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_usdhc2>;
    bus-width = <4>;
    no-1-8-v;
    cd-gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
    fsl,wp-controller;
    status = "okay";
};

pinctrl_usdhc2: usdhc2grp {
        fsl,pins = <
            MX6QDL_PAD_SD2_CMD__SD2_CMD        0x070b1
            MX6QDL_PAD_SD2_CLK__SD2_CLK        0x070b1
            MX6QDL_PAD_SD2_DAT0__SD2_DATA0        0x070b1
            MX6QDL_PAD_SD2_DAT1__SD2_DATA1        0x070b1
            MX6QDL_PAD_SD2_DAT2__SD2_DATA2        0x070b1
            MX6QDL_PAD_SD2_DAT3__SD2_DATA3        0x070b1
            MX6QDL_PAD_SD3_CLK__GPIO7_IO03        0x170b0 /* SD2 CD */
        >;
    };

Here are the more detailed logs. Fail is at CMD5...

Thanks a lot!


mmc1: clock 0Hz busmode 2 powermode 1 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: Initial signal voltage of 3.3v
mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 400000, actual: 386718
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 400000, actual: 386718
mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
mmc1: starting CMD52 arg 00000c00 flags 00000195
mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD52 arg 80000c08 flags 00000195
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
/soc/aips-bus@02100000/usdhc@0219c000: voltage-ranges unspecified
sdhci [sdhci_add_host()]: mmc2: Auto-CMD23 available
mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc1: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 400000, actual: 386718
mmc1: starting CMD0 arg 00000000 flags 000000c0
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
mmc1: req done (CMD0): 0: 00000000 00000000 00000000 00000000
mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 400000, actual: 386718
mmc1: starting CMD8 arg 000001aa flags 000002f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD8): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD5 arg 00000000 flags 000002e1
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD5): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 400000, actual: 386718
mmc1: starting CMD1 arg 00000000 flags 000000e1
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD1): -110: 00000000 00000000 00000000 00000000
mmc1: clock 0Hz busmode 2 powermode 0 cs 0 Vdd 0 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
mmc1: mmc_rescan_try_freq: trying to init card at 300000 Hz
mmc1: clock 0Hz busmode 2 powermode 1 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: Initial signal voltage of 3.3v
mmc1: clock 300000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 300000, actual: 281250
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 300000, actual: 281250
mmc1: starting CMD52 arg 00000c00 flags 00000195
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD52 arg 80000c08 flags 00000195
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc1: clock 300000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 300000, actual: 281250
mmc1: starting CMD0 arg 00000000 flags 000000c0
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
mmc1: req done (CMD0): 0: 00000000 00000000 00000000 00000000
mmc1: clock 300000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 300000, actual: 281250
mmc1: starting CMD8 arg 000001aa flags 000002f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD8): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD5 arg 00000000 flags 000002e1
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD5): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: clock 300000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 300000, actual: 281250
mmc1: starting CMD1 arg 00000000 flags 000000e1
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD1): -110: 00000000 00000000 00000000 00000000
mmc1: clock 0Hz busmode 2 powermode 0 cs 0 Vdd 0 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
mmc1: mmc_rescan_try_freq: trying to init card at 200000 Hz
mmc1: clock 0Hz busmode 2 powermode 1 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: Initial signal voltage of 3.3v
mmc1: clock 200000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 200000, actual: 193359
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 200000, actual: 193359
mmc1: starting CMD52 arg 00000c00 flags 00000195
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD52 arg 80000c08 flags 00000195
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc1: clock 200000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 200000, actual: 193359
mmc1: starting CMD0 arg 00000000 flags 000000c0
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
mmc1: req done (CMD0): 0: 00000000 00000000 00000000 00000000
mmc1: clock 200000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 200000, actual: 193359
mmc1: starting CMD8 arg 000001aa flags 000002f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD8): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD5 arg 00000000 flags 000002e1
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD5): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: clock 200000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 200000, actual: 193359
mmc1: starting CMD1 arg 00000000 flags 000000e1
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD1): -110: 00000000 00000000 00000000 00000000
mmc1: clock 0Hz busmode 2 powermode 0 cs 0 Vdd 0 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
mmc1: mmc_rescan_try_freq: trying to init card at 100000 Hz
mmc1: clock 0Hz busmode 2 powermode 1 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: Initial signal voltage of 3.3v
mmc1: clock 100000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 100000, actual: 96679
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 100000, actual: 96679
mmc1: starting CMD52 arg 00000c00 flags 00000195
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD52 arg 80000c08 flags 00000195
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
mmc1: clock 100000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 100000, actual: 96679
mmc1: starting CMD0 arg 00000000 flags 000000c0
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00000001
mmc1: req done (CMD0): 0: 00000000 00000000 00000000 00000000
mmc1: clock 100000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 100000, actual: 96679
mmc1: starting CMD8 arg 000001aa flags 000002f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD8): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD5 arg 00000000 flags 000002e1
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req failed (CMD5): -110, retrying...
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD5): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: starting CMD55 arg 00000000 flags 000000f5
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
mmc1: clock 100000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
sdhci-esdhc-imx 2194000.usdhc: change pinctrl state for uhs 0
sdhci-esdhc-imx 2194000.usdhc: desired SD clock: 100000, actual: 96679
mmc1: starting CMD1 arg 00000000 flags 000000e1
sdhci [sdhci_irq()]: *** mmc1 got interrupt: 0x00010000
mmc1: req done (CMD1): -110: 00000000 00000000 00000000 00000000
mmc1: clock 0Hz busmode 2 powermode 0 cs 0 Vdd 0 width 0 timing 0

Labels (2)
Tags (1)
0 Kudos
Reply
4 Replies

1,783 Views
igorpadykov
NXP Employee
NXP Employee

Hi Eren

host sends CMD5 prior to the CMD55/ACMD41 pair, and thus would receive a valid OCR in
response to CMD5 and continue to initialize the card.

If the I/O portion of a card has received no CMD5, the I/O Section remains inactive and

shall not respond to any command except CMD5.

So one can attach logic analyzer and check where error happens, my be there is poor

signal quality due to layout.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,783 Views
eren_yilmaz
Contributor III

Hello Igor,

Thank you for your response.

I have checked the signals and as you say it fails to initialize where the SYS_CTRL register, SDCLKFS frequency select field gets set to 40 (it should be 10). Triying different settings, now I am getting

"MMC:   Card did not respond to voltage select!".

Any suggestions?

Thanks

0 Kudos
Reply

1,783 Views
igorpadykov
NXP Employee
NXP Employee

Hi Eren

 

"MMC:   Card did not respond to voltage select!". means that host

does not support suggested SD voltages. One can look at SDIO

specificaion for more details.

Simplified Specifications - SD Association 

 

Best regards
igor

0 Kudos
Reply

1,783 Views
igorpadykov
NXP Employee
NXP Employee

usdhc2 sdio example can be found in technexion board

linux-imx-tn/imx8mq-pico.dtsi at tn-imx_4.14.98_2.0.0_ga-wip-mipi2lvds · TechNexion-customization/li... 

Best regards
igor

0 Kudos
Reply