Changing GPIO pin for SD card detection


#1

Hello all,

We’ve recently received some new hardware based on the MangOH Red design. Unfortunately it seems our SD card detection GPIO pin is slightly different from the MangOH Red. This seems to be causing this: [ 10.398626] mmc0: No card detect facilities available

I spoke briefly with @dfrey about this and he suggested modifying kernel/arch/arm/mach-msm/board-9625.c but I haven’t seen anything SD card related in there. Also note I’ve been able to successfully rebuild and flash Yocto to my WP85.

Any help is greatly appreciated!


#2

SD card pin needs to be same as mangoh unless you want to dig into the SDIO driver(not recommended)


#3

Ah geeze, we are going to have to look at the SDIO driver, we made a mistake attaching it to a different gpio - it was due to the orientation of the WP chip and SD card reader that we made it this way.


#4

Thanks for the reply @asyal. How did you guys define this when designing the MangOH? Did you guys modify the SDIO driver to define the GPIO pin or just chose a standard GPIO pin?


#5

SDIO driver defines that GPIO functionality. We didnt modify it.


#6

So the driver has a spec for the GPIO pin and you guys just followed it?


#7

yes.
If you look carefully Green and Red, use the same GPIO pin.


#8

Thanks @asyal. I spoke with @coastalbrandon and it sounds like we’re stuck with this pin for now. I’m going to try and trace backwards from that log message I received.


#9

I’ve been looking around at old forum posts and lots of them seem to involve No card detect facilities available so I’m thinking this might be a false alarm of sorts.


#10

For the WPx5xx, the definition of the GPIO for SD card detection is in kernel/arch/arm/mach-msm/board-9615-storage.c

Look at GPIO_SDC1_HW_DET and how it is referenced. Keep in mind that 80 is the internal modem GPIO number, not the WP GPIO number. Look in gpiolib.c for the translation table.


#11

Perfect, thank you! I’ll give this a try later this afternoon.


#12

Hey all,

I made the change but there is still no mmc device in /dev. I’m still seeing mmc0: No card detect facilities available but like I said, I think this may be a somewhat expected error. I’m hoping to test a few different models of SD cards tomorrow.


#13

Where is GPIO42 connected to?


#14

It’s connected to a different digital input.