LuckfoxTECH / luckfox-pico

luckfox-pico sdk
320 stars 134 forks source link

openWRT for luckfox series initial support #115

Open pengphei opened 6 months ago

pengphei commented 6 months ago

After some hack for openwrt, now I can launch openwrt for luckfox rv1103/rv1106 series boards, features as below:

adbd enable & support

uci set rkusb.usb.adb_en='1'
uci commit

/etc/init.d/rkusb start

if last command hangs, it will reboot later and adbd start by default.

system burn

gunzip -d openwrt-rockchip-cortexa7-luckfox_pico-ext4-sysupgrade.img.gz
dd if=./openwrt-rockchip-cortexa7-luckfox_pico-ext4-sysupgrade.img of=/dev/sdc bs=2M conv=sync
sync

isp setup

  1. enable adbd
  2. send iqfile to /etc/iqfiles
  3. start rkaiq_3A_server

base system

  1. openWRT system and configs (with uclibc patched): https://github.com/ticklab/openwrt/commits/rockchip-22.03/
  2. rockchip bsp kernel(with openwrt overlay hacking/pending patches): https://github.com/ticklab/rockchip-kernel/tree/openwrt-ticklab-5.10
  3. camera_engine_rkaiq(droped, which not work, will be replaced by binary isp): https://github.com/TinkerBoard-Linux/rockchip-linux-external-camera_engine_rkaiq/tree/linux5.10-rk356x

issues

  1. uclibc binaries libs(including npu/isp/rockit, kernel modules) will be updated soon
pengphei commented 6 months ago

openwrt-rockchip-cortexa7-luckfox_pico-ext4-sysupgrade.img.gz

openwrt image for luckfox pico

pengphei commented 6 months ago

openwrt-rockchip-cortexa7-luckfox_pico-max-ext4-rootfs.zip

openwrt image for luckfox pico pro/max

shawnchain commented 5 months ago

Good job! Could U pls update the OpenWrt kernel package with the RK-Kernel source?

plan44 commented 5 months ago

openwrt-rockchip-cortexa7-luckfox_pico-max-ext4-rootfs.zip

openwrt image for luckfox pico pro/max

Does this work for Luckfox pico max with NAND flash (no SD card), too?

plan44 commented 5 months ago

Hi @pengphei, I'm trying to build openwrt for mtd (nand flash), in squashfs/jffs2 configuration, but I am not successful yet ;-) I am quite used to OpenWrt builds, but only for the MT7688 and RPi targets. I do not yet understand the specifics of the RV110x build, in particular the uboot parts.

I'd be very much interested to help in further developing OpenWrt for the luckfox rv1103/rv1106 series boards, but I don't know where to find more information. Any ideas how to proceed best?

plan44 commented 5 months ago

In the meantime, I managed to build trough OpenWrt 22.03 for the RV1106 and creating openwrt-rockchip-cortexa7-luckfox_pico-max-squashfs-boot.img and openwrt-rockchip-cortexa7-luckfox_pico-max-squashfs-rootfs.img. The former seems to be the kernel, it starts with a device tree according to binwalk, the latter is the squashfs rootfs.

What I am stuck with now is how to install these two in the NAND flash of my LuckFox Pico Max. The entire setup seems different from the mtd setup I know from MT7688, where kernel and squashfs are baked together as an uimage.

Any hints or pointers where to read up? Thx in advance!

plan44 commented 4 months ago

Again two weeks and some experiments later πŸ˜‰

Today I finally managed to get SocToolkit.exe running on an old i86 Windows box (unfortunately, it does not run on any ARM based machines, and neither does upgrade_tool), and could flash the boot and rootfs partition with the kernel/rootfs as produced by the openwrt built.

However, there seems to be a mismatch between the kernel config and the squashfs/jffs2 rootfs image.

I found that CONFIG_MTD_SPI_NAND and CONFIG_MTD_PHYSMAP are required, but apparently something else is missing, because when I start from uboot command line with:

setenv sys_bootargs " loglevel=7 root=/dev/mtdblock6 rootfstype=squashfs,jffs2"
boot

...the boot log shows that the kernel never even attempts to use mtd and start the mtd partition scanners that would create the /dev/mtdblockxx devices. So the kernel just hangs waiting for /dev/mtdblock6.

plan44 commented 4 months ago

