mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00

This patch adds initial platform support guide (i.e. docs/platform_guide.md). Signed-off-by: Anup Patel <anup.patel@wdc.com>
1.4 KiB
1.4 KiB
OpenSBI Platform Support Guideline
The OpenSBI platform support is a set of platform specific hooks provided in the form of a struct sbi_platform instance. It is required by:
- libplatsbi.a - A platform specific OpenSBI static library, that is, libsbi.a plus a struct sbi_platform instance installed at <install_directory>/platform/<platform_subdir>/lib/libplatsbi.a
- firmwares - Platform specific bootable firmware binaries installed at <install_directory>/platform/<platform_subdir>/bin
A complete doxygen-style documentation of struct sbi_platform and related APIs is available in sbi/sbi_platform.h.
Adding a new platform support
The support of a new platform named can be added as follows:
- Create a directory named under platform/ directory
- Create a platform configuration file named config.mk under platform// directory. This configuration file will provide compiler flags, select common drivers, and select firmware options
- Create platform//objects.mk file for listing the platform specific object files to be compiled
- Create platform//platform.c file providing a struct sbi_platform instance
A template platform support code is available under the platform/template. Copying this directory as new directory named under platform/ directory will create all the files mentioned above.