[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/72] ppc/pnv: Support LPC host controller irqs other than serirq
From: |
Nicholas Piggin |
Subject: |
[PULL 17/72] ppc/pnv: Support LPC host controller irqs other than serirqs |
Date: |
Tue, 11 Mar 2025 22:57:11 +1000 |
The LPC model has only supported serirqs (ISA device IRQs), however
there are internal sources that can raise other interrupts. Update the
device to handle these interrupt sources.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
hw/ppc/pnv_lpc.c | 64 +++++++++++++++++++++++-------------------------
1 file changed, 31 insertions(+), 33 deletions(-)
diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c
index 0480a60f3f..d0fccc165d 100644
--- a/hw/ppc/pnv_lpc.c
+++ b/hw/ppc/pnv_lpc.c
@@ -456,46 +456,18 @@ static void pnv_lpc_eval_irqs(PnvLpcController *lpc)
{
uint32_t active_irqs = 0;
- if (lpc->lpc_hc_irqstat & PPC_BITMASK32(16, 31)) {
- qemu_log_mask(LOG_UNIMP, "LPC HC Unimplemented irqs in IRQSTAT: "
- "0x%08"PRIx32"\n", lpc->lpc_hc_irqstat);
- }
-
- if (lpc->lpc_hc_irqser_ctrl & LPC_HC_IRQSER_EN) {
- active_irqs = lpc->lpc_hc_irqstat & lpc->lpc_hc_irqmask;
+ active_irqs = lpc->lpc_hc_irqstat & lpc->lpc_hc_irqmask;
+ if (!(lpc->lpc_hc_irqser_ctrl & LPC_HC_IRQSER_EN)) {
+ active_irqs &= ~LPC_HC_IRQ_SERIRQ_ALL;
}
/* Reflect the interrupt */
- if (!lpc->psi_has_serirq) {
- /*
- * POWER8 ORs all irqs together (also with LPCHC internal interrupt
- * sources) and outputs a single line that raises the PSI LPCHC irq
- * which then latches an OPB IRQ status register that sends the irq
- * to PSI.
- *
- * We don't honor the polarity register, it's pointless and unused
- * anyway
- */
- if (active_irqs) {
- lpc->opb_irq_input |= OPB_MASTER_IRQ_LPC;
- } else {
- lpc->opb_irq_input &= ~OPB_MASTER_IRQ_LPC;
- }
-
- /* Update OPB internal latch */
- lpc->opb_irq_stat |= lpc->opb_irq_input & lpc->opb_irq_mask;
-
- qemu_set_irq(lpc->psi_irq_lpchc, lpc->opb_irq_stat != 0);
- } else {
+ if (lpc->psi_has_serirq) {
/*
- * POWER9 and POWER10 have routing fields in OPB master registers that
+ * POWER9 and later have routing fields in OPB master registers that
* send LPC irqs to 4 output lines that raise the PSI SERIRQ irqs.
* These don't appear to get latched into an OPB register like the
* LPCHC irqs.
- *
- * POWER9 LPC controller internal irqs still go via the OPB
- * and LPCHC PSI irqs like P8, but we have no such internal sources
- * modelled yet.
*/
bool serirq_out[4] = { false, false, false, false };
int irq;
@@ -510,7 +482,33 @@ static void pnv_lpc_eval_irqs(PnvLpcController *lpc)
qemu_set_irq(lpc->psi_irq_serirq[1], serirq_out[1]);
qemu_set_irq(lpc->psi_irq_serirq[2], serirq_out[2]);
qemu_set_irq(lpc->psi_irq_serirq[3], serirq_out[3]);
+
+ /*
+ * POWER9 and later LPC controller internal irqs still go via the OPB
+ * and LPCHC PSI irqs like P8, so take the SERIRQs out and continue.
+ */
+ active_irqs &= ~LPC_HC_IRQ_SERIRQ_ALL;
+ }
+
+ /*
+ * POWER8 ORs all irqs together (also with LPCHC internal interrupt
+ * sources) and outputs a single line that raises the PSI LPCHC irq
+ * which then latches an OPB IRQ status register that sends the irq
+ * to PSI.
+ *
+ * We don't honor the polarity register, it's pointless and unused
+ * anyway
+ */
+ if (active_irqs) {
+ lpc->opb_irq_input |= OPB_MASTER_IRQ_LPC;
+ } else {
+ lpc->opb_irq_input &= ~OPB_MASTER_IRQ_LPC;
}
+
+ /* Update OPB internal latch */
+ lpc->opb_irq_stat |= lpc->opb_irq_input & lpc->opb_irq_mask;
+
+ qemu_set_irq(lpc->psi_irq_lpchc, lpc->opb_irq_stat != 0);
}
static uint64_t lpc_hc_read(void *opaque, hwaddr addr, unsigned size)
--
2.47.1
- [PULL 05/72] pseries: Update SLOF firmware image, (continued)
- [PULL 05/72] pseries: Update SLOF firmware image, Nicholas Piggin, 2025/03/11
- [PULL 09/72] ppc/pnv/occ: Fix common area sensor offsets, Nicholas Piggin, 2025/03/11
- [PULL 06/72] ppc/pnv/phb4: Add pervasive chiplet support to PHB4/5, Nicholas Piggin, 2025/03/11
- [PULL 11/72] ppc/pnv/occ: Better document OCCMISC bits, Nicholas Piggin, 2025/03/11
- [PULL 04/72] ppc/pnv: Update skiboot to 7.1-106, Nicholas Piggin, 2025/03/11
- [PULL 07/72] ppc/pnv/homer: Fix OCC registers, Nicholas Piggin, 2025/03/11
- [PULL 10/72] ppc/pnv/homer: class-based base and size, Nicholas Piggin, 2025/03/11
- [PULL 12/72] ppc/pnv: Make HOMER memory a RAM region, Nicholas Piggin, 2025/03/11
- [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 <=
- [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, 2025/03/11
- [PULL 24/72] ppc/xive: Rename ipb_to_pipr() to xive_ipb_to_pipr(), Nicholas Piggin, 2025/03/11