]> git.proxmox.com Git - mirror_qemu.git/commitdiff
roms: Add OpenSBI version 0.4
authorAlistair Francis <alistair.francis@wdc.com>
Tue, 16 Jul 2019 18:47:22 +0000 (11:47 -0700)
committerPalmer Dabbelt <palmer@sifive.com>
Thu, 18 Jul 2019 21:18:43 +0000 (14:18 -0700)
Add OpenSBI version 0.4 as a git submodule and as a prebult binary.

OpenSBI (https://github.com/riscv/opensbi) aims to provide an open-source
reference implementation of the RISC-V Supervisor Binary Interface (SBI)
specifications for platform-specific firmwares executing in M-mode. For all
supported platforms, OpenSBI provides several runtime firmware examples.
These example firmwares can be used to replace the legacy riscv-pk bootloader
and enable the use of well-known bootloaders such as U-Boot.

OpenSBI is distributed under the terms of the BSD 2-clause license
("Simplified BSD License" or "FreeBSD License", SPDX: BSD-2-Clause). OpenSBI
source code also contains code reused from other projects desribed here:
https://github.com/riscv/opensbi/blob/master/ThirdPartyNotices.md.

In this case all of the code we are using from OpenSBI is BSD 2-clause
as we aren't using the Kendryte code (Apache-2.0) with QEMU and libfdt
is dual licensed as BSD 2-clause (and GPL-2.0+). OpenSBI isn't being
linked with QEMU either it is just being included with QEMU.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
.gitmodules
LICENSE
Makefile
pc-bios/README
pc-bios/opensbi-riscv32-virt-fw_jump.bin [new file with mode: 0755]
pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin [new file with mode: 0755]
pc-bios/opensbi-riscv64-virt-fw_jump.bin [new file with mode: 0755]
roms/Makefile
roms/opensbi [new submodule]

index 2857eec76377d66da7e33fee8df937842d6928ce..c5c474169dc7191ce55f5a1b00b81fcea6c3973b 100644 (file)
@@ -55,3 +55,6 @@
 [submodule "slirp"]
        path = slirp
        url = https://git.qemu.org/git/libslirp.git
+[submodule "roms/opensbi"]
+       path = roms/opensbi
+       url =   https://git.qemu.org/git/opensbi.git
diff --git a/LICENSE b/LICENSE
index 0e0b4b9553a5057ab29a20036e03ad113cfcb940..9389ba614f80b232ffb99d4121983f63ac86d845 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,13 +1,18 @@
-The following points clarify the QEMU license:
+The QEMU distribution includes both the QEMU emulator and
+various firmware files.  These are separate programs that are
+distributed together for our users' convenience, and they have
+separate licenses.
 
-1) QEMU as a whole is released under the GNU General Public License,
-version 2.
+The following points clarify the license of the QEMU emulator:
 
-2) Parts of QEMU have specific licenses which are compatible with the
-GNU General Public License, version 2. Hence each source file contains
-its own licensing information.  Source files with no licensing information
-are released under the GNU General Public License, version 2 or (at your
-option) any later version.
+1) The QEMU emulator as a whole is released under the GNU General
+Public License, version 2.
+
+2) Parts of the QEMU emulator have specific licenses which are compatible
+with the GNU General Public License, version 2. Hence each source file
+contains its own licensing information.  Source files with no licensing
+information are released under the GNU General Public License, version
+2 or (at your option) any later version.
 
 As of July 2013, contributions under version 2 of the GNU General Public
 License (and no later version) are only accepted for the following files
index f9791dcb8278d933246c2965828a5192e08a8bec..386e13a6ea01af1e9e1f8a3445abfbad33f80805 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -770,7 +770,10 @@ palcode-clipper \
 u-boot.e500 u-boot-sam460-20100605.bin \
 qemu_vga.ndrv \
 edk2-licenses.txt \
-hppa-firmware.img
+hppa-firmware.img \
+opensbi-riscv32-virt-fw_jump.bin \
+opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin
+
 
 DESCS=50-edk2-i386-secure.json 50-edk2-x86_64-secure.json \
 60-edk2-aarch64.json 60-edk2-arm.json 60-edk2-i386.json 60-edk2-x86_64.json
index 0a17f3ec6df1a319cddb7e7dd4feabe472135459..68b4a81103cb4e240def17e738c5a0138935e7c9 100644 (file)
   ARM. Licensing information is given in "edk2-licenses.txt". The image files
   are described by the JSON documents in the "pc-bios/descriptors" directory,
   which conform to the "docs/interop/firmware.json" schema.