Just for context, below is the complete bootlog starting in the uboot console. I would expect mtd to parse the partitions around [0.389703] but it does not happen. I must be missing some essential detail here 😒

=>     setenv sys_bootargs " loglevel=7 root=/dev/mtdblock6 rootfstype=squashfs,jffs2"
=>     printenv
arch=arm
autoload=no
baudrate=115200
board=evb_rv1106
board_name=evb_rv1106
bootargs=storagemedia=mtd androidboot.storagemedia=mtd androidboot.mode=normal 
bootcmd=boot_fit;boot_android ${devtype} ${devnum};
bootdelay=0
cpu=armv7
devnum=1
devtype=mtd
eth1addr=26:93:a5:5a:0e:d7
ethaddr=22:93:a5:5a:0e:d7
fdt_addr_r=0x00c00000
kernel_addr_c=0x00808000
kernel_addr_r=0x00008000
mtdparts=spi-nand0:256K(env),256K@256K(idblock),512K(uboot),4M(boot),30M(oem),10M(userdata),210M(rootfs)
pxefile_addr_r=0x00c00000
ramdisk_addr_r=0x000e00000
rkimg_bootdev=if mmc dev 1 && rkimgtest mmc 1; then setenv devtype mmc; setenv devnum 1; echo Boot from SDcard;elif mmc dev 0; then setenv devtype mmc; setenv devnum 0;elif mtd_blk dev 0; then setenv devtype mtd; setenv devnum 0;elif mtd_blk dev 1; then setenv devtype mtd; setenv devnum 1;elif mtd_blk dev 2; then setenv devtype mtd; setenv devnum 2;elif rknand dev 0; then setenv devtype rknand; setenv devnum 0;elif rksfc dev 0; then setenv devtype spinand; setenv devnum 0;elif rksfc dev 1; then setenv devtype spinor; setenv devnum 1;else;setenv devtype ramdisk; setenv devnum 0;fi; 
scriptaddr=0x00b00000
serial#=31d1f0e3a3b8bdbb
soc=rockchip
stderr=serial
stdin=serial
stdout=serial
sys_bootargs= loglevel=7 root=/dev/mtdblock6 rootfstype=squashfs,jffs2
vendor=rockchip

Environment size: 1368/262140 bytes
=>     boot
## Booting FIT Image at 0xe8cb080 with size 0x0032ec00
Fdt Ramdisk skip relocation
No misc partition
## Loading kernel from FIT Image at 0e8cb080 ...
   Using 'conf' configuration
## Verified-boot: 0
   Trying 'kernel' kernel subimage
     Description:  unavailable
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x0e8d5280
     Data Size:    3295296 Bytes = 3.1 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    sha256
     Hash value:   2f58d0727960528255e2e204a38803ee38926374dfc8668db2b9c1608f32742d
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 0e8cb080 ...
   Using 'conf' configuration
   Trying 'fdt' fdt subimage
     Description:  unavailable
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x0e8cb880
     Data Size:    39256 Bytes = 38.3 KiB
     Architecture: ARM
     Load Address: 0x00c00000
     Hash algo:    sha256
     Hash value:   f4a9e232ea144a4f5168e9fc7144a76b757dc75cc859ad784d26115d98b90dac
   Verifying Hash Integrity ... sha256+ OK
   Loading fdt from 0x0e8cb080 to 0x00c00000
   Booting using the fdt blob at 0x00c00000
   Loading Kernel Image from 0x0e8d5280 to 0x00008000 ... OK
   kernel loaded at 0x00008000, end = 0x0032c840
   Using Device Tree in place at 00c00000, end 00c0c957
