Skip to content

Commit

Permalink
bios: litespi: clear rx queue after write
Browse files Browse the repository at this point in the history
clear rx queue at the end of spiflash_master_write().

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
  • Loading branch information
maass-hamburg committed Oct 24, 2024
1 parent c122573 commit 63fa4fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions litex/soc/software/liblitespi/spiflash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
while (!spiflash_rx_ready());

/* Clear RX queue. */
spiflash_core_master_rxtx_read();

/* Clear CS. */
spiflash_core_master_cs_write(0);
}
Expand Down
3 changes: 3 additions & 0 deletions litex/soc/software/liblitespi/spiram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
while (!spiram_rx_ready());

/* Clear RX queue. */
spiflash_core_master_rxtx_read();

/* Clear CS. */
spiram_core_master_cs_write(0);
}
Expand Down

0 comments on commit 63fa4fd

Please sign in to comment.