Rebuild image kernel and boot process

I installed this new image on an SD card and then on an NVME (after updating the SPI flash), both working fine.

Then I tried recompiling the kernel, with a flag that i probably need (CONFIG_USB_HIDDEV), on top of the .config from the image /proc/config.gz and all went well according to the instructions. The install also went well, it only complained about some missing wifi firmware files from linux-firmware, so I put them in the requested directory.
I have also done this last step from the release note: “Note: currently the dtbs are not synced once you installed a different version of kernel, you’ll need to copy over the dtbs from /usr/lib/linux-image-/ to /boot/dtbs/”. Actually I have renamed and replaced only jh7110-visionfive-v2.dtb, because all other files were unchanged.

and at this point I have restarted, and it stalled in the boot process. It said at some point that it couldn’t find the /dev/mmcblk1p4 or some other partition that it shouldn’t be looking for because booting from the nvme. I think the message comes from u-boot, but I have limited experience with the boot process.

how to I recover my setup? I can access the NVME bar booting from the SD card, but I would need more info about the boot process, what to look at, and how to fix it.

I am more interested in extra drivers to deploy my system, so a quick fix or tutorial would be much appreciated.

Can you look at what happens during the boot process?

1 Like

I am not sure I follow you here. The VF2 is not booting, no way to start a minicom from it.
I can of course run a minicom from another machine, and there was an serial-to-usb cable supplied with the VF2, but what should it do? Does VF2 output on a serial console during boot?
Besides, figure 3.9 of VisionFive2_QSG.pdf explains how to connect to the UART of the VF2, but the provided cable pinout is not documented anywhere. apart from the black, i have red, green and white, to match with green and blue of the aforementioned figure 3.9.

Yes, exactly, I use a second Linux system to view the debug console. It can look like this:

2 Likes

the wire sequence, for others having this FTDI usb-to-serial adapter, is black/white/green (resp. in the pins 6/8/10 of the 40-pin header), the red remains disconnected.

ok, i have the caught the issue. it is stalling in initramfs, not in uboot, unlike what i thought.
and it stalls with both kernels, the original one and the one i have recompiled.
it could be an issue in the generated .deb for the initramfs, but i don’t know how to fix it.

the actual log reports the following:

[ 5.547366] mmc_host mmc0: Bus speed (slot 0) = 198000000Hz (slot req 300000Hz, actual 300000HZ div = 330)
1;-1fdone.
Begin: Mounting root file system … Begin: Running /scripts/local-top … done.
Begin: Running /scripts/local-premount … done.
Begin: Waiting for root file system … Begin: Running /scripts/local-block … done.
Begin: Running /scripts/local-block … done. //// 30 times in total this line
done.
Gave up waiting for root file system device. Common problems:

  • Boot args (cat /proc/cmdline)
    • Check rootdelay= (did the system wait long enough?)
  • Missing modules (cat /proc/modules; ls /dev)
    ALERT! /dev/mmcblk1p4 does not exist. Dropping to a shell!

BusyBox v1.35.0 (Debian 1:1.35.0-4) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

(initramfs) [ 76.059879] random: crng init done
(initramfs) uname -a
Linux StarFive 5.15.0 #1 SMP Mon Jul 3 22:33:42 CEST 2023 riscv64 GNU/Linux
(initramfs) mount
none on / type rootfs (rw)
sysfs on xxx type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on xxxx type proc (rw,nosuid,nodev,noexec,relatime)
udev on xxx type devtmpfs (rw,nosuid,relatime,size=3790268k,nr_inodes=947567,mode=755)
devpts on xxx type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on xxx type tmpfs (rw,nosuid,nodev,noexec,relatime,size=811604k,mode=755)
(initramfs)

mmmmm

I have found the probable cause of the issue, but I don’t know how to solve it.
In the boot log, I have:

append: root=/dev/nvme0n1p4 **root=/dev/mmcblk1p4** rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0

I think the kernel is trying to pick the re-definition of root, and so trying to boot from the sdcard. At some point it fails, and this is the result:

Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  /dev/mmcblk1p4 does not exist.  Dropping to a shell!

here is the log:

U-Boot SPL 2021.10 (May 31 2023 - 16:54:00 +0800)
DDR version: dc2e84f0.
Trying to boot from SPI

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

Platform Name             : StarFive VisionFive V2
Platform Features         : medeleg
Platform HART Count       : 5
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 4000000Hz
Platform Console Device   : uart8250
Platform HSM Device       : ---
Platform PMU Device       : ---
Platform Reboot Device    : pm-reset
Platform Shutdown Device  : pm-reset
Platform Suspend Device   : ---
Firmware Base             : 0x40000000
Firmware Size             : 392 KB
Firmware RW Offset        : 0x40000
Runtime SBI Version       : 1.0

Domain0 Name              : root
Domain0 Boot HART         : 1
Domain0 HARTs             : 0*,1*,2*,3*,4*
Domain0 Region00          : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
Domain0 Region01          : 0x0000000040000000-0x000000004003ffff M: (R,X) S/U: ()
Domain0 Region02          : 0x0000000040040000-0x000000004007ffff M: (R,W) S/U: ()
Domain0 Region03          : 0x0000000000000000-0xffffffffffffffff M: (R,W,X) S/U: (R,W,X)
Domain0 Next Address      : 0x0000000040200000
Domain0 Next Arg1         : 0x0000000042200000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes
Domain0 SysSuspend        : yes

Boot HART ID              : 1
Boot HART Domain          : root
Boot HART Priv Version    : v1.11
Boot HART Base ISA        : rv64imafdcbx
Boot HART ISA Extensions  : none
Boot HART PMP Count       : 8
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 34
Boot HART MHPM Count      : 2
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109


U-Boot 2021.10 (May 31 2023 - 16:54:00 +0800), Build: jenkins-github_visionfive2-14

CPU:   rv64imacu_zba_zbb
Model: StarFive VisionFive V2
DRAM:  8 GiB
MMC:   sdio0@16010000: 0, sdio1@16020000: 1
Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

StarFive EEPROM format v2

--------EEPROM INFO--------
Vendor : StarFive Technology Co., Ltd.
Product full SN: VF7110A1-2250-D008E000-00001028
data version: 0x2
PCB revision: 0xa1
BOM revision: A
Ethernet MAC0 address: 6c:cf:39:00:25:53
Ethernet MAC1 address: 6c:cf:39:00:25:54
--------EEPROM INFO--------

In:    serial
Out:   serial
Err:   serial
Model: StarFive VisionFive V2
Net:   eth0: ethernet@16030000, eth1: ethernet@16040000
starfive_pcie pcie@2C000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10
pci enum ...

IDE device 0: Vendor: 0x1d79 Rev: VC2S038D Prod: H869162086          
            Type: Hard Disk
            Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
bootmode flash device 1/0
Hit any key to stop autoboot:  0 
Failed to load 'vf2_nvme_uEnv.txt'
Importing environment from 1/0 ...
## Warning: Input data exceeds 1048576 bytes - truncated
## Info: input data size = 1048578 = 0x100002
## Error: "boot2" not defined
pci enum ...

IDE device 0: Vendor: 0x1d79 Rev: VC2S038D Prod: H869162086          
            Type: Hard Disk
            Capacity: 244198.3 MB = 238.4 GB (500118192 x 512)
406 bytes read in 4 ms (98.6 KiB/s)
## Warning: defaulting to text format
50235 bytes read in 4 ms (12 MiB/s)
50235 bytes written in 1 ms (47.9 MiB/s)
Retrieving file: /extlinux/extlinux.conf
1385 bytes read in 4 ms (337.9 KiB/s)
U-Boot menu
1:      Debian GNU/Linux bookworm/sid 5.15.0-starfive
2:      Debian GNU/Linux bookworm/sid 5.15.0-starfive (rescue target)
3:      Debian GNU/Linux bookworm/sid 5.15.0
4:      Debian GNU/Linux bookworm/sid 5.15.0 (rescue target)
Enter choice: 3
3:      Debian GNU/Linux bookworm/sid 5.15.0
Retrieving file: /initrd.img-5.15.0
9215263 bytes read in 53 ms (165.8 MiB/s)
Retrieving file: /vmlinuz-5.15.0
8495856 bytes read in 49 ms (165.4 MiB/s)
append: root=/dev/nvme0n1p4 root=/dev/mmcblk1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0
Retrieving file: /dtbs/starfive/jh7110-visionfive-v2.dtb
50235 bytes read in 5 ms (9.6 MiB/s)
   Uncompressing Kernel Image
Moving Image from 0x44000000 to 0x40200000, end=419b2000
## Flattened Device Tree blob at 48000000
   Booting using the fdt blob at 0x48000000
   Using Device Tree in place at 0000000048000000, end 000000004800f43a

Starting kernel ...

clk u2_dw_i2c_clk_core already disabled
clk u2_dw_i2c_clk_apb already disabled
clk u5_dw_i2c_clk_core already disabled
clk u5_dw_i2c_clk_apb already disabled
[    0.000000] Linux version 5.15.0 (user@starfive) (gcc (Debian 12.2.0-10) 12.2.0, GNU ld (GNU Binutils for Debian) 2.39.50.20221224) #1 SMP Mon Jul 3 22:33:42 CEST 2023
[    0.000000] OF: fdt: Ignoring memory range 0x40000000 - 0x40200000
[    0.000000] Machine model: StarFive VisionFive V2
[    0.000000] earlycon: uart0 at MMIO32 0x0000000010000000 (options '115200')
[    0.000000] printk: bootconsole [uart0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x0000000080000000, size 512 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000040200000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x000000023fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040200000-0x00000000c010ffff]
[    0.000000]   node   0: [mem 0x00000000c0110000-0x00000000c01fffff]
[    0.000000]   node   0: [mem 0x00000000c0200000-0x000000023fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040200000-0x000000023fffffff]
[    0.000000] SBI specification v1.0 detected
[    0.000000] SBI implementation ID=0x1 Version=0x10002
[    0.000000] SBI TIME extension detected
[    0.000000] SBI IPI extension detected
[    0.000000] SBI RFENCE extension detected
[    0.000000] SBI SRST extension detected
[    0.000000] SBI v0.2 HSM extension detected
[    0.000000] CPU with hartid=0 is not available
[    0.000000] CPU with hartid=0 is not available
[    0.000000] riscv: base ISA extensions acdfim
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: Embedded 18 pages/cpu s34024 r8192 d31512 u73728
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2067975
[    0.000000] Kernel command line: root=/dev/nvme0n1p4 root=/dev/mmcblk1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0
[    0.000000] Unknown command line parameters: stmmaceth=chain_mode:1 selinux=0
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] mem auto-init: stack:all(pattern), heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x00000000fbfff000-0x00000000fffff000] (64MB)
[    0.000000] Memory: 7580540K/8386560K available (10600K kernel code, 5013K rwdata, 4096K rodata, 2197K init, 666K bss, 281732K reserved, 524288K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[    0.000000] rcu:     RCU debug extended QS entry/exit.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] CPU with hartid=0 is not available
[    0.000000] riscv-intc: unable to find hart id for /cpus/cpu@0/interrupt-controller
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: plic@c000000: mapped 136 interrupts with 4 handlers for 9 contexts.
[    0.000000] random: get_random_bytes called from start_kernel+0x4d6/0x6f2 with crng_init=0
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [1]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 881590404240 ns
[    0.000001] sched_clock: 64 bits at 4MHz, resolution 250ns, wraps every 2199023255500ns
[    0.009003] clocksource: timer@13050000.ch0: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.020327] clocksource: timer@13050000.ch1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.031650] clocksource: timer@13050000.ch2: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.042974] clocksource: timer@13050000.ch3: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    2.579664] can: broadcast manager protocol
[    2.584288] can: netlink gateway - max_hops=1
[    2.589377] Bluetooth: RFCOMM TTY layer initialized
[    2.594776] Bluetooth: RFCOMM socket layer initialized
[    2.600497] Bluetooth: RFCOMM ver 1.11
[    2.604648] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    2.610519] Bluetooth: BNEP filters: protocol multicast
[    2.616292] Bluetooth: BNEP socket layer initialized
[    2.621835] lib80211: common routines for IEEE802.11 drivers
[    2.628269] 9pnet: Installing 9P2000 support
[    2.633044] Key type dns_resolver registered
[    2.638618] Loading compiled-in X.509 certificates
[    2.682757] @@ dev ptr:ffffffe0bfefe800/1500/1
[    2.687953] PVR_K:  1: Read BVNC 36.50.54.182 from HW device registers
[    2.695210] PVR_K:  1: RGX Device registered BVNC 36.50.54.182 with 1 core in the system
[    2.710218] PVR_K:  1: RGX Firmware image 'rgx.fw.36.50.54.182' loaded
[    2.721269] PVR_K:  1: Shader binary image 'rgx.sh.36.50.54.182' loaded
[    2.731565] [drm] Initialized pvr 1.19.6345021 20170530 for 18000000.gpu on minor 0
[    2.741122] starfive_jh7110-pinctrl 13040000.gpio: StarFive GPIO chip registered 64 GPIOs
[    2.750886] starfive_jh7110-pinctrl 17020000.gpio: StarFive GPIO chip registered 4 GPIOs
[    2.760063] pl08xdmac 16008000.sec_dma: initialized 8 virtual memcpy channels
[    2.767989] pl08xdmac 16008000.sec_dma: initialized 16 virtual slave channels
[    2.777683] debugfs: Directory '16008000.sec_dma' with parent 'dmaengine' already present!
[    2.786837] pl08xdmac 16008000.sec_dma: DMA: PL080 rev0 at 0x16008000 irq 23
[    2.794894] ssp-pl022 10060000.spi: ARM PL022 driver for StarFive SoC platform, device ID: 0x00041022
[    2.805115] ssp-pl022 10060000.spi: mapped registers from 0x0000000010060000 to (____ptrval____)
[    2.815249] ssp-pl022 10060000.spi: Requested frequency: 10000000 Hz is unsupported,select by default 8250000 Hz
[    2.826885] ssp-pl022 10060000.spi: will use autosuspend for runtime pm, delay 100ms
[    2.836860] i2c 2-0045: Fixing up cyclic dependency with 295d0000.mipi
[    2.844360] seeed_panel 2-0045: Unknown Atmel firmware revision: 0x00
[    2.851701] tinker_ft5406 2-0038: Address = 0x38
[    2.856795] tinker_ft5406 2-0038: width = 800, height = 480, reverse = 1
[    2.864339] tinker_ft5406 2-0038: i2c read error, -121
[    2.870031] tinker_ft5406 2-0038: Checking touch ic failed
[    2.876081] tinker_ft5406: probe of 2-0038 failed with error -121
[    2.883010] i2c 2-0019: Fixing up cyclic dependency with 295d0000.mipi
[    2.891153] Goodix-TS 2-0014: supply AVDD28 not found, using dummy regulator
[    2.899093] Goodix-TS 2-0014: supply VDDIO not found, using dummy regulator
[    3.017474] Goodix-TS 2-0014: i2c test failed attempt 1: -121
[    3.057495] Goodix-TS 2-0014: i2c test failed attempt 2: -121
[    3.097338] Goodix-TS 2-0014: I2C communication failure: -121
[    3.103847] Goodix-TS: probe of 2-0014 failed with error -121
[    3.110424] i2c 2-0020: Fixing up cyclic dependency with 295d0000.mipi
[    3.118962] at24 5-0050: supply vcc not found, using dummy regulator
[    3.126805] at24 5-0050: 512 byte 24c04 EEPROM, writable, 16 bytes/write
[    3.368867] ATR entry: 0x0900000000 -> 0x0900000000 [0x0040000000] (param: 0x000000)
[    3.727410] pcie_plda 2b000000.pcie: Port link up.
[    3.732867] pcie_plda 2b000000.pcie: PCI host bridge to bus 0000:00
[    3.739818] pci_bus 0000:00: root bus resource [bus 00-ff]
[    3.745874] pci_bus 0000:00: root bus resource [mem 0x30000000-0x37ffffff]
[    3.753483] pci_bus 0000:00: root bus resource [mem 0x900000000-0x93fffffff pref]
[    3.761781] pci 0000:00:00.0: [1556:1111] type 01 class 0x060400
[    3.768429] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0xffffffff 64bit pref]
[    3.776458] pci 0000:00:00.0: supports D1 D2
[    3.781178] pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    3.792394] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    3.801388] pci 0000:01:00.0: [1106:3483] type 00 class 0x0c0330
[    3.808050] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    3.954002] hub 1-0:1.0: USB hub found
[    3.958211] hub 1-0:1.0: 1 port detected
[    3.963644] hub 2-0:1.0: USB hub found
[    3.967846] hub 2-0:1.0: 4 ports detected
[    3.975085] pcie_plda 2c000000.pcie: Failed to get power-gpio, but maybe it's always on.
[    3.984224] pcie_plda 2c000000.pcie: host bridge /soc/pcie@2C000000 ranges:
[    3.991977] pcie_plda 2c000000.pcie:      MEM 0x0038000000..0x003fffffff -> 0x0038000000
[    4.000936] pcie_plda 2c000000.pcie:      MEM 0x0980000000..0x09bfffffff -> 0x0980000000
[    4.009921] ATR entry: 0x09c0000000 -> 0x0000000000 [0x0010000000] (param: 0x000001)
[    4.018490] ATR entry: 0x0038000000 -> 0x0038000000 [0x0008000000] (param: 0x000000)
[    4.027038] ATR entry: 0x0980000000 -> 0x0980000000 [0x0040000000] (param: 0x000000)
[    4.187432] usb usb2-port2: over-current condition
[    4.287349] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    4.347370] usb usb2-port4: over-current condition
[    4.397461] pcie_plda 2c000000.pcie: Port link up.
[    4.402973] pcie_plda 2c000000.pcie: PCI host bridge to bus 0001:00
[    4.409909] pci_bus 0001:00: root bus resource [bus 00-ff]
[    4.415963] pci_bus 0001:00: root bus resource [mem 0x38000000-0x3fffffff]
[    4.423566] pci_bus 0001:00: root bus resource [mem 0x980000000-0x9bfffffff pref]
[    4.431859] pci 0001:00:00.0: [1556:1111] type 01 class 0x060400
[    4.438504] pci 0001:00:00.0: reg 0x10: [mem 0x00000000-0xffffffff 64bit pref]
[    4.446534] pci 0001:00:00.0: supports D1 D2
[    4.451255] pci 0001:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    4.462619] pci 0001:01:00.0: [1d79:5766] type 00 class 0x010802
[    4.469290] pci 0001:01:00.0: reg 0x10: [mem 0x00000000-0x00003fff 64bit]
[    4.469792] hub 1-1:1.0: USB hub found
[    4.476807] pci 0001:01:00.0: reg 0x24: [mem 0x00000000-0x00001fff]
[    4.485853] hub 1-1:1.0: 4 ports detected
[    4.487983] pci 0001:01:00.0: 4.000 Gb/s available PCIe bandwidth, limited by 5.0 GT/s PCIe x1 link at 0001:00:00.0 (capable of 31.504 Gb/s with 8.0 GT/s PCIe x4 link)
[    4.512465] pci_bus 0001:01: busn_res: [bus 01-ff] end is updated to 01
[    4.519811] pci 0001:00:00.0: BAR 0: no space for [mem size 0x100000000 64bit pref]
[    4.528282] pci 0001:00:00.0: BAR 0: failed to assign [mem size 0x100000000 64bit pref]
[    4.537126] pci 0001:00:00.0: BAR 8: assigned [mem 0x38000000-0x380fffff]
[    4.544627] pci 0001:01:00.0: BAR 0: assigned [mem 0x38000000-0x38003fff 64bit]
[    4.552728] pci 0001:01:00.0: BAR 5: assigned [mem 0x38004000-0x38005fff]
[    4.560230] pci 0001:00:00.0: PCI bridge to [bus 01]
[    4.565704] pci 0001:00:00.0:   bridge window [mem 0x38000000-0x380fffff]
[    4.573706] nvme nvme0: pci function 0001:01:00.0
[    4.578972] nvme 0001:01:00.0: enabling device (0000 -> 0002)
[    4.585428] pcie_plda 2c000000.pcie: msi#0 address_hi 0x0 address_lo 0x190
[    4.592675] clk-starfive-jh7110-vout 295c0000.clock-controller: starfive JH7110 clk_vout init successfully.
[    4.615522] clk-starfive-jh7110-isp 19810000.clock-controller: starfive JH7110 clk_isp init successfully.
[    4.626780] dw_axi_dmac_platform 16050000.dma-controller: DesignWare AXI DMA Controller, 4 channels
[    4.637871] printk: console [ttyS0] disabled
[    4.662823] 10000000.serial: ttyS0 at MMIO 0x10000000 (irq = 17, base_baud = 1500000) is a 16550A
[    4.672673] printk: console [ttyS0] enabled
[    4.672673] printk: console [ttyS0] enabled
[    4.681481] printk: bootconsole [uart0] disabled
[    4.681481] printk: bootconsole [uart0] disabled
[    4.691875] jh7110-vin 19800000.vin_sysctl: stfcamss probe enter!
[    4.700275] jh7110-vin 19800000.vin_sysctl: stfcamss probe success!
[    4.718451] dwmmc_starfive 16010000.sdio0: IDMAC supports 32-bit address mode.
[    4.718743] jh7110-sec 16000000.crypto: will run requests pump with realtime priority
[    4.725735] dwmmc_starfive 16010000.sdio0: Using internal DMA controller.
[    4.734391] dwmmc_starfive 16020000.sdio1: IDMAC supports 32-bit address mode.
[    4.740387] dwmmc_starfive 16010000.sdio0: Version ID is 290a
[    4.740437] dwmmc_starfive 16010000.sdio0: DW MMC controller at irq 29,32 bit host data width,32 deep fifo
[    4.743854] jh7110-sec 16000000.crypto: Initialized
[    4.745125] starfive-i2s 120b0000.i2stx_4ch0:  designware: play supported
[    4.745135] starfive-i2s 120b0000.i2stx_4ch0: designware: i2s master mode supported
[    4.745563] sf-mipi-dphy-tx 295e0000.mipi-dphy: sf_dphy_probe begin
[    4.745574] sf-mipi-dphy-tx 295e0000.mipi-dphy: ===> sf_dphy_probe enter, 445 
[    4.745712] sf-mipi-dphy-tx 295e0000.mipi-dphy: control ECO
[    4.745733] sf-mipi-dphy-tx 295e0000.mipi-dphy: supply mipi_1p8 not found, using dummy regulator
[    4.746036] sf-mipi-dphy-tx 295e0000.mipi-dphy: sf_dphy_probe end
[    4.746265] cdns-dsi 295d0000.mipi: dsi_sys_clk = 297000000
[    4.746511] cdns-dsi 295d0000.mipi: starfive dsi bind end
[    4.747698] cdns-dsi 295d0000.mipi: hs_rate.980000000, channel = 2
[    4.747703] dwmmc_starfive 16020000.sdio1: Using internal DMA controller.
[    4.747717] dwmmc_starfive 16020000.sdio1: Version ID is 290a
[    4.747760] dwmmc_starfive 16020000.sdio1: DW MMC controller at irq 30,32 bit host data width,32 deep fifo
[    4.747960] mmc_host mmc1: card is polling.
[    4.755521] mmc_host mmc0: card is non-removable.
[    4.967329] mmc_host mmc1: Bus speed (slot 0) = 198000000Hz (slot req 400000Hz, actual 399193HZ div = 248)
[    5.077320] mmc_host mmc0: Bus speed (slot 0) = 198000000Hz (slot req 400000Hz, actual 399193HZ div = 248)
[    5.305864] random: fast init done
[    5.313211] sf-mipi-dphy-tx 295e0000.mipi-dphy: GET_AON_GP_REG
[    5.319062] sf-mipi-dphy-tx 295e0000.mipi-dphy: control ECO
[    5.325281] sys_m31_dphy_tx_configure opts->mipi_dphy.hs_clk_rate = 980000000
[    5.332483] sf-mipi-dphy-tx 295e0000.mipi-dphy: request dphy hs_rate 980Mbps
[    5.337339] usb 1-1.2: new high-speed USB device number 3 using xhci_hcd
[    5.339576] sf-mipi-dphy-tx 295e0000.mipi-dphy: MIPI dphy-tx # PLL is not LOCKED
[    5.353687] sf-mipi-dphy-tx 295e0000.mipi-dphy: want dphy hs_rate 980Mbps
[    5.360489] sf-mipi-dphy-tx 295e0000.mipi-dphy: config dphy hs_rate 980Mbps
[    5.367467] sf-mipi-dphy-tx 295e0000.mipi-dphy: MIPI dphy-tx # AON_POWER_READY_N active(0)
[    5.375750] sf-mipi-dphy-tx 295e0000.mipi-dphy: 1 SET_U0_MIPITX_DPHY_RESETB
[    5.382726] sf-mipi-dphy-tx 295e0000.mipi-dphy: 2 SET_U0_MIPITX_DPHY_RESETB
[    5.389703] sf-mipi-dphy-tx 295e0000.mipi-dphy: MIPI dphy-tx # PLL Locked
[    5.396500] cdns-dsi 295d0000.mipi: START dsi ppi_txbyte_hs
[    5.402091] cdns-dsi 295d0000.mipi: sys_mipi_dsi_set_ppi_txbyte_hs
[    5.407321] mmc_host mmc1: Bus speed (slot 0) = 198000000Hz (slot req 300000Hz, actual 300000HZ div = 330)
[    5.410469] starfive_raxda_10inch 2-0020: dsi command return -61, mode 0
[    5.425115] cdns-dsi 295d0000.mipi: STOP dsi ppi_txbyte_hs
[    5.428818] of_cfs_init
[    5.430637] cdns-dsi 295d0000.mipi: sys_mipi_dsi_set_ppi_txbyte_hs
[    5.433134] of_cfs_init: OK
[    5.439318] sf-mipi-dphy-tx 295e0000.mipi-dphy: 1 SET_U0_MIPITX_DPHY_RESETB
[    5.439327] sf-mipi-dphy-tx 295e0000.mipi-dphy: 2 SET_U0_MIPITX_DPHY_RESETB
[    5.456896] starfive-pwmdac 100b0000.pwmdac: clk_apb0 = 49500000, clk_pwmdac_apb = 49500000, clk_pwmdac_core = 4068493
[    5.468350] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    5.483243] nvme nvme0: allocated 64 MiB host memory buffer.
[    5.522769] pcie_plda 2c000000.pcie: msi#0 address_hi 0x0 address_lo 0x190
[    5.529732] pcie_plda 2c000000.pcie: msi#1 address_hi 0x0 address_lo 0x190
[    5.536646] pcie_plda 2c000000.pcie: msi#2 address_hi 0x0 address_lo 0x190
[    5.543585] pcie_plda 2c000000.pcie: msi#3 address_hi 0x0 address_lo 0x190
[    5.547366] mmc_host mmc0: Bus speed (slot 0) = 198000000Hz (slot req 300000Hz, actual 300000HZ div = 330)
1;-1fdone.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
done.
Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  /dev/mmcblk1p4 does not exist.  Dropping to a shell!


BusyBox v1.35.0 (Debian 1:1.35.0-4) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) [   76.059879] random: crng init done
(initramfs) uname -a
Linux StarFive 5.15.0 #1 SMP Mon Jul 3 22:33:42 CEST 2023 riscv64 GNU/Linux
(initramfs) mount
none on / type rootfs (rw)
sysfs on xxx type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on xxxx type proc (rw,nosuid,nodev,noexec,relatime)
udev on xxx type devtmpfs (rw,nosuid,relatime,size=3790268k,nr_inodes=947567,mode=755)
devpts on xxx type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on xxx type tmpfs (rw,nosuid,nodev,noexec,relatime,size=811604k,mode=755)
(initramfs) 

any idea how to solve this?

I cannot go back and check, but it is possible that the problem was there from the beginning, and that I booted always with the SDcard inserted, accidentally.

If you aren’t explicitly defining it in uboot variables, then it should be coming from your /boot/extlinux conf file, which I think may get auto-updated from /etc/defaults/extlinux

2 Likes

thanks alb!
that’s where the wrong cmdline was.
I have fixed it, and now it boots like before
…although not the recompiled kernel, which does some errors, but this is another story :slight_smile:

1 Like

I think all is resolved from your perspective. Could you please tell me what instructions you used? I am trying to find instructions for recompiling the kernel (I’d like to add-turn on ALSA MIDI support) and have not found them.

@tunagenes, I have followed the release note guide:
VisionFive 2 Debian Wiki - 202306 Release | RVspace

This recompiled kernel is not working! systemd fails to mount its vital FSs, and the system stops during the startup, without giving access even to a console.
I am still trying to understand what went wrong.

I might have misunderstood your question, but since I had already typed what follows, I leave it there. The final part about low-latency might be of interest anyway.

What I did is to just change the line in the .config:
# CONFIG_USB_HIDDEV is not set
to
CONFIG_USB_HIDDEV=y

you can normally run make menuconfig and search (with ‘/’) for MIDI or ALSA, or even for the CONFIG_xxx if you already know what to look for. I have run it for you for midi, with the following (shortened) results:

Symbol: HID_SENSOR_HUMIDITY [=n]   --- false hit
Symbol: SND_RAWMIDI [=y]
Symbol: SND_SEQ_MIDI [=n]
Symbol: SND_SEQ_MIDI_EMUL [=n]
Symbol: SND_SEQ_MIDI_EVENT [=n]
Symbol: SND_SEQ_VIRMIDI [=n]
Symbol: SND_VIRMIDI [=n]
Symbol: USB_CONFIGFS_F_MIDI [=n]
Symbol: USB_F_MIDI [=n]
Symbol: USB_MIDI_GADGET [=n]

each Symbol corresponds to a CONFIG_Symbol in the .config, and the current state is indicated. As some of them select other options, you should change them in menuconfig rather than in the .config. The full output of the search tells you also in which submenu you can find each of them.
I would activate all of them (except CONFIG_HID_SENSOR_HUMIDITY that has nothing to do with your scope).

there are also a few ALSA symbols, all off by default, and you can try activating all of them, too.

the kernel driver support might be just the first step, however.
also, I played with audio on another machine, and I had to use a low-latency kernel to make it work, especially for the MIDI part. nothing dramatic, but impacting the scheduler (CONFIG_HZ_1000=y and CONFIG_HZ=1000 are the most important ones, but I don’t know if they are available and work for other than an x86 architecture).

Ah, I see, I didn’t initially catch that it still wasn’t working for you. Thanks @giacomo for the pointer and the additional info-typing. I’ll post here if we have any success, although I am still hoping that Starfive, or ‘someone else’ will provide a kernel with ALSA and MIDI support enabled.

@tunagenes

I found the issue. I described it here: Kernel build ok but systemd fails to load

basically, the kernel and the rest of the system were not built onboard the VF2, but cross-built from another system.
Once in the same conditions, all works fine.

3 Likes

Far out, Thank you @giacomo !

Necroposting a bit here, but I’d just like to comment that I had a lot of trouble with new kernels not seeming to recognise devices properly, it turns out that I had to copy the device tree blob from the kernel build (in arch/riscv/boot/dts/), which I did not realise was created as it didn’t seem to be mentioned anywhere and wasn’t copied by make install (it might be helpful to run make dtbs_install).

I’m having the same issues as listed in Kernel build ok but systemd fails to load
I’m managing a correct (cross) build, copying the .deb files over, but when picking the new kernel, I end up with

[FAILED] Failed to mount Huge Pages File System.
[FAILED] Failed to mount POSIX Message Queue File System.
[FAILED] Failed to mount Kernel Debug File System.
[FAILED] Failed to mount FUSE Control File System.
[FAILED] Failed to mount Kernel Configuration File System.

This is after checking out tag VF2_v3.8.2 and building.

Every mount says

sys-kernel-debug.mount: Mount process finished, but there is no mount.
sys-kernel-debug.mount: Failed with result 'protocol'.

This happens on armbian but also on the 3.8.2 image starfive-jh7110-VF2_515_v3.8.2-66-SD-minimal-desktop-wayland.img

I’ve tried only copying the kernel files over, and also installing with the .deb files, both end up with the same result

Similar thing happens when building the tag VF2_v3.8.2 without any customization, just following the official instructions