Skip to content

Commit

Permalink
build: Fix qemu run fail issue due to missing _zicbom_svpbmt extensio…
Browse files Browse the repository at this point in the history
…n and optimize S03net

Now evalsoc dts configs contains xec node but not enabled, and added _zicbom_svpbmt
extension for xec driver requirement, so evalsoc without these extension will trap like below

so we add these extensions in during qemu running by default

[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] Unable to handle kernel paging request at virtual address ff20000004002080
[    0.000000] Oops [#1]
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.6.63+ #1
[    0.000000] Hardware name: nuclei,evalsoc (DT)
[    0.000000] epc : 0xffffffff8030dc4e
[    0.000000]  ra : 0xffffffff8030dbb8
[    0.000000] epc : ffffffff8030dc4e ra : ffffffff8030dbb8 sp : ffffffff80e03c50
[    0.000000]  gp : ffffffff80eb7ff0 tp : ffffffff80e0bc80 t0 : ff60000001445f40
[    0.000000]  t1 : 0000000000000000 t2 : 0000000000000003 s0 : ffffffff80e03c80
[    0.000000]  s1 : ff6000007c3e1000 a0 : ff6000007c3e1010 a1 : 0000000000000002
[    0.000000]  a2 : 0000000000000000 a3 : ff20000004002080 a4 : 0000000000000001
[    0.000000]  a5 : ff20000004002080 a6 : 0000000000000040 a7 : ff60000001445f40
[    0.000000]  s2 : 0000000000000001 s3 : 0000000000000000 s4 : ff6000007dff54a0
[    0.000000]  s5 : 0000000000000001 s6 : 0000000000000010 s7 : 0000000000000000
[    0.000000]  s8 : ffffffff80813000 s9 : 0000000000000001 s10: ffffffff80e03c98
[    0.000000]  s11: ff6000007c3e1000 t3 : 0000000000000000 t4 : 0000000000000002
[    0.000000]  t5 : ffffffff80e826a8 t6 : ffffffff80c003b8
[    0.000000] status: 0000000200000100 badaddr: ff20000004002080 cause: 000000000000000d
[    0.000000] [<ffffffff8030dc4e>] 0xffffffff8030dc4e
[    0.000000] [<ffffffff80617a86>] 0xffffffff80617a86
[    0.000000] [<ffffffff80617c3e>] 0xffffffff80617c3e
[    0.000000] [<ffffffff806200c6>] 0xffffffff806200c6
[    0.000000] [<ffffffff80617618>] 0xffffffff80617618
[    0.000000] [<ffffffff806040c8>] 0xffffffff806040c8
[    0.000000] [<ffffffff80600a14>] 0xffffffff80600a14
[    0.000000] Code: 00f4 70a2 7402 64e2 6942 69a2 6145 8082 000f 0140 (4398) 000f
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] Kernel panic - not syncing: Attempted to kill the idle task!
[    0.000000] ---[ end Kernel panic - not syncing: Attempted to kill the idle task! ]---

Signed-off-by: Huaqi Fang <[email protected]>
  • Loading branch information
fanghuaqi committed Dec 5, 2024
1 parent 84ada7b commit 955bbbf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ linux: $(linux_wrkdir)/.config
initrd: $(buildroot_initramfs_sysroot) $(linux_image)
$(INITRAMFS_PRECMD)
# Copy files required for xec network startup
[ -f $(confdir)/S03net ] && cp -af $(confdir)/S03net $(buildroot_initramfs_sysroot)/etc/init.d/
[ -f $(confdir)/S03net ] && cp -af $(confdir)/S03net $(buildroot_initramfs_sysroot)/etc/init.d/ || true
cd $(linux_wrkdir) && \
$(linux_gen_initramfs) \
-o $(initramfs) -u $(shell id -u) -g $(shell id -g) \
Expand Down Expand Up @@ -557,7 +557,7 @@ $(qemu_disk): $(boot_zip)

run_qemu: $(qemu_disk) $(freeloader_elf)
@echo "Run on qemu for simulation"
$(qemu) $(QEMU_MACHINE_OPTS) -cpu nuclei-$(CORE),ext=$(ARCH_EXT) -bios $(freeloader_elf) -nographic -drive file=$(qemu_disk),if=sd,format=raw
$(qemu) $(QEMU_MACHINE_OPTS) -cpu nuclei-$(CORE),ext=$(ARCH_EXT)_zicbom_svpbmt_sscof -bios $(freeloader_elf) -nographic -drive file=$(qemu_disk),if=sd,format=raw

.PHONY: backup snapshot genstamp genboot
# backup your build
Expand Down
30 changes: 26 additions & 4 deletions conf/evalsoc/S03net
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
#!/bin/sh
# config nuclei xec disable autoneg, setting 100M, fduplex mode.

ls /sys/class/net/eth0 2>1 > /dev/null
haseth0=$?

start() {
ethtool -s eth0 autoneg off speed 100 duplex full &
ifconfig lo up &
udhcpc &
if [[ $haseth0 == 0 ]] then
echo "Configure eth0 autoneg off speed 100 duplex full!"
ethtool -s eth0 autoneg off speed 100 duplex full &
ifconfig lo up &
udhcpc &
else
echo "eth0 device not present, will not configure it!"
fi
}

stop() {
if [[ $haseth0 == 0 ]] then
echo "eth0 & lo network down!"
ifconfig lo down &
ifconfig eth0 down &
else
echo "eth0 device not present, will not configure it!"
fi
}

restart() {
start
}

case "$1" in
start|stop|restart)
"$1";;
*)
echo "Usage: $0 {start|stop|restart|reload}"
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

0 comments on commit 955bbbf

Please sign in to comment.