Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/2] Add RISC-V RPMI device power service support
@ 2026-08-29 20:55 Joshua Yeong
  2026-08-29 20:55 ` [PATCH 1/2] dt-bindings: power: Add RPMI device power service bindings Joshua Yeong
  2026-08-29 20:55 ` [PATCH 2/2] pmdomain: riscv: Add RPMI device power service Joshua Yeong
  0 siblings, 2 replies; 6+ messages in thread
From: Joshua Yeong @ 2026-08-29 20:55 UTC (permalink / raw)
  To: rahul, anup, lftan.linux, robh, krzk+dt, conor+dt, ulfh, pjw,
	palmer, aou
  Cc: alex, joshua.yeong, linux-riscv, linux-pm, devicetree,
	linux-kernel

The RISC-V Platform Management Interface (RPMI) specification defines a
modular and extensible messaging protocol between the supervisor software
and a platform microcontroller (PuC). Among the service groups it defines
is the device power service group (service group ID 0x00009), which allows
the supervisor to enumerate the power domains of platform devices managed
by the PuC, query their attributes, and get/set their power state.

This series adds supervisor-side support for that service group:

 - DT bindings for the power domain controller exposed to the supervisor
   ("riscv,rpmi-device-power") and for the SBI MPXY channel that the SBI
   implementation uses to expose the service group to the supervisor
   ("riscv,rpmi-mpxy-device-power").

 - A generic power domain (genpd) provider driver under
   drivers/pmdomain/riscv/ which talks to the PuC over an SBI MPXY
   mailbox channel. At probe it queries GET_NUM_DOMAINS, then for each
   domain queries GET_ATTRS for the name and transition latency and
   GET_STATE for the initial state, and registers the whole set as a
   onecell genpd provider. Domain power on/off is driven through
   SET_STATE with the generic ON/OFF power state parameters, so devices
   can simply reference a domain through the "power-domains" property.

The series is based on the existing RISC-V RPMI/MPXY infrastructure
already present in the tree (drivers/mailbox/riscv-sbi-mpxy-mbox.c and
include/linux/mailbox/riscv-rpmi-message.h), and only adds the device
power service group definitions on top of it.

Testing
=======

The series was tested under QEMU with the RPMI device power service
implemented in firmware.

Components:

 - OpenSBI: latest master branch
   https://github.com/riscv-software-src/opensbi

 - QEMU: the RPMI-enabled tree at
   https://github.com/yeongjoshua/qemu/tree/rpmi-v11.1.0

Kernel config: enable CONFIG_RISCV_RPMI_DEVICE_POWER (default y on RISC-V
when MAILBOX is enabled) along with the SBI MPXY mailbox driver.

Run with:

  qemu-system-riscv64 \
      -M virt -m 2G -smp 4 \
      -bios fw_dynamic.bin \
      -kernel Image \
      -M rpmi=true \
      -nographic \
      -initrd rootfs-busybox.cpio \
      -append "root=/dev/ram rw console=ttyS0,115200 no_console_suspend mem=2048M earlycon=uart8250,mmio,0x10000000"

The RPMI device power domains advertised by the emulated platform
microcontroller show up as generic power domains and can be inspected
through /sys/kernel/debug/pm_genpd/.

--
2.43.0

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

end of thread, other threads:[~2026-09-02 12:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-29 20:55 [PATCH 0/2] Add RISC-V RPMI device power service support Joshua Yeong
2026-08-29 20:55 ` [PATCH 1/2] dt-bindings: power: Add RPMI device power service bindings Joshua Yeong
2026-08-31 16:41   ` Conor Dooley
2026-09-02 11:34     ` Joshua Yeong
2026-08-29 20:55 ` [PATCH 2/2] pmdomain: riscv: Add RPMI device power service Joshua Yeong
2026-08-29 21:06   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox