From a4a1c573e5b0c47fe151a943d03e1d3d92482bab Mon Sep 17 00:00:00 2001 From: Wei6 Zhang Date: Thu, 9 Oct 2025 09:59:39 +0800 Subject: [PATCH] misc: Add RISC-V board configuration for QEMU virt platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add board XML configuration file for RISC-V QEMU virt machine. Key features: - Board and firmware information (U-Boot, QEMU virt platform) - Memory layout from /proc/iomem - PCI device configuration for virtio devices - 4-core processor configuration - Serial console (ttyS0) at 0x10000000 Added comprehensive FIXME documentation explaining: 1. Most information was manually collected rather than auto-extracted 2. Original board inspector relies on x86-specific mechanisms: - DMI/SMBIOS (dmidecode) vs Device Tree - ACPI vs Device Tree - APIC/IOAPIC vs PLIC/CLINT - BIOS vs OpenSBI/U-Boot 3. Fields needing RISC-V adaptation: - AVAILABLE_IRQ_INFO: x86 ISA IRQs (0-15) → PLIC range (1-95+) - apic_id → hart_id - IOAPIC, DRHD (not applicable) The VM is started with: qemu-system-riscv64 \ -machine virt -nographic -m 2048 -smp 4 \ -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \ -device virtio-net-device,netdev=eth0 -netdev user,id=eth0 \ -device virtio-rng-pci \ -drive file=,format=raw,if=virtio Tracked-On: #8814 Reviewed-by: Victor Sun Reviewed-by: Fei Li Signed-off-by: Wei6 Zhang --- .../data/qemu-riscv/qemu-riscv.xml | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 misc/config_tools/data/qemu-riscv/qemu-riscv.xml diff --git a/misc/config_tools/data/qemu-riscv/qemu-riscv.xml b/misc/config_tools/data/qemu-riscv/qemu-riscv.xml new file mode 100644 index 000000000..bb61de337 --- /dev/null +++ b/misc/config_tools/data/qemu-riscv/qemu-riscv.xml @@ -0,0 +1,198 @@ + + + + + BIOS Information + Vendor: U-Boot + Version: 2025.01-0ubuntu0.24.04.2 + Release Date: 01/01/2025 + BIOS Revision: 25.1 + + + Base Board Information + Manufacturer: riscv-virtio + Product Name: qemu + Version: Not Specified + + + 00:01.0 1af4: 1041 Network controller: Virtio network device + 00:02.0 1af4: 1043 Communication controller: Virtio console + + + 00:01.0 0200: 1af4:1041 + 00:02.0 0780: 1af4:1043 + + + /* Wake vector not applicable for RISC-V */ + + + /* Reset register info for RISC-V */ + + + /* Power management info for RISC-V */ + + + /* S3 suspend info */ + + + /* S5 power off info */ + + + + "RISC-V SiFive U74 Processor" + + + /* Cx data is not available */ + + + /* Px data is not available */ + + + /* PCI mmcfg base of MCFG */ + #define DEFAULT_PCI_MMCFG_BASE 0xb0000000UL + + + /* no TPM device */ + + + + +00101000-00101fff : 101000.rtc rtc@101000 +10000000-100000ff : serial +10008000-10008fff : 10008000.virtio_mmio virtio_mmio@10008000 +10100000-10100017 : fw_cfg_mem +20000000-21ffffff : 20000000.flash flash@20000000 +22000000-23ffffff : 20000000.flash flash@20000000 +30000000-3fffffff : PCI ECAM +40000000-7fffffff : pci@30000000 + 40000000-40000fff : 0000:00:01.0 + 40001000-40001fff : 0000:00:02.0 +80000000-8005ffff : Reserved +80060000-fdec2fff : System RAM + ea200000-ea201fff : Reserved + ea202000-ecb92827 : Kernel image + ea202000-eaf6f9e1 : Kernel code + eb800000-ec3fffff : Kernel rodata + ec600000-eca83bff : Kernel data + eca84000-ecb92827 : Kernel bss + ecb92828-ecbfffff : Reserved + f2327000-f2328fff : Reserved + f2527000-f6855fff : Reserved + f9e00000-fddfffff : Reserved + fdea7000-fdea7fff : Reserved + fdea9000-fdea9fff : Reserved + fdeaa000-fdeaafff : Reserved + fdeb9000-fdebefff : Reserved +fdec3000-fdec3fff : Reserved +fdec4000-fdec4fff : System RAM +fdec5000-fdee6fff : Reserved +fdee7000-fef2cfff : System RAM + fdf2d000-fef2cfff : Reserved +fef2d000-fef2dfff : Reserved +fef2e000-ff718fff : System RAM +ff719000-ff71afff : Reserved +ff71b000-ffffffff : System RAM + ff803000-ffa08fff : Reserved + ffa09000-ffd0afff : Reserved + ffd0b000-ffd0bfff : Reserved + ffd0c000-ffde3fff : Reserved + ffde5000-ffde8fff : Reserved + ffde9000-ffdf5fff : Reserved + ffdf6000-ffffffff : Reserved +400000000-7ffffffff : pci@30000000 + 400000000-400003fff : 0000:00:01.0 + 400000000-400003fff : virtio-pci-modern + 400004000-400007fff : 0000:00:02.0 + 400004000-400007fff : virtio-pci-modern + + + /dev/vda1: TYPE="ext4" + + + seri:/dev/ttyS0 type:mmio base:0x10000000 irq:14 + + + 3, 4, 5, 6, 7, 8, 9, 11 + + + 4038724 kB + + + 0, 1, 2, 3 + + + 3 + + + + + 0 + 0x0 + + + + 1 + 0x1 + + + + 2 + 0x2 + + + + 3 + 0x3 + + + + + + + + + + + + + 0x1234 + 0x1111 + 0x060000 + + + + + + + + + +