Skip to content

Commit 49af692

Browse files
clayton8calebofearthkedjenksekarabunileshbpat
authored
[VAL] Add MCU SRAM Byte Test and Prot Region Test (#223)
* [RTL, TB] Route MCU interrupts to top-level for override; cleanup testbench (#195) * Remove unused axi ifs, TB interrupt control logic, and ICCM components * Dummy tweak to axi2tlul compile * Whitespace * Fix a display about i3c wait time * Add comment to trigger file-list check * Restore axi2tlul compile.yml * Connect external interrupts for MCU to top-level for integrator override * Use central command list/params to define TB services behavior * Whitespace * Use central soc_address_map.h and remove duplicates * Generate caliptra_ss_clk_freq with default value for all tests so it doesn't cause compile failures * Rename clk freq variable * Revert test rename from merge conflict * [Val][RTL] Add MCU Mbox Tests and Fix Mbox1 Grant Bug (#200) * User/dev/ekarabulut/caliptra jtag manuf (#187) * added caliptra+mcu UDS c test * caliptra-rom is implemented with C test * updated uds based addr * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/ekarabulut/caliptra_JTAG_manuf' with updated timestamp and hash after successful run * added manuf smoke test * updated uds_test for full fuse write * adjusted completion time of tcl * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/ekarabulut/caliptra_JTAG_manuf' with updated timestamp and hash after successful run * added header comments * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/ekarabulut/caliptra_JTAG_manuf' with updated timestamp and hash after successful run * [RTL] Enable assertions for SS Integration TB (#158) * Enable assertions for SS Integration TB * Merge with TOT * Add missing driver for rst_mbox_lock_req There was a bad merge that didn't cause regressions to fail. Added back the missing logic * Add WUSER driver in LCC and FC We either need to verify these tieoffs of connect them to AXI interconnect * MICROSOFT AUTOMATED PIPELINE: Stamp 'ckuchta-mcu-sram-val' with updated timestamp and hash after successful run * Remove old assertions * Remove stale LIBS_MCI_DIR now in COMP_LIB_NAMES * Add back sb_axi_wvalid port connection to MCU Inadvertently removed this port in caliptra_ss_top.sv * Clean up AXI user connections at SS top Moved all user connections to a single location. Also, removed the MCU DMA AXI IF since it is unused in our design and reduce overhead of maintaining connections to MCU DMA that is unused plus having to add tieoffs to an interface that is unused. * Enable RUSER in axi interconnect * Add MCU hitless update hanshake to CSS HW spec and strap restrictions * Update MCI Boot FSM with MCU halt handshake states Halt handshake is needed to ensure MCU is halted and idle before reset is asserted. Otherwise there could be outstanding AXI transaction when MCU is reset by MCI. * Add halt/ack handshake between MCU and MCI * change "warm reset" to "cold reset" for MCI boot update We have a bug where FW_BOOT_UPD_RESET should be tracking the first update since cold reset, not warm reset. Updated the spec to match what HW should be doing. * Revert back cold reset to warm reset in MCI reset reason register I believe we should be tracking warm reset since Caliptra is reset on MCI warm reset and the FW_EXEC register is reset on warm reset. * Update docs/CaliptraSSHardwareSpecification.md Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> * Update docs/CaliptraSSHardwareSpecification.md Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> * Update docs/CaliptraSSHardwareSpecification.md Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> * Fix grammar per PR review * Clarify hitless update types * Add MCU MBOX Tests and Fix MBOX Lock Clearing Detection (#181) * -Fix mailbox release detection to be based on valid SW write and data being 0 (instead of value edge detect). -Update MBOX clearing to explicitly call out writing 0 to EXECUTE register. * -Add MCU MBOX smoke test with MCU and Caliptra both acquiring and reading/writing MBOX. -Add MCU MBOX lock return one during zeroize test. -Update MCU MBOX zeroize smoke test for new infra. -Add MCU MBOX tests to L0. * -Add MBOX CSRs are zero after lock release test. -Fix mbox_status CSR to reset on MBOX lock release. * Remove OtpKeymgrKeyKnown_A assertion since otp_broadcast_o doesn't exist * Fix Caliptra SS assertions Include caliptra_ss_assertion_overrides.svh in caliptra_ss_top_tb.sv. I think it was removed with a merge. Disable additional assertsions showing up in a TB Fuse module with a FIXME to remove and tagged with a github issue. * Fix decode issue where MBOX1 was granted when MBOX0 targeted * Fix build issue, duplicate assertion names * MICROSOFT AUTOMATED PIPELINE: Stamp 'ckuchta-mcu-sram-val' with updated timestamp and hash after successful run --------- Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> Co-authored-by: kedjenks <kedjenks@gmail.com> * Add new test for I3C and Streaming boot (#161) * Initial test code for bringup with local caliptra-core images * Ending quote - syntax * Reorganize ai3c tests * Rename ai3ct test as svh, since it's an include * Add a top-level include file that grabs all css ai3c tests * Remove recipe for program.hex * Add caliptra subsystem macro to compile.yml; update test-suites with plusargs/pre_exec * Fix user signals and config so design boots with Caliptra ROM * Use DEBUG_OUT as STDOUT in ss sims * Regenerate RDL files and update workflow to catch out of date RDL * Unique AxUSER for Caliptra, MCU-LSU, and MCU-IFU * Fixes to get cptra_ss_i3c_recovery pre-exec working * Initialize data/bss/STACK to DCCM, as the MCU SRAM is locked at startup * Remove cptra AxUSER force; TMP: set cptra AxUSER as SOC CONFIG user * Update RTL submodule to pull fw_test_rom updates * Add explanatory note/TODO on LSU user * Revert changes to mcu_hello_world -- it's a defunct test * Makefile cleanup * Rename top test list file * Reorganize the libs area * Move mcu bringup tasks to shared lib file; update Makefile to init data to DCCM and build libs * Roll back the USER/linker modifications to isolate just the methodology changes * Update testfile yml for all smoke tests * Whitespace * Hello world testcase that shows caliptra-core fw built from caliptra-ss repo * Don't build caliptra_isr for MCU - that's a caliptra-core file * Revert USER changes in i3c test * MICROSOFT AUTOMATED PIPELINE: Stamp 'cwhitehead-msft-local-testcode-PoC' with updated timestamp and hash after successful run * I3C reg rd wr and caliptra streaming boot test rom * Removed the global switch * resolved conflicts. * Resolved conflicts. * Reg read write test updated to read and or write all the reg * Added Streaming boot random test * Added updates for Random and reg read write test * Cleanup commit * Removed Debug log * Updated for randomized block size * Add MCU MBOX Tests and Fix MBOX Lock Clearing Detection (#181) * -Fix mailbox release detection to be based on valid SW write and data being 0 (instead of value edge detect). -Update MBOX clearing to explicitly call out writing 0 to EXECUTE register. * -Add MCU MBOX smoke test with MCU and Caliptra both acquiring and reading/writing MBOX. -Add MCU MBOX lock return one during zeroize test. -Update MCU MBOX zeroize smoke test for new infra. -Add MCU MBOX tests to L0. * -Add MBOX CSRs are zero after lock release test. -Fix mbox_status CSR to reset on MBOX lock release. * Added support for Caliptra Test build in Makefile vcs * Disabled internal scoreboard for VIP --------- Co-authored-by: Caleb Whitehead <cwhitehead@microsoft.com> Co-authored-by: kedjenks <kedjenks@gmail.com> * -Add MCU Mbox Valid User Smoke Test -Add MCU Mbox Write During User Lock Smoke Test -RTL Bug Fix for Incorrect Mbox1 grant connection. * Merge branch 'msft-daily-2025-03-28' of ssh://github.com/chipsalliance/caliptra-ss into user/dev/keithjenkins/mbox_val_1 # Conflicts: # src/integration/stimulus/testsuites/caliptra_ss_master_test_list.csv * Merge branch 'msft-daily-2025-03-28' of ssh://github.com/chipsalliance/caliptra-ss into user/dev/keithjenkins/mbox_val_1 # Conflicts: # src/integration/stimulus/testsuites/caliptra_ss_master_test_list.csv * [DOCS] Update README with simulation instructions, env vars (#184) * Replace instances of the deprecated var CALIPTRA_SS with CALIPTRA_SS_ROOT (removes duplicate variables) * Remove duplicate macros * Document sim-flow, env var setup, and AXI4PC requirement * Formatting updates regarding note on AXI4PC * Clarification on axi4pc version * Fix a grammar error * Apply suggested updates to text about acquiring Axi4PC Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Run RDL check for all PRs, not just to main * Document that some CALIPTRA_TESTNAME code may be in its own directory in caliptra-ss * Regenerate reg map --------- Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Rename test * Rename. * -Refactor MCU mbox test code to move some functions to ss_lib -Address PR comment feedback * Address stride fix for AXI CFG registers * PR feedback: -Remove unneeded soc_address_map.h * Fix bad merge conflict * Address PR feedback -Move CMD_Available interrupt to wait for execute function -Add RW1C interrupt clear and checking --------- Co-authored-by: EMRE KARABULUT <63821295+ekarabu@users.noreply.github.com> Co-authored-by: clayton8 <ckuchta@microsoft.com> Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> Co-authored-by: Nilesh Patel <142342517+nileshbpat@users.noreply.github.com> Co-authored-by: Caleb Whitehead <cwhitehead@microsoft.com> Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Add MCU SRAM byte write test with new MCI lib C files * Add smoke_test_mcu_sram_byte_write to regressions * Add MCU SRAM Protected Region test to regression Random test that does positive and negative testing on the MCU SRAM protected region. Some new C commands were needed to disable assertions in MCU SRAM when doing negative testing. A new soc_ifc_ss library was added for Caliptra Core C code to use. * [fuse_ctrl, test] caliptra _ss _fuse_ctrl_unexpected_reset (#215) * [fuse_ctrl, mmap] Split debug unlock key fuses Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> * [fuse_ctrl, test] caliptra_ss_fuse_ctrl_unexpected_reset Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> * [fuse_ctrl, axi] Adapt AXI ranges to new MMAP Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> * [fuse_ctrl, test] Use random seed in config files Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> * MICROSOFT AUTOMATED PIPELINE: Stamp 'lowrisc_caliptra_ss_fuse_ctrl_unexpected_reset' with updated timestamp and hash after successful run --------- Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> Co-authored-by: Andrea Caforio (LOWRISC C I C) <v-acaforio@microsoft.com> * Fix smoke_test_mcu_sram_protected_region Missing comment // in smoke_test_mcu_sram_protected_region.c Changed DMA error message to be DMA Err preventing regex test failure * Update src/integration/test_suites/libs/soc_ifc_ss/soc_ifc_ss.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix typo protection -> pretected * MICROSOFT AUTOMATED PIPELINE: Stamp 'ckuchta-mcu-sram-test' with updated timestamp and hash after successful run * Add random tests for Caliptra SS and update regression yaml generation script to generate nightly random regression yaml file. Update regression yaml files for new tests (#226) * Fix MCI REG config locking * [TB] Add LCC random tests (#225) * [fuse_ctrl, script] Move to common directory This commit moves the gen_fuse_ctrl_partitions scripts to a common fuse_ctrl_script directory such that the lib can be reused by other scripts. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [fuse_ctrl, script] Add VMEM generation script This commit adds a script that generated VMEM files that can be loaded into the fuse controller. The life cycle state, counter, and the transition token can be programed by using cmd line arguments. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, lib] Extend lc_ctrl library This commit adds functions to the lc_ctrl library that could be useful for different tests. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] LCC transition test This commit adds a simple LCC transition test. The test reads the current LCC state and tries to jump into the next one. By using the script tools/scripts/fuse_ctrl_script/design/gen_fuse_ctrl_vmem.py different starting LC states and unlock tokens can be tested. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [fuse_ctrl, script] Allow to configure multiple tokens This commit extends the VMEM generation script such that multiple tokens can be programmed into OTP vmem. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Add README to caliptra_ss_lcc_st_trans This commit adds a README to guide the user to run the test. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Add smoke_test_lcc_kmac_kat As the KMAC core is inside the lc_ctrl and there is no direct access for SW, this test indirectly tests the KMAC output. - Step 1: gen_fuse_ctrl_vmem.py parses the unhashed token from test_unlock_token.hjson and writes them hashed into the otp-img.2048.vmem file - Step 2: smoke_test_kmac_kat.c contains the same unhashed tokens. The test performs state transitions from TEST_LOCKED0 to PROD_END. If the state transition was successful, the unhashed token was correctly hashed by the KMAC block and matches the hashed token that was generated by the SHAKE reference implementation in gen_fuse_ctrl_vmem.py Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [fuse_ctrl, script] Random parameter generation This commit extends the gen_fuse_ctrl_vmem script such that the unlock tokens, the LC counter, and LC state can be generated randomly. Moreover, a C header file can be generated that contains the unhased tokens that are programmed into VMEM. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Randomly generate unlock tokens This commit extends the test run script such that the gen_fuse_ctrl_vmem.py script is used to randomize the state transition unlock tokens. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Randomize caliptra_ss_lcc_st_trans This test randomizes the caliptra_ss_lcc_st_trans test by calling the gen_fuse_ctrl_vmem.py script that will put a random LC_STATE and LC_CNT into the otp vmem file. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Switch mode of tests - caliptra_ss_lcc_st_trans: Use random LC state & LC counter but fixed unlock tokens - smoke_test_lcc_kmac_kat: Use random unlock token but fixed starting LC state and LC counter Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Switch mode of tests - caliptra_ss_lcc_st_trans: Use random LC state & LC counter but fixed unlock tokens - smoke_test_lcc_kmac_kat: Use random unlock token but fixed starting LC state and LC counter Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl,dv] Add covergroups for LC_CNT and LC_STATE This commit adds simple covergroups for the LC counter value and LC state. Bins are added to make sure that all possible states and counters have been seen. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, sw] Fix LC_CTRL STATUS INIT/READY mask LC_CTRL.STATUS.READY should be bit 1 in the bit field and LC_CTRL.STATUS.INIT should be bit 0 in the bit field. Closes #177 Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * updated .vf file * [script] Add additional python requirements Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl,test] Use error function when expecting an error Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl,test] Use error function when expecting an error Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Use PB Random Seed To generate the randomized OTP VMEM image. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * added vf files with new sim_tools --------- Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> Co-authored-by: Pascal Nasahl <nasahlpa@lowrisc.org> * Fix C build issue * [TB] Add MCU_SRAM -> SHA Accel test case (using DMA assist) (#222) * [RTL, TB] Route MCU interrupts to top-level for override; cleanup testbench (#195) * Remove unused axi ifs, TB interrupt control logic, and ICCM components * Dummy tweak to axi2tlul compile * Whitespace * Fix a display about i3c wait time * Add comment to trigger file-list check * Restore axi2tlul compile.yml * Connect external interrupts for MCU to top-level for integrator override * Use central command list/params to define TB services behavior * Whitespace * Use central soc_address_map.h and remove duplicates * Generate caliptra_ss_clk_freq with default value for all tests so it doesn't cause compile failures * Rename clk freq variable * Revert test rename from merge conflict * [Val][RTL] Add MCU Mbox Tests and Fix Mbox1 Grant Bug (#200) * User/dev/ekarabulut/caliptra jtag manuf (#187) * added caliptra+mcu UDS c test * caliptra-rom is implemented with C test * updated uds based addr * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/ekarabulut/caliptra_JTAG_manuf' with updated timestamp and hash after successful run * added manuf smoke test * updated uds_test for full fuse write * adjusted completion time of tcl * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/ekarabulut/caliptra_JTAG_manuf' with updated timestamp and hash after successful run * added header comments * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/ekarabulut/caliptra_JTAG_manuf' with updated timestamp and hash after successful run * [RTL] Enable assertions for SS Integration TB (#158) * Enable assertions for SS Integration TB * Merge with TOT * Add missing driver for rst_mbox_lock_req There was a bad merge that didn't cause regressions to fail. Added back the missing logic * Add WUSER driver in LCC and FC We either need to verify these tieoffs of connect them to AXI interconnect * MICROSOFT AUTOMATED PIPELINE: Stamp 'ckuchta-mcu-sram-val' with updated timestamp and hash after successful run * Remove old assertions * Remove stale LIBS_MCI_DIR now in COMP_LIB_NAMES * Add back sb_axi_wvalid port connection to MCU Inadvertently removed this port in caliptra_ss_top.sv * Clean up AXI user connections at SS top Moved all user connections to a single location. Also, removed the MCU DMA AXI IF since it is unused in our design and reduce overhead of maintaining connections to MCU DMA that is unused plus having to add tieoffs to an interface that is unused. * Enable RUSER in axi interconnect * Add MCU hitless update hanshake to CSS HW spec and strap restrictions * Update MCI Boot FSM with MCU halt handshake states Halt handshake is needed to ensure MCU is halted and idle before reset is asserted. Otherwise there could be outstanding AXI transaction when MCU is reset by MCI. * Add halt/ack handshake between MCU and MCI * change "warm reset" to "cold reset" for MCI boot update We have a bug where FW_BOOT_UPD_RESET should be tracking the first update since cold reset, not warm reset. Updated the spec to match what HW should be doing. * Revert back cold reset to warm reset in MCI reset reason register I believe we should be tracking warm reset since Caliptra is reset on MCI warm reset and the FW_EXEC register is reset on warm reset. * Update docs/CaliptraSSHardwareSpecification.md Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> * Update docs/CaliptraSSHardwareSpecification.md Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> * Update docs/CaliptraSSHardwareSpecification.md Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> * Fix grammar per PR review * Clarify hitless update types * Add MCU MBOX Tests and Fix MBOX Lock Clearing Detection (#181) * -Fix mailbox release detection to be based on valid SW write and data being 0 (instead of value edge detect). -Update MBOX clearing to explicitly call out writing 0 to EXECUTE register. * -Add MCU MBOX smoke test with MCU and Caliptra both acquiring and reading/writing MBOX. -Add MCU MBOX lock return one during zeroize test. -Update MCU MBOX zeroize smoke test for new infra. -Add MCU MBOX tests to L0. * -Add MBOX CSRs are zero after lock release test. -Fix mbox_status CSR to reset on MBOX lock release. * Remove OtpKeymgrKeyKnown_A assertion since otp_broadcast_o doesn't exist * Fix Caliptra SS assertions Include caliptra_ss_assertion_overrides.svh in caliptra_ss_top_tb.sv. I think it was removed with a merge. Disable additional assertsions showing up in a TB Fuse module with a FIXME to remove and tagged with a github issue. * Fix decode issue where MBOX1 was granted when MBOX0 targeted * Fix build issue, duplicate assertion names * MICROSOFT AUTOMATED PIPELINE: Stamp 'ckuchta-mcu-sram-val' with updated timestamp and hash after successful run --------- Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> Co-authored-by: kedjenks <kedjenks@gmail.com> * Add new test for I3C and Streaming boot (#161) * Initial test code for bringup with local caliptra-core images * Ending quote - syntax * Reorganize ai3c tests * Rename ai3ct test as svh, since it's an include * Add a top-level include file that grabs all css ai3c tests * Remove recipe for program.hex * Add caliptra subsystem macro to compile.yml; update test-suites with plusargs/pre_exec * Fix user signals and config so design boots with Caliptra ROM * Use DEBUG_OUT as STDOUT in ss sims * Regenerate RDL files and update workflow to catch out of date RDL * Unique AxUSER for Caliptra, MCU-LSU, and MCU-IFU * Fixes to get cptra_ss_i3c_recovery pre-exec working * Initialize data/bss/STACK to DCCM, as the MCU SRAM is locked at startup * Remove cptra AxUSER force; TMP: set cptra AxUSER as SOC CONFIG user * Update RTL submodule to pull fw_test_rom updates * Add explanatory note/TODO on LSU user * Revert changes to mcu_hello_world -- it's a defunct test * Makefile cleanup * Rename top test list file * Reorganize the libs area * Move mcu bringup tasks to shared lib file; update Makefile to init data to DCCM and build libs * Roll back the USER/linker modifications to isolate just the methodology changes * Update testfile yml for all smoke tests * Whitespace * Hello world testcase that shows caliptra-core fw built from caliptra-ss repo * Don't build caliptra_isr for MCU - that's a caliptra-core file * Revert USER changes in i3c test * MICROSOFT AUTOMATED PIPELINE: Stamp 'cwhitehead-msft-local-testcode-PoC' with updated timestamp and hash after successful run * I3C reg rd wr and caliptra streaming boot test rom * Removed the global switch * resolved conflicts. * Resolved conflicts. * Reg read write test updated to read and or write all the reg * Added Streaming boot random test * Added updates for Random and reg read write test * Cleanup commit * Removed Debug log * Updated for randomized block size * Add MCU MBOX Tests and Fix MBOX Lock Clearing Detection (#181) * -Fix mailbox release detection to be based on valid SW write and data being 0 (instead of value edge detect). -Update MBOX clearing to explicitly call out writing 0 to EXECUTE register. * -Add MCU MBOX smoke test with MCU and Caliptra both acquiring and reading/writing MBOX. -Add MCU MBOX lock return one during zeroize test. -Update MCU MBOX zeroize smoke test for new infra. -Add MCU MBOX tests to L0. * -Add MBOX CSRs are zero after lock release test. -Fix mbox_status CSR to reset on MBOX lock release. * Added support for Caliptra Test build in Makefile vcs * Disabled internal scoreboard for VIP --------- Co-authored-by: Caleb Whitehead <cwhitehead@microsoft.com> Co-authored-by: kedjenks <kedjenks@gmail.com> * -Add MCU Mbox Valid User Smoke Test -Add MCU Mbox Write During User Lock Smoke Test -RTL Bug Fix for Incorrect Mbox1 grant connection. * Merge branch 'msft-daily-2025-03-28' of ssh://github.com/chipsalliance/caliptra-ss into user/dev/keithjenkins/mbox_val_1 # Conflicts: # src/integration/stimulus/testsuites/caliptra_ss_master_test_list.csv * Merge branch 'msft-daily-2025-03-28' of ssh://github.com/chipsalliance/caliptra-ss into user/dev/keithjenkins/mbox_val_1 # Conflicts: # src/integration/stimulus/testsuites/caliptra_ss_master_test_list.csv * [DOCS] Update README with simulation instructions, env vars (#184) * Replace instances of the deprecated var CALIPTRA_SS with CALIPTRA_SS_ROOT (removes duplicate variables) * Remove duplicate macros * Document sim-flow, env var setup, and AXI4PC requirement * Formatting updates regarding note on AXI4PC * Clarification on axi4pc version * Fix a grammar error * Apply suggested updates to text about acquiring Axi4PC Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Run RDL check for all PRs, not just to main * Document that some CALIPTRA_TESTNAME code may be in its own directory in caliptra-ss * Regenerate reg map --------- Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Rename test * Rename. * -Refactor MCU mbox test code to move some functions to ss_lib -Address PR comment feedback * Address stride fix for AXI CFG registers * PR feedback: -Remove unneeded soc_address_map.h * Fix bad merge conflict * Address PR feedback -Move CMD_Available interrupt to wait for execute function -Add RW1C interrupt clear and checking --------- Co-authored-by: EMRE KARABULUT <63821295+ekarabu@users.noreply.github.com> Co-authored-by: clayton8 <ckuchta@microsoft.com> Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> Co-authored-by: Nilesh Patel <142342517+nileshbpat@users.noreply.github.com> Co-authored-by: Caleb Whitehead <cwhitehead@microsoft.com> Co-authored-by: Steven Bellock <sbellock@nvidia.com> * [TB] Reorganize testbench code into services and mem export files (#206) * Move MCU SRAM (DCCM, I-Cache) to dedicated VeeR export; move other logic to tb_services * Rename CSS CLK FREQ override var in Makefile * Verilog hierarchical names cleanup * Update file-list * Connect some NC signals - w_stub is out of date * Fix comment text for command encode * Move hier path defines to separate file * Additional syntax fixes for w_stub * More syntax fixes, header includes * Remove old defunct mcu coverage files * Add SHA accel test using Caliptra DMA Assist - Drive undriven signals in AXI interfaces: - Upper ADDR bits - AxCACHE, AxPROT, AxREGION, AxQOS - Avery assertions (enable AXI monitor) - Caliptra SS top coverage file - Drive MCI/CALIPTRA base addr strap inputs to SS top - Add new opcode in ss tb services to preload mcu_sram with SHA vector - Add test to run SHA accelerator from MCU SRAM via AXI * Clear SHA lock out of reset * Replace burst DMA txn with single-dw due to AXI interconnt dwidth conversion issue * Add mcu sram SHA accel test to nightly directed regression * Add some debug prints and change verbosity * Regenerate file-lists * avery monitor on flag * Add coverpoints for AXI DMA access to mcu_sram, mci regs, FC * Use params for soc_ifc addr config; add FIFO apertures for FIXED burst access * Remove commented code * Move mcu_sleep to header so all importers can use it * Add wait/timeouts on polling functions * truncate ending newline to eliminate git diff * Put MCU SRAM SHA test in Random, not directed regr * Move coverage bind files to tb_services --------- Co-authored-by: kedjenks <kedjenks@gmail.com> Co-authored-by: EMRE KARABULUT <63821295+ekarabu@users.noreply.github.com> Co-authored-by: clayton8 <ckuchta@microsoft.com> Co-authored-by: Nilesh Patel <142342517+nileshbpat@users.noreply.github.com> Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Add general init fucntion mcu_cptra_init() This function should be used by the majority of C tests to: 1. Configure MCI registers 2. Bring Caliptra out of reset 3. Set Caliptra Fuses 4. Bring Caliptra Core out of reset * Fix type in smoke_test_mcu_mbox.c * Fix type on smoke_test_lcc_scrap.c * Add back mcu_cptra_user_init This is used to configure the SOC_IFC. Adding back to fix mcu_cptra_bringup test. * Update MCI memory map and Address with calculation (#228) * [TB] Halt MCU at end of tests to quiesce AXI i/f (#232) * Halt MCU before ending test so that AXI i/f quiesces * Halt MCU at end of testcase * [VAL] Add MCU mbox user lockout test, refactor existing mbox tests for mbox instance, add to L1 and nightly (#227) * [fuse_ctrl, test] caliptra _ss _fuse_ctrl_unexpected_reset (#215) * [fuse_ctrl, mmap] Split debug unlock key fuses Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> * [fuse_ctrl, test] caliptra_ss_fuse_ctrl_unexpected_reset Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> * [fuse_ctrl, axi] Adapt AXI ranges to new MMAP Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> * [fuse_ctrl, test] Use random seed in config files Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> * MICROSOFT AUTOMATED PIPELINE: Stamp 'lowrisc_caliptra_ss_fuse_ctrl_unexpected_reset' with updated timestamp and hash after successful run --------- Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> Co-authored-by: Andrea Caforio (LOWRISC C I C) <v-acaforio@microsoft.com> * -Refactor MCU mbox tests to be able to select instance -Mbox0 in L0/Promote -Mbox1 added to L1 * -Update testname * -Revert to using BUILD_CFLAGS * -Add MCU mbox test to verify user locked out of mailbox between execute clear and zeroize finished * Add random tests for Caliptra SS and update regression yaml generation script to generate nightly random regression yaml file. Update regression yaml files for new tests (#226) * PR feedback * [TB] Add LCC random tests (#225) * [fuse_ctrl, script] Move to common directory This commit moves the gen_fuse_ctrl_partitions scripts to a common fuse_ctrl_script directory such that the lib can be reused by other scripts. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [fuse_ctrl, script] Add VMEM generation script This commit adds a script that generated VMEM files that can be loaded into the fuse controller. The life cycle state, counter, and the transition token can be programed by using cmd line arguments. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, lib] Extend lc_ctrl library This commit adds functions to the lc_ctrl library that could be useful for different tests. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] LCC transition test This commit adds a simple LCC transition test. The test reads the current LCC state and tries to jump into the next one. By using the script tools/scripts/fuse_ctrl_script/design/gen_fuse_ctrl_vmem.py different starting LC states and unlock tokens can be tested. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [fuse_ctrl, script] Allow to configure multiple tokens This commit extends the VMEM generation script such that multiple tokens can be programmed into OTP vmem. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Add README to caliptra_ss_lcc_st_trans This commit adds a README to guide the user to run the test. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Add smoke_test_lcc_kmac_kat As the KMAC core is inside the lc_ctrl and there is no direct access for SW, this test indirectly tests the KMAC output. - Step 1: gen_fuse_ctrl_vmem.py parses the unhashed token from test_unlock_token.hjson and writes them hashed into the otp-img.2048.vmem file - Step 2: smoke_test_kmac_kat.c contains the same unhashed tokens. The test performs state transitions from TEST_LOCKED0 to PROD_END. If the state transition was successful, the unhashed token was correctly hashed by the KMAC block and matches the hashed token that was generated by the SHAKE reference implementation in gen_fuse_ctrl_vmem.py Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [fuse_ctrl, script] Random parameter generation This commit extends the gen_fuse_ctrl_vmem script such that the unlock tokens, the LC counter, and LC state can be generated randomly. Moreover, a C header file can be generated that contains the unhased tokens that are programmed into VMEM. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Randomly generate unlock tokens This commit extends the test run script such that the gen_fuse_ctrl_vmem.py script is used to randomize the state transition unlock tokens. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Randomize caliptra_ss_lcc_st_trans This test randomizes the caliptra_ss_lcc_st_trans test by calling the gen_fuse_ctrl_vmem.py script that will put a random LC_STATE and LC_CNT into the otp vmem file. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Switch mode of tests - caliptra_ss_lcc_st_trans: Use random LC state & LC counter but fixed unlock tokens - smoke_test_lcc_kmac_kat: Use random unlock token but fixed starting LC state and LC counter Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Switch mode of tests - caliptra_ss_lcc_st_trans: Use random LC state & LC counter but fixed unlock tokens - smoke_test_lcc_kmac_kat: Use random unlock token but fixed starting LC state and LC counter Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl,dv] Add covergroups for LC_CNT and LC_STATE This commit adds simple covergroups for the LC counter value and LC state. Bins are added to make sure that all possible states and counters have been seen. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, sw] Fix LC_CTRL STATUS INIT/READY mask LC_CTRL.STATUS.READY should be bit 1 in the bit field and LC_CTRL.STATUS.INIT should be bit 0 in the bit field. Closes #177 Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * updated .vf file * [script] Add additional python requirements Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl,test] Use error function when expecting an error Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl,test] Use error function when expecting an error Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [lc_ctrl, test] Use PB Random Seed To generate the randomized OTP VMEM image. Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> * added vf files with new sim_tools --------- Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> Co-authored-by: Pascal Nasahl <nasahlpa@lowrisc.org> * [TB] Add MCU_SRAM -> SHA Accel test case (using DMA assist) (#222) * [RTL, TB] Route MCU interrupts to top-level for override; cleanup testbench (#195) * Remove unused axi ifs, TB interrupt control logic, and ICCM components * Dummy tweak to axi2tlul compile * Whitespace * Fix a display about i3c wait time * Add comment to trigger file-list check * Restore axi2tlul compile.yml * Connect external interrupts for MCU to top-level for integrator override * Use central command list/params to define TB services behavior * Whitespace * Use central soc_address_map.h and remove duplicates * Generate caliptra_ss_clk_freq with default value for all tests so it doesn't cause compile failures * Rename clk freq variable * Revert test rename from merge conflict * [Val][RTL] Add MCU Mbox Tests and Fix Mbox1 Grant Bug (#200) * User/dev/ekarabulut/caliptra jtag manuf (#187) * added caliptra+mcu UDS c test * caliptra-rom is implemented with C test * updated uds based addr * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/ekarabulut/caliptra_JTAG_manuf' with updated timestamp and hash after successful run * added manuf smoke test * updated uds_test for full fuse write * adjusted completion time of tcl * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/ekarabulut/caliptra_JTAG_manuf' with updated timestamp and hash after successful run * added header comments * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/ekarabulut/caliptra_JTAG_manuf' with updated timestamp and hash after successful run * [RTL] Enable assertions for SS Integration TB (#158) * Enable assertions for SS Integration TB * Merge with TOT * Add missing driver for rst_mbox_lock_req There was a bad merge that didn't cause regressions to fail. Added back the missing logic * Add WUSER driver in LCC and FC We either need to verify these tieoffs of connect them to AXI interconnect * MICROSOFT AUTOMATED PIPELINE: Stamp 'ckuchta-mcu-sram-val' with updated timestamp and hash after successful run * Remove old assertions * Remove stale LIBS_MCI_DIR now in COMP_LIB_NAMES * Add back sb_axi_wvalid port connection to MCU Inadvertently removed this port in caliptra_ss_top.sv * Clean up AXI user connections at SS top Moved all user connections to a single location. Also, removed the MCU DMA AXI IF since it is unused in our design and reduce overhead of maintaining connections to MCU DMA that is unused plus having to add tieoffs to an interface that is unused. * Enable RUSER in axi interconnect * Add MCU hitless update hanshake to CSS HW spec and strap restrictions * Update MCI Boot FSM with MCU halt handshake states Halt handshake is needed to ensure MCU is halted and idle before reset is asserted. Otherwise there could be outstanding AXI transaction when MCU is reset by MCI. * Add halt/ack handshake between MCU and MCI * change "warm reset" to "cold reset" for MCI boot update We have a bug where FW_BOOT_UPD_RESET should be tracking the first update since cold reset, not warm reset. Updated the spec to match what HW should be doing. * Revert back cold reset to warm reset in MCI reset reason register I believe we should be tracking warm reset since Caliptra is reset on MCI warm reset and the FW_EXEC register is reset on warm reset. * Update docs/CaliptraSSHardwareSpecification.md Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> * Update docs/CaliptraSSHardwareSpecification.md Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> * Update docs/CaliptraSSHardwareSpecification.md Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> * Fix grammar per PR review * Clarify hitless update types * Add MCU MBOX Tests and Fix MBOX Lock Clearing Detection (#181) * -Fix mailbox release detection to be based on valid SW write and data being 0 (instead of value edge detect). -Update MBOX clearing to explicitly call out writing 0 to EXECUTE register. * -Add MCU MBOX smoke test with MCU and Caliptra both acquiring and reading/writing MBOX. -Add MCU MBOX lock return one during zeroize test. -Update MCU MBOX zeroize smoke test for new infra. -Add MCU MBOX tests to L0. * -Add MBOX CSRs are zero after lock release test. -Fix mbox_status CSR to reset on MBOX lock release. * Remove OtpKeymgrKeyKnown_A assertion since otp_broadcast_o doesn't exist * Fix Caliptra SS assertions Include caliptra_ss_assertion_overrides.svh in caliptra_ss_top_tb.sv. I think it was removed with a merge. Disable additional assertsions showing up in a TB Fuse module with a FIXME to remove and tagged with a github issue. * Fix decode issue where MBOX1 was granted when MBOX0 targeted * Fix build issue, duplicate assertion names * MICROSOFT AUTOMATED PIPELINE: Stamp 'ckuchta-mcu-sram-val' with updated timestamp and hash after successful run --------- Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> Co-authored-by: kedjenks <kedjenks@gmail.com> * Add new test for I3C and Streaming boot (#161) * Initial test code for bringup with local caliptra-core images * Ending quote - syntax * Reorganize ai3c tests * Rename ai3ct test as svh, since it's an include * Add a top-level include file that grabs all css ai3c tests * Remove recipe for program.hex * Add caliptra subsystem macro to compile.yml; update test-suites with plusargs/pre_exec * Fix user signals and config so design boots with Caliptra ROM * Use DEBUG_OUT as STDOUT in ss sims * Regenerate RDL files and update workflow to catch out of date RDL * Unique AxUSER for Caliptra, MCU-LSU, and MCU-IFU * Fixes to get cptra_ss_i3c_recovery pre-exec working * Initialize data/bss/STACK to DCCM, as the MCU SRAM is locked at startup * Remove cptra AxUSER force; TMP: set cptra AxUSER as SOC CONFIG user * Update RTL submodule to pull fw_test_rom updates * Add explanatory note/TODO on LSU user * Revert changes to mcu_hello_world -- it's a defunct test * Makefile cleanup * Rename top test list file * Reorganize the libs area * Move mcu bringup tasks to shared lib file; update Makefile to init data to DCCM and build libs * Roll back the USER/linker modifications to isolate just the methodology changes * Update testfile yml for all smoke tests * Whitespace * Hello world testcase that shows caliptra-core fw built from caliptra-ss repo * Don't build caliptra_isr for MCU - that's a caliptra-core file * Revert USER changes in i3c test * MICROSOFT AUTOMATED PIPELINE: Stamp 'cwhitehead-msft-local-testcode-PoC' with updated timestamp and hash after successful run * I3C reg rd wr and caliptra streaming boot test rom * Removed the global switch * resolved conflicts. * Resolved conflicts. * Reg read write test updated to read and or write all the reg * Added Streaming boot random test * Added updates for Random and reg read write test * Cleanup commit * Removed Debug log * Updated for randomized block size * Add MCU MBOX Tests and Fix MBOX Lock Clearing Detection (#181) * -Fix mailbox release detection to be based on valid SW write and data being 0 (instead of value edge detect). -Update MBOX clearing to explicitly call out writing 0 to EXECUTE register. * -Add MCU MBOX smoke test with MCU and Caliptra both acquiring and reading/writing MBOX. -Add MCU MBOX lock return one during zeroize test. -Update MCU MBOX zeroize smoke test for new infra. -Add MCU MBOX tests to L0. * -Add MBOX CSRs are zero after lock release test. -Fix mbox_status CSR to reset on MBOX lock release. * Added support for Caliptra Test build in Makefile vcs * Disabled internal scoreboard for VIP --------- Co-authored-by: Caleb Whitehead <cwhitehead@microsoft.com> Co-authored-by: kedjenks <kedjenks@gmail.com> * -Add MCU Mbox Valid User Smoke Test -Add MCU Mbox Write During User Lock Smoke Test -RTL Bug Fix for Incorrect Mbox1 grant connection. * Merge branch 'msft-daily-2025-03-28' of ssh://github.com/chipsalliance/caliptra-ss into user/dev/keithjenkins/mbox_val_1 # Conflicts: # src/integration/stimulus/testsuites/caliptra_ss_master_test_list.csv * Merge branch 'msft-daily-2025-03-28' of ssh://github.com/chipsalliance/caliptra-ss into user/dev/keithjenkins/mbox_val_1 # Conflicts: # src/integration/stimulus/testsuites/caliptra_ss_master_test_list.csv * [DOCS] Update README with simulation instructions, env vars (#184) * Replace instances of the deprecated var CALIPTRA_SS with CALIPTRA_SS_ROOT (removes duplicate variables) * Remove duplicate macros * Document sim-flow, env var setup, and AXI4PC requirement * Formatting updates regarding note on AXI4PC * Clarification on axi4pc version * Fix a grammar error * Apply suggested updates to text about acquiring Axi4PC Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Run RDL check for all PRs, not just to main * Document that some CALIPTRA_TESTNAME code may be in its own directory in caliptra-ss * Regenerate reg map --------- Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Rename test * Rename. * -Refactor MCU mbox test code to move some functions to ss_lib -Address PR comment feedback * Address stride fix for AXI CFG registers * PR feedback: -Remove unneeded soc_address_map.h * Fix bad merge conflict * Address PR feedback -Move CMD_Available interrupt to wait for execute function -Add RW1C interrupt clear and checking --------- Co-authored-by: EMRE KARABULUT <63821295+ekarabu@users.noreply.github.com> Co-authored-by: clayton8 <ckuchta@microsoft.com> Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> Co-authored-by: Nilesh Patel <142342517+nileshbpat@users.noreply.github.com> Co-authored-by: Caleb Whitehead <cwhitehead@microsoft.com> Co-authored-by: Steven Bellock <sbellock@nvidia.com> * [TB] Reorganize testbench code into services and mem export files (#206) * Move MCU SRAM (DCCM, I-Cache) to dedicated VeeR export; move other logic to tb_services * Rename CSS CLK FREQ override var in Makefile * Verilog hierarchical names cleanup * Update file-list * Connect some NC signals - w_stub is out of date * Fix comment text for command encode * Move hier path defines to separate file * Additional syntax fixes for w_stub * More syntax fixes, header includes * Remove old defunct mcu coverage files * Add SHA accel test using Caliptra DMA Assist - Drive undriven signals in AXI interfaces: - Upper ADDR bits - AxCACHE, AxPROT, AxREGION, AxQOS - Avery assertions (enable AXI monitor) - Caliptra SS top coverage file - Drive MCI/CALIPTRA base addr strap inputs to SS top - Add new opcode in ss tb services to preload mcu_sram with SHA vector - Add test to run SHA accelerator from MCU SRAM via AXI * Clear SHA lock out of reset * Replace burst DMA txn with single-dw due to AXI interconnt dwidth conversion issue * Add mcu sram SHA accel test to nightly directed regression * Add some debug prints and change verbosity * Regenerate file-lists * avery monitor on flag * Add coverpoints for AXI DMA access to mcu_sram, mci regs, FC * Use params for soc_ifc addr config; add FIFO apertures for FIXED burst access * Remove commented code * Move mcu_sleep to header so all importers can use it * Add wait/timeouts on polling functions * truncate ending newline to eliminate git diff * Put MCU SRAM SHA test in Random, not directed regr * Move coverage bind files to tb_services --------- Co-authored-by: kedjenks <kedjenks@gmail.com> Co-authored-by: EMRE KARABULUT <63821295+ekarabu@users.noreply.github.com> Co-authored-by: clayton8 <ckuchta@microsoft.com> Co-authored-by: Nilesh Patel <142342517+nileshbpat@users.noreply.github.com> Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Update MCI memory map and Address with calculation (#228) * PR feedback * PR feedback. * [TB] Halt MCU at end of tests to quiesce AXI i/f (#232) * Halt MCU before ending test so that AXI i/f quiesces * Halt MCU at end of testcase * MICROSOFT AUTOMATED PIPELINE: Stamp 'user/dev/keithjenkins/mbox_val_2' with updated timestamp and hash after successful run --------- Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> Co-authored-by: andrea-caforio <andrea.caforio@lowrisc.org> Co-authored-by: Andrea Caforio (LOWRISC C I C) <v-acaforio@microsoft.com> Co-authored-by: Anjana Parthasarathy <107714838+anjpar@users.noreply.github.com> Co-authored-by: EMRE KARABULUT <63821295+ekarabu@users.noreply.github.com> Co-authored-by: Pascal Nasahl <nasahlpa@lowrisc.org> Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> Co-authored-by: clayton8 <ckuchta@microsoft.com> Co-authored-by: Nilesh Patel <142342517+nileshbpat@users.noreply.github.com> Co-authored-by: Steven Bellock <sbellock@nvidia.com> * Fix mcu_hello_world.c failure * Fix failed regressions * MICROSOFT AUTOMATED PIPELINE: Stamp 'ckuchta-mcu-sram-test' with updated timestamp and hash after successful run --------- Signed-off-by: Andrea Caforio <andrea.caforio@lowrisc.org> Signed-off-by: Pascal Nasahl <nasahlpa@lowrisc.org> Co-authored-by: Caleb <11879229+calebofearth@users.noreply.github.com> Co-authored-by: kedjenks <kedjenks@gmail.com> Co-authored-by: EMRE KARABULUT <63821295+ekarabu@users.noreply.github.com> Co-authored-by: Nilesh Patel <142342517+nileshbpat@users.noreply.github.com> Co-authored-by: Caleb Whitehead <cwhitehead@microsoft.com> Co-authored-by: Steven Bellock <sbellock@nvidia.com> Co-authored-by: andrea-caforio <andrea.caforio@lowrisc.org> Co-authored-by: Andrea Caforio (LOWRISC C I C) <v-acaforio@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Anjana Parthasarathy <107714838+anjpar@users.noreply.github.com> Co-authored-by: Pascal Nasahl <nasahlpa@lowrisc.org>
1 parent 5745877 commit 49af692

File tree

37 files changed

+1436
-134
lines changed

37 files changed

+1436
-134
lines changed

.github/workflow_metadata/pr_hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
29ff3ff273ae018898f753bc3bee8b36382f407b7cbd87dba40a554e3d1f54097e15203a0f0c3af562ffc8ec659b7d4c
1+
7fcfd012bfb833fef21486eca87c4010e32a45dbcd5e2813c99564e65f5b85924dac101aeb484f95ac3ab58565c4a4b6
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1743783955
1+
1743803703

src/integration/stimulus/L0_Promote_caliptra_ss_top_tb_regression.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ contents:
2626
- ../test_suites/caliptra_ss_fuse_ctrl_axi_id/caliptra_ss_fuse_ctrl_axi_id.yml
2727
- ../test_suites/caliptra_ss_fuse_ctrl_zeroization/caliptra_ss_fuse_ctrl_zeroization.yml
2828
- ../test_suites/caliptra_ss_fuse_ctrl_unexpected_reset/caliptra_ss_fuse_ctrl_unexpected_reset.yml
29+
- ../test_suites/smoke_test_mcu_sram_byte_write/smoke_test_mcu_sram_byte_write.yml
30+
- ../test_suites/smoke_test_mcu_sram_protected_region/smoke_test_mcu_sram_protected_region.yml
2931
- ../test_suites/smoke_test_mcu_mbox_valid_user/smoke_test_mcu_mbox0_valid_user.yml
3032
- ../test_suites/smoke_test_mcu_mbox_write_user_lock/smoke_test_mcu_mbox0_write_user_lock.yml
3133
- ../test_suites/smoke_test_mcu_mbox_usr_lock_out_zero/smoke_test_mcu_mbox0_usr_lock_out_zero.yml

src/integration/stimulus/L1_Nightly_Random_caliptra_ss_top_tb_regression.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ contents:
66
tags: ["L1", "caliptra_ss_top_tb", "Random", "Nightly"]
77
path: ""
88
weight: 100
9-
generations: 50
9+
generations: 60
1010
formats:
1111
generate: "reseed {template}.yml -seed {seed}"
1212
path: "{template_basename}__{seed}.yml"
@@ -15,4 +15,5 @@ contents:
1515
$CALIPTRA_SS_ROOT/src/integration/test_suites/smoke_test_lcc_RMA/smoke_test_lcc_RMA: { weight: 100 }
1616
$CALIPTRA_SS_ROOT/src/integration/test_suites/caliptra_ss_fuse_ctrl_test_unlocked0_prov/caliptra_ss_fuse_ctrl_test_unlocked0_prov: { weight: 100 }
1717
$CALIPTRA_SS_ROOT/src/integration/test_suites/caliptra_ss_fuse_ctrl_unexpected_reset/caliptra_ss_fuse_ctrl_unexpected_reset: { weight: 100 }
18+
$CALIPTRA_SS_ROOT/src/integration/test_suites/smoke_test_mcu_sram_protected_region/smoke_test_mcu_sram_protected_region: { weight: 100 }
1819
$CALIPTRA_SS_ROOT/src/integration/test_suites/caliptra_ss_mcu_sram_to_sha/caliptra_ss_mcu_sram_to_sha: { weight: 100 }

src/integration/stimulus/testsuites/caliptra_ss_master_test_list.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ $CALIPTRA_SS_ROOT/src/integration/test_suites/caliptra_ss_fuse_ctrl_writeblank/c
2929
$CALIPTRA_SS_ROOT/src/integration/test_suites/caliptra_ss_fuse_ctrl_axi_id/caliptra_ss_fuse_ctrl_axi_id , Directed , Nightly , L0 , L1 , caliptra_ss_top_tb, Promote , None , 100
3030
$CALIPTRA_SS_ROOT/src/integration/test_suites/caliptra_ss_fuse_ctrl_zeroization/caliptra_ss_fuse_ctrl_zeroization , Directed , Nightly , L0 , L1 , caliptra_ss_top_tb, Promote , None , 100
3131
$CALIPTRA_SS_ROOT/src/integration/test_suites/caliptra_ss_fuse_ctrl_unexpected_reset/caliptra_ss_fuse_ctrl_unexpected_reset , Random , Nightly , L0 , L1 , caliptra_ss_top_tb, Promote , None , 100
32+
$CALIPTRA_SS_ROOT/src/integration/test_suites/smoke_test_mcu_sram_byte_write/smoke_test_mcu_sram_byte_write , Directed , None , L0 , None, caliptra_ss_top_tb, Promote , None , 100
33+
$CALIPTRA_SS_ROOT/src/integration/test_suites/smoke_test_mcu_sram_protected_region/smoke_test_mcu_sram_protected_region , Random , Nightly , L0 , L1 , caliptra_ss_top_tb, Promote , None , 100
3234
$CALIPTRA_SS_ROOT/src/integration/test_suites/smoke_test_mcu_mbox_valid_user/smoke_test_mcu_mbox0_valid_user , Directed , Nightly , L0 , L1 , caliptra_ss_top_tb, Promote , None , 100
3335
$CALIPTRA_SS_ROOT/src/integration/test_suites/smoke_test_mcu_mbox_valid_user/smoke_test_mcu_mbox1_valid_user , Directed , Nightly , None, L1 , caliptra_ss_top_tb, None , None , 100
3436
$CALIPTRA_SS_ROOT/src/integration/test_suites/smoke_test_mcu_mbox_write_user_lock/smoke_test_mcu_mbox0_write_user_lock , Directed , Nightly , L0 , L1 , caliptra_ss_top_tb, Promote , None , 100

src/integration/test_suites/caliptra_ss_mcu_sram_to_sha/caliptra_ss_mcu_sram_to_sha.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void main (void) {
4545

4646
VPRINTF(LOW, "MCU: Caliptra bringup\n")
4747

48-
mcu_cptra_fuse_init();
48+
mcu_cptra_init_d();
4949

5050
//Halt the core to wait for Caliptra to finish the test
5151
__asm__ volatile ("csrwi %0, %1" \

src/integration/test_suites/libs/caliptra_ss_lib/caliptra_ss_lib.c

Lines changed: 132 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,50 @@ void reset_fc_lcc_rtl(void) {
5050
mcu_sleep(160);
5151
}
5252

53-
void mcu_mci_boot_go() {
54-
55-
// Configure EXEC Region before initializing Caliptra
56-
lsu_write_32(SOC_MCI_TOP_MCI_REG_FW_SRAM_EXEC_REGION_SIZE , 100);
57-
VPRINTF(LOW, "MCU: Configure EXEC REGION Size\n");
53+
void write_read_check(uintptr_t rdptr, uint32_t data){
54+
VPRINTF(LOW, "write_read_check: Address: 0x%x -- Data: 0x%x\n", rdptr, data);
55+
56+
lsu_write_32(rdptr, data);
57+
58+
read_check(rdptr, data);
5859

60+
}
5961

62+
uintptr_t get_random_address(uint32_t rnd, uintptr_t start_address, uintptr_t end_address) {
63+
// Return address that is DWORD aligned
64+
uintptr_t range = end_address - start_address + 1;
65+
uintptr_t offset = rnd % range;
66+
uintptr_t address = (start_address + offset) & ~3;
67+
return address;
68+
}
69+
70+
void read_check(uintptr_t rdptr, uint32_t expected_rddata){
71+
uint32_t data;
72+
data = lsu_read_32(rdptr);
73+
VPRINTF(LOW, "read_check: Address: 0x%x -- Expected: 0x%x Actual: 0x%x\n", rdptr, expected_rddata, data);
74+
if (expected_rddata != data) {
75+
VPRINTF(FATAL, "MCU: FATAL - read_check: Data mismatch at address: 0x%x -- Expected: 0x%x Actual: 0x%x\n", rdptr, expected_rddata, data);
76+
SEND_STDOUT_CTRL(0x1);
77+
while(1);
78+
}
79+
}
80+
81+
void mcu_set_fw_sram_exec_region_size(uint32_t size) {
82+
VPRINTF(LOW, "MCU: Configure EXEC REGION Size 0x%x\n", size);
83+
lsu_write_32(SOC_MCI_TOP_MCI_REG_FW_SRAM_EXEC_REGION_SIZE , size);
84+
}
85+
86+
87+
void mcu_set_cptra_dma_axi_user(uint32_t value) {
88+
VPRINTF(LOW, "MCU: Configure CPTRA DMA AXI USER 0x%x\n", value);
89+
lsu_write_32(SOC_SOC_IFC_REG_SS_CALIPTRA_DMA_AXI_USER, value);
90+
}
91+
92+
void mcu_mci_boot_go() {
6093
// writing SOC_MCI_TOP_MCI_REG_CPTRA_BOOT_GO register of MCI for CPTRA Boot FSM to bring Caliptra out of reset
6194
uint32_t cptra_boot_go;
6295
VPRINTF(LOW, "MCU: Writing MCI SOC_MCI_TOP_MCI_REG_CPTRA_BOOT_GO\n");
6396
lsu_write_32(SOC_MCI_TOP_MCI_REG_CPTRA_BOOT_GO, 1);
64-
65-
VPRINTF(LOW, "MCU: Reading SOC_MCI_TOP_MCI_REG_CPTRA_BOOT_GO");
66-
cptra_boot_go = lsu_read_32(SOC_MCI_TOP_MCI_REG_CPTRA_BOOT_GO);
67-
VPRINTF(LOW, "MCU: SOC_MCI_TOP_MCI_REG_CPTRA_BOOT_GO set to %x\n", cptra_boot_go);
6897
}
6998

7099
void mcu_mci_poll_exec_lock() {
@@ -117,52 +146,113 @@ void mcu_cptra_advance_brkpoint() {
117146

118147
}
119148

120-
void mcu_cptra_fuse_init_axi_user(uint32_t cptra_axi_user){
121-
////////////////////////////////////
122-
// Fuse and Boot Bringup
149+
void mcu_cptra_user_init() {
150+
// MBOX: Setup valid AXI USER
151+
lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_VALID_AXI_USER_0, 0x1); // FIXME this should come from a param for LSU AxUSER
152+
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_VALID_AXI_USER_1, 1);
153+
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_VALID_AXI_USER_2, 2);
154+
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_VALID_AXI_USER_3, 3);
155+
lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_0, SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_0_LOCK_MASK);
156+
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_1, SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_1_LOCK_MASK);
157+
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_2, SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_2_LOCK_MASK);
158+
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_3, SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_3_LOCK_MASK);
159+
VPRINTF(LOW, "MCU: Configured MBOX Valid AXI USER\n");
160+
161+
}
162+
163+
void mcu_cptra_init(mcu_cptra_init_args args) {
164+
// DO NOT CALL DIRECTLY. USE THE mcu_cptra_init_d MACRO TO CALL THE FUNCTION
165+
166+
// 4 MAIN OPTIONS:
123167
//
124-
mcu_cptra_wait_for_fuses();
168+
// 1. Always disabled unless a new value is specified:
169+
// - Add a boolean cfg_<feature>.
170+
// - Add a <type> <feature_value>.
171+
// - Skip configuration unless cfg_<feature> is set, then set the <feature_value>.
172+
// - Use for features that most tests don't care about and will have a set value.
173+
//
174+
// 2. Always disabled unless enabled:
175+
// - Add a boolean cfg_enable_<feature>.
176+
// - Skip configuration unless cfg_enable_<feature> is set, then enable the feature.
177+
// - Use for features that most tests don't care about and don't have an actual
178+
// value but when enabled will initiate a configuration within the design.
179+
//
180+
// 3. Always enabled unless specified:
181+
// - Add a cfg_skip_<feature>.
182+
// - Always program the register unless the skip is set.
183+
// - Use when most tests want the feature
184+
// - Use for features that are either DO or SKIP.
185+
//
186+
// 4. Always enabled unless overridden:
187+
// - Add a cfg_override_<feature>.
188+
// - Add a <feature_value>.
189+
// - Use when most tests whant the feature.
190+
// - Always configure to a default value. If cfg_override_<feature> is set,
191+
// write the <feature_value> into the register.
125192

126-
lsu_write_32(SOC_SOC_IFC_REG_SS_CALIPTRA_DMA_AXI_USER, cptra_axi_user);
193+
127194

128-
// Initialize fuses
129-
// TODO set actual fuse values
130-
mcu_cptra_set_fuse_done();
195+
VPRINTF(LOW, "MCU: INIT CONFIGURING START\n");
196+
197+
/////////////////////////////////
198+
// MCU CONFIGURATION
199+
/////////////////////////////////
200+
if (args.cfg_mcu_fw_sram_exec_reg_size) {
201+
VPRINTF(LOW, "MCU: args.mcu_fw_sram_exec_reg_size 0x%x\n", args.mcu_fw_sram_exec_reg_size);
202+
mcu_set_fw_sram_exec_region_size(args.mcu_fw_sram_exec_reg_size);
203+
}
131204

132-
mcu_cptra_advance_brkpoint();
133-
}
205+
if (args.cfg_mcu_mbox0_valid_user) {
206+
mcu_mbox_configure_valid_axi(0, args.mcu_mbox0_valid_user);
207+
}
134208

