aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2022-05-17 18:16:22 +0930
committerReza Arbab <arbab@linux.ibm.com>2022-05-23 10:21:04 -0500
commit9c2808f237f7ef5f93054bef6a019402ec5a2b4b (patch)
treecb9cca40c3e7dc603f517fae27227a7126ca9b80
parentf8c505a4c89ed80308467330e92433208f557637 (diff)
downloadskiboot-9c2808f237f7ef5f93054bef6a019402ec5a2b4b.zip
skiboot-9c2808f237f7ef5f93054bef6a019402ec5a2b4b.tar.gz
skiboot-9c2808f237f7ef5f93054bef6a019402ec5a2b4b.tar.bz2
xscom: Parse P10 ec revision
Use a look up table to support the p9, p10dd1 and p10dd2 conversions. Running on a Rainier: > [ 268.267370706,6] CPU: P10 generation processor (max 4 threads/core) > [ 268.267372501,7] CPU: Boot CPU PIR is 0x0460 PVR is 0x00801200 > [ 268.284420384,5] CHIP: Chip ID 0000 type: P10 DD2.02 > [ 268.284464084,5] CHIP: Chip ID 0002 type: P10 DD2.02 > [ 268.284500468,5] CHIP: Chip ID 0004 type: P10 DD2.02 > [ 268.284538166,5] CHIP: Chip ID 0006 type: P10 DD2.02 > [ 268.286317879,5] PLAT: Detected Rainier platform Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Dan HorĂ¡k <dan@danny.cz> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
-rw-r--r--hw/xscom.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/hw/xscom.c b/hw/xscom.c
index 25e3359..285f7df 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -841,41 +841,42 @@ int64_t xscom_read_cfam_chipid(uint32_t partid, uint32_t *chip_id)
return rc;
}
+/* The recipe comes from the p10_getecid hardware procedure */
static uint8_t xscom_get_ec_rev(struct proc_chip *chip)
{
uint64_t ecid2 = 0;
- uint8_t rev;
+ int8_t rev;
+ const int8_t *table;
+ /* 0 1 2 3 4 5 6 7 */
+ const int8_t p9table[8] = {0, 1, -1, 2, -1, -1, -1, 3};
+ const int8_t p10dd1table[8] = {0, 1, 2, 3, -1, -1, 4, -1};
+ const int8_t p10dd2table[8] = {0, 2, 3, 4, -1, -1, 5, -1};
if (chip_quirk(QUIRK_MAMBO_CALLOUTS))
return 0;
switch (proc_gen) {
case proc_gen_p9:
+ table = p9table;
+ break;
+ case proc_gen_p10:
+ if (chip->ec_level < 0x20)
+ table = p10dd1table;
+ else
+ table = p10dd2table;
break;
default:
return 0;
}
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;
- }
+
+ rev = table[(ecid2 >> 45) & 7];
+ if (rev < 0)
+ return 0;
prlog(PR_INFO, "P%d DD%i.%i%d detected\n",
- 9,
+ proc_gen == proc_gen_p9 ? 9 : 10,
0xf & (chip->ec_level >> 4),
chip->ec_level & 0xf,
rev);