All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] hw/misc: add K230 PMU device model
@ 2026-08-29  2:02 JunWei Li
  2026-08-29  2:02 ` [PATCH 1/3] hw/misc: add K230 PMU device JunWei Li
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: JunWei Li @ 2026-08-29  2:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-riscv, chenhuacai, JunWei Li

This series adds a device model for the K230 power management unit (PMU)
and wires it into the K230 SoC.

The PMU (K230 TRM V0.3.1 chapter 14) controls the core power-on/off path
through two PMIC output pads and reports six PAD inputs plus RTC
interrupts to the CPU.  This minimal model covers the APB register bank
with TRM reset values and write masks, interrupt detection state
(PAD64..PAD69 inputs setting PMU_INT_STATE, the interrupt line following
PMU_INT_STATE & PMU_INT0_TO_CPU, W1C clear) and the PAD70/PAD71 outputs
driven by PMU_SYSCTRL_REG.  Long/short press timing, edge counting and
debounce are intentionally left for a follow-up.

Patch 1 adds the device model, patch 2 wires it into the K230 SoC
(MMIO 0x91000000, small-core PLIC source 81) and patch 3 adds qtest
coverage.  The k230 qtests pass under qtest-riscv64.

JunWei Li (3):
  hw/misc: add K230 PMU device
  hw/riscv: wire up K230 PMU in the SoC
  tests/qtest: add k230-pmu-test

 MAINTAINERS                 |   3 +
 hw/misc/Kconfig             |   3 +
 hw/misc/k230_pmu.c          | 242 ++++++++++++++++++++++++++++++++++++
 hw/misc/meson.build         |   1 +
 hw/riscv/Kconfig            |   1 +
 hw/riscv/k230.c             |  12 +-
 include/hw/misc/k230_pmu.h  |  71 +++++++++++
 include/hw/riscv/k230.h     |   3 +
 tests/qtest/k230-pmu-test.c | 136 ++++++++++++++++++++
 tests/qtest/meson.build     |   3 +-
 10 files changed, 471 insertions(+), 4 deletions(-)
 create mode 100644 hw/misc/k230_pmu.c
 create mode 100644 include/hw/misc/k230_pmu.h
 create mode 100644 tests/qtest/k230-pmu-test.c

-- 
2.20.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-29  4:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-29  2:02 [PATCH 0/3] hw/misc: add K230 PMU device model JunWei Li
2026-08-29  2:02 ` [PATCH 1/3] hw/misc: add K230 PMU device JunWei Li
2026-08-29  2:02 ` [PATCH 2/3] hw/riscv: wire up K230 PMU in the SoC JunWei Li
2026-08-29  2:02 ` [PATCH 3/3] tests/qtest: add k230-pmu-test JunWei Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.