U5SeriesPkg provides the common EDK2 libraries and drivers for SiFive U5 series platforms. Currently the supported platforms are Freedom U500 VC707 platform and Freedom U540 HiFive Unleashed platform.
Both platforms are built with below common edk2 packages under edk2-platforms repository,
This is a sample platform package used against to SiFive Freedom U500 VC707 FPGA Dev Kit, please refer to "SiFive Freedom U500 VC707 FPGA Getting Started Guide" on https://www.sifive.com/documentation. The binary built from Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board can run on U500 VC707 FPGA board.
build -a RISCV64 -t GCC5 -p Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc
This is a sample platform package used for the SiFive Freedom U540 HiFive Unleashed development board, please refer to "SiFive Freedom U540-C000 Manual" on https://www.sifive.com. The binary built from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/ can run on both hardware and QEMU. It is confirmed that version 5.0 of QEMU can boot with this firmware to EFI shell and Linux user space.
build -a RISCV64 -t GCC5 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
For running U540 edk2 binary on QEMU, use qemu-system-riscv64 under riscv64-softmmu to launch the binary with below parameters,
qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd -m 2048 -nographic -smp cpus=5,maxcpus=5
git clone https://github.com/tianocore/edk2.git
git clone https://github.com/tianocore/edk2-platforms.git
# Below to clone opensbi submodule.
git submodule update --init
Refer to Readme.md for building RISC-V platforms.
FreedomU500VC707Board Currently the binary built from U500 edk2 package can boot SiFive Freedom U500 VC707 FPGA to EFI shell with console in/out enabled.
FreedomU540HiFiveUnleashedBoard Currently the binary built from U540 edk2 package can boot SiFive Freedom U540 HiFive Unleashed to EFI shell with console in/out enabled and Linux kernel. Please refer to https://github.com/riscv/riscv-uefi-edk2-docs for booting to Linux kernel.
Please refer to https://github.com/riscv/riscv-uefi-edk2-docs.
Only RISC-V RV64 is verified on this platform.
- RISC-V UEFI Documents
- RISC-V OpenSbi
- SiFive U500 VC707 FPGA Getting Started Guide
- SiFive Freedom U540-C000 Manual
- SiFive RISC-V Core Document
This is the library to create RISC-V core characteristics for building up RISC-V related SMBIOS records to support a single boot loader or OS image on all RISC-V platforms by discovering RISC-V hart configurations dynamically. This library leverage the silicon libraries provided in Silicon/SiFive.
This is common U5 series platform timer library which has the platform-specific timer implementation.
This is common U5 series platform serial port library.
This is common U5 series platform timer DXE driver which has the platform-specific timer implementation.
In order to reduce the dependencies with RISC-V OpenSBI project (https://github.com/riscv/opensbi) and avoid duplicating code we use it, the implementation of RISC-V EDK2 platform is leveraging platform source code from OpenSBI code tree. The "platform.c" under OpenSbiPlatformLib is cloned from RISC-V OpenSBI code tree and built based on edk2 build environment.
This is the platform-implementation specific library which is executed in early PEI phase for U500 platform initialization.
In order to reduce the dependencies with RISC-V OpenSBI project (https://github.com/riscv/opensbi) and fewer burdens to EDK2 build process, the implementation of RISC-V EDK2 platform is leveraging platform source code from OpenSBI code tree. The "platform.c" under OpenSbiPlatformLib is cloned from RISC-V OpenSBI code tree and built based on edk2build environment.
This is the platform-implementation specific library which is executed in early PEI phase for U540 platform initialization.
PCD name | Usage |
---|---|
PcdU5PlatformSystemClock | U5 series platform system clock |
PcdNumberofU5Cores | Number of U5 core enabled on U5 series platform |
PcdE5MCSupported | Indicates whether the Monitor Core (E5) is supported on U5 series platform |
PcdU5UartBase | Platform serial port base address |
Chang, Abner abner.chang@hpe.com Chen, Gilbert gilbert.chen@hpe.com Schaefer, Daniel daniel.schaefer@hpe.com