主机:vmware ubuntu16.04
SDK:ti-sdk-am335x-evm-08.00.00.00-Linux-x86-Install
am335x,自己根据EVM和EVM-SK做的板子,用SD卡启动后加载kernel,无法识别到SD卡。sdio,sd,mmc都检测失败。
2.333925] [huzz]check sdio
[ 2.339035] [huzz]check sd
[ 2.342583] [huzz]mmc_attach_sd
[ 2.347366] [huzz]check mmc
[ 2.351012] [huzz]mmc_attach_mmc
[ 2.355239] [huzz]mmc_send_op_cond+++++++++++++
[ 2.361380] [huzz]mmc_send_op_cond———-
[ 2.366982] [huzz]mmc_attach_mmc:mmc_send_op_cond failed
dts中的配置如下
&mmc1 {
status = "okay";
vmmc-supply = <&vmmc_reg>;
bus-width = <4>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&mmc0_pins_default>;
pinctrl-1 = <&mmc0_pins_sleep>;
cd-gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
};
mmc0_pins_default: mmc0_pins_default {
pinctrl-single,pins = <
0x100 ( PIN_INPUT | MUX_MODE0 ) /* (G17) mmc0_clk.mmc0_clk */
0x104 ( PIN_OUTPUT | MUX_MODE0 ) /* (G18) mmc0_cmd.mmc0_cmd */
0xfc ( PIN_INPUT | MUX_MODE0 ) /* (G16) mmc0_dat0.mmc0_dat0 */
0xf8 ( PIN_INPUT | MUX_MODE0 ) /* (G15) mmc0_dat1.mmc0_dat1 */
0xf4 ( PIN_INPUT | MUX_MODE0 ) /* (F18) mmc0_dat2.mmc0_dat2 */
0xf0 ( PIN_INPUT | MUX_MODE0 ) /* (F17) mmc0_dat3.mmc0_dat3 */
0x15c ( PIN_INPUT | MUX_MODE7 ) /* (A16) spi0_cs0.gpio0[5] */
>;
};
/* Optional sleep pin settings. Must manually enter values in the below skeleton. */
mmc0_pins_sleep: mmc0_pins_sleep {
pinctrl-single,pins = <
0x100 ( PIN_INPUT | MUX_MODE0 ) /* (G17) mmc0_clk.mmc0_clk */
0x104 ( PIN_OUTPUT | MUX_MODE0 ) /* (G18) mmc0_cmd.mmc0_cmd */
0xfc ( PIN_INPUT | MUX_MODE0 ) /* (G16) mmc0_dat0.mmc0_dat0 */
0xf8 ( PIN_INPUT | MUX_MODE0 ) /* (G15) mmc0_dat1.mmc0_dat1 */
0xf4 ( PIN_INPUT | MUX_MODE0 ) /* (F18) mmc0_dat2.mmc0_dat2 */
0xf0 ( PIN_INPUT | MUX_MODE0 ) /* (F17) mmc0_dat3.mmc0_dat3 */
>;
};
am33xx.dtsi中
添加了mmc1 = &mmc1;,本来是没有的,启动的时候没有检测到SD卡,添加了之后才有上面的log。
aliases {
i2c0 = &i2c0;
i2c2 = &i2c2;
serial0 = &uart0;
serial1 = &uart1;
serial3 = &uart3;
d_can0 = &dcan0;
d_can1 = &dcan1;
usb0 = &usb0;
usb1 = &usb1;
phy0 = &usb0_phy;
phy1 = &usb1_phy;
ethernet0 = &cpsw_emac0;
ethernet1 = &cpsw_emac1;
mmc1 = &mmc1;
};
下面的未修改
mmc1: mmc@48060000 {
compatible = "ti,omap4-hsmmc";
ti,hwmods = "mmc1";
ti,dual-volt;
ti,needs-special-reset;
ti,needs-special-hs-handling;
dmas = <&edma 24
&edma 25>;
dma-names = "tx", "rx";
interrupts = <64>;
interrupt-parent = <&intc>;
reg = <0x48060000 0x1000>;
status = "disabled";
};
Steven Liu1:
参考SK板子做的话,SD卡不是应该在MMC0上面吗?你的硬件设计SD卡是在哪个上面的?
如果是在MMC0上面,发一下你当前的MMC0相关dts配置部分。
guangyun wang:
回复 Steven Liu1:
您好!刘工。
我是在使用bbb板子,内核是3.8.13。遇到问题的现象是:sd卡和emmc要同时使用,但是文件系统要放在emmc中。这样,我起初设计环境变量uEnv.txt是“mmcroot=/dev/mmcblk1p2 ro”,但是当sd卡出了问题的时候,或者忘记插卡的时候,板子重新启动就无法找到文件系统啦!
我现在处理这个问题的思路是:修改设备树《am33xx.dtsi》:
aliases { serial0 = &uart1; serial1 = &uart2; serial2 = &uart3; serial3 = &uart4; serial4 = &uart5; serial5 = &uart6; mmc0 = &mmc2; //这两项是我后加上的 mmc1 = &mmc1; // };
。。。。。。
mmc2: mmc@481d8000 { compatible = "ti,omap3-hsmmc"; ti,hwmods = "mmc2"; ti,needs-special-reset; ti,needs-special-hs-handling; dmas = <&edma 2 &edma 3>; dma-names = "tx", "rx"; status = "disabled"; }; mmc1: mmc@48060000 { compatible = "ti,omap3-hsmmc"; ti,hwmods = "mmc1"; ti,dual-volt; ti,needs-special-reset; ti,needs-special-hs-handling; dmas = <&edma 24 &edma 25>; dma-names = "tx", "rx"; status = "disabled"; }; mmc3: mmc@47810000 { compatible = "ti,omap3-hsmmc"; ti,hwmods = "mmc3"; ti,needs-special-reset; ti,needs-special-hs-handling; status = "disabled"; };
我的目的是想让系统启动后,把emmc注册为/dev/mmcblk0设备,这样我就可以把环境变量uEnv.txt设置为“mmcroot=/dev/mmcblk0p2 ro”,不管设备有没有检测到sd卡,emmc的设备名称都不会被修改,就可以解决这个问题了。
但是我这么修改之后,重新编译内核及设备树,替换了板子中相关的zImage和am335x-boneblack.dtb文件后,板子重新上电(板子有sd卡),emmc设备名还是/dev/mmcblk1。
请问,我怎么修改才可以保证不管设备有没有检测到sd卡,emmc的设备名称都不会被修改啊???