Skip to content

slingappa/librpmi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

126 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

librpmi - RPMI Protocol Implementation

Introduction

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.

librpmi high level architecture

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
    • 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.

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=<compiler prefix>

By default, make generates:

  • build/librpmi.a
  • build/librpmi.so.<major>.<minor>.<patch>
  • symlinks build/librpmi.so.<soversion> 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:

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:

sudo dpkg -i build/deb/librpmi0_*.deb \
             build/deb/librpmi-dev_*.deb \
             build/deb/librpmi-src_*.deb

RPM packages can be built with:

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:

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 -

make LIBRPMI_TEST=y

Run tests -

make check

Refer: README in test folder

Project process

License

The librpmi is provided under 2-Clause BSD License

About

Reference implementation of RPMI specification as a library.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C 95.4%
  • Makefile 4.6%