c - OMAP3 上奇怪的 SD 卡是 omap_hsmmc 驱动程序吗?

标签 c kernel driver embedded-linux sd-card

出于某种原因,在几乎任何 Windows/Mac/Linux 机器上工作的卡在我们的嵌入式板上无法工作。更糟糕的是,我们有相同的卡可以正常工作!我研究了 omap_hsmmc 驱动程序(内核 2.6.32)并尝试了各种更改,例如降低时钟速率以启用 SPI 模式等,但没有成功。

这是工作卡的输出(之前的命令相同):

mmc0: clock 24000000Hz busmode 2 powermode 2 cs 0 Vdd 16 width 2 timing 2
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address 59b4
mmcblk0: mmc0:59b4 SD    7.35 GiB 
 mmcblk0:
mmc0: starting CMD18 arg 00000000 flags 000000b5
mmc0:     blksz 512 blocks 8 flags 00000200 tsac 100 ms nsac 0
mmc0:     CMD12 arg 00000000 flags 0000049d
mmci-omap-hs mmci-omap-hs.0: mmc0: CMD18, argument 0x00000000
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 1
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 2
mmci-omap-hs mmci-omap-hs.0: mmc0: CMD12, argument 0x00000000
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 3
mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
mmc0:     4096 bytes transferred: 0
mmc0:     (CMD12): 0: 00000b00 00000000 00000000 00000000
 p1 p2
mmci-omap-hs mmci-omap-hs.0: mmc_fclk: disabled
mmci-omap-hs mmci-omap-hs.0: mmc_fclk: enabled
mmci-omap-hs mmci-omap-hs.0: context was not lost
mmc0: starting CMD18 arg 000234cb flags 000000b5
mmc0:     blksz 512 blocks 2 flags 00000200 tsac 100 ms nsac 0
mmc0:     CMD12 arg 00000000 flags 0000049d
mmci-omap-hs mmci-omap-hs.0: mmc0: CMD18, argument 0x000234cb
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 1
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 2
mmci-omap-hs mmci-omap-hs.0: mmc0: CMD12, argument 0x00000000
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 3

还有坏卡:

mmc0: clock 24000000Hz busmode 2 powermode 2 cs 0 Vdd 16 width 2 timing 2
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address 59b4
mmcblk0: mmc0:59b4 SD    7.35 GiB 
 mmcblk0:
mmc0: starting CMD18 arg 00000000 flags 000000b5
mmc0:     blksz 512 blocks 8 flags 00000200 tsac 100 ms nsac 0
mmc0:     CMD12 arg 00000000 flags 0000049d
mmci-omap-hs mmci-omap-hs.0: mmc0: CMD18, argument 0x00000000
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 1
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 208002
mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x208002 : TC ERRI DCRC
mmci-omap-hs mmci-omap-hs.0: mmc0: CMD12, argument 0x00000000
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 3
mmc0: req done (CMD18): 0: 00000900 00000000 00000000 00000000
mmc0:     0 bytes transferred: -84
mmc0:     (CMD12): 0: 00000b00 00000000 00000000 00000000
mmcblk0: retrying using single block read
mmc0: starting CMD17 arg 00000000 flags 000000b5
mmc0:     blksz 512 blocks 1 flags 00000200 tsac 100 ms nsac 0
mmci-omap-hs mmci-omap-hs.0: mmc0: CMD17, argument 0x00000000
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 1
mmci-omap-hs mmci-omap-hs.0: IRQ Status is 208002
mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x208002 : TC ERRI DCRC
mmc0: req done (CMD17): 0: 00000900 00000000 00000000 00000000
mmc0:     0 bytes transferred: -84

看起来多 block DMA 传输失败 (CMD18),因此驱动程序尝试单 block 传输,但也失败了。

我应该看什么?如果还有什么我可以尝试使用这个驱动程序吗?另外“MMC IRQ 0x208002:TC ERRI DCRC”是什么意思?

最佳答案

问题是在 4 位数据模式下连接不良。

关于c - OMAP3 上奇怪的 SD 卡是 omap_hsmmc 驱动程序吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26678128/

相关文章:

C pthread 段错误

Windows 内核级全局临界区

thread-safety - ARM中的原子操作

kernel - 向 user_struct 添加另一个字段

linux - Linux 驱动程序上下文中的微秒延迟和自旋锁

c - 如何解决这个IP地址错误?

c - 在没有指针的情况下返回 C 中的字符串?

c - 使用驱动程序从特定位置读取 RAM 数据?

c++ - ram 中的共享内存或命名管道?

python - pyodbc 与 DB2 的连接