aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hdata/spira.c17
-rw-r--r--hdata/spira.h12
2 files changed, 28 insertions, 1 deletions
diff --git a/hdata/spira.c b/hdata/spira.c
index 5e3d6cc..2d41e91 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -408,6 +408,22 @@ static void add_vas_node(struct dt_node *np, int idx)
dt_add_property_cells(vas, "ibm,vas-id", idx);
}
+static void add_ecid_data(const struct HDIF_common_hdr *hdr,
+ struct dt_node *xscom)
+{
+ uint32_t size = 0;
+ struct sppcrd_ecid *ecid;
+ const struct HDIF_array_hdr *ec_hdr;
+
+ ec_hdr = HDIF_get_idata(hdr, SPPCRD_IDATA_EC_LEVEL, &size);
+ if (!ec_hdr || !size)
+ return;
+
+ ecid = (void *)ec_hdr + be32_to_cpu(ec_hdr->offset);
+ dt_add_property_u64s(xscom, "ecid", be64_to_cpu(ecid->low),
+ be64_to_cpu(ecid->high));
+}
+
static void add_xscom_add_pcia_assoc(struct dt_node *np, uint32_t pcid)
{
const struct HDIF_common_hdr *hdr;
@@ -526,6 +542,7 @@ static bool add_xscom_sppcrd(uint64_t xscom_base)
add_xive_node(np);
parse_i2c_devs(hdif, SPPCRD_IDATA_HOST_I2C, np);
add_vas_node(np, i);
+ add_ecid_data(hdif, np);
}
/*
diff --git a/hdata/spira.h b/hdata/spira.h
index f850c79..49acf5c 100644
--- a/hdata/spira.h
+++ b/hdata/spira.h
@@ -1,4 +1,4 @@
-/* Copyright 2013-2014 IBM Corp.
+/* Copyright 2013-2017 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1183,6 +1183,16 @@ struct sppcrd_smp_link {
__be16 gpu_slca;
} __packed;
+/* Idata index 8 : chip EC Level array */
+#define SPPCRD_IDATA_EC_LEVEL 8
+
+struct sppcrd_ecid {
+ __be32 chip_id;
+ __be32 ec_level;
+ __be64 low; /* Processor ECID bit 0-63 */
+ __be64 high; /* Processor ECID bit 64-127 */
+} __packed;
+
/*
* Host Services Data.
*/