SlideShare a Scribd company logo
1 of 27
Download to read offline
The future of RISC-V Supervisor
Binary Interface (SBI)
Atish Patra
Principal R&D Engineer
2/1/19©2018 Western Digital Corporation or its affiliates. All rights reserved.
• RISC-V Supervisor Binary Interface(SBI)
• Current status
• Limitations
• Extension proposal
• OpenSBI project
• Boot Flow
• Demo
Outline
2/1/19 2©2018 Western Digital Corporation or its affiliates. All rights reserved.
• Provides an interface to access machine mode only registers
• Clear separation between Supervisor & Supervisor Execution Environment (SEE)
• Helps to run single OS image across different SEE
• Currently implemented by the Berkeley Boot Loader (BBL)
• Calling convention
– S mode traps into M mode using ecall instructions
– Arguments are passed via registers a0-a2
– SBI call type is specified via register a7
– Unsupported SBI returns -38 (ENOSYS in Linux)
– a0 is clobbered register
• Documentation available at
– https://github.com/riscv/riscv-sbi-doc
RISC-V Supervisor Binary Interface (SBI)
2/1/19 3©2018 Western Digital Corporation or its affiliates. All rights reserved.
SEE
SBI
OS (S Mode)
ABI ABI
App1 App2
Current Interface
2/1/19 4©2018 Western Digital Corporation or its affiliates. All rights reserved.
Type Function
Function
ID
Timer sbi_set_timer 0
Console
sbi_console_putchar
sbi_console_getchar
1
2
IPI
sbi_clear_ipi
sbi_send_ipi
3
4
Memory
Model
sbi_remote_fence_i
sbi_remote_sfence_vma
sbi_remote_sfence_vma_as
id
5
6
7
Shutdown sbi_shutdown 8
• Fixed, Not extendable
• No way to modify existing function signatures
• Changes cannot easily maintain backward compatibility
• No clean way to add new SBI function calls
– Power management
– Hart hotplug
– Vendor specific extensions
Limitations
2/1/19 5©2018 Western Digital Corporation or its affiliates. All rights reserved.
SBI Scope
2/1/19 6©2018 Western Digital Corporation or its affiliates. All rights reserved.
• Shouldn’t be treated as a kitchen sink
• New functionality only if absolutely necessary
• Backward compatibility
• No mandated usage of DT or ACPI
• Any functionality can be replaced by S-mode in future
• Anything else ??
• SBI specification to be part of the RISC-V Unix class platform specification
• Need to be approved by RISC-V Unix class platform specification working group
• Streamline the proposal discussion and quick turn around time
§ A mandatory base SBI spec
§ Existing SBI spec will be considered as legacy extension
§ Every other SBI feature set will be a separate extension based on the base spec
§ Every extension will be a sub-specification
§ Can be discussed in parallel once the base SBI specification is finalized
• Need to have an implementation before freeze
SBI proposal working model
2/1/19 7©2018 Western Digital Corporation or its affiliates. All rights reserved.
SBI Base specification - I
• Calling Convention
§ Follows existing calling convention except
return type
§ May return a structure
§ Value in a0 as return value or error from
SBI function
§ Error in a1 as any error SBI library wants to
return
2/1/19 8©2018 Western Digital Corporation or its affiliates. All rights reserved.
struct sbi_ret {
long value;
long error;
}
• A versioning scheme
§ 32bit unsigned integer
§ <major.minor> scheme
§ The existing legacy SBI version will be 0.1
§ The proposed base SBI version will be 0.2
SBI Base specification - II
• A SBI function ID scheme
– A combination of function set number and
function type number.
– Statically defined function set numbers.
– Both Hart/System power management functions
will be a sub-specification.
– Use Reserved set in case of function set is not
clear and may be standardized in future
– Vendors specific functionalities should use
Vendor function set.
2/1/19 9©2018 Western Digital Corporation or its affiliates. All rights reserved.
Function Set Value Description
Legacy 0x000 Existing SBI Functions.
Not mandatory.
Base 0x001 Base Functions
mandatory for any SBI
version.
Hart PM 0x002 Hart power
management.
System PM 0x003 System-level power
management
Reserved 0x010-0x7ff Reserved for
experimental
extensions
Vendor 0x800-0xfff Vendor specific
Functions
SBI Base version Functions
2/1/19 10©2018 Western Digital Corporation or its affiliates. All rights reserved.
Function Type Description
sbi_get_version(void) Returns SBI specification version
sbi_set_sbiimp_version(void) Returns SBI implementation version
sbi_is_function_set(u32 fset) Check if given function set is valid or not
sbiret sbi_is_function_type(u32 ftype, u32 fset) Check if a function type is implemented
for a give function set.
sbiret sbi_get_vendor_id(void) Returns the vendor ID
sbiret sbi_get_mimp_id(void) Returns the machine implementation ID
sbi_get_sbiimp_id Returns the SBI implementation ID
• BBL/Coreboot provides separate SBI implementation
• More fragmentations expected going forward considering vendor specific usage
• Difficult to maintain & track the SBI changes as it evolves
• Need a BBL replacement.
• Need easy plugin model for different platform/soc vendors
• OpenSBI to the rescue!!
OpenSBI project – Why ?
2/1/19 11©2018 Western Digital Corporation or its affiliates. All rights reserved.
• An Open Source SBI implementation project
• Driven by community
• Licensed under BSD-2 clause
• Builds a static library that any M-mode boot loader can link
• Provides a reference implementation of platform code
• Provides a reference implementation of firmware code as well
• Protects firmware using PMP support
• Source level documentation using Doxygen
• Available at
– https://github.com/riscv/opensbi
OpenSBI project – What ?
2/1/19 12©2018 Western Digital Corporation or its affiliates. All rights reserved.
• libsbi.a
§ A static library that provides SBI implementation
§ Other M-mode boot loader may just link this for SBI
functionality
§ Every future proposed SBI extension will be implemented
OpenSBI project – How ?
2/1/19 13©2018 Western Digital Corporation or its affiliates. All rights reserved.
• libplatsbi.a
§ A static library that provides reference platform
implementation
§ Contains minimal platform drivers required for bringup
§ Links libsbi.a for sbi implementation
§ Platform vendors are welcome to add their platform support
• Currently supported platforms
§ QEMU Virt
§ QEMU SiFive_u
§ SiFive Fu540 (HiFive Unleashed)
§ Kendryte K210 SoC
• Builds several firmware binary
• A reference implementation
• Platform specific bootable firmware binary
• Firmware with Payload
§ Any higher stage boot loader i.e. U-Boot binary as payload
§ Supervisor OS i.e. Linux as a direct payload
§ Allows separate device tree linking
• Firmware with Jump Address
§ Jumps to address of next booting stage entry
§ No need to provide payload binary for next stage
§ Booting stage prior to OpenSBI should be capable of loading next stage module
• Vendors may choose to use one of the firmware as is or build their own
OpenSBI project – How ?
2/1/19 14©2018 Western Digital Corporation or its affiliates. All rights reserved.
Current Boot flow – BBL + Linux
2/1/19 15©2018 Western Digital Corporation or its affiliates. All rights reserved.
S- Mode
ZSBL – Zero Stage boot loader
FSBL – First Stage boot loader
BBL – Berkeley boot loader
ZSBL FSBL BBL Linux
M- Mode
ROM DRAM DRAM
§ Difficult add support for other platforms
§ No way to separate DT from kernel image
§ No network booting
§ Kernel image has to be embedded bbl image
S- Mode
Boot flow – OpenSBI + Linux
2/1/19 16©2018 Western Digital Corporation or its affiliates. All rights reserved.
ZSBL FSBL OpenSBI Linux
M- Mode S- Mode
ROM DRAM DRAM
§ Full SMP support
§ Follows existing RISC-V boot flow model
§ Takes Linux Image file as a payload
§ Can accept separate DT file as well
Boot flow – OpenSBI + U-Boot + Linux
2/1/19 17©2018 Western Digital Corporation or its affiliates. All rights reserved.
ZSBL FSBL OpenSBI U-boot Linux
M- Mode S- Mode
ROM DRAM DRAM
§ Follows a standard boot flow
§ Uses U-Boot as the last stage boot loader
§ U-Boot binary as the payload to OpenSBI
§ Linux image loaded via tftp
§ Linux SMP (all cores) will be usable once SBI hart power management
extension is available in OpenSBI
qemu-system-riscv64 -M virt -m 256M -display none -serial stdio -kernel build/platform/qemu/virt/firmware/fw_payload.elf 
-drive file=<path_to_linux_rootfs>,format=raw,id=hd0 
-device virtio-blk-device,drive=hd0 
-append "root=/dev/vda rw console=ttyS0”
make PLATFORM=qemu/virt FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image
• Instructions available at docs/platform/qemu_virt.md
• Linux Image as a direct payload
– Building
– Running
• U-Boot image as a payload
– Building
– Running
Booting – QEMU
2/1/19 18©2018 Western Digital Corporation or its affiliates. All rights reserved.
qemu-system-riscv64 -M virt -m 256M -display none -serial stdio -kernel build/platform/qemu/virt/firmware/fw_payload.elf
make PLATFORM=qemu/virt FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin
• Instructions also available at
docs/platform/sifive_fu540.md
• Linux Image as a direct payload
• U-Boot binary as payload
Booting – HiFive Unleashed
2/1/19 19©2018 Western Digital Corporation or its affiliates. All rights reserved.
make PLATFORM=sifive/fu540 
FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image
make PLAT=sifive/hifive_u540 
FW_PAYLOAD_PATH=~/workspace/u-boot-riscv/u-boot.bin
Booting – HiFive Unleashed
2/1/19 20©2018 Western Digital Corporation or its affiliates. All rights reserved.
Demo – OpenSBI + Linux
2/1/19 21©2018 Western Digital Corporation or its affiliates. All rights reserved.
Demo – OpenSBI + U-Boot + Linux
2/1/19 22©2018 Western Digital Corporation or its affiliates. All rights reserved.
• 32-bit support
• Yocto recipe for OpenSBI in meta-riscv
• SBI v0.2 support (after SBI extension spec frozen)
• SBI Hart power management support
• Link libsbi in U-Boot M mode
• Link libsbi in Coreboot (Volunteer ??)
• CLIC use in OpenSBI (???)
• More platforms …
OpenSBI future work
2/2/19 23©2018 Western Digital Corporation or its affiliates. All rights reserved.
• Q&A ?
Thank you!!
2/1/19 24©2018 Western Digital Corporation or its affiliates. All rights reserved.
Function type list
2/1/19 25©2018 Western Digital Corporation or its affiliates. All rights reserved.
Error code table
2/1/19 26©2018 Western Digital Corporation or its affiliates. All rights reserved.
OpenSBI usage constraints
2/1/19 27©2018 Western Digital Corporation or its affiliates. All rights reserved.
• With libsbi.a, firmware has to provide the platform specific hooks
• RISC-V MSCRATCH CSR must point to a valid OpenSBI scratch space
• RISC-V SP register (i.e. stack pointer) must be set per-HART pointing to
distinct non-overlapping stacks
• Only calls two functions
– sbi_init – gets called when hart boots up
– sbi_trap_handler – Forward all traps and interrupts or at least for the following
• M-mode timer interrupt
• M-mode software interrupt
• Illegal instruction trap
• Misaligned load trap
• Misaligned store trap
• Supervisor ecall trap
• Hypervisor ecall trap

