Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dv] Add ROT_AUTH configuration test. #25704

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions hw/top_earlgrey/dv/chip_sim_cfg.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,22 @@
run_timeout_mins: 120
reseed: 1
}
{
name: chip_sw_otp_ctrl_rot_auth_config
uvm_test_seq: chip_sw_rom_e2e_jtag_inject_vseq
sw_images: [
"//hw/ip/otp_ctrl/data/earlgrey_skus/emulation:otp_img_test_unlocked0_manuf_empty:4",
"//sw/device/tests:otp_ctrl_rot_auth_config_test:5",
]
en_run_modes: ["sw_test_mode_mask_rom"]
run_opts: [
"+sw_test_timeout_ns=160_000_000",
"+use_jtag_dmi=1",
"+use_otp_image=OtpTypeCustom",
]
reseed: 1
run_timeout_mins: 240
}
{
name: chip_sw_otp_ctrl_ecc_error_vendor_test
uvm_test_seq: chip_sw_otp_ctrl_vendor_test_ecc_error_vseq
Expand Down
27 changes: 27 additions & 0 deletions sw/device/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2303,6 +2303,33 @@ opentitan_test(
],
)

opentitan_binary(
name = "otp_ctrl_rot_auth_config_test",
testonly = True,
srcs = ["otp_ctrl_rot_auth_config_test.c"],
exec_env = [
"//hw/top_earlgrey:sim_dv",
],
kind = "ram",
linker_script = "//sw/device/examples/sram_program:sram_program_linker_script",
deps = [
"//hw/top_earlgrey/sw/autogen:top_earlgrey",
"//sw/device/lib/arch:device",
"//sw/device/lib/base:abs_mmio",
"//sw/device/lib/base:macros",
"//sw/device/lib/dif:otp_ctrl",
"//sw/device/lib/runtime:log",
"//sw/device/lib/testing:otp_ctrl_testutils",
"//sw/device/lib/testing/test_framework:check",
"//sw/device/lib/testing/test_framework:ottf_test_config",
"//sw/device/lib/testing/test_framework:status",
"//sw/device/silicon_creator/manuf/lib:individualize",
"//sw/device/silicon_creator/manuf/lib:individualize_sw_cfg_sival",
"//sw/device/silicon_creator/manuf/lib:otp_fields",
"//sw/device/silicon_creator/manuf/lib:sram_start",
],
)

opentitan_test(
name = "keymgr_sideload_aes_test",
srcs = ["keymgr_sideload_aes_test.c"],
Expand Down
35 changes: 35 additions & 0 deletions sw/device/tests/otp_ctrl_rot_auth_config_test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright lowRISC contributors (OpenTitan project).
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#include <stdint.h>

#include "sw/device/lib/arch/device.h"
#include "sw/device/lib/base/abs_mmio.h"
#include "sw/device/lib/dif/dif_otp_ctrl.h"
#include "sw/device/lib/runtime/ibex.h"
#include "sw/device/lib/runtime/log.h"
#include "sw/device/lib/runtime/print.h"
#include "sw/device/lib/testing/otp_ctrl_testutils.h"
#include "sw/device/lib/testing/test_framework/check.h"
#include "sw/device/lib/testing/test_framework/ottf_test_config.h"
#include "sw/device/silicon_creator/manuf/lib/individualize.h"
#include "sw/device/silicon_creator/manuf/lib/individualize_sw_cfg.h"
#include "sw/device/silicon_creator/manuf/lib/otp_fields.h"

#include "hw/top_earlgrey/sw/autogen/top_earlgrey.h"

OTTF_DEFINE_TEST_CONFIG();

bool test_main(void) {
static dif_otp_ctrl_t otp_ctrl;
CHECK_DIF_OK(dif_otp_ctrl_init(
mmio_region_from_addr(TOP_EARLGREY_OTP_CTRL_CORE_BASE_ADDR), &otp_ctrl));
CHECK_STATUS_OK(
manuf_individualize_device_rot_creator_auth_codesign(&otp_ctrl));
CHECK_STATUS_OK(manuf_individualize_device_rot_creator_auth_state(&otp_ctrl));
if (kDeviceType == kDeviceSimDV) {
test_status_set(kTestStatusPassed);
}
return true;
}
Loading