135-
void mcu_cptra_fuse_init() {
136-
enum boot_fsm_state_e boot_fsm_ps;
209+
if (args.cfg_mcu_mbox1_valid_user) {
210+
mcu_mbox_configure_valid_axi(1, args.mcu_mbox1_valid_user);
211+
}
212+
213+
/////////////////////////////////
214+
// BRING CPTRA OUT OF RESET
215+
/////////////////////////////////
216+
mcu_mci_boot_go();
137217

138-
////////////////////////////////////
139-
// Fuse and Boot Bringup
140-
//
141218
mcu_cptra_wait_for_fuses();
142219

220+
/////////////////////////////////
221+
// CPTRA FUSE CONFIGURATION
222+
/////////////////////////////////
223+
if (args.cfg_cptra_dma_axi_user){
224+
mcu_set_cptra_dma_axi_user(args.cptra_dma_axi_user);
225+
}
143226

144-
// Initialize fuses
145-
// TODO set actual fuse values
146-
mcu_cptra_set_fuse_done();
227+
if (args.cfg_enable_cptra_mbox_user_init){
228+
mcu_cptra_user_init();
229+
}
147230

148-
mcu_cptra_advance_brkpoint();
231+
/////////////////////////////////
232+
// CPTRA LOCK FUSE CONFIGURATION
233+
/////////////////////////////////
234+
if (!args.cfg_skip_set_fuse_done) {
235+
mcu_cptra_set_fuse_done();
236+
}
237+
else{
238+
VPRINTF(LOW, "MCU: INIT CONFIGURING: Skip Set fuse done\n");
239+
}
149240

150-
}
241+
/////////////////////////////////
242+
// CPTRA ENSURE BREAKPOINT SET
243+
/////////////////////////////////
244+
if (!args.cfg_skip_set_fuse_done) {
245+
mcu_cptra_advance_brkpoint();
246+
}
247+
else{
248+
VPRINTF(LOW, "MCU: INIT CONFIGURING: Skip advance CPTRA advance breakpoint\n");
249+
}
151250