More Related Content

What's hot

Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewRajKumar Rampelli
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Linaro
 
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted FirmwareHKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted FirmwareLinaro
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 
Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8Linaro
 
RISC-V-Day-Tokyo2018-suzaki
RISC-V-Day-Tokyo2018-suzakiRISC-V-Day-Tokyo2018-suzaki
RISC-V-Day-Tokyo2018-suzakiKuniyasu Suzaki
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introductionYi-Hsiu Hsu
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN
 
LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLinaro
 
Linux Kernel Module - For NLKB
Linux Kernel Module - For NLKBLinux Kernel Module - For NLKB
Linux Kernel Module - For NLKBshimosawa
 

What's hot (20)

Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted FirmwareHKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
Pci express technology 3.0
Pci express technology 3.0Pci express technology 3.0
Pci express technology 3.0
 
Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8Lcu14 107- op-tee on ar mv8
Lcu14 107- op-tee on ar mv8
 
RISC-V-Day-Tokyo2018-suzaki
RISC-V-Day-Tokyo2018-suzakiRISC-V-Day-Tokyo2018-suzaki
RISC-V-Day-Tokyo2018-suzaki
 
I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platform
 
Linux Kernel Module - For NLKB
Linux Kernel Module - For NLKBLinux Kernel Module - For NLKB
Linux Kernel Module - For NLKB
 

Similar to The future of RISC-V Supervisor Binary Interface(SBI)

The role of_open_source_firmware_in_risc-v
The role of_open_source_firmware_in_risc-vThe role of_open_source_firmware_in_risc-v
The role of_open_source_firmware_in_risc-vAtish Patra
 
Applying Hyper-scale Design Patterns to Routing
Applying Hyper-scale Design Patterns to RoutingApplying Hyper-scale Design Patterns to Routing
Applying Hyper-scale Design Patterns to RoutingHannes Gredler
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramLinaro
 
BRKSPG-2069-64bit-package.pdf
BRKSPG-2069-64bit-package.pdfBRKSPG-2069-64bit-package.pdf
BRKSPG-2069-64bit-package.pdfHeng30
 
Building PoC ready ODM Platforms with Arm SystemReady v5.2.pdf
Building PoC ready ODM Platforms with Arm SystemReady v5.2.pdfBuilding PoC ready ODM Platforms with Arm SystemReady v5.2.pdf
Building PoC ready ODM Platforms with Arm SystemReady v5.2.pdfPaul Yang
 
OPNFV: Platform Performance Acceleration
OPNFV: Platform Performance AccelerationOPNFV: Platform Performance Acceleration
OPNFV: Platform Performance AccelerationOPNFV
 
