Hey everyone
I have setup an AM3517 with X-loader, u-boot and Linux (2.6.32) and I'm trying to get the MMC/SD slot working. I have adjusted the pinmux according to my hardware (no WP pin and a custom CD pin on GPIO 99). Furthermore I have to enable power to the MMC/SD slot by setting GPIO 97 to high for which I have added the following code to mmc-am3517evm.c in am3517_mmc_init():
if (gpio_is_valid(97)) { gpio_request(97, "mmc_pwr"); gpio_direction_output(97, 1); } else pr_warning("MMC%d: unable to enable power", c->mmc);
I have checked that both the mmc_pwr and the mmc_cd pins have been properly initialized by looking into /sys/kernel/debug/gpio which lists
gpio-97 (mmc_pwr ) out hi gpio-99 (mmc_cd ) in lo irq-259 edge-both
The card detect logic works (I've added some debug output into mmc-am3517evm.c) and the "lo" of mmc_cd in above output changes to "hi" when I pull the SD card out of the slot (and vice versa).
But the SD card is not detected. dmesg shows the following output during startup:
mmci-omap-hs mmci-omap-hs.0: mmc_fclk: enabled mmci-omap-hs mmci-omap-hs.0: context was not lost mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0 mmci-omap-hs mmci-omap-hs.0: mmc_fclk: disabled mmci-omap-hs mmci-omap-hs.0: mmc_fclk: enabled mmci-omap-hs mmci-omap-hs.0: context was not lost mmc0: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 19 width 0 timing 0 mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 19 width 0 timing 0 mmc0: clock 400000Hz busmode 1 powermode 2 cs 1 Vdd 19 width 0 timing 0 mmc0: starting CMD0 arg 00000000 flags 000000c0 mmci-omap-hs mmci-omap-hs.0: mmc0: CMD0, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req done (CMD0): -110: 00000000 00000000 00000000 00000000 mmc0: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 19 width 0 timing 0 mmc0: starting CMD8 arg 000001aa flags 000002f5 mmci-omap-hs mmci-omap-hs.0: mmc0: CMD8, argument 0x000001aa mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req done (CMD8): -110: 00000000 00000000 00000000 00000000 mmc0: starting CMD5 arg 00000000 flags 000002e1 mmci-omap-hs mmci-omap-hs.0: mmc0: CMD5, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req failed (CMD5): -110, retrying... mmci-omap-hs mmci-omap-hs.0: mmc0: CMD5, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req failed (CMD5): -110, retrying... mmci-omap-hs mmci-omap-hs.0: mmc0: CMD5, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req failed (CMD5): -110, retrying... mmci-omap-hs mmci-omap-hs.0: mmc0: CMD5, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req done (CMD5): -110: 00000000 00000000 00000000 00000000 mmc0: starting CMD55 arg 00000000 flags 000000f5 mmci-omap-hs mmci-omap-hs.0: mmc0: CMD55, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000 mmc0: starting CMD55 arg 00000000 flags 000000f5 mmci-omap-hs mmci-omap-hs.0: mmc0: CMD55, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000 mmc0: starting CMD55 arg 00000000 flags 000000f5 mmci-omap-hs mmci-omap-hs.0: mmc0: CMD55, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000 mmc0: starting CMD55 arg 00000000 flags 000000f5 mmci-omap-hs mmci-omap-hs.0: mmc0: CMD55, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req done (CMD55): -110: 00000000 00000000 00000000 00000000 mmc0: starting CMD1 arg 00000000 flags 000000e1 mmci-omap-hs mmci-omap-hs.0: mmc0: CMD1, argument 0x00000000 mmci-omap-hs mmci-omap-hs.0: IRQ Status is 38000 mmci-omap-hs mmci-omap-hs.0: MMC IRQ 0x38000 : ERRI CTO CCRC mmc0: req done (CMD1): -110: 00000000 00000000 00000000 00000000 mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0 mmci-omap-hs mmci-omap-hs.0: mmc_fclk: disabled
In my kernel I have enabled MMC/SD support with MMC debugging, MMC block device driver and TI OMAP High Speed Multimedia Card Interface support as a module. When booting linux the following kernel modules are auto-loaded:
- mmc_core
- mmc_block
- omap_hsmmc
Another odd thing is that when I build my kernel with MMC/SD support built-in (not as kernel modules) the kernel doesn't load i.e. nothing happens after u-boot prints out
Starting kernel ...
Any ideas/suggestions are welcome. Please let me know if you need any additional information.