FSBL SD Card Driver Does Not Work With 100Mhz Clock
I am trying to change the SD peripheral clock from 125Mhz to 100Mhz. The lower frequency is actually faster as lower dividers can ben chosen. My code base is 2014.3.
ps2_init.c Changes 3 occurences of EMIT_MASKWRITE(0XF8000150, 0x00003F33U ,0x00000C01U), to EMIT_MASKWRITE(0XF8000150, 0x00003F33U ,0x00000F01U), Results in divider changing from 12 to 15. Clock changes from 1500/12=125 to 1500/15=100.
ps2_init.h Change this from #define SDIO_FREQ 125000000 to #define SDIO_FREQ 100000000 It does not really matter as I cannot find any code that uses it.
xparameters.h Change from #define XPAR_PS7_SD_0_SDIO_CLK_FREQ_HZ 125000000 #define XPAR_XSDPS_0_SDIO_CLK_FREQ_HZ 125000000 to #define XPAR_PS7_SD_0_SDIO_CLK_FREQ_HZ 100000000 #define XPAR_XSDPS_0_SDIO_CLK_FREQ_HZ 100000000
chk_mounted() -check_fs() --disk_read() ---XSdPs_ReadPolled() fails with DCRC error.
A clock of 125Mhz actually results in a 15.625Mhz= 125/8. A lot lower than the requested 25Mhz. A clock of 100Mhz results in a clock of 25Mhz = 100/4. I tried 100/8 for a clock of 12.5Mhz. Still does not work.
The u-boot and linux SD card drivers work perfectly with 100Mhz as well as with older cards.