SD card detect signal has wrong polarity for U-Boot 2013.07

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SD card detect signal has wrong polarity for U-Boot 2013.07

Jump to solution
1,302 Views
jjkropp-Triton
Contributor II

Hi,

Can someone point out in U-Boot code and give me some direction for changing the read-polarity of the SD Card Detect signal inputs on an i.MX53?

We changed to a locking mirco-SD card connector our our base-board and the polarity of the card-present signal is opposite than the older one.  We didn't put an inverter on the board(to save cost) and want to make the change in U-Boot code to fix this. I've done some digging in code and have a general understanding of what to do, but I would like some expert help.

I'm using a Karo TX53 moule with U-Boot 2013.07.

The signal inputs I need to change(invert) are SD1_CD - GPIO3[24],  and SD2_CD - GPIO3[25]

Thanks,

Labels (1)
0 Kudos
1 Solution
755 Views
jjkropp-Triton
Contributor II

Igor,

This pointed me in the right direction.

In the structure for my base-board called "tx53_esdhc_cfg" in the tx53.c file -  "cd_gpio" returns the status of the GPIO(3, 24) input pin.

I inverted the return value of the "board_mmc_getcd" function by changing:

"return !gpio_get_value(cfg->cd_gpio)"        to     "return gpio_get_value(cfg->cd_gpio)"    

I removed the "!" operator.

I need to do some cleanup for the 2nd MMC slot, but this worked for me.

Thanks for your help.

View solution in original post

0 Kudos
2 Replies
755 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jed

in fragment below one can change polarity

&esdhc1 {
cd-gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>;
fsl,wp-controller;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_esdhc1>;
status = "okay";
};

linux/imx53-tx53.dtsi at master · torvalds/linux · GitHub

also in uboot one can check function int board_mmc_getcd(struct mmc *mmc)

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

756 Views
jjkropp-Triton
Contributor II

Igor,

This pointed me in the right direction.

In the structure for my base-board called "tx53_esdhc_cfg" in the tx53.c file -  "cd_gpio" returns the status of the GPIO(3, 24) input pin.

I inverted the return value of the "board_mmc_getcd" function by changing:

"return !gpio_get_value(cfg->cd_gpio)"        to     "return gpio_get_value(cfg->cd_gpio)"    

I removed the "!" operator.

I need to do some cleanup for the 2nd MMC slot, but this worked for me.

Thanks for your help.

0 Kudos