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 mmc2问题

Other Parts Discussed in Thread: TPS65910

在设备树里面增加以下内容,然而MMC2还是未能挂载设备,还需要修改内核什么地方吗

mmc3_pins_default: pinmux_mmc3_pins {
        pinctrl-single,pins = <
            0x03c (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_ad15.mmc2_dat3 */
            0x038 (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_ad14.mmc2_dat2 */
            0x048 (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_ad13.mmc2_dat1 */
            0x044 (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_ad12.mmc2_dat0 */
            0x08c (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_clk.mmc2_clk */
            0x088 (PIN_INPUT_PULLUP | MUX_MODE3)    /* gpmc_csn3.mmc2_cmd */
            0x040 (PIN_INPUT_PULLUP | MUX_MODE7)    /* gpio1_16.mmc2_sd */
        >;
    };

    mmc3_pins_sleep: pinmux_mmc3_pins_sleep {
        pinctrl-single,pins = <
            0x03c (PIN_INPUT_PULLDOWN | MUX_MODE7)
            0x038 (PIN_INPUT_PULLDOWN | MUX_MODE7)
            0x048 (PIN_INPUT_PULLDOWN | MUX_MODE7)
            0x044 (PIN_INPUT_PULLDOWN | MUX_MODE7)
            0x08c (PIN_INPUT_PULLDOWN | MUX_MODE7)
            0x088 (PIN_INPUT_PULLDOWN | MUX_MODE7)
            0x040 (PIN_INPUT_PULLDOWN | MUX_MODE7)
        >;
    };

&mmc3 {
    status = "okay";
    vmmc-supply = <&vmmc_reg>;
    bus-width = <4>;
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&mmc3_pins_default>;
    pinctrl-1 = <&mmc3_pins_sleep>;
    cd-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
};

  • cd-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;这句话跟硬件上的引脚对应吗?把它置低试试看,cd-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>

  • 貌似有接口初始化了,挂载不上去的样子,还是识别不了SD卡


    log信息如下

    [    1.392696] omap_hsmmc 48060000.mmc: Got CD GPIO
    [    1.448570] omap_hsmmc 47810000.mmc: Got CD GPIO
    [    1.453472] omap_hsmmc 47810000.mmc: unable to obtain RX DMA engine channel 0
    [    1.489599] ledtrig-cpu: registered to indicate activity on CPUs
    [    1.495918] usbcore: registered new interface driver usbhid
    [    1.501627] usbhid: USB HID core driver
    [    1.505957]  remoteproc0: wkup_m3 is available
    [    1.510504]  remoteproc0: Note: remoteproc is still under development and considered experimental.
    [    1.519537]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [    1.530118]  remoteproc0: Direct firmware load for am335x-pm-firmware.elf failed with error -2
    [    1.540257] usbcore: registered new interface driver snd-usb-audio
    [    1.546556] usbcore: registered new interface driver snd-ua101
    [    1.552515]  remoteproc0: Falling back to user helper
    [    1.557820] usbcore: registered new interface driver snd-usb-caiaq
    [    1.564189] usbcore: registered new interface driver snd-usb-6fire
    [    1.570534] usbcore: registered new interface driver snd-usb-hiface
    [    1.576890] usbcore: registered new interface driver snd-bcd2000
    [    1.583007] usbcore: registered new interface driver snd_usb_pod
    [    1.589123] usbcore: registered new interface driver snd_usb_podhd
    [    1.595389] usbcore: registered new interface driver snd_usb_toneport
    [    1.601934] usbcore: registered new interface driver snd_usb_variax
    [    1.610109] oprofile: using arm/armv7
    [    1.613881] nf_conntrack version 0.5.0 (7932 buckets, 31728 max)
    [    1.621095] ip_tables: (C) 2000-2006 Netfilter Core Team
    [    1.626626] Initializing XFRM netlink socket
    [    1.631026] NET: Registered protocol family 17
    [    1.635520] NET: Registered protocol family 15
    [    1.640064] lib80211: common routines for IEEE802.11 drivers
    [    1.645842] Key type dns_resolver registered
    [    1.650583] omap_voltage_late_init: Voltage driver support not added
    [    1.657369] cpu cpu0: of_pm_voltdm_notifier_register: Failed to get cpu0 regulator/voltdm: -517
    [    1.666260] cpu cpu0: cpu0 clock notifier not ready, retry
    [    1.672225] ThumbEE CPU extension supported.
    [    1.676544] Registering SWP/SWPB emulation handler
    [    1.698392] tps65910 0-002d: No interrupt support, no core IRQ
    [    1.726947] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [    1.733791] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
    [    1.745951] musb-hdrc musb-hdrc.0.auto: MUSB HDRC host driver
    [    1.752106] musb-hdrc musb-hdrc.0.auto: new USB bus registered, assigned bus number 1
    [    1.760212] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    1.767034] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    1.774318] usb usb1: Product: MUSB HDRC host driver
    [    1.779321] usb usb1: Manufacturer: Linux 4.1.18 musb-hcd
    [    1.784743] usb usb1: SerialNumber: musb-hdrc.0.auto
    [    1.790439] hub 1-0:1.0: USB hub found
    [    1.794246] hub 1-0:1.0: 1 port detected
    [    1.834146] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
    [    1.840257] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 2
    [    1.848336] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    [    1.855174] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    1.862450] usb usb2: Product: MUSB HDRC host driver
    [    1.867437] usb usb2: Manufacturer: Linux 4.1.18 musb-hcd
    [    1.872881] usb usb2: SerialNumber: musb-hdrc.1.auto
    [    1.878570] hub 2-0:1.0: USB hub found
    [    1.882374] hub 2-0:1.0: 1 port detected
    [    1.909050] omap_hsmmc 48060000.mmc: Got CD GPIO
    [    1.914142] vmmc: supplied by vbat
    [    1.988495] vdd_mpu: supplied by vbat
    [    1.992356] cpu cpu0: of_pm_voltdm_notifier_register: Fail calculating voltage latency[950000<->1260000]:-22
    [    2.002613] cpu cpu0: of_pm_voltdm_notifier_register: Fail calculating voltage latency[950000<->1260000]:-22
    [    2.015065] input: gpio_buttons@0 as /devices/platform/gpio_buttons@0/input/input0
    [    2.025291] hctosys: unable to open rtc device (rtc0)
    [    2.037736] lis3_reg: disabling
    [    2.041081] ALSA device list:
    [    2.044064]   No soundcards found.
    [    2.048526] Waiting for root device PARTUUID=b47ab8d2-02...
    [    2.067074] mmc1: MAN_BKOPS_EN bit is not set
    [    2.073310] mmc1: new high speed MMC card at address 0001
    [    2.079338] mmcblk0: mmc1:0001 MMC02G 1.79 GiB
    [    2.084042] mmcblk0boot0: mmc1:0001 MMC02G partition 1 1.00 MiB
    [    2.090201] mmcblk0boot1: mmc1:0001 MMC02G partition 2 1.00 MiB
    [    2.098294]  mmcblk0: p1 p2
    [    2.214190] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [    2.222540] VFS: Mounted root (ext4 filesystem) on device 179:2.
    [    2.235681] devtmpfs: mounted
    [    2.239095] Freeing unused kernel memory: 280K (c0a46000 - c0a8c000)
    [    2.288227] usb 2-1: new high-speed USB device number 2 using musb-hdrc
    [    2.428588] usb 2-1: New USB device found, idVendor=1a40, idProduct=0101
    [    2.436825] usb 2-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
    [    2.444144] usb 2-1: Product: USB 2.0 Hub [MTT]
    [    2.449828] hub 2-1:1.0: USB hub found
    [    2.453693] hub 2-1:1.0: 4 ports detected
    INIT: version 2.88 booting
    Error opening /dev/fb0: No such file or directory
    Starting udev
    [    3.289065] udevd[89]: starting version 182
    depmod: ERROR: could not open directory /lib/modules/4.1.18: No such file or directory
    depmod: WARNING: -e needs -E or -F
    depmod: ERROR: could not open directory /lib/modules/4.1.18: No such file or directory
    depmod: FATAL: could not search modules: No such file or directory
    [    4.327649] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
    bootlogd: cannot allocate pseudo tty: No such file or directory
    [    4.978435]  remoteproc0: powering up wkup_m3
    [    4.983876]  remoteproc0: Booting fw image am335x-pm-firmware.elf, size 219803
    [    5.136039]  remoteproc0: remote processor wkup_m3 is now up
    [    5.136065] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x191
    [    5.247256] random: dd urandom read with 32 bits of entropy available

    udevadm settle - timeout of 3 seconds reached, the event queue contains:
      /sys/devices/platform/ocp/481d8000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk0/mmcblk0boot0 (1158)
      /sys/devices/platform/ocp/481d8000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk0/mmcblk0boot1 (1159)
      /sys/devices/platform/ocp/481d8000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk0/mmcblk0p1 (1160)
      /sys/devices/platform/ocp/481d8000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk0/mmcblk0p2 (1161)
    [    7.252033] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

  • 这张卡,在其他的设备上挂载是正常的吗?有没有尝试过,排除一下卡本身的问题。

    看到你的结构体定义,和EZSDK8.0对MMC1上的SD卡接口差异只在下面的标红地方。你现在用的是哪个版本的SDK?实际配置和参考的DTS文件配置是一样的吗?

    327 &mmc1 {
    328 status = "okay";
    329 bus-width = <0x4>;
    330 pinctrl-names = "default", "sleep";
    331 pinctrl-0 = <&mmc1_pins_default>;
    332 pinctrl-1 = <&mmc1_pins_sleep>;
    333 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
    334 cd-inverted;
    335 };

  • SDK 2.0 linux-4.1.18

    SD卡是没有问题的,接口是根据实际配置来设置的,依mmc1的葫芦花了个瓢

  • 加上cd-inverted;还是没有用

  • 我确认一下,你目前使用的电路设计中,VDDSHV1和VDDSHV2是同样的3.3V还是分开的1.8V和3.3V电压域?

    因为看到你的pinmux配置中,有部分管教在VDDSHV1上,另一部分在VDDSHV2上,排除下电路设计上对你的影响。

  • 好像是芯片内部MMC电源使能的问题


    设备数改为

    &vbat {
        regulator-name = "vbat";
        regulator-min-microvolt = <5000000>;
        regulator-max-microvolt = <5000000>;
    };

    &v3v3c_reg {
        regulator-name = "v3v3c_reg";
        regulator-min-microvolt = <3300000>;
        regulator-max-microvolt = <3300000>;
        vin-supply = <&vbat>;
    };

    &mmc3 {
        /* Wifi & Bluetooth on MMC #3 */
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&mmc3_pins_default>;
        vmmmc-supply = <&v3v3c_reg>;
        bus-width = <4>;
        ti,non-removable;
        dmas = <&edma_xbar 12 0 1
            &edma_xbar 13 0 2>;
        dma-names = "tx", "rx";
    };


    启动打印信息为

    [    1.340893] i2c /dev entries driver
    [    1.403362] /ocp/mmc@47810000: voltage-ranges unspecified
    [    1.432001] omap_hsmmc: probe of 47810000.mmc failed with error -22
    [    1.446527] ledtrig-cpu: registered to indicate activity on CPUs
    [    1.454241]  remoteproc0: wkup_m3 is available
    [    1.458744]  remoteproc0: Note: remoteproc is still under development and considered experimental.
    [    1.467934]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [    1.478747]  remoteproc0: Direct firmware load for am335x-pm-firmware.elf failed with error -2
    [    1.490094] oprofile: using arm/armv7
    [    1.494018]  remoteproc0: Falling back to user helper
    [    1.500340] Initializing XFRM netlink socket
    [    1.504920] NET: Registered protocol family 17
    [    1.509503] NET: Registered protocol family 15
    [    1.514189] lib80211: common routines for IEEE802.11 drivers
    [    1.520180] Key type dns_resolver registered
    [    1.525000] omap_voltage_late_init: Voltage driver support not added
    [    1.532176] cpu cpu0: of_pm_voltdm_notifier_register: Failed to get cpu0 regulator/voltdm: -517
    [    1.540955] cpu cpu0: cpu0 clock notifier not ready, retry