Skip to content

Commit 9dda62d

Browse files
timothytrippelpamaury
authored andcommitted
[manuf] remove duplicate tests and config files
All provisioning flows are now tested E2E with the orchestrator script. This makes the `opentitan_test` targets that also ran said flows redundant and unneeded, thus we remove them. Additionally, we no longer need duplicate CA configuration files as these are generated on the fly by the orchestrator script from the same information that was duplicated in the orchestrator SKU configuration files. This simplifies our test infrastructure and provisioning flow configurations. Signed-off-by: Tim Trippel <[email protected]> (cherry picked from commit 6a5747a)
1 parent 367271c commit 9dda62d

File tree

6 files changed

+2
-193
lines changed

6 files changed

+2
-193
lines changed

sw/device/silicon_creator/manuf/base/BUILD

Lines changed: 0 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ load(
1414
"fpga_params",
1515
"opentitan_binary",
1616
"opentitan_test",
17-
"silicon_params",
1817
)
1918
load(
2019
"//sw/device/silicon_creator/manuf/base:provisioning_inputs.bzl",
21-
"CP_PROVISIONING_INPUTS",
2220
"EARLGREY_OTP_CFGS",
2321
"EARLGREY_SKUS",
24-
"FT_PROVISIONING_INPUTS",
2522
)
2623
load(
2724
"//sw/device/silicon_creator/rom/e2e:defs.bzl",
@@ -127,38 +124,6 @@ opentitan_binary(
127124
],
128125
)
129126

