Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSC Board Indiedroid Nova #5493

Merged
merged 3 commits into from Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
81 changes: 81 additions & 0 deletions 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
}
6 changes: 3 additions & 3 deletions config/kernel/linux-rk35xx-legacy.config
Expand Up @@ -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
Expand Down Expand Up @@ -2912,7 +2912,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
Expand Down