AnsweredAssumed Answered

i.mx6sl kernel and mmc boot issue

Question asked by jayakumar2 on Mar 10, 2014
Latest reply on Mar 10, 2014 by jayakumar2

Hi, I'm bringing up a board that uses the i.mx6sl. It is based closely on the i.mx6sl evk. I'm currently having a problem where the kernel fails to mount the rootfs. In u-boot, I'm able to read from the MMC device fine which suggests a possible mistake in my configuration of iomux or something else in the board file in the kernel. The board uses SDHC2 (2nd SDHC interface) as the boot MMC interface, just like i.mx6slevk. I've turned on MMC_DEBUG in the kernel and here's what I see when comparing the boot log between the EVK and my board.

In the failing case, I'm seeing:

mmc0: starting CMD52 arg 00000c00 flags 00000195

mmc0: req done (CMD52): -123: 00000000 00000000 00000000 00000000

sdhci: ===========================================

mmc0: starting CMD52 arg 80000c08 flags 00000195

mmc1: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0

mmc0: req done (CMD52): -123: 00000000 00000000 00000000 00000000

 

whereas on the mx6slevk, I'm seeing:

mmc0: starting CMD52 arg 00000c00 flags 00000195

mmc1: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0

sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00010000

mmc0: req done (CMD52): -110: 00000000 00000000 00000000 00000000

mmc0: starting CMD52 arg 80000c08 flags 00000195

sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x00010000

mmc0: req done (CMD52): -110: 00000000 00000000 00000000 00000000

 

In the failing case, there does not appear to be any sdhci_irq's being

fired. I'm not sure why that's the case. mmc0 req done -123 is -ENOMEDIUM whereas in the working case, I see req done -110 which is ETIMEDOUT. It works fine in the -110 log.

 

In the board file code, I had done:

        platform_device_register(&evk_vmmc_reg_devices);

#if 0 /* xxxjaya original code */

        imx6q_add_sdhci_usdhc_imx(0, &mx6_evk_sd1_data);

        imx6q_add_sdhci_usdhc_imx(1, &mx6_evk_sd2_data);

        imx6q_add_sdhci_usdhc_imx(2, &mx6_evk_sd3_data);

#endif

        imx6q_add_sdhci_usdhc_imx(0, &mx6_evk_sd2_data);

        imx6q_add_sdhci_usdhc_imx(1, &mx6_evk_sd3_data);

 

I wonder if perhaps this is a mistake and is the root cause of the problem. The other area that I'm suspicious about is whether the problem could be due to a core clock rate difference because the EVK is run at 396MHz whereas my board is running at 792MHz.

My board:

CPU: Freescale i.MX6 family TO1.2 at 792 MHz

Thermal sensor with ratio = 176

Temperature:   41 C, calibration data 0x55b4e45f

mx6q pll1: 792MHz

mx6q pll2: 528MHz

mx6q pll3: 480MHz

mx6q pll8: 50MHz

ipg clock     : 66000000Hz

ipg per clock : 66000000Hz

uart clock    : 80000000Hz

cspi clock    : 60000000Hz

ahb clock     : 132000000Hz

axi clock   : 198000000Hz

emi_slow clock: 99000000Hz

ddr clock     : 396000000Hz

usdhc1 clock  : 198000000Hz

usdhc2 clock  : 198000000Hz

usdhc3 clock  : 198000000Hz

usdhc4 clock  : 198000000Hz

 

6SLEVK board:

CPU: Freescale i.MX6 family TO1.2 at 396 MHz

Thermal sensor with ratio = 182

Temperature:   33 C, calibration data 0x57f5115f

mx6q pll1: 792MHz

mx6q pll2: 528MHz

mx6q pll3: 480MHz

mx6q pll8: 50MHz

ipg clock     : 49500000Hz

ipg per clock : 49500000Hz

uart clock    : 80000000Hz

cspi clock    : 60000000Hz

ahb clock     : 99000000Hz

axi clock   : 198000000Hz

emi_slow clock: 99000000Hz

ddr clock     : 396000000Hz

usdhc1 clock  : 198000000Hz

usdhc2 clock  : 198000000Hz

usdhc3 clock  : 198000000Hz

usdhc4 clock  : 198000000Hz

 

Thanks.

 

Detailed kernel bootlog for faliing case on my board:

In:    serial

Out:   serial

Err:   serial

Found PFUZE100! deviceid=10,revid=21

Net:   No ethernet found.

