Blame SOURCES/0001-IBM-PowerNV.patch

ff36e7
From bab358bdb88247e033f21b0155df3006535a18d6 Mon Sep 17 00:00:00 2001
ff36e7
From: Lyonel Vincent <lyonel@ezix.org>
ff36e7
Date: Thu, 7 Aug 2014 22:01:02 +0000
ff36e7
Subject: [PATCH 1/1] apply patch 2 of ticket #655: report IBM PowerNV hardware
ff36e7
 model
ff36e7
ff36e7
From: Dipankar Sarma <dipankar@in.ibm.com>
ff36e7
ff36e7
Like x86, now IBM Power system allows the user to run Linux
ff36e7
on host (PowerNV - Power Non Virtualized) as well as guest
ff36e7
(PowerKVM guest, PowerVM LPAR).
ff36e7
ff36e7
The IBM Power systems use OPAL firmware (https://github.com/open-power/skiboot)
ff36e7
on PowerNV mode which exposes system information to Linux
ff36e7
via device tree (/proc/device-tree).
ff36e7
ff36e7
Device tree provided by OPAL is slightly different than Open
ff36e7
Firmware specification.
ff36e7
ff36e7
lshw presently fetches device tree information according to the
ff36e7
Apple Open firmware format.
ff36e7
ff36e7
Hence we need to detect if the platform is IBM Powernv, if true process
ff36e7
the information appropriately.
ff36e7
ff36e7
Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com>
ff36e7
Signed-off-by: Janani Venkataraman <jananive@linux.vnet.ibm.com>
ff36e7
ff36e7
ff36e7
git-svn-id: http://ezix.org/source/packages/lshw/development@2539 811e2811-9fd9-0310-a116-b6e8ac943c8b
ff36e7
---
ff36e7
 src/core/device-tree.cc | 13 ++++++++++---
ff36e7
 1 file changed, 10 insertions(+), 3 deletions(-)
ff36e7
ff36e7
diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
ff36e7
index 809de7c..2938e1e 100644
ff36e7
--- a/src/core/device-tree.cc
ff36e7
+++ b/src/core/device-tree.cc
ff36e7
@@ -529,9 +529,16 @@ bool scan_device_tree(hwNode & n)
ff36e7
     n.setSerial(get_string(DEVICETREE "/system-id"));
ff36e7
   fix_serial_number(n);
ff36e7
 
ff36e7
-  n.setVendor(get_string(DEVICETREE "/copyright", n.getVendor()));
ff36e7
-
ff36e7
-  get_apple_model(n);
ff36e7
+  if (matches(get_string(DEVICETREE "/compatible"), "^ibm,powernv"))
ff36e7
+  {
ff36e7
+    n.setVendor(get_string(DEVICETREE "/vendor", "IBM"));
ff36e7
+    n.setDescription(get_string(DEVICETREE "/model-name"));
ff36e7
+  }
ff36e7
+  else
ff36e7
+  {
ff36e7
+    n.setVendor(get_string(DEVICETREE "/copyright", n.getVendor()));
ff36e7
+    get_apple_model(n);
ff36e7
+  }
ff36e7
 
ff36e7
   if (core)
ff36e7
   {
ff36e7
-- 
ff36e7
2.4.3
ff36e7