aboutsummaryrefslogtreecommitdiff
path: root/hw/xscom.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-01-15 22:38:25 -0600
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-02-02 18:30:26 +1100
commitc9cadb4fe60d4d41fc45a35a1d2ae27e0632c679 (patch)
treeabdefbe0aa2b14b15198ba8cb56540823677d900 /hw/xscom.c
parent48dee7ac0bc259316b28fc27463625c605160a9a (diff)
downloadskiboot-c9cadb4fe60d4d41fc45a35a1d2ae27e0632c679.zip
skiboot-c9cadb4fe60d4d41fc45a35a1d2ae27e0632c679.tar.gz
skiboot-c9cadb4fe60d4d41fc45a35a1d2ae27e0632c679.tar.bz2
xscom: Grab P9 DD1.0 revision level
To differentiate between 1.00, 1.01, 1.02 etc... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/xscom.c')
-rw-r--r--hw/xscom.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/hw/xscom.c b/hw/xscom.c
index 9afa952..cca3d7d 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -599,6 +599,34 @@ static void xscom_init_chip_info(struct proc_chip *chip)
/* Get EC level from CFAM ID */
chip->ec_level = ((val >> 16) & 0xf) << 4;
chip->ec_level |= (val >> 8) & 0xf;
+
+ /*
+ * On P9 DD1.0, grab the ECID bits to differenciate
+ * DD1.01, 1.02 etc...
+ */
+ if (proc_gen == proc_gen_p9 && chip->ec_level == 0x10) {
+ uint64_t ecid2 = 0;
+ uint8_t rev;
+ xscom_read(chip->id, 0x18002, &ecid2);
+ switch((ecid2 >> 45) & 7) {
+ case 0:
+ rev = 0;
+ break;
+ case 1:
+ rev = 1;
+ break;
+ case 3:
+ rev = 2;
+ break;
+ case 7:
+ rev = 3;
+ break;
+ default:
+ rev = 0;
+ }
+ printf("P9 DD1.0%d detected\n", rev);
+ chip->ec_rev = rev;
+ }
}
/*