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.

mmc trouble on Linux

Other Parts Discussed in Thread: TPS65910, TPS65217, TWL6030

Hi, I'm working on a board based on AM335x and vey similar to a beaglebone, but has 1Gbit eth.

I've dowloaded the linux sdk and build up both uboot and the kernel : I'm able to boot from ethernet but

not from sd card: when linux starts mmc device is not found: here the log of startup:

## Booting kernel from Legacy Image at 80007fc0 ...
   Image Name:   Linux-3.2.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2772872 Bytes = 2.6 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Linux version 3.2.0 (root@wsUttSmaLx) (gcc version 4.5.3 20110311
 (prerelease) (GCC) ) #1 Mon Apr 29 16:04:35 CEST 2013
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instructio
n cache
[    0.000000] Machine: am335xevm
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] AM335X ES1.0 (neon )
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pag
es: 65024
[    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 r
w rootfstype=ext3 rootwait ip=none
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 256MB = 256MB total
[    0.000000] Memory: 254084k/254084k available, 8060k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc04e4000   (4976 kB)
[    0.000000]       .init : 0xc04e4000 - 0xc051d000   ( 228 kB)
[    0.000000]       .data : 0xc051e000 - 0xc057a4b8   ( 370 kB)
[    0.000000]        .bss : 0xc057a4dc - 0xc05a27a8   ( 161 kB)
[    0.000000] NR_IRQS:396
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrup
ts
[    0.000000] Total of 128 interrupts on 1 active controller
[    0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
[    0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz
[    0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 13
1071999ms
[    0.000000] Console: colour dummy device 80x30
[    0.000183] Calibrating delay loop... 548.86 BogoMIPS (lpj=2744320)
[    0.048706] pid_max: default: 32768 minimum: 301
[    0.048858] Security Framework initialized
[    0.048980] Mount-cache hash table entries: 512
[    0.049438] CPU: Testing write buffer coherency: ok
[    0.070404] omap_hwmod: gfx: failed to hardreset
[    0.087127] omap_hwmod: pruss: failed to hardreset
[    0.088409] print_constraints: dummy:
[    0.088867] NET: Registered protocol family 16
[    0.091430] OMAP GPIO hardware version 0.1
[    0.094390] omap_mux_init: Add partition: #1: core, flags: 0
[    0.097045]  omap_i2c.1: alias fck already exists
[    0.098114]  omap2_mcspi.1: alias fck already exists
[    0.098388]  omap2_mcspi.2: alias fck already exists
[    0.099365]  edma.0: alias fck already exists
[    0.099365]  edma.0: alias fck already exists
[    0.099395]  edma.0: alias fck already exists
[    0.123748] bio: create slab <bio-0> at 0
[    0.126281] SCSI subsystem initialized
[    0.128204] usbcore: registered new interface driver usbfs
[    0.128601] usbcore: registered new interface driver hub
[    0.128906] usbcore: registered new device driver usb
[    0.129089] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3
[    0.129425] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1
[    0.148742] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
[    0.150451] tps65910 1-002d: could not be detected
[    0.153076] Switching to clocksource gp timer
[    0.172729] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
[    0.172943] musb-hdrc musb-hdrc.0: dma type: pio
[    0.173400] MUSB0 controller's USBSS revision = 4ea20800
[    0.174133] musb-hdrc musb-hdrc.0: USB OTG mode controller at d083c000 using
PIO, IRQ 18
[    0.174316] musb-hdrc musb-hdrc.1: dma type: pio
[    0.174682] MUSB1 controller's USBSS revision = 4ea20800
[    0.174835] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[    0.174926] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus numbe
r 1
[    0.175079] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    0.175109] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=
1
[    0.175109] usb usb1: Product: MUSB HDRC host driver
[    0.175140] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd
[    0.175140] usb usb1: SerialNumber: musb-hdrc.1
[    0.176147] hub 1-0:1.0: USB hub found
[    0.176177] hub 1-0:1.0: 1 port detected
[    0.176879] musb-hdrc musb-hdrc.1: USB Host mode controller at d083e800 using
 PIO, IRQ 19
[    0.177368] NET: Registered protocol family 2
[    0.177581] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.177947] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    0.178161] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[    0.178283] TCP: Hash tables configured (established 8192 bind 8192)
[    0.178283] TCP reno registered
[    0.178314] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.178344] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.178558] NET: Registered protocol family 1
[    0.178894] RPC: Registered named UNIX socket transport module.
[    0.178894] RPC: Registered udp transport module.
[    0.178894] RPC: Registered tcp transport module.
[    0.178924] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.179199] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.192565] VFS: Disk quotas dquot_6.5.2
[    0.192657] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.193359] msgmni has been set to 496
[    0.197174] alg: No test for stdrng (krng)
[    0.197967] io scheduler noop registered
[    0.197967] io scheduler deadline registered
[    0.198059] io scheduler cfq registered (default)
[    0.199462] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
[    0.744293] console [ttyO0] enabled
[    0.748779] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[    0.756744] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
[    0.764648] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
[    0.772491] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
[    0.780426] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
[    0.800018] brd: module loaded
[    0.809509] loop: module loaded
[    0.812896] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[    0.873657] No daughter card found
[    0.877288] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[    0.892517] Board name: A335TTRX
[    0.895904] Board version: 00A2
[    0.899200]
[    0.899200] The board is a TTRX100.
[    0.905364] tps65217 1-0024: TPS65217 ID 0xf version 1.2
[    0.913208] print_constraints: DCDC1: 900 <--> 1800 mV at 1800 mV
[    0.922027] print_constraints: DCDC2: 900 <--> 3300 mV at 1100 mV
[    0.930786] print_constraints: DCDC3: 900 <--> 1500 mV at 1100 mV
[    0.939544] print_constraints: LDO1: 1000 <--> 3300 mV at 1800 mV
[    0.948211] print_constraints: LDO2: 900 <--> 3300 mV at 3300 mV
[    0.956817] print_constraints: LDO3: 1800 <--> 3300 mV at 3300 mV
[    0.965576] print_constraints: LDO4: 1800 <--> 3300 mV at 3300 mV
[    0.972808]  omap_hsmmc.0: alias fck already exists
[    0.977966] HSMMC[0].omap_hsmmc (mmc1) INIT
[    0.983154] omap-gpmc omap-gpmc: GPMC revision 6.0
[    0.988220] Registering NAND on CS0
[    0.992736]  omap_i2c.3: alias fck already exists
[    1.013732] omap_i2c omap_i2c.3: bus 3 rev2.4.0 at 100 kHz
[    1.021087] registered am33xx_sr device
[    1.026977] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.034393] omap2-nand driver initializing
[    1.039031] ONFI flash detected
[    1.042449] ONFI param page 0 valid
[    1.046142] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron MT29F2G
08ABAFAWP)
[    1.054901] Creating 8 MTD partitions on "omap2-nand.0":
[    1.060485] 0x000000000000-0x000000020000 : "SPL"
[    1.067199] 0x000000020000-0x000000040000 : "SPL.backup1"
[    1.074523] 0x000000040000-0x000000060000 : "SPL.backup2"
[    1.081726] 0x000000060000-0x000000080000 : "SPL.backup3"
[    1.089019] 0x000000080000-0x000000260000 : "U-Boot"
[    1.096618] 0x000000260000-0x000000280000 : "U-Boot Env"
[    1.103729] 0x000000280000-0x000000780000 : "Kernel"
[    1.112457] 0x000000780000-0x000010000000 : "File System"
[    1.223815] OneNAND driver initializing
[    1.273742] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
[    1.280242] davinci_mdio davinci_mdio.0: detected phy mask ffffff7f
[    1.287750] TTRX100: PHY MICREL PATCH
[    1.291900] davinci_mdio.0: probed
[    1.295532] davinci_mdio davinci_mdio.0: phy[7]: device 0:07, driver Micrel K
S8001 or KS8721
[    1.304779] usbcore: registered new interface driver zd1201
[    1.310852] usbcore: registered new interface driver cdc_ether
[    1.317199] usbcore: registered new interface driver cdc_eem
[    1.323303] usbcore: registered new interface driver dm9601
[    1.329223] cdc_ncm: 04-Aug-2011
[    1.332824] usbcore: registered new interface driver cdc_ncm
[    1.338775] Initializing USB Mass Storage driver...
[    1.344177] usbcore: registered new interface driver usb-storage
[    1.350463] USB Mass Storage support registered.
[    1.355590] mousedev: PS/2 mouse device common for all mice
[    1.362182] omap_rtc omap_rtc: rtc core: registered omap_rtc as rtc0
[    1.369079] i2c /dev entries driver
[    1.377349] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    1.460083] cpuidle: using governor ladder
[    1.464996] cpuidle: using governor menu
[    1.469543] omap4_aes_mod_init: loading AM33X AES driver
[    1.475311] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02
[    1.481933] omap4_aes_probe: probe() done
[    1.486450] omap4_sham_mod_init: loading AM33X SHA/MD5 driver
[    1.492645] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03
[    1.505004] omap4_sham_probe: probe() done
[    1.512054] usbcore: registered new interface driver usbhid
[    1.517974] usbhid: USB HID core driver
[    1.522003] oprofile: hardware counters not available
[    1.527313] oprofile: using timer interrupt.
[    1.531860] nf_conntrack version 0.5.0 (3970 buckets, 15880 max)
[    1.538726] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.544464] TCP cubic registered
[    1.547882] NET: Registered protocol family 17
[    1.552612] Registering the dns_resolver key type
[    1.557647] VFP support v0.3: implementor 41 architecture 3 part 30 variant c
 rev 3
