aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2014-07-02 04:02:05 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-07-21 14:48:45 +1000
commit3ec0a137016cc515278071c2f7c413e43d345bf8 (patch)
treefa5f8da188c3b1b27c81934568c9430b9eca74bf
parent3997c62d9986009dc79bb51ee371f3d8e211cf35 (diff)
downloadskiboot-3ec0a137016cc515278071c2f7c413e43d345bf8.zip
skiboot-3ec0a137016cc515278071c2f7c413e43d345bf8.tar.gz
skiboot-3ec0a137016cc515278071c2f7c413e43d345bf8.tar.bz2
P7IOC: Grab PHB version
We need apply errata based on PHB version in future. So lets grab it at PHB initialization time. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--hw/p7ioc-phb.c4
-rw-r--r--include/p7ioc.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c
index f18a511..9bcda82 100644
--- a/hw/p7ioc-phb.c
+++ b/hw/p7ioc-phb.c
@@ -2903,8 +2903,8 @@ int64_t p7ioc_phb_init(struct p7ioc_phb *p)
* the value makes sense...
*/
val = in_be64(p->regs_asb + PHB_VERSION);
-
- PHBDBG(p, "Version reg: %llx\n", val);
+ p->rev = ((val >> 16) & 0xffff) | (val & 0xffff);
+ PHBDBG(p, "PHB version: %08x\n", p->rev);
/*
* Configure AIB operations
diff --git a/include/p7ioc.h b/include/p7ioc.h
index 70c174e..f1e5b39 100644
--- a/include/p7ioc.h
+++ b/include/p7ioc.h
@@ -292,6 +292,9 @@ struct p7ioc_phb {
uint8_t index; /* 0..5 index inside p7ioc */
uint8_t gen;
uint32_t flags;
+#define P7IOC_REV_DD10 0x00a20001
+#define P7IOC_REV_DD11 0x00a20002
+ uint32_t rev; /* Both major and minor have 2 bytes */
void *regs_asb;
void *regs; /* AIB regs */
struct lock lock;