Adding bank: 0x00000000 - 0x10000000 (size: 0x10000000)
Total: 123516.808 ms

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.156 (luz@MBA15-2023.local) (arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 11.2.0 r0+19961-22333a94a0) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 PREEMPT Fri Jun 21 17:58:50 2024
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=50c53c7d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Luckfox Pico Max
[    0.000000] earlycon: uart8250 at MMIO32 0xff4c0000 (options '')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line: storagemedia=mtd androidboot.storagemedia=mtd androidboot.mode=normal  rootwait earlycon=uart8250,mmio32,0xff4c0000 console=ttyFIQ0 root=/dev/mtdblock6 snd_soc_core.prealloc_buffer_size_kbytes=16 coherent_pool=0 mtdparts=spi-nand0:256K(env),256K@256K(idblock),512K(uboot),4M(boot),30M(oem),10M(userdata),210M(rootfs) loglevel=7 rootfstype=squashfs,jffs2 user_debug=31
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 252280K/262144K available (4474K kernel code, 305K rwdata, 1724K rodata, 348K init, 101K bss, 9864K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 30 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.008791] Switching to timer-based delay loop, resolution 41ns
[    0.015982] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=80000)
[    0.027264] pid_max: default: 4096 minimum: 301
[    0.032360] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.040394] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.049551] CPU: Testing write buffer coherency: ok
[    0.055885] Setting up static identity map for 0x81c0 - 0x8214
[    0.062446] rcu: Hierarchical SRCU implementation.
[    0.067813] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.083288] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.092096] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370867519511994 ns
[    0.103257] futex hash table entries: 16 (order: -5, 192 bytes, linear)
[    0.110683] pinctrl core: initialized pinctrl subsystem
[    0.118667] NET: Registered protocol family 16
[    0.124883] DMA: failed to allocate 0 KiB pool for atomic coherent allocation
[    0.135720] thermal_sys: Registered thermal governor 'step_wise'
[    0.135731] thermal_sys: Registered thermal governor 'user_space'
[    0.144749] cpuidle: using governor menu
[    0.242384] iommu: Default domain type: Passthrough 
[    0.251066] SCSI subsystem initialized
[    0.256587] usbcore: registered new interface driver usbfs
[    0.264593] usbcore: registered new interface driver hub
[    0.270987] usbcore: registered new device driver usb
[    0.279749] Advanced Linux Sound Architecture Driver Initialized.
[    0.288819] clocksource: Switched to clocksource arch_sys_counter
[    0.298279] NET: Registered protocol family 2
[    0.304859] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.313642] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.323095] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.331562] TCP bind hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.339369] TCP: Hash tables configured (established 2048 bind 2048)
[    0.346457] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.353675] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.361542] NET: Registered protocol family 1
[    0.366375] PCI: CLS 0 bytes, default 64
[    0.372324] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.383193] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.389703] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.406023] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[    0.425054] /usbdrd: Failed to get clk index: 0 ret: -517
[    0.432595] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.440270] ehci-platform: EHCI generic platform driver
[    0.446461] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.453564] ohci-platform: OHCI generic platform driver
[    0.460360] usbcore: registered new interface driver cdc_acm
[    0.467145] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    0.476579] i2c /dev entries driver
[    0.483627] softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
[    0.494324] softdog:              soft_reboot_cmd=<not set> soft_active_on_boot=0
[    0.503743] Synopsys Designware Multimedia Card Interface Driver
[    0.514869] NET: Registered protocol family 10
[    0.522627] Segment Routing with IPv6
[    0.526834] NET: Registered protocol family 17
[    0.531928] 8021q: 802.1Q VLAN Support v1.8
[    0.537853] /usbdrd: Failed to get clk index: 0 ret: -517
[    0.545405] /usbdrd: Failed to get clk index: 0 ret: -517
[    0.551674] rk3x-i2c ff470000.i2c: deferred probe timeout, ignoring dependency
[    0.560169] dwmmc_rockchip ffaa0000.mmc: deferred probe timeout, ignoring dependency
[    0.569512] ALSA device list:
[    0.572832]   No soundcards found.
[    0.576642] Warning: unable to open an initial console.
[    0.582531] Waiting for root device /dev/mtdblock6...
pengphei commented 4 months ago

Actually, openwrt use some hack patches for squashfs/jffs/ubifs overlay support.

  1. patch the rk kernel with overlay referring patches from target/linux/generic/pending-5.15/hacking-5.15
  2. remove rootfs= env for boot environments, and the openwrt will detectes overlay automaticaly, which have stoped me from booting for a very long time.

have a good luck!

pengphei commented 4 months ago

openwrt-rockchip-cortexa7-luckfox_pico-max-ext4-rootfs.zip openwrt image for luckfox pico pro/max

Does this work for Luckfox pico max with NAND flash (no SD card), too?

Yes, I have made import some patches from "openwrt/target/linux/generic" and make this work.

  1. first we have a openwrt image that bootup from external sd flash
  2. then we build seperate parts of nand firmware binary
  3. then we burn firmware to the nand flashes from sd flash system
  4. we remove sd and boot from nand system

that's all the steps, but I need time to clean my openwrt repo.

shawnchain commented 4 months ago

Thanks for the initial works by @pengphei .

The openwrt ubi patches are required for boot from nand flash with BSP kernel, and rk-uboot also requires additional hack to support dual-boot from spi-nand or sd/emmc.

Anyway it's a huge work to port 22.03/target/linux/generic/pending-5.10 to RK BSP kernel, despiting the uclibc issues on RK commercial libs.

pengphei commented 4 months ago

Thanks for the initial works by @pengphei .

The openwrt ubi patches are required for boot from nand flash with BSP kernel, and rk-uboot also requires additional hack to support dual-boot from spi-nand or sd/emmc.

Anyway it's a huge work to port 22.03/target/linux/generic/pending-5.10 to RK BSP kernel, despiting the uclibc issues on RK commercial libs.

  1. openwrt kernel patches for rk bsp kernel has been finished, anyway very ugly ;)
  2. uclibc for openwrt to support binary compability with rk libs has been finished yet, also ugly ;)
  3. I have made a feed for rockchip, especilly ugly ;(

that's why I need some time to clean my repo.

pengphei commented 4 months ago

Just for context, below is the complete bootlog starting in the uboot console. I would expect mtd to parse the partitions around [0.389703] but it does not happen. I must be missing some essential detail here 😒

  1. please use the patched kernel https://github.com/ticklab/rockchip-kernel/tree/openwrt-ticklab-5.10
  2. please config kernel with overlay/suqashfs/ubifs support
  3. remove rootfs="" env

with the last kernel, it will boot.

plan44 commented 4 months ago

Hi @pengphei, thanks a lot for your help! With this, it almost work, but not quite yet (ubifs problem, see below)

I forked your patched kernel, because I had to add a few fixes on top to make it build in my environment - macOS on M2 mac.

Then, I rebased the changes from your openwrt branch rockchip-22.03 on the latest openwrt 22.03 commit having kernel 5.10.160 to make sure openwrt and kernel are compatible, in a new branch p44-rockchip-rebased.

With this, I applied config to use the external kernel:

CONFIG_KERNEL_GIT_CLONE_URI="git@github.com:plan44/rockchip-kernel.git"
CONFIG_KERNEL_GIT_LOCAL_REPOSITORY=""
CONFIG_KERNEL_GIT_MIRROR_HASH=""
CONFIG_KERNEL_GIT_REF="openwrt-p44-5.10"

This now builds πŸ˜„ , and when flashed to "boot" and "rootfs" areas on luckfox pico max the kernel startsπŸ˜„ , correctly reads mtd πŸ˜„ , but then fails on attaching ubifs 😒

...

[    1.388037] ubi0: attaching mtd6
[    1.595318] ubi0: scanning is finished
[    1.599195] ubi0 error: ubi_read_volume_table: the layout volume was not found
[    1.606747] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd6, error -22
[    1.613832] UBI error: cannot attach mtd6

...

I guess I have something wrong in my changes in target/rockchip/image/cortexa7.mk to produce the ubifs rootfs.

full boot log:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.160 (luz@MBA15-2023.local) (arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 11.2.0 r0+19961-22333a94a0) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 PREEMPT Fri Jul 12 17:59:35 2024
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=50c53c7d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Luckfox Pico Max
[    0.000000] earlycon: uart8250 at MMIO32 0xff4c0000 (options '')
[    0.000000] printk: bootconsole [uart8250] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 67584 KiB at 0x0be00000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line: user_debug=31 storagemedia=mtd androidboot.storagemedia=mtd androidboot.mode=normal  earlycon=uart8250,mmio32,0xff4c0000 console=ttyS2,115200 mtdparts=spi-nand0:256K(env),256K@256K(idblock),512K(uboot),4M(boot),30M(oem),10M(userdata),210M(rootfs) ubi.mtd=6 root=ubi0:rootfs rootfstype=ubifs rk_dma_heap_cma=66M
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 184348K/262144K available (4994K kernel code, 277K rwdata, 1688K rodata, 192K init, 122K bss, 10212K reserved, 67584K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 30 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.008791] Switching to timer-based delay loop, resolution 41ns
[    0.015829] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=80000)
[    0.027111] pid_max: default: 4096 minimum: 301
[    0.032225] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.040260] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.049429] CPU: Testing write buffer coherency: ok
[    0.055827] Setting up static identity map for 0x81c0 - 0x8214
[    0.062399] rcu: Hierarchical SRCU implementation.
[    0.075049] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.084696] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370867519511994 ns
[    0.095486] futex hash table entries: 16 (order: -5, 192 bytes, linear)
[    0.103015] pinctrl core: initialized pinctrl subsystem
[    0.112478] NET: Registered protocol family 16
[    0.117822] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.132715] thermal_sys: Registered thermal governor 'step_wise'
[    0.132726] thermal_sys: Registered thermal governor 'user_space'
[    0.140400] cpuidle: using governor menu
[    0.152446] rv1106_suspend_init map dev_reg 0xff000000 -> 0xc1000000
[    0.213206] rockchip-gpio ff380000.gpio: probed /pinctrl/gpio@ff380000
[    0.223651] rockchip-gpio ff530000.gpio: probed /pinctrl/gpio@ff530000
[    0.233194] rockchip-gpio ff540000.gpio: probed /pinctrl/gpio@ff540000
[    0.243215] rockchip-gpio ff550000.gpio: probed /pinctrl/gpio@ff550000
[    0.252777] rockchip-gpio ff560000.gpio: probed /pinctrl/gpio@ff560000
[    0.260606] rockchip-pinctrl pinctrl: probed pinctrl
[    0.339432] rk_dvbm ffa70000.rkdvbm: probe start
[    0.344726] rk_dvbm ffa70000.rkdvbm: dvbm ctx (ptrval)
[    0.350798] rk_dvbm ffa70000.rkdvbm: probe success
[    0.361822] iommu: Default domain type: Passthrough 
[    0.369721] SCSI subsystem initialized
[    0.377147] usbcore: registered new interface driver usbfs
[    0.383814] usbcore: registered new interface driver hub
[    0.390234] usbcore: registered new device driver usb
[    0.400693] Advanced Linux Sound Architecture Driver Initialized.
[    0.409317] rockchip,rknpor-powergood ff000000.syscon:rknpor-powergood: probe success!
[    0.419806] clocksource: Switched to clocksource arch_sys_counter
[    0.431787] NET: Registered protocol family 2
[    0.436881] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.445693] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.455050] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.463527] TCP bind hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.471314] TCP: Hash tables configured (established 2048 bind 2048)
[    0.478410] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.485630] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.493527] NET: Registered protocol family 1
[    0.498364] PCI: CLS 0 bytes, default 64
[    0.503712] rockchip-thermal ff3c8000.tsadc: tsadc is probed successfully!
[    0.514850] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.525427] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.531928] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.545756] rockchip-usb2phy ff3e0000.usb2-phy: IRQ index 0 not found
[    0.582187] dma-pl330 ff420000.dma-controller: Loaded driver for PL330 DMAC-241330
[    0.590795] dma-pl330 ff420000.dma-controller:   DBUFF-128x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
[    0.603644] misc rk_decom: misc device rk_decom register success.
[    0.610696] rockchip-pvtm ff240000.pvtm: pvtm@0 probed
[    0.617120] rockchip-pvtm ff390000.pvtm: pvtm@0 probed
[    0.624116] rockchip-system-monitor rockchip-system-monitor: system monitor probe
[    0.634568] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[    0.643599] ff4c0000.serial: ttyS2 at MMIO 0xff4c0000 (irq = 40, base_baud = 1500000) is a 16550A
[    0.653690] printk: console [ttyS2] enabled
[    0.653690] printk: console [ttyS2] enabled
[    0.662492] printk: bootconsole [uart8250] disabled
[    0.662492] printk: bootconsole [uart8250] disabled
[    0.674543] ff4d0000.serial: ttyS3 at MMIO 0xff4d0000 (irq = 41, base_baud = 1500000) is a 16550A
[    0.685240] ff4e0000.serial: ttyS4 at MMIO 0xff4e0000 (irq = 42, base_baud = 1500000) is a 16550A
[    0.702206] rockchip-spi ff500000.spi: no high_speed pinctrl state
[    0.708716] random: crng init done
[    0.714011] rockchip-spi ff500000.spi: register misc device rkspi-dev0
[    0.720669] rockchip-spi ff500000.spi: probed, poll=0, rsd=0
[    0.729161] spi-nand spi2.0: Winbond SPI NAND was found.
[    0.734599] spi-nand spi2.0: 256 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
[    0.743966] mtd: Found partition defined in DT for env. Assigning OF node to support nvmem.
[    0.743977] mtd: Found partition defined in DT for idblock. Assigning OF node to support nvmem.
[    0.752370] mtd: Found partition defined in DT for uboot. Assigning OF node to support nvmem.
[    0.761086] mtd: Found partition defined in DT for boot. Assigning OF node to support nvmem.
[    0.769619] mtd: Found partition defined in DT for oem. Assigning OF node to support nvmem.
[    0.778057] mtd: Found partition defined in DT for userdata. Assigning OF node to support nvmem.
[    0.786407] mtd: Found partition defined in DT for rootfs. Assigning OF node to support nvmem.
[    0.795186] 7 cmdlinepart partitions found on MTD device spi-nand0
[    0.809963] Creating 7 MTD partitions on "spi-nand0":
[    0.815020] 0x000000000000-0x000000040000 : "env"
[    0.820878] 0x000000040000-0x000000080000 : "idblock"
[    0.827247] 0x000000080000-0x000000100000 : "uboot"
[    0.833437] 0x000000100000-0x000000500000 : "boot"
[    0.839377] 0x000000500000-0x000002300000 : "oem"
[    0.845469] 0x000002300000-0x000002d00000 : "userdata"
[    0.851890] 0x000002d00000-0x00000ff00000 : "rootfs"
[    0.858921] mtd: setting mtd6 (rootfs) as root device
[    0.864287] mtdsplit: no squashfs found in "rootfs"
[    0.881362] dwc3 ffb00000.usb: Configuration mismatch. dr_mode forced to host
[    0.897052] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.903820] ehci-platform: EHCI generic platform driver
[    0.909756] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.916062] ohci-platform: OHCI generic platform driver
[    0.922683] phy phy-ff3e0000.usb2-phy.0: illegal mode
[    0.927880] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    0.933443] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[    0.941326] xhci-hcd xhci-hcd.0.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000000022010010
[    0.950801] xhci-hcd xhci-hcd.0.auto: irq 71, io mem 0xffb00000
[    0.958221] hub 1-0:1.0: USB hub found
[    0.962108] hub 1-0:1.0: 1 port detected
[    0.967259] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    0.972856] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[    0.980595] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[    0.987324] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    0.996786] hub 2-0:1.0: USB hub found
[    1.000672] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    1.009403] usbcore: registered new interface driver cdc_acm
[    1.015188] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    1.026164] rtc rtc0: invalid alarm value: 2001-10-09T28:02:10
[    1.034270] rockchip-rtc ff1c0000.rtc: registered as rtc0
[    1.039889] rockchip-rtc ff1c0000.rtc: setting system clock to 2021-01-01T14:02:37 UTC (1609509757)
[    1.049952] i2c /dev entries driver
[    1.058173] i2c i2c-4: 1 i2c clients have been registered at 0x30
[    1.065791] i2c i2c-4: 2 i2c clients have been registered at 0x30
[    1.078203] softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
[    1.086861] softdog:              soft_reboot_cmd=<not set> soft_active_on_boot=0
[    1.096068] Synopsys Designware Multimedia Card Interface Driver
[    1.103835] dwmmc_rockchip ffaa0000.mmc: No normal pinctrl state
[    1.109965] dwmmc_rockchip ffaa0000.mmc: No idle pinctrl state
[    1.115908] dwmmc_rockchip ffaa0000.mmc: is rv1106 sd
[    1.121004] dwmmc_rockchip ffaa0000.mmc: IDMAC supports 32-bit address mode.
[    1.128091] dwmmc_rockchip ffaa0000.mmc: Using internal DMA controller.
[    1.134719] dwmmc_rockchip ffaa0000.mmc: Version ID is 270a
[    1.140337] dwmmc_rockchip ffaa0000.mmc: DW MMC controller at irq 59,32 bit host data width,256 deep fifo
[    1.154886] rksfc_base v1.1 2016-01-08
[    1.159726] usbcore: registered new interface driver snd-usb-audio
[    1.166083] mmc_host mmc1: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[    1.178074] rv1106-acodec ff480000.acodec: current soc_id: rv1106
[    1.184444] rv1106-acodec ff480000.acodec: Use pa_ctl_gpio and pa_ctl_delay_ms: 0
[    1.197407] NET: Registered protocol family 10
[    1.202901] Segment Routing with IPv6
[    1.206855] NET: Registered protocol family 17
[    1.211436] 8021q: 802.1Q VLAN Support v1.8
[    1.219719] flash vendor_init_thread!
[    1.224352] rga: rga2, irq = 45, match scheduler
[    1.229087] flash vendor storage:20170308 ret = -1
[    1.235225] rga: rga2 hardware loaded successfully, hw_version:3.3.87975.
[    1.242271] rga: rga2 probe successfully
[    1.247331] rga_iommu: IOMMU binding successfully, default mapping core[0x4]
[    1.255099] rga: Module initialized. v1.3.1
[    1.259428] mmc1: invalid bus width
[    1.262965] mmc1: error -22 whilst initialising SD card
[    1.268558] rve: rve_irq, irq = 61, match scheduler
[    1.274538] rve: Driver loaded successfully rve[2] ver:[2021]58.1a
[    1.280841] rve: probe successfully
[    1.284423] mmc_host mmc1: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
[    1.294863] rve: Module initialized. v1.0.5
[    1.342634] mmc_host mmc1: Bus speed (slot 0) = 49500000Hz (slot req 50000000Hz, actual 49500000HZ div = 0)
[    1.352472] mmc1: new high speed SDHC card at address 59b4
[    1.359059] mmcblk1: mmc1:59b4 00000 7.35 GiB 
[    1.388037] ubi0: attaching mtd6
[    1.595318] ubi0: scanning is finished
[    1.599195] ubi0 error: ubi_read_volume_table: the layout volume was not found
[    1.606747] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd6, error -22
[    1.613832] UBI error: cannot attach mtd6
[    1.619575] RKNPU ff660000.npu: RKNPU: rknpu iommu device-tree entry not found!, using non-iommu mode
[    1.629536] RKNPU ff660000.npu: RKNPU: Initialized RKNPU driver: v0.9.2 for 20230825
[    1.637476] RKNPU ff660000.npu: dev_pm_opp_set_regulators: no regulator (rknpu) found: -19
[    1.647831] rockchip-pm rockchip-suspend: not set sleep mode config
[    1.654244] rockchip-pm rockchip-suspend: not set wakeup-config
[    1.660209] rockchip-pm rockchip-suspend: not set pwm-regulator-config
[    1.666930] rockchip-suspend not set sleep-mode-config for mem-lite
[    1.673237] rockchip-suspend not set wakeup-config for mem-lite
[    1.679181] rockchip-suspend not set sleep-mode-config for mem-ultra
[    1.685546] rockchip-suspend not set wakeup-config for mem-ultra
[    1.693019] ALSA device list:
[    1.696078]   #0: rv-acodec
[    1.699095] dw-apb-uart ff4c0000.serial: forbid DMA for kernel console
[    1.705855] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(31,6): error -19
[    1.713991] Please append a correct "root=" boot option; here are the available partitions:
[    1.722366] 1f00             256 mtdblock0 
[    1.722370]  (driver?)
[    1.728923] 1f01             256 mtdblock1 
[    1.728926]  (driver?)
[    1.735473] 1f02             512 mtdblock2 
[    1.735477]  (driver?)
[    1.742023] 1f03            4096 mtdblock3 
[    1.742026]  (driver?)
[    1.748569] 1f04           30720 mtdblock4 
[    1.748572]  (driver?)
[    1.755116] 1f05           10240 mtdblock5 
[    1.755119]  (driver?)
[    1.761661] 1f06          215040 mtdblock6 
[    1.761665]  (driver?)
[    1.768206] b300         7707648 mmcblk1 
[    1.768210]  driver: mmcblk
[    1.775013] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,6)
plan44 commented 4 months ago

@pengphei: just found the problem πŸ˜„ , need to use append-ubi, not append-rootfs for correctly generating ubi/ubifs. See latest commit.

pengphei commented 4 months ago

@pengphei: just found the problem πŸ˜„ , need to use append-ubi, not append-rootfs for correctly generating ubi/ubifs. See latest commit.

good luck, later I will update the uclibc referring patches, but it will have many patches including openwrt, and its referring packages.

uclibc patches and nand support for openwrt base has been updated, referring to https://github.com/ticklab/openwrt/commits/rockchip-22.03/

plan44 commented 4 months ago

good luck Thanks πŸ˜„

It boots with all of rootfs as ubifs, but I'd like to use the "squashfs+ubifs overlay in ubi" variant and am stuck with that - I just don't understand yet why it does not work, and now hope someone over at the openwrt forum will have an idea.