Merge pull request #1004 from antmicro/liblitespi-freq-init
liblitespi: perform frequency initialization after entering quad/qpi mode
This commit is contained in:
commit
16f6f08d00
|
@ -84,15 +84,8 @@ static void spiflash_master_write(uint32_t val, size_t len, size_t width, uint32
|
||||||
|
|
||||||
void spiflash_init(void)
|
void spiflash_init(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
|
|
||||||
printf("Initializing %s SPI Flash...\n", SPIFLASH_MODULE_NAME);
|
printf("Initializing %s SPI Flash...\n", SPIFLASH_MODULE_NAME);
|
||||||
|
|
||||||
/* Clk frequency auto-calibration. */
|
|
||||||
ret = spiflash_freq_init();
|
|
||||||
if (ret < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Dummy bits setup. */
|
/* Dummy bits setup. */
|
||||||
#ifdef SPIFLASH_MODULE_DUMMY_BITS
|
#ifdef SPIFLASH_MODULE_DUMMY_BITS
|
||||||
spiflash_dummy_bits_setup(SPIFLASH_MODULE_DUMMY_BITS);
|
spiflash_dummy_bits_setup(SPIFLASH_MODULE_DUMMY_BITS);
|
||||||
|
@ -115,6 +108,8 @@ void spiflash_init(void)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Clk frequency auto-calibration. */
|
||||||
|
spiflash_freq_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue