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.

Linux can't init mmc

Other Parts Discussed in Thread: OMAP-L138, DA8XX, OMAP-L137

Hello!

We have developed our customer board based on OMAP-L138. In the first step our device electrical schema is based on SOM and BaseBoard from LogicPD. And now I try to start our device. I have writen UBL and u-boot to SPI flash. My current target is starting of Linux. And I have met a problem. Due to unknown reason Linux can't mount sd card. This is last string of booting log:

Waiting for root device /dev/mmcblk0p2

I have tried to start Linux from different places like SPI flash and SD card FAT partition. But the result is identical. I think that SD card is working normal because u-boot can detect it. But I don't understand why Linux can't do that. I have tried my Linux image in BaseBoard with SOM and it detect SD.

Also I have tried different SD cards. I have tried to load fs from first partiton of SD.

Can anybody give me advices how to solve my problem?

I use PSP SDK 03.20.00.14.

There is my booting log. Also I added pinmux output.


OMAP-L138 initialization passed!
Booting TI User Boot Loader
    UBL Version: 1.65
    UBL Flashtype: SPI
Starting SPI Memory Copy...
Valid magicnum, 0x55424CBB, found at offset 0x00010000.
   DONE
Jumping to entry point at 0xC1080000.


U-Boot 2009.11 (Nov 09 2010 - 18:48:43)

I2C:   ready
DRAM:  64 MB
MMC:   davinci: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
ARM Clock : 300000000 Hz
DDR Clock : 150000000 Hz
Invalid MAC address read.
Net:   Ethernet PHY: GENERIC @ 0x00

Hit any key to stop autoboot:  3  2  1  0
reading boot.scr

** Unable to read "boot.scr" from mmc 0:1 **
reading uImage

2058304 bytes read
## Booting kernel from Legacy Image at c0700000 ...
   Image Name:   Linux-2.6.33-rc4
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2058240 Bytes =  2 MB
   Load Address: c0008000
   Entry Point:  c0008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.33-rc4 (root@lesha-desktop) (gcc version 4.3.3 (Sourcery G++ L
ite 2009q1-203) ) #15 PREEMPT Tue Dec 20 02:36:39 MSK 2011
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: DaVinci DA850/OMAP-L138/AM18xx EVM
Memory policy: ECC disabled, Data cache writeback
DaVinci da850/omap-l138/am18xx variant 0x1
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: mem=32M console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootw
ait ip=off
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 28128KB available (3908K code, 263K data, 148K init, 0K highmem)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
NR_IRQS:245
Console: colour dummy device 80x30
Calibrating delay loop... 149.50 BogoMIPS (lpj=747520)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
DaVinci: 144 gpio irqs
regulator: core version 0.5
NET: Registered protocol family 16
MUX: initialized GPIO1_4
MUX: Setting register GPIO1_4
       PINMUX4 (0x00000010) = 0x00222288 -> 0x00228288
MUX: initialized GPIO1_5
MUX: Setting register GPIO1_5
       PINMUX4 (0x00000010) = 0x00228288 -> 0x00228888
da850_evm_init: HAS_MMC is enabled
MUX: initialized GPIO4_0
MUX: Setting register GPIO4_0
       PINMUX10 (0x00000028) = 0x00222222 -> 0x80222222
MUX: initialized GPIO4_1
MUX: Setting register GPIO4_1
       PINMUX10 (0x00000028) = 0x80222222 -> 0x88222222
MUX: initialized LCD_D_0
MUX: Setting register LCD_D_0
       PINMUX17 (0x00000044) = 0x00000000 -> 0x00000020
MUX: initialized LCD_D_1
MUX: Setting register LCD_D_1
       PINMUX17 (0x00000044) = 0x00000020 -> 0x00000022
MUX: initialized LCD_D_2
MUX: Setting register LCD_D_2
       PINMUX16 (0x00000040) = 0x00000000 -> 0x20000000
MUX: initialized LCD_D_3
MUX: Setting register LCD_D_3
       PINMUX16 (0x00000040) = 0x20000000 -> 0x22000000