152-
void mcu_cptra_user_init() {
153-
// MBOX: Setup valid AXI USER
154-
lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_VALID_AXI_USER_0, 0x1); // FIXME this should come from a param for LSU AxUSER
155-
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_VALID_AXI_USER_1, 1);
156-
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_VALID_AXI_USER_2, 2);
157-
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_VALID_AXI_USER_3, 3);
158-
lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_0, SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_0_LOCK_MASK);
159-
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_1, SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_1_LOCK_MASK);
160-
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_2, SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_2_LOCK_MASK);
161-
// lsu_write_32(SOC_SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_3, SOC_IFC_REG_CPTRA_MBOX_AXI_USER_LOCK_3_LOCK_MASK);
162-
VPRINTF(LOW, "MCU: Configured MBOX Valid AXI USER\n");
163251

252+
VPRINTF(LOW, "MCU: INIT CONFIGURING END\n");
164253
}
165254

255+
166256
void mcu_mbox_clear_lock_out_of_reset(uint32_t mbox_num) {
167257
// MBOX: Write DLEN (normally would be max SRAM size but using smaller size for test run time)
168258
lsu_write_32(SOC_MCI_TOP_MCU_MBOX0_CSR_MBOX_DLEN + MCU_MBOX_NUM_STRIDE*mbox_num, 32);
@@ -227,6 +317,7 @@ void mcu_mbox_clear_mbox_cmd_avail_interrupt(uint32_t mbox_num) {
227317

228318
void mcu_mbox_configure_valid_axi(uint32_t mbox_num, uint32_t *axi_user_id) {
229319

320+
VPRINTF(LOW, "MCU: Configuring Valid AXI USERs in Mbox%x: 0 - 0x%x; 1 - 0x%x; 2 - 0x%x; 3 - 0x%x; 4 - 0x%x;\n", mbox_num, axi_user_id[0], axi_user_id[1], axi_user_id[2], axi_user_id[3], axi_user_id[4]);
230321
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_VALID_AXI_USER_0 + MCU_MBOX_AXI_CFG_STRIDE*mbox_num, axi_user_id[0]);
231322
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_VALID_AXI_USER_1 + MCU_MBOX_AXI_CFG_STRIDE*mbox_num, axi_user_id[1]);
232323
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_VALID_AXI_USER_2 + MCU_MBOX_AXI_CFG_STRIDE*mbox_num, axi_user_id[2]);
@@ -238,8 +329,8 @@ void mcu_mbox_configure_valid_axi(uint32_t mbox_num, uint32_t *axi_user_id) {
238329
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_AXI_USER_LOCK_2 + MCU_MBOX_AXI_CFG_STRIDE*mbox_num, MCI_REG_MBOX0_AXI_USER_LOCK_2_LOCK_MASK);
239330
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_AXI_USER_LOCK_3 + MCU_MBOX_AXI_CFG_STRIDE*mbox_num, MCI_REG_MBOX0_AXI_USER_LOCK_3_LOCK_MASK);
240331
lsu_write_32(SOC_MCI_TOP_MCI_REG_MBOX0_AXI_USER_LOCK_4 + MCU_MBOX_AXI_CFG_STRIDE*mbox_num, MCI_REG_MBOX0_AXI_USER_LOCK_4_LOCK_MASK);
332+
VPRINTF(LOW, "MCU: DONE Configuring Valid AXI USERs in Mbox%x\n", mbox_num);
241333

