56 lines
1.9 KiB
Diff
56 lines
1.9 KiB
Diff
From 48fb0ffbe410feaaf4a122eab7ae3547092fbf35 Mon Sep 17 00:00:00 2001
|
|
From: David Abdurachmanov <davidlt@rivosinc.com>
|
|
Date: Thu, 26 Jan 2023 16:24:47 +0200
|
|
Subject: [PATCH] Use QEMU provided DTB on QEMU targets
|
|
|
|
This is already available for Unleashed/Unmatched boards. Typically we
|
|
use DTB built and provided by the kernel package in Fedora. For the QEMU
|
|
we can get DTB via:
|
|
|
|
qemu-system-riscv64 -nographic -smp 8 -m 2G -machine virt,dumpdtb=qemu-riscv.dtb
|
|
|
|
Then this needs to be placed (in /boot partition):
|
|
|
|
/dtb-6.0.10-300.0.riscv64.fc37.riscv64
|
|
|
|
In that case EXTLINUX will use fdtdir + machine/vendor information to
|
|
locate it.
|
|
|
|
QEMU DTS is not shipped part of the kernel tree.
|
|
|
|
If fdtdir is removed from extlinux.conf it should just assume that DTB
|
|
is available and loaded from the firmware.
|
|
|
|
QEMU or U-Boot firmware provided DTB is located at fdtcontroladdr. Let's
|
|
set fdt_addr to it.
|
|
|
|
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
|
|
---
|
|
configs/qemu-riscv64_defconfig | 2 ++
|
|
configs/qemu-riscv64_spl_defconfig | 2 ++
|
|
2 files changed, 4 insertions(+)
|
|
|
|
diff --git a/configs/qemu-riscv64_defconfig b/configs/qemu-riscv64_defconfig
|
|
index 611d5eb3..8df45b2b 100644
|
|
--- a/configs/qemu-riscv64_defconfig
|
|
+++ b/configs/qemu-riscv64_defconfig
|
|
@@ -26,3 +26,5 @@ CONFIG_SYSRESET=y
|
|
CONFIG_SYSRESET_SBI=y
|
|
CONFIG_CMD_POWEROFF=y
|
|
CONFIG_SYSRESET_CMD_POWEROFF=y
|
|
+CONFIG_USE_PREBOOT=y
|
|
+CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};"
|
|
diff --git a/configs/qemu-riscv64_spl_defconfig b/configs/qemu-riscv64_spl_defconfig
|
|
index 68b16f0a..28e8b3ef 100644
|
|
--- a/configs/qemu-riscv64_spl_defconfig
|
|
+++ b/configs/qemu-riscv64_spl_defconfig
|
|
@@ -26,3 +26,5 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
|
CONFIG_DM_MTD=y
|
|
CONFIG_SYS_MAX_FLASH_BANKS=2
|
|
# CONFIG_BINMAN_FDT is not set
|
|
+CONFIG_USE_PREBOOT=y
|
|
+CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};"
|
|
--
|
|
2.37.1
|
|
|