diff options
Diffstat (limited to 'roms/opensbi/docs/platform')
-rw-r--r-- | roms/opensbi/docs/platform/andes-ae350.md | 30 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/fpga-ariane.md | 38 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/fpga-openpiton.md | 33 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/generic.md | 54 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/nuclei_ux600.md | 22 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/platform.md | 59 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/qemu_virt.md | 149 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/shakti_cclass.md | 33 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/sifive_fu540.md | 195 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/spike.md | 89 | ||||
-rw-r--r-- | roms/opensbi/docs/platform/thead-c910.md | 34 |
11 files changed, 736 insertions, 0 deletions
diff --git a/roms/opensbi/docs/platform/andes-ae350.md b/roms/opensbi/docs/platform/andes-ae350.md new file mode 100644 index 000000000..46889a1f1 --- /dev/null +++ b/roms/opensbi/docs/platform/andes-ae350.md @@ -0,0 +1,30 @@ +Andes AE350 SoC Platform +======================== +The AE350 AXI/AHB-based platform N25(F)/NX25(F)/D25F/A25/AX25 CPU with level-one +memories,interrupt controller, debug module, AXI and AHB Bus Matrix Controller, +AXI-to-AHB Bridge and a collection of fundamentalAHB/APB bus IP components +pre-integrated together as a system design.The high-quality and configurable +AHB/APB IPs suites a majority embedded systems, and the verified platform serves +as a starting point to jump start SoC designs. + +To build platform specific library and firmwares, provide the +*PLATFORM=andes/ae350* parameter to the top level make command. + +Platform Options +---------------- + +The Andes AE350 platform does not have any platform-specific options. + +Building Andes AE350 Platform +----------------------------- + +To use Linux v5.2 should be used to build Andes AE350 OpenSBI binaries by using +the compile time option FW_FDT_PATH. + +AE350's dts is included in https://github.com/andestech/linux/tree/ast-v3_2_0-release-public + +**Linux Kernel Payload** + +``` +make PLATFORM=andes/ae350 FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image FW_FDT_PATH=<ae350.dtb path> +``` diff --git a/roms/opensbi/docs/platform/fpga-ariane.md b/roms/opensbi/docs/platform/fpga-ariane.md new file mode 100644 index 000000000..f95001fb3 --- /dev/null +++ b/roms/opensbi/docs/platform/fpga-ariane.md @@ -0,0 +1,38 @@ +Ariane FPGA SoC Platform +======================== +Ariane is a 6-stage, single issue, in-order CPU which implements the 64-bit +RISC-V instruction set. The Ariane FPGA development platform is based on FPGA +SoC (which currently supports only Genesys 2 board) and is capable of running +Linux. + +The FPGA SoC currently contains the following peripherals: +- DDR3 memory controller +- SPI controller to conncet to an SDCard +- Ethernet controller +- JTAG port (see debugging section below) +- Bootrom containing zero stage bootloader and device tree. + +To build platform specific library and firmwares, provide the +*PLATFORM=fpga/ariane* parameter to the top level `make` command. + +Platform Options +---------------- + +The *Ariane FPGA* platform does not have any platform-specific options. + +Building Ariane FPGA Platform +----------------------------- + +**Linux Kernel Payload** + +``` +make PLATFORM=fpga/ariane FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image +``` + +Booting Ariane FPGA Platform +---------------------------- + +**Linux Kernel Payload** + +As Linux kernel image is embedded in the OpenSBI firmware binary, Ariane will +directly boot into Linux directly after powered on. diff --git a/roms/opensbi/docs/platform/fpga-openpiton.md b/roms/opensbi/docs/platform/fpga-openpiton.md new file mode 100644 index 000000000..7861a197c --- /dev/null +++ b/roms/opensbi/docs/platform/fpga-openpiton.md @@ -0,0 +1,33 @@ +OpenPiton FPGA SoC Platform +======================== +OpenPiton is the world's first open source, general purpose, multithreaded +manycore processor. It is a tiled manycore framework scalable from one to +1/2 billion cores. Currently, OpenPiton supports the 64bit Ariane RISC-V +processor from ETH Zurich. To this end, Ariane has been equipped with a +different L1 cache subsystem that follows a write-through protocol and that has +support for cache invalidations and atomics. + +To build platform specific library and firmwares, provide the +*PLATFORM=fpga/openpiton* parameter to the top level `make` command. + +Platform Options +---------------- + +The *OpenPiton* platform does not have any platform-specific options. + +Building Ariane FPGA Platform +----------------------------- + +**Linux Kernel Payload** + +``` +make PLATFORM=fpga/openpiton FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image +``` + +Booting Ariane FPGA Platform +---------------------------- + +**Linux Kernel Payload** + +As Linux kernel image is embedded in the OpenSBI firmware binary, Ariane will +directly boot into Linux directly after powered on. diff --git a/roms/opensbi/docs/platform/generic.md b/roms/opensbi/docs/platform/generic.md new file mode 100644 index 000000000..f1f7f6424 --- /dev/null +++ b/roms/opensbi/docs/platform/generic.md @@ -0,0 +1,54 @@ +Generic Platform +================ + +The **Generic** platform is a flattened device tree (FDT) based platform +where all platform specific functionality is provided based on FDT passed +by previous booting stage. The **Generic** platform allows us to use same +OpenSBI firmware binaries on various emulators, simulators, FPGAs, and +boards. + +By default, the generic FDT platform makes following assumptions: + +1. platform FW_TEXT_START is 0x80000000 +2. platform features are default +3. platform stack size is default +4. platform has no quirks or work-arounds + +The above assumptions (except 1) can be overridden by adding special platform +callbacks which will be called based on FDT root node compatible string. + +Users of the generic FDT platform will have to ensure that: + +1. Various FDT based drivers under lib/utils directory are upto date + based on their platform requirements +2. The FDT passed by previous booting stage has DT compatible strings and + DT properties in sync with the FDT based drivers under lib/utils directory +3. The FDT must have "stdout-path" DT property in the "/chosen" DT node when + a platform has multiple serial ports or consoles +4. On multi-HART platform, the FDT must have a DT node for IPI device and + lib/utils/ipi directory must have corresponding FDT based IPI driver +5. The FDT must have a DT node for timer device and lib/utils/timer directory + must have corresponding FDT based timer driver + +To build the platform-specific library and firmware images, provide the +*PLATFORM=generic* parameter to the top level `make` command. + +For custom FW_TEXT_START, we can build the platform-specific library and +firmware images by passing *PLATFORM=generic FW_TEXT_START=<custom_text_start>* +parameter to the top level `make` command. + +Platform Options +---------------- + +The *Generic* platform does not have any platform-specific options. + +RISC-V Platforms Using Generic Platform +--------------------------------------- + +* **QEMU RISC-V Virt Machine** (*[qemu_virt.md]*) +* **Spike** (*[spike.md]*) +* **Shakti C-class SoC Platform** (*[shakti_cclass.md]*) + +[qemu_virt.md]: qemu_virt.md +[spike.md]: spike.md +[shakti_cclass.md]: shakti_cclass.md diff --git a/roms/opensbi/docs/platform/nuclei_ux600.md b/roms/opensbi/docs/platform/nuclei_ux600.md new file mode 100644 index 000000000..273b6b438 --- /dev/null +++ b/roms/opensbi/docs/platform/nuclei_ux600.md @@ -0,0 +1,22 @@ + +Nuclei UX600 Platform +===================== + +The **Nuclei UX600** is a 64-bit RISC-V Core which is capable of running Linux. + +> Nuclei UX600: single core, pipeline as single-issue and 6~9 variable stages, in-order dispatch and out-of-order write-back, running up to >1.2GHz + +To build the platform-specific library and firmware images, provide the +*PLATFORM=nuclei/ux600* parameter to the top level `make` command. + +Platform Options +---------------- + +The *Nuclei UX600* platform does not have any platform-specific options. + +Building Nuclei UX600 Platform +------------------------------ + +``` +make PLATFORM=nuclei/ux600 clean all +``` diff --git a/roms/opensbi/docs/platform/platform.md b/roms/opensbi/docs/platform/platform.md new file mode 100644 index 000000000..7f4706813 --- /dev/null +++ b/roms/opensbi/docs/platform/platform.md @@ -0,0 +1,59 @@ +OpenSBI Supported Platforms +=========================== + +OpenSBI currently supports the following virtual and hardware platforms: + +* **Generic**: Flattened device tree (FDT) based platform where platform + specific functionality is provided based on the FDT passed by previous + booting stage. More details on this platform can be found in the file + *[generic.md]*. + +* **QEMU RISC-V Virt Machine**: Platform support for the QEMU *virt* virtual + RISC-V machine. This virtual machine is intended for RISC-V software + development and tests. More details on this platform can be found in the + file *[qemu_virt.md]*. + +* **SiFive FU540 SoC**: Platform support for SiFive FU540 SoC used on the + HiFive Unleashed board, as well as the *sifive_u* QEMU virtual RISC-V + machine. More details on this platform can be found in the file + *[sifive_fu540.md]*. + +* **Kendryte K210 SoC**: Platform support for the Kendryte K210 SoC used on + boards such as the Kendryte KD233 or the Sipeed MAIX Dock. + +* **Ariane FPGA SoC**: Platform support for the Ariane FPGA SoC used on + Genesys 2 board. More details on this platform can be found in the file + *[fpga-ariane.md]*. + +* **Andes AE350 SoC**: Platform support for the Andes's SoC (AE350). More + details on this platform can be found in the file *[andes-ae350.md]*. + +* **T-HEAD C910**: Platform support for the T-HEAD C910 Processor. More + details on this platform can be found in the file *[thead-c910.md]*. + +* **Spike**: Platform support for the Spike emulator. More + details on this platform can be found in the file *[spike.md]*. + +* **OpenPiton FPGA SoC**: Platform support OpenPiton research platform based + on ariane core. More details on this platform can be found in the file + *[fpga_openpiton.md]*. + +* **Shakti C-class SoC Platform**: Platform support for Shakti C-class + processor based SOCs. More details on this platform can be found in the + file *[shakti_cclass.md]*. + +The code for these supported platforms can be used as example to implement +support for other platforms. The *platform/template* directory also provides +template files for implementing support for a new platform. The *object.mk*, +*config.mk* and *platform.c* template files provides enough comments to +facilitate the implementation. + +[generic.md]: generic.md +[qemu_virt.md]: qemu_virt.md +[sifive_fu540.md]: sifive_fu540.md +[fpga-ariane.md]: fpga-ariane.md +[andes-ae350.md]: andes-ae350.md +[thead-c910.md]: thead-c910.md +[spike.md]: spike.md +[fpga_openpiton.md]: fpga_openpiton.md +[shakti_cclass.md]: shakti_cclass.md diff --git a/roms/opensbi/docs/platform/qemu_virt.md b/roms/opensbi/docs/platform/qemu_virt.md new file mode 100644 index 000000000..27771485c --- /dev/null +++ b/roms/opensbi/docs/platform/qemu_virt.md @@ -0,0 +1,149 @@ +QEMU RISC-V Virt Machine Platform +================================= + +The **QEMU RISC-V Virt Machine** is a virtual platform created for RISC-V +software development and testing. It is also referred to as +*QEMU RISC-V VirtIO machine* because it uses VirtIO devices for network, +storage, and other types of IO. + +To build the platform-specific library and firmware images, provide the +*PLATFORM=generic* parameter to the top level `make` command. + +Platform Options +---------------- + +The *QEMU RISC-V Virt Machine* platform does not have any platform-specific +options. + +Execution on QEMU RISC-V 64-bit +------------------------------- + +**No Payload Case** + +Build: +``` +make PLATFORM=generic +``` + +Run: +``` +qemu-system-riscv64 -M virt -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_payload.bin +``` + +**U-Boot Payload** + +Note: the command line examples here assume that U-Boot was compiled using +the `qemu-riscv64_smode_defconfig` configuration. + +Build: +``` +make PLATFORM=generic FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin +``` + +Run: +``` +qemu-system-riscv64 -M virt -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_payload.elf +``` +or +``` +qemu-system-riscv64 -M virt -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_jump.bin \ + -kernel <uboot_build_directory>/u-boot.bin +``` + +**Linux Kernel Payload** + +Note: We assume that the Linux kernel is compiled using +*arch/riscv/configs/defconfig*. + +Build: +``` +make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image +``` + +Run: +``` +qemu-system-riscv64 -M virt -m 256M -nographic \ + -bios build/platform/generic/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" +``` +or +``` +qemu-system-riscv64 -M virt -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_jump.bin \ + -kernel <linux_build_directory>/arch/riscv/boot/Image \ + -drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \ + -device virtio-blk-device,drive=hd0 \ + -append "root=/dev/vda rw console=ttyS0" +``` + + +Execution on QEMU RISC-V 32-bit +------------------------------- + +**No Payload Case** + +Build: +``` +make PLATFORM=generic PLATFORM_RISCV_XLEN=32 +``` + +Run: +``` +qemu-system-riscv32 -M virt -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_payload.bin +``` + +**U-Boot Payload** + +Note: the command line examples here assume that U-Boot was compiled using +the `qemu-riscv32_smode_defconfig` configuration. + +Build: +``` +make PLATFORM=generic PLATFORM_RISCV_XLEN=32 FW_PAYLOAD_PATH=<uboot_build_directory>/u-boot.bin +``` + +Run: +``` +qemu-system-riscv32 -M virt -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_payload.elf +``` +or +``` +qemu-system-riscv32 -M virt -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_jump.bin \ + -kernel <uboot_build_directory>/u-boot.bin +``` + +**Linux Kernel Payload** + +Note: We assume that the Linux kernel is compiled using +*arch/riscv/configs/rv32_defconfig*. + +Build: +``` +make PLATFORM=generic PLATFORM_RISCV_XLEN=32 FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image +``` + +Run: +``` +qemu-system-riscv32 -M virt -m 256M -nographic \ + -bios build/platform/generic/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" +``` +or +``` +qemu-system-riscv32 -M virt -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_jump.bin \ + -kernel <linux_build_directory>/arch/riscv/boot/Image \ + -drive file=<path_to_linux_rootfs>,format=raw,id=hd0 \ + -device virtio-blk-device,drive=hd0 \ + -append "root=/dev/vda rw console=ttyS0" +``` diff --git a/roms/opensbi/docs/platform/shakti_cclass.md b/roms/opensbi/docs/platform/shakti_cclass.md new file mode 100644 index 000000000..05c9b3a4c --- /dev/null +++ b/roms/opensbi/docs/platform/shakti_cclass.md @@ -0,0 +1,33 @@ +Shakti C-class SoC Platform +=========================== +C-Class is a member of the SHAKTI family of processors from +Indian Institute of Technology - Madras (IIT-M). + +It is an extremely configurable and commercial-grade 5-stage +in-order core supporting the standard RV64GCSUN ISA extensions. + +For more details, refer: +* https://gitlab.com/shaktiproject/cores/c-class/blob/master/README.md +* https://c-class.readthedocs.io/en/latest +* https://shakti.org.in + +Platform Options +---------------- + +The *Shakti C-class SoC* platform does not have any platform-specific +options. + +Building Shakti C-class Platform +-------------------------------- + +**Linux Kernel Payload** + +``` +make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image FW_FDT_PATH=<shakti.dtb path> +``` + +**Test Payload** + +``` +make PLATFORM=generic FW_FDT_PATH=<shakti.dtb path> +``` diff --git a/roms/opensbi/docs/platform/sifive_fu540.md b/roms/opensbi/docs/platform/sifive_fu540.md new file mode 100644 index 000000000..b4d3c6051 --- /dev/null +++ b/roms/opensbi/docs/platform/sifive_fu540.md @@ -0,0 +1,195 @@ +SiFive FU540 SoC Platform +========================= +The FU540-C000 is the world’s first 4+1 64-bit RISC-V SoC from SiFive. +The HiFive Unleashed development platform is based on FU540-C000 and capable +of running Linux. + +With QEMU v4.2 or above release, the 'sifive_u' machine can be used to test +OpenSBI image built for the real hardware as well. + +To build platform specific library and firmwares, provide the +*PLATFORM=sifive/fu540* parameter to the top level `make` command. + +Platform Options +---------------- + +The *SiFive FU540 SoC* platform does not have any platform-specific +options. + +Building SiFive Fu540 Platform +------------------------------ + +In order to boot SMP Linux in U-Boot, Linux v5.1 (or higher) and latest +U-Boot v2020.01 (or higher) should be used. + +**Linux Kernel Payload** + +The HiFive Unleashed device tree(DT) is merged in Linux v5.2 release. This +DT (device tree) is not backward compatible with the DT passed from FSBL. + +To use Linux v5.2 (or higher), the pre-built DTB (DT binary) from Linux v5.2 +(or higher) should be used to build SiFive FU540 OpenSBI binaries by using +the compile time option *FW_FDT_PATH*. + +``` +make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image +or +(For Linux v5.2 or higher) +make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image FW_FDT_PATH=<hifive-unleashed-a00.dtb path from Linux kernel> +``` + +**U-Boot Payload** + +The command-line example here assumes that U-Boot was compiled using the +sifive_fu540_defconfig configuration and with U-Boot v2020.01, and up to +v2020.07-rc3. + +``` +make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=<u-boot_build_dir>/u-boot-dtb.bin +``` +For U-Boot v2020.07-rc4 or later releases, SPL support was added in U-Boot. +Please refer to the detailed U-Boot booting guide available at [U-Boot]. + +Flashing the OpenSBI firmware binary to storage media: +------------------------------------------------------ +The first stage boot loader ([FSBL]) expects the storage media to have a GPT +partition table. It tries to look for a partition with following GUID to load +the next stage boot loader (OpenSBI in this case). + +``` +2E54B353-1271-4842-806F-E436D6AF6985 +``` + +That's why the generated firmware binary in above steps should be copied to +the partition of the sdcard with above GUID. + +``` +dd if=build/platform/sifive/fu540/firmware/fw_payload.bin of=/dev/disk2s1 bs=1024 +``` + +In my case, it is the first partition is **disk2s1** that has been formatted +with the above specified GUID. + +In case of a brand new sdcard, it should be formatted with below partition +tables as described here. + +``` +sgdisk --clear \ + --new=1:2048:67583 --change-name=1:bootloader --typecode=1:2E54B353-1271-4842-806F-E436D6AF6985 \ + --new=2:264192: --change-name=2:root --typecode=2:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \ + ${DISK} +``` + +Booting SiFive Fu540 Platform +----------------------------- + +**Linux Kernel Payload** + +As Linux kernel image is embedded in the OpenSBI firmware binary, HiFive +Unleashed will directly boot into Linux directly after powered on. + +**U-Boot Payload** + +As U-Boot image is used as payload, HiFive Unleashed will boot into a U-Boot +prompt. U-Boot tftp boot method can be used to load kernel image in U-Boot +prompt. Here are the steps do a tftpboot. + +1. Set the ip address of the board. +``` +setenv ipaddr <ipaddr of the board> +``` +2. Set the tftpboot server IP. +``` +setenv serverip <ipaddr of the tftp server> +``` +3. Set the network gateway address. +``` +setenv gatewayip <ipaddress of the network gateway> +``` +4. Load the Linux kernel image from the tftp server. +``` +tftpboot ${kernel_addr_r} <Image path in tftpboot directory> +``` +5. Load the ramdisk image from the tftp server. This is only required if +ramdisk is loaded from tftp server. This step is optional, if rootfs is +already part of the kernel or loaded from an external storage by kernel. +``` +tftpboot ${ramdisk_addr_r} <ramdisk path in tftpboot directory> +``` +6. Load the pre-compiled device tree via tftpboot. +``` +tftpboot ${fdt_addr_r} <hifive-unleashed-a00.dtb path in tftpboot directory> +``` +7. Set the boot command-line arguments. +``` +setenv bootargs "root=<root partition> rw console=ttySIF0 earlycon=sbi" +``` +(Note: root partition should point to +** /dev/ram ** - If a ramdisk is used +** root=/dev/mmcblk0pX ** - If a rootfs is already on some other partition +of sdcard) +8. Now boot into Linux. +``` +booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} +or +(If ramdisk is not loaded from network) +booti ${kernel_addr_r} - ${fdt_addr_r} +``` + +**U-Boot & Linux Kernel as a single payload** + +At U-Boot prompt execute the following boot command to boot Linux. + +``` +booti ${kernel_addr_r} - ${fdt_addr_r} +``` + +QEMU Specific Instructions +-------------------------- +If you want to test OpenSBI with QEMU 'sifive_u' machine, please follow the +same instructions above, with the exception of not passing FW_FDT_PATH. + +This is because QEMU generates a device tree blob on the fly based on the +command line parameters and it's compatible with the one used in the upstream +Linux kernel. + +When U-Boot v2020.01 (or higher) is used as the payload, as the SiFive FU540 +DTB for the real hardware is embedded in U-Boot binary itself, due to the same +reason above, we need to switch the U-Boot sifive_fu540_defconfig configuration +from **CONFIG_OF_SEPARATE** to **CONFIG_OF_PRIOR_STAGE** so that U-Boot uses the +DTB generated by QEMU, and u-boot.bin should be used as the payload image, like: + +``` +make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=<u-boot_build_dir>/u-boot.bin +``` + +U-Boot v2020.07 release added SPL support to SiFive HiFive Unleashed board, +hence a build error will be seen after you switch to **CONFIG_OF_PRIOR_STAGE**. + +``` +./tools/mkimage: Can't open arch/riscv/dts/hifive-unleashed-a00.dtb: No such file or directory +./tools/mkimage: failed to build FIT +Makefile:1402: recipe for target 'u-boot.img' failed +make: *** [u-boot.img] Error 1 +``` + +The above errors can be safely ignored as we don't run U-Boot SPL under QEMU. + +Run: +``` +qemu-system-riscv64 -M sifive_u -m 256M -nographic \ + -bios build/platform/sifive/fu540/firmware/fw_payload.bin +``` +or +``` +qemu-system-riscv64 -M sifive_u -m 256M -nographic \ + -bios build/platform/sifive/fu540/firmware/fw_jump.bin \ + -kernel <uboot_build_dir>/u-boot.bin +``` + +While the real hardware operates at the 64-bit mode, it's possible for QEMU to +test the 32-bit OpenSBI firmware. This can be helpful for testing 32-bit SiFive +specific drivers. + +[U-Boot]: https://gitlab.denx.de/u-boot/u-boot/blob/master/doc/board/sifive/fu540.rst +[FSBL]: https://github.com/sifive/freedom-u540-c000-bootloader diff --git a/roms/opensbi/docs/platform/spike.md b/roms/opensbi/docs/platform/spike.md new file mode 100644 index 000000000..79e2eb2b0 --- /dev/null +++ b/roms/opensbi/docs/platform/spike.md @@ -0,0 +1,89 @@ +Spike Simulator Platform +======================== + +The **Spike** is a RISC-V ISA simulator which implements a functional model +of one or more RISC-V harts. The **Spike** compatible virtual platform is +also available on QEMU. In fact, we can use same OpenSBI firmware binaries +on **Spike** simulator and QEMU Spike machine. + +For more details, refer [Spike on GitHub](https://github.com/riscv/riscv-isa-sim) + +To build the platform-specific library and firmware images, provide the +*PLATFORM=generic* parameter to the top level `make` command. + +Platform Options +---------------- + +The *Spike* platform does not have any platform-specific options. + +Execution on Spike Simulator +---------------------------- + +**No Payload Case** + +Build: +``` +make PLATFORM=generic +``` + +Run: +``` +spike build/platform/generic/firmware/fw_payload.elf +``` + +**Linux Kernel Payload** + +Note: We assume that the Linux kernel is compiled using +*arch/riscv/configs/defconfig*. + +Build: +``` +make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image +``` + +Run: +``` +spike --initrd <path_to_cpio_ramdisk> build/platform/generic/firmware/fw_payload.elf +``` + +Execution on QEMU RISC-V 64-bit +------------------------------- + +**No Payload Case** + +Build: +``` +make PLATFORM=generic +``` + +Run: +``` +qemu-system-riscv64 -M spike -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_payload.elf +``` + +**Linux Kernel Payload** + +Note: We assume that the Linux kernel is compiled using +*arch/riscv/configs/defconfig*. + +Build: +``` +make PLATFORM=generic FW_PAYLOAD_PATH=<linux_build_directory>/arch/riscv/boot/Image +``` + +Run: +``` +qemu-system-riscv64 -M spike -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_payload.elf \ + -initrd <path_to_cpio_ramdisk> \ + -append "root=/dev/ram rw console=hvc0 earlycon=sbi" +``` +or +``` +qemu-system-riscv64 -M spike -m 256M -nographic \ + -bios build/platform/generic/firmware/fw_jump.elf \ + -kernel <linux_build_directory>/arch/riscv/boot/Image \ + -initrd <path_to_cpio_ramdisk> \ + -append "root=/dev/ram rw console=hvc0 earlycon=sbi" +``` diff --git a/roms/opensbi/docs/platform/thead-c910.md b/roms/opensbi/docs/platform/thead-c910.md new file mode 100644 index 000000000..786b47d03 --- /dev/null +++ b/roms/opensbi/docs/platform/thead-c910.md @@ -0,0 +1,34 @@ +T-HEAD C910 Processor +===================== +C910 is a 12-stage, 3 issues, 8 executions, out-of-order 64-bit RISC-V CPU which +supports 16 cores, runs with 2.5GHz, and is capable of running Linux. + +To build platform specific library and firmwares, provide the +*PLATFORM=thead/c910* parameter to the top level make command. + +Platform Options +---------------- + +The *T-HEAD C910* platform does not have any platform-specific options. + +Building T-HEAD C910 Platform +----------------------------- + +``` +make PLATFORM=thead/c910 +``` + +Booting T-HEAD C910 Platform +---------------------------- + +**No Payload** + +As there's no payload, you may download vmlinux or u-boot to FW_JUMP_ADDR which +specified in config.mk or compile commands with GDB. And the execution flow will +turn to vmlinux or u-boot when opensbi ends. + +**Linux Kernel Payload** + +You can also choose to use Linux kernel as payload by enabling FW_PAYLOAD=y +along with specifying FW_PAYLOAD_OFFSET. The kernel image will be embedded in +the OPENSBI firmware binary, T-head will directly boot into Linux after OpenSBI. |