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.

AM335x MMC3 (MMC2) in SDK 2.0

Expert 2730 points

I have a problem with MMC3, which is the only one MMC on our custom board. It was "working" with SDK 1.0. With the SDK1.0 we had a problem because we don'T have any card detection pin and broken-cd didn't work. So we decided to try with the SDK 2.0 and kernel 4.1. The dts file for the MMC3 is the same in both cases:

mmc3_pins_default: pinmux_mmc3_pins {
		pinctrl-single,pins = <
			0x03C (PIN_INPUT_PULLUP	| MUX_MODE3)   	/* gpmc_ad15.mmc2_dat3 */
			0x038 (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_ad14.mmc2_dat2 */
			0x034 (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_ad13.mmc2_dat1 */
			0x030 (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_ad12.mmc2_dat0 */
			0x08C (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_clk.mmc2_clk */
			0x088 (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_csn3.mmc2_cmd */
			
		>;
	};

&mmc3 {
	status = "okay";
	/* these are on the crossbar and are outlined in the
	   xbar-event-map element */
	dmas = <&edma 12
		&edma 13>;
	dma-names = "tx", "rx";
	bus-width = <4>;
	pinctrl-names = "default";
	pinctrl-0 = <&mmc3_pins_default>;
	ti,needs-special-hs-handling;
	ti,dual-volt;
	broken-cd;
};

With the SDK 2.0 I won't get any mmcblk0p to /dev and dmesg shows the following errors for the MMC:

[    1.253479] omap_hsmmc 47810000.mmc: GPIO lookup for consumer cd
[    1.253495] omap_hsmmc 47810000.mmc: using device tree for GPIO lookup
[    1.253509] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@47810000[0]'
[    1.253518] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@47810000[0]'
[    1.253527] omap_hsmmc 47810000.mmc: using lookup tables for GPIO lookup
[    1.253536] omap_hsmmc 47810000.mmc: lookup for GPIO cd failed
[    1.253546] omap_hsmmc 47810000.mmc: GPIO lookup for consumer wp
[    1.253554] omap_hsmmc 47810000.mmc: using device tree for GPIO lookup
[    1.253562] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@47810000[0]'
[    1.253570] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@47810000[0]'
[    1.253578] omap_hsmmc 47810000.mmc: using lookup tables for GPIO lookup
[    1.253585] omap_hsmmc 47810000.mmc: lookup for GPIO wp failed
[    1.254079] /ocp/mmc@47810000: voltage-ranges unspecified
[    1.289396] omap_hsmmc: probe of 47810000.mmc failed with error -22

Any ideas how I can make this work?

BR

JHi

  • I will ask the Linux team to look at this.
  • Hi,

    I tested this on my BBB, running SDK2.0 (kernel 4.1) and the device booted fine. There were no warnings like: of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@47810000[0]'.

    Also another thing to have in mind is that your omap_hsmmc driver has no problem with the mmc3 (&mmc dts node that you shared). The address reported in your bootlog mmc@47810000 is MMC2. So your problem is with the &mmc2 dts node. I am not sure why you use mmc2 pins on &mmc3 dts node, but this misalignment may be the root cause of your bootlog errors.

    Best Regards,
    Yordan
  • Hi and thanks for the answer, unfortunately what you write is not correct. In dts MMC1 = MMC0-peripheral, MMC2 = MMC1-peripheral and MMC3=MMC2-peripheral. That's why I wrote on the topic MMC3 (MMC2). The question is what am I doing wrong in my dts file if it works in your BBB? With exactly same dts it works with older SDK.

    BR

    JHi

  • Am I again the only one with this problem? The mmc-driver has been completely changed from the version which worked (SDK 1.0), so I can't use the old one also. Can you even give me hints what I could try?

    BR

    JHi

  • Problem solved!

    I had to add regulator for mmc:

    vmmcsd_fixed: fixedregulator@0 {
    		compatible = "regulator-fixed";
    		regulator-name = "vmmcsd_fixed";
    		regulator-min-microvolt = <3300000>;
    		regulator-max-microvolt = <3300000>;
    	};
    &mmc3 {
    	status = "okay";
    	/* these are on the crossbar and are outlined in the
    	   xbar-event-map element */
    	dmas = <&edma 12
    		&edma 13>;
    	dma-names = "tx", "rx";
    	bus-width = <4>;
    	pinctrl-names = "default", "sleep";
    	pinctrl-0 = <&mmc3_pins_default>;
    	pinctrl-1 = <&mmc3_pins_sleep>;
    	ti,needs-special-hs-handling;
    	ti,dual-volt;
    	vmmc-supply = <&vmmcsd_fixed>;
    	broken-cd;
    };
    

    BR

    JHi