Blob Blame History Raw
From aba767384ea79e3b9e4bcfced7c0e2cb0234963f Mon Sep 17 00:00:00 2001
From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Date: Tue, 16 Jan 2018 16:11:53 +0530
Subject: [PATCH 5/5] devtree: Add vendor field for cpu node

Device tree provides 'vendor' property for cpu nodes. Use that to
populate cpu vendor field

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 src/core/device-tree.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
index 6bcc52d..0e7f399 100644
--- a/src/core/device-tree.cc
+++ b/src/core/device-tree.cc
@@ -459,6 +459,7 @@ struct chip_vpd_data
   string product;
   string serial;
   string slot;
+  string vendor;
 };
 
 
@@ -486,6 +487,9 @@ static void add_chip_vpd(string path, string name,
       if (exists("part-number"))
         data->product = hw::strip(get_string("part-number"));
 
+      if (exists("vendor"))
+        data->vendor = hw::strip(get_string("vendor"));
+
       if (exists("fru-number"))
         data->product += " FRU# " + hw::strip(get_string("fru-number"));
 
@@ -554,6 +558,7 @@ static void fill_core_vpd(hwNode & cpu, string & basepath,
     cpu.setProduct(data->product);
     cpu.setSerial(data->serial);
     cpu.setSlot(data->slot);
+    cpu.setVendor(data->vendor);
   }
 
   if (xscom_path != "")
-- 
1.8.3.1