diff options
-rw-r--r-- | hw/xscom.c | 28 | ||||
-rw-r--r-- | include/chip.h | 1 |
2 files changed, 29 insertions, 0 deletions
@@ -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; + } } /* diff --git a/include/chip.h b/include/chip.h index 61b413c..588db9f 100644 --- a/include/chip.h +++ b/include/chip.h @@ -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) |