大家有用过AM335X的MMC2么?我在用MMC2接SDIO的无线网卡的时候遇到一个比较奇怪的问题,请各位大神帮忙一下。
我把SDIO无线网卡接到MMC0(4bit)上,可以正在启动与使用,问题是我接到MMC2的时候,使用4bit的模式,就总是出错,dmesg里面可以看到发现了一个高速的SDIO卡,但是在后面加载相应的驱动的时候就出错了。
[ 7.304351] mwifiex_sdio mmc1:0001:1: poll card status failed, tries = 0
[ 7.313867] mwifiex_sdio mmc1:0001:1: FW download with helper: poll status timeout @ 6336
[ 7.324761] mwifiex_sdio mmc1:0001:1: prog_fw failed ret=0xffffffff
同样的代码,如果我把4bit改为1bit模式的话,驱动就可以正常运行。。。奇怪的问题
而且我把MMC2接到一个可以引导启动的TF卡,如果是1bit模式,则可以正常的挂载启动,如果是4bit模式的话,它可以识别出卡的大小,但是是最后会挂载失败,下面简要的列一些log:
[ 2.012293] omap_hsmmc mmc.6: of_parse_phandle_with_args of 'reset' failed
[ 2.019563] omap_hsmmc mmc.6: Failed to get rstctl; not using any
[ 2.026205] edma-dma-engine edma-dma-engine.0: allocated channel for 0:33
[ 2.033447] edma-dma-engine edma-dma-engine.0: allocated channel for 0:32
[ 2.040700] mmc.6 supply vmmc_aux not found, using dummy regulator
[ 2.047297] omap_hsmmc mmc.6: pins are not configured from the driver
[ 2.329523] mmc1: new high speed SDHC card at address aaaa
[ 2.335808] registered taskstats version 1
[ 2.340626] mmcblk0: mmc1:aaaa SU04G 3.69 GiB[ 2.346801] tilcdc 4830e000.fb: No power control GPIO
[ 4.068705] mmcblk0: error -110 sending status command, retrying
[ 4.075213] mmcblk0: timed out sending r/w cmd command, card status 0x800b00
[ 4.083291] mmcblk0: error -110 sending status command, retrying
[ 4.089633] mmcblk0: timed out sending r/w cmd command, card status 0x800b00
[ 4.097521] mmcblk0: error -110 sending status command, retrying
[ 4.103851] mmcblk0: timed out sending r/w cmd command, card status 0x800b00
[ 4.111761] mmcblk0: timed out sending r/w cmd command, card status 0x800b00
[ 4.119740] mmcblk0: error -110 sending status command, retrying
[ 4.126070] mmcblk0: timed out sending r/w cmd command, card status 0x800b00
[ 4.133950] mmcblk0: error -110 sending status command, retrying
[ 4.140304] mmcblk0: timed out sending r/w cmd command, card status 0x800b00
[ 4.147697] end_request: I/O error, dev mmcblk0, sector 0
[ 4.153355] Buffer I/O error on device mmcblk0, logical block 0
[ 4.160292] mmcblk0: error -110 sending status command, retrying
[ 4.166662] mmcblk0: timed out sending r/w cmd command, card status 0x800b00
[ 4.174660] mmcblk0: timed out sending r/w cmd command, card status 0x800b00
[ 4.182766] mmcblk0: unable to read partition table
[ 4.188321] tilcdc 4830e000.fb: found TDA19988
[ 4.193837] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[ 4.200811] [drm] No driver support for vblank timestamp query.
[ 4.207294] tilcdc 4830e000.fb: No connectors reported connected with modes
[ 4.214614] [drm] Cannot find any crtc or sizes – going 1024×768
[ 4.229756] Console: switching to colour frame buffer device 128×48
[ 4.242117] tilcdc 4830e000.fb: fb0: frame buffer device
[ 4.247833] tilcdc 4830e000.fb: registered panic notifier
[ 4.253577] [drm] Initialized tilcdc 1.0.0 20121205 on minor 0
[ 4.309020] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
[ 4.315550] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[ 4.322224] mmc2: BKOPS_EN bit is not set
[ 4.327378] libphy: 4a101000.mdio: probed
[ 4.331705] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[ 4.341540] Detected MACID = 78:a5:04:e2:59:87
[ 4.346217] cpsw 4a100000.ethernet: NAPI disabled
[ 4.353121] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:03 UTC (946684803)
[ 4.363125] mmc2: new high speed MMC card at address 0001
[ 4.372770] ALSA device list:
[ 4.378470] #0: TI BeagleBone Black
[ 4.385368] mmcblk1: mmc2:0001 MMC04G 3.60 GiB[ 4.392831] mmcblk1boot0: mmc2:0001 MMC04G partition 1 2.00 MiB
[ 4.402085] mmcblk1boot1: mmc2:0001 MMC04G partition 2 2.00 MiB
[ 4.411877] mmcblk1: p1 p2
[ 4.419106] mmcblk1boot1: unknown partition table
[ 4.427945] mmcblk1boot0: unknown partition table
[ 4.436079] VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -6
[ 4.446810] Please append a correct "root=" boot option; here are the available partitions:
[ 4.457987] b300 3872256 mmcblk0 driver: mmcblk
[ 4.466007] b308 3776512 mmcblk1 driver: mmcblk
[ 4.473982] b309 307200 mmcblk1p1 346d9307-01
[ 4.481955] b30a 3468288 mmcblk1p2 346d9307-02
[ 4.489952] b318 2048 mmcblk1boot1 (driver?)
[ 4.497922] b310 2048 mmcblk1boot0 (driver?)
[ 4.505854] Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(179,2)
[ 4.517096] [<c001125d>] (unwind_backtrace+0x1/0x98) from [<c04a1453>] (panic+0x5b/0x160)
[ 4.528087] [<c04a1453>] (panic+0x5b/0x160) from [<c07db94b>] (mount_block_root+0xf7/0x178)
[ 4.539250] [<c07db94b>] (mount_block_root+0xf7/0x178) from [<c07dbb09>] (mount_root+0x95/0xb0)
[ 4.550815] [<c07dbb09>] (mount_root+0x95/0xb0) from [<c07dbbef>] (prepare_namespace+0xcb/0x11c)
[ 4.562497] [<c07dbbef>] (prepare_namespace+0xcb/0x11c) from [<c049da6f>] (kernel_init+0x7/0x98)
[ 4.574201] [<c049da6f>] (kernel_init+0x7/0x98) from [<c000c7fd>] (ret_from_fork+0x11/0x34)
[ 4.585509] drm_kms_helper: panic occurred, switching back to text console
我用的是BBB,在linux-3.8.bone72的源代码与EZSDK1.0的源代码我都试过了,都会有问题,请大家告知一下,这个是硬件的问题还是BSP的问题,,,
下面是我的fdt设置:
mmc3_pins: pinmux_mmc3_pins {
pinctrl-single,pins = <
0x3c 0x23 /* gpmc_ad15.mmc2.d3, (MODE(3) | RXACTIVE | PULLUP_EN) */
0x38 0x23 /* gpmc_ad14.mmc2.d2, (MODE(3) | RXACTIVE | PULLUP_EN) */
0x34 0x23 /* gpmc_ad13.mmc2.d1, (MODE(3) | RXACTIVE | PULLUP_EN) */
0x30 0x23 /* gpmc_ad12.mmc2.d0, (MODE(3) | RXACTIVE | PULLUP_EN) */
0x8c 0x23 /* gpmc_clk.mmc2.clk, (MODE(3) | RXACTIVE | PULLUP_EN) */
0x88 0x23 /* gpmc_csn3.mmc2.cmd, (MODE(3) | RXACTIVE | PULLUP_EN) */
>;
};
&mmc3 {
pinctrl-names = "default";
pinctrl-0 = <&mmc3_pins>;
vmmc-supply = <&vmmcsd_fixed>;
bus-width = <4>;
dmas = <&edma 32 &edma 33>;
dma-names = "tx", "rx";
ti,non-removable;
status = "okay";
};
Jian Zhou:
首先确定下MMC2的硬件连接和MMC0是完全一样的,然后查一下底层驱动,是不是MMC2工作在1bit模式下了
Bing Yao:
回复 Jian Zhou:
除了没有接CD检测线之外,其它都是一样的,就CMD,CLK,DAT0~DAT3这几根线,都通过10K的电阻上拉到3.3V。
现在的问题是MMC2工作在1bit下,驱动是正常的,不管是接8787无线网卡,或是接TF卡都可以正常使用
但是4bit模式下驱动是错误的,包括直接接TF卡。
而MMC0,4bit是正常的。
Jian Zhou:
回复 Bing Yao:
AM335x的MMC接口支持1bit,4bit,8bit三种工作方式,三个MMC接口都是完全一样的,如果底层驱动没有改过,功能上也应该是一样的。
印象里CD线是不能忽略的。