/dts-v1/;
/ {
#address-cells = <2>;
#size-cells = <2>;
compatible = "riscv-virtio";
model = "riscv-virtio,qemu";
chosen {
bootargs = "console=ttyS0,115200 earlycon root=/dev/vda2 rw rootwait";
stdout-path = "serial0:115200n8";
};
memory@80000000 {
device_type = "memory";
reg = <0x0 0x80000000 0x0 0x8000000>;
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
timebase-frequency = <10000000>;
cpu0: cpu@0 {
device_type = "cpu";
reg = <0>;
compatible = "riscv";
riscv,isa = "rv64imafdc";
mmu-type = "riscv,sv48";
interrupt-controller {
#interrupt-cells = <1>;
compatible = "riscv,cpu-intc";
interrupt-controller;
};
};
};
soc {
#address-cells = <2>;
#size-cells = <2>;
compatible = "simple-bus";
ranges;
uart0: serial@10000000 {
compatible = "ns16550a";
reg = <0x0 0x10000000 0x0 0x100>;
interrupts = <10>;
interrupt-parent = <&plic>;
clock-frequency = <3686400>;
reg-shift = <0>;
reg-io-width = <1>;
no-loopback-test;
};
virtio_blk: virtio@10001000 {
compatible = "virtio,mmio";
reg = <0x0 0x10001000 0x0 0x1000>;
interrupts = <1>;
interrupt-parent = <&plic>;
};
/* 使用QEMU标准的PLIC配置 */
plic: interrupt-controller@c000000 {
compatible = "sifive,plic-1.0.0", "riscv,plic0";
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
reg = <0x0 0xc000000 0x0 0x400000>;
riscv,ndev = <53>;
interrupts-extended = <
&cpu0 11 &cpu0 9
>;
};
clint: clint@2000000 {
compatible = "riscv,clint0";
reg = <0x0 0x2000000 0x0 0x10000>;
interrupts-extended = <&cpu0 3 &cpu0 7>;
};
};
aliases {
serial0 = &uart0;
};
};
Starting kernel ...
[ 0.000000] Linux version 5.15.194 (wangchongyang@LAPTOP-G148G7CE) (riscv64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP Sat Oct 11 10:16:40 CST 2025
[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[ 0.000000] Machine model: riscv-virtio,qemu
[ 0.000000] earlycon: ns16550a0 at MMIO 0x0000000010000000 (options '115200n8')
[ 0.000000] printk: bootconsole [ns16550a0] enabled
[ 0.000000] efi: UEFI not found.
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x0000000087ffffff]
[ 0.000000] SBI specification v1.0 detected
[ 0.000000] SBI implementation ID=0x1 Version=0x10002
[ 0.000000] SBI TIME extension detected
[ 0.000000] SBI IPI extension detected
[ 0.000000] SBI RFENCE extension detected
[ 0.000000] SBI v0.2 HSM extension detected
[ 0.000000] riscv: ISA extensions acdfim
[ 0.000000] riscv: ELF capabilities acdfim
[ 0.000000] percpu: Embedded 18 pages/cpu s33512 r8192 d32024 u73728
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 31815
[ 0.000000] Kernel command line: console=ttyS0,115200 earlycon root=/dev/vda2 rw rootwait
[ 0.000000] Dentry cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] fixmap : 0xffffffcefea00000 - 0xffffffceff000000 (6144 kB)
[ 0.000000] pci io : 0xffffffceff000000 - 0xffffffcf00000000 ( 16 MB)
[ 0.000000] vmemmap : 0xffffffcf00000000 - 0xffffffcfffffffff (4095 MB)
[ 0.000000] vmalloc : 0xffffffd000000000 - 0xffffffdfffffffff (65535 MB)
[ 0.000000] modules : 0xffffffff01127000 - 0xffffffff80000000 (2030 MB)
[ 0.000000] lowmem : 0xffffffe000000000 - 0xffffffe007e00000 ( 126 MB)
[ 0.000000] kernel : 0xffffffff80000000 - 0xffffffffffffffff (2047 MB)
[ 0.000000] Memory: 108508K/129024K available (6159K kernel code, 4867K rwdata, 2048K rodata, 2145K init, 304K bss, 20516K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] rcu: RCU debug extended QS entry/exit.
[ 0.000000] Tracing variant of Tasks RCU enabled.
[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] riscv-intc: 64 local interrupts mapped
[ 0.000000] OF: /soc/interrupt-controller@c000000: could not get #interrupt-cells for /cpus/cpu@0
[ 0.000000] ------------[ cut here ]------------
[ 0.000000] WARNING: CPU: 0 PID: 0 at drivers/irqchip/irq-sifive-plic.c:304 plic_init+0x92/0x3e8
[ 0.000000] Modules linked in:
[ 0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.15.194 #1
[ 0.000000] Hardware name: riscv-virtio,qemu (DT)
[ 0.000000] epc : plic_init+0x92/0x3e8
[ 0.000000] ra : plic_init+0x8e/0x3e8
[ 0.000000] epc : ffffffff808179c2 ra : ffffffff808179be sp : ffffffff81003db0
[ 0.000000] gp : ffffffff810d8cd0 tp : ffffffff8100bd80 t0 : 2f00000000000000
[ 0.000000] t1 : 000000000000004f t2 : 2f636f732f203a46 s0 : ffffffff81003ee0
[ 0.000000] s1 : ffffffe0016090e0 a0 : 0000000000000000 a1 : 0000000000000100
[ 0.000000] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000
[ 0.000000] a5 : 0000000000000000 a6 : 0000000000000008 a7 : 0000000000000038
[ 0.000000] s2 : fffffffffffffff4 s3 : ffffffff81003ee8 s4 : ffffffe007dfd788
[ 0.000000] s5 : ffffffff81003ef8 s6 : 0000000000000000 s7 : ffffffff81003ef8
[ 0.000000] s8 : dead000000000100 s9 : 0000000000000008 s10: fffffffffffffff7
[ 0.000000] s11: 0000000000000000 t3 : ffffffff810e74df t4 : ffffffff810e74df
[ 0.000000] t5 : ffffffff810e74e0 t6 : ffffffff81003998
[ 0.000000] status: 0000000000000100 badaddr: 0000000000000000 cause: 0000000000000003
[ 0.000000] [<ffffffff808179c2>] plic_init+0x92/0x3e8
[ 0.000000] [<ffffffff8082296c>] of_irq_init+0x166/0x296
[ 0.000000] [<ffffffff8081781a>] irqchip_init+0x18/0x20
[ 0.000000] [<ffffffff80802bd8>] init_IRQ+0x10/0x32
[ 0.000000] [<ffffffff80800b2e>] start_kernel+0x498/0x6ec
[ 0.000000] ---[ end trace aa3ca570f1df3acf ]---
[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[ 0.000059] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[ 0.003214] Console: colour dummy device 80x25
[ 0.004490] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=40000)
[ 0.004814] pid_max: default: 32768 minimum: 301
[ 0.008304] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.008523] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.026987] ASID allocator using 16 bits (65536 entries)
[ 0.027745] rcu: Hierarchical SRCU implementation.
[ 0.029040] EFI services will not be available.
[ 0.030892] smp: Bringing up secondary CPUs ...
[ 0.031052] smp: Brought up 1 node, 1 CPU
[ 0.038099] devtmpfs: initialized
[ 0.041633] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.041968] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[ 0.045688] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[ 0.052683] OF: /soc/interrupt-controller@c000000: could not get #interrupt-cells for /cpus/cpu@0
[ 0.053124] OF: /soc/clint@2000000: could not get #interrupt-cells for /cpus/cpu@0
[ 0.054322] OF: /soc/interrupt-controller@c000000: could not get #interrupt-cells for /cpus/cpu@0
[ 0.055149] OF: /soc/clint@2000000: could not get #interrupt-cells for /cpus/cpu@0
[ 0.067024] iommu: Default domain type: Translated
[ 0.067199] iommu: DMA domain TLB invalidation policy: strict mode
[ 0.069677] vgaarb: loaded
[ 0.070496] SCSI subsystem initialized
[ 0.072045] usbcore: registered new interface driver usbfs
[ 0.072298] usbcore: registered new interface driver hub
[ 0.072493] usbcore: registered new device driver usb
[ 0.081539] clocksource: Switched to clocksource riscv_clocksource
[ 0.091346] NET: Registered PF_INET protocol family
[ 0.092311] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 0.094532] tcp_listen_portaddr_hash hash table entries: 128 (order: 0, 4096 bytes, linear)
[ 0.094760] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[ 0.094906] TCP established hash table entries: 1024 (order: 1, 8192 bytes, linear)
[ 0.095205] TCP bind hash table entries: 1024 (order: 3, 32768 bytes, linear)
[ 0.095409] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.098081] UDP hash table entries: 256 (order: 2, 24576 bytes, linear)
[ 0.098403] UDP-Lite hash table entries: 256 (order: 2, 24576 bytes, linear)
[ 0.099320] NET: Registered PF_UNIX/PF_LOCAL protocol family
[ 0.102586] RPC: Registered named UNIX socket transport module.
[ 0.103008] RPC: Registered udp transport module.
[ 0.103107] RPC: Registered tcp transport module.
[ 0.103223] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.103731] PCI: CLS 0 bytes, default 64
[ 0.108023] workingset: timestamp_bits=62 max_order=15 bucket_order=0
[ 0.115541] NFS: Registering the id_resolver key type
[ 0.116425] Key type id_resolver registered
[ 0.116523] Key type id_legacy registered
[ 0.116836] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 0.117112] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[ 0.118221] 9p: Installing v9fs 9p2000 file system support
[ 0.119563] NET: Registered PF_ALG protocol family
[ 0.120206] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.120390] io scheduler mq-deadline registered
[ 0.120511] io scheduler kyber registered
[ 0.157400] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 0.167656] loop: module loaded
[ 0.170369] e1000e: Intel(R) PRO/1000 Network Driver
[ 0.170515] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[ 0.171094] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.171272] ehci-pci: EHCI PCI platform driver
[ 0.171560] ehci-platform: EHCI generic platform driver
[ 0.171689] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.171945] ohci-pci: OHCI PCI platform driver
[ 0.172239] ohci-platform: OHCI generic platform driver
[ 0.173163] usbcore: registered new interface driver uas
[ 0.173360] usbcore: registered new interface driver usb-storage
[ 0.174434] mousedev: PS/2 mouse device common for all mice
[ 0.175189] sdhci: Secure Digital Host Controller Interface driver
[ 0.175367] sdhci: Copyright(c) Pierre Ossman
[ 0.175626] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.176300] usbcore: registered new interface driver usbhid
[ 0.176383] usbhid: USB HID core driver
[ 0.178196] NET: Registered PF_INET6 protocol family
[ 0.182283] Segment Routing with IPv6
[ 0.182479] In-situ OAM (IOAM) with IPv6
[ 0.183058] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 0.184761] NET: Registered PF_PACKET protocol family
[ 0.185545] 9pnet: Installing 9P2000 support
[ 0.186103] Key type dns_resolver registered
[ 0.189075] debug_vm_pgtable: [debug_vm_pgtable ]: Validating architecture page table helpers
[ 0.194747] clk: Disabling unused clocks
[ 0.196000] Warning: unable to open an initial console.
[ 0.196671] Waiting for root device /dev/vda2...
qemu-system-riscv64 \
-machine virt -m 128M -smp 1 \
-bios opensbi/build/platform/generic/firmware/fw_dynamic.elf \
-kernel u-boot-2023.04/u-boot.bin \
-device virtio-blk-device,drive=disk \
-drive id=disk,file=disk.img,format=raw,if=none \
-nographic
setenv bootargs "console=ttyS0,115200 earlycon root=/dev/vda2 rw rootwait"
load virtio 0:1 0x80200000 Image
load virtio 0:1 0x81400000 bosc_board.dtb
booti 0x80200000 - 0x81400000
一直出plic 问题,问题出在那块,如何解决
最新发布