|
|
99c779 |
From 9faf09f9851fafd50b96b59d7eac77fcd1b641d7 Mon Sep 17 00:00:00 2001
|
|
|
99c779 |
From: Chandni Verma <chandni@linux.vnet.ibm.com>
|
|
|
99c779 |
Date: Thu, 20 Oct 2016 14:23:50 +0530
|
|
|
99c779 |
Subject: [PATCH 23/43] devtree: Fix physical ID info for CPU nodes
|
|
|
99c779 |
|
|
|
99c779 |
'reg' property contains processor core id. Use this info to fill
|
|
|
99c779 |
processor physical ID. This is useful to map processor core to
|
|
|
99c779 |
sysfs entry in cpufreq.cc code.
|
|
|
99c779 |
|
|
|
99c779 |
Signed-off-by: Chandni Verma <chandni@linux.vnet.ibm.com>
|
|
|
99c779 |
[Splited original patch and updated description - Vasant]
|
|
|
99c779 |
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
|
|
|
99c779 |
---
|
|
|
99c779 |
src/core/device-tree.cc | 4 ++++
|
|
|
99c779 |
1 file changed, 4 insertions(+)
|
|
|
99c779 |
|
|
|
99c779 |
diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
|
|
|
99c779 |
index c60e49c..9c74e5a 100644
|
|
|
99c779 |
--- a/src/core/device-tree.cc
|
|
|
99c779 |
+++ b/src/core/device-tree.cc
|
|
|
99c779 |
@@ -473,6 +473,7 @@ static void scan_devtree_cpu_power(hwNode & core)
|
|
|
99c779 |
{
|
|
|
99c779 |
uint32_t l2_key = 0;
|
|
|
99c779 |
uint32_t version = 0;
|
|
|
99c779 |
+ uint32_t reg;
|
|
|
99c779 |
string basepath = string(DEVICETREE "/cpus/") + string(namelist[i]->d_name);
|
|
|
99c779 |
hwNode cpu("cpu", hw::processor);
|
|
|
99c779 |
|
|
|
99c779 |
@@ -491,6 +492,9 @@ static void scan_devtree_cpu_power(hwNode & core)
|
|
|
99c779 |
cpu.setDescription("CPU");
|
|
|
99c779 |
set_cpu(cpu, currentcpu++, basepath);
|
|
|
99c779 |
|
|
|
99c779 |
+ reg = get_u32(basepath + "/reg");
|
|
|
99c779 |
+ cpu.setPhysId(tostring(reg));
|
|
|
99c779 |
+
|
|
|
99c779 |
version = get_u32(basepath + "/cpu-version");
|
|
|
99c779 |
if (version != 0)
|
|
|
99c779 |
cpu.setVersion(tostring(version));
|
|
|
99c779 |
--
|
|
|
99c779 |
2.10.2
|
|
|
99c779 |
|