MUX: initialized LCD_D_4
MUX: Setting register LCD_D_4
       PINMUX16 (0x00000040) = 0x22000000 -> 0x22200000
MUX: initialized LCD_D_5
MUX: Setting register LCD_D_5
       PINMUX16 (0x00000040) = 0x22200000 -> 0x22220000
MUX: initialized LCD_D_6
MUX: Setting register LCD_D_6
       PINMUX16 (0x00000040) = 0x22220000 -> 0x22222000
MUX: initialized LCD_D_7
MUX: Setting register LCD_D_7
       PINMUX16 (0x00000040) = 0x22222000 -> 0x22222200
MUX: initialized LCD_D_8
MUX: Setting register LCD_D_8
       PINMUX18 (0x00000048) = 0x00000000 -> 0x00000020
MUX: initialized LCD_D_9
MUX: Setting register LCD_D_9
       PINMUX18 (0x00000048) = 0x00000020 -> 0x00000022
MUX: initialized LCD_D_10
MUX: Setting register LCD_D_10
       PINMUX17 (0x00000044) = 0x00000022 -> 0x20000022
MUX: initialized LCD_D_11
MUX: Setting register LCD_D_11
       PINMUX17 (0x00000044) = 0x20000022 -> 0x22000022
MUX: initialized LCD_D_12
MUX: Setting register LCD_D_12
       PINMUX17 (0x00000044) = 0x22000022 -> 0x22200022
MUX: initialized LCD_D_13
MUX: Setting register LCD_D_13
       PINMUX17 (0x00000044) = 0x22200022 -> 0x22220022
MUX: initialized LCD_D_14
MUX: Setting register LCD_D_14
       PINMUX17 (0x00000044) = 0x22220022 -> 0x22222022
MUX: initialized LCD_D_15
MUX: Setting register LCD_D_15
       PINMUX17 (0x00000044) = 0x22222022 -> 0x22222222
MUX: initialized LCD_PCLK
MUX: Setting register LCD_PCLK
       PINMUX18 (0x00000048) = 0x00000022 -> 0x02000022
MUX: initialized LCD_MCLK
MUX: Setting register LCD_MCLK
       PINMUX18 (0x00000048) = 0x02000022 -> 0x22000022
MUX: initialized LCD_HSYNC
MUX: Setting register LCD_HSYNC
       PINMUX19 (0x0000004c) = 0x00000000 -> 0x00000002
MUX: initialized LCD_VSYNC
MUX: Setting register LCD_VSYNC
       PINMUX19 (0x0000004c) = 0x00000002 -> 0x00000022
MUX: initialized NLCD_AC_ENB_CS
MUX: Setting register NLCD_AC_ENB_CS
       PINMUX19 (0x0000004c) = 0x00000022 -> 0x02000022
MUX: initialized GPIO2_8
MUX: Setting register GPIO2_8
       PINMUX5 (0x00000014) = 0x00110110 -> 0x80110110
MUX: initialized GPIO2_15
MUX: Setting register GPIO2_15
       PINMUX5 (0x00000014) = 0x80110110 -> 0x80110118
MUX: initialized RTC_ALARM
MUX: Setting register RTC_ALARM
       PINMUX0 (0x00000000) = 0x44080000 -> 0x24080000
MUX: initialized GPIO2_4
MUX: Setting register GPIO2_4
       PINMUX6 (0x00000018) = 0x00000000 -> 0x00008000
MUX: initialized GPIO6_13
MUX: Setting register GPIO6_13
       PINMUX13 (0x00000034) = 0x00000000 -> 0x00000800
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource timer0_1
musb_hdrc: version 6.0, cppi4.1-dma, peripheral, debug=0
Waiting for USB PHY clock good...
musb_hdrc: USB Peripheral mode controller at fee00000 using DMA, IRQ 58
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
EMAC: MII PHY configured, RMII PHY will not be functional
MUX: initialized GPIO2_6
MUX: Setting register GPIO2_6
       PINMUX6 (0x00000018) = 0x00008000 -> 0x00008080
