• SD卡报错“error -110 whilst initialising SD card”


    目前开发遇到了某些SD卡和TI的SOC芯片的驱动不协调的地方,具体表现为:

    uboot 阶段初始化mmc dev 1 没有任何串口信息输出,无法读写mmc

    Kernel阶段报错”SD卡初始化失败 error -110 whilst initialising SD card“

    具体的原因是SD的某些CMD操作不支持,返回-110的错误,需要

    uboot阶段,在dts中屏蔽掉:

    main_sdhci1: sdhci@4fb0000 {
    ti,otap-del-sel-legacy = <0x2>;
    /*ti,otap-del-sel-sd-hs = <0xf>;
    ti,otap-del-sel-sdr12 = <0xf>;
    ti,otap-del-sel-sdr25 = <0xf>;
    ti,otap-del-sel-sdr50 = <0xc>;
    ti,otap-del-sel-sdr104 = <0x5>;
    ti,otap-del-sel-ddr50 = <0xc>;
    sdhci-caps-mask = <0x2 0x0>;*/
    dma-coherent;
    };

    Kernel阶段,在drivers/mmc/host/sdhci.c 的函数 void __sdhci_read_caps 中添加:

    host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;

    主要是使能SDHCI_QUIRK2_NO_1_8_V

    if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V) {
       host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 |
       SDHCI_SUPPORT_DDR50);
       /*
            * The SDHCI controller in a SoC might support HS200/HS400
            * (indicated using mmc-hs200-1_8v/mmc-hs400-1_8v dt property),
            * but if the board is modeled such that the IO lines are not
            * connected to 1.8v then HS200/HS400 cannot be supported.
            * Disable HS200/HS400 if the board does not have 1.8v connected
            * to the IO lines. (Applicable for other modes in 1.8v)
             */
             mmc->caps2 &= ~(MMC_CAP2_HSX00_1_8V | MMC_CAP2_HS400_ES);
             mmc->caps &= ~(MMC_CAP_1_8V_DDR | MMC_CAP_UHS);
    }

    重新编译u-boot和Kernel解决SD卡问题。

  • 相关阅读:
    安卓9.0内测的背后,是上万App开发者半年来的适配优化
    错误记录:vue跟vue编译器版本不一致
    jspdf简单使用
    vue input添加回车触发
    vue watch bug记录
    SecureCRT通过拷贝配置文件登陆
    仿射变换
    opencv图像的旋转
    图像旋转的原理
    CvScalar
  • 原文地址:https://www.cnblogs.com/hutiann/p/12377529.html
Copyright © 2020-2023  润新知