[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 8/9] ppc/pnv/occ: Add POWER10 OCC-OPAL data format
From: |
Nicholas Piggin |
Subject: |
[PATCH 8/9] ppc/pnv/occ: Add POWER10 OCC-OPAL data format |
Date: |
Tue, 10 Dec 2024 13:04:48 +1000 |
Add POWER10 OCC-OPAL data format. POWER10 changes major version and
adds a few fields.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
hw/ppc/pnv_occ.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/pnv_occ.c b/hw/ppc/pnv_occ.c
index 5567fbf008e..aa46e118e93 100644
--- a/hw/ppc/pnv_occ.c
+++ b/hw/ppc/pnv_occ.c
@@ -263,14 +263,20 @@ static const TypeInfo pnv_occ_power9_type_info = {
static void pnv_occ_power10_class_init(ObjectClass *klass, void *data)
{
+ PnvOCCClass *poc = PNV_OCC_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
dc->desc = "PowerNV OCC Controller (POWER10)";
+ poc->opal_shared_memory_offset = P9_HOMER_OPAL_DATA_OFFSET;
+ poc->opal_shared_memory_version = 0xA0;
+ poc->xscom_size = PNV9_XSCOM_OCC_SIZE;
+ poc->xscom_ops = &pnv_occ_power9_xscom_ops;
+ assert(!dc->user_creatable);
}
static const TypeInfo pnv_occ_power10_type_info = {
.name = TYPE_PNV10_OCC,
- .parent = TYPE_PNV9_OCC,
+ .parent = TYPE_PNV_OCC,
.class_init = pnv_occ_power10_class_init,
};
@@ -710,6 +716,37 @@ static bool occ_init_homer_memory(PnvOCC *occ, Error
**errp)
static_data.v9.core_max[i] = 1;
}
break;
+ case 0xA0:
+ if (chip->chip_id == 0) {
+ static_data.v10.occ_role = OCC_ROLE_MASTER;
+ } else {
+ static_data.v10.occ_role = OCC_ROLE_SLAVE;
+ }
+ static_data.v10.pstate_min = 4;
+ static_data.v10.pstate_fixed_freq = 3;
+ static_data.v10.pstate_base = 2;
+ static_data.v10.pstate_ultra_turbo = 1;
+ static_data.v10.pstate_fmax = 0;
+ static_data.v10.minor = 0x01;
+ static_data.v10.pstates[0].valid = 1;
+ static_data.v10.pstates[0].id = 0;
+ static_data.v10.pstates[0].freq_khz = cpu_to_be32(4200);
+ static_data.v10.pstates[1].valid = 1;
+ static_data.v10.pstates[1].id = 1;
+ static_data.v10.pstates[1].freq_khz = cpu_to_be32(4000);
+ static_data.v10.pstates[2].valid = 1;
+ static_data.v10.pstates[2].id = 2;
+ static_data.v10.pstates[2].freq_khz = cpu_to_be32(3800);
+ static_data.v10.pstates[3].valid = 1;
+ static_data.v10.pstates[3].id = 3;
+ static_data.v10.pstates[3].freq_khz = cpu_to_be32(3000);
+ static_data.v10.pstates[4].valid = 1;
+ static_data.v10.pstates[4].id = 4;
+ static_data.v10.pstates[4].freq_khz = cpu_to_be32(2000);
+ for (i = 0; i < chip->nr_cores; i++) {
+ static_data.v10.core_max[i] = 1;
+ }
+ break;
default:
g_assert_not_reached();
}
@@ -725,6 +762,10 @@ static bool occ_init_homer_memory(PnvOCC *occ, Error
**errp)
dynamic_data.cur_pwr_cap = cpu_to_be16(PCAP_MAX_POWER_W);
dynamic_data.soft_min_pwr_cap = cpu_to_be16(PCAP_SOFT_MIN_POWER_W);
switch (poc->opal_shared_memory_version) {
+ case 0xA0:
+ dynamic_data.minor_version = 0x1;
+ dynamic_data.v10.wof_enabled = 0x1;
+ break;
case 0x90:
dynamic_data.minor_version = 0x1;
break;
--
2.45.2
- [PATCH 0/9] ppc/pnv: HOMER and OCC fixes and improvements, Nicholas Piggin, 2024/12/09
- [PATCH 1/9] ppc/pnv/homer: Fix OCC registers, Nicholas Piggin, 2024/12/09
- [PATCH 3/9] ppc/pnv/occ: Fix common area sensor offsets, Nicholas Piggin, 2024/12/09
- [PATCH 2/9] ppc/pnv/homer: Make dummy reads return 0, Nicholas Piggin, 2024/12/09
- [PATCH 4/9] ppc/pnv/homer: class-based base and size, Nicholas Piggin, 2024/12/09
- [PATCH 5/9] ppc/pnv/occ: Better document OCCMISC bits, Nicholas Piggin, 2024/12/09
- [PATCH 7/9] ppc/pnv/occ: Update pstate frequency tables, Nicholas Piggin, 2024/12/09
- [PATCH 6/9] ppc/pnv: Make HOMER memory a RAM region, Nicholas Piggin, 2024/12/09
- [PATCH 8/9] ppc/pnv/occ: Add POWER10 OCC-OPAL data format,
Nicholas Piggin <=
- [PATCH 9/9] ppc/pnv/occ: Implement a basic dynamic OCC model, Nicholas Piggin, 2024/12/09