This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3352: MMC3 communication issue

Part Number: AM3352


Tool/software: Linux

Hi all,

communication over mmc3 instance on am3352 ( in device tree node : mmc@47810000) to sdcard connected over sdio doesn't seem to work. I suspect that my settings in device tree are not right, specifically the dma configuration. But I couldn't figure out what would be the correct settings.

With a different cpu board that connects to the same sdcard on the main board but uses mmc1 instance on the cpu board it works fine. So HW wiring is ok.

General/System information:

* Linux Kernel version: v4.4.97

* Snippet of device tree for mmc3 configuration:

/* SD card on JTAG board */

&am33xx_pinmux {
...

mmc2_pins: pinmux_mmc2_pins {
pinctrl-single,pins = <
0x030 (PIN_INPUT_PULLUP | MUX_MODE3) /* GPMC_AD12.mmc2_data0, 39, NC (SD_DATA0) */
0x034 (PIN_INPUT_PULLUP | MUX_MODE3) /* GPMC_AD13.mmc2_data1, 44, NC (SD_DATA1) */
0x038 (PIN_INPUT_PULLUP | MUX_MODE3) /* GPMC_AD14.mmc2_data2, 40, NC (SD_DATA2) */
0x03c (PIN_INPUT_PULLUP | MUX_MODE3) /* GPMC_AD15.mmc2_data3, 32, NC (SD_DATA3) */
0x088 (PIN_INPUT_PULLUP | MUX_MODE3) /* GPMC_CSn3.mmc2_cmd, 56, NC (SD_CMD) */
0x08c (PIN_INPUT | MUX_MODE3) /* GPMC_CLK.mmc2_clk, 43, NC (SD_CLK) */
0x164 (PIN_INPUT_PULLUP | MUX_MODE7) /* ecap0_in_pwm0_out, 60, NC (SD_DET) */
0x11c (PIN_INPUT_PULLUP | MUX_MODE7) /* MII1_TXD3.gpio0_16, 31, NC (SD_Power) */
>;

};
};

&mmc3 {
pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins>;
vmmc-supply = <&vmmcsd_fixed1>;
max-frequency = <50000000>;
dmas = <&edma_xbar 12 0 0
&edma_xbar 13 0 0>;
dma-names = "tx", "rx";
status = "okay";
bus-width = <1>;
disable-wp;
cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; /* ecap0_in_pwm0_out, 60, NC (SD_DET) */
mmc-reply-go-idle;
};

* Debug message log from dmsg:

root@etamin:~# dmesg | grep mmc
[ 1.117419] omap_hsmmc 48060000.mmc: GPIO lookup for consumer cd
[ 1.117445] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
[ 1.117487] of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/ocp/mmc@48060000[0]' - status (0)
[ 1.117593] omap_hsmmc 48060000.mmc: Got CD GPIO
[ 1.122459] omap_hsmmc 48060000.mmc: GPIO lookup for consumer wp
[ 1.122471] omap_hsmmc 48060000.mmc: using device tree for GPIO lookup
[ 1.122485] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@48060000[0]'
[ 1.122500] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@48060000[0]'
[ 1.122513] omap_hsmmc 48060000.mmc: using lookup tables for GPIO lookup
[ 1.122526] omap_hsmmc 48060000.mmc: lookup for GPIO wp failed
[ 1.122650] omap_hsmmc 48060000.mmc: context is restored: restore count 1
[ 1.122664] omap_hsmmc 48060000.mmc: enabled
[ 1.123023] omap_hsmmc 48060000.mmc: unable to get vmmc_aux regulator -19
[ 1.123047] omap_hsmmc 48060000.mmc: unable to get pbias regulator -19
[ 1.124188] mmc0: clock 0Hz busmode 2 powermode 1 cs 0 Vdd 21 width 0 timing 0
[ 1.124236] omap_hsmmc 48060000.mmc: Initial signal voltage of 3.3v
[ 1.143628] mmc0: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
[ 1.163772] mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
[ 1.170745] mmc0: starting CMD52 arg 00000c00 flags 00000195
[ 1.171142] mmc0: req done (CMD52): -110: 00000000 00000000 00000000 00000000
[ 1.171221] omap_hsmmc 47810000.mmc: GPIO lookup for consumer cd
[ 1.171237] omap_hsmmc 47810000.mmc: using device tree for GPIO lookup
[ 1.171277] of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/ocp/mmc@47810000[0]' - status (0)
[ 1.171302] omap_hsmmc 47810000.mmc: Got CD GPIO
[ 1.176269] omap_hsmmc 47810000.mmc: GPIO lookup for consumer wp
[ 1.176285] omap_hsmmc 47810000.mmc: using device tree for GPIO lookup
[ 1.176301] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@47810000[0]'
[ 1.176315] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@47810000[0]'
[ 1.176328] omap_hsmmc 47810000.mmc: using lookup tables for GPIO lookup
[ 1.176341] omap_hsmmc 47810000.mmc: lookup for GPIO wp failed
[ 1.176481] omap_hsmmc 47810000.mmc: context is restored: restore count 1
[ 1.176496] omap_hsmmc 47810000.mmc: enabled
[ 1.176807] omap_hsmmc 47810000.mmc: unable to get vmmc_aux regulator -19
[ 1.176830] omap_hsmmc 47810000.mmc: unable to get pbias regulator -19
[ 1.177127] mmc0: starting CMD52 arg 80000c08 flags 00000195
[ 1.177211] mmc1: clock 0Hz busmode 2 powermode 1 cs 0 Vdd 21 width 0 timing 0
[ 1.177239] omap_hsmmc 47810000.mmc: Initial signal voltage of 3.3v
[ 1.177526] mmc0: req done (CMD52): -110: 00000000 00000000 00000000 00000000
[ 1.177570] mmc0: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0
[ 1.178589] mmc0: starting CMD0 arg 00000000 flags 000000c0
[ 1.178758] mmc0: req done (CMD0): 0: 00000000 00000000 00000000 00000000
[ 1.179784] mmc0: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
[ 1.180800] mmc0: starting CMD8 arg 000001aa flags 000002f5
[ 1.181165] mmc0: req done (CMD8): -110: 00000000 00000000 00000000 00000000
[ 1.181189] mmc0: starting CMD5 arg 00000000 flags 000002e1
[ 1.181560] mmc0: req failed (CMD5): -110, retrying...
[ 1.181928] mmc0: req failed (CMD5): -110, retrying...
[ 1.182295] mmc0: req failed (CMD5): -110, retrying...
[ 1.182657] mmc0: req done (CMD5): -110: 00000000 00000000 00000000 00000000
[ 1.182681] mmc0: starting CMD55 arg 00000000 flags 000000f5
[ 1.183045] mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
[ 1.183066] mmc0: starting CMD55 arg 00000000 flags 000000f5
[ 1.183430] mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
[ 1.183451] mmc0: starting CMD55 arg 00000000 flags 000000f5
[ 1.183819] mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
[ 1.183844] mmc0: starting CMD55 arg 00000000 flags 000000f5
[ 1.184208] mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000
[ 1.184234] mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
[ 1.184253] mmc0: starting CMD1 arg 00000000 flags 000000e1
[ 1.184558] mmc0: req done (CMD1): 0: 00ff8080 00000000 00000000 00000000
[ 1.184585] mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
[ 1.184603] mmc0: clock 400000Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0
[ 1.185615] mmc0: starting CMD0 arg 00000000 flags 000000c0
[ 1.185778] mmc0: req done (CMD0): 0: 00000000 00000000 00000000 00000000
[ 1.186797] mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
[ 1.187810] mmc0: starting CMD1 arg 40200000 flags 000000e1
[ 1.188115] mmc0: req done (CMD1): 0: 00ff8080 00000000 00000000 00000000
[ 1.193544] mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
[ 1.203572] mmc0: starting CMD1 arg 40200000 flags 000000e1
[ 1.203884] mmc0: req done (CMD1): 0: c0ff8080 00000000 00000000 00000000
[ 1.203908] mmc0: starting CMD2 arg 00000000 flags 00000067
[ 1.204436] mmc0: req done (CMD2): 0: 13014e52 314a3536 4c1111d5 a090c2e1
[ 1.204465] mmc0: starting CMD3 arg 00010000 flags 00000015
[ 1.204770] mmc0: req done (CMD3): 0: 00000500 00000000 00000000 00000000
[ 1.204793] mmc0: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
[ 1.204812] mmc0: starting CMD9 arg 00010000 flags 00000007
[ 1.205338] mmc0: req done (CMD9): 0: d04f0132 0f5913ff ffffffef 8a4000bf
[ 1.205364] mmc0: starting CMD7 arg 00010000 flags 00000015
[ 1.205670] mmc0: req done (CMD7): 0: 00000700 00000000 00000000 00000000
[ 1.205712] mmc0: starting CMD8 arg 00000000 flags 000000b5
[ 1.205728] mmc0: blksz 512 blocks 1 flags 00000200 tsac 400 ms nsac 1000
[ 1.221959] mmc0: req done (CMD8): 0: 00000900 00000000 00000000 00000000
[ 1.221966] mmc0: 512 bytes transferred: 0
[ 1.222027] mmc0: MAN_BKOPS_EN bit is not set
[ 1.227515] mmc0: starting CMD6 arg 03af0101 flags 0000049d
[ 1.232689] mmc0: req done (CMD6): 0: 00000800 00000000 00000000 00000000
[ 1.232722] mmc0: starting CMD13 arg 00010000 flags 00000195
[ 1.239198] mmc0: req done (CMD13): 0: 00000900 00000000 00000000 00000000
[ 1.239335] mmc0: starting CMD6 arg 03220101 flags 0000049d
[ 1.246699] mmc0: req done (CMD6): 0: 00000800 00000000 00000000 00000000
[ 1.246789] mmc0: starting CMD13 arg 00010000 flags 00000195
[ 1.254433] mmc0: req done (CMD13): 0: 00000900 00000000 00000000 00000000
[ 1.254571] mmc0: starting CMD6 arg 03b90101 flags 0000049d
[ 1.255106] mmc0: req done (CMD6): 0: 00000800 00000000 00000000 00000000
[ 1.255141] mmc0: starting CMD13 arg 00010000 flags 00000195
[ 1.260787] mmc0: req done (CMD13): 0: 00000900 00000000 00000000 00000000
[ 1.260815] mmc0: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 1
[ 1.260840] mmc0: clock 52000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 1
[ 1.260861] mmc0: starting CMD6 arg 03b70201 flags 0000049d
[ 1.265527] mmc0: req done (CMD6): 0: 00000800 00000000 00000000 00000000
[ 1.265637] mmc0: starting CMD13 arg 00010000 flags 00000195
[ 1.265669] mmc0: req done (CMD13): 0: 00000900 00000000 00000000 00000000
[ 1.265804] mmc0: clock 52000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 3 timing 1
[ 1.265828] mmc0: starting CMD8 arg 00000000 flags 000000b5
[ 1.265842] mmc0: blksz 512 blocks 1 flags 00000200 tsac 400 ms nsac 1000
[ 1.270717] mmc0: req done (CMD8): 0: 00000900 00000000 00000000 00000000
[ 1.270724] mmc0: 512 bytes transferred: 0
[ 1.270765] mmc0: starting CMD6 arg 03a10101 flags 0000049d
[ 1.271439] mmc0: req done (CMD6): 0: 00000800 00000000 00000000 00000000
[ 1.271517] mmc0: starting CMD13 arg 00010000 flags 00000195
[ 1.271549] mmc0: req done (CMD13): 0: 00000900 00000000 00000000 00000000
[ 1.271576] mmc0: starting CMD6 arg 03210101 flags 0000049d
[ 1.277924] mmc0: req done (CMD6): 0: 00000800 00000000 00000000 00000000
[ 1.278073] mmc0: starting CMD13 arg 00010000 flags 00000195
[ 1.278108] mmc0: req done (CMD13): 0: 00000900 00000000 00000000 00000000
[ 1.278249] mmc0: new high speed MMC card at address 0001
[ 1.294799] mmcblk0: mmc0:0001 R1J56L 6.88 GiB
[ 1.299889] mmcblk0boot0: mmc0:0001 R1J56L partition 1 16.0 MiB
[ 1.319522] omap_hsmmc 47810000.mmc: disabled
[ 1.319869] mmcblk0boot1: mmc0:0001 R1J56L partition 2 16.0 MiB
[ 1.327069] mmc0: starting CMD18 arg 00000000 flags 000000b5
[ 1.327092] mmc0: blksz 512 blocks 8 flags 00000200 tsac 400 ms nsac 1000
[ 1.327103] mmc0: CMD12 arg 00000000 flags 00000095
[ 1.331909] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
[ 1.331916] mmc0: 4096 bytes transferred: 0
[ 1.331923] mmc0: (CMD12): 0: 00000b00 00000000 00000000 00000000
[ 1.332153] mmc0: starting CMD18 arg 00340800 flags 000000b5
[ 1.332170] mmc0: blksz 512 blocks 8 flags 00000200 tsac 400 ms nsac 1000
[ 1.332182] mmc0: CMD12 arg 00000000 flags 00000095
[ 1.336973] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
[ 1.336987] mmc0: 4096 bytes transferred: 0
[ 1.336998] mmc0: (CMD12): 0: 00000b00 00000000 00000000 00000000
[ 1.337159] mmc0: starting CMD18 arg 00be0008 flags 000000b5
[ 1.337175] mmc0: blksz 512 blocks 8 flags 00000200 tsac 400 ms nsac 1000
[ 1.337187] mmc0: CMD12 arg 00000000 flags 00000095
[ 1.344198] mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
[ 1.344211] mmc0: 4096 bytes transferred: 0
[ 1.344223] mmc0: (CMD12): 0: 00000b00 00000000 00000000 00000000
[ 1.344288] mmcblk0: p1 p2 p3 p4 < p5 p6 >
[ 1.358271] omap_hsmmc 47810000.mmc: enabled
[ 1.358305] mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
[ 1.372801] mmc1: starting CMD52 arg 00000c00 flags 00000195
[ 1.372930] mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
[ 1.373809] mmc1: starting CMD52 arg 80000c08 flags 00000195
[ 1.373916] mmc1: req done (CMD52): -110: 00000000 00000000 00000000 00000000
[ 1.373952] mmc1: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0
[ 1.374970] mmc1: starting CMD0 arg 00000000 flags 000000d5
[ 1.375053] mmc1: req done (CMD0): -110: 00000000 00000000 00000000 00000000
[ 1.384708] mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0
[ 1.385734] mmc1: starting CMD8 arg 000001aa flags 000002f5
[ 1.385831] mmc1: req done (CMD8): -110: 00000000 00000000 00000000 00000000
[ 1.386023] mmc1: starting CMD5 arg 00000000 flags 000002e1
[ 1.386128] mmc1: req failed (CMD5): -110, retrying...
[ 1.386225] mmc1: req failed (CMD5): -110, retrying...
[ 1.386312] mmc1: req failed (CMD5): -110, retrying...
[ 1.386397] mmc1: req done (CMD5): -110: 00000000 00000000 00000000 00000000
[ 1.386427] mmc1: starting CMD55 arg 00000000 flags 000000f5
[ 1.386507] mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
[ 1.386531] mmc1: starting CMD55 arg 00000000 flags 000000f5
[ 1.386618] mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
[ 1.386644] mmc1: starting CMD55 arg 00000000 flags 000000f5
[ 1.386729] mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
[ 1.386754] mmc1: starting CMD55 arg 00000000 flags 000000f5
[ 1.386835] mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000
[ 1.386864] mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
[ 1.386884] mmc1: starting CMD1 arg 00000000 flags 000000e1
[ 1.386966] mmc1: req done (CMD1): -110: 00000000 00000000 00000000 00000000
[ 1.386996] mmc1: clock 0Hz busmode 2 powermode 0 cs 0 Vdd 0 width 0 timing 0
[ 1.453836] omap_hsmmc 48060000.mmc: disabled
[ 1.483554] omap_hsmmc 47810000.mmc: disabled

