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 2025 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, and 9550 device generations. 19 * Right now 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_smart = { 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 38 static const nvme_log_page_info_t micron_7300_log_extsmart = { 39 .nlpi_short = "micron/extsmart", 40 .nlpi_human = "Extended SMART", 41 .nlpi_lid = MICRON_7300_LOG_EXT_SMART, 42 .nlpi_csi = NVME_CSI_NVM, 43 .nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC, 44 .nlpi_source = NVME_LOG_DISC_S_DB, 45 .nlpi_scope = NVME_LOG_SCOPE_CTRL, 46 .nlpi_len = sizeof (micron_vul_ext_smart_t) 47 }; 48 49 static const nvme_log_page_info_t *micron_7300_log_pages[] = { 50 µn_7300_log_smart, µn_7300_log_extsmart 51 }; 52 53 static const nvme_log_page_info_t micron_74x0_log_extsmart = { 54 .nlpi_short = "micron/extsmart", 55 .nlpi_human = "Extended SMART", 56 .nlpi_lid = MICRON_74x0_LOG_EXT_SMART, 57 .nlpi_csi = NVME_CSI_NVM, 58 .nlpi_kind = NVME_LOG_ID_VENDOR_SPECIFIC, 59 .nlpi_source = NVME_LOG_DISC_S_DB, 60 .nlpi_scope = NVME_LOG_SCOPE_CTRL, 61 .nlpi_len = sizeof (micron_vul_ext_smart_t) 62 }; 63 64 static const nvme_log_page_info_t *micron_74x0_log_pages[] = { 65 µn_74x0_log_extsmart 66 }; 67 68 static const nvme_log_page_info_t *micron_x500_log_pages[] = { 69 &ocp_log_smart, &ocp_log_errrec, &ocp_log_fwact, &ocp_log_lat, 70 &ocp_log_devcap, &ocp_log_unsup 71 }; 72 73 static const nvme_log_page_info_t *micron_9550_log_pages[] = { 74 &ocp_log_smart, &ocp_log_errrec, &ocp_log_fwact, &ocp_log_lat, 75 &ocp_log_devcap, &ocp_log_unsup, &ocp_log_telstr 76 }; 77 78 static const nvme_vsd_ident_t micron_7300_idents[] = { 79 { 80 .nvdi_vid = MICRON_PCI_VID, 81 .nvdi_did = MICRON_7300_PRO_DID, 82 .nvdi_human = "Micron 7300 Pro", 83 }, { 84 .nvdi_vid = MICRON_PCI_VID, 85 .nvdi_did = MICRON_7300_MAX_DID, 86 .nvdi_human = "Micron 7300 Max", 87 } 88 }; 89 90 const nvme_vsd_t micron_7300 = { 91 .nvd_ident = micron_7300_idents, 92 .nvd_nident = ARRAY_SIZE(micron_7300_idents), 93 .nvd_logs = micron_7300_log_pages, 94 .nvd_nlogs = ARRAY_SIZE(micron_7300_log_pages) 95 }; 96 97 static const nvme_vsd_ident_t micron_74x0_idents[] = { 98 { 99 .nvdi_vid = MICRON_PCI_VID, 100 .nvdi_did = MICRON_7400_PRO_DID, 101 .nvdi_human = "Micron 7400 Pro", 102 }, { 103 .nvdi_vid = MICRON_PCI_VID, 104 .nvdi_did = MICRON_7400_MAX_DID, 105 .nvdi_human = "Micron 7400 Max", 106 }, { 107 .nvdi_vid = MICRON_PCI_VID, 108 .nvdi_did = MICRON_7450_PRO_DID, 109 .nvdi_human = "Micron 7450 Pro", 110 }, { 111 .nvdi_vid = MICRON_PCI_VID, 112 .nvdi_did = MICRON_7450_MAX_DID, 113 .nvdi_human = "Micron 7450 Max", 114 } 115 }; 116 117 const nvme_vsd_t micron_74x0 = { 118 .nvd_ident = micron_74x0_idents, 119 .nvd_nident = ARRAY_SIZE(micron_74x0_idents), 120 .nvd_logs = micron_74x0_log_pages, 121 .nvd_nlogs = ARRAY_SIZE(micron_74x0_log_pages) 122 }; 123 124 static const nvme_vsd_ident_t micron_x500_idents[] = { 125 { 126 .nvdi_vid = MICRON_PCI_VID, 127 .nvdi_did = MICRON_6500_ION_DID, 128 .nvdi_human = "Micron 6500 ION" 129 }, { 130 .nvdi_vid = MICRON_PCI_VID, 131 .nvdi_did = MICRON_7500_PRO_DID, 132 .nvdi_human = "Micron 7500 Pro" 133 }, { 134 .nvdi_vid = MICRON_PCI_VID, 135 .nvdi_did = MICRON_7500_MAX_DID, 136 .nvdi_human = "Micron 7500 Max" 137 } 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 }; 146 147 static const nvme_vsd_ident_t micron_9550_idents[] = { 148 { 149 .nvdi_vid = MICRON_PCI_VID, 150 .nvdi_did = MICRON_9550_PRO_DID, 151 .nvdi_human = "Micron 9550 Pro", 152 }, { 153 .nvdi_vid = MICRON_PCI_VID, 154 .nvdi_did = MICRON_9550_MAX_DID, 155 .nvdi_human = "Micron 9550 Max", 156 } 157 }; 158 159 const nvme_vsd_t micron_9550 = { 160 .nvd_ident = micron_9550_idents, 161 .nvd_nident = ARRAY_SIZE(micron_9550_idents), 162 .nvd_logs = micron_9550_log_pages, 163 .nvd_nlogs = ARRAY_SIZE(micron_9550_log_pages) 164 }; 165