diff --git a/.gitmodules b/.gitmodules
index 2857eec76377..7a10e72e09cd 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -55,3 +55,6 @@
 [submodule "slirp"]
 	path = slirp
 	url = https://git.qemu.org/git/libslirp.git
+[submodule "roms/opensbi"]
+	path = roms/opensbi
+	url = https://github.com/riscv/opensbi.git
diff --git a/Makefile b/Makefile
index cfb18f152544..c74e5ba91402 100644
--- a/Makefile
+++ b/Makefile
@@ -761,7 +761,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
diff --git a/pc-bios/opensbi-riscv32-virt-fw_jump.bin b/pc-bios/opensbi-riscv32-virt-fw_jump.bin
new file mode 100644
index 0000000000000000000000000000000000000000..c3e2aaa5148930754d3f88dcc9c6efdb961774d8
GIT binary patch
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 100644
index 0000000000000000000000000000000000000000..530d53f3c84632f2170fe0ea0b4a29019153de65
GIT binary patch
diff --git a/pc-bios/opensbi-riscv64-virt-fw_jump.bin b/pc-bios/opensbi-riscv64-virt-fw_jump.bin
new file mode 100644
index 0000000000000000000000000000000000000000..e6c1986b72081ecf3607b2110628cf8214fa8f00
GIT binary patch
diff --git a/roms/Makefile b/roms/Makefile
index 078d3fb70563..562ed726fd6b 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -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-virt:
+	$(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
index 000000000000..ca20ac0cd4c0
--- /dev/null
+++ b/roms/opensbi
@@ -0,0 +1 @@
+Subproject commit ca20ac0cd4c099006d4eea4d9ac7bd7b58e2ae0f
