This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x Weird MMC CD issue

I am having some weird issue with the Card Detect line on MMC 0.  When i turn the PULLUP on it works, but when i turn it off it works sporadically.  It will work on some boots and not on others : /.  If it works on a power up then it always works.  I have an external pull-up so i shouldn't need the internal one and the reason i need to turn it off is because i have boards with 2 different types of sockets (one open when card is inserted and one closed).  Any ideas why this would be?

Works:

{"gpmc_a11.gpio1_27", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT_PULLUP},

Doesn't work:

{"gpmc_a11.gpio1_27", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},

There is a 10K external pull-up.  Any thoughts?

  • Hi Jarrod,

    Pin GPMC_A11 has an internal pulldown enabled by default. Can you check if this isn't pulling your CD signal to an invalid level?
  • Biser,

    Thanks for the reply!  The pulldown is disabled, the AM33XX_PIN_INPUT macro expands to: (AM33XX_INPUT_EN | AM33XX_PULL_DISA) where:

    #define AM33XX_PULL_DISA (1 << 3)

    #define AM33XX_INPUT_EN (1 << 5)

    I put a scope on to be sure and with no microSD the CD line pretty close to 0v and with the card it it was reading 3.27V and the all my IO power rails are set to 3.3V.  I guess i was lacking some info in my original post too.  I have inverted polarity for the card detect, so high = inserted.  here is my schematic (S to G is open when a card is inserted and closed when there is no card):

    I am running Linux 3.2 from PSP 7.00.  It is really weird because i see no difference in voltage levels on the CD line with or without the internal pullup enabled, but it doesn't work with it off : /.  I think it seems to work when i mess with the card in U-Boot first, but i need to investigate this more.  It is really weird because there is an external pullup so you would think disabling the internal one would be irrelevant...

    Thanks,

    Jarrod

  • Well... I disabled the pullup again, cleaned, and rebuilt the kernel today with the and now everything is running like a champ.... I must have goofed something up last night. I guess that is what i get for trying to rush some stuff at the end of the day : /. Sorry for wasting your time Biser!