Who here was able to enable wifi and serial debug console for their (Ubuntu) kernel 5.x update, for example 5.8? Are there any modifications needed for this in rock960’s https://github.com/96rocks/kernel/blob/release-4.4/arch/arm64/configs/rockchip_linux_defconfig?
BTW, here is a script I’ve written to compile a new kernel update unattended, in case someone else finds it useful.
The mk-image.sh
patch reduces the size of boot.img to 112MB so it doesn’t overrun the existing size for mmcblk1p4 in Ubuntu (the version in master uses 500MB for size) - the output file can be written directly with rkdeveloptool wl 32768 boot.img
without overwriting the next partition on disk.
cat compile_rock960.sh
#!/bin/bash
LINUX_VERSION=${1:-5.8}
BASE_DIR=`readlink -f ${2:-.}`
echo "Using: ${LINUX_VERSION} into ${BASE_DIR}"
CURR_DIR=${PWD}
WORK_DIR=${BASE_DIR}/rock960_${LINUX_VERSION}
OUT_DIR=${WORK_DIR}/out
mkdir -p ${WORK_DIR}
mkdir -p ${OUT_DIR}
cd ${WORK_DIR}
sudo apt update
sudo apt-get install -y build-essential git libncurses5-dev libssl-dev make
sudo apt-get install -y bison device-tree-compiler flex gcc-arm-none-eabi mtools python
sudo apt-get remove -y apt-listchanges
sudo apt-get install -y zlib1g:i386
export ARCH=arm64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib/x86_64-linux-gnu
wget http://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz
mkdir ${WORK_DIR}/toolchain
tar -xf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.xz -C ${WORK_DIR}/toolchain --strip-components=1
git clone --depth 1 https://github.com/ARM-software/arm-trusted-firmware.git
export CROSS_COMPILE=${WORK_DIR}/toolchain/bin/aarch64-linux-gnu-
cd ${WORK_DIR}/arm-trusted-firmware/
make CROSS_COMPILE=${WORK_DIR}/toolchain/bin/aarch64-linux-gnu- PLAT=rk3399
cd ${WORK_DIR}
git clone --branch release-4.4-rock960 --depth 1 https://github.com/96rocks/kernel.git
cd ${WORK_DIR}/kernel
make rockchip_linux_defconfig
make Image dtbs -j$(nproc)
ls -l ${WORK_DIR}/kernel/arch/arm64/boot/dts/rockchip/rock960-model-ab-linux.dtb
cp ${WORK_DIR}/kernel/arch/arm64/boot/dts/rockchip/rock960-model-ab-linux.dtb ${OUT_DIR}/.
cd ${WORK_DIR}
git clone --depth 1 https://github.com/96rocks/build.git
mkdir -p ${WORK_DIR}/out/kernel && cd ${WORK_DIR}/out/kernel
cp ${WORK_DIR}/kernel/arch/arm64/boot/Image .
cd ${WORK_DIR}/build
patch -p0 < ${CURR_DIR}/mk-image.sh.patch
cd ${WORK_DIR}
./build/mk-image.sh -c rk3399 -t boot
ls -l ${WORK_DIR}/kernel/arch/arm64/boot/Image
ls -l ${WORK_DIR}/out/boot.img
ls -l ${WORK_DIR}/kernel/arch/arm64/boot/dts/rockchip/rock960-model-ab-linux.dtb
cp ${WORK_DIR}/kernel/arch/arm64/boot/Image ${OUT_DIR}/Image.96rocks
cp ${WORK_DIR}/kernel/arch/arm64/boot/dts/rockchip/rock960-model-ab-linux.dtb ${OUT_DIR}/.
cd ${WORK_DIR}
git clone --depth 1 https://gitlab.denx.de/u-boot/u-boot.git
cd ${WORK_DIR}/u-boot
export BL31=${WORK_DIR}/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
make ARCH=arm64 rock960-rk3399_defconfig
make CROSS_COMPILE=${WORK_DIR}/toolchain/bin/aarch64-linux-gnu-
ls -l ${WORK_DIR}/u-boot/idbloader.img
ls -l ${WORK_DIR}/u-boot/u-boot-rockchip.bin
ls -l ${WORK_DIR}/u-boot/u-boot.itb
cp ${WORK_DIR}/u-boot/idbloader.img ${OUT_DIR}/.
cp ${WORK_DIR}/u-boot/u-boot-rockchip.bin ${OUT_DIR}/.
cp ${WORK_DIR}/u-boot/u-boot.itb ${OUT_DIR}/.
cd ${WORK_DIR}
git clone --branch linux-${LINUX_VERSION}.y --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
cp ${WORK_DIR}/kernel/arch/arm/configs/rockchip_linux_defconfig ${WORK_DIR}/linux/arch/arm/configs/rockchip_linux_defconfig
cp ${WORK_DIR}/kernel/arch/arm64/configs/rockchip_linux_defconfig ${WORK_DIR}/linux/arch/arm64/configs/rockchip_linux_defconfig
cd ${WORK_DIR}/linux
patch -p0 < ${CURR_DIR}/rockchip_linux_defconfig.patch
make ARCH=arm64 rockchip_linux_defconfig
make ARCH=arm64 CROSS_COMPILE=${WORK_DIR}/toolchain/bin/aarch64-linux-gnu- -j$(nproc)
ls -l ${WORK_DIR}/linux/arch/arm64/boot/Image
ls -l ${WORK_DIR}/linux/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtb
cp ${WORK_DIR}/linux/arch/arm64/boot/Image ${OUT_DIR}/.
cp ${WORK_DIR}/linux/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtb ${OUT_DIR}/.
cat mk-image.sh.patch
diff --git mk-image.sh mk-image.sh
index 0ff6055..afb5c5e 100755
--- mk-image.sh
+++ mk-image.sh
@@ -54,7 +54,10 @@ generate_boot_image() {
echo -e "\e[36m Generate Boot image start\e[0m"
# 500Mb
- mkfs.vfat -n "boot" -S 512 -C ${BOOT} $((500 * 1024))
+ # mkfs.vfat -n "boot" -S 512 -C ${BOOT} $((500 * 1024))
+
+ # 112Mb
+ mkfs.vfat -n "boot" -S 512 -C ${BOOT} $((112 * 1024))
mmd -i ${BOOT} ::/extlinux
mcopy -i ${BOOT} -s ${EXTLINUXPATH}/${CHIP}.conf ::/extlinux/extlinux.conf
cat rockchip_linux_defconfig.patch
--- arch/arm64/configs/rockchip_linux_defconfig 2021-02-28 12:30:52.232068920 -0800
+++ arch/arm64/configs/rockchip_linux_defconfig 2021-02-28 12:31:36.212170628 -0800
@@ -148,9 +148,9 @@
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CONNTRACK_TIMEOUT=y
CONFIG_NF_CONNTRACK_TIMESTAMP=y
-CONFIG_NF_CT_PROTO_DCCP=m
-CONFIG_NF_CT_PROTO_SCTP=m
-CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CT_PROTO_DCCP=y
+CONFIG_NF_CT_PROTO_SCTP=y
+CONFIG_NF_CT_PROTO_UDPLITE=y
CONFIG_NF_CONNTRACK_AMANDA=m
CONFIG_NF_CONNTRACK_FTP=m
CONFIG_NF_CONNTRACK_H323=m
@@ -164,8 +164,8 @@
CONFIG_NF_CT_NETLINK=m
CONFIG_NF_CT_NETLINK_TIMEOUT=m
CONFIG_NF_TABLES=m
-CONFIG_NF_TABLES_INET=m
-CONFIG_NF_TABLES_NETDEV=m
+CONFIG_NF_TABLES_INET=y
+CONFIG_NF_TABLES_NETDEV=y
CONFIG_NFT_EXTHDR=m
CONFIG_NFT_META=m
CONFIG_NFT_CT=m
@@ -285,7 +285,7 @@
CONFIG_NF_CONNTRACK_IPV4=m
CONFIG_NFT_CHAIN_ROUTE_IPV4=m
CONFIG_NFT_DUP_IPV4=m
-CONFIG_NF_TABLES_ARP=m
+CONFIG_NF_TABLES_ARP=y
CONFIG_NF_LOG_ARP=m
CONFIG_NFT_CHAIN_NAT_IPV4=m
CONFIG_NFT_MASQ_IPV4=m
@@ -767,7 +767,7 @@
CONFIG_MEDIA_CEC_SUPPORT=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_VIDEO_V4L2_SUBDEV_API=y
-CONFIG_LIRC=m
+CONFIG_LIRC=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
# CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV is not set