Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bios/spiflash: fix write/ erase, add write from sdcard and range erase #1677

Merged
merged 4 commits into from
Apr 26, 2023

Conversation

mntmn
Copy link

@mntmn mntmn commented Apr 25, 2023

When shipping MNT RKX7, I pre-flash the SPI flash with a LiteX bitfile
for testing. cmd_spiflash had regressed because of changed SPIFLASH defines
and didn't offer the write functions anymore. This commit fixes that, and
adds convenience functions:

  • flash_erase_range <offset> <count (bytes)>
  • flash_from_sdcard <filename>

The latter reuses some boot code to copy the contents of the specified
file from the boot FAT partition on the SD card to SPI flash (i.e.
a bitstream).

Some of the code is based on @norbertthiel's comment litex-hub/litespi#52
But edited to work with W25Q128JVS flash used in MNT RKX7.

Lukas F. Hartmann added 4 commits April 25, 2023 13:26
The code is based on norbert thiel's comment litex-hub/litespi#52
But edited to work with W25Q128JVS flash used in MNT RKX7.
… cmd

When shipping MNT RKX7, I pre-flash the SPI flash with a LiteX bitfile
for testing. cmd_spiflash had regressed because of changed SPIFLASH defines
and didn't offer the write functions anymore. This commit fixes that, and
adds convenience functions:

- flash_erase_range <offset> <count (bytes)>
- flash_from_sdcard <filename>

The latter reuses some boot code to copy the contents of the specified
file from the boot FAT partition on the SD card to SPI flash (i.e.
a bitstream).
@enjoy-digital
Copy link
Owner

Thanks @mntmn, nice features contribution! This looks good so let's merge.

@enjoy-digital enjoy-digital merged commit 34ec22f into enjoy-digital:master Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants