Skip to content

[rram_ctrl] remove flash ctrl from EarlGrey - #30913

Open
gautschimi wants to merge 17 commits into
lowRISC:masterfrom
gautschimi:remove_flash_ctrl
Open

[rram_ctrl] remove flash ctrl from EarlGrey#30913
gautschimi wants to merge 17 commits into
lowRISC:masterfrom
gautschimi:remove_flash_ctrl

Conversation

@gautschimi

@gautschimi gautschimi commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

As per RFC , Earlgrey will be extended with support for RRAM based non-volatile memory.

This 7th integration PR removes flash_ctrl from Earl Grey and fixes remaining dependencies.

The following is done in this PR:

  • flash_ctrl is removed
    • top inst is removed
    • bkdr_loader flash targets are removed
    • adjust several files for the removed alerts/interrupts
    • removed flash targets in DV and verilator TB
  • flash_specific tests are excluded:
    • flash_ctrl_mem_protection_test_fpga_cw340_rom_with_fake_keys
    • flash_ctrl_write_clear_test_fpga_cw340_sival_rom_ext
    • flash_ctrl_info_access_lc_*_fpga_cw340_sival
    • flash_ctrl_idle_low_power_test_fpga_cw340_sival_rom_ext
    • flash_ctrl_idle_low_power_test_fpga_cw340_rom_with_fake_keys
    • flash_ctrl_ops_test
    • flash_ctrl_clock_freqs_test
    • flash_ctrl_test
  • host side unittests that are not yet ported to mock_rram are excluded:
    • bootstrap_unittest
    • bootstrap_fuzz_test
    • bootstrap_unittest_util
    • bootstrap_fuzzer_util
    • flash_exec_unittest
    • isfb_unittest
  • excluded a few flash specific tests for DV
    • chip_prim_tl_access
    • chip_sw_flash_init
    • chip_sw_inject_scramble_seed
  • Remaining DV tests are ported to RRAM
    • all_escalation_reset_test
    • chip_sw_rom_e2e_asm_init
  • Ported remaining C files to use RRAM instead of flash
    • rom_epmp_test
    • spi_device.c, spi_device_test.c
    • modify_digest.c
    • irq_asm.S
    • rv_dm_ndm_reset_req.c
  • removed some stale dependencies in BUILD files
    • that were still pulling in autogenerated files flash_ctrl_c_regs.h, and dif_flash_ctrl.h, flash_ctrl.h
  • adds a first version of the rram_exc_handler.
  • updates the Earl Grey README.md

@gautschimi
gautschimi requested review from a team and cfrantz as code owners August 4, 2026 08:30
@gautschimi
gautschimi requested review from engdoreis and hcallahan-lowrisc and removed request for a team August 4, 2026 08:30
@gautschimi
gautschimi marked this pull request as draft August 4, 2026 08:30
@gautschimi gautschimi changed the title Remove flash ctrl [rram_ctrl] remove flash ctrl from EarlGrey Aug 6, 2026
@gautschimi
gautschimi force-pushed the remove_flash_ctrl branch 3 times, most recently from 47842d7 to 542c061 Compare August 13, 2026 15:02
@gautschimi
gautschimi marked this pull request as ready for review August 13, 2026 15:28
@gautschimi
gautschimi force-pushed the remove_flash_ctrl branch 10 times, most recently from 2d43806 to e02d829 Compare August 14, 2026 16:56
@gautschimi gautschimi self-assigned this Aug 14, 2026
@gautschimi
gautschimi requested a review from a team as a code owner August 14, 2026 18:33
Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
@gautschimi

Copy link
Copy Markdown
Contributor Author

flash_ctrl is too big, verible lint fails because of too many deletions. The biggest contributors are autogen files:

Lines	File
4,523	pinmux/rtl/pinmux_reg_top.sv
3,590	alert_handler/rtl/alert_handler_reg_top.sv
2,070	pinmux/rtl/pinmux_reg_pkg.sv
2,052	pinmux/doc/registers.md
1,612	top_earlgrey.gen.hjson
1,291	xbar_main/rtl/autogen/xbar_main.sv
1,202	alert_handler/rtl/alert_handler_reg_pkg.sv
1,194	bkdr_loader/rtl/bkdr_loader_regs_reg_top.sv
742	rv_plic/rtl/rv_plic_reg_top.sv

Shall I try to split it up somehow or is it ok? @andreaskurth

@gautschimi
gautschimi force-pushed the remove_flash_ctrl branch 3 times, most recently from 878b024 to d6e15ab Compare August 15, 2026 18:08
This includes:
- sleep_pin_wake_test
- rv_dm_ndm_reset_req
- modify_digest
- irq_asm
- spi_device_unittest

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
There were a few tests that actually do not have a dependency on flash,
but still had flash_ctrl in its dependency tree.

spi_device was ported to use nvm_ctrl instead of flash_ctrl

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
Removing flash_ctrl removes 5 alerts and 6 interrupts.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
These tests need to be ported to use mock_rram_ctrl instead of
mock_flash_ctrl. With flash_ctrl removed, they don't build anymore.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
Flash has been removed for earlgrey. It can no longer be accessed by the
bkdr loader.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
This commit adds a first version of the rram_exc_handler.
The content of the rram_exc_handler will need to be further
developement (lowRISC#31010).

This commit also renames the flash_ecc_exc_handler_en to
nvm_ecc_exc_handler_en and puts the rram/flash_exc_handler at the
location of nvm_exception_handler.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
flash_ctrl has been removed, the flash bkdr targets are no longer
available.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
Everything is loaded into RRAM. This also removes the flash_ctrl test
from the verilotor testsuite as it can not pass anymore without
flash_ctrl.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
This section did not yet deduct the reserved_bytes per slot.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
This test tries to execute from uninitialized memory. Instead of relying
on a all-one(flash) or all-zero(RRAM) pattern for uninitialized words,
explicitly write the first and last position of the image with an
all-one pattern that will lead to an illegal instruction.

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
The alerts checks/triggers for the RRAM alerts are currently empty.
This is tracked in issue: (lowRISC#31009)

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
The flash_ctrl references have been removed as RRAM is the only
remaining NVM in Earl Grey.

The section about system reset handling with RRAM has been updated but
will need to be implemented in RTL (lowRISC#31015)

Signed-off-by: Michael Gautschi <mgautschi@lowrisc.org>
@gautschimi
gautschimi requested review from andreaskurth, glaserf, nasahlpa, thommythomaso and vogelpi and removed request for a team August 15, 2026 18:42
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.

1 participant