The librpmi is an implementation of RISC-V Platform Management Interface.
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 -
-
RISC-V platform vendors to implement RPMI services in their platform microcontroller firmware.
-
System-level partitions to implement RPMI services running as separate OpenSBI domain
-
Hypervisors/emulators/simulators to emulate RPMI services for the Guest/VM
- 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
- Base
- System Reset
- System Suspend
- Hart State Management
- Clock
- 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.
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.
// 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=<compiler prefix>
By default, make generates:
build/librpmi.abuild/librpmi.so.<major>.<minor>.<patch>- symlinks
build/librpmi.so.<soversion>andbuild/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.
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:
make deb-pkgThis 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, andpkg-configmetadata for building applications against librpmi.librpmi-src: source content installed under/usr/src/librpmifor users that need to inspect or rebuild the library sources.
Install the generated Debian packages with:
sudo dpkg -i build/deb/librpmi0_*.deb \
build/deb/librpmi-dev_*.deb \
build/deb/librpmi-src_*.debRPM packages can be built with:
make rpm-pkgThis 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, andpkg-configmetadata 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:
sudo dnf install build/rpmbuild/RPMS/*/*.rpmThe 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.
Build test binaries -
make LIBRPMI_TEST=yRun tests -
make checkRefer: README in test folder
The librpmi is provided under 2-Clause BSD License
