|
| 1 | +# Copyright lowRISC contributors (OpenTitan project). |
| 2 | +# Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | + |
| 5 | +load( |
| 6 | + "//rules/opentitan:defs.bzl", |
| 7 | + "fpga_params", |
| 8 | + "opentitan_test", |
| 9 | +) |
| 10 | + |
| 11 | +package(default_visibility = ["//visibility:public"]) |
| 12 | + |
| 13 | +opentitan_test( |
| 14 | + name = "ownership_transfer_test", |
| 15 | + srcs = ["//sw/device/silicon_creator/rom_ext/e2e/verified_boot:boot_test"], |
| 16 | + exec_env = { |
| 17 | + "//hw/top_earlgrey:fpga_hyper310_rom_ext": None, |
| 18 | + }, |
| 19 | + fpga = fpga_params( |
| 20 | + # This test doesn't change OTP, but it modifies the ownership INFO |
| 21 | + # pages, so we need to clear the bitstream after the test, which is |
| 22 | + # what the `changes_otp` parameter actually does. |
| 23 | + changes_otp = True, |
| 24 | + data = [ |
| 25 | + "//sw/device/silicon_creator/lib/ownership/keys/dummy:activate_key", |
| 26 | + "//sw/device/silicon_creator/lib/ownership/keys/dummy:app_prod_pub", |
| 27 | + "//sw/device/silicon_creator/lib/ownership/keys/dummy:owner_key", |
| 28 | + "//sw/device/silicon_creator/lib/ownership/keys/dummy:unlock_key", |
| 29 | + "//sw/device/silicon_creator/lib/ownership/keys/fake:unlock_key", |
| 30 | + ], |
| 31 | + test_cmd = """ |
| 32 | + --clear-bitstream |
| 33 | + --bootstrap={firmware} |
| 34 | + --unlock-key=$(location //sw/device/silicon_creator/lib/ownership/keys/fake:unlock_key) |
| 35 | + --next-owner-key=$(location //sw/device/silicon_creator/lib/ownership/keys/dummy:owner_key) |
| 36 | + --next-unlock-key=$(location //sw/device/silicon_creator/lib/ownership/keys/dummy:unlock_key) |
| 37 | + --next-activate-key=$(location //sw/device/silicon_creator/lib/ownership/keys/dummy:activate_key) |
| 38 | + --next-application-key=$(location //sw/device/silicon_creator/lib/ownership/keys/dummy:app_prod_pub) |
| 39 | + """, |
| 40 | + test_harness = "//sw/host/tests/ownership:transfer_test", |
| 41 | + ), |
| 42 | + rsa_key = { |
| 43 | + "//sw/device/silicon_creator/lib/ownership/keys/dummy:app_prod": "app_prod", |
| 44 | + }, |
| 45 | + deps = [ |
| 46 | + "//sw/device/lib/base:status", |
| 47 | + "//sw/device/lib/testing/test_framework:ottf_main", |
| 48 | + "//sw/device/silicon_creator/lib:boot_log", |
| 49 | + "//sw/device/silicon_creator/lib/drivers:retention_sram", |
| 50 | + ], |
| 51 | +) |
0 commit comments