[    1.565734] ThumbEE CPU extension supported.
[    1.570312] mux: Failed to setup hwmod io irq -22
[    1.575958] Power Management for AM33XX family
[    1.580841] Trying to load am335x-pm-firmware.bin (60 secs timeout)
[    1.587585] Copied the M3 firmware to UMEM
[    1.592102] Compensating OPP0 for 0mV Orig nvalue:0x9a86f5 New nvalue:0x9a86f
5
[    1.599822] Compensating OPP1 for 0mV Orig nvalue:0x9a86f5 New nvalue:0x9a86f
5
[    1.608154] Compensating OPP0 for 0mV Orig nvalue:0x99968c New nvalue:0x99968
c
[    1.615875] Compensating OPP1 for 0mV Orig nvalue:0x998d81 New nvalue:0x998d8
1
[    1.623596] Compensating OPP2 for 0mV Orig nvalue:0x9a80e7 New nvalue:0x9a80e
7
[    1.631286] Compensating OPP3 for 0mV Orig nvalue:0xaaddc6 New nvalue:0xaaddc
6
[    1.639038] create_regulator: DCDC2: Failed to create debugfs directory
[    1.646728] smartreflex smartreflex: am33xx_sr_probe: Driver initialized
[    1.658996] clock: disabling unused clocks to save power
[    1.679382] Detected MACID=bc:6a:29:7f:a7:2f
[    1.685089] cpsw: Detected MACID = bc:6a:29:7f:a7:30
[    1.691528] omap_rtc omap_rtc: setting system clock to 2000-01-01 00:00:01 UT
C (946684801)
[    1.700866] Waiting for root device /dev/mmcblk0p2...

