Rockchip RK3588 - 移植uboot 2017.09 & linux 6.1(友善之家脚本方式)

----------------------------------------------------------------------------------------------------------------------------

开发板 :NanoPC-T6开发板eMMC256GBLPDDR416GB
显示屏 :15.6英寸HDMI接口显示屏u-boot2017.09linux6.1
----------------------------------------------------------------------------------------------------------------------------

本节将会介绍官方固件方式uboot 2017.09以及linux 6.1内核的编译过程,教程来自友善之家官方手册。

一、下载工具和固件

1.1 下载工具
root@zhengyang:/work/sambashare/rk3588/friendly# git clone https://github.com/friendlyarm/sd-fuse_rk3588.git --single-branch -b kernel-6.1.y
root@zhengyang:/work/sambashare/rk3588/friendly# git clone https://521github.com/friendlyarm/sd-fuse_rk3588.git --single-branch -b kernel-6.1.y  #同上,二选一
root@zhengyang:/work/sambashare/rk3588/friendly# cd sd-fuse_rk3588/

如果第一个下载比较慢,可以尝试使用第二个命令,切换镜像源。后面涉及到的github源码下载,均可切换为521github

1.2 下载固件

系统镜像,这里我们以debian-bullseye-desktop-arm64 为例,下载地址:https://download.friendlyelec.com/NanoPC-T6

debian-bullseye-desktop-arm64-images.tgz(位于"\03_分区镜像文件"目录下,以实际下载的文件为准)拷贝到/work/sambashare/rk3588/friendly/sd-fuse_rk3588目录下;

root@zhengyang:/work/sambashare/rk3588/sd-fuse_rk3588# ll debian*
-rwxrw-rw- 1 root root 1590466719 Dec  3 01:49 debian-bullseye-desktop-arm64-images.tgz*
-rwxrw-rw- 1 root root         75 Nov 18 19:05 debian-bullseye-desktop-arm64-images.tgz.hash.md5*
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# tar -xvzf debian-bullseye-desktop-arm64-images.tgz

解压得到debian-bullseye-desktop-arm64文件夹;

root@zhengyang:/work/sambashare/rk3588/sd-fuse_rk3588# ll debian-bullseye-desktop-arm64
-rw-r--r--  1 root root    8072140 May 28  2023 boot.img
-rw-r--r--  1 root root       1424 May 28  2023 dtbo.img
-rw-r--r--  1 root root     307200 Sep  8 23:33 idbloader.img
-rw-r--r--  1 root root         64 Nov 17 10:03 info.conf
-rw-r--r--  1 root root   35551252 Nov 16 16:17 kernel.img
-rw-r--r--  1 root root     471488 Sep  8 23:33 MiniLoaderAll.bin
-rw-r--r--  1 root root      49152 May 28  2023 misc.img
-rw-r--r--  1 root root        470 Nov 17 10:03 parameter.txt
-rw-r--r--  1 root root    6227456 Nov 16 16:17 resource.img
-rw-r--r--  1 root root 3992675220 Nov 17 10:03 rootfs.img
-rw-r--r--  1 root root    4194304 Sep  8 23:33 uboot.img
-rw-r--r--  1 root root     159868 Nov 17 10:03 userdata.img

二、编译内核

2.1 下载内核源码

下载内核源代码:

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# git clone https://github.com/friendlyarm/kernel-rockchip --depth 1 -b nanopi6-v6.1.y kernel-rk3588

保存到当前路径kernel-rk3588文件夹中。

2.2 修改build-kernel.sh脚本

在编译内核之前我们需要修改build-kernel.sh脚本;

根据自己安装的交叉编译环境,这里我需要替换如下代码为:

CROSS_COMPILE=aarch64-linux-gnu-  修改为 CROSS_COMPILE=arm-linux-

并且将如下代码移除:

export PATH=/opt/FriendlyARM/toolchain/11.3-aarch64/bin/:$PATH 
if [ ! -d /opt/FriendlyARM/toolchain/11.3-aarch64 ]; then
        echo "please install aarch64-gcc-11.3 first, using these commands: "
        echo "    git clone https://github.com/friendlyarm/prebuilts.git -b master --depth 1"
        echo "    cd prebuilts/gcc-x64"
        echo "    sudo tar xvf toolchain-11.3-aarch64.tar.xz -C /"
        exit 1
fi

我安装的交叉编译环境位于/usr/local/arm/12.2.1,并且我已经将其配置为全局环境变量了。

此外我们还需要修改./tools/update_kernel_bin_to_img.sh,配置;

CROSS_COMPILE=arm-linux-
2.3 编译内核

执行编译内核命令,编译完成后会自动更新debian-bullseye-desktop-arm64目录下的相关镜像文件,包括文件系统中的内核模块 (rootfs.img会被解包并重新打包,即更新/lib/modules下的驱动模块);

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# KERNEL_SRC=$PWD/kernel-rk3588 ./build-kernel.sh debian-bullseye-desktop-arm64
using official logo.
using official kernel logo.
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACC    scripts/kconfig/zconf.tab.c
  LEX     scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
  WRAP    arch/arm64/include/generated/uapi/asm/errno.h
  WRAP    arch/arm64/include/generated/uapi/asm/ioctl.h
......

其中:

  • KERNEL_SRC配置为内核源码所在路径;
  • $1配置为目标OS系统debian-bullseye-desktop-arm64

如果需要修改开机logo,只需要替换kernel-rockchip目录下的logo.bmplogo_kernel.bmp文件即可。

编译完成后会在./out路径下生成若干文件:ogo_kernel.bmp文件即可;

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll out/
drwxr-xr-x  7 root root  4096 Dec  4 22:43 cryptodev-linux/
drwxr-xr-x  4 root root  4096 Dec  4 22:43 nft-fullcone/
drwxr-xr-x  3 root root  4096 Dec  4 22:42 output_rk3588_kmodules/
drwxr-xr-x  3 root root  4096 Dec  4 22:43 r8125/
drwxr-xr-x 22 root root  4096 Dec  4 22:47 rootfs_new/
drwxr-xr-x  8 root root  4096 Dec  4 22:46 rtl8812au/
drwxr-xr-x  9 root root  4096 Dec  4 22:44 rtl8821CU/
drwxr-xr-x  8 root root  4096 Dec  4 22:45 rtl8822bu/
drwxr-xr-x  8 root root  4096 Dec  4 22:45 rtl8822cs/
drwxr-xr-x  4 root root 16384 Dec  4 22:43 rtw88/

其中:

  • cryptodev-linuxrtl8812aurtl8821CUrtl8822burtl8822csrtw88cryptodev以及usb wifi驱动源码;
  • output_rk3588_kmodules:为内核驱动模块;
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ls out/output_rk3588_kmodules/lib/modules/6.1.25/
cryptodev.ko               modules.builtin.bin      modules.softdep      rtl8821CU.ko   rtw_8723du.ko  rtw_8822bs.ko  rtw_sdio.ko
kernel                     modules.builtin.modinfo  modules.symbols      rtl8822bu.ko   rtw_8821ce.ko  rtw_8822ce.ko  rtw_usb.ko
modules.alias              modules.dep              modules.symbols.bin  rtl8822cs.ko   rtw_8821c.ko   rtw_8822c.ko
modules.alias.bin          modules.dep.bin          nft_fullcone.ko      rtw_8723de.ko  rtw_8821cs.ko  rtw_8822cs.ko
modules.builtin            modules.devname          r8125.ko             rtw_8723d.ko   rtw_8822be.ko  rtw_core.ko
modules.builtin.alias.bin  modules.order            rtl8812au.ko         rtw_8723ds.ko  rtw_8822b.ko   rtw_pci.ko
  • rootfs_new:新的根文件系统的源码;

此外debian-bullseye-desktop-arm64目录下的内核镜像和根文件系统被更新了;

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll debian-bullseye-desktop-arm64
总用量 3962492
drwxr-xr-x  2 root root       4096 Dec  4 22:48 ./
drwxr-xr-x 11 root root       4096 Dec  4 22:42 ../
-rw-r--r--  1 root root    8072140 May 28  2023 boot.img
-rw-r--r--  1 root root       1424 May 28  2023 dtbo.img
-rw-r--r--  1 root root     307200 Sep  8 23:33 idbloader.img
-rw-r--r--  1 root root         64 Nov 17 10:03 info.conf
-rw-r--r--  1 root root   37910548 Dec  4 22:46 kernel.img     # 更新了 
-rw-r--r--  1 root root     471488 Sep  8 23:33 MiniLoaderAll.bin
-rw-r--r--  1 root root      49152 May 28  2023 misc.img
-rw-r--r--  1 root root        470 Dec  4 22:48 parameter.txt   # 更新了
-rw-r--r--  1 root root    5785600 Dec  4 22:46 resource.img  # 更新了
-rw-r--r--  1 root root 4000600956 Dec  4 22:48 rootfs.img    # 更新了
-rw-r--r--  1 root root    4194304 Sep  8 23:33 uboot.img
-rw-r--r--  1 root root     159868 Nov 17 10:03 userdata.img
2.4 build-kernel.sh分析

如果感兴趣可以分析一下./build-kernel.sh的主要工作流程。

2.4.1 配置内核

首先配置内核:

cd ${KERNEL_SRC}
[ -d .git ] && git clean -dxf    # 如果不想每次都重新编译,将改行屏蔽
touch .scmversion

make CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} ${KCFG}

其中:

  • CROSS_COMPILE被配置成arm-linux-
  • ARCH被配置成arm64
  • KCFG被配置成nanopi6_linux_defconfig;
2.4.2 编译内核
make CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} ${KALL} -j$(nproc)

其中:

  • KALL被配置成nanopi6-images;编译规则定义在arch/arm64/Makefile文件;
  • $(nproc):用于获取系统中可用的处理器核心数;

arch/arm64/Makefile文件;

# 编译生成kernel.img      
kernel.img: Image
        $(Q)scripts/mkkrnlimg $(objtree)/arch/arm64/boot/Image $(objtree)/kernel.img >/dev/null
        @echo '  Image:  kernel.img is ready'

ifeq ($(CONFIG_VENDOR_FRIENDLYELEC),y)
DTBS := rk3*-nanopi*-rev*.dtb

# 调用scripts/mkimg编译生成resource.img(由设备树、图片资源文件组成,不包含内核)
nanopi4-images: dtbs kernel.img $(LOGO) $(LOGO_KERNEL)
        $(Q)$(srctree)/scripts/mkimg --dtb $(DTBS) --keep-dtb-name

nanopi5-images: nanopi4-images
nanopi6-images: nanopi4-images
PHONY += nanopi4-images nanopi5-images nanopi6-images
endif

因此该步骤执行完成后,会在./kernel-rk3588目录下生成·kernel.imgresource.img`文件 ;

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll ./kernel-rk3588/kernel.img
-rw-r--r-- 1 root root 37910548 Dec  4 22:54 ./kernel-rk3588/kernel.img
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll ./kernel-rk3588/resource.img
-rw-r--r-- 1 root root 5785600 Dec  4 22:54 ./kernel-rk3588/resource.img
2.4.3 编译驱动模块

执行make modules命令编译驱动模块:

rm -rf ${KMODULES_OUTDIR}
mkdir -p ${KMODULES_OUTDIR}
make CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} INSTALL_MOD_PATH=${KMODULES_OUTDIR} modules -j$(nproc)
if [ $? -ne 0 ]; then
   echo "failed to build kernel modules."
   exit 1
fi

其中:

  • 内核模块路径KMODULES_OUTDIR被配置为./out/output_rk3588_kmodules
TOPPATH=$PWD
OUT=$TOPPATH/out
if [ ! -d $OUT ]; then
        echo "path not found: $OUT"
        exit 1
fi
KMODULES_OUTDIR="${OUT}/output_${SOC}_kmodules"  # out/output_rk3588_kmodules
2.4.4 安装驱动模块

执行make modules_install命令安装驱动模块:

make CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} INSTALL_MOD_PATH=${KMODULES_OUTDIR} modules_install
if [ $? -ne 0 ]; then
    echo "failed to build kernel modules."
         exit 1
fi

# 用于构建并输出内核版本号
KERNEL_VER=`make CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} kernelrelease`

# 如果模块依赖文件modules.dep不存在,则生成内核模块的依赖关系
[ ! -f "${KMODULES_OUTDIR}/lib/modules/${KERNEL_VER}/modules.dep" ] && depmod -b ${KMODULES_OUTDIR} -E Module.symvers -F System.map -w ${KERNEL_VER}
# 去除驱动中的符号信息
(cd ${KMODULES_OUTDIR} && find . -name \*.ko | xargs ${CROSS_COMPILE}strip --strip-unneeded)

(1) 接着编译cryptodev.ko驱动,并拷贝到内核模块路径out/output_rk3588_kmodules/lib/modules/6.1.25/

# build cryptodev-linux
(cd ${OUT} && {
	if [ ! -d cryptodev-linux ]; then
		git clone https://github.com/cryptodev-linux/cryptodev-linux.git -b master cryptodev-linux
	fi
	(cd cryptodev-linux && {
		make CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} KERNEL_DIR=${KERNEL_SRC}
		cp cryptodev.ko ${KMODULES_OUTDIR}/lib/modules/${KERNEL_VER} -afv
	})
})

cryptodev-linux 是一个linux内核模块,它提供了一个加密硬件的接口,可在用户空间中使用该接口来执行加密和解密操作。

(2) 接着编译usb wifi driver

if [ ${BUILD_THIRD_PARTY_DRIVER} -eq 1 ]; then
	for (( i=0; i<${#KERNEL_3RD_DRIVERS[@]}; i++ ));
	do
		build_external_module ${KERNEL_3RD_DRIVERS[$i]} ${KERNEL_3RD_DRIVER_BRANCHES[$i]} ${KERNEL_3RD_DRIVER_NAME[$i]}
	done
fi
2.4.5 更新内核模块依赖

使用depmod命令更新内核模块依赖:

(cd ${KMODULES_OUTDIR}/lib/modules/${KERNEL_VER}/ && {
	rm -rf ./build ./source
	echo "depmod ${KMODULES_OUTDIR} ${KERNEL_VER} ..."
	depmod -a -b ${KMODULES_OUTDIR} ${KERNEL_VER}
})

其中:

  • -a 选项表示更新所有已经加载或已知的内核模块的依赖关系;
  • -b 选项用于指定内核模块所在的目录;
2.4.6 重新打包rootfs.img

执行./tools/update_kernel_bin_to_img.sh脚本解压并重新打包rootfs.img

./tools/update_kernel_bin_to_img.sh ${OUT} ${KERNEL_SRC} ${TARGET_OS} ${TOPPATH}/prebuilt

其中:

  • OUT配置为./out
  • KERNEL_SRC配置为./kernel-rk3588
  • TARGET_OS配置为debian-bullseye-desktop-arm64
  • TOPPATH配置为./

其主要工作就是:

  • 挂载根文件系统./debian-bullseye-desktop-arm64/rootfs.img到某个路径;
  • 删除原有的驱动模块,即mount_point/lib/modules/*文件
  • 使用cp -af将新编译的驱动模块拷贝到mount_point/lib/modules
  • 如果存在固件(./out/output_rk3588_kmodules/lib//lib/firmware目录下),使用cp -af将新编译的固件库拷贝到mount_point/lib/firmware
  • 重新制作根文件系统镜像文件;

update_kernel_bin_to_img.sh脚本源码如下:

#!/bin/bash
set -eu

[ -f ${PWD}/mk-emmc-image.sh ] || {
        echo "Error: please run at the script's home dir"
        exit 1
}

# Automatically re-run script under sudo if not root
if [ $(id -u) -ne 0 ]; then
    echo "Re-running script under sudo..."
    sudo --preserve-env "$0" "$@"
    exit
fi

TOP=$PWD
export MKE2FS_CONFIG="${TOP}/tools/mke2fs.conf"
if [ ! -f ${MKE2FS_CONFIG} ]; then
    echo "error: ${MKE2FS_CONFIG} not found."
    exit 1
fi
true ${MKFS:="${TOP}/tools/mke2fs"}

true ${SOC:=rk3588}
ARCH=arm64
KCFG=nanopi5_linux_defconfig
KIMG=kernel.img
KDTB=resource.img
CROSS_COMPILE=arm-linux-   #aarch64-linux-gnu-
# ${OUT} ${KERNEL_SRC} ${TOPPATH}/${TARGET_OS} ${TOPPATH}/prebuilt
if [ $# -ne 4 ]; then
        echo "bug: missing arg, $0 needs four args"
        exit
fi
OUT=$1
KERNEL_BUILD_DIR=$2
TARGET_OS=$3
PREBUILT=$4
KMODULES_OUTDIR="${OUT}/output_${SOC}_kmodules"

(cd ${KERNEL_BUILD_DIR} && {
        cp ${KIMG} ${KDTB} ${TOP}/${TARGET_OS}/
})

# copy kernel modules to rootfs.img
if [ -f ${TARGET_OS}/rootfs.img ]; then           # 进入,重新打包rootfs.img
    echo "copying kernel module and firmware to rootfs ..."

    # Extract rootfs from img
    simg2img ${TARGET_OS}/rootfs.img ${TARGET_OS}/r.img
    mkdir -p ${OUT}/rootfs_mnt
    mkdir -p ${OUT}/rootfs_new
    mount -t ext4 -o loop ${TARGET_OS}/r.img ${OUT}/rootfs_mnt
    if [ $? -ne 0 ]; then
        echo "failed to mount ${TARGET_OS}/r.img."
        exit 1
    fi
    rm -rf ${OUT}/rootfs_new/*
    cp -af ${OUT}/rootfs_mnt/* ${OUT}/rootfs_new/
    umount ${OUT}/rootfs_mnt
    rm -rf ${OUT}/rootfs_mnt
    rm -f ${TARGET_OS}/r.img

    # Processing rootfs_new
    # Here s5pxx18 is different from h3/h5

    [ -d ${KMODULES_OUTDIR}/lib/firmware ] && cp -af ${KMODULES_OUTDIR}/lib/firmware/* ${OUT}/rootfs_new/lib/firmware/
    rm -rf ${OUT}/rootfs_new/lib/modules/*
    cp -af ${KMODULES_OUTDIR}/lib/modules/* ${OUT}/rootfs_new/lib/modules/

    MKFS_OPTS="-E android_sparse -t ext4 -L rootfs -M /root -b 4096"
    case ${TARGET_OS} in
    friendlywrt* | buildroot*)
        # set default uid/gid to 0
        MKFS_OPTS="-0 ${MKFS_OPTS}"
        ;;
    *)
        ;;
    esac

    # Make rootfs.img
    ROOTFS_DIR=${OUT}/rootfs_new

    case ${TARGET_OS} in
    friendlywrt*)
        echo "prepare kernel modules for friendlywrt ..."
        ${TOP}/tools/prepare_friendlywrt_kernelmodules.sh ${ROOTFS_DIR}
        ;;
    *)
        ;;
    esac

    # clean device files
    (cd ${ROOTFS_DIR}/dev && find . ! -type d -exec rm {} \;)
    # calc image size
    IMG_SIZE=$(((`du -s -B64M ${ROOTFS_DIR} | cut -f1` + 3) * 1024 * 1024 * 64))
    IMG_BLK=$((${IMG_SIZE} / 4096))
    INODE_SIZE=$((`find ${ROOTFS_DIR} | wc -l` + 128))
    # make fs
    [ -f ${TARGET_OS}/rootfs.img ] && rm -f ${TARGET_OS}/rootfs.img
    ${MKFS} -N ${INODE_SIZE} ${MKFS_OPTS} -d ${ROOTFS_DIR} ${TARGET_OS}/rootfs.img ${IMG_BLK}

    if [ ${TARGET_OS} != "eflasher" ]; then
        case ${TARGET_OS} in
        openmediavault-*)
            # disable overlayfs for openmediavault
            cp ${TOP}/prebuilt/parameter-ext4.txt ${TOP}/${TARGET_OS}/parameter.txt
            ;;
        *)
            ${TOP}/tools/generate-partmap-txt.sh ${IMG_SIZE} ${TARGET_OS}
            ;;
        esac
    fi
else
    echo "not found ${TARGET_OS}/rootfs.img"
    exit 1
fi
2.5 编译内核头文件

编译内核头文件运行如下命令:

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# MK_HEADERS_DEB=1 BUILD_THIRD_PARTY_DRIVER=0 KERNEL_SRC=$PWD/kernel-rk3588 ./build-kernel.sh debian-bullseye-desktop-arm64

这里设置了MK_HEADERS_DEB=1表示编译内核头文件;

这里我们分析一下内核头文件的编译过程,其实现代码如下:

if [ ${MK_HEADERS_DEB} -eq 1 ]; then
	# 设置内核头文件dep包路径为 ./out/linux-headers-6.1.25.deb
	KERNEL_HEADERS_DEB=${OUT}/linux-headers-${KERNEL_VER}.deb
	rm -f ${KERNEL_HEADERS_DEB}
	# 1. 重点 构建debian包
	make CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} bindeb-pkg
	if [ $? -ne 0 ]; then
		echo "failed to build kernel header."
		exit 1
	fi

    # 跳转到 ./kernel-rk3588/debian/linux-headers目录下
	(cd ${KERNEL_SRC}/debian/linux-headers && {
		# 删除usr/src/linux-headers*/scripts/子目录下以 .o 结尾的文件和以 .*.cmd结尾的隐藏文件
		find usr/src/linux-headers*/scripts/ \
			-name "*.o" -o -name ".*.cmd" | xargs rm -rf

		# 2. 设置头文件脚本目录./files/linux-headers-5.10-bin_arm64/scripts
		HEADERS_SCRIPT_DIR=${TOPPATH}/files/linux-headers-5.10-bin_arm64/scripts
		if [ -d ${HEADERS_SCRIPT_DIR} ]; then
			# 拷贝脚本文件到 ./kernel-rk3588/debian/linux-headers/usr/src/linux-headers-6.1.25/scripts/
			cp -avf ${HEADERS_SCRIPT_DIR}/* ./usr/src/linux-headers-*${KERNEL_VER}*/scripts/
			if [ $? -ne 0 ]; then
				echo "failed to copy bin file to /usr/src/linux-headers-${KERNEL_VER}."
				exit 1
			fi
		else
			echo "not found files/linux-headers-x.y.z-bin_arm64, why?"
			exit 1
		fi

		find . -type f ! -path './DEBIAN/*' -printf '%P\0' | xargs -r0 md5sum > DEBIAN/md5sums
	})
	
	# 3. 使用dpkg工具将指定的目录打包成一个debian软件包
	dpkg-deb -Zgzip -b ${KERNEL_SRC}/debian/linux-headers ${KERNEL_HEADERS_DEB}
	if [ $? -ne 0 ]; then
		echo "failed to re-make deb package."
		exit 1
	fi

	# clean up 移除./路径下的xxx.deb文件
	(cd $TOPPATH && {
		rm -f linux-*${KERNEL_VER}*_arm64.buildinfo
		rm -f linux-*${KERNEL_VER}*_arm64.changes
		rm -f linux-headers-*${KERNEL_VER}*_arm64.deb
		rm -f linux-image-*${KERNEL_VER}*_arm64.deb
		rm -f linux-libc-dev_*${KERNEL_VER}*_arm64.deb
	})
fi

接下来我们分析一下这段代码,主要涉及三大步骤。

2.5.1 make bindeb-pkg

这里其中有一条比较重要的命令:

make CROSS_COMPILE=${CROSS_COMPILE} ARCH=${ARCH} bindeb-pkgmkae bindeb-pkg

make bindeb-pkg是一个用于构建debian包的命令,它通常用于编译linux内核并生成对应的debian软件包。

当执行make bindeb-pkg 命令时,它会读取当前目录下的linux内核源代码,并根据配置文件进行内核编译。

编译过程将包括编译内核、生成模块、创建initramfs等步骤。最后,它将生成一组二进制文件和相关的debian控制文件,用于创建 debian包。

对于kernel-rk3588执行完成会在内核源码debian目录生成以下文件;

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll kernel-rk3588/debian/
-rw-r--r--  1 root root    6 Dec  4 22:54 arch
-rw-r--r--  1 root root  137 Dec  4 22:54 changelog
-rw-r--r--  1 root root 1250 Dec  4 22:54 control
-rw-r--r--  1 root root  692 Dec  4 22:54 copyright
-rw-r--r--  1 root root  272 Dec  4 22:57 files
drwxr-xr-x  5 root root 4096 Dec  4 22:55 linux-headers/
drwxr-xr-x  7 root root 4096 Dec  4 22:55 linux-image/
drwxr-xr-x  4 root root 4096 Dec  4 22:56 linux-image-dbg/
drwxr-xr-x  4 root root 4096 Dec  4 22:56 linux-libc-dev/
-rwxr-xr-x  1 root root  384 Dec  4 22:54 rules*
drwxr-xr-x  2 root root 4096 Dec  4 22:54 source/

同时会在kernel-rk3588上一级目录下生成如下deb包:

  • linux-image-<version>.deb:内核镜像文件,用于安装和引导新的内核;
  • linux-headers-<version>.deb:内核头文件,用于开发其他软件或编译内核模块;
  • linux-libc-dev_<version>.deb:用于构建用户空间软件的头文件和静态库;

这些生成的debian包可以在 debian或基于debian的系统上安装和使用;

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll ./
-rw-r--r--  1 root root  8547400 Dec  4 22:56 linux-headers-6.1.25_6.1.25-3_arm64.deb
-rw-r--r--  1 root root 32745044 Dec  4 22:56 linux-image-6.1.25_6.1.25-3_arm64.deb
-rw-r--r--  1 root root 84501592 Dec  4 22:57 linux-image-6.1.25-dbg_6.1.25-3_arm64.deb
-rw-r--r--  1 root root  1319152 Dec  4 22:56 linux-libc-dev_6.1.25-3_arm64.deb
-rw-r--r--  1 root root     5660 Dec  4 22:57 linux-upstream_6.1.25-3_arm64.buildinfo
......

需要注意的是:这些deb文件在脚本执行的最后会被删除。

2.5.2 工具拷贝

拷贝./files/linux-headers-5.10-bin_arm64/scripts/下的编译相关的工具到./kernel-rk3588/debian/linux-headers/usr/src/linux-headers-6.1.25/scripts下;

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll ./files/linux-headers-5.10-bin_arm64/scripts/
-rwxr-xr-x 1 root root 32688 Dec  4 21:13 asn1_compiler*
drwxr-xr-x 2 root root  4096 Dec  4 21:13 basic/
drwxr-xr-x 2 root root  4096 Dec  4 21:13 dtc/
-rwxr-xr-x 1 root root 15096 Dec  4 21:13 extract-cert*
drwxr-xr-x 2 root root  4096 Dec  4 21:13 genksyms/
-rwxr-xr-x 1 root root 23896 Dec  4 21:13 kallsyms*
drwxr-xr-x 2 root root  4096 Dec  4 21:13 kconfig/
drwxr-xr-x 2 root root  4096 Dec  4 21:13 mod/
-rwxr-xr-x 1 root root 29896 Dec  4 21:13 recordmcount*
drwxr-xr-x 4 root root  4096 Dec  4 21:13 selinux/
-rwxr-xr-x 1 root root 18792 Dec  4 21:13 sorttable*
-rwxr-xr-x 1 root root 43096 Dec  4 21:13 unifdef*
2.5.3 dpkg-deb

使用dpkg-deb工具将指定的目录打包成一个debian软件包;

dpkg-deb -Zgzip -b ${KERNEL_SRC}/debian/linux-headers ${KERNEL_HEADERS_DEB}

dpkg-deb命令的含义:

  • dpkg-deb: 这是一个debian软件包管理工具,用于创建、操作和管理debian软件包;
  • -Zgzip: 这是一个选项,表示使用 gzip 压缩格式来压缩数据;
  • -b ${KERNEL_SRC}/debian/linux-headers ${KERNEL_HEADERS_DEB}: 这部分指定了要打包的目录以及输出的软件包路径;
    • ${KERNEL_SRC}/debian/linux-headers 是要打包的目录,即./kernel-rk3588/debian/linux-headers目录;
    • ${KERNEL_HEADERS_DEB} 是输出的debian软件包路径,即./out/linux-headers-6.1.25.deb目录;

这里将./kernel-rk3588/debian/linux-headers打包成debian软件包,软件包名称为./out/linux-headers-6.1.25.deb

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll out/
drwxr-xr-x  7 root root     4096 Dec  4 22:54 cryptodev-linux/
-rw-r--r--  1 root root 11283434 Dec  4 22:57 linux-headers-6.1.25.deb # 生成的dep软件包 
drwxr-xr-x  4 root root     4096 Dec  4 22:43 nft-fullcone/
drwxr-xr-x  3 root root     4096 Dec  4 22:54 output_rk3588_kmodules/
drwxr-xr-x  3 root root     4096 Dec  4 22:54 r8125/
drwxr-xr-x 22 root root     4096 Dec  4 22:58 rootfs_new/
drwxr-xr-x  8 root root     4096 Dec  4 22:46 rtl8812au/
drwxr-xr-x  9 root root     4096 Dec  4 22:44 rtl8821CU/
drwxr-xr-x  8 root root     4096 Dec  4 22:45 rtl8822bu/
drwxr-xr-x  8 root root     4096 Dec  4 22:45 rtl8822cs/
drwxr-xr-x  4 root root    16384 Dec  4 22:54 rtw88/

三、编译uboot

3.1 下载uboot

下载uboot源代码并编译,编译完成后会自动更新debian-bullseye-desktop-arm64目录下的相关镜像文件:

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# git clone https://github.com/friendlyarm/uboot-rockchip --depth 1 -b nanopi6-v2017.09
3.2 修改脚本
3.2.1 修改build-uboot.sh脚本

在编译内核之前我们需要修改build-uboot.sh脚本;将如下代码移除:

export PATH=/opt/FriendlyARM/toolchain/11.3-aarch64/bin/:$PATH 

if [ ! -d /opt/FriendlyARM/toolchain/11.3-aarch64 ]; then
        echo "please install aarch64-gcc-11.3 first, using these commands: "
        echo "    git clone https://github.com/friendlyarm/prebuilts.git -b master --depth 1"
        echo "    cd prebuilts/gcc-x64"
        echo "    sudo tar xvf toolchain-11.3-aarch64.tar.xz -C /"
        exit 1
fi
3.2.2 修改./uboot-rockchip/make.sh脚本

根据自己安装的交叉编译环境,修改make.sh设置交叉编译工具路径::

PREBUILTS_GCC_ARM32=/usr/local/arm/12.2.1/bin
PREBUILTS_GCC_ARM64=/usr/local/arm/12.2.1/bin

同时将select_toolchain函数以下代码:

CROSS_COMPILE_ARM32=arm-linux-gnueabihf-
CROSS_COMPILE_ARM64=aarch64-linux-gnu-

修改为:

CROSS_COMPILE_ARM32=arm-none-linux-gnueabihf-
CROSS_COMPILE_ARM64=aarch64-none-linux-gnu-

我安装的交叉编译环境位于/usr/local/arm/12.2.1,并且我已经将其配置为全局环境变量了。

3.3 编译uboot
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# rm -rf rkbin  # 删除的目的,是为了重新下载rkbin
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# UBOOT_SRC=$PWD/uboot-rockchip ./build-uboot.sh debian-bullseye-desktop-arm64

编译完成后debian-bullseye-desktop-arm64目录下的uboot.img被更新了;

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll out/ll debian-bullseye-desktop-arm64
-rw-r--r--  1 root root    8072140 May 28  2023 boot.img
-rw-r--r--  1 root root       1424 May 28  2023 dtbo.img
-rw-r--r--  1 root root     307200 Sep  8 23:33 idbloader.img
-rw-r--r--  1 root root         64 Nov 17 10:03 info.conf
-rw-r--r--  1 root root   37910548 Dec  4 22:57 kernel.img
-rw-r--r--  1 root root     471488 Dec  4 23:26 MiniLoaderAll.bin  # 更新了
-rw-r--r--  1 root root      49152 May 28  2023 misc.img
-rw-r--r--  1 root root        470 Dec  4 22:59 parameter.txt
-rw-r--r--  1 root root    5785600 Dec  4 22:57 resource.img
-rw-r--r--  1 root root 3986211708 Dec  4 22:59 rootfs.img
-rw-r--r--  1 root root    4194304 Dec  4 23:26 uboot.img  # 更新了
-rw-r--r--  1 root root     159868 Nov 17 10:03 userdata.img
3.4 build-uboot.sh分析

如果感兴趣可以分析一下./build-uboot.sh的主要工作流程。

3.4.1 make.sh nanopi6

进入uboot-rockchip目录下执行如下命令 :

cd ${UBOOT_SRC}
make distclean
./make.sh nanopi6

其中:UBOOT_SRC./uboot-rockchip,即uboot源码目录。

有关make.sh文件我们在博客Rockchip RK3399 - TPL/SPL方式加载uboot中有提及到,这是官方提供的一个自动构建的脚本。

我们在命令行输入:

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/uboot-rockchip# ./make.sh help

查看具体编译指令,如下图:

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/uboot-rockchip# ./make.sh help

Usage:
        ./make.sh [board|sub-command]

         - board:        board name of defconfig
         - sub-command:  elf*|loader|trust|uboot|--spl|--tpl|itb|map|sym|<addr>
         - ini:          ini file to pack trust/loader

Output:
         When board built okay, there are uboot/trust/loader images in current directory

Example:

1. Build:
        ./make.sh evb-rk3588               --- build for evb-rk3588_defconfig
        ./make.sh firefly-rk3288           --- build for firefly-rk3288_defconfig
        ./make.sh EXT_DTB=rk-kernel.dtb    --- build with exist .config and external dtb
        ./make.sh                          --- build with exist .config
        ./make.sh env                      --- build envtools

2. Pack:
        ./make.sh uboot                    --- pack uboot.img
        ./make.sh trust                    --- pack trust.img
        ./make.sh trust <ini>              --- pack trust img with assigned ini file
        ./make.sh loader                   --- pack loader bin
        ./make.sh loader <ini>             --- pack loader img with assigned ini file
        ./make.sh --spl                    --- pack loader with u-boot-spl.bin
        ./make.sh --tpl                    --- pack loader with u-boot-tpl.bin
        ./make.sh --tpl --spl              --- pack loader with u-boot-tpl.bin and u-boot-spl.bin

3. Debug:
        ./make.sh elf                      --- dump elf file with -D(default)
        ./make.sh elf-S                    --- dump elf file with -S
        ./make.sh elf-d                    --- dump elf file with -d
        ./make.sh elf-*                    --- dump elf file with -*
        ./make.sh <no reloc_addr>          --- unwind address(no relocated)
        ./make.sh <reloc_addr-reloc_off>   --- unwind address(relocated)
        ./make.sh map                      --- cat u-boot.map
        ./make.sh sym                      --- cat u-boot.sym

因此当执行./make.sh nanopi6时,实际上编译使用的defonfig文件为configs/nanopi6_defconfig。由于该脚本内容较多,这里就不去分析其编译流程了。

编译完成后会在./uboot-rockchip目录下生成uboot.imgrk3588_spl_loader_v1.08.111.bin文件;

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll uboot-rockchip/uboot.img
-rw-r--r-- 1 root root 4194304 Dec  4 23:26 uboot-rockchip/uboot.img
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ll uboot-rockchip/rk3588_spl_loader_v1.12.112.bin
-rw-r--r-- 1 root root 471488 Dec  4 23:26 uboot-rockchip/rk3588_spl_loader_v1.12.112.bin
3.4.2 update_uboot_bin.sh

update_uboot_bin.sh脚本用于更新./debian-bullseye-desktop-arm64目录下的MiniLoaderAll.binuboot.img

./tools/update_uboot_bin.sh ${UBOOT_SRC} ${TOPPATH}/${TARGET_OS}

其中:

  • UBOOT_SRC./uboot-rockchip,即uboot源码目录;
  • ${TOPPATH}/${TARGET_OS}./debian-bullseye-desktop-arm64

update_uboot_bin.sh 源码如下:

#!/bin/bash
set -eu

[ -f ${PWD}/mk-emmc-image.sh ] || {
        echo "Error: please run at the script's home dir"
        exit 1
}

if [ $# -ne 2 ]; then
        echo "number of args must be 2"
        exit 1
fi

# LOADER_DOT_BIN=./uboot-rockchip/rk3588_spl_loader_v1.12.112.bin
LOADER_DOT_BIN==`ls $1/rk3588_spl_loader_*.bin 2>/dev/null | sort -n | tail -1`
if [ -f ${LOADER_DOT_BIN} ]; then
    cp -f ${LOADER_DOT_BIN} $2/MiniLoaderAll.bin   # 拷贝 1
else
    echo "not found $1/rk3588_spl_loader_*.bin, pls build u-boot first."
    exit 1
fi
cp -f $1/uboot.img $2/  # 拷贝 2

exit $?

四、制作SD卡固件

固件文件一般有两种:

  • 单个统一固件:统一固件是由分区表、bootloaderubootkernelsystem等所有文件打包合并成的单个文件。一般官方正式发布的固件都是采用统一固件格式,升级统一固件将会更新主板上所有分区的数据和分区表,并且擦除主板上所有数据;
  • 多个分区镜像:即各个功能独立的文件,如分区表、bootloaderkernel等,在开发阶段生成。独立分区镜像可以只更新指定的分区,而保持其它分区数据不被破坏,在开发过程中会很方便调试;

通过统一固件解包/打包工具,可以把统一固件解包为多个分区镜像,也可以将多个分区镜像合并为一个统一固件。

4.1 生成统一固件

debian-bullseye-desktop-arm64目录下的镜像文件重新打包成SD卡固件:

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ./mk-sd-image.sh debian-bullseye-desktop-arm64
Creating RAW image: out/rk3588-sd-debian-bullseye-desktop-6.1-arm64-20231205.img (7800 MB)
---------------------------------
记录了0+0 的读入
记录了0+0 的写出
0字节已复制,0.000145548 s,0.0 kB/s
----------------------------------------------------------------
[out/rk3588-sd-debian-bullseye-desktop-6.1-arm64-20231205.img] capacity = 7438MB, 7799999488 bytes
current out/rk3588-sd-debian-bullseye-desktop-6.1-arm64-20231205.img partition:
----------------------------------------------------------------
parsing ./debian-bullseye-desktop-arm64/parameter.txt:
create new GPT 9:
----------------------------------------------------------------
copy from: ./debian-bullseye-desktop-arm64 to out/rk3588-sd-debian-bullseye-desktop-6.1-arm64-20231205.img
 [RAW. 0]:      300 KB | ./debian-bullseye-desktop-arm64/idbloader.img  > 100% : done.
 [RAW. 1]:     4096 KB | ./debian-bullseye-desktop-arm64/uboot.img      > 100% : done.
 [RAW. 2]:       48 KB | ./debian-bullseye-desktop-arm64/misc.img       > 100% : done.
 [RAW. 3]:        1 KB | ./debian-bullseye-desktop-arm64/dtbo.img       > 100% : done.
 [RAW. 4]:     5650 KB | ./debian-bullseye-desktop-arm64/resource.img   > 100% : done.
 [RAW. 5]:    37022 KB | ./debian-bullseye-desktop-arm64/kernel.img     > 100% : done.
 [RAW. 6]:     7882 KB | ./debian-bullseye-desktop-arm64/boot.img       > 100% : done.
 [RAW. 8]:  3892784 KB | ./debian-bullseye-desktop-arm64/rootfs.img     > 100% : done.
 [RAW. 9]:      156 KB | ./debian-bullseye-desktop-arm64/userdata.img   > 100% : done.
----------------------------------------------------------------
---------------------------------
RAW image successfully created (00:04:45).
-rw-r--r-- 1 root root 7799999488 Dec  5 00:04 out/rk3588-sd-debian-bullseye-desktop-6.1-arm64-20231205.img
Tip: You can compress it to save disk space.

sh脚本内部调用了Rochchip官方提供的打包工具生成的统一固件,由于打包工具并不开源,所以无法研究源码。

命令完成后,生成的统一固件位于out目录,可以用dd命令制作SD启动卡。

4.2 制作SD启动卡

我们将SD卡插入PC上,在虚拟机ubuntu中运行demsg查看新接入的设备;

[32908.310364] loop7: detected capacity change from 0 to 8257536
[32909.079216] EXT4-fs (loop7): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[33991.894980] loop7: detected capacity change from 0 to 8126464
[33991.948702] EXT4-fs (loop7): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[35745.808031] usb 1-1: new high-speed USB device number 2 using ehci-pci
[35746.078673] usb 1-1: New USB device found, idVendor=14cd, idProduct=1212, bcdDevice= 1.00
[35746.078714] usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[35746.078716] usb 1-1: Product: Mass Storage Device
[35746.078717] usb 1-1: Manufacturer: Generic
[35746.078718] usb 1-1: SerialNumber: 121220160204
[35747.340887] usb-storage 1-1:1.0: USB Mass Storage device detected
[35747.341582] scsi host33: usb-storage 1-1:1.0
[35747.342608] usbcore: registered new interface driver usb-storage
[35747.403944] usbcore: registered new interface driver uas
[35748.377640] scsi 33:0:0:0: Direct-Access     Mass     Storage Device   1.00 PQ: 0 ANSI: 0 CCS
[35748.378504] sd 33:0:0:0: Attached scsi generic sg3 type 0
[35748.522897] sd 33:0:0:0: [sdc] 31211520 512-byte logical blocks: (16.0 GB/14.9 GiB)
[35748.526150] sd 33:0:0:0: [sdc] Write Protect is off
[35748.526152] sd 33:0:0:0: [sdc] Mode Sense: 03 00 00 00
[35748.528185] sd 33:0:0:0: [sdc] No Caching mode page found
[35748.528254] sd 33:0:0:0: [sdc] Assuming drive cache: write through
[35748.551595]  sdc: sdc1 sdc2
[35748.571109] sd 33:0:0:0: [sdc] Attached SCSI removable disk
[35802.517787] rfkill: input handler enabled

可以看到SD卡对应的设备节点为/dev/sdc,对应两个分区sdc1sdc2

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# ls /dev/sdc*
/dev/sdc  /dev/sdc1  /dev/sdc2
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# df -hT
文件系统       类型      容量  已用  可用 已用% 挂载点
udev           devtmpfs  3.9G     0  3.9G    0% /dev
tmpfs          tmpfs     791M  3.6M  787M    1% /run
/dev/sda5      ext4       98G   69G   24G   75% /
tmpfs          tmpfs     3.9G     0  3.9G    0% /dev/shm
tmpfs          tmpfs     5.0M  4.0K  5.0M    1% /run/lock
tmpfs          tmpfs     3.9G     0  3.9G    0% /sys/fs/cgroup
/dev/sda1      vfat      511M  4.0K  511M    1% /boot/efi
/dev/loop15    squashfs  497M  497M     0  100% /snap/gnome-42-2204/132
tmpfs          tmpfs     791M     0  791M    0% /run/user/0
tmpfs          tmpfs     791M   36K  791M    1% /run/user/1000
/dev/sdc2      ext4       11G  311M  9.8G    4% /media/zhengyang/userdata
/dev/sdc1      ext4      4.5G  4.4G   35M  100% /media/zhengyang/rootfs

开始制作SD启动卡:

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# dd if=out/rk3588-sd-debian-bullseye-desktop-6.1-arm64-20231205.img of=/dev/sdc bs=1M

五、Linux下烧录固件

Linux下烧录固件到eMMC有多种方法:

  • 其一是将RK3588进入到MASKROM升级模式或者LOADER升级模式,然后通过upgrade_tool工具进行烧录,这个是Rockchip官方提供的linux环境下的烧录工具;
  • 通过dd命令将image文件烧写至image对应的分区;
  • 通过搭建TFTP服务器,通过tftp命令进行下载,这个我们后面的文章会涉及;

注:upgrade_toolRockchip提供的Linux下的命令行工具(Linux_Upgrade_Tool),需要使用v2以上版本。

5.1 upgrade_tool工具烧录
5.1.1 安装upgrade_tool_v2.17_for_linux

下载 upgrade_tool_v2.17_for_linux.zip(位于"05_工具软件"目录下), 并按以下方法安装到系统中,方便调用:

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# unzip upgrade_tool_v2.17_for_linux.zip
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# cd upgrade_tool_v2.17_for_linux
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo cp upgrade_tool /usr/local/bin
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo chown root:root /usr/local/bin/upgrade_tool
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo chmod a+x /usr/local/bin/upgrade_tool
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo apt-get install lib32stdc++6
5.1.2 进入升级模式

将开发板连接上电源,并且通过HDMI接口连接到显示设备,连接Type-C数据线到PC

(1) 进入MASKROM模式

硬件方式:按住Mask键再长按Power键开机(保持按下Mask键5秒以上),将强制进入MASKROM模式;

软件方式:这一步的前提是eMMC已经烧录过固件,比如debian-bullseye-desktop,具体参考上一篇文章:Rockchip RK3588 - NanoPC-T6开发板介绍有关Windows下通过RKDevTool.exe工具烧录的内容。按下Power键开发板启动,串口终端按下CRTL+C进入uboot命令行,通过在串口调试终端输入reboot loader进入MASKROM模式;

=> reboot loader                     #  进入uboot,输入该命令
## Reboot mode: loader(5242c301)

(2) 进入LOADER模式

由于我使用的开发板不支持硬件进入LOADER模式,因此只能通过软件方式进入LOADER模式;

这一步的前提是eMMC已经烧录过固件,比如debian-bullseye-desktop,具体参考上一篇文章:Windows下通过RKDevTool.exe工具烧录。

按下Power键开发板启动,根文件系统加载完成后,通过在桌面终端输入reboot loader进入LOADER模式;

pi@NanoPC-T6:~$ sudo reboot loader
         Stopping Session 1 of user pi.
         Stopping Session 3 of user pi.
         .....

注意:必须从桌面终端输入reboot loader才会进入LOADER模式,如果是在串口调试终端输入reboot loader那么将进入MASKROM模式。

5.1.3 烧写统一固件

按住Mask键再长按Power键开机(保持按下Mask键5秒以上),将强制进入MASKROM模式;

进入MASKROM模式后,运行upgrade_tool后可以看到连接设备中有个Maskrom的提示:

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588# sudo upgrade_tool LD
List of rockusb connected(1)
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=11     Mode=Maskrom    SerialNo=

烧写统一固件update.img

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool uf update.img

由于我没有统一固件,这里就不演示了。

5.1.4 烧写分区镜像

我们在开发过程中,经常会对内核、根文件系统、uboot进行修改,在这种情况下我们只需要替换我们修改的镜像文件即可。

这里我们可以尝试在MASKROM模式以及LOADER模式下烧录分区镜像。

(1) 按住Mask键再长按Power键开机(保持按下Mask键5秒以上),将强制进入MASKROM模式,在ubuntu宿主机烧写分区镜像;

root@zhengyang:/work/sambashare/rk3399/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool ul MiniLoaderAll.bin
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -p parameter.txt
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -uboot uboot.img
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -misc misc.img 
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -dtbo dtbo.img 
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -resource resource.img
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -k kernel.img      
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -boot boot.img        
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -rootfs rootfs.img    
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -userdata userdata.img 
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool RD

对于MASKROM模式,其中前两步和最后一步是必须的,中间的步骤根据实际情况进行调整。

由于SoC进入到MASKROM模式后,目标板子会运行Rockusb驱动程序。在MASKROM模式下,烧写镜像需要使用到DDR,因此需要下载固件进行DDR的初始化,所以升级之前第一步要做的就是执行sudo upgrade_tool ul MiniLoaderAll.bin

在测试的时候发现了一个问题,烧录完MiniLoaderAll.bin之后,系统自动重启了,因此通过这种方法没法继续烧录其它的镜像文件了。

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool ul MiniLoaderAll.bin
Loading loader...
Support Type:RK3588     Loader ver:1.0b Loader Time:2023-12-04 23:26:21
Start to upgrade loader...
Download Boot Start
Download Boot Success
Wait For Maskrom Start
Wait For Maskrom Success
Test Device Start
Test Device Success
Check Chip Start
Check Chip Success
Get FlashInfo Start
Get FlashInfo Success
Prepare IDB Start
Prepare IDB Success
Download IDB Start
Download IDB Success
Upgrade loader ok.

(2) 按照前面介绍的方法尝试软件方式进入LOADER模式,然后烧录除了MiniLoaderAll.bin之后的所有镜像文件;

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool LD
List of rockusb connected(1)
DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=11     Mode=Loader     SerialNo=1f0bee682f135e89
root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool di -p parameter.txt
......

注意:采用这种方式烧录各个分区,在完成烧录之后,测试发现ubootlinux内核均能正常加载,但是挂载根文件系统的时候却失败了,相关错误详情如下,具体原因尚不可知;

Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
[    6.219797] EXT4-fs error (device mmcblk2p8): ext4_get_journal_inode:5728: inode #8: comm mount: iget: bad extra_isize 1487 (inode size 256)
[    6.219971] EXT4-fs (mmcblk2p8): no journal found
mount: mounting /dev/mmcblk2p8 on /root failed: Invalid argument
Begin: Will now check userdata file system ... fsck from util-linux 2.37.2
[/usr/sbin/fsck.ext4 (1) -- /dev/mmcblk2p9] fsck.ext4 -a -C0 /dev/mmcblk2p9
userdata: clean, 11/12800 files, 4958/51200 blocks
done.
[    6.305282] EXT4-fs (mmcblk2p9): mounted filesystem with ordered data mode. Quota mode: none.
[    6.308585] EXT4-fs (mmcblk2p9): unmounting filesystem.
Begin: Resizing ext4 file system on /dev/mmcblk2p9 ... Model: MMC A3A444 (sd/mmc)
Disk /dev/mmcblk2: 100%
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start  End    Size   File system  Name      Flags
 1      0.00%  0.01%  0.00%               uboot
 2      0.01%  0.01%  0.00%               misc
 3      0.01%  0.01%  0.00%               dtbo
 4      0.01%  0.02%  0.01%               resource
 5      0.02%  0.03%  0.02%               kernel
 6      0.03%  0.05%  0.01%               boot
 7      0.05%  0.06%  0.01%               recovery
 8      0.06%  1.74%  1.68%  ext4         rootfs
 9      1.74%  100%   98.3%  ext4         userdata

[    6.473741]  mmcblk2: p1 p2 p3 p4 p5 p6 p7 p8 p9
[    6.477599]  mmcblk2: p1 p2 p3 p4 p5 p6 p7 p8 p9
resize2fs 1.46.5 (30-Dec-2021)
Resizing the filesystem on /dev/mmcblk2p9 to 59364347 (4k) blocks.
The filesystem on /dev/mmcblk2p9 is now 59364347 (4k) blocks long.

done.
[    6.693921] EXT4-fs (mmcblk2p9): mounted filesystem with ordered data mode. Quota mode: none.
[    6.708138] overlayfs: fs on '/root' does not support file handles, falling back to index=off,nfs_export=off.
done.
[    6.708159] overlayfs: fs on '/root' does not support file handles, falling back to xino=off.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... mount: mounting /dev on /overlay/dev failed: No such file or directory
mount: mounting /dev on /overlay/dev failed: No such file or directory
done.
mount: mounting /run on /overlay/run failed: No such file or directory
run-init: can't execute '/sbin/init': No such file or directory
Target filesystem doesn't have requested /sbin/init.
run-init: can't execute '/sbin/init': No such file or directory
run-init: can't execute '/etc/init': No such file or directory
run-init: can't execute '/bin/init': No such file or directory
run-init: can't execute '/bin/sh': No such file or directory
run-init: can't execute '': No such file or directory
No init found. Try passing init= bootarg.
[    6.845429] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_cancel_cpu_limit_freq freq qos nod add


BusyBox v1.30.1 (Ubuntu 1:1.30.1-7ubuntu3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) [    7.177250] rk-pcie fe150000.pcie: PCIe Link Fail
[    7.177285] rk-pcie fe150000.pcie: failed to initialize host
[    7.687244] rk-pcie fe180000.pcie: PCIe Link Fail
[    7.687271] rk-pcie fe180000.pcie: failed to initialize host
[   14.941768] platform mtd_vendor_storage: deferred probe pending

(initramfs)

后来我将rootfs.img单独拷贝到Windows系统后,通过RKDevTool.exe工具单独烧录根文件系统之后,系统可以正常启动起来。因此我猜测可能是upgrade_tool烧录过程中出现了什么问题。

(3) 如果想查看分区情况,执行如下命令,该命令会读取设备上的分区表信息,支持parametergpt

root@zhengyang:/work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64# sudo upgrade_tool pl
Partition Info(gpt):
NO  LBA        Size       Name
01  0x00004000 0x00002000 uboot
02  0x00006000 0x00002000 misc
03  0x00008000 0x00002000 dtbo
04  0x0000a000 0x00008000 resource
05  0x00012000 0x00014000 kernel
06  0x00026000 0x00010000 boot
07  0x00036000 0x00010000 recovery
08  0x00046000 0x007c0000 rootfs
09  0x00806000 0x1c4e9fc0 userdata

此时rootfs占用0x007c0000个扇区,每个扇区512字节,一共4,160,749,568字节,大于rootfs.img的大小。

5.2 dd命令烧录

由于RK3588OS默认均采用GPT分区, 可以用dd命令将image文件烧写至image对应的分区,SD卡与eMMC的设备节点如下:

  • SD/TF Card设备节点为/dev/mmcblk0
  • eMMC设备节点为/dev/mmcblk2

下面步骤的前提是eMMC已经烧录过固件,比如debian-bullseye-desktop,具体参考上一篇文章:Rockchip RK3588 - NanoPC-T6开发板介绍有关Windows下通过RKDevTool.exe工具烧录的内容。

下面将演示如何将内核更新到eMMC,开发板上电进入操作系统终端命令行,使用parted命令查看分区布局;

pi@NanoPC-T6:~$ sudo parted /dev/mmcblk2 print
Model: MMC A3A444 (sd/mmc)
Disk /dev/mmcblk2: 247GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name      Flags
 1      8389kB  12.6MB  4194kB               uboot
 2      12.6MB  16.8MB  4194kB               misc
 3      16.8MB  21.0MB  4194kB               dtbo
 4      21.0MB  37.7MB  16.8MB               resource
 5      37.7MB  79.7MB  41.9MB               kernel
 6      79.7MB  113MB   33.6MB               boot
 7      113MB   147MB   33.6MB               recovery
 8      147MB   4308MB  4161MB  ext4         rootfs
 9      4308MB  247GB   243GB   ext4         userdata

其中:

  • uboot分区的序号为1,对应的设备节点为/dev/mmcblk2p1
  • resource分区的序号为4,对应的设备节点为/dev/mmcblk2p4
  • kernel分区的序号为5,对应的设备节点为/dev/mmcblk2p5
  • rootfs分区的序号为8,对应的设备节点为/dev/mmcblk2p8

dd命令如下:

dd if=uboot.img of=/dev/mmcblk2p1 bs=1M
dd if=resource.img of=/dev/mmcblk2p4 bs=1M
dd if=kernel.img of=/dev/mmcblk2p5 bs=1M
dd if=rootfs.img of=/dev/mmcblk2p8 bs=1M

如果要更新kernel.img

root@NanoPC-T6:/opt# sudo scp root@192.168.0.200://work/sambashare/rk3588/friendly/sd-fuse_rk3588/debian-bullseye-desktop-arm64/kernel.img ./

root@NanoPC-T6:/opt# sudo dd if=kernel.img of=/dev/mmcblk2p5 bs=1M
36+1 records in
36+1 records out
37910548 bytes (38 MB, 36 MiB) copied, 0.296491 s, 128 MB/s

通过这种方式烧录的rootfs.img好像存在和upgrade_tool烧录一样的问题。

六、调试

6.1 串口连接

使用准备好的USB转串口适配器和连接线(需另购),连接开发板,其使用的是RK3588UART2

引脚开发板接口USB转串口
1GNDGND
2UART2_TX_M0_DEBUGRX
3UART2_RX_M0_DEBUGTX

其电路原理图如下:

6.2 MobaXterm

这里我使用的串口调试工具是MobaXterm,选择串口端口,设置波特率为1500000,8位数据位,1位停止位。

img
6.3 上电测试
点击查看代码
DDR V1.12 52218f4949 cym 23/07/06-19:46:50
LPDDR4X, 2112MHz
channel[0] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
channel[1] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
channel[2] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
channel[3] BW=16 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=8 Size=4096MB
Manufacturer ID:0x1
CH0 RX Vref:27.5%, TX Vref:21.8%,22.8%
CH1 RX Vref:25.8%, TX Vref:22.8%,22.8%
CH2 RX Vref:28.4%, TX Vref:21.8%,21.8%
CH3 RX Vref:27.9%, TX Vref:20.8%,22.8%
change to F1: 528MHz
change to F2: 1068MHz
change to F3: 1560MHz
change to F0: 2112MHz
out
U-Boot SPL board init
U-Boot SPL 2017.09-g5f53abfa1e-221223 #zzz (Dec 26 2022 - 09:10:09)
Trying to boot from MMC2
MMC: no card present
mmc_init: -123, time 0
spl: mmc init failed with error: -123
Trying to boot from MMC1
SPL: A/B-slot: _a, successful: 0, tries-remain: 7
Trying fit image at 0x4000 sector
## Verified-boot: 0
## Checking atf-1 0x00040000 ... sha256(b40ce543bb...) + OK
## Checking uboot 0x00200000 ... sha256(4e99df8c0e...) + OK
## Checking fdt 0x003326d8 ... sha256(a3ef1c0929...) + OK
## Checking atf-2 0x000f0000 ... sha256(f202de33d9...) + OK
## Checking atf-3 0xff100000 ... sha256(af08976afd...) + OK
## Checking optee 0x08400000 ... sha256(6193f4aac7...) + OK
Jumping to U-Boot(0x00200000) via ARM Trusted Firmware(0x00040000)
Total: 515.29 ms

INFO:    Preloader serial: 2
NOTICE:  BL31: v2.3():v2.3-616-gdc1125f48:finley.xiao
NOTICE:  BL31: Built : 16:41:17, Jul 13 2023
INFO:    spec: 0x1
INFO:    ext 32k is not valid
INFO:    ddr: stride-en 4CH
INFO:    GICv3 without legacy support detected.
INFO:    ARM GICv3 driver initialized in EL3
INFO:    valid_cpu_msk=0xff bcore0_rst = 0x0, bcore1_rst = 0x0
INFO:    system boots from cpu-hwid-0
INFO:    idle_st=0x21fff, pd_st=0x11fff9, repair_st=0xfff70001
INFO:    dfs DDR fsp_params[0].freq_mhz= 2112MHz
INFO:    dfs DDR fsp_params[1].freq_mhz= 528MHz
INFO:    dfs DDR fsp_params[2].freq_mhz= 1068MHz
INFO:    dfs DDR fsp_params[3].freq_mhz= 1560MHz
INFO:    BL31: Initialising Exception Handling Framework
INFO:    BL31: Initializing runtime services
INFO:    BL31: Initializing BL32
I/TC:
I/TC: OP-TEE version: 3.13.0-698-g7f1ea6d6e #hisping.lin (gcc version 10.2.1 20201103 (GNU Toolchain for the A-profile Architecture 10.2-2020.11 (arm-10.16))) #53 Wed Apr 19 14:30:22 CST 2023 aarch64
I/TC: Primary CPU initializing
I/TC: Primary CPU switching to normal world boot
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2017.09-g8241716-dirty #root (Dec 04 2023 - 23:25:57 +0800)

Board: NanoPi R6S
PreSerial: 2, raw, 0xfeb50000
DRAM:  16 GiB
Sysmem: init
Relocation Offset: eda2b000
Relocation fdt: eb9fa3a0 - eb9fecc8
CR: M/C/I
Using default environment

DM: v2
mmc@fe2c0000: 1, mmc@fe2e0000: 0
Bootdev(atags): mmc 0
MMC0: HS400 Enhanced Strobe, 200Mhz
PartType: EFI
boot mode: normal
RESC: 'resource', blk@0x0000a000
optee api revision: 2.0
TEEC: Waring: Could not find security partition
lib/avb/libavb_user/avb_ops_user.c: trusty_read_lock_state failed
Error determining whether device is unlocked.
Device is: UNLOCKED
DTB: rk3588-nanopi6-rev01.dtb (270114)
HASH(c): OK
ANDROID: fdt overlay OK
I2c0 speed: 100000Hz
vsel-gpios- not found!
en-gpios- not found!
vdd_cpu_big0_s0 675000 uV
vsel-gpios- not found!
en-gpios- not found!
vdd_cpu_big1_s0 675000 uV
I2c2 speed: 100000Hz
vsel-gpios- not found!
en-gpios- not found!
vdd_npu_s0 800000 uV
spi2: RK806: 2
ON=0x00, OFF=0x00
vdd_gpu_s0 750000 uV
vdd_cpu_lit_s0 750000 uV
vdd_log_s0 750000 uV
vdd_vdenc_s0 init 750000 uV
vdd_ddr_s0 850000 uV
get vp0 plane mask:0x7, primary id:0, cursor_plane:2, from dts
get vp1 plane mask:0x148, primary id:6, cursor_plane:3, from dts
get vp2 plane mask:0x280, primary id:7, cursor_plane:9, from dts
Could not find baseparameter partition
I2c6 speed: 200000Hz
Rockchip UBOOT DRM driver version: v1.0.1
vp0 have layer nr:3[0 1 2 ], primary plane: 0
vp1 have layer nr:3[3 6 8 ], primary plane: 6
vp2 have layer nr:2[7 9 ], primary plane: 7
vp3 have layer nr:0[], primary plane: 0
Could not find baseparameter partition
color_format:1
hdmi_select_link_config use tmds mode
mode:1920x1080 bus_format:0x2025
hdmi@fde80000:  detailed mode clock 148500 kHz, flags[5]
    H: 1920 2008 2052 2200
    V: 1080 1084 1089 1125
bus_format: 2025
VOP update mode to: 1920x1080p60, type: HDMI0 for VP0
dclk:148500,if_pixclk_div;2,if_dclk_div:4
VP0 set crtc_clock to 148500KHz
VOP VP0 enable Cluster0[800x480->800x480@560x300] fmt[1] addr[0xee01a000]
CEA mode used vic=16
mtmdsclock:148500000
hdptx_ropll_cmn_config bus_width:16a8c8 rate:1485000
hdptx phy pll locked!
dw_hdmi_setup HDMI mode
don't use dsc mode
dw hdmi qp use tmds mode
bus_width:0x16a8c8,bit_rate:1485000
hdptx phy lane locked!
CLK: (sync kernel. arm: enter 1008000 KHz, init 1008000 KHz, kernel 0N/A)
  b0pll 24000 KHz
  b1pll 24000 KHz
  lpll 24000 KHz
  v0pll 24000 KHz
  aupll 786431 KHz
  cpll 1500000 KHz
  gpll 1188000 KHz
  npll 850000 KHz
  ppll 1100000 KHz
  aclk_center_root 702000 KHz
  pclk_center_root 100000 KHz
  hclk_center_root 396000 KHz
  aclk_center_low_root 500000 KHz
  aclk_top_root 750000 KHz
  pclk_top_root 100000 KHz
  aclk_low_top_root 396000 KHz
vdd_usbc 12597 mV

Net:   No ethernet found.
Hit key to stop autoboot('CTRL+C'):  0
## Booting FIT Image FIT: No fit blob
FIT: No FIT image
ANDROID: reboot reason: "(none)"
Not AVB images, AVB skip
No valid android hdr
Android image load failed
Android boot failed, error -1.

## Booting Rockchip Format Image
fdt      @ 0x08300000 (0x000421c2)
kernel   @ 0x00400000 (0x02427808)
ramdisk  @ 0x0a200000 (0x007b2bc0)
Fdt Ramdisk skip relocation
## Flattened Device Tree blob at 0x08300000
   Booting using the fdt blob at 0x08300000
   Using Device Tree in place at 0000000008300000, end 00000000083451c1
## reserved-memory:
  cma: addr=10000000 size=8000000
  drm-logo@00000000: addr=edf00000 size=468000
  vendor-storage-rm@00000000: addr=ebcd4000 size=10000
  ramoops@110000: addr=110000 size=e0000
Adding bank: 0x00200000 - 0x08400000 (size: 0x08200000)
Adding bank: 0x09400000 - 0xf0000000 (size: 0xe6c00000)
Adding bank: 0x100000000 - 0x3fc000000 (size: 0x2fc000000)
Adding bank: 0x3fc500000 - 0x3fff00000 (size: 0x03a00000)
Adding bank: 0x4f0000000 - 0x500000000 (size: 0x10000000)
Total: 1900.996/2658.940 ms

Starting kernel ...

[    2.669526] Booting Linux on physical CPU 0x0000000000 [0x412fd050]
[    2.669550] Linux version 6.1.25 (root@zhengyang) (arm-linux-gcc (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205, GNU ld (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 2.39.0.20221210) #2 SMP Mon Dec  4 22:42:15 CST 2023
[    2.676552] Machine model: FriendlyElec NanoPC-T6
[    2.683905] earlycon: uart8250 at MMIO32 0x00000000feb50000 (options '')
[    2.687452] printk: bootconsole [uart8250] enabled
[    2.690226] OF: fdt: Reserved memory: failed to reserve memory for node 'drm-cubic-lut@00000000': base 0x0000000000000000, size 0 MiB
[    2.691392] Reserved memory: created CMA memory pool at 0x0000000010000000, size 128 MiB
[    2.692135] OF: reserved mem: initialized node cma, compatible id shared-dma-pool
[    2.919840] Zone ranges:
[    2.920083]   DMA      [mem 0x0000000000200000-0x00000000ffffffff]
[    2.920656]   DMA32    empty
[    2.920923]   Normal   [mem 0x0000000100000000-0x00000004ffffffff]
[    2.921493] Movable zone start for each node
[    2.921885] Early memory node ranges
[    2.922213]   node   0: [mem 0x0000000000200000-0x00000000083fffff]
[    2.922789]   node   0: [mem 0x0000000009400000-0x00000000efffffff]
[    2.923367]   node   0: [mem 0x0000000100000000-0x00000003fbffffff]
[    2.923946]   node   0: [mem 0x00000003fc500000-0x00000003ffefffff]
[    2.924522]   node   0: [mem 0x00000004f0000000-0x00000004ffffffff]
[    2.925098] Initmem setup node 0 [mem 0x0000000000200000-0x00000004ffffffff]
[    2.926614] On node 0, zone DMA: 512 pages in unavailable ranges
[    2.950600] On node 0, zone DMA: 4096 pages in unavailable ranges
[    3.030372] On node 0, zone Normal: 1280 pages in unavailable ranges
[    3.032635] On node 0, zone Normal: 256 pages in unavailable ranges
[    3.033375] psci: probing for conduit method from DT.
[    3.034420] psci: PSCIv1.1 detected in firmware.
[    3.034846] psci: Using standard PSCI v0.2 function IDs
[    3.035328] psci: Trusted OS migration not required
[    3.035812] psci: SMC Calling Convention v1.2
[    3.036562] percpu: Embedded 28 pages/cpu s75256 r8192 d31240 u114688
[    3.037343] Detected VIPT I-cache on CPU0
[    3.037751] CPU features: detected: GIC system register CPU interface
[    3.038342] CPU features: detected: Virtualization Host Extensions
[    3.038916] CPU features: detected: Qualcomm erratum 1009, or ARM erratum 1286807, 2441009
[    3.039674] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[    3.040314] alternatives: applying boot alternatives
[    3.042430] Built 1 zonelists, mobility grouping on.  Total pages: 4122720
[    3.043068] Kernel command line: storagemedia=emmc androidboot.storagemedia=emmc androidboot.mode=normal androidboot.dtbo_idx=0 androidboot.verifiedbootstate=orange earlycon=uart8250,mmio32,0xfeb50000 console=ttyFIQ0 coherent_pool=1m irqchip.gicv3_pseudo_nmi=0 rw root=/dev/mmcblk2p8 rootfstype=ext4 rootflags=discard data=/dev/mmcblk2p9 consoleblank=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1
[    3.046741] The swapaccount= commandline option is deprecated. Please report your usecase to linux-mm@kvack.org if you depend on this functionality.
[    3.047971] Unknown kernel command line parameters "storagemedia=emmc data=/dev/mmcblk2p9 cgroup_enable=memory cgroup_memory=1", will be passed to user space.
[    3.050821] Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes, linear)
[    3.052337] Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    3.053068] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[    3.053693] software IO TLB: area num 8.
[    3.066518] software IO TLB: mapped [mem 0x00000000e7cd4000-0x00000000ebcd4000] (64MB)
[    3.176264] Memory: 16182760K/16752640K available (17728K kernel code, 3486K rwdata, 6008K rodata, 9664K init, 925K bss, 438808K reserved, 131072K cma-reserved)
[    3.177706] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[    3.178337] ftrace: allocating 58377 entries in 229 pages
[    3.265209] ftrace: allocated 229 pages with 5 groups
[    3.265767] trace event string verifier disabled
[    3.266378] rcu: Hierarchical RCU implementation.
[    3.266814] rcu:     RCU event tracing is enabled.
[    3.267231]  Rude variant of Tasks RCU enabled.
[    3.267647]  Tracing variant of Tasks RCU enabled.
[    3.268087] rcu: RCU calculated value of scheduler-enlistment delay is 30 jiffies.
[    3.273592] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    3.276747] GICv3: GIC: Using split EOI/Deactivate mode
[    3.277231] GICv3: 480 SPIs implemented
[    3.277585] GICv3: 0 Extended SPIs implemented
[    3.278020] Root IRQ handler: gic_handle_irq
[    3.278425] GICv3: GICv3 features: 16 PPIs
[    3.278841] GICv3: CPU0: found redistributor 0 region 0:0x00000000fe680000
[    3.279790] ITS [mem 0xfe640000-0xfe65ffff]
[    3.280217] ITS@0x00000000fe640000: allocated 8192 Devices @1000e0000 (indirect, esz 8, psz 64K, shr 0)
[    3.281101] ITS@0x00000000fe640000: allocated 32768 Interrupt Collections @1000f0000 (flat, esz 2, psz 64K, shr 0)
[    3.282057] ITS: using cache flushing for cmd queue
[    3.282533] ITS [mem 0xfe660000-0xfe67ffff]
[    3.282953] ITS@0x00000000fe660000: allocated 8192 Devices @100110000 (indirect, esz 8, psz 64K, shr 0)
[    3.283834] ITS@0x00000000fe660000: allocated 32768 Interrupt Collections @100120000 (flat, esz 2, psz 64K, shr 0)
[    3.284790] ITS: using cache flushing for cmd queue
[    3.285429] GICv3: using LPI property table @0x0000000100130000
[    3.286085] GIC: using cache flushing for LPI property table
[    3.286608] GICv3: CPU0: using allocated LPI pending table @0x0000000100140000
[    3.287321] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    3.401093] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    3.401653] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    3.402633] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    3.404566] Console: colour dummy device 80x25
[    3.405005] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=80000)
[    3.405936] pid_max: default: 32768 minimum: 301
[    3.406408] LSM: Security Framework initializing
[    3.406921] Mount-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    3.407636] Mountpoint-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    3.409921] cblist_init_generic: Setting adjustable number of callback queues.
[    3.410582] cblist_init_generic: Setting shift to 3 and lim to 1.
[    3.411212] cblist_init_generic: Setting shift to 3 and lim to 1.
[    3.411937] rcu: Hierarchical SRCU implementation.
[    3.412374] rcu:     Max phase no-delay instances is 1000.
[    3.413575] Platform MSI: msi-controller@fe640000 domain created
[    3.414131] Platform MSI: msi-controller@fe660000 domain created
[    3.415024] PCI/MSI: /interrupt-controller@fe600000/msi-controller@fe640000 domain created
[    3.415823] PCI/MSI: /interrupt-controller@fe600000/msi-controller@fe660000 domain created
[    3.417191] smp: Bringing up secondary CPUs ...
I/TC: Secondary CPU 1 initializing
I/TC: Secondary CPU 1 switching to normal world boot
I/TC: Secondary CPU 2 initializing
I/TC: Secondary CPU 2 switching to normal world boot
I/TC: Secondary CPU 3 initializing
I/TC: Secondary CPU 3 switching to normal world boot
I/TC: Secondary CPU 4 initializing
I/TC: Secondary CPU 4 switching to normal world boot
I/TC: Secondary CPU 5 initializing
I/TC: Secondary CPU 5 switching to normal world boot
I/TC: Secondary CPU 6 initializing
I/TC: Secondary CPU 6 switching to normal world boot
I/TC: Secondary CPU 7 initializing
I/TC: Secondary CPU 7 switching to normal world boot
[    3.418768] Detected VIPT I-cache on CPU1
[    3.418844] GICv3: CPU1: found redistributor 100 region 0:0x00000000fe6a0000
[    3.418861] GICv3: CPU1: using allocated LPI pending table @0x0000000100150000
[    3.418898] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
[    3.420116] Detected VIPT I-cache on CPU2
[    3.420188] GICv3: CPU2: found redistributor 200 region 0:0x00000000fe6c0000
[    3.420204] GICv3: CPU2: using allocated LPI pending table @0x0000000100160000
[    3.420238] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
[    3.421428] Detected VIPT I-cache on CPU3
[    3.421498] GICv3: CPU3: found redistributor 300 region 0:0x00000000fe6e0000
[    3.421514] GICv3: CPU3: using allocated LPI pending table @0x0000000100170000
[    3.421546] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
[    3.422704] CPU features: detected: Spectre-v4
[    3.422708] CPU features: detected: Spectre-BHB
[    3.422711] Detected PIPT I-cache on CPU4
[    3.422758] GICv3: CPU4: found redistributor 400 region 0:0x00000000fe700000
[    3.422769] GICv3: CPU4: using allocated LPI pending table @0x0000000100180000
[    3.422791] CPU4: Booted secondary processor 0x0000000400 [0x414fd0b0]
[    3.423969] Detected PIPT I-cache on CPU5
[    3.424024] GICv3: CPU5: found redistributor 500 region 0:0x00000000fe720000
[    3.424034] GICv3: CPU5: using allocated LPI pending table @0x0000000100190000
[    3.424058] CPU5: Booted secondary processor 0x0000000500 [0x414fd0b0]
[    3.425199] Detected PIPT I-cache on CPU6
[    3.425253] GICv3: CPU6: found redistributor 600 region 0:0x00000000fe740000
[    3.425264] GICv3: CPU6: using allocated LPI pending table @0x00000001001a0000
[    3.425287] CPU6: Booted secondary processor 0x0000000600 [0x414fd0b0]
[    3.426435] Detected PIPT I-cache on CPU7
[    3.426491] GICv3: CPU7: found redistributor 700 region 0:0x00000000fe760000
[    3.426502] GICv3: CPU7: using allocated LPI pending table @0x00000001001b0000
[    3.426525] CPU7: Booted secondary processor 0x0000000700 [0x414fd0b0]
[    3.426580] smp: Brought up 1 node, 8 CPUs
[    3.443379] SMP: Total of 8 processors activated.
[    3.443811] CPU features: detected: 32-bit EL0 Support
[    3.444275] CPU features: detected: Data cache clean to the PoU not required for I/D coherence
[    3.445052] CPU features: detected: Common not Private translations
[    3.445617] CPU features: detected: CRC32 instructions
[    3.446083] CPU features: detected: RCpc load-acquire (LDAPR)
[    3.446603] CPU features: detected: LSE atomic instructions
[    3.447106] CPU features: detected: Privileged Access Never
[    3.447614] CPU features: detected: RAS Extension Support
[    3.448104] CPU features: detected: Speculative Store Bypassing Safe (SSBS)
[    3.448799] CPU: All CPU(s) started at EL2
[    3.449171] alternatives: applying system-wide alternatives
[    3.457044] devtmpfs: initialized
[    3.470147] Registered cp15_barrier emulation handler
[    3.470606] Registered setend emulation handler
[    3.471082] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370867519511994 ns
[    3.471951] futex hash table entries: 2048 (order: 5, 131072 bytes, linear)
[    3.473543] pinctrl core: initialized pinctrl subsystem
[    3.474513] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    3.475539] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    3.476350] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    3.477211] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    3.477939] audit: initializing netlink subsys (disabled)
[    3.478494] audit: type=2000 audit(0.069:1): state=initialized audit_enabled=0 res=1
[    3.478971] Registered FIQ tty driver
[    3.479633] thermal_sys: Registered thermal governor 'fair_share'
[    3.479636] thermal_sys: Registered thermal governor 'step_wise'
[    3.480176] thermal_sys: Registered thermal governor 'user_space'
[    3.480722] cpuidle: using governor menu
[    3.481729] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    3.482423] ASID allocator initialised with 65536 entries
[    3.484764] ramoops: dmesg-0 0x18000@0x0000000000110000
[    3.485230] ramoops: dmesg-1 0x18000@0x0000000000128000
[    3.485715] ramoops: console 0x80000@0x0000000000140000
[    3.486185] ramoops: pmsg    0x30000@0x00000000001c0000
[    3.486888] printk: console [ramoops-1] enabled
[    3.487398] pstore: Registered ramoops as persistent store backend
[    3.487947] ramoops: using 0xe0000@0x110000, ecc: 0
[    3.518876] platform fdd90000.vop: Fixed dependency cycle(s) with /dp@fde50000
[    3.519867] platform fdd90000.vop: Fixed dependency cycle(s) with /hdmi@fde80000
[    3.526647] platform fed80000.phy: Fixed dependency cycle(s) with /i2c@fec80000/fusb302@22/connector
[    3.534739] rockchip-gpio fd8a0000.gpio: probed /pinctrl/gpio@fd8a0000
[    3.535522] rockchip-gpio fec20000.gpio: probed /pinctrl/gpio@fec20000
[    3.536279] rockchip-gpio fec30000.gpio: probed /pinctrl/gpio@fec30000
[    3.537035] rockchip-gpio fec40000.gpio: probed /pinctrl/gpio@fec40000
[    3.537853] rockchip-gpio fec50000.gpio: probed /pinctrl/gpio@fec50000
[    3.538488] rockchip-pinctrl pinctrl: probed pinctrl
[    3.540276] platform fdd90000.vop: Fixed dependency cycle(s) with /hdmi@fdea0000
[    3.544611] KASLR disabled due to lack of seed
[    3.549059] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
[    3.549666] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
[    3.550229] HugeTLB: registered 32.0 MiB page size, pre-allocated 0 pages
[    3.550832] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
[    3.551385] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
[    3.551988] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
[    3.552552] HugeTLB: registered 64.0 KiB page size, pre-allocated 0 pages
[    3.553161] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
[    3.554019] cryptd: max_cpu_qlen set to 1000
[    3.555307] fiq_debugger fiq_debugger.0: error -ENXIO: IRQ fiq not found
[    3.555921] fiq_debugger fiq_debugger.0: error -ENXIO: IRQ wakeup not found
[    3.556546] fiq_debugger_probe: could not install nmi irq handler
[[    3.557129] printk: console [ttyFIQ0] enabled
    3.557129] printk: console [ttyFIQ0] enabled
[    3.557899] printk: bootconsole [uart8250] disabled
[    3.557899] printk: bootconsole [uart8250] disabled
[    3.558410] Registered fiq debugger ttyFIQ0
[    3.569482] iommu: Default domain type: Translated
[    3.569488] iommu: DMA domain TLB invalidation policy: strict mode
[    3.569624] SCSI subsystem initialized
[    3.569694] usbcore: registered new interface driver usbfs
[    3.569709] usbcore: registered new interface driver hub
[    3.569724] usbcore: registered new device driver usb
[    3.569866] mc: Linux media interface: v0.10
[    3.569882] videodev: Linux video capture interface: v2.00
[    3.569911] pps_core: LinuxPPS API ver. 1 registered
[    3.569915] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    3.569923] PTP clock support registered
[    3.570122] arm-scmi firmware:scmi: Enabled polling mode TX channel - prot_id:16
[    3.570170] arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
[    3.570199] arm-scmi firmware:scmi: SCMI Protocol v2.0 'rockchip:' Firmware version 0x0
[    3.571240] Advanced Linux Sound Architecture Driver Initialized.
[    3.571492] Bluetooth: Core ver 2.22
[    3.571506] NET: Registered PF_BLUETOOTH protocol family
[    3.571510] Bluetooth: HCI device and connection manager initialized
[    3.571518] Bluetooth: HCI socket layer initialized
[    3.571523] Bluetooth: L2CAP socket layer initialized
[    3.571530] Bluetooth: SCO socket layer initialized
[    3.571540] NetLabel: Initializing
[    3.571543] NetLabel:  domain hash size = 128
[    3.571547] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    3.571573] NetLabel:  unlabeled traffic allowed by default
[    3.572806] rockchip-cpuinfo cpuinfo: SoC            : 35880000
[    3.572813] rockchip-cpuinfo cpuinfo: Serial         : 1f0bee682f135e89
[    4.267285] clocksource: Switched to clocksource arch_sys_counter
[    4.267417] VFS: Disk quotas dquot_6.6.0
[    4.267439] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    4.267486] FS-Cache: Loaded
[    4.271922] NET: Registered PF_INET protocol family
[    4.272131] IP idents hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    4.279208] tcp_listen_portaddr_hash hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    4.279332] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    4.279363] TCP established hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    4.280205] TCP bind hash table entries: 65536 (order: 10, 4194304 bytes, linear)
[    4.283813] TCP: Hash tables configured (established 131072 bind 65536)
[    4.283878] UDP hash table entries: 8192 (order: 7, 786432 bytes, linear)
[    4.284245] UDP-Lite hash table entries: 8192 (order: 7, 786432 bytes, linear)
[    4.284662] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    4.284881] RPC: Registered named UNIX socket transport module.
[    4.284887] RPC: Registered udp transport module.
[    4.284891] RPC: Registered tcp transport module.
[    4.284895] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    4.284987] PCI: CLS 0 bytes, default 64
[    4.285079] Trying to unpack rootfs image as initramfs...
[    4.285517] rockchip-thermal fec00000.tsadc: Missing rockchip,grf property
[    4.286214] rockchip-thermal fec00000.tsadc: tsadc is probed successfully!
[    4.289539] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[    4.290631] Initialise system trusted keyrings
[    4.290735] workingset: timestamp_bits=46 max_order=22 bucket_order=0
[    4.292670] zbud: loaded
[    4.293173] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    4.293504] NFS: Registering the id_resolver key type
[    4.293519] Key type id_resolver registered
[    4.293524] Key type id_legacy registered
[    4.293554] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    4.293562] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    4.293637] fuse: init (API version 7.37)
[    4.318986] Key type asymmetric registered
[    4.318994] Asymmetric key parser 'x509' registered
[    4.319018] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 242)
[    4.319098] io scheduler mq-deadline registered
[    4.319103] io scheduler kyber registered
[    4.319141] io scheduler bfq registered
[    4.327736] rockchip-hdptx-phy-hdmi fed60000.hdmiphy: hdptx phy init success
[    4.328470] rockchip-hdptx-phy-hdmi fed70000.hdmiphy: hdptx phy init success
[    4.330981] rk-pcie fe180000.pcie: invalid prsnt-gpios property in node
[    4.331208] rk-pcie fe150000.pcie: invalid prsnt-gpios property in node
[    4.331477] iep: Module initialized.
[    4.331516] mpp_service mpp-srv: 889af935b author: jensen 2023-11-16 ARM64: dts: rockchip: Fix PCI bus dtc warnings for nanopi5/6
[    4.331523] mpp_service mpp-srv: probe start
[    4.333007] mpp_vepu2 jpege-ccu: probing start
[    4.333014] mpp_vepu2 jpege-ccu: probing finish
[    4.333793] mpp_rkvdec2 fdc30000.rkvdec-ccu: rkvdec-ccu, probing start
[    4.333854] mpp_rkvdec2 fdc30000.rkvdec-ccu: ccu-mode: 1
[    4.333859] mpp_rkvdec2 fdc30000.rkvdec-ccu: probing finish
[    4.334151] mpp_rkvenc2 rkvenc-ccu: probing start
[    4.334158] mpp_rkvenc2 rkvenc-ccu: probing finish
[    4.334536] mpp_service mpp-srv: probe success
[    4.343603] dma-pl330 fea10000.dma-controller: Loaded driver for PL330 DMAC-241330
[    4.343617] dma-pl330 fea10000.dma-controller:       DBUFF-128x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
[    4.344400] dma-pl330 fea30000.dma-controller: Loaded driver for PL330 DMAC-241330
[    4.344408] dma-pl330 fea30000.dma-controller:       DBUFF-128x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
[    4.345184] dma-pl330 fed10000.dma-controller: Loaded driver for PL330 DMAC-241330
[    4.345192] dma-pl330 fed10000.dma-controller:       DBUFF-128x8bytes Num_Chans-8 Num_Peri-32 Num_Events-16
[    4.345543] rockchip-pvtm fda40000.pvtm: pvtm@0 probed
[    4.345602] rockchip-pvtm fda50000.pvtm: pvtm@1 probed
[    4.345651] rockchip-pvtm fda60000.pvtm: pvtm@2 probed
[    4.345700] rockchip-pvtm fdaf0000.pvtm: pvtm@3 probed
[    4.345746] rockchip-pvtm fdb30000.pvtm: pvtm@4 probed
[    4.346221] rockchip-system-monitor rockchip-system-monitor: system monitor probe
[    4.347022] Serial: 8250/16550 driver, 10 ports, IRQ sharing disabled
[    4.347379] rk-pcie fe150000.pcie: host bridge /pcie@fe150000 ranges:
[    4.347426] rk-pcie fe150000.pcie:       IO 0x00f0100000..0x00f01fffff -> 0x00f0100000
[    4.347456] rk-pcie fe150000.pcie:      MEM 0x00f0200000..0x00f0ffffff -> 0x00f0200000
[    4.347478] rk-pcie fe150000.pcie:      MEM 0x0900000000..0x093fffffff -> 0x0900000000
[    4.347508] feb90000.serial: ttyS6 at MMIO 0xfeb90000 (irq = 36, base_baud = 1500000) is a 16550A
[    4.347541] rk-pcie fe150000.pcie: iATU unroll: enabled
[    4.347555] rk-pcie fe150000.pcie: iATU regions: 8 ob, 8 ib, align 64K, limit 8G
[    4.348797] random: crng init done
[    4.353656] rk_iommu fdca0000.iommu: av1d iommu enabled
[    4.354818] rockchip-vop2 fdd90000.vop: Adding to iommu group 15
[    4.362089] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp0 assign plane mask: 0x7, primary plane phy id: 0
[    4.362114] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp1 assign plane mask: 0x148, primary plane phy id: 6
[    4.362125] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp2 assign plane mask: 0x280, primary plane phy id: 7
[    4.362136] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] vp3 assign plane mask: 0x0, primary plane phy id: -1
[    4.362216] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] Esmart0-win0 as cursor plane for vp0
[    4.362290] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] Esmart1-win0 as cursor plane for vp1
[    4.362359] rockchip-vop2 fdd90000.vop: [drm:vop2_bind] Esmart3-win0 as cursor plane for vp2
[    4.372025] rockchip-drm display-subsystem: bound fdd90000.vop (ops 0xffffffc009276328)
[    4.372477] dwhdmi-rockchip fde80000.hdmi: registered ddc I2C bus driver
[    4.372876] rockchip-drm display-subsystem: bound fde80000.hdmi (ops 0xffffffc009288c78)
[    4.373290] dwhdmi-rockchip fdea0000.hdmi: registered ddc I2C bus driver
[    4.373628] rockchip-drm display-subsystem: bound fdea0000.hdmi (ops 0xffffffc009288c78)
[    4.373817] rockchip-drm display-subsystem: bound fde50000.dp (ops 0xffffffc00928bc40)
[    4.479499] dwhdmi-rockchip fde80000.hdmi: i2c read err!
[    4.480253] [drm] Initialized rockchip 3.0.0 20140818 for display-subsystem on minor 0
[    4.555097] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x0
[    4.569297] Freeing initrd memory: 7880K
[    4.580647] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x0
[    4.607310] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x0
[    4.618516] Console: switching to colour frame buffer device 240x67
[    4.633974] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x0
[    4.635195] rockchip-drm display-subsystem: [drm] fb0: rockchipdrmfb frame buffer device
[    4.638637] SPI driver panel-simple-spi has no spi_device_id for simple-panel-spi
[    4.642718] brd: module loaded
[    4.645367] loop: module loaded
[    4.645494] lkdtm: No crash points registered, enable through debugfs
[    4.646370] SPI driver spidev has no spi_device_id for rockchip,spidev
[    4.647313] rockchip-spi feb20000.spi: no high_speed pinctrl state
[    4.648373] rk806 spi2.0: chip id: RK806,ver:0x2, 0x1
[    4.648511] rk806 spi2.0: ON: 0x80 OFF:0x4
[    4.660656] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x1
[    4.662120] rk806 spi2.0: no sleep-setting state
[    4.662131] rk806 spi2.0: no reset-setting pinctrl state
[    4.662137] rk806 spi2.0: no dvs-setting pinctrl state
[    4.663508] rockchip-spi feb20000.spi: probed, poll=0, rsd=0, cs-inactive=0, ready=0
[    4.665163] PPP generic driver version 2.4.2
[    4.665265] usbcore: registered new interface driver asix
[    4.665291] usbcore: registered new interface driver ax88179_178a
[    4.665306] usbcore: registered new interface driver cdc_ether
[    4.665321] usbcore: registered new interface driver rndis_host
[    4.665337] usbcore: registered new interface driver qmi_wwan
[    4.665694] platform fc000000.usb: Fixed dependency cycle(s) with /i2c@fec80000/fusb302@22
[    4.677930] phy phy-fd5d4000.syscon:usb2-phy@4000.3: illegal mode
[    4.677945] xhci-hcd xhci-hcd.9.auto: xHCI Host Controller
[    4.677958] xhci-hcd xhci-hcd.9.auto: new USB bus registered, assigned bus number 1
[    4.678047] xhci-hcd xhci-hcd.9.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x0000200002010010
[    4.678076] xhci-hcd xhci-hcd.9.auto: irq 73, io mem 0xfc400000
[    4.678156] xhci-hcd xhci-hcd.9.auto: xHCI Host Controller
[    4.678165] xhci-hcd xhci-hcd.9.auto: new USB bus registered, assigned bus number 2
[    4.678174] xhci-hcd xhci-hcd.9.auto: Host supports USB 3.0 SuperSpeed
[    4.678241] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01
[    4.678251] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.678258] usb usb1: Product: xHCI Host Controller
[    4.678264] usb usb1: Manufacturer: Linux 6.1.25 xhci-hcd
[    4.678270] usb usb1: SerialNumber: xhci-hcd.9.auto
[    4.678502] hub 1-0:1.0: USB hub found
[    4.678519] hub 1-0:1.0: 1 port detected
[    4.678666] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    4.678707] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.01
[    4.678715] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.678722] usb usb2: Product: xHCI Host Controller
[    4.678728] usb usb2: Manufacturer: Linux 6.1.25 xhci-hcd
[    4.678734] usb usb2: SerialNumber: xhci-hcd.9.auto
[    4.678923] hub 2-0:1.0: USB hub found
[    4.678937] hub 2-0:1.0: 1 port detected
[    4.679093] usbcore: registered new interface driver cdc_acm
[    4.679100] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    4.679117] usbcore: registered new interface driver cdc_wdm
[    4.679185] usbcore: registered new interface driver uas
[    4.679217] usbcore: registered new interface driver usb-storage
[    4.679251] usbcore: registered new interface driver usbserial_generic
[    4.679262] usbserial: USB Serial support registered for generic
[    4.679279] usbcore: registered new interface driver ch341
[    4.679292] usbserial: USB Serial support registered for ch341-uart
[    4.679308] usbcore: registered new interface driver cp210x
[    4.679318] usbserial: USB Serial support registered for cp210x
[    4.679339] usbcore: registered new interface driver ftdi_sio
[    4.679350] usbserial: USB Serial support registered for FTDI USB Serial Device
[    4.679384] usbcore: registered new interface driver option
[    4.679394] usbserial: USB Serial support registered for GSM modem (1-port)
[    4.679421] ehci-platform fc800000.usb: EHCI Host Controller
[    4.679429] ohci-platform fc840000.usb: Generic Platform OHCI controller
[    4.679439] ehci-platform fc800000.usb: new USB bus registered, assigned bus number 3
[    4.679440] usbcore: registered new interface driver pl2303
[    4.679446] ohci-platform fc840000.usb: new USB bus registered, assigned bus number 4
[    4.679448] usbserial: USB Serial support registered for pl2303
[    4.679462] usbcore: registered new interface driver qcserial
[    4.679474] usbserial: USB Serial support registered for Qualcomm USB modem
[    4.679476] ehci-platform fc880000.usb: EHCI Host Controller
[    4.679494] ehci-platform fc880000.usb: new USB bus registered, assigned bus number 5
[    4.679495] ohci-platform fc8c0000.usb: Generic Platform OHCI controller
[    4.679508] ohci-platform fc840000.usb: irq 76, io mem 0xfc840000
[    4.679518] ohci-platform fc8c0000.usb: new USB bus registered, assigned bus number 6
[    4.679525] ehci-platform fc800000.usb: irq 74, io mem 0xfc800000
[    4.679567] ehci-platform fc880000.usb: irq 75, io mem 0xfc880000
[    4.679648] ohci-platform fc8c0000.usb: irq 77, io mem 0xfc8c0000
[    4.679693] mousedev: PS/2 mouse device common for all mice
[    4.680068] .. rk pwm remotectl v2.0 init
[    4.680192] input: fd8b0030.pwm as /devices/platform/fd8b0030.pwm/input/input0
[    4.680382] remotectl-pwm fd8b0030.pwm: pwm version is 0x2130000
[    4.680423] remotectl-pwm fd8b0030.pwm: Controller support pwrkey capture
[    4.681393] input: rk805 pwrkey as /devices/platform/feb20000.spi/spi_master/spi2/spi2.0/rk805-pwrkey.7.auto/input/input1
[    4.681593] i2c_dev: i2c /dev entries driver
[    4.687317] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x0
[    4.690635] ehci-platform fc800000.usb: USB 2.0 started, EHCI 1.00
[    4.690785] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01
[    4.690797] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.690805] usb usb3: Product: EHCI Host Controller
[    4.690811] usb usb3: Manufacturer: Linux 6.1.25 ehci_hcd
[    4.690817] usb usb3: SerialNumber: fc800000.usb
[    4.691052] hub 3-0:1.0: USB hub found
[    4.691077] hub 3-0:1.0: 1 port detected
[    4.703975] ehci-platform fc880000.usb: USB 2.0 started, EHCI 1.00
[    4.704192] rtc-hym8563 6-0051: rtc information is valid
[    4.704214] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01
[    4.704226] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.704234] usb usb5: Product: EHCI Host Controller
[    4.704240] usb usb5: Manufacturer: Linux 6.1.25 ehci_hcd
[    4.704246] usb usb5: SerialNumber: fc880000.usb
[    4.704563] hub 5-0:1.0: USB hub found
[    4.704612] hub 5-0:1.0: 1 port detected
[    4.708095] rtc-hym8563 6-0051: registered as rtc0
[    4.708609] rtc-hym8563 6-0051: setting system clock to 2023-12-06T17:00:27 UTC (1701882027)
[    4.713977] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x0
[    4.715206] IR NEC protocol handler initialized
[    4.717331] rk_hdmirx fdee0000.hdmirx-controller: No reserved memory for HDMIRX, use default CMA
[    4.717359] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_probe: cpu_aff:0x400, Bound_cpu:4, wdt_cfg_bound_cpu:5
[    4.717855] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_audio_interrupts_setup: 0
[    4.718508] rk_hdmirx fdee0000.hdmirx-controller: rk_hdmirx_hdcp_register success
[    4.718530] rk_hdmirx fdee0000.hdmirx-controller: fdee0000.hdmirx-controller driver probe ok!
[    4.719500] __power_supply_register: Expected proper parent device for 'test_ac'
[    4.719604] __power_supply_register: Expected proper parent device for 'test_battery'
[    4.719775] __power_supply_register: Expected proper parent device for 'test_usb'
[    4.720484] device-mapper: uevent: version 1.0.3
[    4.720604] device-mapper: ioctl: 4.47.0-ioctl (2022-07-28) initialised: dm-devel@redhat.com
[    4.721345] cpu cpu0: bin=0
[    4.721524] cpu cpu0: leakage=8
[    4.722962] cpu cpu0: pvtm=1406
[    4.723100] cpu cpu0: pvtm-volt-sel=0
[    4.725089] cpu cpu4: bin=0
[    4.725264] cpu cpu4: leakage=7
[    4.731827] cpu cpu4: pvtm=1639
[    4.735886] cpu cpu4: pvtm-volt-sel=2
[    4.738041] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.01
[    4.738055] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.738063] usb usb4: Product: Generic Platform OHCI controller
[    4.738070] usb usb4: Manufacturer: Linux 6.1.25 ohci_hcd
[    4.738076] usb usb4: SerialNumber: fc840000.usb
[    4.738304] hub 4-0:1.0: USB hub found
[    4.738320] hub 4-0:1.0: 1 port detected
[    4.738598] usb usb6: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 6.01
[    4.738621] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.738633] cpu cpu6: bin=0
[    4.738636] usb usb6: Product: Generic Platform OHCI controller
[    4.738644] usb usb6: Manufacturer: Linux 6.1.25 ohci_hcd
[    4.738658] usb usb6: SerialNumber: fc8c0000.usb
[    4.738812] cpu cpu6: leakage=7
[    4.739057] hub 6-0:1.0: USB hub found
[    4.739098] hub 6-0:1.0: 1 port detected
[    4.740635] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x0
[    4.745397] cpu cpu6: pvtm=1635
[    4.749424] cpu cpu6: pvtm-volt-sel=2
[    4.751469] cpu cpu0: avs=0
[    4.752745] cpu cpu4: avs=0
[    4.753852] cpu cpu6: avs=0
[    4.753960] cpu cpu0: l=10000 h=85000 hyst=5000 l_limit=0 h_limit=1608000000 h_table=0
[    4.754317] cpu cpu0: EM: created perf domain
[    4.754721] cpu cpu4: l=10000 h=85000 hyst=5000 l_limit=0 h_limit=2208000000 h_table=0
[    4.761128] cpu cpu4: EM: created perf domain
[    4.761754] cpu cpu6: l=10000 h=85000 hyst=5000 l_limit=0 h_limit=2208000000 h_table=0
[    4.767337] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x0
[    4.768177] cpu cpu6: EM: created perf domain
[    4.769268] sdhci: Secure Digital Host Controller Interface driver
[    4.769279] sdhci: Copyright(c) Pierre Ossman
[    4.769284] Synopsys Designware Multimedia Card Interface Driver
[    4.769637] sdhci-pltfm: SDHCI platform and OF driver helper
[    4.771128] ledtrig-cpu: registered to indicate activity on CPUs
[    4.771151] arm-scmi firmware:scmi: Failed. SCMI protocol 17 not active.
[    4.771189] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
[    4.771222] hid: raw HID events driver (C) Jiri Kosina
[    4.771415] usbcore: registered new interface driver usbhid
[    4.771423] usbhid: USB HID core driver
[    4.779873] optee: probing for conduit method.
[    4.779899] optee: revision 3.13 (7f1ea6d6)
[    4.780195] optee: dynamic shared memory is enabled
[    4.780327] optee: initialized driver
[    4.794094] rk-pcie fe150000.pcie: PCIe Linking... LTSSM is 0x0
[    4.800189] rockchip-i2s-tdm fddf0000.i2s: CLK-ALWAYS-ON: mclk: 12288000, bclk: 3072000, fsync: 48000
[    4.801560] rockchip-i2s-tdm fddf4000.i2s: CLK-ALWAYS-ON: mclk: 12288000, bclk: 3072000, fsync: 48000
[    4.805172] mmc2: SDHCI controller on fe2e0000.mmc [fe2e0000.mmc] using ADMA
[    4.805581] debugfs: File 'Capture' in directory 'dapm' already present!
[    4.807920] debugfs: File 'Capture' in directory 'dapm' already present!
[    4.819778] input: rockchip,hdmiin rockchip,hdmiin as /devices/platform/hdmiin-sound/sound/card3/input2
[    4.820627] Initializing XFRM netlink socket
[    4.820645] IPsec XFRM device driver
[    4.820928] NET: Registered PF_INET6 protocol family
[    4.822053] Segment Routing with IPv6
[    4.822079] In-situ OAM (IOAM) with IPv6
[    4.825513] bpfilter: Loaded bpfilter_umh pid 149
[    4.825901] NET: Registered PF_PACKET protocol family
[    4.826075] Bluetooth: RFCOMM TTY layer initialized
[    4.826085] Bluetooth: RFCOMM socket layer initialized
[    4.826099] Bluetooth: RFCOMM ver 1.11
[    4.826109] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    4.826126] Bluetooth: HIDP socket layer initialized
[    4.826164] [BT_RFKILL]: Enter rfkill_rk_init
[    4.826170] [WLAN_RFKILL]: Enter rfkill_wlan_init
[    4.826546] Key type dns_resolver registered
[    4.827720] registered taskstats version 1
[    4.827750] Loading compiled-in X.509 certificates
[    4.828466] zswap: loaded using pool lzo/zbud
[    4.829087] pstore: Using crash dump compression: deflate
[    4.841267] rga3_core0 fdb60000.rga: Adding to iommu group 2
[    4.841546] rga: rga3_core0, irq = 41, match scheduler
[    4.841769] rga: rga3_core0 hardware loaded successfully, hw_version:3.0.76831.
[    4.841854] rga: rga3_core0 probe successfully
[    4.842246] rga3_core1 fdb70000.rga: Adding to iommu group 3
[    4.842392] rga: rga3_core1, irq = 42, match scheduler
[    4.842575] rga: rga3_core1 hardware loaded successfully, hw_version:3.0.76831.
[    4.842618] rga: rga3_core1 probe successfully
[    4.843036] rga: rga2, irq = 97, match scheduler
[    4.843330] rga: rga2 hardware loaded successfully, hw_version:3.2.63318.
[    4.843386] rga: rga2 probe successfully
[    4.843564] rga_iommu: IOMMU binding successfully, default mapping core[0x1]
[    4.843723] rga: Module initialized. v1.2.27
[    4.848433] rk-pcie fe180000.pcie: host bridge /pcie@fe180000 ranges:
[    4.848500] rk-pcie fe180000.pcie:       IO 0x00f3100000..0x00f31fffff -> 0x00f3100000
[    4.848545] rk-pcie fe180000.pcie:      MEM 0x00f3200000..0x00f3ffffff -> 0x00f3200000
[    4.848578] rk-pcie fe180000.pcie:      MEM 0x09c0000000..0x09ffffffff -> 0x09c0000000
[    4.848676] rk-pcie fe180000.pcie: iATU unroll: enabled
[    4.848697] rk-pcie fe180000.pcie: iATU regions: 8 ob, 8 ib, align 64K, limit 8G
[    4.871940] friendlyelec-board board: Serial         : 1f0bee682f135e89
[    4.874008] rk-pcie fe190000.pcie: invalid prsnt-gpios property in node
[    4.874695] rk-pcie fe170000.pcie: invalid prsnt-gpios property in node
[    4.874835] rk-pcie fe190000.pcie: host bridge /pcie@fe190000 ranges:
[    4.874860] mpp_vdpu1 fdb51000.avsd-plus: Adding to iommu group 1
[    4.874874] rk-pcie fe190000.pcie:       IO 0x00f4100000..0x00f41fffff -> 0x00f4100000
[    4.874908] rk-pcie fe190000.pcie:      MEM 0x00f4200000..0x00f4ffffff -> 0x00f4200000
[    4.874928] rk-pcie fe190000.pcie:      MEM 0x0a00000000..0x0a3fffffff -> 0x0a00000000
[    4.874988] rk-pcie fe190000.pcie: iATU unroll: enabled
[    4.875001] rk-pcie fe190000.pcie: iATU regions: 8 ob, 8 ib, align 64K, limit 8G
[    4.875249] mpp_vdpu1 fdb51000.avsd-plus: probe device
[    4.875530] mpp_vdpu1 fdb51000.avsd-plus: reset_group->rw_sem_on=0
[    4.875552] mpp_vdpu1 fdb51000.avsd-plus: reset_group->rw_sem_on=0
[    4.875923] mpp_vdpu1 fdb51000.avsd-plus: probing finish
[    4.876230] mpp_vdpu2 fdb50400.vdpu: Adding to iommu group 1
[    4.876323] mpp_vdpu2 fdb50400.vdpu: probe device
[    4.876530] mpp_vdpu2 fdb50400.vdpu: reset_group->rw_sem_on=0
[    4.876546] mpp_vdpu2 fdb50400.vdpu: reset_group->rw_sem_on=0
[    4.876866] mpp_vdpu2 fdb50400.vdpu: probing finish
[    4.877158] mpp_vepu2 fdba0000.jpege-core: Adding to iommu group 5
[    4.877325] mpp_vepu2 fdba0000.jpege-core: probing start
[    4.877619] mpp_vepu2 fdba0000.jpege-core: attach ccu success
[    4.878199] mpp_vepu2 fdba0000.jpege-core: probing finish
[    4.878545] mpp_vepu2 fdba4000.jpege-core: Adding to iommu group 6
[    4.878683] mpp_vepu2 fdba4000.jpege-core: probing start
[    4.878961] mpp_vepu2 fdba4000.jpege-core: attach ccu success
[    4.879371] mpp_vepu2 fdba4000.jpege-core: probing finish
[    4.879712] mpp_vepu2 fdba8000.jpege-core: Adding to iommu group 7
[    4.879856] mpp_vepu2 fdba8000.jpege-core: probing start
[    4.880133] mpp_vepu2 fdba8000.jpege-core: attach ccu success
[    4.880469] mpp_vepu2 fdba8000.jpege-core: probing finish
[    4.880833] mpp_vepu2 fdbac000.jpege-core: Adding to iommu group 8
[    4.880979] mpp_vepu2 fdbac000.jpege-core: probing start
[    4.881255] mpp_vepu2 fdbac000.jpege-core: attach ccu success
[    4.881830] mpp_vepu2 fdbac000.jpege-core: probing finish
[    4.882177] mpp-iep2 fdbb0000.iep: Adding to iommu group 9
[    4.882320] mpp-iep2 fdbb0000.iep: probe device
[    4.882595] mpp-iep2 fdbb0000.iep: allocate roi buffer failed
[    4.882928] mpp-iep2 fdbb0000.iep: probing finish
[    4.883276] mpp_jpgdec fdb90000.jpegd: Adding to iommu group 4
[    4.883596] mpp_jpgdec fdb90000.jpegd: probe device
[    4.884357] mpp_jpgdec fdb90000.jpegd: probing finish
[    4.884717] mpp_rkvdec2 fdc38100.rkvdec-core: Adding to iommu group 12
[    4.885239] mpp_rkvdec2 fdc38100.rkvdec-core: rkvdec-core, probing start
[    4.885547] mpp_rkvdec2 fdc38100.rkvdec-core: shared_niu_a is not found!
[    4.885561] rkvdec2_init:982: No niu aclk reset resource define
[    4.885575] mpp_rkvdec2 fdc38100.rkvdec-core: shared_niu_h is not found!
[    4.885584] rkvdec2_init:985: No niu hclk reset resource define
[    4.885667] mpp_rkvdec2 fdc38100.rkvdec-core: no regulator, devfreq is disabled
[    4.885785] mpp_rkvdec2 fdc38100.rkvdec-core: core_mask=00010001
[    4.885799] mpp_rkvdec2 fdc38100.rkvdec-core: attach ccu as core 0
[    4.886136] mpp_rkvdec2 fdc38100.rkvdec-core: sram_start 0x00000000ff001000
[    4.886149] mpp_rkvdec2 fdc38100.rkvdec-core: rcb_iova 0x00000000fff00000
[    4.886161] mpp_rkvdec2 fdc38100.rkvdec-core: sram_size 491520
[    4.886172] mpp_rkvdec2 fdc38100.rkvdec-core: rcb_size 1048576
[    4.886185] mpp_rkvdec2 fdc38100.rkvdec-core: min_width 512
[    4.886200] mpp_rkvdec2 fdc38100.rkvdec-core: rcb_info_count 20
[    4.886210] mpp_rkvdec2 fdc38100.rkvdec-core: [136, 24576]
[    4.886223] mpp_rkvdec2 fdc38100.rkvdec-core: [137, 49152]
[    4.886234] mpp_rkvdec2 fdc38100.rkvdec-core: [141, 90112]
[    4.886245] mpp_rkvdec2 fdc38100.rkvdec-core: [140, 49152]
[    4.886256] mpp_rkvdec2 fdc38100.rkvdec-core: [139, 180224]
[    4.886267] mpp_rkvdec2 fdc38100.rkvdec-core: [133, 49152]
[    4.886277] mpp_rkvdec2 fdc38100.rkvdec-core: [134, 8192]
[    4.886289] mpp_rkvdec2 fdc38100.rkvdec-core: [135, 4352]
[    4.886299] mpp_rkvdec2 fdc38100.rkvdec-core: [138, 13056]
[    4.886310] mpp_rkvdec2 fdc38100.rkvdec-core: [142, 291584]
[    4.886371] mpp_rkvdec2 fdc38100.rkvdec-core: probing finish
[    4.886682] mpp_rkvdec2 fdc48100.rkvdec-core: Adding to iommu group 13
[    4.887104] mpp_rkvdec2 fdc48100.rkvdec-core: rkvdec-core, probing start
[    4.887405] mpp_rkvdec2 fdc48100.rkvdec-core: shared_niu_a is not found!
[    4.887419] rkvdec2_init:982: No niu aclk reset resource define
[    4.887432] mpp_rkvdec2 fdc48100.rkvdec-core: shared_niu_h is not found!
[    4.887441] rkvdec2_init:985: No niu hclk reset resource define
[    4.887514] mpp_rkvdec2 fdc48100.rkvdec-core: no regulator, devfreq is disabled
[    4.887595] mpp_rkvdec2 fdc48100.rkvdec-core: core_mask=00020002
[    4.887625] mpp_rkvdec2 fdc48100.rkvdec-core: attach ccu as core 1
[    4.888020] mpp_rkvdec2 fdc48100.rkvdec-core: sram_start 0x00000000ff079000
[    4.888033] mpp_rkvdec2 fdc48100.rkvdec-core: rcb_iova 0x00000000ffe00000
[    4.888045] mpp_rkvdec2 fdc48100.rkvdec-core: sram_size 487424
[    4.888055] mpp_rkvdec2 fdc48100.rkvdec-core: rcb_size 1048576
[    4.888067] mpp_rkvdec2 fdc48100.rkvdec-core: min_width 512
[    4.888081] mpp_rkvdec2 fdc48100.rkvdec-core: rcb_info_count 20
[    4.888092] mpp_rkvdec2 fdc48100.rkvdec-core: [136, 24576]
[    4.888103] mpp_rkvdec2 fdc48100.rkvdec-core: [137, 49152]
[    4.888114] mpp_rkvdec2 fdc48100.rkvdec-core: [141, 90112]
[    4.888125] mpp_rkvdec2 fdc48100.rkvdec-core: [140, 49152]
[    4.888136] mpp_rkvdec2 fdc48100.rkvdec-core: [139, 180224]
[    4.888146] mpp_rkvdec2 fdc48100.rkvdec-core: [133, 49152]
[    4.888157] mpp_rkvdec2 fdc48100.rkvdec-core: [134, 8192]
[    4.888168] mpp_rkvdec2 fdc48100.rkvdec-core: [135, 4352]
[    4.888179] mpp_rkvdec2 fdc48100.rkvdec-core: [138, 13056]
[    4.888190] mpp_rkvdec2 fdc48100.rkvdec-core: [142, 291584]
[    4.888249] mpp_rkvdec2 fdc48100.rkvdec-core: probing finish
[    4.888554] mpp_rkvenc2 fdbd0000.rkvenc-core: Adding to iommu group 10
[    4.888835] mpp_rkvenc2 fdbd0000.rkvenc-core: probing start
[    4.890057] mpp_rkvenc2 fdbd0000.rkvenc-core: leakage=11
[    4.890086] mpp_rkvenc2 fdbd0000.rkvenc-core: leakage-volt-sel=1
[    4.891168] mpp_rkvenc2 fdbd0000.rkvenc-core: avs=0
[    4.891202] mpp_rkvenc2 fdbd0000.rkvenc-core: l=-2147483648 h=2147483647 hyst=0 l_limit=0 h_limit=0 h_table=0
[    4.892076] mpp_rkvenc2 fdbd0000.rkvenc-core: attach ccu as core 0
[    4.892373] mpp_rkvenc2 fdbd0000.rkvenc-core: probing finish
[    4.892714] mpp_rkvenc2 fdbe0000.rkvenc-core: Adding to iommu group 11
[    4.893039] mpp_rkvenc2 fdbe0000.rkvenc-core: probing start
[    4.893866] mpp_rkvenc2 fdbe0000.rkvenc-core: leakage=11
[    4.893886] mpp_rkvenc2 fdbe0000.rkvenc-core: leakage-volt-sel=1
[    4.895143] mpp_rkvenc2 fdbe0000.rkvenc-core: avs=0
[    4.895179] mpp_rkvenc2 fdbe0000.rkvenc-core: l=-2147483648 h=2147483647 hyst=0 l_limit=0 h_limit=0 h_table=0
[    4.895461] mpp_rkvenc2 fdbe0000.rkvenc-core: attach ccu as core 1
[    4.895733] mpp_rkvenc2 fdbe0000.rkvenc-core: probing finish
[    4.896058] mpp_av1dec fdc70000.av1d: Adding to iommu group 14
[    4.896481] mpp_av1dec fdc70000.av1d: probing start
[    4.897003] mpp_av1dec fdc70000.av1d: probing finish
[    4.898593] mali fb000000.gpu: Kernel DDK version g18p0-01eac0
[    4.898957] rockchip-dmc dmc: bin=0
[    4.899206] rockchip-dmc dmc: leakage=27
[    4.899225] rockchip-dmc dmc: leakage-volt-sel=0
[    4.899591] dwmmc_rockchip fe2c0000.mmc: No normal pinctrl state
[    4.899610] dwmmc_rockchip fe2c0000.mmc: No idle pinctrl state
[    4.899737] dwmmc_rockchip fe2c0000.mmc: IDMAC supports 32-bit address mode.
[    4.899783] dwmmc_rockchip fe2c0000.mmc: Using internal DMA controller.
[    4.899799] dwmmc_rockchip fe2c0000.mmc: Version ID is 270a
[    4.899838] dwmmc_rockchip fe2c0000.mmc: DW MMC controller at irq 117,32 bit host data width,256 deep fifo
[    4.899871] mali fb000000.gpu: bin=0
[    4.900067] mali fb000000.gpu: leakage=11
[    4.900137] debugfs: Directory 'fb000000.gpu-mali' with parent 'vdd_gpu_s0' already present!
[    4.900802] rockchip-dmc dmc: avs=0
[    4.900827] rockchip-dmc dmc: current ATF version 0x100
[    4.900952] rockchip-dmc dmc: normal_rate = 1560000000
[    4.900962] rockchip-dmc dmc: reboot_rate = 2112000000
[    4.900970] rockchip-dmc dmc: suspend_rate = 528000000
[    4.900978] rockchip-dmc dmc: video_4k_rate = 1560000000
[    4.900986] rockchip-dmc dmc: video_4k_10b_rate = 1560000000
[    4.900994] rockchip-dmc dmc: video_svep_rate = 1560000000
[    4.901002] rockchip-dmc dmc: boost_rate = 2112000000
[    4.901010] rockchip-dmc dmc: fixed_rate(isp|cif0|cif1|dualview) = 2112000000
[    4.901019] rockchip-dmc dmc: performance_rate = 2112000000
[    4.901027] rockchip-dmc dmc: hdmirx_rate = 2112000000
[    4.901039] rockchip-dmc dmc: failed to get vop bandwidth to dmc rate
[    4.901046] rockchip-dmc dmc: failed to get vop pn to msch rl
[    4.901498] mali fb000000.gpu: pvtm=826
[    4.901528] rockchip-dmc dmc: l=10000 h=2147483647 hyst=5000 l_limit=0 h_limit=0 h_table=0
[    4.901732] mali fb000000.gpu: pvtm-volt-sel=1
[    4.901830] debugfs: Directory 'fb000000.gpu-mali' with parent 'vdd_gpu_s0' already present!
[    4.903638] mali fb000000.gpu: avs=0
[    4.903692] W : [File] : drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c; [Line] : 144; [Func] : kbase_platform_rk_init(); power-off-delay-ms not available.
[    4.904034] mali fb000000.gpu: r0p0 status 5 not found in HW issues table;
[    4.904053] mali fb000000.gpu: falling back to closest match: r0p0 status 0
[    4.904067] mali fb000000.gpu: Execution proceeding normally with fallback match
[    4.904078] mali fb000000.gpu: GPU identified as 0x7 arch 10.8.6 r0p0 status 0
[    4.904142] mali fb000000.gpu: No priority control manager is configured
[    4.904321] mali fb000000.gpu: No memory group manager is configured
[    4.904363] mali fb000000.gpu: Protected memory allocator not available
[    4.905223] mali fb000000.gpu: Capping CSF_FIRMWARE_TIMEOUT to CSF_FIRMWARE_PING_TIMEOUT
[    4.905779] mali fb000000.gpu: EM: created perf domain
[    4.906308] mali fb000000.gpu: l=10000 h=85000 hyst=5000 l_limit=0 h_limit=800000000 h_table=0
[    4.907054] mali fb000000.gpu: Probed as mali0
[    4.909312] mmc2: Host Software Queue enabled
[    4.909331] mmc2: new HS400 Enhanced strobe MMC card at address 0001
[    4.909690] mmcblk2: mmc2:0001 A3A444 230 GiB
[    4.911857]  mmcblk2: p1 p2 p3 p4 p5 p6 p7 p8 p9
[    4.912709] mmcblk2boot0: mmc2:0001 A3A444 4.00 MiB
[    4.913585] mmcblk2boot1: mmc2:0001 A3A444 4.00 MiB
[    4.913668] mmc_host mmc0: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
[    4.914382] mmcblk2rpmb: mmc2:0001 A3A444 4.00 MiB, chardev (236:0)
[    4.918522] input: realtek,rt5616-codec Headphone Jack as /devices/platform/rt5616-sound/sound/card4/input3
[    4.921117] RKNPU fdab0000.npu: Adding to iommu group 0
[    4.921243] RKNPU fdab0000.npu: RKNPU: rknpu iommu is enabled, using iommu mode
[    4.922551] RKNPU fdab0000.npu: can't request region for resource [mem 0xfdab0000-0xfdabffff]
[    4.922577] RKNPU fdab0000.npu: can't request region for resource [mem 0xfdac0000-0xfdacffff]
[    4.922589] RKNPU fdab0000.npu: can't request region for resource [mem 0xfdad0000-0xfdadffff]
[    4.922980] [drm] Initialized rknpu 0.9.2 20231018 for fdab0000.npu on minor 1
[    4.925031] rockchip-pm rockchip-suspend: not set pwm-regulator-config
[    4.925044] rockchip-suspend not set sleep-mode-config for mem-lite
Loading, please wait...
[    4.925050] rockchip-suspend not set wakeup-config for mem-lite
[    4.925055] rockchip-suspend not set sleep-mode-config for mem-ultra
[    4.925060] rockchip-suspend not set wakeup-config for mem-ultra
[    4.925474] ALSA device list:
[    4.925479]   #0: rockchip,hdmi0
[    4.925484]   #1: rockchip,dp0
[    4.925490]   #2: rockchip,hdmi1
[    4.925495]   #3: rockchip,hdmiin
[    4.925499]   #4: realtek,rt5616-codec
[    4.927460] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[    4.930898] Freeing unused kernel memory: 9664K
[    4.954301] Run /init as init process
[    4.958937] vendor storage:20190527 ret = 0
[    4.981964] rk-pcie fe170000.pcie: host bridge /pcie@fe170000 ranges:
[    4.982025] rk-pcie fe170000.pcie:       IO 0x00f2100000..0x00f21fffff -> 0x00f2100000
[    4.982056] rk-pcie fe170000.pcie:      MEM 0x00f2200000..0x00f2ffffff -> 0x00f2200000
[    4.982077] rk-pcie fe170000.pcie:      MEM 0x0980000000..0x09bfffffff -> 0x0980000000
[    4.982173] rk-pcie fe170000.pcie: iATU unroll: enabled
[    4.982187] rk-pcie fe170000.pcie: iATU regions: 8 ob, 8 ib, align 64K, limit 8G
Starting version 249.11-0ubuntu3.7
[    5.071752] usb 1-1: New USB device found, idVendor=14cd, idProduct=8601, bcdDevice= 0.00
[    5.071789] usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=0
[    5.071802] usb 1-1: Product: USB 2.0 Hub
[    5.071811] usb 1-1: Manufacturer: USB Device
[    5.128924] hub 1-1:1.0: USB hub found
[    5.129053] hub 1-1:1.0: 4 ports detected
[    5.143984] rk-pcie fe190000.pcie: PCIe Link up, LTSSM is 0x130011
[    5.144030] rk-pcie fe190000.pcie: PCIe Gen.2 x1 link up
[    5.144207] rk-pcie fe190000.pcie: PCI host bridge to bus 0004:40
[    5.144229] pci_bus 0004:40: root bus resource [bus 40-4f]
[    5.144247] pci_bus 0004:40: root bus resource [io  0x200000-0x2fffff] (bus address [0xf4100000-0xf41fffff])
[    5.144260] pci_bus 0004:40: root bus resource [mem 0xf4200000-0xf4ffffff]
[    5.144272] pci_bus 0004:40: root bus resource [mem 0xa00000000-0xa3fffffff pref]
[    5.144317] pci 0004:40:00.0: [1d87:3588] type 01 class 0x060400
[    5.144349] pci 0004:40:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[    5.144415] pci 0004:40:00.0: supports D1 D2
[    5.144427] pci 0004:40:00.0: PME# supported from D0 D1 D3hot
[    5.154117] pci 0004:40:00.0: Primary bus is hard wired to 0
[    5.154141] pci 0004:40:00.0: bridge configuration invalid ([bus 01-ff]), reconfiguring
[    5.154330] pci 0004:41:00.0: [10ec:8125] type 00 class 0x020000
[    5.154390] pci 0004:41:00.0: reg 0x10: [io  0x0000-0x00ff]
[    5.154459] pci 0004:41:00.0: reg 0x18: [mem 0x00000000-0x0000ffff 64bit]
[    5.154505] pci 0004:41:00.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit]
[    5.154852] pci 0004:41:00.0: supports D1 D2
[    5.154862] pci 0004:41:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    5.164190] pci_bus 0004:41: busn_res: [bus 41-4f] end is updated to 41
[    5.164235] pci 0004:40:00.0: BAR 8: assigned [mem 0xf4200000-0xf42fffff]
[    5.164250] pci 0004:40:00.0: BAR 6: assigned [mem 0xf4300000-0xf430ffff pref]
[    5.164262] pci 0004:40:00.0: BAR 7: assigned [io  0x200000-0x200fff]
[    5.164276] pci 0004:41:00.0: BAR 2: assigned [mem 0xf4200000-0xf420ffff 64bit]
[    5.164315] pci 0004:41:00.0: BAR 4: assigned [mem 0xf4210000-0xf4213fff 64bit]
[    5.164353] pci 0004:41:00.0: BAR 0: assigned [io  0x200000-0x2000ff]
[    5.164373] pci 0004:40:00.0: PCI bridge to [bus 41]
[    5.164383] pci 0004:40:00.0:   bridge window [io  0x200000-0x200fff]
[    5.164393] pci 0004:40:00.0:   bridge window [mem 0xf4200000-0xf42fffff]
[    5.166237] pcieport 0004:40:00.0: PME: Signaling with IRQ 131
[    5.247381] rk-pcie fe170000.pcie: PCIe Link up, LTSSM is 0x130011
[    5.247423] rk-pcie fe170000.pcie: PCIe Gen.2 x1 link up
[    5.247620] rk-pcie fe170000.pcie: PCI host bridge to bus 0002:20
[    5.247637] pci_bus 0002:20: root bus resource [bus 20-2f]
[    5.247651] pci_bus 0002:20: root bus resource [io  0x300000-0x3fffff] (bus address [0xf2100000-0xf21fffff])
[    5.247663] pci_bus 0002:20: root bus resource [mem 0xf2200000-0xf2ffffff]
[    5.247673] pci_bus 0002:20: root bus resource [mem 0x980000000-0x9bfffffff pref]
[    5.247718] pci 0002:20:00.0: [1d87:3588] type 01 class 0x060400
[    5.247746] pci 0002:20:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[    5.247809] pci 0002:20:00.0: supports D1 D2
[    5.247819] pci 0002:20:00.0: PME# supported from D0 D1 D3hot
[    5.258022] pci 0002:20:00.0: Primary bus is hard wired to 0
[    5.258056] pci 0002:20:00.0: bridge configuration invalid ([bus 01-ff]), reconfiguring
[    5.258355] pci 0002:21:00.0: [10ec:8125] type 00 class 0x020000
[    5.258419] pci 0002:21:00.0: reg 0x10: [io  0x0000-0x00ff]
[    5.258488] pci 0002:21:00.0: reg 0x18: [mem 0x00000000-0x0000ffff 64bit]
[    5.258535] pci 0002:21:00.0: reg 0x20: [mem 0x00000000-0x00003fff 64bit]
[    5.258880] pci 0002:21:00.0: supports D1 D2
[    5.258891] pci 0002:21:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    5.267512] pci_bus 0002:21: busn_res: [bus 21-2f] end is updated to 21
[    5.267569] pci 0002:20:00.0: BAR 8: assigned [mem 0xf2200000-0xf22fffff]
[    5.267584] pci 0002:20:00.0: BAR 6: assigned [mem 0xf2300000-0xf230ffff pref]
[    5.267598] pci 0002:20:00.0: BAR 7: assigned [io  0x300000-0x300fff]
[    5.267615] pci 0002:21:00.0: BAR 2: assigned [mem 0xf2200000-0xf220ffff 64bit]
[    5.267656] pci 0002:21:00.0: BAR 4: assigned [mem 0xf2210000-0xf2213fff 64bit]
[    5.267696] pci 0002:21:00.0: BAR 0: assigned [io  0x300000-0x3000ff]
[    5.267716] pci 0002:20:00.0: PCI bridge to [bus 21]
[    5.267727] pci 0002:20:00.0:   bridge window [io  0x300000-0x300fff]
[    5.267739] pci 0002:20:00.0:   bridge window [mem 0xf2200000-0xf22fffff]
[    5.270968] pcieport 0002:20:00.0: PME: Signaling with IRQ 141
[    5.407324] usb 1-1.1: new full-speed USB device number 3 using xhci-hcd
[    5.500285] usb 1-1.1: New USB device found, idVendor=03eb, idProduct=8a6e, bcdDevice=10.34
[    5.500332] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    5.500343] usb 1-1.1: Product: Atmel maXTouch Digitizer
[    5.500353] usb 1-1.1: Manufacturer: Atmel
[    5.500362] usb 1-1.1: SerialNumber: I22R077080
[    5.621336] Freeing drm_logo memory: 4512K
[    5.643788] hid-generic 0003:03EB:8A6E.0001: hiddev96,hidraw0: USB HID v1.11 Device [Atmel Atmel maXTouch Digitizer] on usb-xhci-hcd.9.auto-1.1/input0
[    5.648732] input: Atmel Atmel maXTouch Digitizer as /devices/platform/usbdrd3_1/fc400000.usb/xhci-hcd.9.auto/usb1/1-1/1-1.1/1-1.1:1.1/0003:03EB:8A6E.0002/input/input4
[    5.704288] hid-generic 0003:03EB:8A6E.0002: input,hidraw1: USB HID v1.11 Device [Atmel Atmel maXTouch Digitizer] on usb-xhci-hcd.9.auto-1.1/input1
[    5.706742] input: Atmel Atmel maXTouch Digitizer as /devices/platform/usbdrd3_1/fc400000.usb/xhci-hcd.9.auto/usb1/1-1/1-1.1/1-1.1:1.2/0003:03EB:8A6E.0003/input/input5
[    5.761215] hid-generic 0003:03EB:8A6E.0003: input,hiddev97,hidraw2: USB HID v1.11 Pointer [Atmel Atmel maXTouch Digitizer] on usb-xhci-hcd.9.auto-1.1/input2
[    5.834268] usb 1-1.4: new low-speed USB device number 4 using xhci-hcd
[    5.931151] usb 1-1.4: New USB device found, idVendor=1a2c, idProduct=4d7e, bcdDevice= 1.10
[    5.931214] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    5.931252] usb 1-1.4: Product: USB Keyboard
[    5.931281] usb 1-1.4: Manufacturer: SEMICO
[    6.031499] input: SEMICO USB Keyboard as /devices/platform/usbdrd3_1/fc400000.usb/xhci-hcd.9.auto/usb1/1-1/1-1.4/1-1.4:1.0/0003:1A2C:4D7E.0004/input/input6
[    6.089534] hid-generic 0003:1A2C:4D7E.0004: input,hidraw3: USB HID v1.10 Keyboard [SEMICO USB Keyboard] on usb-xhci-hcd.9.auto-1.4/input0
[    6.100030] input: SEMICO USB Keyboard Consumer Control as /devices/platform/usbdrd3_1/fc400000.usb/xhci-hcd.9.auto/usb1/1-1/1-1.4/1-1.4:1.1/0003:1A2C:4D7E.0005/input/input7
[    6.154899] input: SEMICO USB Keyboard System Control as /devices/platform/usbdrd3_1/fc400000.usb/xhci-hcd.9.auto/usb1/1-1/1-1.4/1-1.4:1.1/0003:1A2C:4D7E.0005/input/input8
[    6.155651] input: SEMICO USB Keyboard as /devices/platform/usbdrd3_1/fc400000.usb/xhci-hcd.9.auto/usb1/1-1/1-1.4/1-1.4:1.1/0003:1A2C:4D7E.0005/input/input10
[    6.156705] hid-generic 0003:1A2C:4D7E.0005: input,hiddev98,hidraw4: USB HID v1.10 Keyboard [SEMICO USB Keyboard] on usb-xhci-hcd.9.auto-1.4/input1
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
[    6.316076] EXT4-fs (mmcblk2p8): mounted filesystem with ordered data mode. Quota mode: none.
Begin: Will now check userdata file system ... fsck from util-linux 2.37.2
[/usr/sbin/fsck.ext4 (1) -- /dev/mmcblk2p9] fsck.ext4 -a -C0 /dev/mmcblk2p9
userdata: recovering journal
userdata: Clearing orphaned inode 4320362 (uid=0, gid=0, mode=0100644, size=35024)
userdata: Clearing orphaned inode 4320300 (uid=0, gid=0, mode=0100644, size=1685536)
userdata: Clearing orphaned inode 4320197 (uid=0, gid=0, mode=0100644, size=326176)
userdata: Clearing orphaned inode 4320182 (uid=0, gid=0, mode=0100644, size=9346096)
userdata: Clearing orphaned inode 4320151 (uid=0, gid=0, mode=0100644, size=10016)
userdata: Clearing orphaned inode 4319972 (uid=0, gid=0, mode=0100644, size=210808)
userdata: Clearing orphaned inode 4319950 (uid=0, gid=0, mode=0100644, size=583024)
userdata: Clearing orphaned inode 4319910 (uid=0, gid=0, mode=0100644, size=79920)
userdata: Clearing orphaned inode 4319888 (uid=0, gid=0, mode=0100644, size=2341288)
userdata: Clearing orphaned inode 4319777 (uid=0, gid=0, mode=0100644, size=174424)
userdata: Clearing orphaned inode 4319745 (uid=0, gid=110, mode=0100600, size=350344)
userdata: Clearing orphaned inode 4319674 (uid=0, gid=0, mode=0100755, size=884408)
userdata: Clearing orphaned inode 4319642 (uid=0, gid=0, mode=0100755, size=133328)
userdata: Clearing orphaned inode 4319476 (uid=0, gid=0, mode=0100644, size=187704)
userdata: Clearing orphaned inode 4319393 (uid=0, gid=0, mode=0100644, size=577176)
userdata: Clearing orphaned inode 4319330 (uid=0, gid=0, mode=0100644, size=2727664)
userdata: Clearing orphaned inode 4319253 (uid=0, gid=0, mode=0100644, size=318480)
userdata: Clearing orphaned inode 4319290 (uid=0, gid=0, mode=0100644, size=887816)
userdata: Clearing orphaned inode 4319076 (uid=0, gid=0, mode=0100644, size=52208)
userdata: Clearing orphaned inode 4319400 (uid=0, gid=0, mode=0100644, size=183104)
userdata: Clearing orphaned inode 4319270 (uid=0, gid=0, mode=0100644, size=157952)
userdata: Clearing orphaned inode 4319653 (uid=0, gid=0, mode=0100755, size=256440)
userdata: Clearing orphaned inode 4319629 (uid=0, gid=0, mode=0100755, size=1687072)
userdata: Clearing orphaned inode 4319277 (uid=0, gid=0, mode=0100644, size=2734352)
userdata: Clearing orphaned inode 4319216 (uid=0, gid=0, mode=0100644, size=742816)
userdata: Clearing orphaned inode 4319047 (uid=0, gid=0, mode=0100644, size=456064)
userdata: Clearing orphaned inode 4319284 (uid=0, gid=0, mode=0100755, size=240720)
userdata: Clearing orphaned inode 4319257 (uid=0, gid=0, mode=0100755, size=26544)
userdata: Clearing orphaned inode 4319226 (uid=0, gid=0, mode=0100644, size=5776)
userdata: Clearing orphaned inode 4319180 (uid=0, gid=0, mode=0100644, size=1309136)
userdata: Clearing orphaned inode 4319157 (uid=0, gid=0, mode=0100644, size=3360)
userdata: Clearing orphaned inode 4319156 (uid=0, gid=0, mode=0100644, size=47)
userdata: Clearing orphaned inode 4319154 (uid=0, gid=0, mode=0100644, size=34)
userdata: Clearing orphaned inode 4319152 (uid=0, gid=0, mode=0100644, size=50)
userdata: Clearing orphaned inode 4319150 (uid=0, gid=0, mode=0100644, size=62)
userdata: Clearing orphaned inode 4319148 (uid=0, gid=0, mode=0100644, size=270)
userdata: Clearing orphaned inode 4319146 (uid=0, gid=0, mode=0100644, size=48)
userdata: Clearing orphaned inode 4319144 (uid=0, gid=0, mode=0100644, size=23)
userdata: Clearing orphaned inode 4319142 (uid=0, gid=0, mode=0100644, size=252)
userdata: Clearing orphaned inode 4319140 (uid=0, gid=0, mode=0100644, size=346132)
userdata: Clearing orphaned inode 4319138 (uid=0, gid=0, mode=0100644, size=1519554)
userdata: Clearing orphaned inode 4319132 (uid=0, gid=0, mode=0100644, size=131)
userdata: Clearing orphaned inode 4319488 (uid=0, gid=0, mode=0100644, size=27004)
userdata: Clearing orphaned inode 4319412 (uid=0, gid=0, mode=0100644, size=10280)
userdata: Clearing orphaned inode 4319136 (uid=0, gid=0, mode=0100644, size=14672)
userdata: Clearing orphaned inode 4319130 (uid=0, gid=0, mode=0100644, size=31576)
userdata: Clearing orphaned inode 4319126 (uid=0, gid=0, mode=0100644, size=84720)
userdata: Clearing orphaned inode 4319122 (uid=0, gid=0, mode=0100755, size=160200)
userdata: Clearing orphaned inode 4319109 (uid=0, gid=0, mode=0100644, size=51640)
userdata: Clearing orphaned inode 4319105 (uid=0, gid=0, mode=0100644, size=22800)
userdata: Clearing orphaned inode 4319091 (uid=0, gid=0, mode=0100644, size=633000)
userdata: Clearing orphaned inode 4319087 (uid=0, gid=0, mode=0100644, size=14560)
userdata: Clearing orphaned inode 4319082 (uid=0, gid=0, mode=0100755, size=1451024)
userdata: Clearing orphaned inode 4319063 (uid=0, gid=0, mode=0100755, size=145328)
userdata: Clearing orphaned inode 4301026 (uid=1000, gid=1000, mode=0100644, size=32768)
userdata: Clearing orphaned inode 4300839 (uid=1000, gid=1000, mode=0100600, size=64)
userdata: clean, 34334/11596800 files, 1013206/59364347 blocks
done.
[    6.689644] EXT4-fs (mmcblk2p9): mounted filesystem with ordered data mode. Quota mode: none.
[    6.696702] EXT4-fs (mmcblk2p9): re-mounted. Quota mode: none.
[    6.703059] overlayfs: "xino" feature enabled using 32 upper inode bits.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
[    6.885800] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_cancel_cpu_limit_freq freq qos nod add

Welcome to Debian GNU/Linux 11 (bullseye)!

Configuration file /lib/systemd/system/rkaiq_3A.service is marked world-writable. Please remove world writability permission bits. Proceeding anyway.
[    7.237408] rk-pcie fe150000.pcie: PCIe Link Fail
[    7.237458] rk-pcie fe150000.pcie: failed to initialize host
/lib/systemd/system/bootanim.service:9: Unit configured to use KillMode=none. This is unsafe, as it disables systemd's process lifecycle management for the service. Please update your service to use a safer KillMode=, such as 'mixed' or 'control-group'. Support for KillMode=none is deprecated and will eventually be removed.
[  OK  ] Created slice system-getty.slice.
[  OK  ] Created slice system-modprobe.slice.
[  OK  ] Created slice system-serial\x2dgetty.slice.
[  OK  ] Created slice User and Session Slice.
[  OK  ] Started Dispatch Password …ts to Console Directory Watch.
[  OK  ] Started Forward Password R…uests to Wall Directory Watch.
[  OK  ] Set up automount Arbitrary…s File System Automount Point.
[  OK  ] Reached target Local Encrypted Volumes.
[  OK  ] Reached target Remote File Systems.
[  OK  ] Reached target Slices.
[  OK  ] Reached target Swap.
[  OK  ] Listening on Syslog Socket.
[  OK  ] Listening on initctl Compatibility Named Pipe.
[  OK  ] Listening on Journal Audit Socket.
[  OK  ] Listening on Journal Socket (/dev/log).
[  OK  ] Listening on Journal Socket.
[  OK  ] Listening on udev Control Socket.
[  OK  ] Listening on udev Kernel Socket.
         Mounting Huge Pages File System...
         Mounting POSIX Message Queue File System...
         Mounting Kernel Debug File System...
         Mounting Kernel Trace File System...
         Starting Set the console keyboard layout...
         Starting Create list of st…odes for the current kernel...
         Starting Load Kernel Module configfs...
         Starting Load Kernel Module drm...
         Starting Load Kernel Module fuse...
[  OK  ] Started Nameserver information manager.
[  OK  ] Reached target Network (Pre).
         Starting Enable Rockchip camera engine rkaiq...
         Starting Journal Service...
         Starting Load Kernel Modules...
         Starting Remount Root and Kernel File Systems...
         Starting Coldplug All udev Devices...
[  OK  ] Mounted Huge Pages File System.
[  OK  ] Mounted POSIX Message Queue File System.
[  OK  ] Mounted Kernel Debug File System.
[  OK  ] Mounted Kernel Trace File System.
[  OK  ] Finished Create list of st… nodes for the current kernel.
[  OK  ] Finished Load Kernel Module configfs.
[  OK  ] Finished Load Kernel Module drm.
[  OK  ] Finished Load Kernel Module fuse.
[  OK  ] Started Enable Rockchip camera engine rkaiq.
         Mounting FUSE Control File System...
         Mounting Kernel Configuration File System...
[  OK  ] Finished Remount Root and Kernel File Systems.
         Starting Platform Persistent Storage Archival...
         Starting Load/Save Random Seed...
         Starting Create System Users...
[  OK  ] Mounted FUSE Control File System.
[  OK  ] Mounted Kernel Configuration File System.
[    7.370327] r8125: loading out-of-tree module taints kernel.
[    7.372975] r8125 2.5Gigabit Ethernet driver 9.010.01-NAPI loaded
[    7.373110] r8125 0004:41:00.0: enabling device (0000 -> 0003)
[  OK  ] Finished Platform Persistent Storage Archival.
[    7.391429] r8125: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
[    7.393495] r8125  Copyright (C) 2022 Realtek NIC software team <nicfae@realtek.com>
[  OK  ] Finished Create System Users.
[    7.393495]  This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>.
[    7.393495]  This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>.
[    7.393788] r8125 2.5Gigabit Ethernet driver 9.010.01-NAPI loaded
         Starting Create Static Device Nodes in /dev...
[    7.393881] r8125 0002:21:00.0: enabling device (0000 -> 0003)
[  OK  ] Finished Load/Save Random Seed.
[    7.413576] r8125: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
[  OK  ] Finished Create Static Device Nodes in /dev.
[    7.415607] r8125  Copyright (C) 2022 Realtek NIC software team <nicfae@realtek.com>
[    7.415607]  This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>.
[    7.415607]  This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>.
         Starting Rule-based Manage…for Device Events and Files...
[  OK  ] Finished Load Kernel Modules.
         Starting Apply Kernel Variables...
[  OK  ] Finished Set the console keyboard layout.
[  OK  ] Reached target Local File Systems (Pre).
[  OK  ] Reached target Local File Systems.
         Starting Enable support fo…l executable binary formats...
         Starting Boot time animation...
         Starting Set console font and keymap...
         Starting Manage USB device functions...
         Mounting Arbitrary Executable File Formats File System...
[  OK  ] Finished Apply Kernel Variables.
[  OK  ] Finished Set console font and keymap.
[  OK  ] Mounted Arbitrary Executable File Formats File System.
[  OK  ] Finished Enable support fo…nal executable binary formats.
[  OK  ] Started Boot time animation.
[  OK  ] Started Rule-based Manager for Device Events and Files.
[  OK  ] Started Journal Service.
         Starting Flush Journal to Persistent Storage...
[    7.549472] systemd-journald[399]: Received client request to flush runtime journal.
[  OK  ] Finished Coldplug All udev Devices.
         Starting Helper to synchronize boot up for ifupdown...
[  OK  ] Finished Helper to synchronize boot up for ifupdown.
         Starting Raise network interfaces...
[  OK  ] Finished Flush Journal to Persistent Storage.
[    7.691586] at24 6-0053: supply vcc not found, using dummy regulator
         Starting Create Volatile Files and Directories...
[  OK  ] Found device /dev/ttyFIQ0.
[    7.711004] cryptodev: driver 1.12 loaded.
[    7.728963] rk-crypto fe370000.crypto: invalid resource
[    7.739179] rk-crypto fe370000.crypto: register to cryptodev ok!
[    7.739201] rk-crypto fe370000.crypto: CRYPTO V2.0.0.0 Accelerator successfully registered
[  OK  ] Reached target Hardware activated USB gadget.
[    7.750638] rk-pcie fe180000.pcie: PCIe Link Fail
[    7.750675] rk-pcie fe180000.pcie: failed to initialize host
[  OK  ] Finished Create Volatile Files and Directories.
         Starting Update UTMP about System Boot/Shutdown...
         Starting Enable Rockchip camera engine rkaiq...
[  OK  ] Finished Raise network interfaces.
[  OK  ] Finished Update UTMP about System Boot/Shutdown.
[  OK  ] Started Enable Rockchip camera engine rkaiq.
[  OK  ] Reached target System Initialization.
[  OK  ] Started ACPI Events Check.
[  OK  ] Started Trigger anacron every hour.
[  OK  ] Started Daily apt download activities.
[  OK  ] Started Daily apt upgrade and clean activities.
[  OK  ] Started Periodic ext4 Onli…ata Check for All Filesystems.
[  OK  ] Started Discard unused blocks once a week.
[  OK  ] Started Daily man-db regeneration.
[  OK  ] Started Daily Cleanup of Temporary Directories.
[  OK  ] Reached target Paths.
[  OK  ] Reached target Timers.
[  OK  ] Listening on ACPID Listen Socket.
[  OK  ] Listening on D-Bus System Message Bus Socket.
[  OK  ] Listening on Load/Save RF …itch Status /dev/rfkill Watch.
[  OK  ] Listening on triggerhappy.socket.
[  OK  ] Reached target Sockets.
[  OK  ] Reached target Basic System.
[  OK  ] Started ACPI event daemon.
         Starting Save/Restore Sound Card State...
[  OK  ] Started Run anacron jobs.
[    7.923125] file system registered
[    7.929554] input: Atmel Atmel maXTouch Digitizer as /devices/platform/usbdrd3_1/fc400000.usb/xhci-hcd.9.auto/usb1/1-1/1-1.1/1-1.1:1.1/0003:03EB:8A6E.0002/input/input11
         Starting enable ASYNC for Debian Display...
         Starting Bluetooth management mechanism...
[  OK  ] Started D-Bus System Message Bus.
         Starting Network Manager...
         Starting Remove Stale Onli…t4 Metadata Check Snapshots...
         Starting Init board...
         Starting Init Onboard LEDs...
         Starting LSB: Load kernel …d to enable cpufreq scaling...
         Starting LSB: Run /etc/rc.local if it exist...
         Starting rkisp 3A engine...
         Starting System Logging Service...
         Starting User Login Management...
         Starting triggerhappy global hotkey daemon...
         Starting Disk Manager...
         Starting WPA supplicant...
[  OK  ] Finished Save/Restore Sound Card State.
[  OK  ] Finished Init board.
[  OK  ] Finished Init Onboard LEDs.
[  OK  ] Reached target Sound Card.
[  OK  ] Started rkisp 3A engine.
[    7.983380] read descriptors
[    7.983412] read strings
[    7.987513] hid-multitouch 0003:03EB:8A6E.0002: input,hidraw1: USB HID v1.11 Device [Atmel Atmel maXTouch Digitizer] on usb-xhci-hcd.9.auto-1.1/input1
[  OK  ] Started triggerhappy global hotkey daemon.
[  OK  ] Started System Logging Service.
[  OK  ] Started LSB: Load kernel m…ded to enable cpufreq scaling.
         Starting LSB: set CPUFreq kernel parameters...
[  OK  ] Started LSB: Run /etc/rc.local if it exist.
[  OK  ] Started Manage USB device functions.
[  OK  ] Started User Login Management.
[  OK  ] Finished Remove Stale Onli…ext4 Metadata Check Snapshots.
[  OK  ] Started WPA supplicant.
         Starting Authorization Manager...
[  OK  ] Started LSB: set CPUFreq kernel parameters.
[  OK  ] Started Network Manager.
[  OK  ] Reached target Network.
[  OK  ] Reached target Network is Online.
[  OK  ] Started lcd2usb.
         Starting Network Time Service...
         Starting OpenVPN service...
         Starting /etc/rc.local Compatibility...
         Starting Sets network devices IRQ and RPS...
         Starting OpenBSD Secure Shell server...
[  OK  ] Started strongSwan IPsec I…IKEv2 daemon using ipsec.conf.
         Starting Hostname Service...
         Starting Permit User Sessions...
         Starting LSB: layer 2 tunelling protocol daemon...
[  OK  ] Finished OpenVPN service.
[  OK  ] Started Authorization Manager.
[  OK  ] Finished Sets network devices IRQ and RPS.
[  OK  ] Finished Permit User Sessions.
         Starting Light Display Manager...
[    8.215866] NET: Registered PF_PPPOX protocol family
[  OK  ] Started /etc/rc.local Compatibility.
[  OK  ] Started Getty on tty1.
[  OK  ] Started Serial Getty on ttyFIQ0.
[  OK  ] Reached target Login Prompts.
[  OK  ] Started Hostname Service.
[    8.242921] l2tp_core: L2TP core driver, V2.0
[    8.246466] l2tp_netlink: L2TP netlink interface
[    8.249127] l2tp_ppp: PPPoL2TP kernel driver, V2.0
[  OK  ] Started Network Time Service.
[  OK  ] Started LSB: layer 2 tunelling protocol daemon.
[  OK  ] Started Light Display Manager.
         Starting Network Manager Script Dispatcher Service...
[  OK  ] Started Disk Manager.
[  OK  ] Started OpenBSD Secure Shell server.
[    8.291038] eth0: 0xffffffc00b280000, 7a:03:14:91:cd:b6, IRQ 142
[    8.299625] dwc3 fc000000.usb: device reset
[  OK  ] Started Network Manager Script Dispatcher Service.
[    8.342904] eth1: 0xffffffc00b250000, 7e:03:14:91:cd:b6, IRQ 174
[    8.347759] android_work: sent uevent USB_STATE=CONNECTED
[    8.510196] mali fb000000.gpu: Loading Mali firmware 0x1010000
[    8.513441] mali fb000000.gpu: Mali firmware git_sha: ee476db42870778306fa8d559a605a73f13e455c
[  OK  ] Started Bluetooth management mechanism.
[    9.898563] r8125: eth0: link up
[    9.898670] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  OK  ] Created slice User Slice of UID 1000.
         Starting User Runtime Directory /run/user/1000...
[  OK  ] Finished User Runtime Directory /run/user/1000.
         Starting User Manager for UID 1000...
[  OK  ] Started User Manager for UID 1000.
[  OK  ] Started Session 1 of user pi.
[  OK  ] Started enable ASYNC for Debian Display.
[  OK  ] Reached target Multi-User System.
[  OK  ] Reached target Graphical Interface.
[  OK  ] Started Setup rockchip platform environment.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Finished Update UTMP about System Runlevel Changes.
[   11.292158] ttyFIQ ttyFIQ0: tty_port_close_start: tty->count = 1 port count = 2
[   11.495522] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_audio_startup: device is no connected or audio is off
[   11.882093] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   11.882140] Bluetooth: BNEP filters: protocol multicast
[   11.882163] Bluetooth: BNEP socket layer initialized

Debian GNU/Linux 11 NanoPC-T6 ttyFIQ0

NanoPC-T6 login: [   18.181721] platform mtd_vendor_storage: deferred probe pending
[   18.334982] dwc3 fc000000.usb: device reset
[   18.397829] android_work: sent uevent USB_STATE=CONFIGURED

NanoPC-T6 login: root
Password:
Linux NanoPC-T6 6.1.25 #2 SMP Mon Dec  4 22:42:15 CST 2023 aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@NanoPC-T6:~#
6.4 磁盘测试
6.4.1 查看块设备

查看eMMC块设备文件:

pi@NanoPC-T6:~$ ls /dev/mmc* -l
brw-rw---- 1 root disk 179,  0 Dec  6 14:33 /dev/mmcblk2
brw-rw---- 1 root disk 179, 32 Dec  6 13:47 /dev/mmcblk2boot0
brw-rw---- 1 root disk 179, 64 Dec  6 13:47 /dev/mmcblk2boot1
brw-rw---- 1 root disk 179,  1 Dec  6 14:33 /dev/mmcblk2p1
brw-rw---- 1 root disk 179,  2 Dec  6 14:33 /dev/mmcblk2p2
brw-rw---- 1 root disk 179,  3 Dec  6 14:33 /dev/mmcblk2p3
brw-rw---- 1 root disk 179,  4 Dec  6 14:33 /dev/mmcblk2p4
brw-rw---- 1 root disk 179,  5 Dec  6 14:33 /dev/mmcblk2p5
brw-rw---- 1 root disk 179,  6 Dec  6 14:33 /dev/mmcblk2p6
brw-rw---- 1 root disk 179,  7 Dec  6 14:33 /dev/mmcblk2p7
brw-rw---- 1 root disk 179,  8 Dec  6 14:33 /dev/mmcblk2p8
brw-rw---- 1 root disk 179,  9 Dec  6 14:33 /dev/mmcblk2p9
crw------- 1 root root 236,  0 Dec  6 13:47 /dev/mmcblk2rpmb

这里一共有12个块设备节点和1个字符设备节点;其中:

  • /dev/mmcblk2表示的是eMMC这个设备,其主设备号为179,次设备号为0;
  • mmcblk2boot0mmcblk2boot1对应两个Boot Area Partition;每一个Boot Area Partition大小都是4MB
  • mmcblk2rpmb则为RPMB Partition;大小为4MB
  • mmcblk2pxUser Data Area划分出来的SW Partitions;实际上就是通过解析GPT分区表创建的分区,分区编号依次为1,2,3,4,5,6,7,8,9;

使用cat /proc/partitions,可以查看全部分区信息:

pi@NanoPC-T6:~$ cat /proc/partitions
major minor  #blocks  name

   1        0       4096 ram0
   1        1       4096 ram1
   1        2       4096 ram2
   1        3       4096 ram3
   1        4       4096 ram4
   1        5       4096 ram5
   1        6       4096 ram6
   1        7       4096 ram7
 179        0  241664000 mmcblk2
 179        1       4096 mmcblk2p1
 179        2       4096 mmcblk2p2
 179        3       4096 mmcblk2p3
 179        4      16384 mmcblk2p4
 179        5      40960 mmcblk2p5
 179        6      32768 mmcblk2p6
 179        7      32768 mmcblk2p7
 179        8    4063232 mmcblk2p8
 179        9  237457391 mmcblk2p9
 179       32       4096 mmcblk2boot0
 179       64       4096 mmcblk2boot1

其中blocks表示分区的容量,每个blocks1KB。这里:

  • mmcblk2p1对应uboot分区,大小为4MB
  • mmcblk2p2对应misc分区,大小为4MB
  • mmcblk2p3对应dtbo分区,大小为4MB
  • mmcblk2p4对应resource分区,大小为16MB
  • mmcblk2p5对应kernel分区,大小为40MB
  • mmcblk2p6对应boot分区,大小为32MB
  • mmcblk2p7对应recovery分区,大小为32MB
  • mmcblk2p8对应rootfs分区,大小为3968MB
  • mmcblk2p9对应userdata分区,大小为剩余所有空间;
6.4.2 查看磁盘空间

这里我们可以通过df -hT查看磁盘空间信息;

pi@NanoPC-T6:~$ df -hT
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  7.8G  8.0K  7.8G   1% /dev
tmpfs          tmpfs     1.6G  2.0M  1.6G   1% /run
overlay        overlay   224G   28M  213G   1% /
tmpfs          tmpfs     7.8G     0  7.8G   0% /dev/shm
tmpfs          tmpfs     5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs     1.6G   52K  1.6G   1% /run/user/1000

显示内容参数说明:

  • Filesystem:文件系统;
  • Type:文件系统类型;
  • Size: 分区大小;
  • Used: 已使用容量;
  • Avail: 还可以使用的容量;
  • Use%: 已用百分比;
  • Mounted on: 挂载点; 

udevtmpfs是虚拟文件系统,它们通常用于设备和临时文件系统,并且占用的空间很小。

overlay是一个联合文件系统,挂载在根目录/,总容量为224GB,已使用空间为28MB,剩余可用空间为213GB,已使用空间占总容量的比例为1%

其他的 tmpfs 文件系统用于临时存储,例如 /dev/shm/run/lock/run/user/1000

6.5 ssh远程连接

查看网络服务状态:

pi@NanoPC-T6:~$ sudo systemctl status NetworkManager.service
● NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendo>
     Active: active (running) since Wed 2023-12-06 15:17:24 UTC; 19min ago
       Docs: man:NetworkManager(8)
   Main PID: 748 (NetworkManager)
      Tasks: 3 (limit: 18964)
     Memory: 14.0M
        CPU: 374ms
     CGroup: /system.slice/NetworkManager.service
             └─748 /usr/sbin/NetworkManager --no-daemon

Dec 06 15:17:26 NanoPC-T6 NetworkManager[748]: <info>  [1701875846.1472] device>
Dec 06 15:17:26 NanoPC-T6 NetworkManager[748]: <info>  [1701875846.1478] device>
Dec 06 15:17:26 NanoPC-T6 NetworkManager[748]: <info>  [1701875846.1491] manage>
Dec 06 15:17:26 NanoPC-T6 NetworkManager[748]: <info>  [1701875846.1519] manage>
Dec 06 15:17:26 NanoPC-T6 NetworkManager[748]: <info>  [1701875846.1522] policy>
Dec 06 15:17:26 NanoPC-T6 NetworkManager[748]: <info>  [1701875846.1531] dns-mg>
Dec 06 15:17:26 NanoPC-T6 NetworkManager[748]: <info>  [1701875846.2094] device>
Dec 06 15:17:26 NanoPC-T6 NetworkManager[748]: <info>  [1701875846.2126] manage>
Dec 06 15:17:30 NanoPC-T6 NetworkManager[748]: <info>  [1701875850.5638] manage>
Dec 06 15:17:32 NanoPC-T6 NetworkManager[748]: <info>  [1701875852.6026] agent->

输入ifconfig命令后,可以看到网络配置信息,其中包含了两个有线网卡;

pi@NanoPC-T6:~$ sudo ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.101  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::a761:1d58:f857:735b  prefixlen 64  scopeid 0x20<link>
        ether 7a:03:14:91:cd:b6  txqueuelen 1000  (Ethernet)
        RX packets 454  bytes 44063 (43.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 256  bytes 19362 (18.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 142

eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 7e:03:14:91:cd:b6  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 174

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

我们可以看到开发板的ip地址为192.168.0.101,因此我们可以使用ping测试和我们宿主机之间的网络通不通;

pi@NanoPC-T6:~$ sudo ping 192.168.0.200
PING 192.168.0.200 (192.168.0.200) 56(84) bytes of data.
64 bytes from 192.168.0.200: icmp_seq=1 ttl=64 time=1.63 ms
64 bytes from 192.168.0.200: icmp_seq=2 ttl=64 time=0.976 ms
64 bytes from 192.168.0.200: icmp_seq=3 ttl=64 time=0.905 ms
^C
--- 192.168.0.200 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 0.905/1.169/1.628/0.325 ms

既然网络是通过的,那么我们就可以通过ssh远程连接工具连接我们的开发板,这里我使用的是MobaXtermdebain系统默认账号密码如下:

普通用户:
    用户名: pi
    密码: pi

Root用户:
    默认没有设置root密码,可通过sudo passwd root命令配置root密码

这里我们使用Mobaxterm工具以root用户登录,登录之后如下所示;

┌────────────────────────────────────────────────────────────────────┐
     │                        • MobaXterm 11.1 •                          │
     │            (SSH client, X-server and networking tools)             │
     │                                                                    │
     │ ➤ SSH session to pi@192.168.0.101                                  │
     │   • SSH compression : ✔                                            │
     │   • SSH-browser     : ✔                                            │
     │   • X11-forwarding  : ✔  (remote display is forwarded through SSH) │
     │   • DISPLAY         : ✔  (automatically set on remote server)      │
     │                                                                    │
     │ ➤ For more info, ctrl+click on help or visit our website           │
     └────────────────────────────────────────────────────────────────────┘

Linux NanoPC-T6 6.1.25 #2 SMP Mon Dec  4 22:42:15 CST 2023 aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Dec  6 15:17:52 2023
pi@NanoPC-T6:~$

通过sudo passwd root命令配置root密码:

pi@NanoPC-T6:~$ sudo passwd root
New password:
Retype new password:
passwd: password updated successfully

这里我将root密码设置为123456,我们可以使用su命令切换到root用户:

pi@NanoPC-T6:~$ su root
Password:
root@NanoPC-T6:/home/pi#
6.6 安装内核头文件

在根文件系统/opt目录下存放着linux-header安装包,可以直接安装;

root@NanoPC-T6:/home/pi# cd /opt/
root@NanoPC-T6:/opt# ls -l
-rw-r--r-- 1 root root 7765064 Jun 27 10:12 linux-headers-5.10.160-1.deb
-rw-r--r-- 1 root root 8436016 Nov  9 11:38 linux-headers-6.1.25-1.deb
root@NanoPC-T6:/opt# rm -rf *

当然我们也可以安装我们编译生成的linux-header安装包;

root@NanoPC-T6:/opt# scp root@192.168.0.200://work/sambashare/rk3588/friendly/sd-fuse_rk3588/out/linux-headers-6.1.25.deb ./
root@192.168.0.200's password:
linux-headers-6.1.25.deb   100%   11MB  11.2MB/s   00:00
root@NanoPC-T6:/opt# sudo dpkg -i /opt/linux-headers-*.deb

安装完成后,我们可以看一下/usr/src目录下是否创建了linux-headers-$(uname-r)文件;

root@NanoPC-T6:/opt#  ls -l /usr/src/
drwxr-xr-x 5 pi pi 4096 Dec  6 15:43 linux-headers-5.10.160
drwxr-xr-x 5 pi pi 4096 Dec  6 15:48 linux-headers-6.1.25
root@NanoPC-T6:/opt#  ls -l /usr/src/linux-headers-6.1.25/
-rw-r--r--  1 root root   71902 Dec  4 13:48 Makefile
-rw-r--r--  1 root root 1124563 Dec  4 14:55 Module.symvers
drwxr-xr-x  3 pi   pi      4096 Dec  6 15:43 arch
drwxr-xr-x 33 pi   pi      4096 Dec  6 15:43 include
drwxr-xr-x 17 pi   pi     24576 Dec  6 15:48 scripts

在开发版测试编译内核模块并安装:

pi@NanoPC-T6:/opt$ sudo apt update
pi@NanoPC-T6:/opt$ sudo apt install git gcc make bc
pi@NanoPC-T6:/opt$ git clone https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
pi@NanoPC-T6:/opt$ cd RTL88x2BU-Linux-Driver
pi@NanoPC-T6:/opt$ sudo make -j$(nproc)
pi@NanoPC-T6:/opt$ sudo make install
pi@NanoPC-T6:/opt$ sudo modprobe 88x2bu

如果出现内核编译gcc版本和debiangcc版本不一致问题;

warning: the compiler differs from the one used to build the kernel
  The kernel was built by: arm-linux-gcc (Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
  You are using:           gcc (Debian 10.2.1-6) 10.2.1 20210110

则按照接下来的教程升级debiangcc版本即可:

6.6.1 查看gcc版本
root@NanoPC-T6:/opt/RTL88x2BU-Linux-Driver# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/10/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)

此处安装的gcc版本为10.2.1

6.6.2 安装aptitude

安装aptitudeaptitudeapt-get一样,是debian及其衍生系统中功能极其强大的包管理工具。

aptitude整合了dselectapt-get的所有功能, 并提供的更多特性,特别是在依赖关系处理上。

pi@NanoPC-T6:/$ sudo apt-get update
pi@NanoPC-T6:/$ sudo apt-get install aptitude

常用命令:

aptitude update     更新可用的包列表
aptitude upgrade    升级可用的包
aptitude dist-upgrade   将系统升级到新的发行版
aptitude install pkgname    安装包
aptitude remove pkgname     删除包
aptitude purge pkgname  删除包及其配置文件
aptitude search string  搜索包
aptitude show pkgname   显示包的详细信息
aptitude clean  删除下载的包文件
aptitude autoclean  仅删除过期的包文件
6.6.3 配置软件源

配置软件源:

pi@NanoPC-T6:/$ sudo vim /etc/apt/sources.list

这里需要把原内容删除,全部替换为:

# 默认注释了源码镜像以提高 apt update 速度
# 官方   sid表示最新的,每天都更新
deb http://ftp.cn.debian.org/debian/ sid main contrib non-free
#deb-src http://ftp.cn.debian.org/debian/ sid main contrib non-free
deb http://ftp.de.debian.org/debian/ sid main contrib non-free
#deb-src http://ftp.de.debian.org/debian/ sid main contrib non-free

# 清华大学的软件源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free 
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

# 阿里云的软件源
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
# deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

# 中科大的软件源
deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free 
# deb-src https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free 
deb https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free 
# deb-src https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free 
deb https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free 
# deb-src https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free 
deb https://mirrors.ustc.edu.cn/debian-security bullseye-security main contrib non-free 
# deb-src https://mirrors.ustc.edu.cn/debian-security bullseye-security main contrib non-free

# 腾讯的软件源
deb http://mirrors.cloud.tencent.com/debian bullseye main contrib non-free
#deb-src http://mirrors.cloud.tencent.com/debian bullseye main contrib non-free
deb http://mirrors.cloud.tencent.com/debian bullseye-updates main contrib non-free
#deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main contrib non-free
deb http://mirrors.cloud.tencent.com/debian bullseye-backports main contrib non-free
#deb-src http://mirrors.cloud.tencent.com/debian bullseye-backports main contrib non-free
deb http://mirrors.cloud.tencent.com/debian-security/ bullseye-security main contrib non-free
#deb-src http://mirrors.cloud.tencent.com/debian-security/ bullseye-security main contrib non-free

更新库:

pi@NanoPC-T6:/$ sudo aptitude clean
pi@NanoPC-T6:/$ sudo aptitude update

aptitude search可以看到aptitude库里边有了:

pi@NanoPC-T6:/$ sudo aptitude search gcc-12
p   gcc-12                                                             - GNU C compiler
p   gcc-12-arm-linux-gnueabi                                           - GNU C compiler (cross compiler for armel architecture)
......
6.6.4 安装gcc

Linux系统下,可以通过安装不同的gcc版本实现版本切换。首先,需要安装需要的gcc版本。

pi@NanoPC-T6:/$ sudo aptitude install gcc-12 g++-12   # 第一次执行
....          # 前面一直选择n

The following actions will resolve these dependencies:

      Remove the following packages:
1)      binutils [2.35.2-2 (now, oldstable)]
2)      binutils-aarch64-linux-gnu [2.35.2-2 (now, oldstable)]
3)      gcc [4:10.2.1-1 (now, oldstable)]
4)      gcc-10 [10.2.1-6 (now, oldstable)]
5)      libbinutils [2.35.2-2 (now, oldstable)]
6)      libctf0 [2.35.2-2 (now, oldstable)]
7)      libgcc-10-dev [10.2.1-6 (now, oldstable)]
8)      libubsan1 [10.2.1-6 (now, oldstable)]

      Keep the following packages at their current version:
9)      cpp-12 [Not Installed]
10)     g++-12 [Not Installed]
11)     gcc-12 [Not Installed]
12)     libasan8 [Not Installed]
13)     libc-bin [2.31-13+deb11u6 (now, oldstable)]
14)     libc6 [2.31-13+deb11u6 (now, oldstable)]
15)     libgcc-12-dev [Not Installed]
16)     libgcc-s1 [10.2.1-6 (now, oldstable)]
17)     libgomp1 [10.2.1-6 (now, oldstable)]
18)     libgprofng0 [Not Installed]
19)     libhwasan0 [Not Installed]
20)     libitm1 [10.2.1-6 (now, oldstable)]
21)     liblsan0 [10.2.1-6 (now, oldstable)]
22)     libstdc++-12-dev [Not Installed]
23)     libstdc++6 [10.2.1-6 (now, oldstable)]
24)     libtsan2 [Not Installed]
25)     libzstd1 [1.4.8+dfsg-2.1 (now, oldstable)]
26)     locales [2.31-13+deb11u6 (now, oldstable)]


Accept this solution? [Y/n/q/?] y             # 最后一次设置为y

pi@NanoPC-T6:/$ sudo aptitude install gcc-12 g++-12   # 第二次执行
root@NanoPC-T6:/# sudo aptitude install gcc-12 g++-12
The following NEW packages will be installed:
  binutils{a} binutils-aarch64-linux-gnu{a} binutils-common{a} cpp-12{a} g++-12 gcc-12 gcc-12-base{a} libasan8{a} libbinutils{a} libcc1-0{a}
  libctf-nobfd0{a} libctf0{a} libgcc-12-dev{a} libgprofng0{a} libhwasan0{a} libitm1{a} liblsan0{a} libsframe1{a} libstdc++-12-dev{a} libtsan2{a}
  libubsan1{a}
The following packages will be upgraded:
  libc-bin libc6 libgcc-s1 libgomp1 libstdc++6 libzstd1 locales
The following packages are RECOMMENDED but will NOT be installed:
  manpages
7 packages upgraded, 21 newly installed, 0 to remove and 1161 not upgraded.
Need to get 59.4 MB of archives. After unpacking 234 MB will be used.
The following packages have unmet dependencies:
 libc-dev-bin : Depends: libc6 (< 2.32) but 2.37-13 is to be installed
 libc6-dev : Depends: libc6 (= 2.31-13+deb11u6) but 2.37-13 is to be installed
The following actions will resolve these dependencies:

     Install the following packages:
1)     libffi8 [3.4.4-2 (unstable)]
2)     rpcsvc-proto [1.4.3-1 (unstable)]

     Upgrade the following packages:
3)     libc-dev-bin [2.31-13+deb11u6 (now, oldstable) -> 2.37-13 (unstable)]
4)     libc6-dev [2.31-13+deb11u6 (now, oldstable) -> 2.37-13 (unstable)]
5)     libglib2.0-0 [2.66.8-1 (now, oldstable) -> 2.78.2-1 (unstable)]
6)     libglib2.0-bin [2.66.8-1 (now, oldstable) -> 2.78.2-1 (unstable)]
7)     libglib2.0-dev [2.66.8-1 (now, oldstable) -> 2.78.2-1 (unstable)]
8)     libglib2.0-dev-bin [2.66.8-1 (now, oldstable) -> 2.78.2-1 (unstable)]



Accept this solution? [Y/n/q/?] y  # 第一次选择y

安装完后,可以在终端中使用下面的命令查看已安装的gcc版本:

root@NanoPC-T6:/# dpkg --list | grep gcc
ii  gcc-10-base:arm64                           10.2.1-6                        arm64        GCC, the GNU Compiler Collection (base package)
ii  gcc-12                                      12.3.0-12                       arm64        GNU C compiler
ii  gcc-12-base:arm64                           12.3.0-12                       arm64        GCC, the GNU Compiler Collection (base package)
ii  gcc-13-base:arm64                           13.2.0-8                        arm64        GCC, the GNU Compiler Collection (base package)
ii  gcc-9-base:arm64                            9.3.0-22                        arm64        GCC, the GNU Compiler Collection (base package)
ii  libgcc-12-dev:arm64                         12.3.0-12                       arm64        GCC support library (development files)
ii  libgcc-s1:arm64                             13.2.0-8                        arm64        GCC support library

如果安装多个gcc版本后,可以使用update-alternatives工具切换版本。

使用下面的命令添加gcc-12为备选项:

pi@NanoPC-T6:/$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 60 
update-alternatives: using /usr/bin/gcc-12 to provide /usr/bin/gcc (gcc) in auto mode

同样,数字60表示优先级,数字越大优先级越高。这里为了便于理解,将优先级设置为了不同的数字。

使用下面的命令查看gcc相关的备选项:

pi@NanoPC-T6:/$ sudo update-alternatives --config gcc
There is only one alternative in link group gcc (providing /usr/bin/gcc): /usr/bin/gcc-12
Nothing to configure.

查看gcc版本,并创建cc的软链接;

pi@NanoPC-T6:/$ gcc -v        # 命令1
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/12/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 12.3.0-12' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.3.0 (Debian 12.3.0-12)

pi@NanoPC-T6:/$ sudo ln -s /usr/bin/gcc /usr/bin/cc # 命令2

然后可以按照前文介绍的流程继续编译RTL88x2BU-Linux-Driver,编译后安装88x2bu.ko驱动;

pi@NanoPC-T6:/opt/RTL88x2BU-Linux-Driver$ sudo modprobe 88x2bu
pi@NanoPC-T6:/opt/RTL88x2BU-Linux-Driver$ lsmod
Module                  Size  Used by
88x2bu               3092480  0
cfg80211              749568  1 88x2bu      # 这里
nfnetlink              20480  1
hid_logitech_hidpp     45056  0
hid_logitech_dj        28672  0
hid_multitouch         28672  0
bnep                   28672  2
l2tp_ppp               28672  0
l2tp_netlink           24576  1 l2tp_ppp
l2tp_core              40960  2 l2tp_ppp,l2tp_netlink
ip6_udp_tunnel         16384  1 l2tp_core
udp_tunnel             20480  1 l2tp_core
pppox                  20480  1 l2tp_ppp
joydev                 32768  0
at24                   24576  0
r8169                  86016  0
rk_crypto             147456  0
cryptodev              81920  1 rk_crypto
uio_pdrv_genirq        20480  0
uio                    24576  1 uio_pdrv_genirq
binfmt_misc            24576  1
r8125                 163840  0
ledtrig_netdev         16384  0
ip_tables              32768  0
6.7 安装libusb-1.0-0-dev
root@SOM-RK3399v2:/opt# sudo apt install libusb-dev libusb-1.0-0-dev

在使用libusb库的时候需要指定:

  • 头文件libusb.h安装到了/usr/include/libusb-1.0路径;
  • 动态库libusb-1.0.so安装到了/usr/lib/aarch64-linux-gnu/路径;

/opt/libusb目录下编写测试应用程序listdev.c

#include <stdio.h>
#include <sys/types.h>
#include <libusb.h>

static void print_devs(libusb_device **devs)
{
    libusb_device *dev;
    int i = 0;

    while ((dev = devs[i++]) != NULL) {
        struct libusb_device_descriptor desc;
        int r = libusb_get_device_descriptor(dev, &desc);
        if (r < 0) {
            fprintf(stderr, "failed to get device descriptor");
            return;
        }

        printf("%04x:%04x (bus %d, device %d)\n",
            desc.idVendor, desc.idProduct,
            libusb_get_bus_number(dev), libusb_get_device_address(dev));
    }
}

int main(void)
{
    libusb_device **devs;
    int r;
    ssize_t cnt;

    r = libusb_init(NULL);
    if (r < 0)
        return r;

    cnt = libusb_get_device_list(NULL, &devs);
    if (cnt < 0)
        return (int) cnt;

    print_devs(devs);
    libusb_free_device_list(devs, 1);

    libusb_exit(NULL);
    return 0;
}

编译并运行:

pi@NanoPC-T6:/opt/libusb$ sudo gcc  -o listdev listdev.c  -I/usr/include/libusb-1.0   -lusb-1.0
pi@NanoPC-T6:/opt/libusb$ ./listdev
1d6b:0003 (bus 2, device 1)
1a2c:4d7e (bus 1, device 5)
046d:c52b (bus 1, device 4)
03eb:8a6e (bus 1, device 3)
14cd:8601 (bus 1, device 2)
1d6b:0002 (bus 1, device 1)
1d6b:0001 (bus 6, device 1)
1d6b:0002 (bus 5, device 1)
1d6b:0001 (bus 4, device 1)
1d6b:0002 (bus 3, device 1)
6.8 安装x11vnc远程桌面

x11vnc是一个VNC服务器,安装后我们可以不依赖外部的显示设备,,通过网络远程登debia桌面。

6.8.1 安装x11vnc
pi@NanoPC-T6:/$ sudo aptitude install x11vnc
# 一直选择y

设置VNC客户端登录密码,这里我设置为123456

pi@NanoPC-T6:/$ sudo x11vnc -storepasswd /etc/x11vnc.pwd

设置x11vnc在开机时自动启动,新建如下文件:

pi@NanoPC-T6:/$ sudo vi /lib/systemd/system/x11vnc.service

内容如下:

[Unit]
Description=Start x11vnc at startup.
Requires=display-manager.service
After=syslog.target network-online.target
Wants=syslog.target network-online.target
 
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -display :0 -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pwd -rfbport 5900 -shared -capslock -nomodtweak
ExecStop=/usr/bin/x11vnc -R stop
Restart=on-failure
 
[Install]
WantedBy=multi-user.target

设置systemd服务:

pi@NanoPC-T6:/$ sudo systemctl daemon-reload
pi@NanoPC-T6:/$ sudo systemctl enable x11vnc.service
pi@NanoPC-T6:/$ sudo systemctl start x11vnc
6.8.2 测试远程桌面

Windows电脑上安装VNC Viewe,下载地址Download VNC Viewer for Windows | VNC® Connect

安装完成后启动VNC客户端软件, 在地址栏输入: IP地址:5900连接即可,效果如下图所示;

图中设备IP地址为192.168.0.101, 使用端口5900进行连接。

6.8.3 禁止用户自动休眠

执行如下命令查看休眠模式的情况:

pi@NanoPC-T6:/$ sudo systemctl status sleep.target
● sleep.target - Sleep
     Loaded: loaded (/lib/systemd/system/sleep.target; static)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

可以看出,sleep状态是loaded,也就是处于开启状态。接下来,执行如下命令关闭系统的自动休眠开关:

pi@NanoPC-T6:/$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Created symlink /etc/systemd/system/sleep.target → /dev/null.
Created symlink /etc/systemd/system/suspend.target → /dev/null.
Created symlink /etc/systemd/system/hibernate.target → /dev/null.
Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.

再次执行如下命令,查看休眠设置:

pi@NanoPC-T6:/$ sudo systemctl status sleep.target
○ sleep.target
     Loaded: masked (Reason: Unit sleep.target is masked.)
     Active: inactive (dead)

可以看到sleep的状态已经变成了masked,也就是关闭了。

虽然吧,这个解决方案看上去挺合理的。但实际上,它也无效,后来电脑还是会每晚自动休眠。

尝试如下命令;

pi@NanoPC-T6:/$ sudo gsettings set org.gnome.desktop.screensaver lock-enabled false
pi@NanoPC-T6:/$ sudo gsettings set org.gnome.desktop.session idle-delay 0

七、debain系统设置

7.1 更改时区

检查当前时区:

pi@NanoPC-T6:/$ timedatectl
               Local time: Fri 2023-12-08 15:06:08 UTC
           Universal time: Fri 2023-12-08 15:06:08 UTC
                 RTC time: Fri 2023-12-08 15:06:08
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: n/a
          RTC in local TZ: no

列出所有时区:

pi@NanoPC-T6:/$ timedatectl list-timezones

设置时区 (比如上海):

pi@NanoPC-T6:/$ sudo timedatectl set-timezone Asia/Shanghai
pi@NanoPC-T6:/$ timedatectl
               Local time: Fri 2023-12-08 23:06:34 CST
           Universal time: Fri 2023-12-08 15:06:34 UTC
                 RTC time: Fri 2023-12-08 15:06:34
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: n/a
          RTC in local TZ: no
7.2 更换桌面墙纸

修改如下配置文件:

pi@NanoPC-T6:/$ vim /home/pi/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
7.3 设置中文语言与输入法
7.3.1 设置中文语言

输入以下命令:

pi@NanoPC-T6:/$ sudo dpkg-reconfigure locales
Generating locales (this might take a while)...
  zh_CN.UTF-8... done
Generation complete.

执行之后可以使用空格选择,Tab键跳转光标,这里用空格选中 zh_CN.UTF-8

添加环境变量到.bashrc,这个文件主要用于设置系统的locale

pi@NanoPC-T6:/$ echo "export LC_ALL=zh_CN.UTF-8" >> ~/.bashrc
pi@NanoPC-T6:/$ echo "export LANG=zh_CN.UTF-8" >> ~/.bashrc
pi@NanoPC-T6:/$ echo "export LANGUAGE=zh_CN.UTF-8" >> ~/.bashrc

使配置立即生效:

pi@NanoPC-T6:/$ source ~/.bashrc
-bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8): No such file or directory

根据上面登录警告提示可知,系统已经设置了默认地区_语言.字符集为zh_CN.UTF-8,但是在系统中没有定义对应的locale文件,
所以只需要手动生成这个locale文件即可。

查看系统所有可用的locale

pi@NanoPC-T6:/$ sudo locale -a
C
C.utf8
POSIX
zh_CN.utf8

但是看到zh_CN.utf8已经安装,因此我们忽略上面那个警告。

使用locale命令可以查询当前环境中所有的本地化信息,包括语言、字符集、货币格式等,具体操作如下:

pi@NanoPC-T6:/$ locale
LANG=zh_CN.UTF-8
LANGUAGE=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=zh_CN.UTF-8
7.3.2 安装中文输入法

Fcitx (Flexible Input Method Framework) :即小企鹅输入法,它是一个以GPL方式发布的输入法平台(即原来的G五笔),包括五笔、拼音(全拼和双拼)、二笔、区位等输入模块,支持简入繁出,是在Linux操作系统中常用的中文输入法。它的优点是,短小精悍、跟程序的兼容性比较好。

输入如下命令安装fcitx

pi@NanoPC-T6:/$ sudo aptitude install fcitx
pi@NanoPC-T6:/$ sudo aptitude install im-config
pi@NanoPC-T6:/$ sudo aptitude install fcitx-ui-classic fcitx-ui-light
pi@NanoPC-T6:/$ sudo aptitude install fcitx-frontend-gtk2 
pi@NanoPC-T6:/$ sudo aptitude install fcitx-frontend-gtk3

听说搜狗输入法很多Bug,还占性能。所以选择Google,终端输入以下:

pi@NanoPC-T6:/$ sudo apt install fcitx-googlepinyin

重启后,在桌面环境按Ctrl+Space即可切换中英文输入法, 右上角也出现了输入法图标,右击右上角的输入法图标,,在弹出菜单中可以切换输入法, 如下图所示:

7.4 测试OpenGL ES性能

glmark2是一款比较出名的GPU benchmark测试程序,支持OpenGL 2.0OpenGL ES 2.0

进入debain桌面环境打开命令行终端,输入以下命令即可测试:

pi@NanoPC-T6:/$ glmark2-es2
arm_release_ver: g13p0-01eac0, rk_so_ver: 10
=======================================================
    glmark2 2021.12
=======================================================
    OpenGL Information
    GL_VENDOR:      ARM
    GL_RENDERER:    Mali-G610
    GL_VERSION:     OpenGL ES 3.2 v1.g13p0-01eac0.a8b6f0c7e1f83c654c60d1775112dbe4
    Surface Config: buf=32 r=8 g=8 b=8 a=8 depth=24 stencil=0
    Surface Size:   800x600 windowed
=======================================================
[build] use-vbo=false: FPS: 1122 FrameTime: 0.891 ms
[build] use-vbo=true: FPS: 1191 FrameTime: 0.840 ms
[texture] texture-filter=nearest: FPS: 1189 FrameTime: 0.841 ms
[texture] texture-filter=linear: FPS: 1221 FrameTime: 0.819 ms
[texture] texture-filter=mipmap: FPS: 1210 FrameTime: 0.826 ms
[shading] shading=gouraud: FPS: 1124 FrameTime: 0.890 ms
[shading] shading=blinn-phong-inf: FPS: 1272 FrameTime: 0.786 ms
[shading] shading=phong: FPS: 1194 FrameTime: 0.838 ms
[shading] shading=cel: FPS: 1244 FrameTime: 0.804 ms
[bump] bump-render=high-poly: FPS: 852 FrameTime: 1.174 ms
[bump] bump-render=normals: FPS: 1426 FrameTime: 0.701 ms
[bump] bump-render=height: FPS: 1415 FrameTime: 0.707 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 1406 FrameTime: 0.711 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 1088 FrameTime: 0.919 ms
[pulsar] light=false:quads=5:texture=false: FPS: 1335 FrameTime: 0.749 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 640 FrameTime: 1.562 ms
[desktop] effect=shadow:windows=4: FPS: 1203 FrameTime: 0.831 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 278 FrameTime: 3.597 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 258 FrameTime: 3.876 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 485 FrameTime: 2.062 ms
[ideas] speed=duration: FPS: 713 FrameTime: 1.403 ms
[jellyfish] <default>: FPS: 1053 FrameTime: 0.950 ms
[terrain] <default>: FPS: 256 FrameTime: 3.906 ms
[shadow] <default>: FPS: 1207 FrameTime: 0.829 ms
[refract] <default>: FPS: 375 FrameTime: 2.667 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 1293 FrameTime: 0.773 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 1178 FrameTime: 0.849 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 1185 FrameTime: 0.844 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 1167 FrameTime: 0.857 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 1265 FrameTime: 0.791 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 1264 FrameTime: 0.791 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 1282 FrameTime: 0.780 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 1310 FrameTime: 0.763 ms
=======================================================
                                  glmark2 Score: 1051 
=======================================================

可以看到这个跑分比RK3399421高多了。

7.5 HDMI设置
7.5.1 设置HDMI/DP屏幕分辨率

进入桌面系统左上角菜单Settings -> Display界面进行设置即可;

7.5.2 设置HiDPI屏幕缩放

Xfce支持HiDPI缩放,可以使用设置管理器启用。

进入桌面系统左上角菜单Settings >Settings Manager >Appearance > Settings > Window Scaling,选择2作为缩放系数。

或者编辑文件~/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml

7.5.3 查看当前分辨率

在桌面系统打开终端,运行如下命令查看当前分辨率:

pi@NanoPC-T6:~$ xrandr -q
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1920x1080     60.00*+  60.00    50.00  
   1280x1024     60.02  
   1280x720      60.00  
   800x600       56.25  
   720x576       50.00  
   720x480       59.94    59.94  
HDMI-2 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
7.5.5 设置分辨率

如果要设置分辨率为1920x1080@60Hz,在桌面系统终端运行如下命令:

pi@NanoPC-T6:/$  xrandr --output HDMI-1 --mode 1920x1080 --refresh 60
7.5.6 设节HDMI输出边界

For example, the transformation scaling horizontal coordinates by 0.8, vertical coordinates by 1.04 and moving the screen by 35 pixels right and 19 pixels down:

pi@NanoPC-T6:/$ xrandr --output HDMI-1 --transform 0.80,0,-35,0,1.04,-19,0,0,1
7.5.7 开机自动调整

编辑~/.config/autostart/lxrandr-autostart.desktop,将完整的xrandr命令写入到Exec=开头的键中,如下所示:

[Desktop Entry]
Type=Application
Name=LXRandR autostart
Comment=Start xrandr with settings done in LXRandR
Exec=sh -c 'xrandr --output HDMI-1 --mode 1920x1080 --refresh 50 --transform 1.04,0,-35,0,1.05,-30,0,0,1'
7.6 chromium网页浏览器
7.6.1 GPU支持情况

系统预装的Chromium网页浏览器已经默认启用硬件加速,支持WebGL,可以通过输入网址chrome://gpu了解硬件加速情况,如下图所示:

7.6.2 VPU支持情况

在浏览器上播放一个视频,查看CPU的利用率:

然后在命令行使用fuser查看mpp设备节点的使用情况来确认已经调用了vpu:

pi@NanoPC-T6:~$ sudo fuser /dev/mpp_service
/dev/mpp_service:     1754

如果fuser命令没有内容输出, 则表示当前是软解。

7.6.3 查看支持的硬解格式

在浏览器地址栏输入about://gpu,翻页到页面最底部,查看 Video Acceleration Information表格;

播放一个视频后,再在浏览器地址栏输入about://media-internals,可以查看最近播放的视频是否启用了硬解;

7.7 测试mpp视频硬件编码

在桌面环境运行如下命令:

pi@NanoPC-T6:/$ sudo mpi_enc_test -w 1920 -h 1080 -t 7 -f 0 -o test.h264 -n 300
pi@NanoPC-T6:/$ export XDG_RUNTIME_DIR=/run/user/0
pi@NanoPC-T6:/$ sudo ffplay test.h264
Input #0, h264, from 'test.h264':  0KB vq=    0KB sq=    0B f=0/0   
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 30 fps, 30 tbr, 1200k tbn, 60 tbc
    nan M-V:    nan fd=  92 aq=    0KB vq=    0KB sq=    0B f=0/0
7.8 HDMI-IN的使用

找一台主机或者开发板,将其HDMI输出连接到NandPC-T6开发板HDMI-IN输入接口,这里我是将NandPC-T4开发板作为HDMI输出源。

7.8.1 使用脚本

debian集成了hdmirx_preview.sh测试脚本,直接运行该脚本即可,可以看到NandPC-T4开发板ubuntu的界面;

pi@NanoPC-T6:/$ hdmirx_preview.sh
HDMI-In info:
-------------------------
    device: /dev/video0
     width: 1920
     heigh: 1080
    format: BGR3

设置暂停管道 ...
管道正在实用且不需要 REBOOT ...
管道被 PREROLLED ...
设置播放管道 ...
New clock: GstAudioSrcClock
重新分配延迟时间...
重新分配延迟时间...
重新分配延迟时间...
^Chandling interrupt.
中断:中止管道 ...
Execution ended after 0:05:05.634882586
设置 NULL 管道 ...
Ctrl+C is captured

脚本路径:/usr/local/bin/hdmirx_preview.sh;源码如下:

#!/bin/bash

trap 'onCtrlC' INT
function onCtrlC () {
    echo 'Ctrl+C is captured'
    killall gst-launch-1.0
    exit 0
}

device_id=$(v4l2-ctl --list-devices | grep -A1 hdmirx | grep -v hdmirx | awk -F ' ' '{print $NF}')
v4l2-ctl -d $device_id --set-dv-bt-timings query 2>&1 > /dev/null
width=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active width" |awk -F ' ' '{print $NF}')
heigh=$(v4l2-ctl -d $device_id --get-dv-timings | grep "Active heigh" |awk -F ' ' '{print $NF}')
format=$(v4l2-ctl -d $device_id -V -D | grep "Pixel Format" | cut -d ':' -f 2 | cut -d "'" -f 2)
status=$(cat /sys/class/hdmirx/hdmirx/status)

if [ "$status" = "disconnected" ]; then
    echo "Please connect a device to the HDMI-IN port."
    exit 1
fi

echo "HDMI-In info:"
echo "-------------------------"
echo "    device: $device_id"
echo "     width: $width"
echo "     heigh: $heigh"
echo "    format: $format"
echo ""

rt5616_card=$(aplay -l | grep "rt5616" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmi0_card=$(aplay -l | grep "hdmi0" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmi1_card=$(aplay -l | grep "hdmi1" | cut -d ':' -f 1 | cut -d ' ' -f 2)
hdmiin_card=$(arecord -l | grep "hdmiin" | cut -d ":" -f 1 | cut -d ' ' -f 2)

[ -e /usr/lib/aarch64-linux-gnu/libGLdispatch.so.0 ] && \
        export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libGLdispatch.so.0:$LD_PRELOAD

case $format in
NV12)
    DISPLAY=:0.0 gst-launch-1.0 v4l2src device=${device_id} ! video/x-raw,format=${format},width=${width},height=${heigh},framerate=60/1 \
        ! queue ! xvimagesink 2>&1 > /dev/null &
    ;;
BGR3)
    DISPLAY=:0.0 gst-launch-1.0 v4l2src device=${device_id} ! video/x-raw,format=BGR,width=${width},height=${heigh},framerate=60/1 \
        ! queue ! glimagesink 2>&1 > /dev/null &
    ;;
*)
    echo "Warning: the pixel format is not NV12, possible poor performance."
    DISPLAY=:0.0 gst-launch-1.0 v4l2src device=${device_id} ! video/x-raw,format=${format},width=${width},height=${heigh},framerate=15/1 \
        ! videoconvert ! video/x-raw,width=${width},height=${heigh},format=NV12,framerate=15/1 ! queue ! xvimagesink 2>&1 > /dev/null &
    ;;
esac

gst-launch-1.0 alsasrc device=hw:${hdmiin_card},0 ! audioconvert ! audioresample ! queue \
    ! tee name=t ! queue ! alsasink device="hw:${hdmi0_card},0" \
    t. ! queue ! alsasink device="hw:${rt5616_card},0" &

while true
do
    sleep 10
done

请留意:只有NV12格式才能达到最佳性能,有关图像格式可以参考《linux驱动移植-USB摄像头采集图像实时显示(v4l2应用)》第四节。

7.8.2 使用V4L2命令

HDMI-IN设备的节点为:/dev/video0,可以通过v4l2的命令来操作它。

(1) 使用命令列出所有摄像头设备:

pi@NanoPC-T6:/$ v4l2-ctl --list-devices
rk_hdmirx (fdee0000.hdmirx-controller):
        /dev/video0

其中/dev/video0就是这个HDMI-IN的设备。

(2) 查看设备的预览支持格式:

pi@NanoPC-T6:/$ v4l2-ctl -d0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture Multiplanar

        [0]: 'BGR3' (24-bit BGR 8-8-8)
        [1]: 'NV24' (Y/UV 4:4:4)
        [2]: 'NV16' (Y/UV 4:2:2)
        [3]: 'NV12' (Y/UV 4:2:0)

(3) 查看设备的信息:

pi@NanoPC-T6:/$ v4l2-ctl -d /dev/video0  -V -D
Driver Info:
        Driver name      : rk_hdmirx
        Card type        : rk_hdmirx
        Bus info         : fdee0000.hdmirx-controller
        Driver version   : 6.1.25
        Capabilities     : 0x84201000
                Video Capture Multiplanar
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04201000
                Video Capture Multiplanar
                Streaming
                Extended Pix Format
Format Video Capture Multiplanar:
        Width/Height      : 1920/1080
        Pixel Format      : 'BGR3' (24-bit BGR 8-8-8)
        Field             : None
        Number of planes  : 1
        Flags             :
        Colorspace        : sRGB
        Transfer Function : Default
        YCbCr/HSV Encoding: Default
        Quantization      : Limited Range
        Plane 0           :
           Bytes per Line : 5760
           Size Image     : 6220800

(4) 查看当前连接的设备的分辨率与图像格式:

pi@NanoPC-T6:/$ v4l2-ctl -d /dev/video0 --get-fmt-video
Format Video Capture Multiplanar:
        Width/Height      : 1920/1080
        Pixel Format      : 'BGR3' (24-bit BGR 8-8-8)
        Field             : None
        Number of planes  : 1
        Flags             :
        Colorspace        : sRGB
        Transfer Function : Default
        YCbCr/HSV Encoding: Default
        Quantization      : Limited Range
        Plane 0           :
           Bytes per Line : 5760
           Size Image     : 6220800

(5) 使用v4l2-ctl抓一帧图片:

pi@NanoPC-T6:/$ v4l2-ctl  -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat='BGR3' --stream-mmap=4 --stream-skip=10  --stream-to=/home/pi/1080p_bgr24.yuv --stream-count=1 --stream-poll

其中:

  • -d: 摄像头对应设备文件;
  • --set-fmt-video:指定了帧宽高及pxielformat
  • --stream-mmap:指定buffer的类型为mmap(内存映射方式),即将内核空间的缓存映射到用户空间;
  • --stream-to:指定帧数据保存的文件路径;
  • --stream-skip:指定丢弃(不保存到文件)前10帧;
  • --stream-count:指定抓取的帧数,不包括--stream-skip丢弃的数量;

(6) 使用v4l2-ctl录制视频:

pi@NanoPC-T6:/$ v4l2-ctl  -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat='BGR3' --stream-mmap=4 --set-selection=target=crop,flags=0,top=0,left=0,width=1920,height=1080 --stream-to=/home/pi/video.yuv
7.8.3 ffplay

使用ffplay预览抓取的一帧图片,ffplayFFmpeg提供的一个极为简单的音视频媒体播放器(由ffmpeg库和SDL库开发),可以用于音视频播放、可视化分析 ,提供音视频显示和播放相关的图像信息、音频的波形等信息,也可以用作FFmpeg API的测试工具使用。

(1) 使用ffplay非常简单,只需在终端中运行以下命令来播放媒体文件:

pi@NanoPC-T6:/$ ffplay -f rawvideo -video_size 1920x1080 -pixel_format bgr24 /home/pi/1080p_bgr24.yuv
[rawvideo @ 0x7f10000bb0] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from '/home/pi/1080p_bgr8.yuv':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 1244160 kb/s
    Stream #0:0: Video: rawvideo (BGR[24] / 0x18524742), bgr24, 1920x1080, 1244160 kb/s, 25 tbr, 25 tbn, 25 tbc
   2.18 M-V:  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0

其中:

  • -video_size显示图片大小;
  • -pixel_format指定像素格式,非常重要,我这里的图片格式为BGR24

关于pix_fmt参数可以使用如下命令查看,并找到与图像对应的:

pi@NanoPC-T6:/$ ffmpeg -pix_fmts | grep bgr
Pixel formats:
I.... = Supported Input  format for conversion
.O... = Supported Output format for conversion
..H.. = Hardware accelerated format
...P. = Paletted format
....B = Bitstream format
FLAGS NAME            NB_COMPONENTS BITS_PER_PIXEL
IO... bgr24                  3            24
IO... bgr8                   3             8
.O..B bgr4                   3             4
IO... bgr4_byte              3             4
IO... abgr                   4            32
IO... bgra                   4            32
IO... bgr565be               3            16
IO... bgr565le               3            16
IO... bgr555be               3            15
IO... bgr555le               3            15
IO... bgr444le               3            12
IO... bgr444be               3            12
IO... bgr48be                3            48
IO... bgr48le                3            48
IO... bgra64be               4            64
IO... bgra64le               4            64
IO... 0bgr                   3            24
IO... bgr0                   3            24

显示效果如下:

(2) 使用ffplay播放录制的视频:

pi@NanoPC-T6:/$ ffplay -f rawvideo -video_size 1920x1080 -pixel_format bgr24 /home/pi/video.yuv
7.8.4 HDMI-IN音频

查看HDMI-IN音频设备

pi@NanoPC-T6:/$ cat /proc/asound/card*
cat: /proc/asound/card0: 是一个目录
cat: /proc/asound/card1: 是一个目录
cat: /proc/asound/card2: 是一个目录
cat: /proc/asound/card3: 是一个目录
cat: /proc/asound/card4: 是一个目录
 0 [rockchiphdmi0  ]: rockchip_hdmi0 - rockchip,hdmi0
                      rockchip,hdmi0
 1 [rockchipdp0    ]: rockchip_dp0 - rockchip,dp0
                      rockchip,dp0
 2 [rockchiphdmi1  ]: rockchip_hdmi1 - rockchip,hdmi1
                      rockchip,hdmi1
 3 [rockchiphdmiin ]: rockchip_hdmiin - rockchip,hdmiin
                      rockchip,hdmiin
 4 [realtekrt5616co]: simple-card - realtek,rt5616-codec
                      realtek,rt5616-codec

可以看到,rockchiphdmiin的声卡号为3。

录制音频(录制10秒):

pi@NanoPC-T6:/$ sudo arecord -D hw:3,0 -f cd /home/pi/test.wav -d 10

其中:

  • -D hw:3,0:指定录音使用的声卡设备;
  • -d:录音的持续时间,以秒为单位;
  • -f:录音的格式,可以根据实际情况选择;这里设置录制的音频格式为CD音质,即16比特、44.1kHz采样率;
  • test.wav:指定保存音频的文件名为 test.wav

回放所录制的音频(输出到HDMI-IN):

pi@NanoPC-T6:/$ sudo aplay /home/pi/test.wav -D 'hw:rockchiphdmiin'
7.8.5 使用GStreamer

GStreamer是一种多媒体框架,你可以使用它来构建自定义的多媒体应用程序,捕获摄像头视频,进行处理和展示。

你可以使用以下GStreamer管道捕获视频:

pi@NanoPC-T6:/$ DISPLAY=:0.0 gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=BGR,width=1920,height=1080,framerate=60/1 ! queue ! glimagesink

其中:

  • DISPLAY=:0.0DISPLAY 环境变量允许用户指定应用程序应在哪个显示和屏幕上运行,格式如 hostname:display.screen;在这个设置中,:0.0 表示X Window System中的第一个显示和第一个屏幕;
  • v4l2srcv4l2src 是一个GStreamer插件,用于从V4L2设备(比如摄像头、HDMI-IN)读取视频数据;
  • device=/dev/video0: 指定了要使用的设备文件路径;
  • video/x-raw:指定输出数据格式为原始视频,format参数设置为BGRwidth设置为1920height设置为1080framerate设置为60fps
  • queue:是一个GStreamer插件,用于在管道中创建一个缓冲区队列,以平衡数据流的处理速度;
  • glimagesink:是一个GStreamer插件,用于将视频数据显示在图形界面上;

实时捕获HDMI-IN(声卡3)音频,并通过声卡0、声卡4输出:

pi@NanoPC-T6:/$ gst-launch-1.0 alsasrc device=hw:3,0 ! audioconvert ! audioresample ! queue ! tee name=t ! queue ! alsasink device="hw:0,0" t. ! queue ! alsasink device="hw:4,0"

音视频录制:

pi@NanoPC-T6:/$ DISPLAY=:0.0 gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=BGR,width=1920,height=1080,framerate=60/1 ! queue ! mpph265enc ! h265parse ! queue ! mux. alsasrc device=hw:3,0 ! audio/x-raw,channels=2 ! audioconvert ! voaacenc ! queue ! mux. matroskamux name=mux ! filesink location=/home/pi/1080p60.mkv

参考文章:

[1] Rockchip RK3399 - 移植uboot 2017.09 & linux 4.19(友善之家脚本方式)

[2] NanoPC-T6开发手册

[3] gcc/c++ 版本不一致问题导致的

[4] 软件包:gcc-12(12.3.0-12 以及其他的)

[5] ArmSom--摄像头开发指南(二)

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Rockchip RK3566是一款由Rockchip推出的高性能应用处理器,其集成了四核ARM Cortex-A55 CPU和ARM Mali-G52 GPU。在移植U-Boot 2023.04时,我们需要考虑以下几个方面的工作: 1. 了解RK3566芯片的硬件架构和技术规格,包括处理器核心、内存控制器、外设接口等。这将有助于理解U-Boot如何与硬件交互,并进行相应的配置。 2. 下载并准备U-Boot 2023.04的源代码。在Rockchip官方网站或开源社区中可以找到最新的U-Boot源代码。将其下载并解压到开发机上。 3. 设置交叉编译环境。因为U-Boot是一个跨平台的项目,所以需要配置适合RK3566的交叉编译器,确保能够正确编译U-Boot源代码。 4. 配置U-Boot。根据RK3566的硬件架构和技术规格,需要进行相应的配置,包括处理器、内存、外设等设置。这些设置在U-Boot的配置文件中进行,可以根据需求进行修改。 5. 编译U-Boot。在配置好U-Boot后,使用交叉编译器编译U-Boot源代码。编译完成后,将生成的U-Boot二进制文件烧录到RK3566的启动设备上,如eMMC或SD卡。 6. 测试U-Boot。将准备好的启动设备插入RK3566开发板中,根据开发板的启动方式,进入U-Boot命令行界面。在命令行界面中可以进行各种操作和调试,如加载内核、启动操作系统等。 7. 调试和优化。在移植和测试U-Boot过程中,可能会出现一些问题和不稳定的情况。需要通过调试和优化来解决这些问题,确保U-Boot的正常运行和稳定性。 总之,移植U-Boot 2023.04到Rockchip RK3566需要了解芯片的硬件架构和技术规格,配置和编译U-Boot源代码,进行测试和调试。这样可以确保U-Boot能够与RK3566正常交互,并为后续的操作系统加载和启动提供基础支持。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Graceful_scenery

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值