xref: /illumos-gate/usr/src/test/util-tests/tests/libjedec/hex2spd/libjedec_hex2spd_lp3.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  * LPDDR3 SPD tests
18  */
19 
20 #include <libjedec.h>
21 #include "libjedec_hex2spd.h"
22 
23 const hex2spd_test_t nanya_lp3 = {
24 	.ht_file = "lpddr3/NT6CL256T32CQ",
25 	.ht_checks = { {
26 		.hs_key = SPD_KEY_DRAM_TYPE,
27 		.hs_type = DATA_TYPE_UINT32,
28 		.hs_val = { .hs_u32 = SPD_DT_LPDDR3_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 = 14 }
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 = 8ULL * 1024ULL * 1024ULL * 1024ULL }
73 	}, {
74 		.hs_key = SPD_KEY_PKG_NDIE,
75 		.hs_type = DATA_TYPE_UINT32,
76 		.hs_val = { .hs_u32 = 2 }
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 = 32 }
89 	}, {
90 		.hs_key = SPD_KEY_DRAM_NCHAN,
91 		.hs_type = DATA_TYPE_UINT32,
92 		.hs_val = { .hs_u32 = 1 }
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 = 32 }
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 = 2048 }
109 	}, {
110 		.hs_key = SPD_KEY_MAC,
111 		.hs_type = DATA_TYPE_UINT32,
112 		.hs_val = { .hs_u32 = 200000 }
113 	}, {
114 		.hs_key = SPD_KEY_TCKAVG_MIN,
115 		.hs_type = DATA_TYPE_UINT64,
116 		.hs_val = { .hs_u64 = 1071 }
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 = 12, .ha_vals = { 3, 6, 8, 9,
125 		    10, 12, 14, 20, 22, 24, 26, 32 } } }
126 	}, {
127 		.hs_key = SPD_KEY_TAA_MIN,
128 		.hs_type = DATA_TYPE_UINT64,
129 		.hs_val = { .hs_u64 = 12850 }
130 	}, {
131 		.hs_key = SPD_KEY_LP_RWLAT,
132 		.hs_type = DATA_TYPE_UINT32,
133 		.hs_val = { .hs_u32 = SPD_LP_RWLAT_WRITE_B |
134 		    SPD_LP_RWLAT_DBIRD_EN }
135 	}, {
136 		.hs_key = SPD_KEY_TRCD_MIN,
137 		.hs_type = DATA_TYPE_UINT64,
138 		.hs_val = { .hs_u64 = 18000 }
139 	}, {
140 		.hs_key = SPD_KEY_TRPAB_MIN,
141 		.hs_type = DATA_TYPE_UINT64,
142 		.hs_val = { .hs_u64 = 21000 }
143 	}, {
144 		.hs_key = SPD_KEY_TRPPB_MIN,
145 		.hs_type = DATA_TYPE_UINT64,
146 		.hs_val = { .hs_u64 = 18000 }
147 	}, {
148 		.hs_key = SPD_KEY_TRFCAB_MIN,
149 		.hs_type = DATA_TYPE_UINT64,
150 		.hs_val = { .hs_u64 = 130000 }
151 	}, {
152 		.hs_key = SPD_KEY_TRFCPB_MIN,
153 		.hs_type = DATA_TYPE_UINT64,
154 		.hs_val = { .hs_u64 = 60000 }
155 	}, {
156 		.hs_key = SPD_KEY_DDR4_MAP_DQ8,
157 		.hs_type = DATA_TYPE_UINT32_ARRAY,
158 		.hs_val = { .hs_u32a = { .ha_nval = 4,
159 		    .ha_vals = { 3, 2, 0, 1 } } },
160 	}, {
161 		.hs_key = SPD_KEY_DDR4_MAP_DQ12,
162 		.hs_type = DATA_TYPE_UINT32_ARRAY,
163 		.hs_val = { .hs_u32a = { .ha_nval = 4,
164 		    .ha_vals = { 7, 6, 4, 5 } } },
165 	}, {
166 		.hs_key = SPD_KEY_DDR4_MAP_DQ24,
167 		.hs_type = DATA_TYPE_UINT32_ARRAY,
168 		.hs_val = { .hs_u32a = { .ha_nval = 4,
169 		    .ha_vals = { 3, 1, 0, 2 } } },
170 	}, {
171 		.hs_key = SPD_KEY_DDR4_MAP_DQ28,
172 		.hs_type = DATA_TYPE_UINT32_ARRAY,
173 		.hs_val = { .hs_u32a = { .ha_nval = 4,
174 		    .ha_vals = { 7, 5, 4, 6 } } },
175 	}, {
176 		.hs_key = SPD_KEY_MFG_MOD_MFG_NAME,
177 		.hs_type = DATA_TYPE_STRING,
178 		.hs_val = { .hs_str = "Nanya Technology" }
179 	}, {
180 		.hs_key = SPD_KEY_MFG_DRAM_MFG_NAME,
181 		.hs_type = DATA_TYPE_STRING,
182 		.hs_val = { .hs_str = "Nanya Technology" }
183 	}, {
184 		.hs_key = SPD_KEY_MFG_MOD_LOC_ID,
185 		.hs_type = DATA_TYPE_UINT32,
186 		.hs_val = { .hs_u32 = 0x33 }
187 	}, {
188 		.hs_key = SPD_KEY_MFG_MOD_YEAR,
189 		.hs_type = DATA_TYPE_STRING,
190 		.hs_val = { .hs_str = "95" }
191 	}, {
192 		.hs_key = SPD_KEY_MFG_MOD_WEEK,
193 		.hs_type = DATA_TYPE_STRING,
194 		.hs_val = { .hs_str = "03" }
195 	}, {
196 		.hs_key = SPD_KEY_MFG_MOD_SN,
197 		.hs_type = DATA_TYPE_STRING,
198 		.hs_val = { .hs_str = "FEDCBA98" }
199 	}, {
200 		.hs_key = SPD_KEY_MFG_MOD_PN,
201 		.hs_type = DATA_TYPE_STRING,
202 		.hs_val = { .hs_str = "NT6CL256T32CQ-H1" },
203 	}, {
204 		.hs_key = SPD_KEY_MFG_MOD_REV,
205 		.hs_type = DATA_TYPE_STRING,
206 		.hs_val = { .hs_str = "C0" }
207 	}, {
208 		.hs_key = SPD_KEY_MFG_DRAM_STEP,
209 		.hs_type = DATA_TYPE_STRING,
210 		.hs_val = { .hs_str = "C3" }
211 	}, {
212 		.hs_key = NULL,
213 	} }
214 };
215