From 612d6d998da5fed403885140fad1ae84baa7e583 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 5 Oct 2021 17:12:52 -0400 Subject: [PATCH] Add optane dimm for XCC systems Optane DIMMs are not normal SPD, use the proprietary API to fetch information. Change-Id: If4e9cca602f982c35a756f89b02eae9e35545785 --- pyghmi/ipmi/oem/lenovo/handler.py | 3 +++ pyghmi/ipmi/oem/lenovo/imm.py | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index 651ea4e1..5cfa0310 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -738,6 +738,9 @@ class OEMHandler(generic.OEMHandler): pass if self.has_xcc and name and name.startswith('PSU '): self.immhandler.augment_psu_info(fru, name) + if (self.has_xcc and 'memory_type' in fru + and fru['memory_type'] == 'Unknown'): + self.immhandler.fetch_dimm(name, fru) return fru elif self.is_fpc and self.is_fpc != 6: # SMM variant fru['oem_parser'] = 'lenovo' diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 318f4328..53fa109c 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -867,6 +867,26 @@ class XCCClient(IMMClient): raise pygexc.UnsupportedFunctionality( 'This platform does not support AC reseat.') + def fetch_dimm(self, name, fru): + meminfo = self.grab_cacheable_json('/api/dataset/imm_memory') + meminfo = meminfo.get('items', [{}])[0].get('memory', []) + for memi in meminfo: + if memi.get('memory_description', None) == name: + fru['model'] = memi['memory_part_number'] + fru['ecc'] = memi.get('memory_ecc_bits', 0) != 0 + fru['manufacture_location'] = 0 + fru['memory_type'] = memi['memory_type'] + fru['module_type'] = fru['memory_type'] + mdate = memi['memory_manuf_date'] + mdate = '20{}-W{}'.format(mdate[-2:], mdate[:-2]) + fru['manufacture_date'] = mdate + speed = memi['memory_config_speed'] * 8 / 100 * 100 + fru['speed'] = speed + fru['capacity_mb'] = memi['memory_capacity'] * 1024 + fru['serial'] = memi['memory_serial_number'].strip() + fru['manufacturer'] = memi['memory_manufacturer'] + break + def get_description(self): dsc = self.wc.grab_json_response('/DeviceDescription.json') dsc = dsc[0]