riscv-software-src/opensbi

No sign of kernel initialisation on Spike

OrkunAliOzkan opened this issue · 1 comments

I am attempting to boot OpenSBI+linux on the Spike simulator, and have been making good use of documentation https://github.com/riscv-software-src/opensbi/blob/master/docs/platform/spike.md

I built my kernel image:

make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- defconfig
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-

And embedded it into the OpenSBI executable:

make PLATFORM=generic CROSS_COMPILE=riscv64-linux-gnu- FW_PAYLOAD_PATH=/path/to/kernel/Image

Then proceeded to run the simulator:

spike -m256 \
    --isa=RV64IMAFDC \
    --bootargs 'root=/dev/ram rw console=hvc0 earlycon=sbi' \
    path/to/the/fw_payload.elf \
    --kernel=/path/to/kernel/Image

Which results in console log output:

OpenSBI v1.2-105-g2868f26
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|___/_____|
        | |
        |_|

Platform Name             : ucbbar,spike-bare
Platform Features         : medeleg
Platform HART Count       : 1
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 10000000Hz
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform PMU Device       : ---
Platform Reboot Device    : htif
Platform Shutdown Device  : htif
Platform Suspend Device   : ---
Platform CPPC Device      : ---
Firmware Base             : 0x80000000
Firmware Size             : 232 KB
Firmware RW Offset        : 0x20000
Runtime SBI Version       : 1.0

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*
Domain0 Region00          : 0x0000000080000000-0x000000008001ffff M: (R,X) S/U: ()
Domain0 Region01          : 0x0000000000020000-0x000000008003ffff M: (R,X) S/U: ()
Domain0 Region02          : 0x0000000002080000-0x00000000020bffff M: (I,R,W) S/U: ()
Domain0 Region03          : 0x0000000002000000-0x000000000207ffff M: (I,R,W) S/U: ()
Domain0 Region04          : 0x0000000000000000-0xffffffffffffffff M: (R,W,X) S/U: (R,W,X)
Domain0 Next Address      : 0x0000000080200000
Domain0 Next Arg1         : 0x0000000082200000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes
Domain0 SysSuspend        : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART Priv Version    : v1.12
Boot HART Base ISA        : rv64imafdc
Boot HART ISA Extensions  : none
Boot HART PMP Count       : 16
Boot HART PMP Granularity : 4
Boot HART PMP Address Bits: 54
Boot HART MHPM Count      : 0
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x00000000000b109

Which clearly shows the kernel initalising is not presented, if running at all. I know the contents of the firmware can run when built with this cross compiler, because I attempted to run opensbi on the sim with the test payload only and it ran, however I am unsure of how to diagnose this problem and proceed further. Any insight would be greatly appreciated.

For those interested in replicating my steps:
Busybox: v1.36.0
Linux: https://github.com/litex-hub/linux/tree/litex-rebase
OpenSBI: 2868f26
Toolchain: riscv64-unknown-elf-gcc-12.1.0