I try to recompile the current vf2 kernel from github. It seems to be 6.8.0-rc2
When i try to boot it i get the following log:
U-Boot menu
1: Debian GNU/Linux bookworm/sid 5.15.0-starfive NVME
2: Debian GNU/Linux bookworm/sid vmlinuz-6.1.31 NVME default
3: Debian GNU/Linux bookworm/sid 6.8 NVME
Enter choice: 3
3: Debian GNU/Linux bookworm/sid 6.8 NVME
Retrieving file: /initrd.img-6.8.0-rc2-visionfive-g35960454d7db
5135906 bytes read in 30 ms (163.3 MiB/s)
Retrieving file: /vmlinuz-6.8.0-rc2-visionfive-g35960454d7db
6263296 bytes read in 36 ms (165.9 MiB/s)
append: root=/dev/nvme0n1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0
Retrieving file: /dtbs/starfive/jh7110-visionfive-v2.dtb
48366 bytes read in 5 ms (9.2 MiB/s)
Bad Linux RISCV Image magic!
1: Debian GNU/Linux bookworm/sid 5.15.0-starfive NVME
Retrieving file: /initrd.img-5.15.0-starfive
5153484 bytes read in 35 ms (140.4 MiB/s)
Retrieving file: /vmlinuz-5.15.0-starfive
8420005 bytes read in 52 ms (154.4 MiB/s)
append: root=/dev/nvme0n1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0
Retrieving file: /dtbs/starfive/jh7110-visionfive-v2.dtb
48366 bytes read in 6 ms (7.7 MiB/s)
Uncompressing Kernel Image
Moving Image from 0x44000000 to 0x40200000, end=41973000
So it seems u-boot does not want to boot the kernel.
Inspecting the kernel file i can see that the magic RISCV header is missing:
zless vmlinuz-5.15.0-starfive yields:
MZo^P`^L^A^@^@^@ ^@^@^@^@^@^@0w^A^@^@^@^@^@^@^@^@^@^@^@^@^B^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@RISCV^@^@^@RSC^E@^@^@^@PE^@^@dP^B^@^@^@^@^@^@^
as first line, zless vmlinuz-6.8.0-rc2-visionfive-g35960454d7db yields:
MZ^@^@zimg&^A^@<93>=^^@^@^@^@^@^@^@^@^@zstd22^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@#<82><81>@^@^@^@PE^@^@dP^B^@^@^@^@^@^
So i conclude that my kernel has the wrong magic header, thus u-boot refuses to boot it.
The kernel was built on a Linux starfive 5.15.0-starfive #1 SMP Sun Mar 26 12:29:48 EDT 2023 riscv64 GNU/Linux system doing:
git clone GitHub - starfive-tech/linux
cd linux
cp arch/riscv/configs/starfive_visionfive2_defconfig .config
make olddefconfig
make -j4 bindeb-pkg
No config on my side involved. Just the starfive_visionfive2_defconfig in a fresh github kernel tree. I ran exactly the commands posted above. I would understand that tinkering with the config might lead to unpredictable results, but i just downloaded the tree from github and compiled with default defconfig.
Can you boot from NVME ?
I compiled JH7110_VisionFive2_6.1.y_devel using arch/riscv/configs/starfive_visionfive2_defconfig and i can not see any nvme devices once booted into initramfs.
I then tried to enable all NVME kernel options that are enabled in the stock kernel taken from config-5.15.0-starfive, but still no /dev/nvme0n1p4 in initramfs.
Anything else i need to enable ?
Thanks for your help !