+
+- OpenSBI (https://github.com/riscv/opensbi) aims to provide an open-source
+  reference implementation of the RISC-V Supervisor Binary Interface (SBI)
+  specifications for platform-specific firmwares executing in M-mode. For all
+  supported platforms, OpenSBI provides several runtime firmware examples.
+  These example firmwares can be used to replace the legacy riscv-pk bootloader
+  and enable the use of well-known bootloaders such as U-Boot.
+  OpenSBI is distributed under the terms of the BSD 2-clause license
+  ("Simplified BSD License" or "FreeBSD License", SPDX: BSD-2-Clause). OpenSBI
+  source code also contains code reused from other projects desribed here:
+  https://github.com/riscv/opensbi/blob/master/ThirdPartyNotices.md.
diff --git a/pc-bios/opensbi-riscv32-virt-fw_jump.bin b/pc-bios/opensbi-riscv32-virt-fw_jump.bin
new file mode 100755 (executable)
index 0000000..f5bcaa5
Binary files /dev/null and b/pc-bios/opensbi-riscv32-virt-fw_jump.bin differ
diff --git a/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin b/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
new file mode 100755 (executable)
index 0000000..5d7a1ef
Binary files /dev/null and b/pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin differ
diff --git a/pc-bios/opensbi-riscv64-virt-fw_jump.bin b/pc-bios/opensbi-riscv64-virt-fw_jump.bin
new file mode 100755 (executable)
index 0000000..4cec6f0
Binary files /dev/null and b/pc-bios/opensbi-riscv64-virt-fw_jump.bin differ
index 078d3fb70563ac43eaccb01c0eb77aa00504790d..dc70fb5aea3f97fbf68acfc9f2a64c9e2b14751f 100644 (file)
@@ -37,6 +37,8 @@ find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
 powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
 powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
 x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
+riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
+riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
 
 # tag our seabios builds
 SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
@@ -52,18 +54,21 @@ EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
 default:
        @echo "nothing is build by default"
        @echo "available build targets:"
-       @echo "  bios           -- update bios.bin (seabios)"
-       @echo "  vgabios        -- update vgabios binaries (seabios)"
-       @echo "  sgabios        -- update sgabios binaries"
-       @echo "  pxerom         -- update nic roms (bios only)"
-       @echo "  efirom         -- update nic roms (bios+efi)"
-       @echo "  slof           -- update slof.bin"
-       @echo "  skiboot        -- update skiboot.lid"
-       @echo "  u-boot.e500    -- update u-boot.e500"
-       @echo "  u-boot.sam460  -- update u-boot.sam460"
-       @echo "  efi            -- update UEFI (edk2) platform firmware"
-       @echo "  clean          -- delete the files generated by the previous" \
-                                 "build targets"
+       @echo "  bios               -- update bios.bin (seabios)"
+       @echo "  vgabios            -- update vgabios binaries (seabios)"
+       @echo "  sgabios            -- update sgabios binaries"
+       @echo "  pxerom             -- update nic roms (bios only)"
+       @echo "  efirom             -- update nic roms (bios+efi)"
+       @echo "  slof               -- update slof.bin"
+       @echo "  skiboot            -- update skiboot.lid"
+       @echo "  u-boot.e500        -- update u-boot.e500"
+       @echo "  u-boot.sam460      -- update u-boot.sam460"
+       @echo "  efi                -- update UEFI (edk2) platform firmware"
+       @echo "  opensbi32-virt     -- update OpenSBI for 32-bit virt machine"
+       @echo "  opensbi64-virt     -- update OpenSBI for 64-bit virt machine"
+       @echo "  opensbi64-sifive_u -- update OpenSBI for 64-bit sifive_u machine"
+       @echo "  clean              -- delete the files generated by the previous" \
+                                     "build targets"
 
 bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
        cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
@@ -162,6 +167,24 @@ skiboot:
 efi: edk2-basetools
        $(MAKE) -f Makefile.edk2
 
+opensbi32-virt:
+       $(MAKE) -C opensbi \
+               CROSS_COMPILE=$(riscv32_cross_prefix) \
+               PLATFORM="qemu/virt"
+       cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv32-virt-fw_jump.bin
+
+opensbi64-virt:
+       $(MAKE) -C opensbi \
+               CROSS_COMPILE=$(riscv64_cross_prefix) \
+               PLATFORM="qemu/virt"
+       cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-virt-fw_jump.bin
+
+opensbi64-sifive_u:
+       $(MAKE) -C opensbi \
+               CROSS_COMPILE=$(riscv64_cross_prefix) \
+               PLATFORM="qemu/sifive_u"
+       cp opensbi/build/platform/qemu/virt/firmware/fw_jump.bin ../pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin
+
 clean:
        rm -rf seabios/.config seabios/out seabios/builds
        $(MAKE) -C sgabios clean
@@ -173,3 +196,4 @@ clean:
        $(MAKE) -C u-boot-sam460ex distclean
        $(MAKE) -C skiboot clean
        $(MAKE) -f Makefile.edk2 clean
+       $(MAKE) -C opensbi clean
diff --git a/roms/opensbi b/roms/opensbi
new file mode 160000 (submodule)
index 0000000..ce228ee
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit ce228ee0919deb9957192d723eecc8aaae2697c6