Any ideas?

Thanks

Sam

 

  • Sam,

    Samuel Egli said:
    With a different cpu board that connects to the same sdcard on the main board but uses mmc1 instance on the cpu board it works fine.

    From what I understand, MMC1/0x481D8000 is working fine on your AM335x custom board, while MMC2/0x47810000 fails. You can dump MMC1 and MMC2 registers and compare the values for differences.

    Samuel Egli said:
    * Linux Kernel version: v4.4.97

    This kernel is not supported by TI. If you can switch to kernel that is coming with AM335x TI PSDK we can be in better help. The latest 4.4.x kernel supported by TI is 4.4.41 and is coming with PSDK v3.03 (link below):

    You can also use 4.9.x kernels and 4.14.40

    Note also that for booting, you can use MMC0 or MMC1, but not MMC2.

    Check also what values you have in CM_PER_MMC2_CLKCTRL and MMC2 Control Module pinmux registers. Check these with devmem2 tool in user space, as some other code might overwrite these settings in kernel.

    Samuel Egli said:
    bus-width = <1>;

    As you are using 4 data lines (mmc2_dat0 to mmc2_dat3), this should be "bus-width = <4>"

    Regards,
    Pavel

  • Hi Pavel,

    thanks for your reply. Interesting point that we cannot boot from MMC2. That was actually the intent. So I can save myself the effort to check what is wrong.

    Regards

    Sam

  • Sam,

    Only MMC0 and MMC1 are supported by AM335x ROM Code, thus you can only boot from these MMC instances. For more info, check AM335x TRM, section 26.1.8.5 MMC / SD Cards

    Regards,
    Pavel