Hit any key to stop autoboot:  0

mmc0 is current device

 

 

MMC read: dev # 0, block # 2048, count 8192 ... 8192 blocks read: OK

## Booting kernel from Legacy Image at 80800000 ...

   Image Name:   Linux-3.0.35-2666-gbdde708-gf574

   Image Type:   ARM Linux Kernel Image (uncompressed)

   Data Size:    3152556 Bytes =  3 MB

   Load Address: 80008000

   Entry Point:  80008000

   Verifying Checksum ... OK

   Loading Kernel Image ... OK

OK

  

Starting kernel ...

 

 

Linux version 3.0.35-2666-gbdde708-gf574c61-dirty (lucid@ubuntu) (gcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) ) #22 PREEMPT Fri Mar 7 22:47:59 PST 2014

CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d

CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache

Machine: Freescale i.MX 6SoloLite EVK Board

Memory policy: ECC disabled, Data cache writeback

CPU identified as i.MX6SoloLite, silicon rev 1.2

On node 0 totalpages: 131072

free_area_init_node: node 0, pgdat 80608af8, node_mem_map 8b800000

  DMA zone: 368 pages used for memmap

  DMA zone: 0 pages reserved

  DMA zone: 46736 pages, LIFO batch:15

  Normal zone: 656 pages used for memmap

  Normal zone: 83312 pages, LIFO batch:15

pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768

pcpu-alloc: [0] 0

Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048

Kernel command line: console=ttymxc0,115200 loglevel=8 root=/dev/mmcblk0p1 rootwait video=mxcepdcfb:E060SCM,bpp=16

PID hash table entries: 2048 (order: 1, 8192 bytes)

Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)

Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)

Memory: 512MB = 512MB total

Memory: 513436k/513436k available, 10852k reserved, 0K highmem

XC GPIO hardware

sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms

arm_max_freq=1GHz

MXC_Early serial console at MMIO 0x2020000 (options '115200')

bootconsole [ttymxc0] enabled

Console: colour dummy device 80x30

Calibrating delay loop... 1581.05 BogoMIPS (lpj=7905280)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available

print_constraints: dummy:

NET: Registered protocol family 16

print_constraints: vddpu: 725 <--> 1300 mV at 700 mV fast normal

print_constraints: vddcore: 725 <--> 1300 mV at 1100 mV fast normal

print_constraints: vddsoc: 725 <--> 1300 mV at 1200 mV fast normal

print_constraints: vdd2p5: 2000 <--> 2775 mV at 2400 mV fast normal

print_constraints: vdd1p1: 800 <--> 1400 mV at 1100 mV fast normal

print_constraints: vdd3p0: 2625 <--> 3400 mV at 3000 mV fast normal

hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.

hw-breakpoint: 1 breakpoint(s) reserved for watchpoint single-step.

hw-breakpoint: maximum watchpoint size is 4 bytes.

L310 cache controller enabled

l2x0: 16 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x02030000, Cache size: 262144 B

bio: create slab <bio-0> at 0

print_constraints: vmmc: 3300 mV

print_constraints: SPKVDD: 4325 mV

SCSI subsystem initialized

spi_imx imx6q-ecspi.0: probed

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

mc_pfuze 0-0008: ID: 0,Full lay: 2 ,Metal lay: 1

mc_pfuze 0-0008: FAB: 0 ,FIN: 0

print_constraints: PFUZE100_SW1A: 300 <--> 1875 mV at 1300 mV

print_constraints: PFUZE100_SW1B: 300 <--> 1875 mV at 300 mV

print_constraints: PFUZE100_SW1C: 300 <--> 1875 mV at 1300 mV

print_constraints: PFUZE100_SW2: 800 <--> 3950 mV at 3150 mV

print_constraints: PFUZE100_SW3A: 400 <--> 1975 mV at 1200 mV

print_constraints: PFUZE100_SW3B: 400 <--> 1975 mV at 1200 mV

print_constraints: PFUZE100_SW4: 800 <--> 3950 mV at 3300 mV

print_constraints: PFUZE100_SWBST: 5000 <--> 5150 mV at 5000 mV

print_constraints: PFUZE100_VSNVS: 1200 <--> 3000 mV at 1800 mV

print_constraints: PFUZE100_VREFDDR: at 750 mV

print_constraints: PFUZE100_VGEN1: 800 <--> 1550 mV at 1200 mV

print_constraints: PFUZE100_VGEN2: 800 <--> 1550 mV at 800 mV

