feat: M3 complete — WiFi, BT keyboard and mouse

Bluetooth (RTL8723D USB combo chip):
- GPIO pin 357 (active low) enables WiFi/BT hardware via x6200_gpio_set()
- bluez5_utils 5.64 (downgraded from 5.79 — HID input plugin broken in 5.79)
- rtl8723d_config.bin added to overlay (missing from linux-firmware package)
- S45wifi-bt: GPIO enable + modprobe btusb/uhid/hidp at boot
- S85bt-keyboard: auto-connect loop with scan+connect every 20s

WiFi (RTL8723DU):
- out-of-tree lwfinger/rtw88 driver (RTW88_8723DU not in kernel 6.1 mainline)
- linux-firmware RTL_RTW88 for rtw88/rtw8723d_fw.bin
- regulatory.db for cfg80211
- wpa_supplicant with multi-network config in /etc/wpa_supplicant.conf
- S46wifi: wpa_supplicant + udhcpc at boot

Key findings:
- RTL8723D USB WiFi (0bda:d723) requires out-of-tree rtw88 on kernel 6.1
- BT and WiFi share same USB device, both need GPIO 357 = 0 to power on
- bluez5 5.79 HID input plugin not linked into bluetoothd (build system bug)
This commit is contained in:
Joakim
2026-05-09 21:02:53 +02:00
parent e67ff6c019
commit 2526d5b087
19 changed files with 964 additions and 16 deletions

View File

@@ -0,0 +1,45 @@
#!/bin/sh
# S45wifi-bt — aktiverar WiFi/BT-chipet (RTL8723D) via GPIO
#
# X6200:s WiFi/BT-chip är avstängt vid boot och måste aktiveras
# via GPIO pin 357 (active low) innan kernel-drivern kan använda det.
#
# Måste köras innan S40bluetoothd startar.
case "$1" in
start)
echo "Starting WiFi/BT hardware"
python3 - << 'PYEOF'
import ctypes
lib = ctypes.CDLL("libaether_x6200_control.so")
lib.x6200_gpio_init.restype = ctypes.c_bool
lib.x6200_gpio_set.argtypes = [ctypes.c_int, ctypes.c_int]
lib.x6200_gpio_init()
lib.x6200_gpio_set(357, 0) # active low — 0 = ON
PYEOF
sleep 1
modprobe btusb
modprobe uhid
modprobe hidp
sleep 3
echo "OK"
;;
stop)
python3 - << 'PYEOF'
import ctypes
lib = ctypes.CDLL("libaether_x6200_control.so")
lib.x6200_gpio_init.restype = ctypes.c_bool
lib.x6200_gpio_set.argtypes = [ctypes.c_int, ctypes.c_int]
lib.x6200_gpio_init()
lib.x6200_gpio_set(357, 1) # 1 = OFF
PYEOF
echo "WiFi/BT hardware stopped"
;;
restart)
$0 stop; sleep 1; $0 start
;;
*)
echo "Usage: $0 {start|stop|restart}" >&2
exit 1
;;
esac