board: add Torder R10D support

Enable community vendor-kernel images for the RK3566 tablet.

Requires R10D device-tree and camera support in the vendor kernel.

Signed-off-by: JasonYANG170 <39414350+JasonYANG170@users.noreply.github.com>
This commit is contained in:
JasonYANG170 2026-11-02 03:09:52 +08:00 • committed by Igor
parent b7e1a60f64
commit 9e58e25341
11 changed files with 198 additions and 1 deletions

View file

@ -0,0 +1,68 @@
# Rockchip RK3566 tablet 4GB LPDDR3 32GB eMMC 800x1280 DSI UWE5621DS Wi-Fi/BT
BOARD_NAME="R10D"
BOARD_VENDOR="torder"
BOARDFAMILY="rk35xx"
BOARD_MAINTAINER="JasonYANG170"
INTRODUCED="2022"
BOOTCONFIG="generic-rk3568_defconfig"
BOOT_SOC="rk3566"
KERNEL_TARGET="vendor"
KERNEL_TEST_TARGET="vendor"
FULL_DESKTOP="yes"
POWER_MANAGEMENT_FEATURES="yes"
BOOT_FDT_FILE="rockchip/rk3566-torder-r10d.dtb"
IMAGE_PARTITION_TABLE="gpt"
BOOT_SCENARIO="binman"
SERIALCON="ttyFIQ0:1500000"
PACKAGE_LIST_BOARD="bluez rfkill iproute2"
MODULES_VENDOR="sprdwl_ng sprdbt_tty sc7a20 gsl3673-800x1280"
function post_family_config__torder_r10d() {
declare -g BOOTSOURCE="https://github.com/u-boot/u-boot.git"
declare -g BOOTBRANCH="tag:v2025.10"
declare -g BOOTPATCHDIR="v2025.10/board_torder-r10d"
declare -g BOOTDELAY=1
declare -g BOOTENV_FILE="torder-r10d.txt"
declare -g DDR_BLOB="rk35/rk3568_ddr_1056MHz_v1.10.bin"
declare -g UBOOT_TARGET_MAP="BL31=${SRC}/cache/sources/rkbin-r10d/3e288fe814e059dd06833495f845cab04ac20a5c/bin/rk35/rk3568_bl31_v1.46.elf ROCKCHIP_TPL=ddr-r10d.bin;;u-boot-rockchip.bin"
}
function custom_kernel_config__torder_r10d() {
opts_y+=(SPARD_WLAN_SUPPORT WCN_BSP_DRIVER_BUILDIN VIDEO_GC02M0 DRM_PANEL_SIMPLE BACKLIGHT_PWM FB DRM_FBDEV_EMULATION FRAMEBUFFER_CONSOLE FRAMEBUFFER_CONSOLE_DETECT_PRIMARY)
opts_m+=(WLAN_UWE5622 TTY_OVERY_SDIO GS_SC7A20 TOUCHSCREEN_GSL3673_800X1280 DRM_PANFROST)
opts_n+=(MALI400 MALI_MIDGARD MALI_BIFROST)
}
function post_family_tweaks_bsp__torder_r10d() {
: "${destination:?}"
install -d "${destination}/usr/bin" "${destination}/usr/lib/systemd/system" "${destination}/etc/udev/rules.d"
install -m 644 "${SRC}/packages/bsp/rockchip/60-media.rules" "${destination}/etc/udev/rules.d/"
install -m 755 "${SRC}/packages/bsp/rk3399/hciattach_opi" "${destination}/usr/bin/"
install -m 755 "${SRC}/packages/bsp/torder-r10d/torder-r10d-bluetooth" "${destination}/usr/bin/"
install -m 755 "${SRC}/packages/bsp/torder-r10d/torder-r10d-wifi-address" "${destination}/usr/bin/"
install -m 644 "${SRC}/packages/bsp/torder-r10d/70-torder-r10d-wifi.rules" "${destination}/etc/udev/rules.d/"
install -d "${destination}/usr/lib/firmware"
ln -s "uwe5621ds/wifi_56630001_3ant.ini" "${destination}/usr/lib/firmware/wifi_56630001_3ant.ini"
install -m 644 "${SRC}/packages/bsp/torder-r10d/torder-r10d-bluetooth.service" "${destination}/usr/lib/systemd/system/"
install -m 755 "${SRC}/packages/bsp/torder-r10d/torder-r10d-bluetooth-sleep" "${destination}/usr/bin/"
install -m 644 "${SRC}/packages/bsp/torder-r10d/torder-r10d-bluetooth-sleep.service" "${destination}/usr/lib/systemd/system/"
install -d "${destination}/etc/systemd/sleep.conf.d"
install -m 644 "${SRC}/packages/bsp/torder-r10d/torder-r10d-sleep.conf" "${destination}/etc/systemd/sleep.conf.d/90-torder-r10d.conf"
}
function post_family_tweaks__torder_r10d() {
chroot_sdcard systemctl --no-reload enable torder-r10d-bluetooth.service torder-r10d-bluetooth-sleep.service
}
function fetch_sources_tools__torder_r10d_ddr() {
fetch_from_repo "https://github.com/rockchip-linux/rkbin" "rkbin-r10d" "commit:3e288fe814e059dd06833495f845cab04ac20a5c" "yes"
}
function post_config_uboot_target__torder_r10d_ddr() {
local rkbin="${SRC}/cache/sources/rkbin-r10d/3e288fe814e059dd06833495f845cab04ac20a5c"
cp "${RKBIN_DIR}/${DDR_BLOB}" ddr-r10d.bin
cp "${rkbin}/tools/ddrbin_param.txt" ddr-r10d-param.txt
sed -i 's/^lp3_freq=.*/lp3_freq=780/' ddr-r10d-param.txt
run_host_command_logged python3 "${rkbin}/tools/ddrbin_tool.py" rk356x ddr-r10d-param.txt ddr-r10d.bin "--ver_edit= "
echo "703a40bf8ae66fa4a733e4f61e6fde2c1a59a3be10ad960626bb6befa635b881 ddr-r10d.bin" | sha256sum -c -
}

