xref: /illumos-gate/usr/src/lib/libnvme/common/libnvme_micron.c (revision cdd3e9a818787b4def17c9f707f435885ce0ed31)
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  * libnvme logic specific to Micron device families. Currently this has support
18  * for the Micron 7300, 7400, 7450, 6500, and 7500 device generations. Right now
19  * we only have support for some of the device-specific log pages.
20  */
21 
22 #include <sys/sysmacros.h>
23 #include <sys/nvme/micron.h>
24 
25 #include "libnvme_impl.h"
26 
27 static const nvme_log_page_info_t micron_7300_log_pages[] = { {
28 	.nlpi_short = "micron/smart",
29 	.nlpi_human = "Vendor Unique SMART",
30 	.nlpi_lid = MICRON_7300_LOG_SMART,
31 	.nlpi_csi = NVME_CSI_NVM,
32 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
33 	.nlpi_source = NVME_LOG_DISC_S_DB,
34 	.nlpi_scope = NVME_LOG_SCOPE_CTRL,
35 	.nlpi_len = sizeof (micron_vul_smart_t)
36 }, {
37 	.nlpi_short = "micron/extsmart",
38 	.nlpi_human = "Extended SMART",
39 	.nlpi_lid = MICRON_7300_LOG_EXT_SMART,
40 	.nlpi_csi = NVME_CSI_NVM,
41 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
42 	.nlpi_source = NVME_LOG_DISC_S_DB,
43 	.nlpi_scope = NVME_LOG_SCOPE_CTRL,
44 	.nlpi_len = sizeof (micron_vul_ext_smart_t)
45 } };
46 
47 static const nvme_log_page_info_t micron_74x0_log_pages[] = { {
48 	.nlpi_short = "micron/extsmart",
49 	.nlpi_human = "Extended SMART",
50 	.nlpi_lid = MICRON_74x0_LOG_EXT_SMART,
51 	.nlpi_csi = NVME_CSI_NVM,
52 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
53 	.nlpi_source = NVME_LOG_DISC_S_DB,
54 	.nlpi_scope = NVME_LOG_SCOPE_CTRL,
55 	.nlpi_len = sizeof (micron_vul_ext_smart_t)
56 } };
57 
58 static const nvme_log_page_info_t micron_x500_log_pages[] = { {
59 	.nlpi_short = "ocp/smart",
60 	.nlpi_human = "OCP SMART / Health Information",
61 	.nlpi_lid = OCP_LOG_DSSD_SMART,
62 	.nlpi_csi = NVME_CSI_NVM,
63 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
64 	.nlpi_source = NVME_LOG_DISC_S_DB,
65 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
66 	.nlpi_len = sizeof (ocp_vul_smart_t),
67 }, {
68 	.nlpi_short = "ocp/errrec",
69 	.nlpi_human = "OCP Error Recovery",
70 	.nlpi_lid = OCP_LOG_DSSD_ERROR_REC,
71 	.nlpi_csi = NVME_CSI_NVM,
72 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
73 	.nlpi_source = NVME_LOG_DISC_S_DB,
74 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
75 	.nlpi_len = sizeof (ocp_vul_errrec_t),
76 }, {
77 	.nlpi_short = "ocp/fwact",
78 	.nlpi_human = "OCP Firmware Activation",
79 	.nlpi_lid = OCP_LOG_DSSD_FWACT,
80 	.nlpi_csi = NVME_CSI_NVM,
81 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
82 	.nlpi_source = NVME_LOG_DISC_S_DB,
83 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
84 	.nlpi_len = sizeof (ocp_vul_fwact_t),
85 }, {
86 	.nlpi_short = "ocp/latency",
87 	.nlpi_human = "OCP Latency Monitor",
88 	.nlpi_lid = OCP_LOG_DSSD_LATENCY,
89 	.nlpi_csi = NVME_CSI_NVM,
90 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
91 	.nlpi_source = NVME_LOG_DISC_S_DB,
92 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
93 	.nlpi_len = sizeof (ocp_vul_lat_t),
94 }, {
95 	.nlpi_short = "ocp/devcap",
96 	.nlpi_human = "OCP Device Capabilities",
97 	.nlpi_lid = OCP_LOG_DSSD_DEV_CAP,
98 	.nlpi_csi = NVME_CSI_NVM,
99 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
100 	.nlpi_source = NVME_LOG_DISC_S_DB,
101 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
102 	.nlpi_len = sizeof (ocp_vul_devcap_t),
103 }, {
104 	.nlpi_short = "ocp/unsup",
105 	.nlpi_human = "OCP Unsupported Requirements",
106 	.nlpi_lid = OCP_LOG_DSSD_UNSUP_REQ,
107 	.nlpi_csi = NVME_CSI_NVM,
108 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
109 	.nlpi_source = NVME_LOG_DISC_S_DB,
110 	.nlpi_scope = NVME_LOG_SCOPE_NVM,
111 	.nlpi_len = sizeof (ocp_vul_unsup_req_t),
112 } };
113 
114 const nvme_vsd_t micron_7300_pro = {
115 	.nvd_vid = MICRON_PCI_VID,
116 	.nvd_did = MICRON_7300_PRO_DID,
117 	.nvd_human = "Micron 7300 Pro",
118 	.nvd_logs = micron_7300_log_pages,
119 	.nvd_nlogs = ARRAY_SIZE(micron_7300_log_pages)
120 };
121 
122 const nvme_vsd_t micron_7300_max = {
123 	.nvd_vid = MICRON_PCI_VID,
124 	.nvd_did = MICRON_7300_MAX_DID,
125 	.nvd_human = "Micron 7300 Max",
126 	.nvd_logs = micron_7300_log_pages,
127 	.nvd_nlogs = ARRAY_SIZE(micron_7300_log_pages)
128 };
129 
130 const nvme_vsd_t micron_7400_pro = {
131 	.nvd_vid = MICRON_PCI_VID,
132 	.nvd_did = MICRON_7400_PRO_DID,
133 	.nvd_human = "Micron 7400 Pro",
134 	.nvd_logs = micron_74x0_log_pages,
135 	.nvd_nlogs = ARRAY_SIZE(micron_74x0_log_pages)
136 };
137 
138 const nvme_vsd_t micron_7400_max = {
139 	.nvd_vid = MICRON_PCI_VID,
140 	.nvd_did = MICRON_7400_MAX_DID,
141 	.nvd_human = "Micron 7400 Max",
142 	.nvd_logs = micron_74x0_log_pages,
143 	.nvd_nlogs = ARRAY_SIZE(micron_74x0_log_pages)
144 };
145 
146 const nvme_vsd_t micron_7450_pro = {
147 	.nvd_vid = MICRON_PCI_VID,
148 	.nvd_did = MICRON_7450_PRO_DID,
149 	.nvd_human = "Micron 7450 Pro",
150 	.nvd_logs = micron_74x0_log_pages,
151 	.nvd_nlogs = ARRAY_SIZE(micron_74x0_log_pages)
152 };
153 
154 const nvme_vsd_t micron_7450_max = {
155 	.nvd_vid = MICRON_PCI_VID,
156 	.nvd_did = MICRON_7450_MAX_DID,
157 	.nvd_human = "Micron 7450 Max",
158 	.nvd_logs = micron_74x0_log_pages,
159 	.nvd_nlogs = ARRAY_SIZE(micron_74x0_log_pages)
160 };
161 
162 const nvme_vsd_t micron_6500_ion = {
163 	.nvd_vid = MICRON_PCI_VID,
164 	.nvd_did = MICRON_6500_ION_DID,
165 	.nvd_human = "Micron 6500 ION",
166 	.nvd_logs = micron_x500_log_pages,
167 	.nvd_nlogs = ARRAY_SIZE(micron_x500_log_pages)
168 };
169 
170 const nvme_vsd_t micron_7500_pro = {
171 	.nvd_vid = MICRON_PCI_VID,
172 	.nvd_did = MICRON_7500_PRO_DID,
173 	.nvd_human = "Micron 7500 Pro",
174 	.nvd_logs = micron_x500_log_pages,
175 	.nvd_nlogs = ARRAY_SIZE(micron_x500_log_pages)
176 };
177 
178 const nvme_vsd_t micron_7500_max = {
179 	.nvd_vid = MICRON_PCI_VID,
180 	.nvd_did = MICRON_7500_MAX_DID,
181 	.nvd_human = "Micron 7500 Max",
182 	.nvd_logs = micron_x500_log_pages,
183 	.nvd_nlogs = ARRAY_SIZE(micron_x500_log_pages)
184 };
185