HPM SDK
HPMicro Software Development Kit
hpm_otp_table.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021-2024 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_CHIP_ID_OFFSET (64U)
25 #define OTP_TABLE_MAC0_OFFSET (65U)
26 #define OTP_TABLE_USB_PID_OFFSET (68U)
27 #define OTP_TABLE_USB_VID_OFFSET (68U)
28 #define OTP_TABLE_PUBLIC_KEY_HASH_OFFSET (80U)
29 #define OTP_TABLE_UUID_OFFSET (88U)
30 #define OTP_TABLE_EXIP0_KEY_OFFSET (96U)
31 #define OTP_TABLE_MASTER_KEY_OFFSET (112U)
32 
33 /* HARD_LOCK */
34 #define OTP_TABLE_HARD_LOCK_MASK (0xFFFFFFFFU)
35 #define OTP_TABLE_HARD_LOCK_SHIFT (0x0U)
36 #define OTP_TABLE_HARD_LOCK_SET(x) (((uint32_t)(x) << OTP_TABLE_HARD_LOCK_SHIFT) & OTP_TABLE_HARD_LOCK_MASK)
37 #define OTP_TABLE_HARD_LOCK_GET(x) (((uint32_t)(x) & OTP_TABLE_HARD_LOCK_MASK) >> OTP_TABLE_HARD_LOCK_SHIFT)
38 
39 /* LIFECYCLE_B */
40 #define OTP_TABLE_LIFECYCLE_B_MASK (0xF0000000U)
41 #define OTP_TABLE_LIFECYCLE_B_SHIFT (0x1CU)
42 #define OTP_TABLE_LIFECYCLE_B_SET(x) (((uint32_t)(x) << OTP_TABLE_LIFECYCLE_B_SHIFT) & OTP_TABLE_LIFECYCLE_B_MASK)
43 #define OTP_TABLE_LIFECYCLE_B_GET(x) (((uint32_t)(x) & OTP_TABLE_LIFECYCLE_B_MASK) >> OTP_TABLE_LIFECYCLE_B_SHIFT)
44 
45 /* TCU_DISABLE */
46 #define OTP_TABLE_TCU_DISABLE_MASK (0x80000U)
47 #define OTP_TABLE_TCU_DISABLE_SHIFT (0x13U)
48 #define OTP_TABLE_TCU_DISABLE_SET(x) (((uint32_t)(x) << OTP_TABLE_TCU_DISABLE_SHIFT) & OTP_TABLE_TCU_DISABLE_MASK)
49 #define OTP_TABLE_TCU_DISABLE_GET(x) (((uint32_t)(x) & OTP_TABLE_TCU_DISABLE_MASK) >> OTP_TABLE_TCU_DISABLE_SHIFT)
50 
51 /* DEBUG_DISABLE */
52 #define OTP_TABLE_DEBUG_DISABLE_MASK (0x20000U)
53 #define OTP_TABLE_DEBUG_DISABLE_SHIFT (0x11U)
54 #define OTP_TABLE_DEBUG_DISABLE_SET(x) (((uint32_t)(x) << OTP_TABLE_DEBUG_DISABLE_SHIFT) & OTP_TABLE_DEBUG_DISABLE_MASK)
55 #define OTP_TABLE_DEBUG_DISABLE_GET(x) (((uint32_t)(x) & OTP_TABLE_DEBUG_DISABLE_MASK) >> OTP_TABLE_DEBUG_DISABLE_SHIFT)
56 
57 /* JTAG_DISABLE */
58 #define OTP_TABLE_JTAG_DISABLE_MASK (0x10000U)
59 #define OTP_TABLE_JTAG_DISABLE_SHIFT (0x10U)
60 #define OTP_TABLE_JTAG_DISABLE_SET(x) (((uint32_t)(x) << OTP_TABLE_JTAG_DISABLE_SHIFT) & OTP_TABLE_JTAG_DISABLE_MASK)
61 #define OTP_TABLE_JTAG_DISABLE_GET(x) (((uint32_t)(x) & OTP_TABLE_JTAG_DISABLE_MASK) >> OTP_TABLE_JTAG_DISABLE_SHIFT)
62 
63 /* PUK_REVOKE */
64 #define OTP_TABLE_PUK_REVOKE_MASK (0xFF00U)
65 #define OTP_TABLE_PUK_REVOKE_SHIFT (0x8U)
66 #define OTP_TABLE_PUK_REVOKE_SET(x) (((uint32_t)(x) << OTP_TABLE_PUK_REVOKE_SHIFT) & OTP_TABLE_PUK_REVOKE_MASK)
67 #define OTP_TABLE_PUK_REVOKE_GET(x) (((uint32_t)(x) & OTP_TABLE_PUK_REVOKE_MASK) >> OTP_TABLE_PUK_REVOKE_SHIFT)
68 
69 /* LIFECYCLE_A */
70 #define OTP_TABLE_LIFECYCLE_A_MASK (0xFU)
71 #define OTP_TABLE_LIFECYCLE_A_SHIFT (0x0U)
72 #define OTP_TABLE_LIFECYCLE_A_SET(x) (((uint32_t)(x) << OTP_TABLE_LIFECYCLE_A_SHIFT) & OTP_TABLE_LIFECYCLE_A_MASK)
73 #define OTP_TABLE_LIFECYCLE_A_GET(x) (((uint32_t)(x) & OTP_TABLE_LIFECYCLE_A_MASK) >> OTP_TABLE_LIFECYCLE_A_SHIFT)
74 
75 /* MONO_EPOCH */
76 #define OTP_TABLE_MONO_EPOCH_MASK (0xFFFF0000U)
77 #define OTP_TABLE_MONO_EPOCH_SHIFT (0x10U)
78 #define OTP_TABLE_MONO_EPOCH_SET(x) (((uint32_t)(x) << OTP_TABLE_MONO_EPOCH_SHIFT) & OTP_TABLE_MONO_EPOCH_MASK)
79 #define OTP_TABLE_MONO_EPOCH_GET(x) (((uint32_t)(x) & OTP_TABLE_MONO_EPOCH_MASK) >> OTP_TABLE_MONO_EPOCH_SHIFT)
80 
81 /* SW_VER */
82 #define OTP_TABLE_SW_VER_MASK (0xFFFFFFFFU)
83 #define OTP_TABLE_SW_VER_SHIFT (0x0U)
84 #define OTP_TABLE_SW_VER_SET(x) (((uint32_t)(x) << OTP_TABLE_SW_VER_SHIFT) & OTP_TABLE_SW_VER_MASK)
85 #define OTP_TABLE_SW_VER_GET(x) (((uint32_t)(x) & OTP_TABLE_SW_VER_MASK) >> OTP_TABLE_SW_VER_SHIFT)
86 
87 /* DIE_TRACE */
88 #define OTP_TABLE_DIE_TRACE_SHIFT (0x0U)
89 #define OTP_TABLE_DIE_TRACE_BIT_LENGTH (0x80U)
90 
91 /* DEBUG_KEY */
92 #define OTP_TABLE_DEBUG_KEY_SHIFT (0x0U)
93 #define OTP_TABLE_DEBUG_KEY_BIT_LENGTH (0x80U)
94 
95 /* CHIP_ID */
96 #define OTP_TABLE_CHIP_ID_MASK (0xFFFFFFFFU)
97 #define OTP_TABLE_CHIP_ID_SHIFT (0x0U)
98 #define OTP_TABLE_CHIP_ID_SET(x) (((uint32_t)(x) << OTP_TABLE_CHIP_ID_SHIFT) & OTP_TABLE_CHIP_ID_MASK)
99 #define OTP_TABLE_CHIP_ID_GET(x) (((uint32_t)(x) & OTP_TABLE_CHIP_ID_MASK) >> OTP_TABLE_CHIP_ID_SHIFT)
100 
101 /* MAC0 */
102 #define OTP_TABLE_MAC0_SHIFT (0x0U)
103 #define OTP_TABLE_MAC0_BIT_LENGTH (0x30U)
104 
105 /* USB_PID */
106 #define OTP_TABLE_USB_PID_MASK (0xFFFFU)
107 #define OTP_TABLE_USB_PID_SHIFT (0x0U)
108 #define OTP_TABLE_USB_PID_SET(x) (((uint32_t)(x) << OTP_TABLE_USB_PID_SHIFT) & OTP_TABLE_USB_PID_MASK)
109 #define OTP_TABLE_USB_PID_GET(x) (((uint32_t)(x) & OTP_TABLE_USB_PID_MASK) >> OTP_TABLE_USB_PID_SHIFT)
110 
111 /* USB_VID */
112 #define OTP_TABLE_USB_VID_MASK (0xFFFF0000U)
113 #define OTP_TABLE_USB_VID_SHIFT (0x10U)
114 #define OTP_TABLE_USB_VID_SET(x) (((uint32_t)(x) << OTP_TABLE_USB_VID_SHIFT) & OTP_TABLE_USB_VID_MASK)
115 #define OTP_TABLE_USB_VID_GET(x) (((uint32_t)(x) & OTP_TABLE_USB_VID_MASK) >> OTP_TABLE_USB_VID_SHIFT)
116 
117 /* PUBLIC_KEY_HASH */
118 #define OTP_TABLE_PUBLIC_KEY_HASH_SHIFT (0x0U)
119 #define OTP_TABLE_PUBLIC_KEY_HASH_BIT_LENGTH (0x100U)
120 
121 /* UUID */
122 #define OTP_TABLE_UUID_SHIFT (0x0U)
123 #define OTP_TABLE_UUID_BIT_LENGTH (0x80U)
124 
125 /* EXIP0_KEY */
126 #define OTP_TABLE_EXIP0_KEY_SHIFT (0x0U)
127 #define OTP_TABLE_EXIP0_KEY_BIT_LENGTH (0x80U)
128 
129 /* MASTER_KEY */
130 #define OTP_TABLE_MASTER_KEY_SHIFT (0x0U)
131 #define OTP_TABLE_MASTER_KEY_BIT_LENGTH (0x100U)
132 
133 
134 #endif /* HPM_OTP_TABLE_H */