View file

@ -0,0 +1,7 @@
verbosity=1
bootlogo=false
console=both
serialcon=ttyFIQ0
initrd_high=0xffffffffffffffff
fdt_high=0xffffffffffffffff
extraargs=cma=256M

View file

@ -13,6 +13,7 @@ setenv bootlogo "false"
setenv rootfstype "ext4"
setenv docker_optimizations "on"
setenv earlycon "off"
setenv serialcon "ttyS2"
test -n "${distro_bootpart}" || distro_bootpart=1
@ -31,7 +32,7 @@ fi
if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi
if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=ttyS2,1500000 ${consoleargs}"; fi
if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=${serialcon},1500000 ${consoleargs}"; fi
if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi
if test "${bootlogo}" = "true"; then
setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}"

View file

@ -0,0 +1 @@
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="unisoc_wifi", RUN+="/usr/bin/torder-r10d-wifi-address %k"

View file

@ -0,0 +1,23 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
set -e
modprobe sprdbt_tty
rfkill unblock bluetooth
if [[ ! -r /sys/class/net/wlan0/address ]]; then
echo "Wi-Fi address is unavailable; retry Bluetooth initialization later." >&2
exit 1
fi
mac_file=/var/lib/bluetooth/torder-r10d-address
if [[ ! -s "${mac_file}" ]]; then
install -d -m 700 /var/lib/bluetooth
hash=$(printf '%s' "$(cat /etc/machine-id)-bt" | sha256sum)
printf '02:%s:%s:%s:%s:%s\n' "${hash:2:2}" "${hash:4:2}" "${hash:6:2}" "${hash:8:2}" "${hash:10:2}" >"${mac_file}"
fi
read -r address <"${mac_file}"
[[ "${address}" =~ ^([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}$ ]]
# The helper derives its controller address from this service-local file.
mount --bind --read-only "${mac_file}" /sys/class/net/wlan0/address
exec /usr/bin/hciattach_opi -n -s 1500000 /dev/ttyBT0 sprd 1500000 flow "${address}"

View file

@ -0,0 +1,37 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
set -eu
state=/run/torder-r10d-bluetooth-sleep
case "${1:-}" in
pre)
if systemctl is-active --quiet torder-r10d-bluetooth.service; then
bluetoothctl show 2>/dev/null | awk '/Powered:/ {print $2}' >"$state"
test -s "$state" || printf 'no\n' >"$state"
systemctl stop torder-r10d-bluetooth.service
rfkill block bluetooth
fi
;;
post)
if test -f "$state"; then
powered=$(cat "$state")
systemctl start torder-r10d-bluetooth.service
for n in $(seq 1 30); do
bluetoothctl list | grep -q Controller && break
sleep 0.2
done
restored=no
for n in $(seq 1 40); do
current=$(bluetoothctl show 2>/dev/null | awk '/Powered:/ {print $2}')
if test "$current" = "$powered"; then
restored=yes
break
fi
if test "$powered" = yes; then bluetoothctl power on || true; else bluetoothctl power off || true; fi
sleep 0.2
done
test "$restored" = yes
rm -f "$state"
fi
;;
*) exit 2 ;;
esac