Docker and IBM Integration Bus
Docker and IBM Integration BusDocker and IBM Integration Bus
Docker and IBM Integration BusGeza Geleji
 
Cisco usNIC libfabric provider
Cisco usNIC libfabric providerCisco usNIC libfabric provider
Cisco usNIC libfabric providerJeff Squyres
 
MIPI DevCon 2016: MIPI DisCo and ACPI - Streamlining MIPI Component Integration
MIPI DevCon 2016: MIPI DisCo and ACPI - Streamlining MIPI Component IntegrationMIPI DevCon 2016: MIPI DisCo and ACPI - Streamlining MIPI Component Integration
MIPI DevCon 2016: MIPI DisCo and ACPI - Streamlining MIPI Component IntegrationMIPI Alliance
 
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)iXsystems
 
SUSE shim and things related to it
SUSE shim and things related to itSUSE shim and things related to it
SUSE shim and things related to itSUSE Labs Taipei
 
OSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentOSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentNETWAYS
 
The Open Power ISA: A Summary of Architecture Compliancy Options and the Late...
The Open Power ISA: A Summary of Architecture Compliancy Options and the Late...The Open Power ISA: A Summary of Architecture Compliancy Options and the Late...
The Open Power ISA: A Summary of Architecture Compliancy Options and the Late...Ganesan Narayanasamy
 
Infrastructure Modernization by Dr. Wolfgang Rother, IBM Germany
Infrastructure Modernization by Dr. Wolfgang Rother, IBM GermanyInfrastructure Modernization by Dr. Wolfgang Rother, IBM Germany
Infrastructure Modernization by Dr. Wolfgang Rother, IBM GermanyFresche Solutions
 
XPDDS17: PL011 UART Emulation in Xen on ARM - Bhupinder Thakur, Qualcomm Data...
XPDDS17: PL011 UART Emulation in Xen on ARM - Bhupinder Thakur, Qualcomm Data...XPDDS17: PL011 UART Emulation in Xen on ARM - Bhupinder Thakur, Qualcomm Data...
XPDDS17: PL011 UART Emulation in Xen on ARM - Bhupinder Thakur, Qualcomm Data...The Linux Foundation
 
2022-05-03 SoC Interest Group Meeting - Deploying and testing firmware-softwa...
2022-05-03 SoC Interest Group Meeting - Deploying and testing firmware-softwa...2022-05-03 SoC Interest Group Meeting - Deploying and testing firmware-softwa...
2022-05-03 SoC Interest Group Meeting - Deploying and testing firmware-softwa...xiso
 
