From 961560515de9579968b4abac610ad23b4ce3b7ce Mon Sep 17 00:00:00 2001 From: Lane Jennison Date: Thu, 20 Jul 2023 00:33:49 +0000 Subject: [PATCH 1/2] add indiedroid nova board config. update rk3588 BSP kernel to enable r8169 driver for ethernets and RTL8821CS for wifi --- config/boards/indiedroid-nova.csc | 81 ++++++++++++++++++++++++ config/kernel/linux-rk35xx-legacy.config | 16 +---- 2 files changed, 84 insertions(+), 13 deletions(-) create mode 100644 config/boards/indiedroid-nova.csc diff --git a/config/boards/indiedroid-nova.csc b/config/boards/indiedroid-nova.csc new file mode 100644 index 000000000000..7e58bb45a96d --- /dev/null +++ b/config/boards/indiedroid-nova.csc @@ -0,0 +1,81 @@ +# Rockchip RK3588S octa core 4/8/16GB RAM SoC eMMC USB3 USB-C GbE +BOARD_NAME="Indiedroid Nova" +BOARDFAMILY="rockchip-rk3588" +BOOTCONFIG="indiedroid_defconfig" # vendor name, not standard, see hook below, set BOOT_SOC below to compensate +BOOT_SOC="rk3588" +KERNEL_TARGET="legacy,collabora,edge" +FULL_DESKTOP="yes" +BOOT_LOGO="desktop" +BOOT_FDT_FILE="rockchip/rk3588s-indiedroid-nova.dtb" +BOOT_SCENARIO="spl-blobs" +BOOT_SUPPORT_SPI="yes" +IMAGE_PARTITION_TABLE="gpt" +SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes +BOOTFS_TYPE="fat" +SRC_EXTLINUX="no" # going back to standard uboot for now + +## only applies to extlinux so not used +SRC_CMDLINE="console=ttyS0,115200n8 console=tty1 console=both net.ifnames=0 rootflags=data=writeback" + + +# Override family config for this board; let's avoid conditionals in family config. +function post_family_config__indiedroid-nova_use_stvhay_uboot() { + BOOTSOURCE='https://github.com/stvhay/u-boot.git' + BOOTBRANCH='branch:rockchip-rk3588-unified' + BOOTPATCHDIR="legacy" +} + +# BSP kernel uses device name from contract manufacturer rather than production name in mainline +function post_family_config_branch_legacy__use_9tripod_dtb() { + + declare -g BOOT_FDT_FILE="rockchip/rk3588s-9tripod-linux.dtb" + +} + +# Add bluetooth packages to the image (not rootfs cache) +function post_family_config__bluetooth_hciattach_add_bluetooth_packages() { + display_alert "${BOARD}" "adding bluetooth packages to image" "info" + add_packages_to_image rfkill bluetooth bluez bluez-tools +} + +# setup bluetooth stuff +function pre_customize_image__indiedroid_add_bluetooth() { + display_alert "${BOARD}" "install bluetooth firmware" "info" + local TMPDIR + + # Build firmware + TMPDIR=$(mktemp -d) + pushd "${TMPDIR}" || exit 1 + git clone https://github.com/stvhay/rkwifibt || exit 1 + cd rkwifibt || exit 1 + make -C realtek/rtk_hciattach || exit 1 + # Install the firmware and utility + mkdir -p "${SDCARD}/lib/firmware/rtl_bt" + cp -fr realtek/RTL8821CS/* "${SDCARD}/lib/firmware/rtl_bt/" + cp -f realtek/rtk_hciattach/rtk_hciattach "${SDCARD}/usr/bin/" + cp -f bt_load_rtk_firmware "${SDCARD}/usr/bin/" + chroot_sdcard chmod +x /usr/bin/{rtk_hciattach,bt_load_rtk_firmware} + echo hci_uart >> "${SDCARD}/etc/modules" + popd || exit 1 + + #TODO this should probably be replaced with the existing extensions/bluetooth-hciattach.sh + + display_alert "${BOARD}" "setup bluetooth service" "info" + # Systemd service + cat > "${SDCARD}/etc/systemd/system/bluetooth-rtl8821cs.service" <<- EOD + [Unit] + Description=RTL8821CS Firmware Service + After=network.target + + [Service] + Type=oneshot + Environment=BT_TTY_DEV=/dev/ttyS9 + ExecStart=/usr/bin/bt_load_rtk_firmware + RemainAfterExit=true + StandardOutput=journal + + [Install] + WantedBy=multi-user.target + EOD + chroot_sdcard systemctl enable bluetooth-rtl8821cs.service +} diff --git a/config/kernel/linux-rk35xx-legacy.config b/config/kernel/linux-rk35xx-legacy.config index 939c765d5bc2..17b3faa3c389 100644 --- a/config/kernel/linux-rk35xx-legacy.config +++ b/config/kernel/linux-rk35xx-legacy.config @@ -2529,8 +2529,8 @@ CONFIG_IONIC=y CONFIG_NET_VENDOR_REALTEK=y # CONFIG_8139CP is not set # CONFIG_8139TOO is not set -# CONFIG_R8168 is not set -# CONFIG_R8169 is not set +CONFIG_R8168=m +CONFIG_R8169=m CONFIG_R8125=y CONFIG_REALTEK_PGTOOL=m # CONFIG_NET_VENDOR_RENESAS is not set @@ -2882,16 +2882,6 @@ CONFIG_WLAN_VENDOR_TI=y # CONFIG_WL12XX is not set # CONFIG_WL18XX is not set # CONFIG_WLCORE is not set -CONFIG_RTL8822BS=m -CONFIG_RTL8723DU=m -CONFIG_RTL8723DS=m -CONFIG_RTL8822BU=m -CONFIG_RTL8188EU=m -CONFIG_RTL8821CU=m -CONFIG_88XXAU=m -CONFIG_RTL8192EU=m -# CONFIG_RTL8189FS is not set -CONFIG_RTL8189ES=m CONFIG_WLAN_VENDOR_ZYDAS=y CONFIG_USB_ZD1201=m # CONFIG_ZD1211RW is not set @@ -2912,7 +2902,7 @@ CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/ap6275p/nvram.txt" # CONFIG_INFINEON_DHD is not set CONFIG_RTL8852BE=m CONFIG_RTL8852BU=m -# CONFIG_RTL8821CS is not set +CONFIG_RTL8821CS=m # CONFIG_MAC80211_HWSIM is not set CONFIG_USB_NET_RNDIS_WLAN=y # CONFIG_VIRT_WIFI is not set From 4970bb90b4afd352fbbc80edce524cf4c638fa1e Mon Sep 17 00:00:00 2001 From: Lane Jennison Date: Thu, 20 Jul 2023 12:25:10 +0000 Subject: [PATCH 2/2] re-add extra wifi modules to rk3588 legacy config --- config/kernel/linux-rk35xx-legacy.config | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/kernel/linux-rk35xx-legacy.config b/config/kernel/linux-rk35xx-legacy.config index 17b3faa3c389..6a1a1f6889e8 100644 --- a/config/kernel/linux-rk35xx-legacy.config +++ b/config/kernel/linux-rk35xx-legacy.config @@ -2882,6 +2882,16 @@ CONFIG_WLAN_VENDOR_TI=y # CONFIG_WL12XX is not set # CONFIG_WL18XX is not set # CONFIG_WLCORE is not set +CONFIG_RTL8822BS=m +CONFIG_RTL8723DU=m +CONFIG_RTL8723DS=m +CONFIG_RTL8822BU=m +CONFIG_RTL8188EU=m +CONFIG_RTL8821CU=m +CONFIG_88XXAU=m +CONFIG_RTL8192EU=m +# CONFIG_RTL8189FS is not set +CONFIG_RTL8189ES=m CONFIG_WLAN_VENDOR_ZYDAS=y CONFIG_USB_ZD1201=m # CONFIG_ZD1211RW is not set