@@ -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;
+ }
}
/*
@@ -155,6 +155,7 @@ struct proc_chip {
/* These are only initialized after xcom_init */
enum proc_chip_type type;
uint32_t ec_level; /* 0xMm (DD1.0 = 0x10) */
+ uint8_t ec_rev; /* sub-revision */
/* Those two values are only populated on machines with an FSP
* dbob_id = Drawer/Block/Octant/Blade (DBOBID)
To differentiate between 1.00, 1.01, 1.02 etc... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> --- hw/xscom.c | 28 ++++++++++++++++++++++++++++ include/chip.h | 1 + 2 files changed, 29 insertions(+)