Skip to contentSkip to conversation

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

PATCH Superseded Chen-Yu Tsai 2 participants 3 messages May 4, 2021 – May 5, 2021

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

---
Changes since v1:
- added uart-has-rtscts property
- added alias for uart_A

Hi Neil, Martin,

I dropped your review-bys since I added the UART alias and I'm not sure what the policy for those are.

ChenYu

---
 .../boot/dts/amlogic/meson-gxbb-nanopi-k2.dts      | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +13 -1
index 7273eed5292c..f017a263784f 100644
@@ -15,6 +15,7 @@ / {
 
 	aliases {
 		serial0 = &uart_AO;
+		serial1 = &uart_A;
 		ethernet0 = &ethmac;
 	};
 
@@ -385,9 +386,20 @@ &uart_AO {
 
 /* Bluetooth on AP6212 */
 &uart_A {
-	status = "disabled";
+	status = "okay";
 	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
 	pinctrl-names = "default";
+	uart-has-rtscts;
+
+	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
#1 lore raw

Hi,

Quoted 30 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.

---
Changes since v1:
- added uart-has-rtscts property
- added alias for uart_A

Hi Neil, Martin,

I dropped your review-bys since I added the UART alias and I'm not sure what the policy for those are.

ChenYu

---
 .../boot/dts/amlogic/meson-gxbb-nanopi-k2.dts      | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +0 -0
index 7273eed5292c..f017a263784f 100644

arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts / { · line 18

Quoted 4 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +1 -0
@@ -15,6 +15,7 @@ / {
 
        aliases {
                serial0 = &uart_AO;
+               serial1 = &uart_A;

this should not be needed anymore since a26988e8fef4b258d1b771e0f4b2e3b67cb2e044 ("tty: serial: meson: if no alias specified use an available id")

IIRC for "newly added" .dts we are only adding the alias for anything that shows up in /dev/ for the user
meson-khadas-vim3.dtsi for example is not adding an alias for uart_A (also used for Bluetooth)

Best regards,
Martin

#2 lore raw
Quoted 42 lines · Martin Blumenstingl

Hi,

Quoted 30 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.

---
Changes since v1:
- added uart-has-rtscts property
- added alias for uart_A

Hi Neil, Martin,

I dropped your review-bys since I added the UART alias and I'm not sure what the policy for those are.

ChenYu

---
 .../boot/dts/amlogic/meson-gxbb-nanopi-k2.dts      | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +0 -0
index 7273eed5292c..f017a263784f 100644

arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts / { · line 18

Quoted 4 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +1 -0
@@ -15,6 +15,7 @@ / {
 
        aliases {
                serial0 = &uart_AO;
+               serial1 = &uart_A;

this should not be needed anymore since a26988e8fef4b258d1b771e0f4b2e3b67cb2e044 ("tty: serial: meson: if no alias specified use an available id")

Quoted 4 lines

IIRC for "newly added" .dts we are only adding the alias for anything that shows up in /dev/ for the user
meson-khadas-vim3.dtsi for example is not adding an alias for uart_A (also used for Bluetooth)

I see. So if some user had a customized .dts enabling more UARTs, they would probably have the user visible ones aliased, and the Bluetooth one would be in the reserved range regardless.

I'll drop the extra alias then.

Thanks
ChenYu