242-
VPRINTF(LOW, "MCU: Configured Valid AXI USERs in Mbox%x: 0 - 0x%x; 1 - 0x%x; 2 - 0x%x; 3 - 0x%x; 4 - 0x%x;\n", mbox_num, axi_user_id[0], axi_user_id[1], axi_user_id[2], axi_user_id[3], axi_user_id[4]);
243334
}
244335

245336
bool mcu_mbox_acquire_lock(uint32_t mbox_num, uint32_t attempt_count) {

src/integration/test_suites/libs/caliptra_ss_lib/caliptra_ss_lib.h

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,34 @@
2222
#include <stdbool.h>
2323

2424
extern uint32_t state;
25+
26+
typedef struct {
27+
// FW_SRAM_EXEC_REGION_SIZE
28+
bool cfg_mcu_fw_sram_exec_reg_size;
29+
uint32_t mcu_fw_sram_exec_reg_size;
30+
31+
// CPTRA DMA AXI USER
32+
bool cfg_cptra_dma_axi_user;
33+
uint32_t cptra_dma_axi_user;
34+
35+
// MCU MBOX VALID USER
36+
bool cfg_mcu_mbox0_valid_user;
37+
uint32_t *mcu_mbox0_valid_user;
38+
bool cfg_mcu_mbox1_valid_user;
39+
uint32_t *mcu_mbox1_valid_user;
40+
41+
// SOC_IFC MBOX
42+
bool cfg_enable_cptra_mbox_user_init;
43+
44+
// FUSE DONE
45+
bool cfg_skip_set_fuse_done;
46+
47+
} mcu_cptra_init_args;
48+
// MAIN CPTRA INIT FUNCTION EVERYONE SHOULD USER
49+
// TO LOAD FUSES!!!
50+
void mcu_cptra_init(mcu_cptra_init_args args);
51+
#define mcu_cptra_init_d(...) mcu_cptra_init((mcu_cptra_init_args){__VA_ARGS__});
52+
2553
uint32_t xorshift32(void);
2654

2755
// Bitfield indicating which MCU Mboxes are valid for the given test
@@ -38,11 +66,12 @@ void reset_fc_lcc_rtl(void);
3866
void mcu_cptra_wait_for_fuses() ;
3967
void mcu_cptra_set_fuse_done() ;
4068
void mcu_cptra_advance_brkpoint() ;
41-
void mcu_cptra_fuse_init_axi_user(uint32_t cptra_axi_user);
69+
void mcu_set_fw_sram_exec_region_size(uint32_t size);
70+
void mcu_set_cptra_dma_axi_user(uint32_t value);
4271
void mcu_mci_boot_go();
72+
void read_check(uintptr_t rdptr, uint32_t expected_rddata);
4373
void mcu_mci_poll_exec_lock();
4474
void mcu_mci_req_reset();
45-
void mcu_cptra_fuse_init();
4675
void mcu_cptra_user_init();
4776
void mcu_cptra_poll_mb_ready();
4877
void mcu_cptra_mbox_cmd();
@@ -59,12 +88,11 @@ void mcu_mbox_configure_valid_axi(uint32_t mbox_num, uint32_t *axi_user_id);
5988
bool mcu_mbox_acquire_lock(uint32_t mbox_num, uint32_t attempt_count);
6089
bool mcu_mbox_wait_for_user_to_be_mcu(uint32_t mbox_num, uint32_t attempt_count);
6190
void mcu_mbox_clear_mbox_cmd_avail_interrupt(uint32_t mbox_num);
91+
void write_read_check(uintptr_t rdptr, uint32_t data);
92+
uintptr_t get_random_address(uint32_t rnd, uintptr_t start_address, uintptr_t end_address);
6293
void mcu_mbox_clear_execute(uint32_t mbox_num);
6394

6495

65-
#define TB_CMD_SHA_VECTOR_TO_MCU_SRAM 0x80
66-
67-
6896
#define TB_CMD_SHA_VECTOR_TO_MCU_SRAM 0x80
6997

7098
#define FC_LCC_CMD_OFFSET 0xB0
@@ -79,11 +107,13 @@ void mcu_mbox_clear_execute(uint32_t mbox_num);
79107
#define CMD_LC_FORCE_RMA_SCRAP_PPD FC_LCC_CMD_OFFSET + 0x0a
80108
#define CMD_FC_TRIGGER_ESCALATION FC_LCC_CMD_OFFSET + 0x0b
81109

110+
#define TB_CMD_DISABLE_MCU_SRAM_PROT_ASSERTS 0xC0
111+
112+
82113
#define TB_CMD_DISABLE_INJECT_ECC_ERROR 0xe0
83114
#define TB_CMD_INJECT_ECC_ERROR_SINGLE_DCCM 0xe2
84115
#define TB_CMD_INJECT_ECC_ERROR_DOUBLE_DCCM 0xe3
85116

86-
87117
#define MCU_MBOX_NUM_STRIDE (SOC_MCI_TOP_MCU_MBOX1_CSR_BASE_ADDR - SOC_MCI_TOP_MCU_MBOX0_CSR_BASE_ADDR)
88118
#define MCU_MBOX_AXI_CFG_STRIDE (SOC_MCI_TOP_MCI_REG_MBOX1_AXI_USER_LOCK_0 - SOC_MCI_TOP_MCI_REG_MBOX0_AXI_USER_LOCK_0)
89119

0 commit comments

Comments
 (0)