summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Hoemann <jerry.hoemann@hpe.com>2023-02-03 10:14:50 +0100
committerJean Delvare <jdelvare@suse.de>2023-02-03 10:14:50 +0100
commit9d2bbd5db427b063da137d9016fe6628038334eb (patch)
tree0f0085586c4c970d35db08b56fdad3646f13a52f
parent3d6835047f80691678e5db3127f9d573956413f0 (diff)
downloaddmidecode-git-9d2bbd5db427b063da137d9016fe6628038334eb.tar.gz
dmioem: Decode HPE OEM Record 216
Decode HPE OEM Record 216: Version Indicator Record. Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com> Signed-off-by: Jean Delvare <jdelvare@suse.de>
-rw-r--r--dmioem.c200
1 files changed, 200 insertions, 0 deletions
diff --git a/dmioem.c b/dmioem.c
index b791118..65a809b 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -300,6 +300,161 @@ static void dmi_hp_203_devloc(const char *fname, unsigned int code)
pr_attr(fname, "%s", str);
}
+static void dmi_hp_216_fw_type(u16 code)
+{
+ const char *str = "Reserved";
+ static const char * const type[] = {
+ "Reserved", /* 0x00 */
+ "System ROM",
+ "Redundant System ROM",
+ "System ROM Bootblock",
+ "Power Management Controller Firmware",
+ "Power Management Controller Firmware Bootloader",
+ "SL Chassis Firmware",
+ "SL Chassis Firmware Bootloader",
+ "Hardware PAL/CPLD",
+ "SPS Firmware (ME Firmware)",
+ "SL Chassis PAL/CPLD",
+ "Compatibility Support Module (CSM)",
+ "APML",
+ "Smart Storage Battery (Megacell) Firmware",
+ "Trusted Module (TPM or TCM) Firmware Version",
+ "NVMe Backplane Firmware",
+ "Intelligent Provisioning",
+ "SPI Descriptor Version",
+ "Innovation Engine Firmware (IE Firmware)",
+ "UMB Backplane Firmware",
+ "Reserved", /* 0x14 */
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved", /* 0x1F */
+ "EL Chassis Abstraction Revision",
+ "EL Chassis Firmware Revision",
+ "EL Chassis PAL/CPLD",
+ "EL Cartride Abstraction Revision",
+ "Reserved", /* 0x24 */
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved", /* 0x2F */
+ "Embedded Video Controller",
+ "PCIe Riser Programmable Logic Device",
+ "PCIe cards that contain a CPLD",
+ "Intel NVMe VROC",
+ "Intel SATA VROC",
+ "Intel SPS Firmware",
+ "Secondary System Programmable Logic Device",
+ "CPU MEZZ Programmable Logic Device", /* 0x37 */
+ "Intel Artic Sound -M Accelerator Models Firmware",
+ "Ampere System Control Processor (SCP – PMPro+SMPro)",
+ "Intel CFR information", /* 0x3A */
+ };
+
+ if (code < ARRAY_SIZE(type))
+ str = type[code];
+
+ pr_attr("Firmware Type", "%s", str);
+}
+
+static void dmi_hp_216_version(u8 format, u8 *data)
+{
+ char buf[80];
+ const char * const reserved = "Reserved";
+ const char *vers = buf;
+ int gen;
+
+ gen = dmi_hpegen(dmi_product);
+
+ switch (format) {
+ case 0:
+ sprintf(buf, "No Version Data");
+ break;
+ case 1:
+ sprintf(buf, "%c.%d.%d", data[0] & (1 << 7) ? 'B' : 'R',
+ data[0] & 0x7, data[1] & 0x7);
+ break;
+ case 2:
+ sprintf(buf, "%d.%d", data[0] >> 4, data[0] & 0x0f);
+ break;
+ case 4:
+ sprintf(buf, "%d.%d.%d", data[0] >> 4, data[0] & 0x0f, data[1] & 0x7f);
+ break;
+ case 5:
+ if (gen == G9) {
+ sprintf(buf, "%d.%d.%d", data[0] >> 4, data[0] & 0x0f, data[1] & 0x7f);
+ } else if (gen == G10 || gen == G10P) {
+ sprintf(buf, "%d.%d.%d.%d", data[1] & 0x0f, data[3] & 0x0f,
+ data[5] & 0x0f, data[6] & 0x0f);
+ } else {
+ vers = reserved;
+ }
+ break;
+ case 6:
+ sprintf(buf, "%d.%d", data[1], data[0]);
+ break;
+ case 7:
+ sprintf(buf, "v%d.%.2d (%.2d/%.2d/%d)", data[0], data[1],
+ data[2], data[3], WORD(data + 4));
+ break;
+ case 8:
+ sprintf(buf, "%d.%d", WORD(data + 4), WORD(data));
+ break;
+ case 9:
+ sprintf(buf, "%d.%d.%d", data[0], data[1], WORD(data + 2));
+ break;
+ case 10:
+ sprintf(buf, "%d.%d.%d Build %d", data[0], data[1], data[2], data[3]);
+ break;
+ case 11:
+ sprintf(buf, "%d.%d %d", WORD(data + 2), WORD(data), DWORD(data + 4));
+ break;
+ case 12:
+ sprintf(buf, "%d.%d.%d.%d", WORD(data), WORD(data + 2),
+ WORD(data + 4), WORD(data + 6));
+ break;
+ case 13:
+ sprintf(buf, "%d", data[0]);
+ break;
+ case 14:
+ sprintf(buf, "%d.%d.%d.%d", data[0], data[1], data[2], data[3]);
+ break;
+ case 15:
+ sprintf(buf, "%d.%d.%d.%d (%.2d/%.2d/%d)",
+ WORD(data), WORD(data + 2), WORD(data + 4), WORD(data + 6),
+ data[8], data[9], WORD(data + 10));
+ break;
+ case 16:
+ sprintf(buf, "%c%c%c%c.%d%d",
+ data[0], data[1], data[2], data[3], data[4], data[5]);
+ break;
+ case 17:
+ sprintf(buf, "%08X", DWORD(data));
+ break;
+ case 18:
+ sprintf(buf, "%d.%2d", data[0], data[1]);
+ break;
+ case 3: /* fall through */
+ default:
+ vers = reserved;
+ }
+ pr_attr("Version Data", "%s", vers);
+}
+
static int dmi_hp_224_status(u8 code)
{
static const char * const present[] = {
@@ -743,6 +898,51 @@ static int dmi_decode_hp(const struct dmi_header *h)
}
break;
+ case 216:
+ /*
+ * Vendor Specific: Version Indicator Record
+ *
+ * This record is used to allow determining Firmware and CPLD revisions for
+ * components in the system. The goal of this record is to provide a
+ * flexible method to communicate to software and firmware the revisions
+ * of these components. This record replaces much of the functionality of
+ * Record Type 193. OEM SMBIOS Record Type 193 was not scaling well with
+ * the large number of potential CPLD devices, power management controllers,
+ * etc. This record is flexible such that each instance of Type 216
+ * defines one firmware component. This record also includes the string
+ * name for which software should refer to the component. The record
+ * includes both data bytes to indicate the revision and a string value. A
+ * firmware component can implement either or both. If both are supported,
+ * it allows easy display of the revision, but prevents the need for
+ * software/firmware to parse strings when doing comparisons on revisions.
+ * As there is one Type 216 Record per firmware component, the Handle for
+ * the Record can be used to tie firmware components with other OEM SMBIOS
+ * Records in the future if needed (similar to how SMBIOS Type 17 is tied
+ * to other Record Types related to DIMMs)
+ *
+ * Offset | Name | Width | Description
+ * ------------------------------------------
+ * 0x00 | Type | BYTE | 0xD8, Version Indicator Record
+ * 0x01 | Length | BYTE | Length of structure
+ * 0x02 | Handle | WORD | Unique handle
+ * 0x04 | FW Type | WORD | Type of Firmware
+ * 0x06 | FW Name | STRING | Name of Firmware
+ * 0x07 | FW Version | STRING | Firmware Version
+ * 0x08 | Data Format| BYTE | Format of the Version Data
+ * 0x09 |Version Data|12 BYTES| Version Data in Format from field 0x08
+ * 0x15 | Unique ID | WORD | Unique ID for Firmware flash
+ */
+ if (gen < G8) return 0;
+ pr_handle_name("%s Version Indicator", company);
+ if (h->length < 23) break;
+ dmi_hp_216_fw_type(WORD(data + 0x04));
+ pr_attr("Firmware Name String", "%s", dmi_string(h, data[0x06]));
+ pr_attr("Firmware Version String", "%s", dmi_string(h, data[0x07]));
+ dmi_hp_216_version(data[0x08], data + 0x09);
+ if (WORD(data + 0x15))
+ pr_attr("Unique ID", "0x%04x", WORD(data + 0x15));
+ break;
+
case 219:
/*
* Vendor Specific: HPE ProLiant Information