[U-Boot] ARM: zynq: sdhci clock frequency init question

Krunal Desai kdesai at planetaryresources.com
Fri Apr 25 18:19:38 CEST 2014


Hi all -

I noticed that in zynq_sdhci.c, responsible for initializing PS SD controller(s), host controller max clock frequency is always set to 52MHz (http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/mmc/zynq_sdhci.c;h=fdce2c2c10ec85c4a291532f927eae4a0b5627c9;hb=master#l34). In cases where user is using EMIO connectivity, max clock speed is limited to 25MHz. This results in out-of-spec operation as the divider calculation logic trusts the input to add_sdhci() and does not check the SLCR itself to confirm what the IO clock to SD controller actually is.

I think I saw OF/device-tree support patched in recently (I am on the 2013.4 tag); I think the "right" way to solve this is add capability in zynq_sdhci_init to read device-tree for 'clock-frequency' property, and use that to populate the arguments to add_sdhci() with that information, defaulting to a safe minimum (25MHz?) if no entry is found. Otherwise, I suppose a config could be added akin to 'ZYNQ_SD0_MIO'/'ZYNQ_SD1_MIO' to populate the correct minimum value.

Does this sound sane? I am thinking of implementing that as a patch for ourselves internally, but I think it will be of value to the greater community as well.

Thanks,
Krunal



More information about the U-Boot mailing list