Run PLIC test from init directly

This commit is contained in:
Rodrigo Arias 2024-09-05 15:06:34 +02:00
parent 4f70ac11ac
commit 0bcb12a259

View File

@ -162,14 +162,9 @@
ash
'';
"/preinit".source = pkgs.writeScript "preinit" ''
"/testplic".source = pkgs.writeScript "testplic" ''
#!${config.system.build.extraUtils}/bin/ash
export PATH=${config.system.build.extraUtils}/bin
# csrtool all-in-order
if read -t 3 -p 'press enter for shell'; then
ash
fi
set -x
@ -241,9 +236,15 @@
echo "--- Testing claim register: SKIP"
fi
)
set +x
echo "all done, dropping to a shell..."
ash
'';
echo "all done, waiting forever..."
while [ 1 ]; do sleep 9999; done
"/preinit".source = pkgs.writeScript "preinit" ''
#!${config.system.build.extraUtils}/bin/ash
export PATH=${config.system.build.extraUtils}/bin
# csrtool all-in-order
# ip addr
# cat /proc/interrupts
@ -273,8 +274,15 @@
# while [ 1 ]; do xxd -s $((0x1bfff0000 - 0x60000000)) \
# -l 4 /dev/qdma34000-MM-1; sleep 0.2; done
preDeviceCommands = ''
echo "Creating a heartbeat counter at 0x1bfff0000"
sh -c 'hb=0; while [ 1 ]; do let hb=$hb+1; devmem 0x1bfff0000 32 $hb; done' &
if read -t 3 -p 'Press enter for shell... '; then
ash
fi
echo "Running tests..."
sh /testplic
# echo "Creating a heartbeat counter at 0x1bfff0000"
# sh -c 'hb=0; while [ 1 ]; do let hb=$hb+1; devmem 0x1bfff0000 32 $hb; done' &
''
+
# Disable proactive compaction. May be better to disable CONFIG_COMPACTION.
@ -477,7 +485,7 @@
cat > $out <<EOF
git_commit=${rev}
xtrace=yes
bootargs=root=/dev/ram0 loglevel=7 rw earlycon=sbi console=hvc0 debug1 rdinit=/preinit init=${init}
bootargs=root=/dev/ram0 loglevel=7 rw earlycon=sbi console=hvc0 init=${init}
ramdisk_size=$(stat --format %s $(readlink -f ${initrd}))
bootcmd=fdt print; booti \''${kernel_addr_r} \''${ramdisk_addr_r}:\''${ramdisk_size} \''${fdtcontroladdr}
EOF