Skip to content

Commit

Permalink
[test] add flash scrambling/ECC smoketest
Browse files Browse the repository at this point in the history
This adds a simple flash scrambling/ECC smoketest to DV to test the
`gen-flash-img.py` can properly prepare a flash image for backdoor
loading in flash in DV. This test is also added to the list of tests run
in pre-submit CI.

Signed-off-by: Timothy Trippel <[email protected]>
  • Loading branch information
timothytrippel committed Mar 16, 2023
1 parent 6b944e7 commit 4fad90c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions hw/top_earlgrey/data/chip_testplan.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -3349,6 +3349,7 @@
"chip_sw_rstmgr_smoketest",
"chip_sw_sram_ctrl_smoketest",
"chip_sw_uart_smoketest",
"chip_sw_flash_scrambling_smoketest",
]
}
{
Expand Down
12 changes: 12 additions & 0 deletions hw/top_earlgrey/dv/chip_sim_cfg.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,17 @@
]
run_timeout_mins: 300
}
{
name: chip_sw_flash_scrambling_smoketest
uvm_test_seq: chip_sw_base_vseq
sw_images: [
"//sw/device/tests:flash_scrambling_smoketest:1",
"//sw/device/tests:flash_scrambling_smoketest_otp_img_rma:4",
]
en_run_modes: ["sw_test_mode_test_rom"]
run_opts: ["+use_otp_image=OtpTypeCustom"]
run_timeout_mins: 10
}
]

// List of regressions.
Expand All @@ -1822,6 +1833,7 @@
"chip_sw_spi_device_pass_through",
"chip_sw_i2c_host_tx_rx",
"chip_sw_i2c_device_tx_rx",
"chip_sw_flash_scrambling_smoketest",
"chip_plic_all_irqs",
"chip_sw_example_flash",
"chip_sw_example_rom",
Expand Down
34 changes: 34 additions & 0 deletions sw/device/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2229,3 +2229,37 @@ opentitan_functest(
"//sw/device/lib/testing/test_framework:ujson_ottf",
],
)

otp_json(
name = "flash_scrambling_smoketest_otp_overlay",
partitions = [
otp_partition(
name = "CREATOR_SW_CFG",
items = {
# Enable flash scrambling and ECC.
"CREATOR_SW_CFG_FLASH_DATA_DEFAULT_CFG": "0000090606",
},
),
],
)

otp_image(
name = "flash_scrambling_smoketest_otp_img_rma",
src = "//hw/ip/otp_ctrl/data:otp_json_rma",
overlays = STD_OTP_OVERLAYS + [":flash_scrambling_smoketest_otp_overlay"],
visibility = ["//visibility:private"],
)

opentitan_functest(
name = "flash_scrambling_smoketest",
srcs = ["example_test_from_flash.c"],
dv = dv_params(
otp = ":flash_scrambling_smoketest_otp_img_rma",
),
targets = [
"dv",
],
deps = [
"//sw/device/lib/testing/test_framework:ottf_main",
],
)

0 comments on commit 4fad90c

Please sign in to comment.