xref: /illumos-gate/usr/src/lib/libnvme/common/libnvme_micron.c (revision e8d3efa1c56e5f2b5368600a2baeb7b1d54a07f8)
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 2026 Oxide Computer Company
14  */
15 
16 /*
17  * libnvme logic specific to Micron device families. Currently this has support
18  * for the Micron 7300, 7400, 7450, 6500, 7500, 9550, and 7600 device
19  * generations. This covers support for some of the device-specific log pages
20  * and features.
21  */
22 
23 #include <sys/sysmacros.h>
24 #include <sys/nvme/micron.h>
25 
26 #include "libnvme_impl.h"
27 
28 static const nvme_log_page_info_t micron_7300_log_smart = {
29 	.nlpi_short = "micron/smart",
30 	.nlpi_human = "Vendor Unique SMART",
31 	.nlpi_lid = MICRON_7300_LOG_SMART,
32 	.nlpi_csi = NVME_CSI_NVM,
33 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
34 	.nlpi_source = NVME_LOG_DISC_S_DB,
35 	.nlpi_scope = NVME_LOG_SCOPE_CTRL,
36 	.nlpi_len = sizeof (micron_vul_smart_t)
37 };
38 
39 static const nvme_log_page_info_t micron_7300_log_extsmart = {
40 	.nlpi_short = "micron/extsmart",
41 	.nlpi_human = "Extended SMART",
42 	.nlpi_lid = MICRON_7300_LOG_EXT_SMART,
43 	.nlpi_csi = NVME_CSI_NVM,
44 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
45 	.nlpi_source = NVME_LOG_DISC_S_DB,
46 	.nlpi_scope = NVME_LOG_SCOPE_CTRL,
47 	.nlpi_len = sizeof (micron_vul_ext_smart_t)
48 };
49 
50 static const nvme_log_page_info_t *micron_7300_log_pages[] = {
51 	&micron_7300_log_smart, &micron_7300_log_extsmart
52 };
53 
54 static const nvme_log_page_info_t micron_74x0_log_extsmart = {
55 	.nlpi_short = "micron/extsmart",
56 	.nlpi_human = "Extended SMART",
57 	.nlpi_lid = MICRON_74x0_LOG_EXT_SMART,
58 	.nlpi_csi = NVME_CSI_NVM,
59 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
60 	.nlpi_source = NVME_LOG_DISC_S_DB,
61 	.nlpi_scope = NVME_LOG_SCOPE_CTRL,
62 	.nlpi_len = sizeof (micron_vul_ext_smart_t)
63 };
64 
65 static const nvme_vsd_ident_t micron_7300_idents[] = {
66 	{
67 		.nvdi_vid = MICRON_PCI_VID,
68 		.nvdi_did = MICRON_7300_PRO_DID,
69 		.nvdi_human = "Micron 7300 Pro",
70 	}, {
71 		.nvdi_vid = MICRON_PCI_VID,
72 		.nvdi_did = MICRON_7300_MAX_DID,
73 		.nvdi_human = "Micron 7300 Max",
74 	}
75 };
76 
77 const nvme_vsd_t micron_7300 = {
78 	.nvd_ident = micron_7300_idents,
79 	.nvd_nident = ARRAY_SIZE(micron_7300_idents),
80 	.nvd_logs = micron_7300_log_pages,
81 	.nvd_nlogs = ARRAY_SIZE(micron_7300_log_pages)
82 };
83 
84 static const nvme_vsd_ident_t micron_74x0_idents[] = {
85 	{
86 		.nvdi_vid = MICRON_PCI_VID,
87 		.nvdi_did = MICRON_7400_PRO_DID,
88 		.nvdi_human = "Micron 7400 Pro",
89 	}, {
90 		.nvdi_vid = MICRON_PCI_VID,
91 		.nvdi_did = MICRON_7400_MAX_DID,
92 		.nvdi_human = "Micron 7400 Max",
93 	}, {
94 		.nvdi_vid = MICRON_PCI_VID,
95 		.nvdi_did = MICRON_7450_PRO_DID,
96 		.nvdi_human = "Micron 7450 Pro",
97 	}, {
98 		.nvdi_vid = MICRON_PCI_VID,
99 		.nvdi_did = MICRON_7450_MAX_DID,
100 		.nvdi_human = "Micron 7450 Max",
101 	}
102 };
103 
104 static const nvme_log_page_info_t *micron_74x0_log_pages[] = {
105 	&micron_74x0_log_extsmart
106 };
107 
108 const nvme_vsd_t micron_74x0 = {
109 	.nvd_ident = micron_74x0_idents,
110 	.nvd_nident = ARRAY_SIZE(micron_74x0_idents),
111 	.nvd_logs = micron_74x0_log_pages,
112 	.nvd_nlogs = ARRAY_SIZE(micron_74x0_log_pages)
113 };
114 
115 static const nvme_vsd_ident_t micron_x500_idents[] = {
116 	{
117 		.nvdi_vid = MICRON_PCI_VID,
118 		.nvdi_did = MICRON_6500_ION_DID,
119 		.nvdi_human = "Micron 6500 ION"
120 	}, {
121 		.nvdi_vid = MICRON_PCI_VID,
122 		.nvdi_did = MICRON_7500_PRO_DID,
123 		.nvdi_human = "Micron 7500 Pro"
124 	}, {
125 		.nvdi_vid = MICRON_PCI_VID,
126 		.nvdi_did = MICRON_7500_MAX_DID,
127 		.nvdi_human = "Micron 7500 Max"
128 	}
129 };
130 
131 static const nvme_log_page_info_t *micron_x500_log_pages[] = {
132 	&ocp_log_smart, &ocp_log_errrec, &ocp_log_fwact, &ocp_log_lat,
133 	&ocp_log_devcap, &ocp_log_unsup
134 };
135 
136 static const nvme_feat_info_t *micron_x500_feats[] = {
137 	&ocp_feat_plpfail, &ocp_feat_plphealth
138 };
139 
140 const nvme_vsd_t micron_x500 = {
141 	.nvd_ident = micron_x500_idents,
142 	.nvd_nident = ARRAY_SIZE(micron_x500_idents),
143 	.nvd_logs = micron_x500_log_pages,
144 	.nvd_nlogs = ARRAY_SIZE(micron_x500_log_pages),
145 	.nvd_feats = micron_x500_feats,
146 	.nvd_nfeats = ARRAY_SIZE(micron_x500_feats)
147 };
148 
149 static const nvme_vsd_ident_t micron_9550_idents[] = {
150 	{
151 		.nvdi_vid = MICRON_PCI_VID,
152 		.nvdi_did = MICRON_9550_PRO_DID,
153 		.nvdi_human = "Micron 9550 Pro",
154 	}, {
155 		.nvdi_vid = MICRON_PCI_VID,
156 		.nvdi_did = MICRON_9550_MAX_DID,
157 		.nvdi_human = "Micron 9550 Max",
158 	}
159 };
160 
161 static const nvme_log_page_info_t *micron_9550_log_pages[] = {
162 	&ocp_log_smart, &ocp_log_errrec, &ocp_log_fwact, &ocp_log_lat,
163 	&ocp_log_devcap, &ocp_log_unsup, &ocp_log_telstr
164 };
165 
166 static const nvme_feat_info_t *micron_9550_feats[] = {
167 	&ocp_feat_errinj, &ocp_feat_plpfail, &ocp_feat_plphealth
168 };
169 
170 const nvme_vsd_t micron_9550 = {
171 	.nvd_ident = micron_9550_idents,
172 	.nvd_nident = ARRAY_SIZE(micron_9550_idents),
173 	.nvd_logs = micron_9550_log_pages,
174 	.nvd_nlogs = ARRAY_SIZE(micron_9550_log_pages),
175 	.nvd_feats = micron_9550_feats,
176 	.nvd_nfeats = ARRAY_SIZE(micron_9550_feats)
177 };
178 
179 static const nvme_vsd_ident_t micron_7600_idents[] = {
180 	{
181 		.nvdi_vid = MICRON_PCI_VID,
182 		.nvdi_did = MICRON_7600_PRO_DID,
183 		.nvdi_human = "Micron 7600 Pro",
184 	}, {
185 		.nvdi_vid = MICRON_PCI_VID,
186 		.nvdi_did = MICRON_7600_MAX_DID,
187 		.nvdi_human = "Micron 7600 Max",
188 	}
189 };
190 
191 static const nvme_log_page_info_t *micron_7600_log_pages[] = {
192 	&ocp_log_smart, &ocp_log_errrec, &ocp_log_lat, &ocp_log_devcap,
193 	&ocp_log_hwcomp, &ocp_log_telstr
194 };
195 
196 static const nvme_feat_info_t *micron_7600_feats[] = {
197 	&ocp_feat_errinj, &ocp_feat_plpfail, &ocp_feat_plphealth
198 };
199 
200 const nvme_vsd_t micron_7600 = {
201 	.nvd_ident = micron_7600_idents,
202 	.nvd_nident = ARRAY_SIZE(micron_7600_idents),
203 	.nvd_logs = micron_7600_log_pages,
204 	.nvd_nlogs = ARRAY_SIZE(micron_7600_log_pages),
205 	.nvd_feats = micron_7600_feats,
206 	.nvd_nfeats = ARRAY_SIZE(micron_7600_feats)
207 };
208