Add support for RPMI to U-Boot
Subsystems (2)
v2 cover Add support for RPMI to U-Boot
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 one client or service group in RPMI jargon: the clock service group.
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@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>;
};
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>;
};
```[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
Changes in v2:
- Drop the device-power service group as the DT bindings for it are not mainlined (was patch 5 and 7).
- Reorder headers in all .c files.
- Don't null check pointers before free().
- Improve error messages in rpmi_check_versions() (patch 1).
- Remove struct sbi_mpxy_rpmi_channel_attrs and struct sbi_mpxy_channel_attrs for simpler u32 arrays (patch 2).
- Remove transition_latency from struct rpmi_clk_def as it's unused (patch 4).
- Simplify last return path of _rpmi_clk_enable_disable() (patch 4).
- Move the call to _rpmi_clk_get_rate() from _rpmi_clk_set_rate() to rpmi_clk_set_rate() (patch 4).
Charles Perry (5):
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
firmware: rpmi: add a test and a sandbox driver
MAINTAINERS | 8 + arch/riscv/include/asm/sbi.h | 57 +++ arch/sandbox/dts/test.dts | 12 + configs/sandbox_defconfig | 2 + drivers/clk/Kconfig | 7 + drivers/clk/Makefile | 1 + drivers/clk/clk_rpmi.c | 344 +++++++++++++++ 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.c | 156 +++++++ drivers/firmware/rpmi/rpmi-sandbox.h | 47 ++ drivers/firmware/rpmi/rpmi-sbi-mpxy.c | 410 ++++++++++++++++++ drivers/firmware/rpmi/rpmi-shmem.c | 473 +++++++++++++++++++++ drivers/firmware/rpmi/rpmi-uclass.c | 144 +++++++ include/dm/uclass-id.h | 1 + include/rpmi-uclass.h | 79 ++++ include/rpmi.h | 159 +++++++ include/rpmi_proto.h | 125 ++++++ test/dm/Makefile | 1 + test/dm/rpmi.c | 48 +++ 23 files changed, 2553 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.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 include/rpmi-uclass.h create mode 100644 include/rpmi.h create mode 100644 include/rpmi_proto.h create mode 100644 test/dm/rpmi.c
Signature · 1 line
2.47.3
PATCH v2 1/5 firmware: add support for RPMI
RISC-V Platform Management Interface (RPMI) defines an OS-agnostic protocol for communication between an Application Processor (AP) and a platform microcontroller (PuC) [1]
Add UCLASS_RPMI to abstract the implementation details of an RPMI transport layer. A transport driver should implement the struct rpmi_transport_ops callback interface while an RPMI client driver should use struct rpmi_chan and the rpmi_* API:
* rpmi_get_by_index()
* rpmi_open()
* rpmi_close()
* rpmi_get_attr()
* rpmi_send_with_resp()
* rpmi_send_posted()
The most important part of the API is rpmi_send_with_resp() and rpmi_send_posted() which is used to send a message and possibly receive a response from the firmware.
rpmi_get_attr() can be used to retrieve attributes of the channel like the implementation ID or the maximum message size. This is to retrieve information that lives outside of the service group of the rpmi_chan, either in the "base service group" or in the transport layer itself.
rpmi_get_by_index() can be used to initialize a struct rpmi_chan using info from the device tree.
rpmi_open() and rpmi_close() must be called once at initialization and deinitialization by clients to let the transport layer do some stateful things if needed.
A helper function is also added: rpmi_check_versions() which is just a wrapper around rpmi_get_attr() to do some basic version checking that all clients should perform.
[1]: https://github.com/riscv-non-isa/riscv-rpmi
---
Changes in v2: (from Yao Zi review)
- Reorder headers
- Improve error messages in rpmi_check_versions()
--- MAINTAINERS | 6 ++ drivers/firmware/Kconfig | 1 + drivers/firmware/Makefile | 1 + drivers/firmware/rpmi/Kconfig | 9 ++ drivers/firmware/rpmi/Makefile | 1 + drivers/firmware/rpmi/rpmi-uclass.c | 144 +++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/rpmi-uclass.h | 79 ++++++++++++++ include/rpmi.h | 159 ++++++++++++++++++++++++++++ include/rpmi_proto.h | 63 +++++++++++ 10 files changed, 464 insertions(+) create mode 100644 drivers/firmware/rpmi/Kconfig create mode 100644 drivers/firmware/rpmi/Makefile create mode 100644 drivers/firmware/rpmi/rpmi-uclass.c create mode 100644 include/rpmi-uclass.h create mode 100644 include/rpmi.h create mode 100644 include/rpmi_proto.h
MAINTAINERS +6 -0
@@ -1651,6 +1651,12 @@ F: drivers/usb/gadget/f_rockusb.c F: cmd/rockusb.c F: doc/README.rockusb +RPMI +M: Charles Perry <[email protected]> +S: Maintained +F: drivers/firmware/rpmi/ +F: include/rpmi* + SANDBOX M: Simon Glass <[email protected]> S: Maintained
drivers/firmware/Kconfig +1 -0
@@ -49,3 +49,4 @@ config ARM_SMCCC_FEATURES source "drivers/firmware/arm-ffa/Kconfig" source "drivers/firmware/scmi/Kconfig" +source "drivers/firmware/rpmi/Kconfig"
drivers/firmware/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o obj-$(CONFIG_SANDBOX) += firmware-sandbox.o obj-$(CONFIG_ZYNQMP_FIRMWARE) += firmware-zynqmp.o obj-$(CONFIG_SCMI_FIRMWARE) += scmi/ +obj-$(CONFIG_RPMI_FIRMWARE) += rpmi/
drivers/firmware/rpmi/Kconfig new file +9 -0
@@ -0,0 +1,9 @@ +config RPMI_FIRMWARE + bool "Enable RPMI support" + depends on RISCV && DM && OF_CONTROL + select FIRMWARE + help + RISC-V Platform Management Interface (RPMI) defines an OS-agnostic + protocol for communication between an Application Processor (AP) and a + platform microcontroller (PuC). The RPMI specification is available + at: https://github.com/riscv-non-isa/riscv-rpmi
drivers/firmware/rpmi/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += rpmi-uclass.o
drivers/firmware/rpmi/rpmi-uclass.c new file +144 -0
144 lines not on this page · raw message
include/dm/uclass-id.h +1 -0
@@ -128,6 +128,7 @@ enum uclass_id {UCLASS_RESET ,/* Reset controller device */ UCLASS_RKMTD ,/* Rockchip MTD device */ UCLASS_RNG ,/* Random Number Generator */ +UCLASS_RPMI ,/* RPMI transport */ UCLASS_RTC ,/* Real time clock device */ UCLASS_SCMI_AGENT ,/* Interface with an SCMI server */ UCLASS_SCMI_BASE, /* Interface for SCMI Base protocol */
include/rpmi-uclass.h new file +79 -0
79 lines not on this page · raw message
include/rpmi.h new file +159 -0
159 lines not on this page · raw message
include/rpmi_proto.h new file +63 -0
63 lines not on this page · raw message
Signature · 1 line
2.47.3
PATCH v2 2/5 firmware: rpmi: add support for the SBI MPXY transport
In reply to Charles PerryThis adds an RPMI transport driver for the Supervisor Binary Interface (SBI) message proxy (MPXY) extension [1].
This is for S-Mode U-Boot where some supervisor software (such as OpenSBI) runs in M-Mode and handles the low level communication with the PuC.
[1]: https://github.com/riscv-non-isa/riscv-sbi-doc (chapter 20)
---
Changes in v2: (from Yao Zi review)
- Reorder headers
- Remove struct sbi_mpxy_rpmi_channel_attrs and struct sbi_mpxy_channel_attrs for simpler u32 arrays
- Don't null check pointers before free()
--- arch/riscv/include/asm/sbi.h | 57 ++++ drivers/firmware/rpmi/Kconfig | 9 + drivers/firmware/rpmi/Makefile | 1 + drivers/firmware/rpmi/rpmi-sbi-mpxy.c | 410 ++++++++++++++++++++++++++ 4 files changed, 477 insertions(+) create mode 100644 drivers/firmware/rpmi/rpmi-sbi-mpxy.c
arch/riscv/include/asm/sbi.h +57 -0
@@ -10,6 +10,7 @@#define _ASM_RISCV_SBI_H#include <linux/types.h> +#include <linux/errno.h> enum sbi_ext_id {SBI_EXT_0_1_SET_TIMER =0x0 ,
@@ -104,6 +105,17 @@ enum sbi_ext_dbcn_fid { SBI_EXT_DBCN_CONSOLE_WRITE_BYTE, }; +enum sbi_ext_mpxy_fid { +SBI_EXT_MPXY_GET_SHMEM_SIZE =0 , +SBI_EXT_MPXY_SET_SHMEM , +SBI_EXT_MPXY_GET_CHANNEL_IDS , +SBI_EXT_MPXY_READ_ATTRS , +SBI_EXT_MPXY_WRITE_ATTRS , +SBI_EXT_MPXY_SEND_MSG_WITH_RESP , +SBI_EXT_MPXY_SEND_MSG_WITHOUT_RESP , +SBI_EXT_MPXY_GET_NOTIFICATION_EVENTS , +}; +#ifdef CONFIG_SBI_V01 #define SBI_EXT_SET_TIMER SBI_EXT_0_1_SET_TIMER#define SBI_FID_SET_TIMER 0
@@ -132,6 +144,14 @@ enum sbi_ext_dbcn_fid {#define SBI_SPEC_VERSION_MAJOR_MASK 0x7f#define SBI_SPEC_VERSION_MINOR_MASK 0xffffff +static inline unsigned long sbi_mk_version (unsigned long major, +unsigned long minor) +{ +return ((major &SBI_SPEC_VERSION_MAJOR_MASK ) + <<SBI_SPEC_VERSION_MAJOR_SHIFT ) | + (minor &SBI_SPEC_VERSION_MINOR_MASK ); +} +/* SBI return error codes */ #define SBI_SUCCESS 0#define SBI_ERR_FAILURE -1
@@ -139,6 +159,43 @@ enum sbi_ext_dbcn_fid {#define SBI_ERR_INVALID_PARAM -3#define SBI_ERR_DENIED -4#define SBI_ERR_INVALID_ADDRESS -5 +#define SBI_ERR_ALREADY_AVAILABLE -6 +#define SBI_ERR_ALREADY_STARTED -7 +#define SBI_ERR_ALREADY_STOPPED -8 +#define SBI_ERR_NO_SHMEM -9 +#define SBI_ERR_INVALID_STATE -10 +#define SBI_ERR_BAD_RANGE -11 +#define SBI_ERR_TIMEOUT -12 +#define SBI_ERR_IO -13 +#define SBI_ERR_DENIED_LOCKED -14 + +static inline int sbi_to_linux_error (int err) +{ +switch (err) { +case SBI_SUCCESS : +return 0 ; +case SBI_ERR_DENIED : +case SBI_ERR_DENIED_LOCKED : +return -EPERM ; +case SBI_ERR_INVALID_PARAM : +case SBI_ERR_INVALID_STATE : +return -EINVAL ; +case SBI_ERR_BAD_RANGE : +return -ERANGE ; +case SBI_ERR_INVALID_ADDRESS : +return -EFAULT ; +case SBI_ERR_NO_SHMEM : +return -ENOMEM ; +case SBI_ERR_TIMEOUT : +return -ETIMEDOUT ; +case SBI_ERR_IO : +return -EIO ; +case SBI_ERR_NOT_SUPPORTED : +case SBI_ERR_FAILURE : +default : +return -EOPNOTSUPP ; + }; +}struct sbiret {long error;
drivers/firmware/rpmi/Kconfig +9 -0
@@ -7,3 +7,12 @@ config RPMI_FIRMWARE protocol for communication between an Application Processor (AP) and a platform microcontroller (PuC). The RPMI specification is available at: https://github.com/riscv-non-isa/riscv-rpmi + +config RPMI_SBI_MPXY + bool "RPMI over SBI MPXY transport" + depends on RPMI_FIRMWARE && SBI + help + Enable support for transport of RPMI messages over the message proxy + (MPXY) extension of the supervisor binary interface (SBI). The + specification for the MPXY extension is available at: + https://github.com/riscv-non-isa/riscv-sbi-doc (chapter 20)
drivers/firmware/rpmi/Makefile +1 -0
@@ -1 +1,2 @@ obj-y += rpmi-uclass.o +obj-$(CONFIG_RPMI_SBI_MPXY) += rpmi-sbi-mpxy.o
drivers/firmware/rpmi/rpmi-sbi-mpxy.c new file +410 -0
410 lines not on this page · raw message
Signature · 1 line
2.47.3
PATCH v2 3/5 firmware: rpmi: add support for shared memory transport
In reply to Charles PerryAdd support for transport of RPMI messages over shared memory as described in the RPMI spec [1]. This uses two or four ring buffers composed of a fixed number of "slots" to pass messages between the AP and the PuC. U-Boot is the Application processor (AP) and sends messages through the a2p-req queue and receives response though the p2a-ack queue. There is no support for platform microcontroller (PuC) initiated requests nor notifications.
This transport can be used in M or S mode U-Boot, but in the S-mode case, one must make sure that the supervisor software isn't already using the AP side of the shared memory.
[1]: https://github.com/riscv-non-isa/riscv-rpmi (chapter 2)
---
Changes in v2: (from Yao Zi review)
- Reorder headers
- Don't null check pointers before free()
--- drivers/firmware/rpmi/Kconfig | 8 + drivers/firmware/rpmi/Makefile | 1 + drivers/firmware/rpmi/rpmi-shmem.c | 473 +++++++++++++++++++++++++++++ include/rpmi_proto.h | 23 ++ 4 files changed, 505 insertions(+) create mode 100644 drivers/firmware/rpmi/rpmi-shmem.c
drivers/firmware/rpmi/Kconfig +8 -0
@@ -16,3 +16,11 @@ config RPMI_SBI_MPXY (MPXY) extension of the supervisor binary interface (SBI). The specification for the MPXY extension is available at: https://github.com/riscv-non-isa/riscv-sbi-doc (chapter 20) + +config RPMI_SHMEM + bool "RPMI over shared memory transport" + depends on RPMI_FIRMWARE + help + Enable support for transport of RPMI messages over shared memory as + described in chapter 2 of the RPMI specification, available at: + https://github.com/riscv-non-isa/riscv-rpmi
drivers/firmware/rpmi/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-y += rpmi-uclass.o obj-$(CONFIG_RPMI_SBI_MPXY) += rpmi-sbi-mpxy.o +obj-$(CONFIG_RPMI_SHMEM) += rpmi-shmem.o
drivers/firmware/rpmi/rpmi-shmem.c new file +473 -0
473 lines not on this page · raw message
include/rpmi_proto.h +23 -0
@@ -60,4 +60,27 @@ enum rpmi_servicegroup_id { RPMI_SRVGRP_VENDOR_END = 0xFFFF, }; +/** RPMI Base ServiceGroup Service IDs */ +enum rpmi_base_service_id { +RPMI_BASE_SRV_ENABLE_NOTIFICATION =0x01 , +RPMI_BASE_SRV_GET_IMPLEMENTATION_VERSION =0x02 , +RPMI_BASE_SRV_GET_IMPLEMENTATION_IDN =0x03 , +RPMI_BASE_SRV_GET_SPEC_VERSION =0x04 , +RPMI_BASE_SRV_GET_PLATFORM_INFO =0x05 , +RPMI_BASE_SRV_PROBE_SERVICE_GROUP =0x06 , +RPMI_BASE_SRV_GET_ATTRIBUTES =0x07 , +}; + +/** RPMI Messages Types */ +enum rpmi_message_type { +/* Normal request backed with ack */ +RPMI_MSG_NORMAL_REQUEST =0x0 , +/* Request without any ack */ +RPMI_MSG_POSTED_REQUEST =0x1 , +/* Acknowledgment for normal request message */ +RPMI_MSG_ACKNOWLDGEMENT =0x2 , +/* Notification message */ +RPMI_MSG_NOTIFICATION =0x3 , +}; +#endif
Signature · 1 line
2.47.3
PATCH v2 4/5 drivers: clk: add support for RPMI clocks
In reply to Charles PerryThe RISC-V Platform Management Interface (RPMI) defines a service group for control and monitoring of clocks [1]. This can be exposed as a UCLASS_CLK driver.
[1]: https://github.com/riscv-non-isa/riscv-rpmi (chapter 4.8)
---
Changes in v2: (from Yao Zi review)
- Reorder headers
- Don't null check pointers before free()
- Remove transition_latency from struct rpmi_clk_def as its unused
- Simplify last return path of _rpmi_clk_enable_disable()
- Move the call to _rpmi_clk_get_rate() from _rpmi_clk_set_rate() to rpmi_clk_set_rate()
--- MAINTAINERS | 1 + drivers/clk/Kconfig | 7 + drivers/clk/Makefile | 1 + drivers/clk/clk_rpmi.c | 344 +++++++++++++++++++++++++++++++++++++++++ include/rpmi_proto.h | 39 +++++ 5 files changed, 392 insertions(+) create mode 100644 drivers/clk/clk_rpmi.c
MAINTAINERS +1 -0
@@ -1654,6 +1654,7 @@ F: doc/README.rockusb RPMI M: Charles Perry <[email protected]> S: Maintained +F: drivers/clk/clk_rpmi.c F: drivers/firmware/rpmi/ F: include/rpmi*
drivers/clk/Kconfig +7 -0
@@ -181,6 +181,13 @@ config CLK_OCTEON help Enable this to support the clocks on Octeon MIPS platforms. +config CLK_RPMI + bool "Enable RPMI clock driver" + depends on CLK && RPMI_FIRMWARE + help + Enable this option if you want to support clock devices exposed + by RISC-V Platform Management Interface (RPMI). + config SANDBOX_CLK_CCF bool "Sandbox Common Clock Framework [CCF] support" depends on SANDBOX
drivers/clk/Makefile +1 -0
@@ -45,6 +45,7 @@ obj-$(CONFIG_CLK_OCTEON) += clk_octeon.o obj-$(CONFIG_CLK_OWL) += owl/ obj-$(CONFIG_CLK_QCOM) += qcom/ obj-$(CONFIG_CLK_RENESAS) += renesas/ +obj-$(CONFIG_CLK_RPMI) += clk_rpmi.o obj-$(CONFIG_$(PHASE_)CLK_SCMI) += clk_scmi.o obj-$(CONFIG_CLK_SIFIVE) += sifive/ obj-$(CONFIG_CLK_SOPHGO) += sophgo/
drivers/clk/clk_rpmi.c new file +344 -0
344 lines not on this page · raw message
include/rpmi_proto.h +39 -0
@@ -83,4 +83,43 @@ enum rpmi_message_type { RPMI_MSG_NOTIFICATION = 0x3, }; +/* RPMI clock service IDs */ +enum rpmi_clock_service_id { +RPMI_CLK_SRV_ENABLE_NOTIFICATION =0x01 , +RPMI_CLK_SRV_GET_NUM_CLOCKS =0x02 , +RPMI_CLK_SRV_GET_ATTRIBUTES =0x03 , +RPMI_CLK_SRV_GET_SUPPORTED_RATES =0x04 , +RPMI_CLK_SRV_SET_CONFIG =0x05 , +RPMI_CLK_SRV_GET_CONFIG =0x06 , +RPMI_CLK_SRV_SET_RATE =0x07 , +RPMI_CLK_SRV_GET_RATE =0x08 , +RPMI_CLK_SRV_ID_MAX_COUNT +}; + +/** Clock rate match mode */ +enum rpmi_clock_rate_match { +RPMI_CLK_RATE_MATCH_PLATFORM =0 , +RPMI_CLK_RATE_MATCH_ROUND_DOWN =1 , +RPMI_CLK_RATE_MATCH_ROUND_UP =2 , +RPMI_CLK_RATE_MATCH_MAX +}; + +/** Supported clock states */ +enum rpmi_clock_state { +RPMI_CLK_STATE_DISABLED =0 , +RPMI_CLK_STATE_ENABLED =1 , +RPMI_CLK_STATE_MAX +}; + +/** Clock type based on rate format */ +enum rpmi_clock_type { +RPMI_CLK_TYPE_DISCRETE =0 , +RPMI_CLK_TYPE_LINEAR =1 , +RPMI_CLK_TYPE_MAX +}; + +#define RPMI_CLK_NAME_LEN 16 + +#define RPMI_CLOCK_RATE_INVALID (-1ULL) +#endif
Signature · 1 line
2.47.3
PATCH v2 5/5 firmware: rpmi: add a test and a sandbox driver
In reply to Charles PerryCreate a new transport layer that sends the messages to a simulated RPMI firmware.
For now, this only contains a simulation of the clock service group which is implemented using code from librpmi [1] and adapted.
Also add a test in test/dm that makes use of the RPMI clock driver.
---
Changes in v2:
- Reorder headers
--- MAINTAINERS | 1 + arch/sandbox/dts/test.dts | 12 + configs/sandbox_defconfig | 2 + drivers/firmware/rpmi/Kconfig | 3 +- drivers/firmware/rpmi/Makefile | 1 + drivers/firmware/rpmi/rpmi-sandbox-clock.c | 446 +++++++++++++++++++++ drivers/firmware/rpmi/rpmi-sandbox.c | 156 +++++++ drivers/firmware/rpmi/rpmi-sandbox.h | 47 +++ test/dm/Makefile | 1 + test/dm/rpmi.c | 48 +++ 10 files changed, 716 insertions(+), 1 deletion(-) create mode 100644 drivers/firmware/rpmi/rpmi-sandbox-clock.c create mode 100644 drivers/firmware/rpmi/rpmi-sandbox.c create mode 100644 drivers/firmware/rpmi/rpmi-sandbox.h create mode 100644 test/dm/rpmi.c
MAINTAINERS +1 -0
@@ -1657,6 +1657,7 @@ S: Maintained F: drivers/clk/clk_rpmi.c F: drivers/firmware/rpmi/ F: include/rpmi* +F: test/dm/rpmi.c SANDBOX M: Simon Glass <[email protected]>
arch/sandbox/dts/test.dts +12 -0
@@ -874,6 +874,18 @@ sm: secure-monitor { compatible = "sandbox,sm"; }; + + rpmi: rpmi { + compatible = "sandbox,rpmi-transport"; + #mbox-cells = <1>; + }; + + rpmi_clock: rpmi-clock { + compatible = "riscv,rpmi-clock"; + mboxes = <&rpmi 0x8>; + #clock-cells = <1>; + clocks = <&rpmi_clock 0>, <&rpmi_clock 1>, <&rpmi_clock 2>, <&rpmi_clock 3>; + }; }; fpga {
configs/sandbox_defconfig +2 -0
@@ -194,6 +194,7 @@ CONFIG_BUTTON_GPIO=y CONFIG_CLK=y CONFIG_CLK_K210=y CONFIG_CLK_K210_SET_RATE=y +CONFIG_CLK_RPMI=y CONFIG_SANDBOX_CLK_CCF=y CONFIG_CLK_SCMI=y CONFIG_CPU=y
@@ -210,6 +211,7 @@ CONFIG_FASTBOOT_FLASH=y CONFIG_FASTBOOT_FLASH_MMC_DEV=0 CONFIG_ARM_FFA_TRANSPORT=y CONFIG_SCMI_FIRMWARE=y +CONFIG_RPMI_FIRMWARE=y CONFIG_FPGA_ALTERA=y CONFIG_FPGA_STRATIX_II=y CONFIG_FPGA_STRATIX_V=y
drivers/firmware/rpmi/Kconfig +2 -1
@@ -1,6 +1,7 @@ config RPMI_FIRMWARE bool "Enable RPMI support" - depends on RISCV && DM && OF_CONTROL + depends on RISCV || SANDBOX + depends on DM && OF_CONTROL select FIRMWARE help RISC-V Platform Management Interface (RPMI) defines an OS-agnostic
drivers/firmware/rpmi/Makefile +1 -0
@@ -1,3 +1,4 @@ obj-y += rpmi-uclass.o obj-$(CONFIG_RPMI_SBI_MPXY) += rpmi-sbi-mpxy.o obj-$(CONFIG_RPMI_SHMEM) += rpmi-shmem.o +obj-$(CONFIG_SANDBOX) += rpmi-sandbox.o rpmi-sandbox-clock.o
drivers/firmware/rpmi/rpmi-sandbox-clock.c new file +446 -0
446 lines not on this page · raw message
drivers/firmware/rpmi/rpmi-sandbox.c new file +156 -0
156 lines not on this page · raw message
drivers/firmware/rpmi/rpmi-sandbox.h new file +47 -0
47 lines not on this page · raw message
test/dm/Makefile +1 -0
@@ -109,6 +109,7 @@ obj-$(CONFIG_CMD_RKMTD) += rkmtd.o obj-$(CONFIG_$(PHASE_)DM_RNG) += rng.o obj-$(CONFIG_DM_RTC) += rtc.o obj-$(CONFIG_SCMI_FIRMWARE) += scmi.o +obj-$(CONFIG_RPMI_FIRMWARE) += rpmi.o obj-$(CONFIG_SCSI) += scsi.o obj-$(CONFIG_DM_SERIAL) += serial.o obj-$(CONFIG_DM_SPI_FLASH) += sf.o
test/dm/rpmi.c new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
2.47.3
Quoted 6 lines · Charles Perry
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.
From the first look it looks like SCMI. Why do you introducing something what can be replaced by SCMI? And SCMI has only specific ARM transport layer but the rest is arch independent.
In our case where we have Microblaze V in programmable logic I can't see any reason to use RPMI for talking to the same server if I need to do it from ARM side too via SCMI.
I pretty much think that there should be communication with ARM and instead of creating another firmware interface talk to each other and have only one which can be used across multiple architectures.
Thanks,
Michal
Quoted 14 lines · Michal Simek
Quoted 6 lines · Charles Perry
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.
From the first look it looks like SCMI. Why do you introducing
something what can be replaced by SCMI?
And SCMI has only specific ARM transport layer but the rest is arch independent.
Quoted 6 lines
In our case where we have Microblaze V in programmable logic I can't see any reason to use RPMI for talking to the same server if I need to do it from ARM side too via SCMI.
I pretty much think that there should be communication with ARM and instead of creating another firmware interface talk to each other and have only one which can be used across multiple architectures.
Thanks,
Michal
Hello Michal,
The specifications for RISC-V are produced by RISC-V International. AMD is a strategic member. Please, join the relevant technical groups to collaborate on specifications.
RISC-V has defined the Supervisor Binary Interface (SBI) specification which is available at https://github.com/riscv-non-isa/riscv-sbi-doc/releases/download/v3.0/riscv-sbi.pdf.
The Message Proxy (MPXY) extension defines how communication channels between different parts of software can be established.
RPMI is one of the defined messaging protocols. The ratified specification is available at https://github.com/riscv-non-isa/riscv-rpmi/releases/download/v1.0/riscv-rpmi.pdf.
Best regards
Heinrich
Quoted 5 lines · Michal Simek
Quoted 2 lines · Charles Perry
Hello,
Quoted 8 lines
Quoted 4 lines
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.
From the first look it looks like SCMI. Why do you introducing something what can be replaced by SCMI?
And SCMI has only specific ARM transport layer but the rest is arch independent.
Yes, there are alot of similarities between RPMI and SCMI. I found some justification for this in some Linux Plumbers slide deck on RISC-V power management by Paul Walmsley [1]:
* The hardware is more sophisticated
* The software is more sophisticated
* Some stakeholders haven’t had input in the past
* RISC-V “big tent” philosophy
I think this is referring to the SBI spec of RISC-V vs arm's PSCI but the same arguments may as well apply to RPMI vs SCMI.
Some other arguments:
* The microcontroller side is made easier with RPMI because of librpmi [2]. SCMI has SCP-firmware [3] which is a quite complex project compared to librpmi. Also SCP-firmware doesn't accept contribution anymore.
* RPMI is already in Linux.
For what I'm doing, RPMI is what gave me the first results (controlling clocks) the quickest because all the pieces were present in Linux, OpenSBI and librpmi. There are however lots of missing service drivers in Linux and some other important OS like u-boot don't have support for RPMI at all. So even though I gave you a bunch of reason for saying yes to RPMI, I do have some doubt about how long it will take to bring RPMI on par with SCMI, making the SCMI-for-RISCV transport that you suggest more appealing.
[1]: https://lpc.events/event/2/contributions/197/attachments/133/165/RISC-V_Platform_Power_Management.pdf (slide 22) [2]: https://github.com/riscv-software-src/librpmi
[3]: https://gitlab.arm.com/firmware/SCP-firmware
Quoted 11 lines
In our case where we have Microblaze V in programmable logic I can't see any reason to use RPMI for talking to the same server if I need to do it from ARM side too via SCMI.
I pretty much think that there should be communication with ARM and instead of creating another firmware interface talk to each other and have only one which can be used across multiple architectures.
Thanks,
Michal
Thanks,
Charles
Quoted 42 lines · Charles Perry
Quoted 5 lines · Michal Simek
Quoted 2 lines · Charles Perry
Hello,
Quoted 8 lines
Quoted 4 lines
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.
From the first look it looks like SCMI. Why do you introducing something
what can be replaced by SCMI?
And SCMI has only specific ARM transport layer but the rest is arch independent.Yes, there are alot of similarities between RPMI and SCMI. I found some justification for this in some Linux Plumbers slide deck on RISC-V power management by Paul Walmsley [1]:
* The hardware is more sophisticated
* The software is more sophisticated
* Some stakeholders haven’t had input in the past
* RISC-V “big tent” philosophyI think this is referring to the SBI spec of RISC-V vs arm's PSCI but the same arguments may as well apply to RPMI vs SCMI.
Some other arguments:
* The microcontroller side is made easier with RPMI because of librpmi [2]. SCMI has SCP-firmware [3] which is a quite complex project compared to librpmi. Also SCP-firmware doesn't accept contribution anymore.
* RPMI is already in Linux.For what I'm doing, RPMI is what gave me the first results (controlling clocks) the quickest because all the pieces were present in Linux, OpenSBI and librpmi. There are however lots of missing service drivers in Linux and some other important OS like u-boot don't have support for RPMI at all. So even though I gave you a bunch of reason for saying yes to RPMI, I do have some doubt about how long it will take to bring RPMI on par with SCMI, making the SCMI-for-RISCV transport that you suggest more appealing.
Quoted 12 lines
[1]: https://lpc.events/event/2/contributions/197/attachments/133/165/RISC-V_Platform_Power_Management.pdf (slide 22) [2]: https://github.com/riscv-software-src/librpmi
[3]: https://gitlab.arm.com/firmware/SCP-firmwareQuoted 8 lines
In our case where we have Microblaze V in programmable logic I can't see any reason to use RPMI for talking to the same server if I need to do it from ARM side too via SCMI.
I pretty much think that there should be communication with ARM and instead of creating another firmware interface talk to each other and have only one which can be used across multiple architectures.
I have sent RFC patch to eliminate ARM from SCMI here
and feedback is quite positive. I think it is more or less question to Microchip if you want to take responsibility on another firmware interface (I understand that it is approved, etc) or just use what it is around for longer time.
Thanks,
Michal
Quoted 58 lines · Michal Simek
Quoted 42 lines · Charles Perry
Quoted 5 lines · Michal Simek
Quoted 2 lines · Charles Perry
Hello,
Quoted 8 lines
Quoted 4 lines
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.
From the first look it looks like SCMI. Why do you introducing something
what can be replaced by SCMI?
And SCMI has only specific ARM transport layer but the rest is arch independent.Yes, there are alot of similarities between RPMI and SCMI. I found some justification for this in some Linux Plumbers slide deck on RISC-V power management by Paul Walmsley [1]:
* The hardware is more sophisticated
* The software is more sophisticated
* Some stakeholders haven’t had input in the past
* RISC-V “big tent” philosophyI think this is referring to the SBI spec of RISC-V vs arm's PSCI but the same arguments may as well apply to RPMI vs SCMI.
Some other arguments:
* The microcontroller side is made easier with RPMI because of librpmi [2]. SCMI has SCP-firmware [3] which is a quite complex project compared to librpmi. Also SCP-firmware doesn't accept contribution anymore.
* RPMI is already in Linux.For what I'm doing, RPMI is what gave me the first results (controlling clocks) the quickest because all the pieces were present in Linux, OpenSBI and librpmi. There are however lots of missing service drivers in Linux and some other important OS like u-boot don't have support for RPMI at all. So even though I gave you a bunch of reason for saying yes to RPMI, I do have some doubt about how long it will take to bring RPMI on par with SCMI, making the SCMI-for-RISCV transport that you suggest more appealing.
Quoted 12 lines
[1]: https://lpc.events/event/2/contributions/197/attachments/133/165/RISC-V_Platform_Power_Management.pdf (slide 22) [2]: https://github.com/riscv-software-src/librpmi
[3]: https://gitlab.arm.com/firmware/SCP-firmwareQuoted 8 lines
In our case where we have Microblaze V in programmable logic I can't see any reason to use RPMI for talking to the same server if I need to do it from ARM side too via SCMI.
I pretty much think that there should be communication with ARM and instead of creating another firmware interface talk to each other and have only one which can be used across multiple architectures.
Quoted 8 lines
I have sent RFC patch to eliminate ARM from SCMI here
and feedback is quite positive. I think it is more or less question to Microchip if you want to take responsibility on another firmware interface (I understand that it is approved, etc) or just use what it is around for longer time.
I don't think it is a question to just Microchip, it's a question to be asked to all the various companies and projects using RISC-V. For example will upstream OpenSBI accept support for SCMI, or will they say "we have RPMI, use that"?
Quoted 69 lines · Conor Dooley
Quoted 58 lines · Michal Simek
Quoted 42 lines · Charles Perry
Quoted 5 lines · Michal Simek
Quoted 2 lines · Charles Perry
Hello,
Quoted 8 lines
Quoted 4 lines
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.
From the first look it looks like SCMI. Why do you introducing something
what can be replaced by SCMI?
And SCMI has only specific ARM transport layer but the rest is arch independent.Yes, there are alot of similarities between RPMI and SCMI. I found some justification for this in some Linux Plumbers slide deck on RISC-V power management by Paul Walmsley [1]:
* The hardware is more sophisticated
* The software is more sophisticated
* Some stakeholders haven’t had input in the past
* RISC-V “big tent” philosophyI think this is referring to the SBI spec of RISC-V vs arm's PSCI but the same arguments may as well apply to RPMI vs SCMI.
Some other arguments:
* The microcontroller side is made easier with RPMI because of librpmi [2]. SCMI has SCP-firmware [3] which is a quite complex project compared to librpmi. Also SCP-firmware doesn't accept contribution anymore.
* RPMI is already in Linux.For what I'm doing, RPMI is what gave me the first results (controlling clocks) the quickest because all the pieces were present in Linux, OpenSBI and librpmi. There are however lots of missing service drivers in Linux and some other important OS like u-boot don't have support for RPMI at all. So even though I gave you a bunch of reason for saying yes to RPMI, I do have some doubt about how long it will take to bring RPMI on par with SCMI, making the SCMI-for-RISCV transport that you suggest more appealing.
Quoted 12 lines
[1]: https://lpc.events/event/2/contributions/197/attachments/133/165/RISC-V_Platform_Power_Management.pdf (slide 22) [2]: https://github.com/riscv-software-src/librpmi
[3]: https://gitlab.arm.com/firmware/SCP-firmwareQuoted 8 lines
In our case where we have Microblaze V in programmable logic I can't see any reason to use RPMI for talking to the same server if I need to do it from ARM side too via SCMI.
I pretty much think that there should be communication with ARM and instead of creating another firmware interface talk to each other and have only one which can be used across multiple architectures.
Quoted 8 lines
I have sent RFC patch to eliminate ARM from SCMI here
and feedback is quite positive. I think it is more or less question to Microchip if you want to take responsibility on another firmware interface (I understand that it is approved, etc) or just use what it is around for longer time.
Quoted 4 lines
I don't think it is a question to just Microchip, it's a question to be asked to all the various companies and projects using RISC-V. For example will upstream OpenSBI accept support for SCMI, or will they say "we have RPMI, use that"?
For upstream OpenSBI, the preference is RVI specifications and open standards (such as UEFI, ACPI, Device Tree, etc).
Regards,
Anup
Quoted 59 lines · Michal Simek
Quoted 42 lines · Charles Perry
Quoted 5 lines · Michal Simek
Quoted 2 lines · Charles Perry
Hello,
Quoted 8 lines
Quoted 4 lines
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.
From the first look it looks like SCMI. Why do you introducing something
what can be replaced by SCMI?
And SCMI has only specific ARM transport layer but the rest is arch independent.Yes, there are alot of similarities between RPMI and SCMI. I found some justification for this in some Linux Plumbers slide deck on RISC-V power management by Paul Walmsley [1]:
* The hardware is more sophisticated
* The software is more sophisticated
* Some stakeholders haven’t had input in the past
* RISC-V “big tent” philosophyI think this is referring to the SBI spec of RISC-V vs arm's PSCI but the same arguments may as well apply to RPMI vs SCMI.
Some other arguments:
* The microcontroller side is made easier with RPMI because of librpmi [2]. SCMI has SCP-firmware [3] which is a quite complex project compared to librpmi. Also SCP-firmware doesn't accept contribution anymore.
* RPMI is already in Linux.For what I'm doing, RPMI is what gave me the first results (controlling clocks) the quickest because all the pieces were present in Linux, OpenSBI and librpmi. There are however lots of missing service drivers in Linux and some other important OS like u-boot don't have support for RPMI at all. So even though I gave you a bunch of reason for saying yes to RPMI, I do have some doubt about how long it will take to bring RPMI on par with SCMI, making the SCMI-for-RISCV transport that you suggest more appealing.
Quoted 12 lines
[1]: https://lpc.events/event/2/contributions/197/attachments/133/165/RISC-V_Platform_Power_Management.pdf (slide 22) [2]: https://github.com/riscv-software-src/librpmi
[3]: https://gitlab.arm.com/firmware/SCP-firmwareQuoted 8 lines
In our case where we have Microblaze V in programmable logic I can't see any reason to use RPMI for talking to the same server if I need to do it from ARM side too via SCMI.
I pretty much think that there should be communication with ARM and instead of creating another firmware interface talk to each other and have only one which can be used across multiple architectures.
Quoted 8 lines
I have sent RFC patch to eliminate ARM from SCMI here
and feedback is quite positive. I think it is more or less question to Microchip if you want to take responsibility on another firmware interface (I understand that it is approved, etc) or just use what it is around for longer time.
Simply renaming the Linux sources does not make the SCMI specification to be open and community driven. The real problem is SCMI specification development is not open and community driven with appropriate permissive license.
Some of the note worthy highlights of RPMI ecosystem as compared to SCMI are:
1) RPMI specification is an open an community driven specification licensed under "Creative Commons Attribution 4.0".
2) The scope of RPMI specification is much bigger than SCMI specification where RPMI is trying to consolidate all required messaging protocols under one RPMI specification. RPMI defines some unique service groups in-addition to the service
groups providing SCMI-style functionality such as:
2.1) Collaborative Processor Performance Control (CPPC)
Allows application processor to abstract out CPPC support to a microcontroller. It also has fast-channels for hot-path CPPC registers such as desired performance and current performance level along with RISC-V specific fast-mechanism to access delivered and reference counter.
2.2) System MSI
Allows system-level events to be sent to application processors as MSIs. This is used for graceful shutdown/reboot request, hotplug events, etc 2.3) Request Forward
Enables one domain / world to receive messages forwarded from another domain.
2.4) Managment Mode (MM)
Allows UFEI / EDK2 firmware running on application processors to talk to managment mode (other domain / world / microcontroller) for secure variable updates and other MM services
2.5) RAS Agent
Allows UEFI / EDK2 firmware to discover error sources handled by firmware and generate RAS related ACPI tables at boot-time
2.6) Truested Execution Environment (TEE) (Work-in-progress) Provides a rich and extensible TEE communication interface between non-secure world (Linux) and trusted world (OP-TEE and others). 2.7) ... and more to come ...
3) The LibRPMI project which a open-source reference implementation of RPMI is permissively licensed under BSD-2-clause which allows platform vendors use any RTOS / baremetal-app as their microcontroller firmware. This library is also shipped as a shared library allowing QEMU to use LibRPMI for emulating RPMI services for TCG and KVM guests.
4) The following Linux RPMI drivers are already available in upstream:
MPXY mailbox controller, RPMI clock, and RPMI system MSI whereas the CPPC, LPI and system suspend drivers already work as-is for RISC-V. The upstreaming of RPMI performance driver is in-progress and should be merged soon. The OpenSBI (M-mode firmware) already supports almost all service groups defined by the RPMI v1.0 specification.
Based on the above facts, I would suggest AMD to consider using RPMI over SCMI.
Regards,
Anup
Quoted 122 lines · Anup Patel
Quoted 59 lines · Michal Simek
Quoted 42 lines · Charles Perry
Quoted 5 lines · Michal Simek
Quoted 2 lines · Charles Perry
Hello,
Quoted 8 lines
Quoted 4 lines
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.
From the first look it looks like SCMI. Why do you introducing something
what can be replaced by SCMI?
And SCMI has only specific ARM transport layer but the rest is arch independent.Yes, there are alot of similarities between RPMI and SCMI. I found some justification for this in some Linux Plumbers slide deck on RISC-V power management by Paul Walmsley [1]:
* The hardware is more sophisticated
* The software is more sophisticated
* Some stakeholders haven’t had input in the past
* RISC-V “big tent” philosophyI think this is referring to the SBI spec of RISC-V vs arm's PSCI but the same arguments may as well apply to RPMI vs SCMI.
Some other arguments:
* The microcontroller side is made easier with RPMI because of librpmi [2]. SCMI has SCP-firmware [3] which is a quite complex project compared to librpmi. Also SCP-firmware doesn't accept contribution anymore.
* RPMI is already in Linux.For what I'm doing, RPMI is what gave me the first results (controlling clocks) the quickest because all the pieces were present in Linux, OpenSBI and librpmi. There are however lots of missing service drivers in Linux and some other important OS like u-boot don't have support for RPMI at all. So even though I gave you a bunch of reason for saying yes to RPMI, I do have some doubt about how long it will take to bring RPMI on par with SCMI, making the SCMI-for-RISCV transport that you suggest more appealing.
Quoted 12 lines
[1]: https://lpc.events/event/2/contributions/197/attachments/133/165/RISC-V_Platform_Power_Management.pdf (slide 22) [2]: https://github.com/riscv-software-src/librpmi
[3]: https://gitlab.arm.com/firmware/SCP-firmwareQuoted 8 lines
In our case where we have Microblaze V in programmable logic I can't see any reason to use RPMI for talking to the same server if I need to do it from ARM side too via SCMI.
I pretty much think that there should be communication with ARM and instead of creating another firmware interface talk to each other and have only one which can be used across multiple architectures.
Quoted 8 lines
I have sent RFC patch to eliminate ARM from SCMI here
and feedback is quite positive. I think it is more or less question to Microchip if you want to take responsibility on another firmware interface (I understand that it is approved, etc) or just use what it is around for longer time.
Simply renaming the Linux sources does not make the SCMI specification to be open and community driven. The real problem is SCMI specification development is not open and community driven with appropriate permissive license.
Some of the note worthy highlights of RPMI ecosystem as compared to SCMI are:
1) RPMI specification is an open an community driven specification licensed under "Creative Commons Attribution 4.0".
2) The scope of RPMI specification is much bigger than SCMI specification where RPMI is trying to consolidate all required messaging protocols under one RPMI specification. RPMI defines some unique service groups in-addition to the service
groups providing SCMI-style functionality such as:
2.1) Collaborative Processor Performance Control (CPPC)
Allows application processor to abstract out CPPC support to a microcontroller. It also has fast-channels for hot-path CPPC registers such as desired performance and current performance level along with RISC-V specific fast-mechanism to access delivered and reference counter.
2.2) System MSI
Allows system-level events to be sent to application processors as MSIs. This is used for graceful shutdown/reboot request, hotplug events, etc 2.3) Request Forward
Enables one domain / world to receive messages forwarded from another domain.
2.4) Managment Mode (MM)
Allows UFEI / EDK2 firmware running on application processors to talk to managment mode (other domain / world / microcontroller) for secure variable updates and other MM services
2.5) RAS Agent
Allows UEFI / EDK2 firmware to discover error sources handled by firmware and generate RAS related ACPI tables at boot-time 2.6) Truested Execution Environment (TEE) (Work-in-progress) Provides a rich and extensible TEE communication interface between non-secure world (Linux) and trusted world (OP-TEE and others). 2.7) ... and more to come ...3) The LibRPMI project which a open-source reference implementation of RPMI is permissively licensed under BSD-2-clause which allows platform vendors use any RTOS / baremetal-app as their microcontroller firmware. This library is also shipped as a shared library allowing QEMU to use LibRPMI for emulating RPMI services for TCG and KVM guests.
4) The following Linux RPMI drivers are already available in upstream:
MPXY mailbox controller, RPMI clock, and RPMI system MSI whereas the CPPC, LPI and system suspend drivers already work as-is for RISC-V. The upstreaming of RPMI performance driver is in-progress and should be merged soon. The OpenSBI (M-mode firmware) already supports almost all service groups defined by the RPMI v1.0 specification.
Quoted 2 lines
Based on the above facts, I would suggest AMD to consider using RPMI over SCMI.
In the Linux kernel when I do grep RPMI I see that it is just tighten to RISCV.
If this is community driven effort and based on what you are describing above (based on you better then SCMI) why is this connected only to RISCV. I would be very surprised if this was labeled like this that none raised this concern.
If you look at FirmwareHandoff as another example of community driver specification which is architecture neutral or trying to be.
https://github.com/FirmwareHandoff/
I would rather see one specification which is trying to solve the same issue where vendors are talking to each other to achieve the same goal. Instead of another firmware specification which should be adopted, reviewed, tested and used to serve the same purpose. And also not solving problems on heterogeneous systems with mix of architectures.
Anyway if this is real community driven spec I am happy to join that discussion and ask above question. If this is arch neutral I can't see any reason why there should be riscv in compatible string and Kconfigs setup for RISCV only.
Thanks,
Michal