Usdhc2 not working on Yocto Rocko

Hi everyone:

I have an Colibri iMX6 expansion board that has wl18xx connected to usdhc2.

My image is based on meta-toradex-nxp.git, Rocko branch, linux-toradex_4.9-1.0.x

When booted up, the kernel gives me

[ 2.000020] sdhci-esdhc-imx 2194000.usdhc: sdhci_pltfm_init failed -12
[ 2.014988] sdhci-esdhc-imx: probe of 2194000.usdhc failed with error -12

I put this in my device tree.

/ {
	mmc2_pwrseq: mmc2_pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&gpio3 24 GPIO_ACTIVE_LOW>, /* WiFi Bluetooth enable pins */
					<&gpio3 23 GPIO_ACTIVE_LOW>;
	};
};

&usdhc2 {
	status = "okay";
	label = "SDIO";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usdhc2>;
	mmc-pwrseq = <&mmc2_pwrseq>;
	keep-power-in-suspend;
	enable-sdio-wakeup;
	non-removable;
	cap-power-off-card;
	no-1-8-v;
	#address-cells = <1>;
	#size-cells = <0>;

	wlcore@0 {
		compatible = "ti,wl1835";
		reg = <0x2>;
		interrupt-parent = <&gpio3>;
		interrupts = <25 IRQ_TYPE_EDGE_RISING>;
	};
};

usdhc {
	pinctrl_usdhc2: usdhc2grp {
		fsl,pins = <
			MX6QDL_PAD_SD2_CMD__SD2_CMD	0x17069
			MX6QDL_PAD_SD2_CLK__SD2_CLK	0x10069
			MX6QDL_PAD_SD2_DAT0__SD2_DATA0	0x17069
			MX6QDL_PAD_SD2_DAT1__SD2_DATA1	0x17069
			MX6QDL_PAD_SD2_DAT2__SD2_DATA2	0x17069
			MX6QDL_PAD_SD2_DAT3__SD2_DATA3	0x17069
			MX6QDL_PAD_EIM_D25__GPIO3_IO25	0x13059
			MX6QDL_PAD_EIM_D24__GPIO3_IO24	0x13059
			MX6QDL_PAD_EIM_D23__GPIO3_IO23	0x13059
		>;
	};
};

The same device tree works for Morty branch.

Menuconfig:

MMC_SDHCI [=y]

MMC_SDHCI_ESDHC_IMX [=y]

Even when I only put this in device tree, it still gives me the same error.

&usdhc2 {
	status = "okay";
};

Anybody know what might be the problem? Thanks

Which carrier board are you using?

I’m using Gumstix Colibri iMX6 Dev Board
https://store.gumstix.com/development-boards/colibri/colibri-imx6-dev-board.html

Thanks for the Information.

Could you provide the complete device tree files and complete dmesg log?
Did you update the device tree files to the kernel 4.9 also?

I attached dts, dtb and dmesg file.

In the dts file I included imx6dl.dtsi and imx6qdl-colibri.dtsi, the files are from 4.9 kernel. Thanks

Attachment

Hi

It looks like there is a bug in the 4.9 kernel if you do not propose an alias for mmc2.
Adding the following to the alias node should fix the issue:

mmc2 = &usdhc2;

Max

Thank you very much, that fix the issue. I just wondering why is that necessary to make usdhc2 working?

Welcome.

With ‘there is a bug in the 4.9 kernel’ I meant ‘there is bug in the4.9 kernel which reveals itself if you do not alias all usdhc instances you create’.

Note that that there is a commit in our -next branch which fixes it. However I guess that adding ‘mmc2 = &usdhc2;’ is the easier fix for you.