This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335X内核移植中的SD卡驱动问题

SDK版本为8.0,启动后打印log

[    1.693930] mousedev: PS/2 mouse device common for all mice
[    1.699960] i2c /dev entries driver
[    1.705907] omap_hsmmc 48060000.mmc: Got CD GPIO
[    1.746774] ledtrig-cpu: registered to indicate activity on CPUs
[    1.754566] oprofile: using arm/armv7
[    1.759592] Initializing XFRM netlink socket
[    1.764633] NET: Registered protocol family 10
[    1.774912] sit: IPv6 over IPv4 tunneling driver
[    1.782636] NET: Registered protocol family 17
[    1.787507] NET: Registered protocol family 15
[    1.792659] Key type dns_resolver registered
[    1.797426] omap_voltage_late_init: Voltage driver support not added
[    1.804085] sr_dev_init: No voltage domain specified for smartreflex0. Cannot initialize
[    1.812592] sr_dev_init: No voltage domain specified for smartreflex1. Cannot initialize
[    1.822562] ThumbEE CPU extension supported.
[    1.827207] Registering SWP/SWPB emulation handler
[    1.832240] SmartReflex Class3 initialized
[    1.848085] omap_hsmmc 48060000.mmc: no support for card's volts
[    1.854393] mmc0: error -22 whilst initialising SD card
[    1.861362] omap-gpmc 50000000.gpmc: GPMC revision 6.0
[    1.867151] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000

mmc0: error -22 whilst initialising SD card这是什么原因导致的?

  • 请问这是TI开发板上的log还是您自己板子上的log?

  •  查查您的硬件, 看是不是线记错了,您可以参考 http://www.friendlyarm.net/forum/topic/867 

  • 3年后, 遇到相同问题, 记录帮助后面的同志们

    原因如下:

    dts中mmc没有设置 vmmc-supply的值

    因为我们的硬件sd上一直有电的,所以我把这个vmmc-supply删除了,觉得没有什么用.

    但是代码中

    omap_hsmmc_reg_get

         -> mmc_regulator_get_supply

             -> mmc_regulator_get_ocrmask 这里会去解析vmmc-supply相关的东西

            解析ok的话 会对mmc->ocr_avail赋值

    这个值不对的话

    其实在后面还有这样一句

    if (!mmc->ocr_avail)
          mmc->ocr_avail = mmc_pdata(host)->ocr_mask;

    不幸的是 ocr_mask 也是空

    于是mmc->ocr_avail为空就会打印

    omap_hsmmc 48060000.mmc: no support for card's volts

    对于不需要上下电的sd来说 vmmc-supply可以这样设置

    &mmc1 {
        status = "okay";
        bus-width = <4>;
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
        vmmc-supply = <&vmmcsd_fixed>;
        broken-cd;
    };

    / {

       .......

        vmmcsd_fixed: fixedregulator0 {
            compatible = "regulator-fixed";
            regulator-name = "vmmcsd_fixed";
            regulator-min-microvolt = <3300000>;
            regulator-max-microvolt = <3300000>;
        };  
    };