HPM SDK
HPMicro Software Development Kit
hpm_otp_table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2025 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 
9 #ifndef HPM_OTP_TABLE_H
10 #define HPM_OTP_TABLE_H
11 
12 /* OTP WORD OFFSET */
13 #define OTP_TABLE_HARD_LOCK_OFFSET (0U)
14 #define OTP_TABLE_LIFECYCLE_B_OFFSET (1U)
15 #define OTP_TABLE_TCU_DISABLE_OFFSET (1U)
16 #define OTP_TABLE_DEBUG_DISABLE_OFFSET (1U)
17 #define OTP_TABLE_JTAG_DISABLE_OFFSET (1U)
18 #define OTP_TABLE_PUK_REVOKE_OFFSET (1U)
19 #define OTP_TABLE_LIFECYCLE_A_OFFSET (1U)
20 #define OTP_TABLE_MONO_EPOCH_OFFSET (2U)
21 #define OTP_TABLE_SW_VER_OFFSET (3U)
22 #define OTP_TABLE_DIE_TRACE_OFFSET (8U)
23 #define OTP_TABLE_DEBUG_KEY_OFFSET (12U)
24 #define OTP_TABLE_TSNS_BASE_OFFSET (21U)
25 #define OTP_TABLE_TSNS_SLOPE_OFFSET (21U)
26 #define OTP_TABLE_CHIP_ID_OFFSET (64U)
27 #define OTP_TABLE_USB_PID_OFFSET (68U)
28 #define OTP_TABLE_USB_VID_OFFSET (68U)
29 #define OTP_TABLE_PUBLIC_KEY_HASH_OFFSET (80U)
30 #define OTP_TABLE_UUID_OFFSET (88U)
31 #define OTP_TABLE_EXIP0_KEY_OFFSET (96U)
32 #define OTP_TABLE_EXIP1_KEY_OFFSET (104U)
33 #define OTP_TABLE_MASTER_KEY_OFFSET (112U)
34 
35 /* HARD_LOCK */
36 #define OTP_TABLE_HARD_LOCK_MASK (0xFFFFFFFFU)
37 #define OTP_TABLE_HARD_LOCK_SHIFT (0x0U)
38 #define OTP_TABLE_HARD_LOCK_SET(x) (((uint32_t)(x) << OTP_TABLE_HARD_LOCK_SHIFT) & OTP_TABLE_HARD_LOCK_MASK)
39 #define OTP_TABLE_HARD_LOCK_GET(x) (((uint32_t)(x) & OTP_TABLE_HARD_LOCK_MASK) >> OTP_TABLE_HARD_LOCK_SHIFT)
40 
41 /* LIFECYCLE_B */
42 #define OTP_TABLE_LIFECYCLE_B_MASK (0xF0000000U)
43 #define OTP_TABLE_LIFECYCLE_B_SHIFT (0x1CU)
44 #define OTP_TABLE_LIFECYCLE_B_SET(x) (((uint32_t)(x) << OTP_TABLE_LIFECYCLE_B_SHIFT) & OTP_TABLE_LIFECYCLE_B_MASK)
45 #define OTP_TABLE_LIFECYCLE_B_GET(x) (((uint32_t)(x) & OTP_TABLE_LIFECYCLE_B_MASK) >> OTP_TABLE_LIFECYCLE_B_SHIFT)
46 
47 /* TCU_DISABLE */
48 #define OTP_TABLE_TCU_DISABLE_MASK (0x80000U)
49 #define OTP_TABLE_TCU_DISABLE_SHIFT (0x13U)
50 #define OTP_TABLE_TCU_DISABLE_SET(x) (((uint32_t)(x) << OTP_TABLE_TCU_DISABLE_SHIFT) & OTP_TABLE_TCU_DISABLE_MASK)
51 #define OTP_TABLE_TCU_DISABLE_GET(x) (((uint32_t)(x) & OTP_TABLE_TCU_DISABLE_MASK) >> OTP_TABLE_TCU_DISABLE_SHIFT)
52 
53 /* DEBUG_DISABLE */
54 #define OTP_TABLE_DEBUG_DISABLE_MASK (0x20000U)
55 #define OTP_TABLE_DEBUG_DISABLE_SHIFT (0x11U)
56 #define OTP_TABLE_DEBUG_DISABLE_SET(x) (((uint32_t)(x) << OTP_TABLE_DEBUG_DISABLE_SHIFT) & OTP_TABLE_DEBUG_DISABLE_MASK)
57 #define OTP_TABLE_DEBUG_DISABLE_GET(x) (((uint32_t)(x) & OTP_TABLE_DEBUG_DISABLE_MASK) >> OTP_TABLE_DEBUG_DISABLE_SHIFT)
58 
59 /* JTAG_DISABLE */
60 #define OTP_TABLE_JTAG_DISABLE_MASK (0x10000U)
61 #define OTP_TABLE_JTAG_DISABLE_SHIFT (0x10U)
62 #define OTP_TABLE_JTAG_DISABLE_SET(x) (((uint32_t)(x) << OTP_TABLE_JTAG_DISABLE_SHIFT) & OTP_TABLE_JTAG_DISABLE_MASK)
63 #define OTP_TABLE_JTAG_DISABLE_GET(x) (((uint32_t)(x) & OTP_TABLE_JTAG_DISABLE_MASK) >> OTP_TABLE_JTAG_DISABLE_SHIFT)
64 
65 /* PUK_REVOKE */
66 #define OTP_TABLE_PUK_REVOKE_MASK (0xFF00U)
67 #define OTP_TABLE_PUK_REVOKE_SHIFT (0x8U)
68 #define OTP_TABLE_PUK_REVOKE_SET(x) (((uint32_t)(x) << OTP_TABLE_PUK_REVOKE_SHIFT) & OTP_TABLE_PUK_REVOKE_MASK)
69 #define OTP_TABLE_PUK_REVOKE_GET(x) (((uint32_t)(x) & OTP_TABLE_PUK_REVOKE_MASK) >> OTP_TABLE_PUK_REVOKE_SHIFT)
70 
71 /* LIFECYCLE_A */
72 #define OTP_TABLE_LIFECYCLE_A_MASK (0xFU)
73 #define OTP_TABLE_LIFECYCLE_A_SHIFT (0x0U)
74 #define OTP_TABLE_LIFECYCLE_A_SET(x) (((uint32_t)(x) << OTP_TABLE_LIFECYCLE_A_SHIFT) & OTP_TABLE_LIFECYCLE_A_MASK)
75 #define OTP_TABLE_LIFECYCLE_A_GET(x) (((uint32_t)(x) & OTP_TABLE_LIFECYCLE_A_MASK) >> OTP_TABLE_LIFECYCLE_A_SHIFT)
76 
77 /* MONO_EPOCH */
78 #define OTP_TABLE_MONO_EPOCH_MASK (0xFFFF0000U)
79 #define OTP_TABLE_MONO_EPOCH_SHIFT (0x10U)
80 #define OTP_TABLE_MONO_EPOCH_SET(x) (((uint32_t)(x) << OTP_TABLE_MONO_EPOCH_SHIFT) & OTP_TABLE_MONO_EPOCH_MASK)
81 #define OTP_TABLE_MONO_EPOCH_GET(x) (((uint32_t)(x) & OTP_TABLE_MONO_EPOCH_MASK) >> OTP_TABLE_MONO_EPOCH_SHIFT)
82 
83 /* SW_VER */
84 #define OTP_TABLE_SW_VER_MASK (0xFFFFFFFFU)
85 #define OTP_TABLE_SW_VER_SHIFT (0x0U)
86 #define OTP_TABLE_SW_VER_SET(x) (((uint32_t)(x) << OTP_TABLE_SW_VER_SHIFT) & OTP_TABLE_SW_VER_MASK)
87 #define OTP_TABLE_SW_VER_GET(x) (((uint32_t)(x) & OTP_TABLE_SW_VER_MASK) >> OTP_TABLE_SW_VER_SHIFT)
88 
89 /* DIE_TRACE */
90 #define OTP_TABLE_DIE_TRACE_SHIFT (0x0U)
91 #define OTP_TABLE_DIE_TRACE_BIT_LENGTH (0x80U)
92 
93 /* DEBUG_KEY */
94 #define OTP_TABLE_DEBUG_KEY_SHIFT (0x0U)
95 #define OTP_TABLE_DEBUG_KEY_BIT_LENGTH (0x80U)
96 
97 /* TSNS_BASE */
98 #define OTP_TABLE_TSNS_BASE_MASK (0xFFFFU)
99 #define OTP_TABLE_TSNS_BASE_SHIFT (0x0U)
100 #define OTP_TABLE_TSNS_BASE_SET(x) (((uint32_t)(x) << OTP_TABLE_TSNS_BASE_SHIFT) & OTP_TABLE_TSNS_BASE_MASK)
101 #define OTP_TABLE_TSNS_BASE_GET(x) (((uint32_t)(x) & OTP_TABLE_TSNS_BASE_MASK) >> OTP_TABLE_TSNS_BASE_SHIFT)
102 
103 /* TSNS_SLOPE */
104 #define OTP_TABLE_TSNS_SLOPE_MASK (0xFFFF0000U)
105 #define OTP_TABLE_TSNS_SLOPE_SHIFT (0x10U)
106 #define OTP_TABLE_TSNS_SLOPE_SET(x) (((uint32_t)(x) << OTP_TABLE_TSNS_SLOPE_SHIFT) & OTP_TABLE_TSNS_SLOPE_MASK)
107 #define OTP_TABLE_TSNS_SLOPE_GET(x) (((uint32_t)(x) & OTP_TABLE_TSNS_SLOPE_MASK) >> OTP_TABLE_TSNS_SLOPE_SHIFT)
108 
109 /* CHIP_ID */
110 #define OTP_TABLE_CHIP_ID_MASK (0xFFFFFFFFU)
111 #define OTP_TABLE_CHIP_ID_SHIFT (0x0U)
112 #define OTP_TABLE_CHIP_ID_SET(x) (((uint32_t)(x) << OTP_TABLE_CHIP_ID_SHIFT) & OTP_TABLE_CHIP_ID_MASK)
113 #define OTP_TABLE_CHIP_ID_GET(x) (((uint32_t)(x) & OTP_TABLE_CHIP_ID_MASK) >> OTP_TABLE_CHIP_ID_SHIFT)
114 
115 /* USB_PID */
116 #define OTP_TABLE_USB_PID_MASK (0xFFFFU)
117 #define OTP_TABLE_USB_PID_SHIFT (0x0U)
118 #define OTP_TABLE_USB_PID_SET(x) (((uint32_t)(x) << OTP_TABLE_USB_PID_SHIFT) & OTP_TABLE_USB_PID_MASK)
119 #define OTP_TABLE_USB_PID_GET(x) (((uint32_t)(x) & OTP_TABLE_USB_PID_MASK) >> OTP_TABLE_USB_PID_SHIFT)
120 
121 /* USB_VID */
122 #define OTP_TABLE_USB_VID_MASK (0xFFFF0000U)
123 #define OTP_TABLE_USB_VID_SHIFT (0x10U)
124 #define OTP_TABLE_USB_VID_SET(x) (((uint32_t)(x) << OTP_TABLE_USB_VID_SHIFT) & OTP_TABLE_USB_VID_MASK)
125 #define OTP_TABLE_USB_VID_GET(x) (((uint32_t)(x) & OTP_TABLE_USB_VID_MASK) >> OTP_TABLE_USB_VID_SHIFT)
126 
127 /* PUBLIC_KEY_HASH */
128 #define OTP_TABLE_PUBLIC_KEY_HASH_SHIFT (0x0U)
129 #define OTP_TABLE_PUBLIC_KEY_HASH_BIT_LENGTH (0x100U)
130 
131 /* UUID */
132 #define OTP_TABLE_UUID_SHIFT (0x0U)
133 #define OTP_TABLE_UUID_BIT_LENGTH (0x80U)
134 
135 /* EXIP0_KEY */
136 #define OTP_TABLE_EXIP0_KEY_SHIFT (0x0U)
137 #define OTP_TABLE_EXIP0_KEY_BIT_LENGTH (0x80U)
138 
139 /* EXIP1_KEY */
140 #define OTP_TABLE_EXIP1_KEY_SHIFT (0x0U)
141 #define OTP_TABLE_EXIP1_KEY_BIT_LENGTH (0x80U)
142 
143 /* MASTER_KEY */
144 #define OTP_TABLE_MASTER_KEY_SHIFT (0x0U)
145 #define OTP_TABLE_MASTER_KEY_BIT_LENGTH (0x100U)
146 
147 
148 #endif /* HPM_OTP_TABLE_H */