[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/72] ppc/pnv/occ: Better document OCCMISC bits
From: |
Nicholas Piggin |
Subject: |
[PULL 11/72] ppc/pnv/occ: Better document OCCMISC bits |
Date: |
Tue, 11 Mar 2025 22:57:05 +1000 |
Use defines for the OCCMISC register bits, and add a comment about the
IRQ request bit, which QEMU may not model quite correctly.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
hw/ppc/pnv_occ.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/pnv_occ.c b/hw/ppc/pnv_occ.c
index c6681a035a..5424d87ee9 100644
--- a/hw/ppc/pnv_occ.c
+++ b/hw/ppc/pnv_occ.c
@@ -30,6 +30,7 @@
#define OCB_OCI_OCCMISC 0x4020
#define OCB_OCI_OCCMISC_AND 0x4021
#define OCB_OCI_OCCMISC_OR 0x4022
+#define OCCMISC_PSI_IRQ PPC_BIT(0)
/* OCC sensors */
#define OCC_SENSOR_DATA_BLOCK_OFFSET 0x0000
@@ -50,13 +51,16 @@
static void pnv_occ_set_misc(PnvOCC *occ, uint64_t val)
{
- bool irq_state;
-
- val &= 0xffff000000000000ull;
+ val &= PPC_BITMASK(0, 18); /* Mask out unimplemented bits */
occ->occmisc = val;
- irq_state = !!(val >> 63);
- qemu_set_irq(occ->psi_irq, irq_state);
+
+ /*
+ * OCCMISC IRQ bit triggers the interrupt on a 0->1 edge, but not clear
+ * how that is handled in PSI so it is level-triggered here, which is not
+ * really correct (but skiboot is okay with it).
+ */
+ qemu_set_irq(occ->psi_irq, !!(val & OCCMISC_PSI_IRQ));
}
static uint64_t pnv_occ_power8_xscom_read(void *opaque, hwaddr addr,
--
2.47.1
- [PULL 00/72] ppc-for-10.0-1 queue, Nicholas Piggin, 2025/03/11
- [PULL 01/72] ppc/ppc405: Remove tests, Nicholas Piggin, 2025/03/11
- [PULL 03/72] hw/ppc: Deprecate 405 CPUs, Nicholas Piggin, 2025/03/11
- [PULL 02/72] ppc/ppc405: Remove boards, Nicholas Piggin, 2025/03/11
- [PULL 08/72] ppc/pnv/homer: Make dummy reads return 0, Nicholas Piggin, 2025/03/11
- [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 <=
- [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, 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