Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RPXY driver for StandaloneMmPkg #1

Open
wants to merge 26 commits into
base: dev-upstream
Choose a base branch
from

Conversation

yli147
Copy link

@yli147 yli147 commented Mar 29, 2024

This is the patchset to enable the StandaloneMm driver in OpenSBI.

avpatel and others added 26 commits February 27, 2024 15:19
We add generic mailbox library which is independent of hardware
description format (FDT or ACPI). The OpenSBI platform support or
mailbox drivers can register mailbox controller instances which
can be discovered and used by different mailbox client drivers.
Each mailbox controller instance has a unique ID which can be
used by mailbox client drivers for find the mailbox controller
instance. The mailbox client drivers will typically request a
mailbox channel from the mailbox controller and use it to do
data transfer with the remote end of mailbox channel.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
We add a simple FDT based mailbox framework which is built on top
of generic mailbox library. The phandle of FDT mailbox DT node is
treated as unique mailbox controller ID required by the generic
mailbox library. The FDT based mailbox drivers will be probed
on-demand from fdt_mailbox_request_chan() called by the mailbox
client drivers.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
…pport

The RISC-V Platform Management Interface (RPMI) defines a messaging protocol
and shared memory based transport for bi-directional communication with an
External Controller.

This patch adds the RPMI Messaging Protocol headers and helper macros for
creating and dismantling RPMI messages. Also, it adds RPMI shared memory
based transport driver which is a mailbox controller.

Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
Signed-off-by: Subrahmanya Lingappa <slingappa@ventanamicro.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Add RPMI based driver for system reset and enable it in the generic
platform defconfig

Signed-off-by: Rahul Pathak <rpathak@ventanamicro.com>
The generic platform can have multiple system suspend drivers so
let us add a simple FDT based system suspend driver framework.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Added RPMI system suspend driver.

to test this execute the follwoing in Linux:
 $ echo mem > /sys/power/state

to wake up in qemu execute the following command on
qemu control terminal:
(qemu) system_wakeup

Signed-off-by: Subrahmanya Lingappa <slingappa@ventanamicro.com>
The generic platform can have multiple HSM drivers so let us
add a simple FDT based HSM driver framework.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Added optional resume address to the hart suspend call,
which may or may not get honoured by the platform software.

Signed-off-by: Subrahmanya Lingappa <slingappa@ventanamicro.com>
Added RPMI based Hart State Management (HSM) handlers. The RPMI
HSM service group provides set of routine to query and control
power states of a Hart.

Signed-off-by: Subrahmanya Lingappa <slingappa@ventanamicro.com>
The generic platform can have multiple CPPC drivers so let us
add a simple FDT based CPPC driver framework.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Added RPMI driver for CPPC register read, write and probe.

Signed-off-by: Subrahmanya Lingappa <slingappa@ventanamicro.com>
We introduce RPMI proxy framework which allows platform specific
code or driver to register RPMI proxy service groups. These RPMI
proxy service groups will allow supervisor software to send RPMI
messages using the SBI RPMI Proxy extension.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Implement SBI RPXY extension only when some RPMI proxy service
group is provided by platform code or driver.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
The generic platform can have multiple RPXY drivers so let us
add a simple FDT based RPXY driver framework.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
We add a generic mailbox client based RPXY driver which can be
extended to support multiple RPMI service groups. Initially, this
driver only supports RPMI clock service group.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
In order to implement SSE on IPI notifications, provides regs to
sbi_ipi_process(). This will be used in two cases, global event
triggered from one cpu to another and ipi injection to a specific hart.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
This extension [1] allows to deliver events from SBI to supervisor via a
software mecanism. This extensions defines events (either local or
global) which are signaled by the SBI on specific signal sources (IRQ,
traps, etc) and are injected to be executed in supervisor mode. These

[1] https://lists.riscv.org/g/tech-prs/message/515

Signed-off-by: Clément Léger <cleger@rivosinc.com>
- Reserve 256 SSE events for local RAS events.
- Use 2 events for DRAM and HART

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
- Add high priority interrupt for RAS
- Enable the interrupt

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
- Add a RAS driver interface framework
- The actual RAS drivers will set/get the RAS agent to
  the interface
- SBI makes the RAS agent calls through this interface

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
- Probe and initialize the RAS platform drivers

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
- Add RAS driver which communicates to RAS agent over RPMI
- The driver is enumarated from the FDT entry

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
- Calls RAS drivers to synchronize errors with RAS agent
- Injects SSE events reported by RAS agent

Signed-off-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
The domain context management component in OpenSBI provides basic CPU
context management routines for existing OpenSBI domain. As domain
extension, it was initially designed to facilitate the suspension
and resumption of domains, enabling secure domains to efficiently
share CPU resources.

The patch also provides an addition to the OpenSBI domain to provide
updates on hart-domain assignment and declarations of contexts within
the domain.

Signed-off-by: Qingyu Shang <2931013282@sjtu.edu.cn>
Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com>
Tested-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
If multiple domains are there in the s-mode, and
these domains need use rpxy shmem to communicate with
each other, then each domain may need its own
rpxy shmem region for harts. This patch is the
implementation to allocate rpxy shmem for each domain.

Signed-off-by: Yong Li <yong.li@intel.com>
This is a base RPXY driver to support the UEFI
StandaloneMm mode.

Signed-off-by: Yong Li <yong.li@intel.com>
@avpatel avpatel force-pushed the dev-upstream branch 4 times, most recently from 15b44b7 to b2e729a Compare May 20, 2024 14:11
@avpatel avpatel force-pushed the dev-upstream branch 5 times, most recently from bc047f0 to b5c25cb Compare August 27, 2024 06:27
@avpatel avpatel force-pushed the dev-upstream branch 2 times, most recently from d136f97 to da879ee Compare September 13, 2024 07:23
@avpatel avpatel force-pushed the dev-upstream branch 4 times, most recently from 78e3dfe to 4dd504c Compare November 15, 2024 16:25
@avpatel avpatel force-pushed the dev-upstream branch 4 times, most recently from 6f3452c to a046672 Compare November 21, 2024 05:12
@avpatel avpatel force-pushed the dev-upstream branch 2 times, most recently from 0b16fbd to 2eb602c Compare December 6, 2024 13:04
avpatel added a commit that referenced this pull request Jan 16, 2025
Instead of having one common FDT MPXY RPMI mailbox client drivers
for various RPMI service groups, split this driver into two parts:
1) Common MPXY RPMI mailbox client library
2) MPXY driver for RPMI clock service group

The above split enables having a separate MPXY driver for each
RPMI clock service group and #1 (above) will allow code sharing
between various MPXY RPMI drivers.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
avpatel added a commit that referenced this pull request Jan 21, 2025
Instead of having one common FDT MPXY RPMI mailbox client drivers
for various RPMI service groups, split this driver into two parts:
1) Common MPXY RPMI mailbox client library
2) MPXY driver for RPMI clock service group

The above split enables having a separate MPXY driver for each
RPMI clock service group and #1 (above) will allow code sharing
between various MPXY RPMI drivers.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
avpatel added a commit that referenced this pull request Feb 3, 2025
Instead of having one common FDT MPXY RPMI mailbox client drivers
for various RPMI service groups, split this driver into two parts:
1) Common MPXY RPMI mailbox client library
2) MPXY driver for RPMI clock service group

The above split enables having a separate MPXY driver for each
RPMI clock service group and #1 (above) will allow code sharing
between various MPXY RPMI drivers.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
avpatel added a commit that referenced this pull request Feb 13, 2025
Instead of having one common FDT MPXY RPMI mailbox client drivers
for various RPMI service groups, split this driver into two parts:
1) Common MPXY RPMI mailbox client library
2) MPXY driver for RPMI clock service group

The above split enables having a separate MPXY driver for each
RPMI clock service group and #1 (above) will allow code sharing
between various MPXY RPMI drivers.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
@avpatel avpatel force-pushed the dev-upstream branch 4 times, most recently from be3be6c to 89af176 Compare February 20, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants