AM335x - SD card detection code

Hi all,

I have a custom board that is a modified copy of beaglebone. I am running 3.2.33 kernel.

My problem is that the kernel doesn’t detect the SD Card when its booting. I realized the problem is caused by difference in SD card reader. Beaglebone uses card reader that a card detection switch. The switch is opened (pull-up; hence high) when it is empty, and switch is closed (shorted to ground; low) when card is inserted. In my board, the logic is reversed. I imagined this to be simple modification in the kernel, but cannot find where that card detection config / set-up is. I have looked in board-am335xevm.c file, and still looking around. No luck yet.

Could someone point me to which file to modify? or Is there a flowchart of kernel file chain that would show me which file/function linux kernel calls?

Best regards,

Jinsuk

Research CONFIG_BOOT_TRACER

There is also bootchart

both will render an .SVG graphic visualization of the kernel boot process

The configuration is present in board-am335xevm.c only,

Go inside function “mmc0_init()”, you will find function calls to “setup_pin_mux()”,

For common mmc pins along with write-protect and card-detect mmc pins. You need to

Change AM33XX_PIN_INPUT_PULLUP => AM33XX_PIN_INPUT_PULLDOWN

Thanks,

Vaibhav

Thanks for the help guys. I also posted on TI forum, and they were able to help me.

I needed to edit those two functions in this file /drivers/mmc/host/omap_hsmmc.c

omap_hsmmc_card_detect()

omap_hsmmc_get_cover_state()

Best regards,

Jin

Many possibilities, does uboot take SD card?

What do you mean by “take”?

Thanks,

Vaibhav

Can uboot read any SD card? can you boot uboot from SD card?

Yes, certainly. That’s the basic feature.

The boot sequence would be, ROM è MLO è u-boot.img è uImage

Thanks,

Vaibhav