Any idea?

Thanks

M. Sangalli

  • Hi Mario.

    It looks like you are missing the card detect function running.  Following your log should be the text:

    mmc0: host does not support reading read-only switch. assuming write-enable.
    mmc0: new high speed SDHC card at address b368
    mmcblk0: mmc0:b368       7.45 GiB
    mmcblk0: p1 p

    which is generated when the card detect IRQ occurs.  Does gpio_cd in the board file's omap2_hsmmc_info match the GPIO used by your hardware?

    Regards,

        Steve

  • Hi, Steve, thank You for the hint : I think that should be the problem: my board has a uSD card but
    without the CD pin :-)
    I've disable it setting  it to EINVAL:   am335x_mmc[0].gpio_cd = -EINVAL;  but this do not works,
    so  I've programmed the GPIO pin in  PULL-DOWN mode,  assuming that in such case the card
    will be always detected as present,  but with no results....
    Any other suggestion?

    Thanks,

    Mario


    NB: I've attached the board start up file , from mach-omap2 I've changed to match my board

    7242.board-am335xevm.c


  • Hi Mario.

    EINVAL means that there's something other than a GPIO pin that's used for card detection.  But there still needs to be a card detect function.

    One problem with indicating an otherwise unused GPIO is that an interrupt won't be generated unless there's an edge.  Or if the GPIO is setup for level-triggered interrupt, then an interrupt will constantly be requested.

    Likely you can indicate your own card detect function that always returns true, assuming you are sure that the card will always be there.  Much better would be to add the connection between CD and a GPIO.  But to see how a non-GPIO detect function can work, see how board-omap4panda indicates a TWL6030 function for card detect.  This works in conjunction with the functions in drivers/mmc/host/omap_hsmmc.c.

    Regards,

        Steve

  • Steve, thanks for the help!

    I will check your suggestion to add some workaround to this problem: unfortunatly I cannot change
    the hardware at this stage.

    Btw, I was able to detect SD card adding this statement:   am335x_mmc[0].nonremovable = true;
    that problably will skip the CD input in some way, but I'm not sure that is the correct way to go on.

    Mario