2014/09/02 Cisco UCS HPC @ ANL
2014/09/02 Cisco UCS HPC @ ANL2014/09/02 Cisco UCS HPC @ ANL
2014/09/02 Cisco UCS HPC @ ANLdgoodell
 

Similar to The future of RISC-V Supervisor Binary Interface(SBI) (20)

The role of_open_source_firmware_in_risc-v
The role of_open_source_firmware_in_risc-vThe role of_open_source_firmware_in_risc-v
The role of_open_source_firmware_in_risc-v
 
Applying Hyper-scale Design Patterns to Routing
Applying Hyper-scale Design Patterns to RoutingApplying Hyper-scale Design Patterns to Routing
Applying Hyper-scale Design Patterns to Routing
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready Program
 
BRKSPG-2069-64bit-package.pdf
BRKSPG-2069-64bit-package.pdfBRKSPG-2069-64bit-package.pdf
BRKSPG-2069-64bit-package.pdf
 
Building PoC ready ODM Platforms with Arm SystemReady v5.2.pdf
Building PoC ready ODM Platforms with Arm SystemReady v5.2.pdfBuilding PoC ready ODM Platforms with Arm SystemReady v5.2.pdf
Building PoC ready ODM Platforms with Arm SystemReady v5.2.pdf
 
OPNFV: Platform Performance Acceleration
OPNFV: Platform Performance AccelerationOPNFV: Platform Performance Acceleration
OPNFV: Platform Performance Acceleration
 
Tools for FPGA Development
Tools for FPGA DevelopmentTools for FPGA Development
Tools for FPGA Development
 
TFI2014 Session II - Requirements for SDN - Brian Field
TFI2014 Session II - Requirements for SDN - Brian FieldTFI2014 Session II - Requirements for SDN - Brian Field
TFI2014 Session II - Requirements for SDN - Brian Field
 
Docker and IBM Integration Bus
Docker and IBM Integration BusDocker and IBM Integration Bus
Docker and IBM Integration Bus
 
Cisco usNIC libfabric provider
Cisco usNIC libfabric providerCisco usNIC libfabric provider
Cisco usNIC libfabric provider
 
MIPI DevCon 2016: MIPI DisCo and ACPI - Streamlining MIPI Component Integration
MIPI DevCon 2016: MIPI DisCo and ACPI - Streamlining MIPI Component IntegrationMIPI DevCon 2016: MIPI DisCo and ACPI - Streamlining MIPI Component Integration
MIPI DevCon 2016: MIPI DisCo and ACPI - Streamlining MIPI Component Integration
 
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
PCI Pass-through - FreeBSD VM on Hyper-V (MeetBSD California 2016)
 
SUSE shim and things related to it
SUSE shim and things related to itSUSE shim and things related to it
SUSE shim and things related to it
 
Slimline Open Firmware
Slimline Open FirmwareSlimline Open Firmware
Slimline Open Firmware
 
OSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install EnvironmentOSDC 2014: Nat Morris - Open Network Install Environment
OSDC 2014: Nat Morris - Open Network Install Environment
 
The Open Power ISA: A Summary of Architecture Compliancy Options and the Late...
The Open Power ISA: A Summary of Architecture Compliancy Options and the Late...The Open Power ISA: A Summary of Architecture Compliancy Options and the Late...
The Open Power ISA: A Summary of Architecture Compliancy Options and the Late...
 
Infrastructure Modernization by Dr. Wolfgang Rother, IBM Germany
Infrastructure Modernization by Dr. Wolfgang Rother, IBM GermanyInfrastructure Modernization by Dr. Wolfgang Rother, IBM Germany
Infrastructure Modernization by Dr. Wolfgang Rother, IBM Germany
 
XPDDS17: PL011 UART Emulation in Xen on ARM - Bhupinder Thakur, Qualcomm Data...
XPDDS17: PL011 UART Emulation in Xen on ARM - Bhupinder Thakur, Qualcomm Data...XPDDS17: PL011 UART Emulation in Xen on ARM - Bhupinder Thakur, Qualcomm Data...
XPDDS17: PL011 UART Emulation in Xen on ARM - Bhupinder Thakur, Qualcomm Data...
 
