at91sam9g45 mmc driver probe fails with device tree

Discussion around AT91RM9200 and SAM9 Series Products.

Moderator: nferre

jay214128
Posts: 7
Joined: Fri Jan 23, 2015 3:29 am

at91sam9g45 mmc driver probe fails with device tree

Thu Mar 09, 2017 8:21 pm

I am upgrading the linux kernel on an older product using the at91sam9g45 MCU. The previous code did not use device tree and provided the MMC driver platform data from a board_xxx.c file. The new driver gets the platform data from DT, which seems to be working fine.

The mmc driver (drivers/mmc/host/atmel-mci.c) has changed and now the probe repeatedly fails with -EPROBE_DEFER. With the previous code, it would use PIO (no DMA, no PDC). I changed the kernel configuration to add CONFIG_AT_HDMAC and now the probe succeeds (using DMA), but the mmc device still does not work.

My root file system is on the SD Card in the mmc slot, so the kernel cannot mount the root FS.
Any ideas on how to fix this?
jay214128
Posts: 7
Joined: Fri Jan 23, 2015 3:29 am

Re: at91sam9g45 mmc driver probe fails with device tree

Fri Mar 10, 2017 12:40 am

I was able to get this working. I removed the CONFIG_AT_HDMAC configuration to match my original product and patched the atmel-mci.c driver to not try DMA when CONFIG_AT_HDMAC is not configured (like the old code did). A secondary issue I had was that I had added cd-inverted = <1>; to my dts file thinking the card detect was inverted, and changed it to cd-inverted = <0>; when I realized it was not. However, I discovered that since this is a boolean property, putting cd-inverted = anything results in true, which was wrong for my board. I remove the line completely and the card detect works.

Return to “SAM9 ARM9 MPU”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests