Is there a usable 6.x kernel supporting M2/SSD?

I’ve tried the upstream kernel from GitHub - starfive-tech/linux at JH7110_VisionFive2_upstream. Unfortunately it could NOT boot.

The only usable 6.x kernel is 6.2.6 from ubuntu 23.04. It works well but lack of support of PCIe and USB.

1 Like

Even Ubuntu Server 23.04 for the StarFive VisionFive 2 preinstalled image does not currently support USB or PCIe:

I would keep an eye on https://kernel.org for a mainline, stable (or preferably a longterm kernel) which adds support for PCIe neither of which is currently in any upstream kernel (yet). But patches do exist (see previous link) so you could patch your own kernel and/or backport the current patches. Or you can wait until they are accepted in possibly kernel 6.5 (or 6.6).

2 Likes

Thanks, I’ll try the patches later to test. Actually what i’m expecting is a working repo with all patches applied (JH7110 Upstream Status | RVspace), Ha ha

Have you tried the one from Daily Ubuntu Kernel Builds - Now With 100% More APT Repo! it is 6.4.0-rc6+ ?
USB works (on an 1.2 board with 1.2 dtb) with that one. I haven’t tried nvme yet (can try tonight) . The nvme is recognized with that kernel too.

3 Likes

That just means I need to re-try with the upstream branch again since it’s off into that space.

The meta-riscv repo for Yocto support’s lagging…and I’ve got projects that leverage the NVMe and other things. Be better if I could get 6.x support going. Thing is…it’s…messy and missing hunks of stuff like DT pieces to build with.

I had the 6.2 stuff working nice enough at one point. Problem is that we’ve got all sorts of people running down blind alleys on varying different fronts (For example…WHY are they insisting on a FIT image. That really only makes sense if you’re using MTD and bulk NAND flash.)

Thank you ! That saved me a lot of trouble :slight_smile:

I just tried agreenbhm’s kernel this morning. My aigo 2T (with Maxio’s controller) works, but no luck with WD Black 1T.

root@VF2:~# lspci
0000:00:00.0 PCI bridge: PLDA XpressRich-AXI Ref Design
0000:01:00.0 USB controller: VIA Technologies, Inc. VL805/806 xHCI USB 3.0 Controller (rev 01)
0001:00:00.0 PCI bridge: PLDA XpressRich-AXI Ref Design
0001:01:00.0 Non-Volatile memory controller: MAXIO Technology (Hangzhou) Ltd. Device 1602 (rev 01)
root@VF2:~# fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 1.86 TiB, 2048408248320 bytes, 4000797360 sectors
Disk model: aigo NVMe SSD P7000Z 2TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F487646B-D5F3-4C2F-9652-17725D3C0583

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 3750000639 3749998592 1.7T Linux filesystem
root@VF2:~# hdparm -t --direct /dev/nvme0n1p1

/dev/nvme0n1p1:
Timing O_DIRECT disk reads: 500 MB in 3.01 seconds = 166.33 MB/sec

root@VF2:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@VF2:~# uname -a
Linux VF2 6.4.0-starfive #136 SMP Fri Jun 16 01:55:05 UTC 2023 riscv64 riscv64 riscv64 GNU/Linux

2 Likes

Hello. I have had my board since last summer and have successfully run

  1. premade sd-images from the the repo tags, usually updating the spl and uboot files as I go.

  2. Before I updated to the new v3.82 from the second to last update, I was able to build a custom Armbian image which booted from SD card and had SCSI drivers, specifically SCSI transport FC and the drivers (QLE2xxx) as a module installed and working great to connect to my FC target box.

  3. recently in the past few days I updated the spl and uboot to [VF2_v3.8.2] and the board runs and boots th 202310 SD and NVME images just fine.

  4. The cw18 ARCH image is really good too. thank you.

  5. So I wanted to see if I could build a 6.1.y(31) kernel on the board and it works without a hitch. The instructions are valid, and I only noticed that the [ git checkout command needs to be run in the /linux folder, and not in the …/linux folder. ]

my work flow as best I can remember. I do have the serial to USB monitor.

  1. downloaded NVME 202310.
  2. Balena-etcher to NVME drive
  3. boot vf2 - 0/0 switch settings
  4. usual resizing of the /root partition - follow guide/your knowledge
    (note: thinking of maybe trying to make the /boot partition larger to hold
    more kernels, help here? )
  5. I did run the extras script, but I do not know if I had to yet.

a. wget https://github.com/starfivetech/Debian/releases/download/v0.8.0-engineering-release-wayland/install_package_and_dependencies.sh

b. sudo chmod +x install_package_and_dependencies.sh

c. sudo ./install_package_and_dependencies.sh


  1. dependencies

a. sudo apt-get install build-essential linux-source bc kmod cpio flex libncurses5-dev libelf-dev libssl-dev dwarves bison git

  1. repo

a. sudo git clone GitHub - starfive-tech/linux

  1. IMPORTANT DIFFERENCE

a. cd linux

b. sudo git checkout VF2_6.1_v3.8.2

  1. copy current running kernel config file as a starting point

a. sudo cp arch/riscv/configs/starfive_visionfive2_defconfig .config ( makes file )

b. sudo make ARCH=riscv olddefconfig ( copies from running kernel, mostly? ) : NOTE my board crashed setting the architecture on the native board. NOT CROSS COMPILING!

  1. Config your kernel - leave it alone, install drivers, peruse at your leisure. your call. BE CAREFUL

a. sudo make menuconfig

b. save work ( .config or save many with different settings…)

  1. Compile 6.1.x kernel

a. make ARCH=riscv -j$(nproc) bindeb-pkg : NOTE my board crashed setting the architecture on the native board. NOT CROSS COMPILING!

COMPILE TIME ( on the vf2 board ): Around 1.5 hrs. ( adding modules later only takes 5 min. when recompiling )

  1. Debian packages are found in …/linux - one level up from the repo. if you use //home/user/linux, then the *.deb files are in //home/user

a. sudo dpkg -i *.deb

--------------IMPORTANT--------------
b. sudo cp -r ~/linux/debian/linux-image/usr/lib/linux-image-6.1.(x)/* //boot/dtbs

c. sudo reboot


Booted right up for me. kernel 6.1

PROBLEMS:

  1. desktop if slower than molasses. I added the PVR drivers as a module as dmesg showed it did not load from initramfs. Does load now but make no difference. So now on to the video side I guess. For another post.

STUFF I RUN:

  1. npm - for uptime-kuma works well.
  2. usual apache2 web server intranet stuff.
  3. htmly blog self hosted thing.
  4. rust stuff / cargo
  5. want to try the gpio and node.js gpio interfacing.
  6. 95% command line stuff.
  7. and golang - gotty

STUFFI DO NOT UNDERSTAND:

  1. how to configure the booting of “current” ARMBIAN, SLARM64, DIETPI, and UBUNTU images… not a single one of them will boot at all.
    Yes I reset the env defaults.

  2. NO EFI booting???

ANSWER TO THE TOPIC QUESTION:

yes, there is a 6.1 kernel supporting m.2, and you can make it.

sorry if I made any mistakes/comments welcome.

1 Like

Just throwing my thoughts into the room…I guess, the 6.x DTBs are incompatible with a 5.x kernel and vice versa.
Had similar problems booting 6.x kernel with 5.x DTBs present.

maybe you can use v3.8.2 kernal 6.1.31 to compile.
Releases · starfive-tech/VisionFive2 (github.com)
Building StarFive Debian image | RVspace

You are correct! I have been attempting other combinations: if the user space? repo

is added to the …/linux root compile folder with git clone, , then the strange modules I have yet to locate for the video have been added. Whether they added to compile source or someway to current file system source I am not sure.

$lsmod
vdec venc

will sometimes appear, then go away. I need to sift through the configs and learn a bit more.

Using the SD card image, and the steps above the desktop rendering returns to “normal”.

this link may help you
Building StarFive Debian image | RVspace