From a1743ae5cc4debd5842ce0a13fed46530ad38433 Mon Sep 17 00:00:00 2001 From: Satoshi Ikeuchi Date: Sun, 4 Oct 2026 11:51:23 +0900 Subject: [PATCH] qualcommbe: add Bluetooth support for Linksys LN6001 Enable the Bluetooth UART and pin configuration for Linksys Velop WRT Pro 7 (LN6001/MBE70). Describe the ISP and reset outputs through the existing named GPIO export mechanism, holding both high at boot. Select the generic bluetooth-uart package in DEVICE_PACKAGES so images include kmod-hci-uart and BlueZ btattach through its dependencies. Initialize the LN6001 UCI defaults to attach /dev/ttyMSM1 using H4 at 115200 baud. Preserve already configured UARTs, including disabled ones. The generic package remains disabled until a board or user configures it. The combined series passed cold-start controller initialization, LE discovery, connection and service discovery without a userspace reset pulse. Keep Bluetooth support separate from Wi-Fi enablement. Signed-off-by: Satoshi Ikeuchi Link: https://github.com/openwrt/openwrt/pull/25594 Signed-off-by: Robert Marko --- .../qualcommbe/dts/ipq9554-linksys-ln6001.dts | 37 +++++++++++++++++++ target/linux/qualcommbe/image/ipq95xx.mk | 2 +- .../base-files/etc/uci-defaults/03_bluetooth | 16 ++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 target/linux/qualcommbe/ipq95xx/base-files/etc/uci-defaults/03_bluetooth diff --git a/target/linux/qualcommbe/dts/ipq9554-linksys-ln6001.dts b/target/linux/qualcommbe/dts/ipq9554-linksys-ln6001.dts index 701fa962d0d..e64f8052063 100644 --- a/target/linux/qualcommbe/dts/ipq9554-linksys-ln6001.dts +++ b/target/linux/qualcommbe/dts/ipq9554-linksys-ln6001.dts @@ -14,6 +14,7 @@ aliases { serial0 = &blsp1_uart2; + serial1 = &blsp1_uart4; led-boot = &led_blue; led-failsafe = &led_red; led-running = &led_blue; @@ -24,6 +25,22 @@ stdout-path = "serial0:115200n8"; }; + gpio-export { + compatible = "gpio-export"; + + bluetooth-isp { + gpio-export,name = "bluetooth-isp"; + gpio-export,output = <1>; + gpios = <&tlmm 57 GPIO_ACTIVE_HIGH>; + }; + + bluetooth-reset { + gpio-export,name = "bluetooth-reset"; + gpio-export,output = <1>; + gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; + }; + }; + keys { compatible = "gpio-keys"; pinctrl-0 = <&keys_pins>; @@ -81,6 +98,12 @@ status = "okay"; }; +&blsp1_uart4 { + pinctrl-0 = <&uart4_pins>, <&bluetooth_pta_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + &mdio { clock-frequency = <6250000>; pinctrl-0 = <&mdio_pins>; @@ -291,6 +314,13 @@ }; &tlmm { + bluetooth_pta_pins: bluetooth-pta-state { + pins = "gpio54", "gpio55", "gpio56"; + function = "pta"; + drive-strength = <8>; + bias-disable; + }; + keys_pins: keys-state { pins = "gpio37", "gpio40"; function = "gpio"; @@ -354,6 +384,13 @@ bias-pull-down; }; }; + + uart4_pins: uart4-state { + pins = "gpio50", "gpio51", "gpio52", "gpio53"; + function = "blsp4_uart"; + drive-strength = <8>; + bias-disable; + }; }; /* diff --git a/target/linux/qualcommbe/image/ipq95xx.mk b/target/linux/qualcommbe/image/ipq95xx.mk index 3adaeaad482..ae404d9278c 100644 --- a/target/linux/qualcommbe/image/ipq95xx.mk +++ b/target/linux/qualcommbe/image/ipq95xx.mk @@ -37,7 +37,7 @@ define Device/linksys_ln6001 DEVICE_MODEL := LN6001 DEVICE_DTS := ipq9554-linksys-ln6001 SOC := ipq9554 - DEVICE_PACKAGES += kmod-leds-pwm kmod-fs-f2fs mkf2fs f2fsck + DEVICE_PACKAGES += bluetooth-uart kmod-leds-pwm kmod-fs-f2fs mkf2fs f2fsck IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | \ check-size 128m | sysupgrade-tar rootfs=$$$$@ | append-metadata endef diff --git a/target/linux/qualcommbe/ipq95xx/base-files/etc/uci-defaults/03_bluetooth b/target/linux/qualcommbe/ipq95xx/base-files/etc/uci-defaults/03_bluetooth new file mode 100644 index 00000000000..22678a34ce6 --- /dev/null +++ b/target/linux/qualcommbe/ipq95xx/base-files/etc/uci-defaults/03_bluetooth @@ -0,0 +1,16 @@ +#!/bin/sh + +. /lib/functions.sh + +[ "$(board_name)" = "linksys,ln6001" ] || exit 0 +[ "$(uci -q get bluetooth-uart.main)" = "uart" ] || exit 0 + +# Preserve an already configured UART, including a disabled one. +[ -z "$(uci -q get bluetooth-uart.main.device)" ] || exit 0 + +uci -q batch <<-EOF + set bluetooth-uart.main.device='/dev/ttyMSM1' + set bluetooth-uart.main.protocol='h4' + set bluetooth-uart.main.speed='115200' + set bluetooth-uart.main.enabled='1' +EOF