https://github.com/riscv-software-src/librpmi
Reference implementation of RPMI specification as a library.
https://github.com/riscv-software-src/librpmi
Last synced: about 1 month ago
JSON representation
Reference implementation of RPMI specification as a library.
- Host: GitHub
- URL: https://github.com/riscv-software-src/librpmi
- Owner: riscv-software-src
- License: other
- Created: 2024-06-11T11:16:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-28T03:41:32.000Z (over 1 year ago)
- Last Synced: 2025-04-01T11:50:33.745Z (about 1 year ago)
- Language: C
- Size: 423 KB
- Stars: 9
- Watchers: 5
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: COPYING.BSD
Awesome Lists containing this project
README
## librpmi - RPMI Protocol Implementation
## Introduction
The librpmi is an implementation of [RISC-V Platform Management Interface](https://github.com/riscv-non-isa/riscv-rpmi).
The librpmi implements RPMI shared memory transport, RPMI message protocol and
various Service groups and Services as defined in the RPMI specification.

The librpmi can be used by -
1. RISC-V platform vendors to implement RPMI services in their
platform microcontroller firmware.
2. System-level partitions to implement RPMI services running as
separate OpenSBI domain
3. Hypervisors/emulators/simulators to emulate RPMI services for the Guest/VM
### Features
- RPMI Transport (shared memory)
- Multiple RPMI shared memory based transports capability.
- Configurable transport where service groups can be enabled or disabled
for specific transport (except Base group).
- RPMI Service Groups
- [x] Base
- [x] System Reset
- [x] System Suspend
- [x] Hart State Management
- [x] Clock
- [x] CPPC
- Platform HAL interface.
- Test framework to test librpmi which is easy to extend and add more service
group test cases.
- HTML and PDF documentation generated by doxygen.
> The librpmi is a new project and is in development. More capabilities and
service groups will be added soon.
## Development
The librpmi supports GNU Make and comes with a simple Makefile that generates
`librpmi.a`, shared library objects (`librpmi.so.*`), and test applications
under the `build` directory.
### librpmi.a and shared library objects
```
// defaut without debug logs and tests, compiler optimizations are on
make
// Enable debug logs and build tests, compiler optimizations are off
make LIBRPMI_TEST=y LIBRPMI_DEBUG=y
// Cross compilation
make CROSS_COMPILE=
```
By default, `make` generates:
- `build/librpmi.a`
- `build/librpmi.so...`
- symlinks `build/librpmi.so.` and `build/librpmi.so`
The platform vendors may also integrate librpmi sources directly into the
platform microcontroller firmware and extend firmware build system to
build the librpmi sources rather than using `librpmi.a`.
## Packaging
The repository can build Debian and RPM packages for systems that want to
consume librpmi as an installed library instead of integrating the source tree
or manually copying build artifacts. These packages provide a repeatable way to
install the runtime library, development files, and source content needed by
downstream projects such as emulators, hypervisors, firmware build flows, and
distribution packaging pipelines.
Debian packages can be built with:
```shell
make deb-pkg
```
This stages the Debian packaging from `packaging/debian` and writes the package
outputs under `build/deb`. The generated packages are:
- `librpmi0`: runtime shared library (`librpmi.so.*`).
- `librpmi-dev`: headers, static library, linker symlink, and `pkg-config`
metadata for building applications against librpmi.
- `librpmi-src`: source content installed under `/usr/src/librpmi` for users
that need to inspect or rebuild the library sources.
Install the generated Debian packages with:
```shell
sudo dpkg -i build/deb/librpmi0_*.deb \
build/deb/librpmi-dev_*.deb \
build/deb/librpmi-src_*.deb
```
RPM packages can be built with:
```shell
make rpm-pkg
```
This uses `packaging/rpm/librpmi.spec` and writes the RPM build tree under
`build/rpmbuild`. The generated RPM packages are:
- `librpmi`: runtime shared library (`librpmi.so.*`).
- `librpmi-devel`: headers, static library, linker symlink, and `pkg-config`
metadata for building applications against librpmi.
- `librpmi-source`: source content installed under `/usr/src/librpmi`.
Install the generated RPM packages with the system package manager, for example:
```shell
sudo dnf install build/rpmbuild/RPMS/*/*.rpm
```
## Documentation
The librpmi supports doxygen which can generate both html and pdf
documentation under `build\docs` directory.
```
make docs
```
This generates pdf file `build/docs/latex/refman.pdf` and html documentation
at `build/docs/html`.
## Test
Build test binaries -
```shell
make LIBRPMI_TEST=y
```
Run tests -
```shell
make check
```
Refer: [README in test folder](test/README.md)
## Project process
- [Contributing guide](CONTRIBUTING.md)
- [Maintainers](MAINTAINERS.md)
- [Release process](RELEASE.md)
## License
The librpmi is provided under [2-Clause BSD License](COPYING.BSD)