您尚未登录。

#1 RISC-V » xuantie c906 移植到fpga开发板上后,启动linux卡在Mountpoint-cache hash table entries » 今天 15:46:42

leedh001
回复: 0

大家好,我最近在鼓捣将xuantie c906移植到我手头上的开发板上,从能跑第一个裸程序,到能跳转ddr4,最后到启动引导linux折腾了好久。
现在linux启动就卡住,日志如下:
SPL: C906 PCIe boot -> ZSB
SPL: waiting for DDR images
SPL: poll @ 0xa3ffffc0, expect 0x4942534f
SPL: first DDR read...
SPL: mem@0xa03f8000=0x000702b7 0x907322cd
SPL: jump ZSB @ 0xA03F8000
SPL: about to jr
ZSB: next_stage -> OpenSBI=0x00000000_0xa03f8000

OpenSBI v0.9
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|

Platform Name : T-HEAD C906 FPGA SoftCPU
Platform Features : mfdeleg
Platform HART Count : 1
Platform IPI Device : clint
Platform Timer Device : clint
Platform Console Device : uart8250
Platform HSM Device : ---
Platform SysReset Device : ---
Firmware Base : 0xa0000000
Firmware Size : 108 KB
Runtime SBI Version : 0.3

Domain0 Name : root
Domain0 Boot HART : 0
Domain0 HARTs : 0*
Domain0 Region00 : 0x0000004004000000-0x000000400400ffff (I)
Domain0 Region01 : 0x00000000a0000000-0x00000000a001ffff ()
Domain0 Region02 : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address : 0x00000000a0400000
Domain0 Next Arg1 : 0x00000000a8000000
Domain0 Next Mode : S-mode
Domain0 SysReset : yes

Boot HART ID : 0
Boot HART Domain : root
Boot HART ISA : rv64imafdcsux
Boot HART Features : scounteren,mcounteren,time
Boot HART PMP Count : 16
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 38
Boot HART MHPM Count : 8
Boot HART MHPM Count : 8
Boot HART MIDELEG : 0x0000000000000222
Boot HART MEDELEG : 0x000000000000b109
[ 0.000000] Linux version 5.10.4 (test@dev) (riscv64-unknown-linux-gnu-gcc (Xuantie-900 linux-5.10.4 glibc gcc Toolchain V2.6.1 B-20220906) 10.2.0, GNU ld (GNU Binutils) 2.35) #13 Thu Aug 13 23:07:35 CST 2026
[ 0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[ 0.000000] printk: bootconsole [sbi0] enabled
[ 0.000000] printk: debug: skip boot console de-registration.
[ 0.000000] efi: UEFI not found.
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x00000000a0400000-0x00000000c03fffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000a0400000-0x00000000c03fffff]
[ 0.000000] Initmem setup node 0 [mem 0x00000000a0400000-0x00000000c03fffff]
[ 0.000000] On node 0 totalpages: 131072
[ 0.000000] DMA32 zone: 1792 pages used for memmap
[ 0.000000] DMA32 zone: 0 pages reserved
[ 0.000000] DMA32 zone: 131072 pages, LIFO batch:31
[ 0.000000] software IO TLB: mapped [mem 0x00000000bbcc4000-0x00000000bfcc4000] (64MB)
[ 0.000000] SBI specification v0.3 detected
[ 0.000000] SBI implementation ID=0x1 Version=0x9
[ 0.000000] SBI v0.2 TIME extension detected
[ 0.000000] SBI v0.2 IPI extension detected
[ 0.000000] SBI v0.2 RFENCE extension detected
[ 0.000000] riscv: ISA extensions acdfim
[ 0.000000] riscv: ELF capabilities acdfim
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 129280
[ 0.000000] Kernel command line: console=ttyS0,19200n8 earlycon=sbi keep_bootcon maxcpus=1 nr_cpus=1 rdinit=/sbin/init loglevel=8
[ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[ 0.000000] Sorting __ex_table...
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 421652K/524288K available (6037K kernel code, 4756K rwdata, 4096K rodata, 184K init, 333K bss, 102636K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] riscv-intc: 64 local interrupts mapped
[ 0.000000] plic: interrupt-controller@4000000000: mapped 64 interrupts with 1 handlers for 2 contexts.
[ 0.000000] random: get_random_bytes called from start_kernel+0x37c/0x4ee with crng_init=0
[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
[ 0.000093] sched_clock: 64 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns
[ 0.050672] Console: colour dummy device 80x25
[ 0.077894] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=400000)
[ 0.140377] pid_max: default: 32768 minimum: 301
[ 0.170140] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[ 0.214027] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)

后面就再也不打印任何东东了,就停住了。怀疑是ddr4跟c906之间接的有问题,但是不知道咋整。
我的这个板子不太好做jtag调试,全靠加日志定位(下面的github链接里还有其他加了很多调试的日志),加了一堆也没定位到。

我的板子能插ddr4,有pcie3.0,但是不太好接外置存储器,我就将linux系统相关文件通过xdma写入到ddr4,然后再通过xdma的axi-lite释放cpu复位这样子。
ddr4通过axi_interconnect128.v给接了进去,同时通过smartConnect达到支持c906和xdma都能访问ddr4。

我的整个启动链条是SPL->zero_stage_boot->openSBI->linux。

我把整个工程都开源了:https://github.com/leedh001/c906

我实在没招了,请大家给点儿思路。

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn


东莞哇酷科技有限公司开发