2022-05-03 SoC Interest Group Meeting - Deploying and testing firmware-softwa...
2022-05-03 SoC Interest Group Meeting - Deploying and testing firmware-softwa...2022-05-03 SoC Interest Group Meeting - Deploying and testing firmware-softwa...
2022-05-03 SoC Interest Group Meeting - Deploying and testing firmware-softwa...
 
2014/09/02 Cisco UCS HPC @ ANL
2014/09/02 Cisco UCS HPC @ ANL2014/09/02 Cisco UCS HPC @ ANL
2014/09/02 Cisco UCS HPC @ ANL
 

Recently uploaded

Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...amitlee9823
 
VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...SUHANI PANDEY
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证tufbav
 
HLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussHLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussDrMSajidNoor
 
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...tanu pandey
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men 🔝Deoghar🔝 Escorts...
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men  🔝Deoghar🔝   Escorts...➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men  🔝Deoghar🔝   Escorts...
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men 🔝Deoghar🔝 Escorts...amitlee9823
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...motiram463
 
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Pooja Nehwal
 
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men 🔝Vijayawada🔝 E...
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men  🔝Vijayawada🔝   E...➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men  🔝Vijayawada🔝   E...
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men 🔝Vijayawada🔝 E...amitlee9823
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证ehyxf
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsDeira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsEscorts Call Girls
 

Recently uploaded (20)

Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
 
VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...
VVIP Pune Call Girls Gahunje WhatSapp Number 8005736733 With Elite Staff And ...
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
 
HLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussHLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discuss
 
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men 🔝Deoghar🔝 Escorts...
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men  🔝Deoghar🔝   Escorts...➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men  🔝Deoghar🔝   Escorts...
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men 🔝Deoghar🔝 Escorts...
 
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Chakan ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
 
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Abortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get CytotecAbortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get Cytotec
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006
 
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men 🔝Vijayawada🔝 E...
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men  🔝Vijayawada🔝   E...➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men  🔝Vijayawada🔝   E...
➥🔝 7737669865 🔝▻ Vijayawada Call-girls in Women Seeking Men 🔝Vijayawada🔝 E...
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
 
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort GirlsDeira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
Deira Dubai Escorts +0561951007 Escort Service in Dubai by Dubai Escort Girls
 

