[PATCH 0/7] Add support for RPMI to U-Boot
Charles Perry
charles.perry at microchip.com
Fri Jun 26 22:15:41 CEST 2026
Hello,
This series adds support for RISC-V Platform Management Interface (RPMI) to
U-Boot. RPMI is an OS-agnostic protocol for communication between an
Application Processor (AP) and a Platform Microcontroller (PuC) [1]. The
goals and purpose of RPMI are similar to ARM's SCMI.
This patchset first adds an abstraction layer for the transport
(UCLASS_RPMI), then adds two transport layer (SBI MPXY and shared memory)
and finally adds two client, or service group in RPMI jargon: Clock and
device power service groups.
This series also include a sandbox mode for which the RPMI transport
doesn't attach to a firmware but contains a simulation of a firmware. This
reuses code from librpmi [2] to create the message responses.
Apart from the spec [1], this series reuses code from the Linux SBI MPXY
driver [3], OpenSBI shared memory transport [4] and Linux RPMI clock driver
[5].
This was tested on a PIC64-HPSC SoC which features an application cluster
and a system controller with isolated address spaces, hence the need for
RPMI. I've tested the interoperability between RPMI clients and transports
with an S-Mode U-boot (using the MPXY transport) and M-Mode U-Boot (using
shared memory transport) and the following device tree fragment:
```
firmware {
rpmi: mailbox at 7000000000 {
compatible = "riscv,rpmi-shmem-mbox";
reg = <0x70 0x00000000 0x0 0x3000>,
<0x70 0x00003000 0x0 0x3000>,
<0x70 0x00006000 0x0 0x1000>,
<0x70 0x00007000 0x0 0x1000>;
reg-names = "a2p-req", "p2a-ack", "p2a-req", "a2p-ack";
riscv,slot-size = <64>;
#mbox-cells = <1>;
};
ifndef CONFIG_RISCV_MMODE
clock-service {
compatible = "riscv,rpmi-mpxy-clock";
mboxes = <&rpmi 0x8>;
riscv,sbi-mpxy-channel-id = <0x1000>;
};
device-power-service {
compatible = "riscv,rpmi-mpxy-device-power";
mboxes = <&rpmi 0x9>;
riscv,sbi-mpxy-channel-id = <0x1001>;
};
mpxy_mbox: mailbox {
compatible = "riscv,sbi-mpxy-mbox";
#mbox-cells = <2>;
};
endif
sysc_clk: clock-controller {
compatible = "riscv,rpmi-clock";
ifdef CONFIG_RISCV_MMODE
mboxes = <&rpmi 0x8>;
else
mboxes = <&mpxy_mbox 0x1000 0x0>;
endif
#clock-cells = <1>;
};
sysc_dpwr: power-domain-controller {
compatible = "riscv,rpmi-device-power";
ifdef CONFIG_RISCV_MMODE
mboxes = <&rpmi 0x9>;
else
mboxes = <&mpxy_mbox 0x1001 0x0>;
endif
#power-domain-cells = <1>;
};
};
```
[1]: https://github.com/riscv-non-isa/riscv-rpmi
[2]: https://github.com/riscv-software-src/librpmi
[3]: https://elixir.bootlin.com/linux/v7.0.10/source/drivers/mailbox/riscv-sbi-mpxy-mbox.c
[4]: https://elixir.bootlin.com/opensbi/v1.8.1/source/lib/utils/mailbox/fdt_mailbox_rpmi_shmem.c
[5]: https://elixir.bootlin.com/linux/v7.0.10/source/drivers/clk/clk-rpmi.c
Cc: Rahul Pathak <rahul at summations.net>
Cc: Anup Patel <anup at brainfault.org>
Cc: Paul Walmsley <pjw at kernel.org>
Cc: Palmer Dabbelt <palmer at dabbelt.com>
Cc: Albert Ou <aou at eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex at ghiti.fr>
Cc: Romain Caritey <romain.caritey at microchip.com>
Cc: Mame Maria Mbaye <MameMaria.Mbaye at microchip.com>
Cc: Tom Rini <trini at konsulko.com>
Cc: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
Cc: Rick Chen <rick at andestech.com>
Cc: Leo Yu-Chi Liang <ycliang at andestech.com>
Charles Perry (7):
firmware: add support for RPMI
firmware: rpmi: add support for the SBI MPXY transport
firmware: rpmi: add support for shared memory transport
drivers: clk: add support for RPMI clocks
drivers: power: add support for RPMI power domains
firmware: rpmi: add a test and a sandbox driver
firmware: rpmi: add a test and sandbox for device power
MAINTAINERS | 9 +
arch/riscv/include/asm/sbi.h | 57 +++
arch/sandbox/dts/test.dts | 23 +
configs/sandbox_defconfig | 3 +
drivers/clk/Kconfig | 7 +
drivers/clk/Makefile | 1 +
drivers/clk/clk_rpmi.c | 346 +++++++++++++++
drivers/firmware/Kconfig | 1 +
drivers/firmware/Makefile | 1 +
drivers/firmware/rpmi/Kconfig | 27 ++
drivers/firmware/rpmi/Makefile | 4 +
drivers/firmware/rpmi/rpmi-sandbox-clock.c | 446 +++++++++++++++++++
drivers/firmware/rpmi/rpmi-sandbox-power.c | 174 ++++++++
drivers/firmware/rpmi/rpmi-sandbox.c | 158 +++++++
drivers/firmware/rpmi/rpmi-sandbox.h | 48 +++
drivers/firmware/rpmi/rpmi-sbi-mpxy.c | 449 +++++++++++++++++++
drivers/firmware/rpmi/rpmi-shmem.c | 474 +++++++++++++++++++++
drivers/firmware/rpmi/rpmi-uclass.c | 138 ++++++
drivers/power/domain/Kconfig | 7 +
drivers/power/domain/Makefile | 1 +
drivers/power/domain/rpmi-power-domain.c | 229 ++++++++++
include/dm/uclass-id.h | 1 +
include/rpmi-uclass.h | 79 ++++
include/rpmi.h | 159 +++++++
include/rpmi_proto.h | 143 +++++++
test/dm/Makefile | 1 +
test/dm/rpmi.c | 69 +++
27 files changed, 3055 insertions(+)
create mode 100644 drivers/clk/clk_rpmi.c
create mode 100644 drivers/firmware/rpmi/Kconfig
create mode 100644 drivers/firmware/rpmi/Makefile
create mode 100644 drivers/firmware/rpmi/rpmi-sandbox-clock.c
create mode 100644 drivers/firmware/rpmi/rpmi-sandbox-power.c
create mode 100644 drivers/firmware/rpmi/rpmi-sandbox.c
create mode 100644 drivers/firmware/rpmi/rpmi-sandbox.h
create mode 100644 drivers/firmware/rpmi/rpmi-sbi-mpxy.c
create mode 100644 drivers/firmware/rpmi/rpmi-shmem.c
create mode 100644 drivers/firmware/rpmi/rpmi-uclass.c
create mode 100644 drivers/power/domain/rpmi-power-domain.c
create mode 100644 include/rpmi-uclass.h
create mode 100644 include/rpmi.h
create mode 100644 include/rpmi_proto.h
create mode 100644 test/dm/rpmi.c
--
2.47.3
More information about the U-Boot
mailing list