130-
_CP_PROVISIONING_CMD_ARGS = """
131-
--elf={sram_cp_provision}
132-
""" + CP_PROVISIONING_INPUTS
133-
134-
_CP_PROVISIONING_HARNESS = "//sw/host/provisioning/cp"
135-
136-
opentitan_test(
137-
name = "cp_provision",
138-
exec_env = {
139-
"//hw/top_earlgrey:fpga_cw310_rom_with_fake_keys": None,
140-
"//hw/top_earlgrey:fpga_cw340_rom_with_fake_keys": None,
141-
"//hw/top_earlgrey:silicon_creator": None,
142-
},
143-
fpga = fpga_params(
144-
binaries = {":sram_cp_provision": "sram_cp_provision"},
145-
changes_otp = True,
146-
needs_jtag = True,
147-
otp = "//hw/top_earlgrey/data/otp/emulation:otp_img_test_unlocked0_manuf_empty",
148-
tags = ["manuf"],
149-
test_cmd = _CP_PROVISIONING_CMD_ARGS,
150-
test_harness = _CP_PROVISIONING_HARNESS,
151-
),
152-
silicon = silicon_params(
153-
binaries = {":sram_cp_provision": "sram_cp_provision"},
154-
changes_otp = True,
155-
interface = "teacup",
156-
needs_jtag = True,
157-
test_cmd = _CP_PROVISIONING_CMD_ARGS,
158-
test_harness = _CP_PROVISIONING_HARNESS,
159-
),
160-
)
161-
162127
opentitan_test(
163128
name = "cp_provision_functest",
164129
exec_env = {
@@ -363,16 +328,6 @@ manifest(d = {
363328
for sku, config in EARLGREY_SKUS.items()
364329
]
365330

366-
_FT_PROVISIONING_CMD_ARGS = """
367-
--elf={{sram_ft_individualize}}
368-
--bootstrap={{ft_personalize}}
369-
--second-bootstrap={{bundle}}
370-
--ca-config={{ca_config}}
371-
--owner-success-text="{owner_fw_boot_str}"
372-
""" + FT_PROVISIONING_INPUTS
373-
374-
_FT_PROVISIONING_HARNESS = "//sw/host/provisioning/ft:ft_{}"
375-
376331
[
377332
opentitan_binary_assemble(
378333
name = "ft_fw_bundle_{}".format(sku),
@@ -410,112 +365,6 @@ filegroup(
410365
EXT_SIGNED_PERSO_BINS,
411366
)
412367

413-
[
414-
opentitan_test(
415-
name = "ft_provision_{}".format(sku),
416-
exec_env = {
417-
"//hw/top_earlgrey:fpga_cw310_rom_with_fake_keys": None,
418-
"//hw/top_earlgrey:fpga_cw340_rom_with_fake_keys": None,
419-
"//hw/top_earlgrey:fpga_cw340_sival": None,
420-
"//hw/top_earlgrey:silicon_creator": None,
421-
},
422-
fpga = fpga_params(
423-
timeout = "moderate",
424-
binaries =
425-
{
426-
":sram_ft_individualize_{}".format(config["otp"]): "sram_ft_individualize",
427-
# Use a pre-compiled perso binary if the SKU defines it,
428-
# else use the label of the opentitan_binary for the SKU.
429-
config.get(
430-
"perso_bin",
431-
":ft_personalize_{}".format(sku),
432-
): "ft_personalize",
433-
config["ca_config"]: "ca_config",
434-
":ft_fw_bundle_{}".format(sku): "bundle",
435-
},
436-
changes_otp = True,
437-
data = [config["ca_data"]],
438-
needs_jtag = True,
439-
otp = "//hw/top_earlgrey/data/otp/emulation:otp_img_test_locked0_manuf_initialized",
440-
owner_slot_b = OWNER_SLOTS["b"],
441-
rom_ext_slot_a = SLOTS["a"],
442-
rom_ext_slot_b = SLOTS["b"],
443-
tags = [
444-
"lc_test_locked0",
445-
"manuf",
446-
] + (["manual"] if config.get("offline", False) else []),
447-
test_cmd = _FT_PROVISIONING_CMD_ARGS.format(
448-
owner_fw_boot_str = config.get("owner_fw_boot_str", ""),
449-
),
450-
test_harness = _FT_PROVISIONING_HARNESS.format(sku),
451-
),
452-
silicon = silicon_params(
453-
binaries =
454-
{
455-
":sram_ft_individualize_{}".format(config["otp"]): "sram_ft_individualize",
456-
# Use a pre-compiled perso binary if the SKU defines it,
457-
# else use the label of the opentitan_binary for the SKU.
458-
config.get(
459-
"perso_bin",
460-
":ft_personalize_{}".format(sku),
461-
): "ft_personalize",
462-
config["ca_config"]: "ca_config",
463-
":ft_fw_bundle_{}".format(sku): "bundle",
464-
},
465-
changes_otp = True,
466-
data = [config["ca_data"]],
467-
interface = "teacup",
468-
needs_jtag = True,
469-
owner_slot_b = OWNER_SLOTS["b"],
470-
rom_ext_slot_a = SLOTS["a"],
471-
rom_ext_slot_b = SLOTS["b"],
472-
test_cmd = _FT_PROVISIONING_CMD_ARGS.format(
473-
owner_fw_boot_str = config.get("owner_fw_boot_str", ""),
474-
),
475-
test_harness = _FT_PROVISIONING_HARNESS.format(sku),
476-
),
477-
)
478-
for sku, config in EARLGREY_SKUS.items()
479-
]
480-
481-
test_suite(
482-
name = "ft_provision_cw310",
483-
tags = ["manual"],
484-
tests = [
485-
":ft_provision_{}_fpga_cw310_rom_with_fake_keys".format(sku)
486-
for sku, config in EARLGREY_SKUS.items()
487-
if not config.get("offline", False)
488-
],
489-
)
490-
491-
test_suite(
492-
name = "ft_provision_including_offline_cw310",
493-
tags = ["manual"],
494-
tests = [
495-
":ft_provision_{}_fpga_cw310_rom_with_fake_keys".format(sku)
496-
for sku in EARLGREY_SKUS.keys()
497-
],
498-
)
499-
500-
test_suite(
501-
name = "ft_provision_cw340",
502-
tags = ["manual"],
503-
tests = [
504-
":ft_provision_{}_fpga_cw340_rom_with_fake_keys".format(sku)
505-
for sku, config in EARLGREY_SKUS.items()
506-
if not config.get("offline", False)
507-
],
508-
)
509-
510-
test_suite(
511-
name = "ft_provision_including_offline_cw340",
512-
tags = ["manual"],
513-
tests = [
514-
":ft_provision_{}_fpga_cw340_rom_with_fake_keys".format(sku)
515-
for sku in EARLGREY_SKUS.keys()
516-
],
517-
)
518-
519368
_DISQUALIFIED_FOR_SIGNING = ["emulation"]
520369

521370
[

sw/device/silicon_creator/manuf/base/provisioning_inputs.bzl

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ EARLGREY_SKUS = {
2525
# OTP Config: Emulation; DICE Certs: X.509; Additional Certs: None
2626
"emulation": {
2727
"otp": "emulation",
28-
"ca_config": "//sw/device/silicon_creator/manuf/keys/fake:ca_config.json",
2928
"ca_data": "@//sw/device/silicon_creator/manuf/keys/fake:ca_data",
3029
"dice_libs": ["//sw/device/silicon_creator/lib/cert:dice"],
3130
"host_ext_libs": ["@provisioning_exts//:default_ft_ext_lib"],
@@ -40,7 +39,6 @@ EARLGREY_SKUS = {
4039
# OTP Config: Emulation; DICE Certs: CWT; Additional Certs: None
4140
"emulation_dice_cwt": {
4241
"otp": "emulation",
43-
"ca_config": "//sw/device/silicon_creator/manuf/keys/fake:ca_config.json",
4442
"ca_data": "@//sw/device/silicon_creator/manuf/keys/fake:ca_data",
4543
"dice_libs": ["//sw/device/silicon_creator/lib/cert:dice_cwt"],
4644
"host_ext_libs": ["@provisioning_exts//:default_ft_ext_lib"],
@@ -57,7 +55,6 @@ EARLGREY_SKUS = {
5755
# OTP Config: Emulation; DICE Certs: X.509; Additional Certs: TPM EK
5856
"emulation_tpm": {
5957
"otp": "emulation",
60-
"ca_config": "//sw/device/silicon_creator/manuf/keys/fake:ca_config.json",
6158
"ca_data": "@//sw/device/silicon_creator/manuf/keys/fake:ca_data",
6259
"dice_libs": ["//sw/device/silicon_creator/lib/cert:dice"],
6360
"host_ext_libs": ["@provisioning_exts//:default_ft_ext_lib"],
@@ -78,7 +75,6 @@ EARLGREY_SKUS = {
7875
# a more appropriate solution is found.
7976
# "sival": {
8077
# "otp": "sival",
81-
# "ca_config": "//sw/device/silicon_creator/manuf/keys/sival:ca_config.json",
8278
# "ca_data": "@//sw/device/silicon_creator/manuf/keys/sival:ca_data",
8379
# "dice_libs": ["//sw/device/silicon_creator/lib/cert:dice"],
8480
# "host_ext_libs": ["@provisioning_exts//:default_ft_ext_lib"],
@@ -94,24 +90,3 @@ EARLGREY_SKUS = {
9490
# "offline": True,
9591
# },
9692
} | EXT_EARLGREY_SKUS
97-
98-
_TEST_TOKENS = """
99-
--test-unlock-token="0x11111111_11111111_11111111_11111111"
100-
--test-exit-token="0x11111111_11111111_11111111_11111111"
101-
"""
102-
103-
CP_PROVISIONING_INPUTS = _TEST_TOKENS + """
104-
--wafer-auth-secret="0x00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000"
105-
"""
106-
107-
FT_PROVISIONING_INPUTS = _TEST_TOKENS + """
108-
--ft-device-id="0x11111111_22222222_33333333_44444444"
109-
--target-mission-mode-lc-state="prod"
110-
--rma-unlock-token="0x01234567_89abcdef_01234567_89abcdef"
111-
--token-encrypt-key-der-file="sw/device/silicon_creator/manuf/keys/fake/rma_unlock_enc_rsa3072.pub.der"
112-
--rom-ext-measurement="0x11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111"
113-
--owner-manifest-measurement="0x22222222_22222222_22222222_22222222_22222222_22222222_22222222_22222222"
114-
--owner-measurement="0x33333333_33333333_33333333_33333333_33333333_33333333_33333333_33333333"
115-
--rom-ext-security-version="0"
116-
--owner-security-version="0"
117-
"""

sw/device/silicon_creator/manuf/keys/fake/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ exports_files(glob(["**"]))
99
filegroup(
1010
name = "ca_data",
1111
srcs = [
12-
":ca_config.json",
1312
":dice_ca.pem",
1413
":ext_ca.pem",
1514
":rma_unlock_enc_rsa3072.pub.der",

sw/device/silicon_creator/manuf/keys/fake/ca_config.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

sw/host/provisioning/orchestrator/configs/skus/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package(default_visibility = ["//visibility:public"])
1212
exports_files(glob(["**"]))
1313

1414
filegroup(
15-
name = "sku_all",
15+
name = "all",
1616
srcs = depset([
1717
config["orchestrator_cfg"]
1818
for _, config in EARLGREY_SKUS.items()

sw/host/provisioning/orchestrator/src/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ filegroup(
8282
"//sw/device/silicon_creator/manuf/keys:ca_data_all",
8383
"//sw/host/provisioning/cp",
8484
"//sw/host/provisioning/ft:ft_all",
85-
"//sw/host/provisioning/orchestrator/configs/skus:sku_all",
85+
"//sw/host/provisioning/orchestrator/configs/skus:all",
8686
"//third_party/openocd:jtag_cmsis_dap_adapter_cfg",
8787
"//third_party/openocd:jtag_olimex_cfg",
8888
"//third_party/openocd:openocd_bin",

0 commit comments

Comments
 (0)