[Skiboot] [PATCHv 2] hdat/vpd: Add chip-id property to processor chip node under vpd
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Mon Jun 13 16:59:06 AEST 2016
We have core information under /cpus node and processor chip VPD data
(like SN, LN, etc) under /vpd directory. Presently we don't have any
property to relate cores and chip information. This patch adds chip-id
information for processor chip nodes under vpd.
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
hdata/spira.c | 15 +++++++++++----
hdata/test/p8-840-spira.dt | 2 ++
hdata/test/p81-811.spira.dt | 4 ++++
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/hdata/spira.c b/hdata/spira.c
index cb97615..e4e6b2d 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -371,7 +371,7 @@ static bool add_xscom_sppcrd(uint64_t xscom_base)
const struct HDIF_common_hdr *hdif;
unsigned int i, vpd_sz;
const void *vpd;
- struct dt_node *np;
+ struct dt_node *np, *vpd_node;
for_each_ntuple_idx(&spira.ntuples.proc_chip, hdif, i,
SPPCRD_HDIF_SIG) {
@@ -409,7 +409,11 @@ static bool add_xscom_sppcrd(uint64_t xscom_base)
}
/* Add chip VPD */
- dt_add_vpd_node(hdif, SPPCRD_IDATA_FRU_ID, SPPCRD_IDATA_KW_VPD);
+ vpd_node = dt_add_vpd_node(hdif, SPPCRD_IDATA_FRU_ID,
+ SPPCRD_IDATA_KW_VPD);
+ if (vpd_node)
+ dt_add_property_cells(vpd_node, "ibm,chip-id",
+ be32_to_cpu(cinfo->xscom_id));
/* Add module VPD on version A and later */
if (version >= 0x000a) {
@@ -437,7 +441,7 @@ static void add_xscom_sppaca(uint64_t xscom_base)
{
const struct HDIF_common_hdr *hdif;
unsigned int i;
- struct dt_node *np;
+ struct dt_node *np, *vpd_node;
for_each_ntuple_idx(&spira.ntuples.paca, hdif, i, PACA_HDIF_SIG) {
const struct sppaca_cpu_id *id;
@@ -474,7 +478,10 @@ static void add_xscom_sppaca(uint64_t xscom_base)
continue;
/* Add chip VPD */
- dt_add_vpd_node(hdif, SPPACA_IDATA_FRU_ID, SPPACA_IDATA_KW_VPD);
+ vpd_node = dt_add_vpd_node(hdif, SPPACA_IDATA_FRU_ID,
+ SPPACA_IDATA_KW_VPD);
+ if (vpd_node)
+ dt_add_property_cells(vpd_node, "ibm,chip-id", chip_id);
/* Add chip associativity data */
dt_add_property_cells(np, "ibm,ccm-node-id",
diff --git a/hdata/test/p8-840-spira.dt b/hdata/test/p8-840-spira.dt
index 8746bea..83f299b 100644
--- a/hdata/test/p8-840-spira.dt
+++ b/hdata/test/p8-840-spira.dt
@@ -772,6 +772,7 @@ prop: ibm,enabled-idle-states size: 24 val: 6e617000666173742d736c65657000727677
prop: part-number size: 8 val: 3030465837343800
prop: ccin size: 5 val: 3534453100
prop: description size: 8 val: 556e6b6e6f776e00
+ prop: ibm,chip-id size: 4 val: 00000000
node: processor at 1001
prop: ibm,loc-code size: 25 val: 55373843392e3030312e575a53304357582d50312d43333200
prop: fru-type size: 2 val: 5046
@@ -785,6 +786,7 @@ prop: ibm,enabled-idle-states size: 24 val: 6e617000666173742d736c65657000727677
prop: part-number size: 8 val: 3030465837343800
prop: ccin size: 5 val: 3534453100
prop: description size: 8 val: 556e6b6e6f776e00
+ prop: ibm,chip-id size: 4 val: 00000001
node: usb-connector at 2902
prop: ibm,loc-code size: 24 val: 55373843392e3030312e575a53304357582d50312d543100
prop: fru-type size: 2 val: 4355
diff --git a/hdata/test/p81-811.spira.dt b/hdata/test/p81-811.spira.dt
index 068152c..c545bb6 100644
--- a/hdata/test/p81-811.spira.dt
+++ b/hdata/test/p81-811.spira.dt
@@ -1900,6 +1900,7 @@ prop: ibm,enabled-idle-states size: 24 val: 6e617000666173742d736c65657000727677
prop: part-number size: 8 val: 3030465837343000
prop: ccin size: 5 val: 3534453800
prop: description size: 8 val: 556e6b6e6f776e00
+ prop: ibm,chip-id size: 4 val: 00000000
node: processor at 1001
prop: ibm,loc-code size: 25 val: 55373843422e3030312e575a533030414c2d50312d43333200
prop: fru-type size: 2 val: 5046
@@ -1913,6 +1914,7 @@ prop: ibm,enabled-idle-states size: 24 val: 6e617000666173742d736c65657000727677
prop: part-number size: 8 val: 3030465837343000
prop: ccin size: 5 val: 3534453800
prop: description size: 8 val: 556e6b6e6f776e00
+ prop: ibm,chip-id size: 4 val: 00000001
node: processor at 1002
prop: ibm,loc-code size: 25 val: 55373843422e3030312e575a533030414c2d50312d43333300
prop: fru-type size: 2 val: 5046
@@ -1926,6 +1928,7 @@ prop: ibm,enabled-idle-states size: 24 val: 6e617000666173742d736c65657000727677
prop: part-number size: 8 val: 3030465837343000
prop: ccin size: 5 val: 3534453800
prop: description size: 8 val: 556e6b6e6f776e00
+ prop: ibm,chip-id size: 4 val: 00000010
node: processor at 1003
prop: ibm,loc-code size: 25 val: 55373843422e3030312e575a533030414c2d50312d43333300
prop: fru-type size: 2 val: 5046
@@ -1939,6 +1942,7 @@ prop: ibm,enabled-idle-states size: 24 val: 6e617000666173742d736c65657000727677
prop: part-number size: 8 val: 3030465837343000
prop: ccin size: 5 val: 3534453800
prop: description size: 8 val: 556e6b6e6f776e00
+ prop: ibm,chip-id size: 4 val: 00000011
node: usb-connector at 2900
prop: ibm,loc-code size: 24 val: 55373843422e3030312e575a533030414c2d50312d543500
prop: fru-type size: 2 val: 4355
More information about the Skiboot
mailing list