wukui1008 发表于 2012-12-21 18:09

sd卡驱动测试程序mmc_test.c 使用


RT。在网上查了些资料:大致使用如下:
mount -t debugfs none /sys/kernel/debug
modprobe mmc_test
mmc_test mmc0:0001: Card claimed for testing.
echo 25 > /sys/kernel/debug/mmc0/mmc0\:0001/test
cat /sys/kernel/debug/mmc0\:0001/test


------------------------------------------------------------
mmc_test.c中mmc_driver.drv.name = "mmc_test"
但是内核里面好像没有注册一个叫"mmc_test"的设备啊

所以我加载mmc_test.ko的时候    mmc_driver.probe都没法执行

请问是怎么回事?????????????

另外 我也碰到跟楼主一样的问题,不知道mmc_test如何使用。

网上这么说
    make menuconfig --> Kernel hacking --> 选中Debug Filesystem (CONFIG_DEBUG_FS)选项。

    make menuconfig --> kernel hacking --> 选中Kernel debugging (CONFIG_DEBUG_KERNEL)选 项。

挂载debug file system

    # mount -t debugfs none /sys/kernel/debug

但是我配置好内核后 烧进去 一跑结果就死机了,郁闷   
打印如下
VFS: Mounted root (ext2 filesystem).
Freeing init memoDWC_otg: Attached device Not Supported
hub 2-0:1.0: over-current change on port 1
init started:BusyBox v1.4.2 (2011-08-10 14:44:43 CST) multi-call binary
Starting pid 934, console /dev/console: '/etc/init.d/rcS'
TCC8900_nand: module license 'Proprietary. (C) 2008 Telechips Inc.' taints kernel.



ndda:

demon19840308 发表于 2013-01-05 17:13

开发板与开发板的区别很大. 理论上 想要被调用mmc_driver.probe 必须现有一个 mmc设备. 才能触发 probe.
设备和驱动 在总线上互相配对时才会使用probe.
我建议你在 platform中创建一个mmc设备 和 mmc driver 用一样的表示,这样才能触发配对
页: [1]
查看完整版本: sd卡驱动测试程序mmc_test.c 使用