AnsweredAssumed Answered

MicroSD Can't be detected by kernel

Question asked by cheng chen on Aug 6, 2019
Latest reply on Aug 6, 2019 by igorpadykov

Our project use MicroSD as storage, use nand flash to booting system.

And MicroSD's hardware design referenced SD of i.MX6ull EVK,but VDD  always  keep on,3.3v. 

 

Now,my question is linux kernel can't detected MicroSD,when booting kernel.

There is a error code is -84,found it kernel log.

But odd, when uboot, I can find my card's information using mmcinfo CMD.

 

=> mmcinfo
Device: FSL_SDHC
Manufacturer ID: 2
OEM: 544d
Name: SA16G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.5 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes

 

 

 

kernel log:

[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Additional per-CPU info printed with stalls.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] mxc_clocksource_init 3000000
[ 0.000000] Switching to timer-based delay loop, resolution 333ns
[ 0.000016] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 715827882841ns
[ 0.000057] clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns
[ 0.002461] Console: colour dummy device 80x30
[ 0.002502] Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)
[ 0.002537] pid_max: default: 32768 minimum: 301
[ 0.002754] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.002785] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.004155] CPU: Testing write buffer coherency: ok
[ 0.004639] /cpus/cpu@0 missing clock-frequency property
[ 0.004681] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.004793] Setting up static identity map for 0x80008280 - 0x800082d8
[ 0.041133] Brought up 1 CPUs
[ 0.041172] SMP: Total of 1 processors activated (6.00 BogoMIPS).
[ 0.041191] CPU: All CPU(s) started in SVC mode.
[ 0.042289] devtmpfs: initialized
[ 0.062225] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.063124] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.086483] pinctrl core: initialized pinctrl subsystem
[ 0.088991] NET: Registered protocol family 16
[ 0.106973] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.130966] cpuidle: using governor ladder
[ 0.161035] cpuidle: using governor menu
[ 0.207776] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.207813] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.209328] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[ 0.210075] imx6ul-pinctrl 2290000.iomuxc-snvs: initialized IMX pinctrl driver
[ 0.278567] mxs-dma 1804000.dma-apbh: initialized
[ 0.286255] SCSI subsystem initialized
[ 0.287639] usbcore: registered new interface driver usbfs
[ 0.287837] usbcore: registered new interface driver hub
[ 0.288076] usbcore: registered new device driver usb
[ 0.290738] i2c i2c-1: can't use DMA
[ 0.291050] Linux video capture interface: v2.00
[ 0.291277] pps_core: LinuxPPS API ver. 1 registered
[ 0.291302] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.291391] PTP clock support registered
[ 0.294511] MIPI CSI2 driver module loaded
[ 0.294983] Advanced Linux Sound Architecture Driver Initialized.
[ 0.297210] Bluetooth: Core ver 2.20
[ 0.297338] NET: Registered protocol family 31
[ 0.297361] Bluetooth: HCI device and connection manager initialized
[ 0.297400] Bluetooth: HCI socket layer initialized
[ 0.297431] Bluetooth: L2CAP socket layer initialized
[ 0.297514] Bluetooth: SCO socket layer initialized
[ 0.299597] Switched to clocksource mxc_timer1
[ 0.326605] NET: Registered protocol family 2
[ 0.328190] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.328330] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.328488] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.328625] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.328686] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.329124] NET: Registered protocol family 1
[ 0.329956] RPC: Registered named UNIX socket transport module.
[ 0.329990] RPC: Registered udp transport module.
[ 0.330011] RPC: Registered tcp transport module.
[ 0.330030] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.334979] Bus freq driver module loaded
[ 0.337267] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.354464] VFS: Disk quotas dquot_6.6.0
[ 0.354976] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.360615] NFS: Registering the id_resolver key type
[ 0.360738] Key type id_resolver registered
[ 0.360758] Key type id_legacy registered
[ 0.360984] jffs2: version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
[ 0.362862] fuse init (API version 7.23)
[ 0.373990] io scheduler noop registered
[ 0.374038] io scheduler deadline registered
[ 0.374502] io scheduler cfq registered (default)
[ 0.375596] imx-weim 21b8000.weim: Driver registered.
[ 0.382429] MIPI DSI driver module loaded
[ 0.382916] MIPI DSI driver module loaded
[ 0.388402] imx-sdma 20ec000.sdma: no event needs to be remapped
[ 0.388621] imx-sdma 20ec000.sdma: loaded firmware 3.3
[ 0.397021] imx-sdma 20ec000.sdma: initialized
[ 0.399211] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 19, base_baud = 5000000) is a IMX
[ 1.041940] console [ttymxc0] enabled
[ 1.047570] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 226, base_baud = 5000000) is a IMX
[ 1.057729] 21ec000.serial: ttymxc2 at MMIO 0x21ec000 (irq = 227, base_baud = 5000000) is a IMX
[ 1.067961] 21f0000.serial: ttymxc3 at MMIO 0x21f0000 (irq = 228, base_baud = 5000000) is a IMX
[ 1.081316] [drm] Initialized drm 1.1.0 20060810
[ 1.087176] [drm] Initialized vivante 1.0.0 20120216 on minor 0
[ 1.119933] brd: module loaded
[ 1.136788] loop: module loaded
[ 1.141471] m2m: > tt_bat_en: 45
[ 1.144762] m2m: > tt_pwr_key: 77
[ 1.148114] m2m: > tt_rst: 82
[ 1.151219] m2m: > huawei_bat_en: 44
[ 1.154838] m2m: > ublx_en: 41
[ 1.157929] m2m: > tt_usb_sw: 43
[ 1.164777] m2m tt power on
[ 1.167609] bycc>>> simple_gpio_probe end
[ 1.187873] nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x68
[ 1.194355] nand: Micron MT29F32G08CBACAWP
[ 1.198493] nand: 4096 MiB, MLC, erase size: 1024 KiB, page size: 4096, OOB size: 224
[ 1.207189] gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 5
[ 1.215198] Bad block table found at page 1048320, version 0x01
[ 1.221659] Bad block table found at page 1048064, version 0x01
[ 1.227848] nand_read_bbt: bad block at 0x000005a00000
[ 1.233082] nand_read_bbt: bad block at 0x000005b00000
[ 1.239225] 5 cmdlinepart partitions found on MTD device gpmi-nand
[ 1.245509] Creating 5 MTD partitions on "gpmi-nand":
[ 1.250657] 0x000000000000-0x000004000000 : "boot"
[ 1.258108] 0x000004000000-0x000005000000 : "kernel"
[ 1.265659] 0x000005000000-0x000006000000 : "dtb"
[ 1.273005] 0x000006000000-0x000006100000 : "misc"
[ 1.280594] 0x000006100000-0x000100000000 : "rootfs"
[ 1.289919] gpmi-nand 1806000.gpmi-nand: driver registered.
[ 1.297519] spi_gpio spi4: gpio-miso property not found, switching to no-rx mode
[ 1.306187] bycc >> gen_74x164_probe
[ 1.313176] CAN device driver interface
[ 1.320108] flexcan 2090000.can: device registered (reg_base=a0b00000, irq=26)
[ 1.330087] 2188000.ethernet supply phy not found, using dummy regulator
[ 1.350824] pps pps0: new PPS source ptp0
[ 1.355804] bycc register mdio bus,2188000.ethernet
[ 1.361134] fec_enet_mii_bus: probed
[ 1.366379] bycc 3register mdio bus,2188000.ethernet
[ 1.371547] bycc >> fec main
[ 1.376112] fec 2188000.ethernet eth0: registered PHC device 0
[ 1.383810] PPP generic driver version 2.4.2
[ 1.388735] PPP BSD Compression module registered
[ 1.393732] PPP Deflate Compression module registered
[ 1.399069] usbcore: registered new interface driver asix
[ 1.404830] usbcore: registered new interface driver ax88179_178a
[ 1.411258] usbcore: registered new interface driver cdc_ether
[ 1.417282] usbcore: registered new interface driver net1080
[ 1.423204] usbcore: registered new interface driver cdc_subset
[ 1.429299] usbcore: registered new interface driver zaurus
[ 1.435263] usbcore: registered new interface driver cdc_ncm
[ 1.441184] usbcore: registered new interface driver cdc_mbim
[ 1.446982] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.453609] ehci-mxc: Freescale On-Chip EHCI Host driver
[ 1.459407] usbcore: registered new interface driver cdc_wdm
[ 1.465398] usbcore: registered new interface driver usb-storage
[ 1.471871] usbcore: registered new interface driver usbserial
[ 1.477858] usbcore: registered new interface driver usbserial_generic
[ 1.484606] usbserial: USB Serial support registered for generic
[ 1.490838] usbcore: registered new interface driver option
[ 1.496579] usbserial: USB Serial support registered for GSM modem (1-port)
[ 1.503816] usbcore: registered new interface driver usb_ehset_test
[ 1.512931] 2184800.usbmisc supply vbus-wakeup not found, using dummy regulator
[ 1.522258] 2184000.usb supply vbus not found, using dummy regulator
[ 1.535951] 2184200.usb supply vbus not found, using dummy regulator
[ 1.546328] ci_hdrc ci_hdrc.1: EHCI Host Controller
[ 1.551398] ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
[ 1.569689] ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
[ 1.577379] hub 1-0:1.0: USB hub found
[ 1.581456] hub 1-0:1.0: 1 port detected
[ 1.588088] mousedev: PS/2 mouse device common for all mice
[ 1.595832] input: 20cc000.snvs:snvs-powerkey as /devices/platform/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
[ 1.614010] snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r as rtc0
[ 1.623199] i2c /dev entries driver
[ 1.629240] IR NEC protocol handler initialized
[ 1.633935] IR RC5(x/sz) protocol handler initialized
[ 1.639040] IR RC6 protocol handler initialized
[ 1.643666] IR JVC protocol handler initialized
[ 1.648251] IR Sony protocol handler initialized
[ 1.652961] IR SANYO protocol handler initialized
[ 1.657713] IR Sharp protocol handler initialized
[ 1.662510] IR MCE Keyboard/mouse protocol handler initialized
[ 1.668391] IR XMP protocol handler initialized
[ 1.679491] imx2-wdt 20bc000.wdog: use WDOG_B to reboot.
[ 1.686199] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
[ 1.692548] Bluetooth: HCI UART driver ver 2.3
[ 1.697039] Bluetooth: HCI UART protocol H4 registered
[ 1.702278] Bluetooth: HCI UART protocol BCSP registered
[ 1.707625] Bluetooth: HCI UART protocol ATH3K registered
[ 1.713363] usbcore: registered new interface driver bcm203x
[ 1.719274] usbcore: registered new interface driver btusb
[ 1.725099] usbcore: registered new interface driver ath3k
[ 1.731887] sdhci: Secure Digital Host Controller Interface driver
[ 1.738114] sdhci: Copyright(c) Pierre Ossman
[ 1.742620] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.750939] /soc/aips-bus@02100000/usdhc@02190000: voltage-ranges unspecified
[ 1.759742] sdhci-esdhc-imx 2190000.usdhc: No vmmc regulator found
[ 1.765968] sdhci-esdhc-imx 2190000.usdhc: No vqmmc regulator found
[ 1.819696] mmc0: mmc_rescan_try_freq: trying to init card at 50000000 Hz
[ 1.826707] mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA
[ 1.843142] sdhci error >>>>>>>>>>irq>>> -84
[ 1.862904] sdhci error >>>>>>>>>>irq>>> -84
[ 1.868498] usbcore: registered new interface driver usbhid
[ 1.874511] sdhci error >>>>>>>>>>irq>>> -84
[ 1.878894] usbhid: USB HID core driver
[ 1.882964] sdhci error >>>>>>>>>>irq>>> -84
[ 1.893088] sdhci error >>>>>>>>>>irq>>> -84
[ 1.901885] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 1.919055] wm8960 1-001a: Failed to issue reset
[ 1.923829] mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
[ 1.930801] wm8960: probe of 1-001a failed with error -5
[ 1.939506] fsl-asrc 2034000.asrc: driver registered
[ 1.953338] imx-wm8960 sound: failed to find codec platform device
[ 1.962065] imx-wm8960: probe of sound failed with error -22
[ 1.971920] NET: Registered protocol family 26
[ 1.978464] NET: Registered protocol family 10
[ 1.996564] sdhci error >>>>>>>>>>irq>>> -84
[ 2.000902] sdhci error >>>>>>>>>>irq>>> -84
[ 2.018377] sit: IPv6 over IPv4 tunneling driver
[ 2.025253] bycc >> return error = -110
[ 2.029494] sdhci error >>>>>>>>>>irq>>> -84
[ 2.033821] sdhci error >>>>>>>>>>irq>>> -84
[ 2.040697] sdhci error >>>>>>>>>>irq>>> -84
[ 2.045021] sdhci error >>>>>>>>>>irq>>> -84
[ 2.051880] sdhci error >>>>>>>>>>irq>>> -84
[ 2.056202] sdhci error >>>>>>>>>>irq>>> -84
[ 2.063018] sdhci error >>>>>>>>>>irq>>> -84
[ 2.067339] sdhci error >>>>>>>>>>irq>>> -84
[ 2.087314] NET: Registered protocol family 17
[ 2.096343] can: controller area network core (rev 20120528 abi 9)
[ 2.103269] hub 1-1:1.0: USB hub found
[ 2.109338] mmc0: mmc_rescan_try_freq: trying to init card at 300000 Hz
[ 2.116104] hub 1-1:1.0: 4 ports detected
[ 2.120393] NET: Registered protocol family 29
[ 2.125001] can: raw protocol (rev 20120528)
[ 2.129321] can: broadcast manager protocol (rev 20120528 t)
[ 2.135319] can: netlink gateway (rev 20130117) max_hops=1
[ 2.149996] Bluetooth: RFCOMM TTY layer initialized
[ 2.155034] Bluetooth: RFCOMM socket layer initialized
[ 2.163587] Bluetooth: RFCOMM ver 1.11
[ 2.167600] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 2.173142] Bluetooth: BNEP filters: protocol multicast
[ 2.178554] Bluetooth: BNEP socket layer initialized
[ 2.185289] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 2.193561] Bluetooth: HIDP socket layer initialized
[ 2.204147] 8021q: 802.1Q VLAN Support v1.8
[ 2.211872] Key type dns_resolver registered
[ 2.216196] sdhci error >>>>>>>>>>irq>>> -84
[ 2.242230] sdhci error >>>>>>>>>>irq>>> -84
[ 2.246548] sdhci error >>>>>>>>>>irq>>> -84
[ 2.253509] sdhci error >>>>>>>>>>irq>>> -84
[ 2.257818] sdhci error >>>>>>>>>>irq>>> -84
[ 2.264672] sdhci error >>>>>>>>>>irq>>> -84
[ 2.268985] sdhci error >>>>>>>>>>irq>>> -84
[ 2.275838] sdhci error >>>>>>>>>>irq>>> -84
[ 2.280152] sdhci error >>>>>>>>>>irq>>> -84
[ 2.311849] mmc0: mmc_rescan_try_freq: trying to init card at 200000 Hz
[ 2.323894] ubi0: attaching mtd4
[ 2.374015] sdhci error >>>>>>>>>>irq>>> -84
[ 2.378329] sdhci error >>>>>>>>>>irq>>> -84
[ 2.403928] sdhci error >>>>>>>>>>irq>>> -84
[ 2.408235] sdhci error >>>>>>>>>>irq>>> -84
[ 2.415263] sdhci error >>>>>>>>>>irq>>> -84
[ 2.419570] sdhci error >>>>>>>>>>irq>>> -84
[ 2.426589] sdhci error >>>>>>>>>>irq>>> -84
[ 2.430898] sdhci error >>>>>>>>>>irq>>> -84
[ 2.437947] sdhci error >>>>>>>>>>irq>>> -84
[ 2.442255] sdhci error >>>>>>>>>>irq>>> -84
[ 2.467391] mmc0: mmc_rescan_try_freq: trying to init card at 100000 Hz
[ 2.536260] sdhci error >>>>>>>>>>irq>>> -84
[ 2.540572] sdhci error >>>>>>>>>>irq>>> -84
[ 2.570007] sdhci error >>>>>>>>>>irq>>> -84
[ 2.574316] sdhci error >>>>>>>>>>irq>>> -84
[ 2.582078] sdhci error >>>>>>>>>>irq>>> -84
[ 2.586386] sdhci error >>>>>>>>>>irq>>> -84
[ 2.593969] sdhci error >>>>>>>>>>irq>>> -84
[ 2.598275] sdhci error >>>>>>>>>>irq>>> -84
[ 2.605822] sdhci error >>>>>>>>>>irq>>> -84
[ 2.610131] sdhci error >>>>>>>>>>irq>>> -84
[ 2.958839] random: nonblocking pool is initialized
[ 4.428184] ubi0: scanning is finished
[ 4.446556] ubi0 warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 75, need 76
[ 4.463577] ubi0: attached mtd4 (name "rootfs", size 3999 MiB)
[ 4.469466] ubi0: PEB size: 1048576 bytes (1024 KiB), LEB size: 1040384 bytes
[ 4.476775] ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
[ 4.483753] ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
[ 4.490801] ubi0: good PEBs: 3995, bad PEBs: 4, corrupted PEBs: 0
[ 4.496924] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[ 4.504224] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1248174596
[ 4.513429] ubi0: available PEBs: 0, total reserved PEBs: 3995, PEBs reserved for bad PEB handling: 75
[ 4.522828] ubi0: background thread "ubi_bgt0d" started, PID 81
[ 4.528830] dhd_module_init in
[ 4.533383] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 2016-09-16 23:56:11 UTC (1474070171)
[ 4.564353] gpio_dvfs: disabling
[ 4.567633] vref-3v3: disabling
[ 4.570892] VSD_3V3: disabling
[ 4.573971] can-3v3: disabling
[ 4.577388] ALSA device list:
[ 4.580443] No soundcards found.
[ 4.725381] UBIFS (ubi0:0): recovery needed
[ 4.859441] UBIFS (ubi0:0): recovery deferred
[ 4.864133] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode
[ 4.872480] UBIFS (ubi0:0): LEB size: 1040384 bytes (1016 KiB), min./max. I/O unit sizes: 4096 bytes/4096 bytes
[ 4.882651] UBIFS (ubi0:0): FS size: 4063739904 bytes (3875 MiB, 3906 LEBs), journal size 33292288 bytes (31 MiB, 32 LEBs)
[ 4.893765] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[ 4.900845] UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID 555BADC3-9127-482D-80EB-F54AC09B2009, small LPT model
[ 4.914173] VFS: Mounted root (ubifs filesystem) readonly on device 0:14.
[ 4.922490] devtmpfs: mounted
[ 4.926138] Freeing unused kernel memory: 308K (80b0b000 - 80b58000)

 

my dts wrote:

&usdhc1 {
   pinctrl-names = "default", "state_100mhz", "state_200mhz";
   pinctrl-0 = <&pinctrl_usdhc1>;
   pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
   pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
   //cd-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;
   //keep-power-in-suspend;
   //enable-sdio-wakeup;
   //vmmc-supply = <&reg_sd1_vmmc>;
   status = "okay";
};

 

root@imx6ul7d:~# ls /sys/class/mmc_host/mmc0/ -l
total 0
lrwxrwxrwx 1 root root 0 Sep 17 00:02 device -> ../../../2190000.usdhc
drwxr-xr-x 2 root root 0 Sep 17 00:02 power
lrwxrwxrwx 1 root root 0 Sep 17 00:02 subsystem -> ../../../../../../../class/mmc_host
-rw-r--r-- 1 root root 4096 Sep 16 23:56 uevent

Outcomes