Colibri VF 61 - U-Boot - How do I change the polarity of the SD card detection?

Hallo,

we have been using the Colibri VF 61 module together with the Viola carrier board for software development. We want to boot Linux from a micro SD card. This works well with the Viola carrier board. But now we like to switch to our custom board.

On the Viola carrier board the SD-card-detect signal goes from 1 to 0 if you plug a SD card. On our board the signal goes from 0 to 1. So the SD card is not recognized in U-Boot and booting fails. Like on the Viola board, on our board the signal is as well connected to the pin PTB20/SD-WakeUp.
When booting from network the SD card works fine in Linux as the SD-card-detection polarity can simply be changed in the device tree file. But in U-Boot, I think i need to change the sources in order to invert the sd-card-detection-polarity.

I’ve cloned the git repository git://git.toradex.com/u-boot-toradex.git and checked out the 2016.11-toradex branch.

Could you please show me where to change the SD-card-detection-polarity or provide a patch?
Our may be there is an configuration option?

Thanks in advance!

At least from the Colibri VF board file, the esdhc1 is considered as always connected, have a look at this.

I agree with Bhuvan here, it does not look like U-Boot is making use of card detect. What happens when you try to access the SD-card in U-Boot?

Hallo Bhuvan and Stefan,
you were completely right. It was not U-Boot but Linux stopping boot process when coming to root filesystem mount. The Linux device tree file installed on the SD card was simply missing the following line inverting polarity of the card detection signal.

&esdhc1 {
	cd-inverted;
};

I did not see this because until now I could’t use the serial interface of our board and watch the boot process. This was fixed by our electronic engineer this morning.

Glad it woks now, thanks for keeping us posted.