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

Add feature to skip clearing SRAM in ROM. #1622

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rom/dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ itrng = ["caliptra-hw-model/itrng"]
verilator = ["caliptra-hw-model/verilator"]
no-fmc = []
fake-rom = []
skip-clear-sram = []
no-cfi = ["caliptra-image-verify/no-cfi", "caliptra-drivers/no-cfi"]
slow_tests = []
"hw-1.0" = ["caliptra-builder/hw-1.0", "caliptra-drivers/hw-1.0", "caliptra-registers/hw-1.0", "caliptra-hw-model/hw-1.0"]
Expand Down
4 changes: 4 additions & 0 deletions rom/dev/src/start.S
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ _start:
andi t1, t1, 0x3
bne t1, x0, post_ecc_init

#ifndef CARGO_FEATURE_SKIP_CLEAR_SRAM
//
// Cold Boot
//
Expand All @@ -117,6 +118,7 @@ _start:
la a0, DCCM_ORG // dest
la a1, DCCM_SIZE // len
call _zero_mem256
#endif // CARGO_FEATURE_SKIP_CLEAR_SRAM

post_ecc_init:

Expand Down Expand Up @@ -354,9 +356,11 @@ exit_rom:

// Save the FMC address
addi a3, a0, 0
#ifndef CARGO_FEATURE_SKIP_CLEAR_SRAM
la a0, STACK_ORG // dest
la a1, STACK_SIZE // len
call _zero_mem256
#endif // CARGO_FEATURE_SKIP_CLEAR_SRAM

// Clear all registers
li x1, 0; li x2, 0; li x3, 0; li x4, 0;
Expand Down
Loading