The future of RISC-V Supervisor Binary Interface(SBI)

  • 1. The future of RISC-V Supervisor Binary Interface (SBI) Atish Patra Principal R&D Engineer 2/1/19©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 2. • RISC-V Supervisor Binary Interface(SBI) • Current status • Limitations • Extension proposal • OpenSBI project • Boot Flow • Demo Outline 2/1/19 2©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 3. • Provides an interface to access machine mode only registers • Clear separation between Supervisor & Supervisor Execution Environment (SEE) • Helps to run single OS image across different SEE • Currently implemented by the Berkeley Boot Loader (BBL) • Calling convention – S mode traps into M mode using ecall instructions – Arguments are passed via registers a0-a2 – SBI call type is specified via register a7 – Unsupported SBI returns -38 (ENOSYS in Linux) – a0 is clobbered register • Documentation available at – https://github.com/riscv/riscv-sbi-doc RISC-V Supervisor Binary Interface (SBI) 2/1/19 3©2018 Western Digital Corporation or its affiliates. All rights reserved. SEE SBI OS (S Mode) ABI ABI App1 App2
  • 4. Current Interface 2/1/19 4©2018 Western Digital Corporation or its affiliates. All rights reserved. Type Function Function ID Timer sbi_set_timer 0 Console sbi_console_putchar sbi_console_getchar 1 2 IPI sbi_clear_ipi sbi_send_ipi 3 4 Memory Model sbi_remote_fence_i sbi_remote_sfence_vma sbi_remote_sfence_vma_as id 5 6 7 Shutdown sbi_shutdown 8
  • 5. • Fixed, Not extendable • No way to modify existing function signatures • Changes cannot easily maintain backward compatibility • No clean way to add new SBI function calls – Power management – Hart hotplug – Vendor specific extensions Limitations 2/1/19 5©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 6. SBI Scope 2/1/19 6©2018 Western Digital Corporation or its affiliates. All rights reserved. • Shouldn’t be treated as a kitchen sink • New functionality only if absolutely necessary • Backward compatibility • No mandated usage of DT or ACPI • Any functionality can be replaced by S-mode in future • Anything else ??
  • 7. • SBI specification to be part of the RISC-V Unix class platform specification • Need to be approved by RISC-V Unix class platform specification working group • Streamline the proposal discussion and quick turn around time § A mandatory base SBI spec § Existing SBI spec will be considered as legacy extension § Every other SBI feature set will be a separate extension based on the base spec § Every extension will be a sub-specification § Can be discussed in parallel once the base SBI specification is finalized • Need to have an implementation before freeze SBI proposal working model 2/1/19 7©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 8. SBI Base specification - I • Calling Convention § Follows existing calling convention except return type § May return a structure § Value in a0 as return value or error from SBI function § Error in a1 as any error SBI library wants to return 2/1/19 8©2018 Western Digital Corporation or its affiliates. All rights reserved. struct sbi_ret { long value; long error; } • A versioning scheme § 32bit unsigned integer § <major.minor> scheme § The existing legacy SBI version will be 0.1 § The proposed base SBI version will be 0.2
  • 9. SBI Base specification - II • A SBI function ID scheme – A combination of function set number and function type number. – Statically defined function set numbers. – Both Hart/System power management functions will be a sub-specification. – Use Reserved set in case of function set is not clear and may be standardized in future – Vendors specific functionalities should use Vendor function set. 2/1/19 9©2018 Western Digital Corporation or its affiliates. All rights reserved. Function Set Value Description Legacy 0x000 Existing SBI Functions. Not mandatory. Base 0x001 Base Functions mandatory for any SBI version. Hart PM 0x002 Hart power management. System PM 0x003 System-level power management Reserved 0x010-0x7ff Reserved for experimental extensions Vendor 0x800-0xfff Vendor specific Functions
  • 10. SBI Base version Functions 2/1/19 10©2018 Western Digital Corporation or its affiliates. All rights reserved. Function Type Description sbi_get_version(void) Returns SBI specification version sbi_set_sbiimp_version(void) Returns SBI implementation version sbi_is_function_set(u32 fset) Check if given function set is valid or not sbiret sbi_is_function_type(u32 ftype, u32 fset) Check if a function type is implemented for a give function set. sbiret sbi_get_vendor_id(void) Returns the vendor ID sbiret sbi_get_mimp_id(void) Returns the machine implementation ID sbi_get_sbiimp_id Returns the SBI implementation ID
  • 11. • BBL/Coreboot provides separate SBI implementation • More fragmentations expected going forward considering vendor specific usage • Difficult to maintain & track the SBI changes as it evolves • Need a BBL replacement. • Need easy plugin model for different platform/soc vendors • OpenSBI to the rescue!! OpenSBI project – Why ? 2/1/19 11©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 12. • An Open Source SBI implementation project • Driven by community • Licensed under BSD-2 clause • Builds a static library that any M-mode boot loader can link • Provides a reference implementation of platform code • Provides a reference implementation of firmware code as well • Protects firmware using PMP support • Source level documentation using Doxygen • Available at – https://github.com/riscv/opensbi OpenSBI project – What ? 2/1/19 12©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 13. • libsbi.a § A static library that provides SBI implementation § Other M-mode boot loader may just link this for SBI functionality § Every future proposed SBI extension will be implemented OpenSBI project – How ? 2/1/19 13©2018 Western Digital Corporation or its affiliates. All rights reserved. • libplatsbi.a § A static library that provides reference platform implementation § Contains minimal platform drivers required for bringup § Links libsbi.a for sbi implementation § Platform vendors are welcome to add their platform support • Currently supported platforms § QEMU Virt § QEMU SiFive_u § SiFive Fu540 (HiFive Unleashed) § Kendryte K210 SoC
  • 14. • Builds several firmware binary • A reference implementation • Platform specific bootable firmware binary • Firmware with Payload § Any higher stage boot loader i.e. U-Boot binary as payload § Supervisor OS i.e. Linux as a direct payload § Allows separate device tree linking • Firmware with Jump Address § Jumps to address of next booting stage entry § No need to provide payload binary for next stage § Booting stage prior to OpenSBI should be capable of loading next stage module • Vendors may choose to use one of the firmware as is or build their own OpenSBI project – How ? 2/1/19 14©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 15. Current Boot flow – BBL + Linux 2/1/19 15©2018 Western Digital Corporation or its affiliates. All rights reserved. S- Mode ZSBL – Zero Stage boot loader FSBL – First Stage boot loader BBL – Berkeley boot loader ZSBL FSBL BBL Linux M- Mode ROM DRAM DRAM § Difficult add support for other platforms § No way to separate DT from kernel image § No network booting § Kernel image has to be embedded bbl image S- Mode
  • 16. Boot flow – OpenSBI + Linux 2/1/19 16©2018 Western Digital Corporation or its affiliates. All rights reserved. ZSBL FSBL OpenSBI Linux M- Mode S- Mode ROM DRAM DRAM § Full SMP support § Follows existing RISC-V boot flow model § Takes Linux Image file as a payload § Can accept separate DT file as well
  • 17. Boot flow – OpenSBI + U-Boot + Linux 2/1/19 17©2018 Western Digital Corporation or its affiliates. All rights reserved. ZSBL FSBL OpenSBI U-boot Linux M- Mode S- Mode ROM DRAM DRAM § Follows a standard boot flow § Uses U-Boot as the last stage boot loader § U-Boot binary as the payload to OpenSBI § Linux image loaded via tftp § Linux SMP (all cores) will be usable once SBI hart power management extension is available in OpenSBI
  • 18. qemu-system-riscv64 -M virt -m 256M -display none -serial stdio -kernel build/platform/qemu/virt/firmware/fw_payload.elf -drive file=<path_to_linux_rootfs>,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -append "root=/dev/vda rw console=ttyS0” make PLATFORM=qemu/virt FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image • Instructions available at docs/platform/qemu_virt.md • Linux Image as a direct payload – Building – Running • U-Boot image as a payload – Building – Running Booting – QEMU 2/1/19 18©2018 Western Digital Corporation or its affiliates. All rights reserved. qemu-system-riscv64 -M virt -m 256M -display none -serial stdio -kernel build/platform/qemu/virt/firmware/fw_payload.elf make PLATFORM=qemu/virt FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin
  • 19. • Instructions also available at docs/platform/sifive_fu540.md • Linux Image as a direct payload • U-Boot binary as payload Booting – HiFive Unleashed 2/1/19 19©2018 Western Digital Corporation or its affiliates. All rights reserved. make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image make PLAT=sifive/hifive_u540 FW_PAYLOAD_PATH=~/workspace/u-boot-riscv/u-boot.bin
  • 20. Booting – HiFive Unleashed 2/1/19 20©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 21. Demo – OpenSBI + Linux 2/1/19 21©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 22. Demo – OpenSBI + U-Boot + Linux 2/1/19 22©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 23. • 32-bit support • Yocto recipe for OpenSBI in meta-riscv • SBI v0.2 support (after SBI extension spec frozen) • SBI Hart power management support • Link libsbi in U-Boot M mode • Link libsbi in Coreboot (Volunteer ??) • CLIC use in OpenSBI (???) • More platforms … OpenSBI future work 2/2/19 23©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 24. • Q&A ? Thank you!! 2/1/19 24©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 25. Function type list 2/1/19 25©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 26. Error code table 2/1/19 26©2018 Western Digital Corporation or its affiliates. All rights reserved.
  • 27. OpenSBI usage constraints 2/1/19 27©2018 Western Digital Corporation or its affiliates. All rights reserved. • With libsbi.a, firmware has to provide the platform specific hooks • RISC-V MSCRATCH CSR must point to a valid OpenSBI scratch space • RISC-V SP register (i.e. stack pointer) must be set per-HART pointing to distinct non-overlapping stacks • Only calls two functions – sbi_init – gets called when hart boots up – sbi_trap_handler – Forward all traps and interrupts or at least for the following • M-mode timer interrupt • M-mode software interrupt • Illegal instruction trap • Misaligned load trap • Misaligned store trap • Supervisor ecall trap • Hypervisor ecall trap