Skip to content

Commit

Permalink
[rom_ext_e2e] Use the fpga_hyper310_rom_ext environment
Browse files Browse the repository at this point in the history
Use the `fpga_hyper310_rom_ext` environment for ROM_EXT end-to-end tests.
The hyperdebug serial ports support serial break out of the box, whereas
the CW310 serial ports require special SAM3x firmware to support serial
break.

Signed-off-by: Chris Frantz <[email protected]>
  • Loading branch information
cfrantz committed Aug 29, 2024
1 parent 6f7d85a commit 9a7e239
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 28 deletions.
23 changes: 12 additions & 11 deletions sw/device/silicon_creator/rom_ext/e2e/boot_svc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ opentitan_test(
name = "boot_svc_empty_test",
srcs = ["boot_svc_empty_test.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "{rom_ext}@0 {firmware}@0x10000 {firmware}@0x90000",
Expand All @@ -57,7 +57,7 @@ opentitan_test(
name = "boot_svc_wakeup_test",
srcs = ["boot_svc_wakeup_test.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "{rom_ext}@0 {firmware}@0x10000",
Expand Down Expand Up @@ -85,7 +85,7 @@ opentitan_test(
name = "boot_svc_next_test",
srcs = ["boot_svc_next_test.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "{rom_ext}@0 {firmware}@0x10000 {firmware}@0x90000",
Expand All @@ -111,7 +111,7 @@ opentitan_test(
name = "boot_svc_primary_test",
srcs = ["boot_svc_primary_test.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "{rom_ext}@0 {firmware}@0x10000 {firmware}@0x90000",
Expand Down Expand Up @@ -145,7 +145,7 @@ opentitan_test(
name = "boot_svc_bad_next_test",
srcs = ["boot_svc_bad_next_test.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "{rom_ext}@0 {firmware}@0x10000 {firmware}@0x90000",
Expand Down Expand Up @@ -173,26 +173,27 @@ opentitan_test(
"//sw/device/silicon_creator/rom_ext/e2e/verified_boot:boot_test",
],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
data = [
"//sw/device/silicon_creator/lib/ownership/keys/fake:no_owner_recovery_key",
],
exit_failure = "(PASS|FAIL|FAULT).*\n",
# This test requires serial break support which is not available in CI yet.
tags = ["broken"],
test_cmd = """
--exec="transport init"
--exec="fpga clear-bitstream"
--exec="fpga load-bitstream {bitstream}"
--exec="bootstrap --clear-uart=true {firmware}"
--exec="console --non-interactive --exit-success='ownership_state: \\x00\\x00\\x00\\x00\r\n' --exit-failure='{exit_failure}'"
--exec="console --non-interactive --exit-success='ownership_state = OWND\r\n' --exit-failure='{exit_failure}'"
--exec="rescue boot-svc ownership-unlock \
--mode Any \
--nonce 0 \
--sign $(location //sw/device/silicon_creator/lib/ownership/keys/fake:no_owner_recovery_key)"
--exec="console --non-interactive --exit-success='ownership_state = UANY\r\n' --exit-failure='{exit_failure}'"
# Since we've altered the ownership state, clear the bitstream to not affect later tests.
--exec="fpga clear-bitstream"
no-op
""",
),
Expand All @@ -215,7 +216,7 @@ opentitan_binary(
testonly = True,
srcs = ["boot_svc_min_sec_ver_test.c"],
exec_env = [
"//hw/top_earlgrey:fpga_cw310_rom_ext",
"//hw/top_earlgrey:fpga_hyper310_rom_ext",
],
linker_script = "//sw/device/lib/testing/test_framework:ottf_ld_silicon_owner_slot_virtual",
manifest = ":manifest_version_4",
Expand All @@ -237,7 +238,7 @@ opentitan_test(
name = "boot_svc_min_sec_ver_test",
srcs = ["boot_svc_min_sec_ver_test.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "{rom_ext}@0 {firmware}@0x10000 {min_sec_ver_4:signed_bin}@0x90000",
Expand Down
2 changes: 1 addition & 1 deletion sw/device/silicon_creator/rom_ext/e2e/handoff/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ _FAULT_TEST_CASES = {
],
defines = test_data["defines"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
exit_success = test_data["exit_success"],
Expand Down
8 changes: 4 additions & 4 deletions sw/device/silicon_creator/rom_ext/e2e/lockdown/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ opentitan_test(
name = "otp_creator_lockdown",
srcs = ["otp_creator_lockdown.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
exit_failure = "PASS|FAIL|BFV:.*\r\n",
Expand All @@ -36,7 +36,7 @@ opentitan_test(
name = "otp_dai_lockdown",
srcs = ["otp_dai_lockdown.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
exit_failure = "PASS|FAIL|BFV:.*\r\n",
Expand All @@ -60,7 +60,7 @@ opentitan_test(
name = "sram_lockdown",
srcs = ["sram_lockdown.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
deps = [
"//hw/ip/sram_ctrl/data:sram_ctrl_regs",
Expand All @@ -74,7 +74,7 @@ opentitan_test(
name = "epmp_rlb_lockdown",
srcs = ["epmp_rlb_lockdown.c"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
deps = [
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
Expand Down
13 changes: 4 additions & 9 deletions sw/device/silicon_creator/rom_ext/e2e/rescue/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ _POSITIONS = {
"//sw/device/silicon_creator/rom_ext/e2e/verified_boot:boot_test",
],
exec_env = [
"//hw/top_earlgrey:fpga_cw310_rom_ext",
"//hw/top_earlgrey:fpga_hyper310_rom_ext",
],
linker_script = position["linker_script"],
deps = [
Expand All @@ -52,15 +52,14 @@ _POSITIONS = {
opentitan_test(
name = "rescue_firmware_{}".format(name),
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "",
binaries = {
":boot_test_{}".format(name): "payload",
},
slot = position["slot"],
tags = ["broken"],
test_cmd = """
--exec="transport init"
--exec="fpga load-bitstream {bitstream}"
Expand All @@ -81,16 +80,14 @@ _POSITIONS = {
opentitan_test(
name = "next_slot",
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "{rom_ext}@0 {slot_a:signed_bin}@0x10000 {slot_b:signed_bin}@0x90000",
binaries = {
":boot_test_slot_a": "slot_a",
":boot_test_slot_b": "slot_b",
},
# This test requires serial break support which is not available in CI yet.
tags = ["broken"],
test_cmd = """
--exec="transport init"
--exec="fpga load-bitstream {bitstream}"
Expand All @@ -111,16 +108,14 @@ opentitan_test(
opentitan_test(
name = "primary_slot",
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "{rom_ext}@0 {slot_a:signed_bin}@0x10000 {slot_b:signed_bin}@0x90000",
binaries = {
":boot_test_slot_a": "slot_a",
":boot_test_slot_b": "slot_b",
},
# This test requires serial break support which is not available in CI yet.
tags = ["broken"],
test_cmd = """
--exec="transport init"
--exec="fpga load-bitstream {bitstream}"
Expand Down
6 changes: 3 additions & 3 deletions sw/device/silicon_creator/rom_ext/e2e/verified_boot/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ _POSITIONS = {
name = "position_{}".format(name),
srcs = [":boot_test"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
assemble = "{romext}@{romext_offset} {firmware}@{owner_offset}",
Expand Down Expand Up @@ -124,7 +124,7 @@ opentitan_test(
name = "bad_manifest_test",
srcs = [":boot_test"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
exit_failure = "PASS|FAIL|FAULT|BFV:.{8}",
Expand Down Expand Up @@ -169,7 +169,7 @@ _KEYS = {
name = "key_{}".format(name),
srcs = [":boot_test"],
exec_env = {
"//hw/top_earlgrey:fpga_cw310_rom_ext": None,
"//hw/top_earlgrey:fpga_hyper310_rom_ext": None,
},
fpga = fpga_params(
exit_failure = keyinfo["exit_failure"],
Expand Down

0 comments on commit 9a7e239

Please sign in to comment.