print_constraints: PFUZE100_VGEN3: 1800 <--> 3300 mV at 1800 mV

print_constraints: PFUZE100_VGEN4: 1800 <--> 3300 mV at 1800 mV

print_constraints: PFUZE100_VGEN5: 1800 <--> 3300 mV at 2500 mV

print_constraints: PFUZE100_VGEN6: 1800 <--> 3300 mV at 1800 mV

i2c i2c-1: Invalid 7-bit I2C address 0x00

i2c i2c-1: Can't create device at 0x00

Advanced Linux Sound Architecture Driver Version 1.0.24.

Bluetooth: Core ver 2.16

NET: Registered protocol family 31

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

Bluetooth: L2CAP socket layer initialized

Bluetooth: SCO socket layer initialized

cfg80211: Calling CRDA to update world regulatory domain

max17135 0-0048: Max17135 PMIC not found!

max17135 regulator init failed: -6

i2c-core: driver [max17135] using legacy suspend method

i2c-core: driver [max17135] using legacy resume method

Switching to clocksource mxc_timer1

NET: Registered protocol family 2

IP route cache hash table entries: 4096 (order: 2, 16384 bytes)

fsl-usb2-udc: bind to driver g_ether

mousedev: PS/2 mouse device common for all mice

input: imx-keypad as /devices/platform/imx-keypad/input/input0

snvs_rtc snvs_rtc.0: rtc core: registered snvs_rtc as rtc0

i2c /dev entries driver

Linux video capture interface: v2.00

imx2-wdt imx2-wdt.0: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=1)

Bluetooth: Virtual HCI driver ver 1.3

Bluetooth: Generic Bluetooth USB driver ver 0.6

usbcore: registered new interface driver btusb

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

sdhci sdhci-esdhc-imx.1: no write-protect pin available!

sdhci [sdhci_add_host()]: Disabling ADMA as it is marked broken

sdhci [sdhci_add_host()]: mmc0: Auto-CMD23 unavailable

sdhci: =========== REGISTER DUMP (mmc0)===========

sdhci: Sys addr: 0x00000000 | Version:  0x00000202

sdhci: Blk size: 0x00000200 | Blk cnt:  0x00000001

sdhci: Argument: 0x00020000 | Trn mode: 0x00000000

sdhci: Present:  0xfff88088 | Host ctl: 0x00000002

sdhci: Power:    0x0000000d | Blk gap:  0x00000000

sdhci: Wake-up:  0x00000000 | Clock:    0x00000118

sdhci: Timeout:  0x00000000 | Int stat: 0x00000000

sdhci: Int enab: 0x007f0003 | Sig enab: 0x007f0003

sdhci: AC12 err: 0x00000000 | Slot int: 0x00000202

sdhci: Caps:     0x07ebb407 | Caps_1:   0x0000b407

sdhci: Cmd:      0x00000d1a | Max curr: 0x00ffffff

sdhci: Host ctl2: 0x00000000

sdhci: ===========================================

mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0

mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz

mmc0: SDHCI controller on platform [sdhci-esdhc-imx.1] using DMA

sdhci sdhci-esdhc-imx.2: no write-protect pin available!

mmc0: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0

sdhci [sdhci_add_host()]: Disabling ADMA as it is marked broken

sdhci [sdhci_add_host()]: mmc1: Auto-CMD23 unavailable

mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

sdhci: =========== REGISTER DUMP (mmc1)===========

sdhci: Sys addr: 0x00000000 | Version:  0x00000202

sdhci: Blk size: 0x00000000 | Blk cnt:  0x00000001

sdhci: Argument: 0x00000000 | Trn mode: 0x00000000

sdhci: Present:  0xfff88088 | Host ctl: 0x00000000

sdhci: Power:    0x0000000d | Blk gap:  0x00000000

sdhci: Wake-up:  0x00000000 | Clock:    0x0000800f

sdhci: Timeout:  0x00000000 | Int stat: 0x00000000

sdhci: Int enab: 0x007f0003 | Sig enab: 0x007f0003

sdhci: AC12 err: 0x00000000 | Slot int: 0x00000202

sdhci: Caps:     0x07ebb407 | Caps_1:   0x0000b407

sdhci: Cmd:      0x00000000 | Max curr: 0x00ffffff

sdhci: Host ctl2: 0x00000000

mmc0: starting CMD52 arg 00000c00 flags 00000195

mmc0: req done (CMD52): -123: 00000000 00000000 00000000 00000000

