Skip to contentSkip to conversation

ARM: sun8i: h3: bluetooth for Banana Pi M2 Zero board

PATCH Superseded Andreas Kemnade 2 participants 3 messages Feb 28, 2019 – Mar 1, 2019

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: sun8i: h3: bluetooth for Banana Pi M2 Zero board

The Banana Pi M2 Zero board has an AP6212 BT+Wifi combo chip with broadcom internals attached to UART1 and some gpios. This addition is in line with similar boards

---
 .../boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts    | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +29 -0
index 1db2541135a7..39e206fac4e3 100644
@@ -69,6 +69,8 @@
 		compatible = "mmc-pwrseq-simple";
 		pinctrl-names = "default";
 		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
+		clocks = <&rtc 1>;
+		clock-names = "ext_clock";
 	};
 };
 
@@ -122,7 +124,34 @@
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	uart-has-rtscts;
 	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		pinctrl-names = "default";
+		pinctrl-0 = <&bt_pins_out>, <&bt_pins_in>;
+		clocks = <&rtc 1>;
+		clock-names = "lpo";
+		vbat-supply = <&reg_vcc3v3>;
+		vddio-supply = <&reg_vcc3v3>;
+		device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
+		host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
+		shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+	};
+
+};
+
+&pio {
+	bt_pins_out: bt_out {
+		pins = "PG12", "PG13";
+		function = "gpio_out";
+	};
+
+	bt_pins_in: bt_in {
+		pins = "PG11";
+		function = "gpio_in";
+	};
 };
 
 &usb_otg {
Signature · 1 line
2.11.0
#1 lore raw

Hi,

Thanks for your patch

Quoted 44 lines · Andreas Kemnade

The Banana Pi M2 Zero board has an AP6212 BT+Wifi combo chip with broadcom internals attached to UART1 and some gpios. This addition is in line with similar boards

---
 .../boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts    | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +19 -0
index 1db2541135a7..39e206fac4e3 100644
@@ -69,6 +69,8 @@
 		compatible = "mmc-pwrseq-simple";
 		pinctrl-names = "default";
 		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
+		clocks = <&rtc 1>;
+		clock-names = "ext_clock";
 	};
 };
 
@@ -122,7 +124,34 @@
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	uart-has-rtscts;
 	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		pinctrl-names = "default";
+		pinctrl-0 = <&bt_pins_out>, <&bt_pins_in>;
+		clocks = <&rtc 1>;
+		clock-names = "lpo";
+		vbat-supply = <&reg_vcc3v3>;
+		vddio-supply = <&reg_vcc3v3>;
+		device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
+		host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
+		shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+	};
+
+};
+

arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts line 154

Quoted 10 lines
arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +10 -0
+&pio {
+	bt_pins_out: bt_out {
+		pins = "PG12", "PG13";
+		function = "gpio_out";
+	};
+
+	bt_pins_in: bt_in {
+		pins = "PG11";
+		function = "gpio_in";
+	};

You don't need any of those pinctrl nodes, GPIOs work fine without.

Maxime

Signature · 3 lines
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
Quoted 53 lines · On Fri, 1 Mar 2019 15:36:32 +0100 Maxime Ripard <[email protected]>…

Hi,

Thanks for your patch

Quoted 48 lines · Andreas Kemnade

The Banana Pi M2 Zero board has an AP6212 BT+Wifi combo chip with broadcom internals attached to UART1 and some gpios. This addition is in line with similar boards

---
 .../boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts    | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +23 -0
index 1db2541135a7..39e206fac4e3 100644
@@ -69,6 +69,8 @@
 		compatible = "mmc-pwrseq-simple";
 		pinctrl-names = "default";
 		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
+		clocks = <&rtc 1>;
+		clock-names = "ext_clock";
 	};
 };
 
@@ -122,7 +124,34 @@
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+	uart-has-rtscts;
 	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		pinctrl-names = "default";
+		pinctrl-0 = <&bt_pins_out>, <&bt_pins_in>;
+		clocks = <&rtc 1>;
+		clock-names = "lpo";
+		vbat-supply = <&reg_vcc3v3>;
+		vddio-supply = <&reg_vcc3v3>;
+		device-wakeup-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
+		host-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
+		shutdown-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+	};
+
+};
+
+&pio {
+	bt_pins_out: bt_out {
+		pins = "PG12", "PG13";
+		function = "gpio_out";
Quoted 9 lines

arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts line 154

Quoted 6 lines
arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts +6 -0
+	};
+
+	bt_pins_in: bt_in {
+		pins = "PG11";
+		function = "gpio_in";
+	};  

You don't need any of those pinctrl nodes, GPIOs work fine without.

ok, that makes things easier. I will resend a v2 without them.

Regards,
Andreas