1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright 2017-2020 NXP
4  *
5  * Brief   Version Registers.
6  */
7 #ifndef __VERSION_REGS_H__
8 #define __VERSION_REGS_H__
9 
10 #include <util.h>
11 
12 /* Compile Time Parameters */
13 #define CTPR_MS                         0x0FA8
14 #define BM_CTPR_MS_RNG_I                SHIFT_U32(0x7, 8)
15 #define GET_CTPR_MS_RNG_I(val)          (((val) & BM_CTPR_MS_RNG_I) >> 8)
16 
17 #define CTPR_LS				0x0FAC
18 #define BM_CTPR_LS_SPLIT_KEY		BIT(14)
19 #define GET_CTPR_LS_SPLIT_KEY(val)	(((val) & BM_CTPR_LS_SPLIT_KEY) >> 14)
20 
21 /* Secure Memory Version ID */
22 #define SMVID_MS			0x0FD8
23 #define BM_SMVID_MS_MAX_NPAG		SHIFT_U32(0x3FF, 16)
24 #define GET_SMVID_MS_MAX_NPAG(val)	(((val) & BM_SMVID_MS_MAX_NPAG) >> 16)
25 #define BM_SMVID_MS_NPRT		SHIFT_U32(0xF, 12)
26 #define GET_SMVID_MS_NPRT(val)		(((val) & BM_SMVID_MS_NPRT) >> 12)
27 
28 #define SMVID_LS			0x0FDC
29 #define BM_SMVID_LS_PSIZ		SHIFT_U32(0x7, 16)
30 #define GET_SMVID_LS_PSIZ(val)		(((val) & BM_SMVID_LS_PSIZ) >> 16)
31 
32 /* CHA Cluster Block Version ID */
33 #define CCBVID                          0x0FE4
34 #define BM_CCBVID_CAAM_ERA              SHIFT_U32(0xFF, 24)
35 #define GET_CCBVID_CAAM_ERA(val)        (((val) & BM_CCBVID_CAAM_ERA) >> 24)
36 
37 /* CHA Version ID */
38 #define CHAVID_LS                       0x0FEC
39 #define BM_CHAVID_LS_RNGVID             SHIFT_U32(0xF, 16)
40 #define GET_CHAVID_LS_RNGVID(val)       (((val) & BM_CHAVID_LS_RNGVID) >> 16)
41 #define BM_CHAVID_LS_MDVID		SHIFT_U32(0xF, 12)
42 
43 #define CHAVID_LS_MDVID_LP256           SHIFT_U32(0, 12)
44 
45 /* CHA Number */
46 #define CHANUM_MS                       0x0FF0
47 #define BM_CHANUM_MS_JRNUM              SHIFT_U32(0xF, 28)
48 #define GET_CHANUM_MS_JRNUM(val)        (((val) & BM_CHANUM_MS_JRNUM) >> 28)
49 
50 #define CHANUM_LS                       0x0FF4
51 #define BM_CHANUM_LS_PKNUM              SHIFT_U32(0xF, 28)
52 #define GET_CHANUM_LS_PKNUM(val)	(((val) & BM_CHANUM_LS_PKNUM) >> 28)
53 #define BM_CHANUM_LS_MDNUM              SHIFT_U32(0xF, 12)
54 #define GET_CHANUM_LS_MDNUM(val)	(((val) & BM_CHANUM_LS_MDNUM) >> 12)
55 
56 /* PKHA Version for Era > 10 */
57 #define PKHA_VERSION			0x0E8C
58 #define BM_PKHA_VERSION_PKNUM		0xFF
59 #define GET_PKHA_VERSION_PKNUM(val)	((val) & BM_PKHA_VERSION_PKNUM)
60 
61 /* MDHA Version for Era > 10 */
62 #define MDHA_VERSION			0xE94
63 #define BM_MDHA_VERSION_MDNUM		0xFF
64 #define GET_MDHA_VERSION_MDNUM(val)	((val) & BM_MDHA_VERSION_MDNUM)
65 #define BM_MDHA_VERSION_MDVID		SHIFT_U32(0xFF, 24)
66 
67 #define MDHA_VERSION_MDVID_LP256	SHIFT_U32(0, 24)
68 
69 /* RNG Version for Era > 10 */
70 #define RNG_VERSION			0x0EF8
71 #define BM_RNG_VERSION_VID	        SHIFT_U32(0xFF, 24)
72 #define GET_RNG_VERSION_VID(val)	((val) & BM_RNG_VERSION_VID)
73 
74 /* JR Version for Era > 10 */
75 #define JR_VERSION			0x0EF8
76 #define BM_JR_VERSION_JRNUM		0xFF
77 #define GET_JR_VERSION_JRNUM(val)	((val) & BM_JR_VERSION_JRNUM)
78 
79 #endif /* __VERSION_REGS_H__ */
80 
81