Merge pull request #2101 from VOGL-electronic/bios_spi_fix

bios: litespi: clear rx queue after write Beta
This commit is contained in:
enjoy-digital 2024-11-13 11:12:51 +01:00 committed by GitHub
commit 2b3fd723a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -111,6 +111,9 @@ static void spiflash_master_write(uint32_t val, size_t len, size_t width, uint32
spiflash_core_master_rxtx_write(val); spiflash_core_master_rxtx_write(val);
while (!spiflash_rx_ready()); while (!spiflash_rx_ready());
/* Clear RX queue. */
spiflash_core_master_rxtx_read();
/* Clear CS. */ /* Clear CS. */
spiflash_core_master_cs_write(0); spiflash_core_master_cs_write(0);
} }
@ -153,7 +156,7 @@ static uint32_t spiflash_read_id_register(void)
transfer_cmd(w_buf, buf, 4); transfer_cmd(w_buf, buf, 4);
#ifdef SPIFLASH_DEBUG #ifdef SPIFLASH_DEBUG
printf("[ID: %02x %02x %02x %02x]", buf[0], buf[1], buf[2], buf[3]); printf("[ID: %02x %02x %02x %02x]\n", buf[0], buf[1], buf[2], buf[3]);
#endif #endif
/* FIXME normally the status should be in buf[1], /* FIXME normally the status should be in buf[1],
@ -170,7 +173,7 @@ static uint32_t spiflash_read_status_register(void)
transfer_cmd(w_buf, buf, 4); transfer_cmd(w_buf, buf, 4);
#ifdef SPIFLASH_DEBUG #ifdef SPIFLASH_DEBUG
printf("[SR: %02x %02x %02x %02x]", buf[0], buf[1], buf[2], buf[3]); printf("[SR: %02x %02x %02x %02x]\n", buf[0], buf[1], buf[2], buf[3]);
#endif #endif
/* FIXME normally the status should be in buf[1], /* FIXME normally the status should be in buf[1],

View File

@ -97,6 +97,9 @@ static void spiram_master_write(uint32_t val, size_t len, size_t width, uint32_t
spiram_core_master_rxtx_write(val); spiram_core_master_rxtx_write(val);
while (!spiram_rx_ready()); while (!spiram_rx_ready());
/* Clear RX queue. */
spiflash_core_master_rxtx_read();
/* Clear CS. */ /* Clear CS. */
spiram_core_master_cs_write(0); spiram_core_master_cs_write(0);
} }