[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/72] ppc/pnv: Implement LPC FW address space IDSEL
From: |
Nicholas Piggin |
Subject: |
[PULL 19/72] ppc/pnv: Implement LPC FW address space IDSEL |
Date: |
Tue, 11 Mar 2025 22:57:13 +1000 |
LPC FW address space is a 256MB (28-bit) region to one of 16-devices
that are selected with the IDSEL register. Implement this by making
the ISA FW address space 4GB, and move the 256MB OPB alias within
that space according to IDSEL.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
hw/ppc/pnv_lpc.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c
index 0e02ce6e94..d812dc8268 100644
--- a/hw/ppc/pnv_lpc.c
+++ b/hw/ppc/pnv_lpc.c
@@ -85,7 +85,7 @@ enum {
#define ISA_IO_SIZE 0x00010000
#define ISA_MEM_SIZE 0x10000000
-#define ISA_FW_SIZE 0x10000000
+#define ISA_FW_SIZE 0x100000000
#define LPC_IO_OPB_ADDR 0xd0010000
#define LPC_IO_OPB_SIZE 0x00010000
#define LPC_MEM_OPB_ADDR 0xe0000000
@@ -561,10 +561,13 @@ static void lpc_hc_write(void *opaque, hwaddr addr,
uint64_t val,
switch (addr) {
case LPC_HC_FW_SEG_IDSEL:
- /* XXX Actually figure out how that works as this impact
- * memory regions/aliases
+ /*
+ * ISA FW "devices" are modeled as 16x256MB windows into a
+ * 4GB LPC FW address space.
*/
+ val &= 0xf; /* Selects device 0-15 */
lpc->lpc_hc_fw_seg_idsel = val;
+ memory_region_set_alias_offset(&lpc->opb_isa_fw, val *
LPC_FW_OPB_SIZE);
break;
case LPC_HC_FW_RD_ACC_SIZE:
lpc->lpc_hc_fw_rd_acc_size = val;
@@ -798,9 +801,9 @@ static void pnv_lpc_realize(DeviceState *dev, Error **errp)
memory_region_init(&lpc->opb_mr, OBJECT(dev), "lpc-opb", 0x100000000ull);
address_space_init(&lpc->opb_as, &lpc->opb_mr, "lpc-opb");
- /* Create ISA IO and Mem space regions which are the root of
- * the ISA bus (ie, ISA address spaces). We don't create a
- * separate one for FW which we alias to memory.
+ /*
+ * Create ISA IO, Mem, and FW space regions which are the root of
+ * the ISA bus (ie, ISA address spaces).
*/
memory_region_init(&lpc->isa_io, OBJECT(dev), "isa-io", ISA_IO_SIZE);
memory_region_init(&lpc->isa_mem, OBJECT(dev), "isa-mem", ISA_MEM_SIZE);
--
2.47.1
- [PULL 15/72] ppc/pnv/occ: Implement a basic dynamic OCC model, (continued)
- [PULL 15/72] ppc/pnv/occ: Implement a basic dynamic OCC model, Nicholas Piggin, 2025/03/11
- [PULL 17/72] ppc/pnv: Support LPC host controller irqs other than serirqs, Nicholas Piggin, 2025/03/11
- [PULL 20/72] ppc/pnv: Move PNOR to offset 0 in the ISA FW space, Nicholas Piggin, 2025/03/11
- [PULL 16/72] target/ppc: Add Power9/10 power management SPRs, Nicholas Piggin, 2025/03/11
- [PULL 21/72] ppc/pnv: Add a PNOR address and size sanity checks, Nicholas Piggin, 2025/03/11
- [PULL 13/72] ppc/pnv/occ: Update pstate frequency tables, Nicholas Piggin, 2025/03/11
- [PULL 22/72] ppc/pnv: Add a default formatted PNOR image, Nicholas Piggin, 2025/03/11
- [PULL 14/72] ppc/pnv/occ: Add POWER10 OCC-OPAL data format, Nicholas Piggin, 2025/03/11
- [PULL 18/72] ppc/pnv: raise no-response errors if an LPC transaction fails, Nicholas Piggin, 2025/03/11
- [PULL 23/72] ppc/xive2: Update NVP save/restore for group attributes, Nicholas Piggin, 2025/03/11
- [PULL 19/72] ppc/pnv: Implement LPC FW address space IDSEL,
Nicholas Piggin <=
- [PULL 24/72] ppc/xive: Rename ipb_to_pipr() to xive_ipb_to_pipr(), Nicholas Piggin, 2025/03/11
- [PULL 25/72] ppc/xive2: Add grouping level to notification, Nicholas Piggin, 2025/03/11
- [PULL 27/72] ppc/xive2: Add undelivered group interrupt to backlog, Nicholas Piggin, 2025/03/11
- [PULL 26/72] ppc/xive2: Support group-matching when looking for target, Nicholas Piggin, 2025/03/11
- [PULL 29/72] ppc/xive2: Process group backlog when updating the CPPR, Nicholas Piggin, 2025/03/11
- [PULL 30/72] qtest/xive: Add group-interrupt test, Nicholas Piggin, 2025/03/11
- [PULL 31/72] ppc/xive2: Add support for MMIO operations on the NVPG/NVC BAR, Nicholas Piggin, 2025/03/11
- [PULL 32/72] ppc/xive2: Support crowd-matching when looking for target, Nicholas Piggin, 2025/03/11
- [PULL 33/72] pnv/xive2: Rename nvp_ to nvx_ if they can refer to NVP or NVGC, Nicholas Piggin, 2025/03/11
- [PULL 34/72] ppc/xive2: Check crowd backlog when scanning group backlog, Nicholas Piggin, 2025/03/11