NTFS driver 2.1.29 [Flags: R/W].
JFFS2 version 2.2. (NAND) В© 2001-2006 Red Hat, Inc.
JFS: nTxBlock = 219, nTxLock = 1758
msgmni has been set to 54
io scheduler noop registered (default)
da8xx_lcdc da8xx_lcdc.0: GLCD: Found Sharp_LK043T1DG01 panel
Console: switching to colour frame buffer device 60x34
Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x1c42000 (irq = 25) is a 16550A
serial8250.0: ttyS1 at MMIO 0x1d0c000 (irq = 53) is a 16550A
serial8250.0: ttyS2 at MMIO 0x1d0d000 (irq = 61) is a 16550A
console [ttyS2] enabled
brd: module loaded
console [netcon0] enabled
netconsole: network logging started
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci ohci.0: DA8xx OHCI
ohci ohci.0: new USB bus registered, assigned bus number 1
ohci ohci.0: irq 59, io mem 0x01e25000
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
omap_rtc: RTC power up reset detected
watchdog watchdog: heartbeat 60 sec
cpuidle: using governor ladder
cpuidle: using governor menu
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (439 buckets, 1756 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
xt_time: kernel timezone is -0000
IPv4 over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
arp_tables: (C) 2002 David S. Miller
TCP cubic registered
NET: Registered protocol family 17
Bridge firewalling registered
Clocks: disable unused i2c1
Clocks: disable unused emac
Clocks: disable unused mcasp
Clocks: disable unused aemif
Clocks: disable unused spi0
Clocks: disable unused spi1
Clocks: disable unused mcbsp0
Clocks: disable unused mcbsp1
Clocks: disable unused vpif
------------[ cut here ]------------
WARNING: at arch/arm/mach-davinci/da850.c:1178 da850_regulator_init+0x3c/0x58()
Unable to obtain voltage regulator for CVDD; voltage scaling unsupported
Modules linked in:
Backtrace:
[<c0031730>] (dump_backtrace+0x0/0x114) from [<c0321220>] (dump_stack+0x18/0x1c)
 r7:c1c23d40 r6:c0039540 r5:c03a7b16 r4:0000049a
[<c0321208>] (dump_stack+0x0/0x1c) from [<c0041b8c>] (warn_slowpath_common+0x50/
0x68)
[<c0041b3c>] (warn_slowpath_common+0x0/0x68) from [<c0041bf0>] (warn_slowpath_fm
t+0x30/0x38)
 r7:c1d68c00 r6:c043936c r5:c0404280 r4:c0420ccc
[<c0041bc0>] (warn_slowpath_fmt+0x0/0x38) from [<c0039540>] (da850_regulator_ini
t+0x3c/0x58)
 r3:c0411cac r2:c03a7b34
[<c0039504>] (da850_regulator_init+0x0/0x58) from [<c000f70c>] (davinci_cpu_init
+0x40/0xc0)
 r5:c0404280 r4:c1dd2300
[<c000f6cc>] (davinci_cpu_init+0x0/0xc0) from [<c0257a94>] (cpufreq_add_dev+0x15
4/0x41c)
 r5:c1dd2300 r4:00000000
[<c0257940>] (cpufreq_add_dev+0x0/0x41c) from [<c020683c>] (sysdev_driver_regist
er+0xb8/0x128)
[<c0206784>] (sysdev_driver_register+0x0/0x128) from [<c0256ba8>] (cpufreq_regis
ter_driver+0xf4/0x1a0)
 r6:c0406074 r5:c0402d90 r4:c0420cfc
[<c0256ab4>] (cpufreq_register_driver+0x0/0x1a0) from [<c000f6ac>] (davinci_cpuf
req_probe+0x90/0xb0)
 r5:c0402d90 r4:c0420cfc
[<c000f61c>] (davinci_cpufreq_probe+0x0/0xb0) from [<c0208f20>] (platform_drv_pr
obe+0x20/0x24)
 r5:c04034b0 r4:c04034b0
[<c0208f00>] (platform_drv_probe+0x0/0x24) from [<c0207f44>] (driver_probe_devic
e+0xb0/0x164)
[<c0207e94>] (driver_probe_device+0x0/0x164) from [<c0208060>] (__driver_attach+
0x68/0x8c)
 r7:c1d68c00 r6:c0406074 r5:c04034e4 r4:c04034b0
[<c0207ff8>] (__driver_attach+0x0/0x8c) from [<c0207704>] (bus_for_each_dev+0x50
/0x84)
 r7:c1d68c00 r6:c0406074 r5:c0207ff8 r4:00000000
[<c02076b4>] (bus_for_each_dev+0x0/0x84) from [<c0207da8>] (driver_attach+0x20/0
x28)
 r6:c0406074 r5:c0406074 r4:c0024d34
[<c0207d88>] (driver_attach+0x0/0x28) from [<c0206fdc>] (bus_add_driver+0xa4/0x2
30)
[<c0206f38>] (bus_add_driver+0x0/0x230) from [<c020837c>] (driver_register+0xb0/
0x13c)
[<c02082cc>] (driver_register+0x0/0x13c) from [<c020938c>] (platform_driver_regi
ster+0x4c/0x60)
 r9:00000000 r8:00000000 r7:00000001 r6:c000f5f8 r5:c0406060
r4:c0024d34
[<c0209340>] (platform_driver_register+0x0/0x60) from [<c02093c0>] (platform_dri
ver_probe+0x20/0xb4)
[<c02093a0>] (platform_driver_probe+0x0/0xb4) from [<c000f610>] (davinci_cpufreq
_init+0x18/0x24)
 r7:00000001 r6:c000f5f8 r5:00000000 r4:c0024d34
[<c000f5f8>] (davinci_cpufreq_init+0x0/0x24) from [<c002d3a4>] (do_one_initcall+
0x64/0x1c4)
[<c002d340>] (do_one_initcall+0x0/0x1c4) from [<c0008480>] (kernel_init+0xa8/0x1
2c)
 r7:00000000 r6:00000000 r5:00000000 r4:c0024d34
[<c00083d8>] (kernel_init+0x0/0x12c) from [<c00454a4>] (do_exit+0x0/0x6b4)
 r5:00000000 r4:00000000
---[ end trace 10fdf51caa867526 ]---
davinci_emac_probe: using random MAC addr: 66:a0:a2:27:c3:0d
emac-mii: probed
omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
Waiting for root device /dev/mmcblk0p2...

  • May be problem is due to I use SD card as storage for Linux image and root fs... I use SD card separated on 2 partitions. Partition 1 is FAT for store Linux image. And partition 2 is ext2 for root fs. Unfortunetly I can't use SPI flash like a propper storage for Linux image because flash size is only 2Mb on my device.

  • Did the SD card form change between EVM and custom board? If you moved from full sized SD to micro SD, you will have lost the card insert and write protect pins. In that case, you need to patch the kernel to assume that the card is always there and always writable.

  • Norman,

    thanks a lot for your answer! You gave me a right way to find the reason of problem! You are right we use microSD instead of full sized SD. I have enabled special feature in Linux kernel setup to support permanent card detection:

    Device Drivers --->

        <*>MMC/SD/SDIO card support --->

              [*] Assume MMC/SD cards are non-removable

    But it didn't gave a result.

    Then I compared CD (card detect) and WP (write protection) pins values beetwen EVM and my device. And I have found that for EVM CD pin value is 1 but for the device this pin is 0. WP pins are 0 for both devices. Then I patched board-da850-evm.c. I changed da850_evm_mmc_get_cd () function. I commented checking of DA850_MMCSD_CD_PIN (GPIO4_0) pin and said return 1 always:

    static int da850_evm_mmc_get_cd(int index)
    {
        //return !gpio_get_value(DA850_MMCSD_CD_PIN);
        return 1;
    }

    And it works! Micro SD is detected by Linux.

    Is my patch correct?

  • If the patch works for you, it's correct! My experience is with the OMAP-L137. I hard-coded the return values for da830_evm_mmc_get_ro() and da830_evm_mmc_get_cd(). It's been a while but I think it was 0 and 1 or vice versa. I also removed the pinmux of the CD and WP pins.