From: JunWei Li <vae1207@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, chenhuacai@canaan-creative.com,
JunWei Li <vae1207@gmail.com>
Subject: [PATCH 0/3] hw/misc: add K230 PMU device model
Date: Sat, 29 Aug 2026 10:02:26 +0800 [thread overview]
Message-ID: <20260829020229.389742-1-vae1207@gmail.com> (raw)
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
next reply other threads:[~2026-08-29 4:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-29 2:02 JunWei Li [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260829020229.389742-1-vae1207@gmail.com \
--to=vae1207@gmail.com \
--cc=chenhuacai@canaan-creative.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.