Ask how to change sdio clocking rate

Hi there,

I am trying to do some test with Beceem WiMax card on SDIO port on
Beagleboard, but the card can not be detected as a MMC/SD card, and
thus WiMax driver is not loaded. After some investigating, I found
that the SDIO clock is 48MHz instead of 24MHz, which is supposed to
be. My question is how to modify the kernel to change the SDIO clock
to 24MHz.

Thanks in advanced,

Yan

I don't have the answer right away. I believe that could probably be
found in Chapter 4 (Power, Reset and Clock management) of OMAP35x
Applications Processor, Technical Reference Manual.
I was checking the Registers in Section 4.14 but I couldn't find the
answer.
If I see something later, I will post it here.
Frederico

I don't have the answer right away. I believe that could probably be
found in Chapter 4 (Power, Reset and Clock management) of OMAP35x
Applications Processor, Technical Reference Manual.
I was checking the Registers in Section 4.14 but I couldn't find the
answer.

First of all: please don't touch anything related to chapter 4 for this...
:slight_smile:

As a quick hack you can hardcode/change it in: drivers/mmc/host/omap_hsmmc.c
Look for the CLKD bits 15:6 in the MMCHS_SYSCTL register, which decides the
clock divider for the MMC interface.

if (ios->clock) {
                dsor = OMAP_MMC_MASTER_CLOCK / ios->clock;
                if (dsor < 1)
                        dsor = 1;

                if (OMAP_MMC_MASTER_CLOCK / dsor > ios->clock)
                        dsor++;

                if (dsor > 250)
                        dsor = 250;
        }

More info to be found in the TRM - spruf98g.pdf :slight_smile:

That being said I think the Linux MMC/SD/SDIO driver system is supposed to
determine the maximum supported speed by reading the capabilities for the
device attached. If you therefore experience a 48MHz clock I think the
device is reporting a wrong maximum speed (in case maximum really is 24MHz
:slight_smile:

More relevant info for SDIO cards ca be found in drivers/mmc/core/sdio.c as
well

Good luck
  Søren