View file

@ -0,0 +1,15 @@
[Unit]
Description=Quiesce Torder R10D Bluetooth during system sleep
Before=sleep.target
StopWhenUnneeded=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/torder-r10d-bluetooth-sleep pre
ExecStop=/usr/bin/torder-r10d-bluetooth-sleep post
TimeoutStartSec=20
TimeoutStopSec=20
[Install]
WantedBy=sleep.target

View file

@ -0,0 +1,17 @@
[Unit]
Description=Torder R10D Bluetooth
After=systemd-modules-load.service
Before=bluetooth.service
ConditionPathExists=/proc/device-tree/uwe-bsp
[Service]
Type=simple
PrivateMounts=yes
BindReadOnlyPaths=/lib/firmware/uwe5621ds/bt_configure_rf_marlin3e_3.ini:/lib/firmware/bt_configure_rf.ini
BindReadOnlyPaths=/lib/firmware/uwe5621ds/bt_configure_pskey.ini:/lib/firmware/bt_configure_pskey.ini
ExecStart=/usr/bin/torder-r10d-bluetooth
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,5 @@
[Sleep]
AllowSuspend=yes
AllowHibernation=no
AllowHybridSleep=no
AllowSuspendThenHibernate=no

View file

@ -0,0 +1,11 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
set -eu
interface=${1:?}
address=$(cat "/sys/class/net/${interface}/address")
[[ "${address}" == "00:00:00:00:00:00" ]] || exit 0
hash=$(printf '%s-wifi' "$(cat /etc/machine-id)" | sha256sum)
printf -v address '02:%s:%s:%s:%s:%s' "${hash:0:2}" "${hash:2:2}" "${hash:4:2}" "${hash:6:2}" "${hash:8:2}"
exec ip link set dev "${interface}" address "${address}"

View file

@ -0,0 +1,12 @@
diff --git a/configs/generic-rk3568_defconfig b/configs/generic-rk3568_defconfig
--- a/configs/generic-rk3568_defconfig
+++ b/configs/generic-rk3568_defconfig
@@ -20,7 +20,7 @@
CONFIG_SPL_LOAD_FIT=y
# CONFIG_BOOTMETH_VBE is not set
CONFIG_LEGACY_IMAGE_FORMAT=y
-CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-generic.dtb"
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3566-torder-r10d.dtb"
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_SPL_MAX_SIZE=0x40000
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set