xref: /illumos-gate/usr/src/lib/libnvme/common/libnvme_micron.c (revision 7655c6d53c36750b508636f48c73a2de57754e5a)
16a5dded7SRobert Mustacchi /*
26a5dded7SRobert Mustacchi  * This file and its contents are supplied under the terms of the
36a5dded7SRobert Mustacchi  * Common Development and Distribution License ("CDDL"), version 1.0.
46a5dded7SRobert Mustacchi  * You may only use this file in accordance with the terms of version
56a5dded7SRobert Mustacchi  * 1.0 of the CDDL.
66a5dded7SRobert Mustacchi  *
76a5dded7SRobert Mustacchi  * A full copy of the text of the CDDL should have accompanied this
86a5dded7SRobert Mustacchi  * source.  A copy of the CDDL is also available via the Internet at
96a5dded7SRobert Mustacchi  * http://www.illumos.org/license/CDDL.
106a5dded7SRobert Mustacchi  */
116a5dded7SRobert Mustacchi 
126a5dded7SRobert Mustacchi /*
136a5dded7SRobert Mustacchi  * Copyright 2024 Oxide Computer Company
146a5dded7SRobert Mustacchi  */
156a5dded7SRobert Mustacchi 
166a5dded7SRobert Mustacchi /*
176a5dded7SRobert Mustacchi  * libnvme logic specific to Micron device families. Currently this has support
18627ade2aSRobert Mustacchi  * for the Micron 7300, 7400, 7450, 6500, and 7500 device generations. Right now
19627ade2aSRobert Mustacchi  * we only have support for some of the device-specific log pages.
206a5dded7SRobert Mustacchi  */
216a5dded7SRobert Mustacchi 
226a5dded7SRobert Mustacchi #include <sys/sysmacros.h>
236a5dded7SRobert Mustacchi #include <sys/nvme/micron.h>
246a5dded7SRobert Mustacchi 
256a5dded7SRobert Mustacchi #include "libnvme_impl.h"
266a5dded7SRobert Mustacchi 
27*7655c6d5SRobert Mustacchi static const nvme_log_page_info_t micron_7300_log_smart = {
286a5dded7SRobert Mustacchi 	.nlpi_short = "micron/smart",
296a5dded7SRobert Mustacchi 	.nlpi_human = "Vendor Unique SMART",
306a5dded7SRobert Mustacchi 	.nlpi_lid = MICRON_7300_LOG_SMART,
316a5dded7SRobert Mustacchi 	.nlpi_csi = NVME_CSI_NVM,
326a5dded7SRobert Mustacchi 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
336a5dded7SRobert Mustacchi 	.nlpi_source = NVME_LOG_DISC_S_DB,
346a5dded7SRobert Mustacchi 	.nlpi_scope = NVME_LOG_SCOPE_CTRL,
356a5dded7SRobert Mustacchi 	.nlpi_len = sizeof (micron_vul_smart_t)
36*7655c6d5SRobert Mustacchi };
37*7655c6d5SRobert Mustacchi 
38*7655c6d5SRobert Mustacchi static const nvme_log_page_info_t micron_7300_log_extsmart = {
396a5dded7SRobert Mustacchi 	.nlpi_short = "micron/extsmart",
406a5dded7SRobert Mustacchi 	.nlpi_human = "Extended SMART",
416a5dded7SRobert Mustacchi 	.nlpi_lid = MICRON_7300_LOG_EXT_SMART,
426a5dded7SRobert Mustacchi 	.nlpi_csi = NVME_CSI_NVM,
436a5dded7SRobert Mustacchi 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
446a5dded7SRobert Mustacchi 	.nlpi_source = NVME_LOG_DISC_S_DB,
456a5dded7SRobert Mustacchi 	.nlpi_scope = NVME_LOG_SCOPE_CTRL,
466a5dded7SRobert Mustacchi 	.nlpi_len = sizeof (micron_vul_ext_smart_t)
47*7655c6d5SRobert Mustacchi };
486a5dded7SRobert Mustacchi 
49*7655c6d5SRobert Mustacchi static const nvme_log_page_info_t *micron_7300_log_pages[] = {
50*7655c6d5SRobert Mustacchi 	&micron_7300_log_smart, &micron_7300_log_extsmart
51*7655c6d5SRobert Mustacchi };
52*7655c6d5SRobert Mustacchi 
53*7655c6d5SRobert Mustacchi static const nvme_log_page_info_t micron_74x0_log_extsmart = {
546a5dded7SRobert Mustacchi 	.nlpi_short = "micron/extsmart",
556a5dded7SRobert Mustacchi 	.nlpi_human = "Extended SMART",
566a5dded7SRobert Mustacchi 	.nlpi_lid = MICRON_74x0_LOG_EXT_SMART,
576a5dded7SRobert Mustacchi 	.nlpi_csi = NVME_CSI_NVM,
586a5dded7SRobert Mustacchi 	.nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC,
596a5dded7SRobert Mustacchi 	.nlpi_source = NVME_LOG_DISC_S_DB,
606a5dded7SRobert Mustacchi 	.nlpi_scope = NVME_LOG_SCOPE_CTRL,
616a5dded7SRobert Mustacchi 	.nlpi_len = sizeof (micron_vul_ext_smart_t)
62*7655c6d5SRobert Mustacchi };
636a5dded7SRobert Mustacchi 
64*7655c6d5SRobert Mustacchi static const nvme_log_page_info_t *micron_74x0_log_pages[] = {
65*7655c6d5SRobert Mustacchi 	&micron_74x0_log_extsmart
66*7655c6d5SRobert Mustacchi };
67627ade2aSRobert Mustacchi 
68*7655c6d5SRobert Mustacchi static const nvme_log_page_info_t *micron_x500_log_pages[] = {
69*7655c6d5SRobert Mustacchi 	&ocp_log_smart, &ocp_log_errrec, &ocp_log_fwact, &ocp_log_lat,
70*7655c6d5SRobert Mustacchi 	&ocp_log_devcap, &ocp_log_unsup
71*7655c6d5SRobert Mustacchi };
72*7655c6d5SRobert Mustacchi 
73*7655c6d5SRobert Mustacchi static const nvme_vsd_ident_t micron_7300_idents[] = {
74*7655c6d5SRobert Mustacchi 	{
75*7655c6d5SRobert Mustacchi 		.nvdi_vid = MICRON_PCI_VID,
76*7655c6d5SRobert Mustacchi 		.nvdi_did = MICRON_7300_PRO_DID,
77*7655c6d5SRobert Mustacchi 		.nvdi_human = "Micron 7300 Pro",
78*7655c6d5SRobert Mustacchi 	}, {
79*7655c6d5SRobert Mustacchi 		.nvdi_vid = MICRON_PCI_VID,
80*7655c6d5SRobert Mustacchi 		.nvdi_did = MICRON_7300_MAX_DID,
81*7655c6d5SRobert Mustacchi 		.nvdi_human = "Micron 7300 Max",
82*7655c6d5SRobert Mustacchi 	}
83*7655c6d5SRobert Mustacchi };
84*7655c6d5SRobert Mustacchi 
85*7655c6d5SRobert Mustacchi const nvme_vsd_t micron_7300 = {
86*7655c6d5SRobert Mustacchi 	.nvd_ident = micron_7300_idents,
87*7655c6d5SRobert Mustacchi 	.nvd_nident = ARRAY_SIZE(micron_7300_idents),
886a5dded7SRobert Mustacchi 	.nvd_logs = micron_7300_log_pages,
896a5dded7SRobert Mustacchi 	.nvd_nlogs = ARRAY_SIZE(micron_7300_log_pages)
906a5dded7SRobert Mustacchi };
916a5dded7SRobert Mustacchi 
92*7655c6d5SRobert Mustacchi static const nvme_vsd_ident_t micron_74x0_idents[] = {
93*7655c6d5SRobert Mustacchi 	{
94*7655c6d5SRobert Mustacchi 		.nvdi_vid = MICRON_PCI_VID,
95*7655c6d5SRobert Mustacchi 		.nvdi_did = MICRON_7400_PRO_DID,
96*7655c6d5SRobert Mustacchi 		.nvdi_human = "Micron 7400 Pro",
97*7655c6d5SRobert Mustacchi 	}, {
98*7655c6d5SRobert Mustacchi 		.nvdi_vid = MICRON_PCI_VID,
99*7655c6d5SRobert Mustacchi 		.nvdi_did = MICRON_7400_MAX_DID,
100*7655c6d5SRobert Mustacchi 		.nvdi_human = "Micron 7400 Max",
101*7655c6d5SRobert Mustacchi 	}, {
102*7655c6d5SRobert Mustacchi 		.nvdi_vid = MICRON_PCI_VID,
103*7655c6d5SRobert Mustacchi 		.nvdi_did = MICRON_7450_PRO_DID,
104*7655c6d5SRobert Mustacchi 		.nvdi_human = "Micron 7450 Pro",
105*7655c6d5SRobert Mustacchi 	}, {
106*7655c6d5SRobert Mustacchi 		.nvdi_vid = MICRON_PCI_VID,
107*7655c6d5SRobert Mustacchi 		.nvdi_did = MICRON_7450_MAX_DID,
108*7655c6d5SRobert Mustacchi 		.nvdi_human = "Micron 7450 Max",
109*7655c6d5SRobert Mustacchi 	}
1106a5dded7SRobert Mustacchi };
1116a5dded7SRobert Mustacchi 
112*7655c6d5SRobert Mustacchi const nvme_vsd_t micron_74x0 = {
113*7655c6d5SRobert Mustacchi 	.nvd_ident = micron_74x0_idents,
114*7655c6d5SRobert Mustacchi 	.nvd_nident = ARRAY_SIZE(micron_74x0_idents),
1156a5dded7SRobert Mustacchi 	.nvd_logs = micron_74x0_log_pages,
1166a5dded7SRobert Mustacchi 	.nvd_nlogs = ARRAY_SIZE(micron_74x0_log_pages)
1176a5dded7SRobert Mustacchi };
1186a5dded7SRobert Mustacchi 
119*7655c6d5SRobert Mustacchi static const nvme_vsd_ident_t micron_x500_idents[] = {
120*7655c6d5SRobert Mustacchi 	{
121*7655c6d5SRobert Mustacchi 		.nvdi_vid = MICRON_PCI_VID,
122*7655c6d5SRobert Mustacchi 		.nvdi_did = MICRON_6500_ION_DID,
123*7655c6d5SRobert Mustacchi 		.nvdi_human = "Micron 6500 ION"
124*7655c6d5SRobert Mustacchi 	}, {
125*7655c6d5SRobert Mustacchi 		.nvdi_vid = MICRON_PCI_VID,
126*7655c6d5SRobert Mustacchi 		.nvdi_did = MICRON_7500_PRO_DID,
127*7655c6d5SRobert Mustacchi 		.nvdi_human = "Micron 7500 Pro"
128*7655c6d5SRobert Mustacchi 	}, {
129*7655c6d5SRobert Mustacchi 		.nvdi_vid = MICRON_PCI_VID,
130*7655c6d5SRobert Mustacchi 		.nvdi_did = MICRON_7500_MAX_DID,
131*7655c6d5SRobert Mustacchi 		.nvdi_human = "Micron 7500 Max"
132*7655c6d5SRobert Mustacchi 	}
1336a5dded7SRobert Mustacchi };
1346a5dded7SRobert Mustacchi 
135*7655c6d5SRobert Mustacchi const nvme_vsd_t micron_x500 = {
136*7655c6d5SRobert Mustacchi 	.nvd_ident = micron_x500_idents,
137*7655c6d5SRobert Mustacchi 	.nvd_nident = ARRAY_SIZE(micron_x500_idents),
138627ade2aSRobert Mustacchi 	.nvd_logs = micron_x500_log_pages,
139627ade2aSRobert Mustacchi 	.nvd_nlogs = ARRAY_SIZE(micron_x500_log_pages)
140627ade2aSRobert Mustacchi };
141