Skip to contentSkip to conversation

arm64: dts: meson-gxbb: nanopi-k2: Enable Bluetooth

PATCH Superseded Chen-Yu Tsai 3 participants 3 messages Apr 29, 2021

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: meson-gxbb: nanopi-k2: Enable Bluetooth

From: Chen-Yu Tsai <[email protected]>

The NanoPi K2 has a AP6212 WiFi+BT combo module. The WiFi portion is already enabled. The BT part is connected via UART and I2S.

Enable the UART and add a device node describing the Bluetooth portion of the module.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +11 -1
index 7273eed5292c..10f48fb1af61 100644
@@ -385,9 +385,19 @@ &uart_AO {
 
 /* Bluetooth on AP6212 */
 &uart_A {
-	status = "disabled";
+	status = "okay";
 	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
 	pinctrl-names = "default";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		clocks = <&wifi_32k>;
+		clock-names = "lpo";
+		vbat-supply = <&vddio_ao3v3>;
+		vddio-supply = <&vddio_ao18>;
+		host-wakeup-gpios = <&gpio GPIOX_21 GPIO_ACTIVE_HIGH>;
+		shutdown-gpios = <&gpio GPIOX_20 GPIO_ACTIVE_HIGH>;
+	};
 };
 
 /* 40-pin CON1 */
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Chen-Yu Tsai

From: Chen-Yu Tsai <[email protected]>

The NanoPi K2 has a AP6212 WiFi+BT combo module. The WiFi portion is already enabled. The BT part is connected via UART and I2S.

Enable the UART and add a device node describing the Bluetooth portion of the module.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +4 -1
index 7273eed5292c..10f48fb1af61 100644
@@ -385,9 +385,19 @@ &uart_AO {
 
 /* Bluetooth on AP6212 */
 &uart_A {
-	status = "disabled";
+	status = "okay";
 	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
 	pinctrl-names = "default";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";

arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts &uart_AO { · line 403

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +7 -0
+		clocks = <&wifi_32k>;
+		clock-names = "lpo";
+		vbat-supply = <&vddio_ao3v3>;
+		vddio-supply = <&vddio_ao18>;
+		host-wakeup-gpios = <&gpio GPIOX_21 GPIO_ACTIVE_HIGH>;
+		shutdown-gpios = <&gpio GPIOX_20 GPIO_ACTIVE_HIGH>;
+	};
 };
 
 /* 40-pin CON1 */

Thanks !

reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Chen-Yu Tsai
Quoted 10 lines · Chen-Yu Tsai

From: Chen-Yu Tsai <[email protected]>

The NanoPi K2 has a AP6212 WiFi+BT combo module. The WiFi portion is already enabled. The BT part is connected via UART and I2S.

Enable the UART and add a device node describing the Bluetooth portion of the module.

one nit-pick below - with that you can add my:

Quoted 9 lines
---
 arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +0 -0
index 7273eed5292c..10f48fb1af61 100644

arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts &uart_AO { · line 390

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +1 -1
@@ -385,9 +385,19 @@ &uart_AO {
 
 /* Bluetooth on AP6212 */
 &uart_A {
-       status = "disabled";
+       status = "okay";
        pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
        pinctrl-names = "default";

based on Documentation/devicetree/bindings/serial/serial.yaml please add:
uart-has-rtscts;

Thank you!
Martin