Software APIs
otp_fi_commands.h
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 #ifndef OPENTITAN_SW_DEVICE_TESTS_PENETRATIONTESTS_JSON_OTP_FI_COMMANDS_H_
6 #define OPENTITAN_SW_DEVICE_TESTS_PENETRATIONTESTS_JSON_OTP_FI_COMMANDS_H_
7 #include "sw/device/lib/ujson/ujson_derive.h"
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 // clang-format off
13 
14 #define OTPFI_SUBCOMMAND(_, value) \
15  value(_, HwCfg) \
16  value(_, Init) \
17  value(_, LifeCycle) \
18  value(_, OwnerSwCfg) \
19  value(_, VendorTest)
20 UJSON_SERDE_ENUM(OtpFiSubcommand, otp_fi_subcommand_t, OTPFI_SUBCOMMAND);
21 
22 #define OTPFI_VENDORTEST_PARTITION(field, string) \
23  field(vendor_test_comp, uint32_t, 16) \
24  field(vendor_test_fi, uint32_t, 16) \
25  field(otp_status_codes, uint32_t) \
26  field(otp_error_causes, uint8_t, 10) \
27  field(alerts, uint32_t, 3) \
28  field(ast_alerts, uint32_t, 2)
29 UJSON_SERDE_STRUCT(OtpFiVendortestPartition, otp_fi_vendortest_partition_t, OTPFI_VENDORTEST_PARTITION);
30 
31 #define OTPFI_OWNERSWCFG_PARTITION(field, string) \
32  field(owner_sw_cfg_comp, uint32_t, 200) \
33  field(owner_sw_cfg_fi, uint32_t, 200) \
34  field(otp_status_codes, uint32_t) \
35  field(otp_error_causes, uint8_t, 10) \
36  field(alerts, uint32_t, 3) \
37  field(ast_alerts, uint32_t, 2)
38 UJSON_SERDE_STRUCT(OtpFiOwnerswcfgPartition, otp_fi_ownerswcfg_partition_t, OTPFI_OWNERSWCFG_PARTITION);
39 
40 #define OTPFI_HWCFG_PARTITION(field, string) \
41  field(hw_cfg_comp, uint32_t, 20) \
42  field(hw_cfg_fi, uint32_t, 20) \
43  field(otp_status_codes, uint32_t) \
44  field(otp_error_causes, uint8_t, 10) \
45  field(alerts, uint32_t, 3) \
46  field(ast_alerts, uint32_t, 2)
47 UJSON_SERDE_STRUCT(OtpFiHwcfgPartition, otp_fi_hwcfg_partition_t, OTPFI_HWCFG_PARTITION);
48 
49 #define OTPFI_LIFECYCLE_PARTITION(field, string) \
50  field(life_cycle_comp, uint32_t, 22) \
51  field(life_cycle_fi, uint32_t, 22) \
52  field(otp_status_codes, uint32_t) \
53  field(otp_error_causes, uint8_t, 10) \
54  field(alerts, uint32_t, 3) \
55  field(ast_alerts, uint32_t, 2)
56 UJSON_SERDE_STRUCT(OtpFiLifecyclePartition, otp_fi_lifecycle_partition_t, OTPFI_LIFECYCLE_PARTITION);
57 
58 // clang-format on
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 #endif // OPENTITAN_SW_DEVICE_TESTS_PENETRATIONTESTS_JSON_OTP_FI_COMMANDS_H_