soc: software: liblitespi: enter quad mode before freq init

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
This commit is contained in:
Filip Kokosinski 2021-08-16 07:43:20 +02:00
parent 79ac09316a
commit ebc4ddc1e5
1 changed files with 2 additions and 7 deletions

View File

@ -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