xref: /illumos-gate/usr/src/test/util-tests/tests/libjedec/hex2spd/libjedec_hex2spd_lp4.c (revision 8119dad84d6416f13557b0ba8e2aaf9064cbcfd3)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2024 Oxide Computer Company
14  */
15 
16 /*
17  * LPDDR4/X SPD tests
18  */
19 
20 #include <libjedec.h>
21 #include "libjedec_hex2spd.h"
22 
23 const hex2spd_test_t micron_lp4 = {
24 	.ht_file = "lpddr4/MT53D1024M32D4",
25 	.ht_checks = { {
26 		.hs_key = SPD_KEY_DRAM_TYPE,
27 		.hs_type = DATA_TYPE_UINT32,
28 		.hs_val = { .hs_u32 = SPD_DT_LPDDR4_SDRAM }
29 	}, {
30 		.hs_key = SPD_KEY_MOD_TYPE,
31 		.hs_type = DATA_TYPE_UINT32,
32 		.hs_val = { .hs_u32 = SPD_MOD_TYPE_SOLDER }
33 	}, {
34 		.hs_key = SPD_KEY_NBYTES_TOTAL,
35 		.hs_type = DATA_TYPE_UINT32,
36 		.hs_val = { .hs_u32 = 512 }
37 	}, {
38 		.hs_key = SPD_KEY_NBYTES_USED,
39 		.hs_type = DATA_TYPE_UINT32,
40 		.hs_val = { .hs_u32 = 384 }
41 	}, {
42 		.hs_key = SPD_KEY_REV_ENC,
43 		.hs_type = DATA_TYPE_UINT32,
44 		.hs_val = { .hs_u32 = 1 }
45 	}, {
46 		.hs_key = SPD_KEY_REV_ADD,
47 		.hs_type = DATA_TYPE_UINT32,
48 		.hs_val = { .hs_u32 = 1 }
49 	}, {
50 		.hs_key = SPD_KEY_MOD_HYBRID_TYPE,
51 		.hs_type = DATA_TYPE_UINT32,
52 		.hs_val = { .hs_u32 = SPD_MOD_NOT_HYBRID }
53 	}, {
54 		.hs_key = SPD_KEY_NROW_BITS,
55 		.hs_type = DATA_TYPE_UINT32,
56 		.hs_val = { .hs_u32 = 16 }
57 	}, {
58 		.hs_key = SPD_KEY_NCOL_BITS,
59 		.hs_type = DATA_TYPE_UINT32,
60 		.hs_val = { .hs_u32 = 10 }
61 	}, {
62 		.hs_key = SPD_KEY_NBGRP_BITS,
63 		.hs_type = DATA_TYPE_UINT32,
64 		.hs_val = { .hs_u32 = 0 }
65 	}, {
66 		.hs_key = SPD_KEY_NBANK_BITS,
67 		.hs_type = DATA_TYPE_UINT32,
68 		.hs_val = { .hs_u32 = 3 }
69 	}, {
70 		.hs_key = SPD_KEY_DIE_SIZE,
71 		.hs_type = DATA_TYPE_UINT64,
72 		.hs_val = { .hs_u64 = 32ULL * 1024ULL * 1024ULL * 1024ULL }
73 	}, {
74 		.hs_key = SPD_KEY_PKG_NDIE,
75 		.hs_type = DATA_TYPE_UINT32,
76 		.hs_val = { .hs_u32 = 4 }
77 	}, {
78 		.hs_key = SPD_KEY_RANK_ASYM,
79 		.hs_type = DATA_TYPE_BOOLEAN,
80 		.hs_val = { .hs_bool = false }
81 	}, {
82 		.hs_key = SPD_KEY_NRANKS,
83 		.hs_type = DATA_TYPE_UINT32,
84 		.hs_val = { .hs_u32 = 2 }
85 	}, {
86 		.hs_key = SPD_KEY_DRAM_WIDTH,
87 		.hs_type = DATA_TYPE_UINT32,
88 		.hs_val = { .hs_u32 = 16 }
89 	}, {
90 		.hs_key = SPD_KEY_DRAM_NCHAN,
91 		.hs_type = DATA_TYPE_UINT32,
92 		.hs_val = { .hs_u32 = 2 }
93 	}, {
94 		.hs_key = SPD_KEY_NSUBCHAN,
95 		.hs_type = DATA_TYPE_UINT32,
96 		.hs_val = { .hs_u32 = 1 }
97 	}, {
98 		.hs_key = SPD_KEY_DATA_WIDTH,
99 		.hs_type = DATA_TYPE_UINT32,
100 		.hs_val = { .hs_u32 = 16 }
101 	}, {
102 		.hs_key = SPD_KEY_ECC_WIDTH,
103 		.hs_type = DATA_TYPE_UINT32,
104 		.hs_val = { .hs_u32 = 0 }
105 	}, {
106 		.hs_key = SPD_KEY_MAW,
107 		.hs_type = DATA_TYPE_UINT32,
108 		.hs_val = { .hs_u32 = 4096 }
109 	}, {
110 		.hs_key = SPD_KEY_MAC,
111 		.hs_type = DATA_TYPE_UINT32,
112 		.hs_val = { .hs_u32 = SPD_KEY_MAC_UNLIMITED }
113 	}, {
114 		.hs_key = SPD_KEY_TCKAVG_MIN,
115 		.hs_type = DATA_TYPE_UINT64,
116 		.hs_val = { .hs_u64 = 468 }
117 	}, {
118 		.hs_key = SPD_KEY_TCKAVG_MAX,
119 		.hs_type = DATA_TYPE_UINT64,
120 		.hs_val = { .hs_u64 = 1500 }
121 	}, {
122 		.hs_key = SPD_KEY_CAS,
123 		.hs_type = DATA_TYPE_UINT32_ARRAY,
124 		.hs_val = { .hs_u32a = { .ha_nval = 1, .ha_vals = { 44 } } }
125 	}, {
126 		.hs_key = SPD_KEY_TAA_MIN,
127 		.hs_type = DATA_TYPE_UINT64,
128 		.hs_val = { .hs_u64 = 4375 }
129 	}, {
130 		.hs_key = SPD_KEY_LP_RWLAT,
131 		.hs_type = DATA_TYPE_UINT32,
132 		.hs_val = { .hs_u32 = SPD_LP_RWLAT_WRITE_A }
133 	}, {
134 		.hs_key = SPD_KEY_TRCD_MIN,
135 		.hs_type = DATA_TYPE_UINT64,
136 		.hs_val = { .hs_u64 = 18000 }
137 	}, {
138 		.hs_key = SPD_KEY_TRPAB_MIN,
139 		.hs_type = DATA_TYPE_UINT64,
140 		.hs_val = { .hs_u64 = 21000 }
141 	}, {
142 		.hs_key = SPD_KEY_TRPPB_MIN,
143 		.hs_type = DATA_TYPE_UINT64,
144 		.hs_val = { .hs_u64 = 18000 }
145 	}, {
146 		.hs_key = SPD_KEY_TRFCAB_MIN,
147 		.hs_type = DATA_TYPE_UINT64,
148 		.hs_val = { .hs_u64 = 380000 }
149 	}, {
150 		.hs_key = SPD_KEY_TRFCPB_MIN,
151 		.hs_type = DATA_TYPE_UINT64,
152 		.hs_val = { .hs_u64 = 190000 }
153 	}, {
154 		.hs_key = SPD_KEY_DDR4_MAP_DQ0,
155 		.hs_type = DATA_TYPE_UINT32_ARRAY,
156 		.hs_val = { .hs_u32a = { .ha_nval = 4,
157 		    .ha_vals = { 0, 1, 2, 3 } } },
158 	}, {
159 		.hs_key = SPD_KEY_DDR4_MAP_DQ4,
160 		.hs_type = DATA_TYPE_UINT32_ARRAY,
161 		.hs_val = { .hs_u32a = { .ha_nval = 4,
162 		    .ha_vals = { 4, 5, 6, 7 } } },
163 	}, {
164 		.hs_key = SPD_KEY_DDR4_MAP_DQ16,
165 		.hs_type = DATA_TYPE_UINT32_ARRAY,
166 		.hs_val = { .hs_u32a = { .ha_nval = 4,
167 		    .ha_vals = { 0, 1, 3, 2 } } },
168 	}, {
169 		.hs_key = SPD_KEY_MFG_MOD_MFG_NAME,
170 		.hs_type = DATA_TYPE_STRING,
171 		.hs_val = { .hs_str = "Micron Technology" }
172 	}, {
173 		.hs_key = SPD_KEY_MFG_DRAM_MFG_NAME,
174 		.hs_type = DATA_TYPE_STRING,
175 		.hs_val = { .hs_str = "Micron Technology" }
176 	}, {
177 		.hs_key = SPD_KEY_MFG_MOD_YEAR,
178 		.hs_type = DATA_TYPE_STRING,
179 		.hs_val = { .hs_str = "AA" }
180 	}, {
181 		.hs_key = SPD_KEY_MFG_MOD_WEEK,
182 		.hs_type = DATA_TYPE_STRING,
183 		.hs_val = { .hs_str = "BB" }
184 	}, {
185 		.hs_key = SPD_KEY_MFG_MOD_SN,
186 		.hs_type = DATA_TYPE_STRING,
187 		.hs_val = { .hs_str = "10010220" }
188 	}, {
189 		.hs_key = SPD_KEY_MFG_MOD_PN,
190 		.hs_type = DATA_TYPE_STRING,
191 		.hs_val = { .hs_str = "MT53D1024M32D4" },
192 	}, {
193 		.hs_key = SPD_KEY_MFG_MOD_REV,
194 		.hs_type = DATA_TYPE_STRING,
195 		.hs_val = { .hs_str = "2B" }
196 	}, {
197 		.hs_key = SPD_KEY_MFG_DRAM_STEP,
198 		.hs_type = DATA_TYPE_STRING,
199 		.hs_val = { .hs_str = "B2" }
200 	}, {
201 		.hs_key = NULL,
202 	} }
203 };
204