[bazel] Use the bootstrap protocol for mask rom e2e tests
Signed-off-by: Alphan Ulusoy <alphan@google.com>
diff --git a/rules/opentitan_test.bzl b/rules/opentitan_test.bzl
index f5fc492..0014b79 100644
--- a/rules/opentitan_test.bzl
+++ b/rules/opentitan_test.bzl
@@ -140,7 +140,7 @@
# Base Parameters
args = _BASE_PARAMS["args"] + [
"--exec=\"load-bitstream --rom-kind={rom_kind} $(location {bitstream})\"",
- "--exec=\"bootstrap $(location {flash})\"",
+ "--exec=\"bootstrap --protocol {bootstrap_protocol} $(location {flash})\"",
"console",
"--exit-failure=" + shell.quote(_EXIT_FAILURE),
"--exit-success=" + shell.quote(_EXIT_SUCCESS),
@@ -156,6 +156,7 @@
# CW310-specific Parameters
bitstream = "//hw/bitstream:test_rom",
rom_kind = None,
+ bootstrap_protocol = "primitive",
# None
**kwargs):
"""A macro to create CW310 parameters for OpenTitan functional tests.
@@ -327,6 +328,11 @@
else:
fail("Unknown bitstream type. Expected the bitstream label to contain the string 'test_rom' or 'mask_rom'.")
+ # Determine the bootstrap protocol to use.
+ bootstrap_protocol = "primitive"
+ if rom_kind and rom_kind == "maskrom":
+ bootstrap_protocol = "eeprom"
+
# Set OTP image.
otp = params.pop("otp")
@@ -352,6 +358,7 @@
rom = rom,
rom_kind = rom_kind,
bitstream = bitstream,
+ bootstrap_protocol = bootstrap_protocol,
)
if target == "fpga_cw310":
# We attach the uarts configuration to the front of the command
diff --git a/sw/device/silicon_creator/mask_rom/BUILD b/sw/device/silicon_creator/mask_rom/BUILD
index ef86229..2fbd85e 100644
--- a/sw/device/silicon_creator/mask_rom/BUILD
+++ b/sw/device/silicon_creator/mask_rom/BUILD
@@ -322,7 +322,7 @@
cw310 = cw310_params(
args = [
"--exec=\"load-bitstream --rom-kind={rom_kind} $(location {bitstream})\"",
- "--exec=\"bootstrap $(location {flash})\"",
+ "--exec=\"bootstrap --protocol {bootstrap_protocol} $(location {flash})\"",
"console",
"--timeout=3600s",
"--exit-success='{}'".format(BOOT_FAILURE_MSG),