sdhci: ===========================================

mmc0: starting CMD52 arg 80000c08 flags 00000195

mmc1: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0

mmc0: req done (CMD52): -123: 00000000 00000000 00000000 00000000

mmc0: clock 400000Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0

mmc1: SDHCI controller on platform [sdhci-esdhc-imx.2] using DMA

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

Cirrus Logic CS42888 ALSA SoC Codec Driver

mmc0: starting CMD0 arg 00000000 flags 000000c0

mmc0: req done (CMD0): -123: 00000000 00000000 00000000 00000000

i2c-core: driver [cs42888] using legacy suspend method

i2c-core: driver [cs42888] using legacy resume method

mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

imx_3stack asoc driver

ALSA device list:

  No soundcards found.

TCP cubic registered

NET: Registered protocol family 17

can: controller area network core (rev 20090105 abi 8)

mmc0: starting CMD8 arg 000001aa flags 000002f5

mmc0: req done (CMD8): -123: 00000000 00000000 00000000 00000000

NET: Registered protocol family 29

can: raw protocol (rev 20090105)

mmc0: starting CMD5 arg 00000000 flags 000002e1

can: broadcast manager protocol (rev 20090105 t)

mmc0: req failed (CMD5): -123, retrying...

Bluetooth: RFCOMM TTY layer initialized

mmc0: req failed (CMD5): -123, retrying...

Bluetooth: RFCOMM socket layer initialized

mmc0: req failed (CMD5): -123, retrying...

mmc0: req done (CMD5): -123: 00000000 00000000 00000000 00000000

Bluetooth: RFCOMM ver 1.11

Bluetooth: BNEP (Ethernet Emulation) ver 1.3

Bluetooth: BNEP filters: protocol multicast

sdhci sdhci-esdhc-imx.1: desired SD clock: 400000, actual: 375000

Bluetooth: HIDP (Human Interface Emulation) ver 1.2

lib80211: common routines for IEEE802.11 drivers

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc0: req done (CMD55): -123: 00000000 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

lib80211_crypt: registered algorithm 'NULL'

VFP support v0.3:

mmc0: req done (CMD55): -123: 00000000 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc0: req done (CMD55): -123: 00000000 00000000 00000000 00000000

mmc0: starting CMD55 arg 00000000 flags 000000f5

mmc0: req done (CMD55): -123: 00000000 00000000 00000000 00000000

mmc0: starting CMD1 arg 00000000 flags 000000e1

implementor 41 architecture 3 part 30 variant 9 rev 4

mmc0: req done (CMD1): -123: 00000000 00000000 00000000 00000000

mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0

mmc0: mmc_rescan_try_freq: trying to init card at 300000 Hz

Bus freq driver module loaded

Bus freq driver Enabled

mxc_dvfs_core_probe

mmc0: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0

DVFS driver module loaded

regulator_init_complete: PFUZE100_VGEN5: incomplete constraints, leaving on

regulator_init_complete: SPKVDD: incomplete constraints, leaving on

mmc0: clock 300000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0

snvs_rtc snvs_rtc.0: setting system clock to 1970-01-01 00:00:00 UTC (0)

Waiting for root device /dev/mmcblk0p1...

mmc0: starting CMD52 arg 00000c00 flags 00000195

mmc0: req done (CMD52): -123: 00000000 00000000 00000000 00000000

mmc0: starting CMD52 arg 80000c08 flags 00000195

mmc0: req done (CMD52): -123: 00000000 00000000 00000000 00000000

mmc0: clock 300000Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0

sdhci sdhci-esdhc-imx.1: desired SD clock: 300000, actual: 281250

sdhci sdhci-esdhc-imx.1: desired SD clock: 300000, actual: 281250

sdhci sdhci-esdhc-imx.1: desired SD clock: 300000, actual: 281250

mmc0: starting CMD0 arg 00000000 flags 000000c0

mmc0: req done (CMD0): -123: 00000000 00000000 00000000 00000000

mmc0: clock 300000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0

sdhci sdhci-esdhc-imx.1: desired SD clock: 300000, actual: 281250

sdhci sdhci-esdhc-imx.1: desired SD clock: 300000, actual: 281250

sdhci sdhci-esdhc-imx.1: desired SD clock: 300000, actual: 281250

mmc0: starting CMD8 arg 000001aa flags 000002f5

mmc0: req done (CMD8): -123: 00000000 00000000 00000000 00000000

Outcomes