Skip to contentSkip to conversation

Bluetooth support for GXBB/GXL/GXM based devices

PATCH New Martin Blumenstingl 4 participants 15 messages Jan 15, 2017 – Jan 19, 2017

Subsystems (3)
lore
Share & tools
lore

Martin Blumenstingl

author reviewer
#0 lore raw

cover Bluetooth support for GXBB/GXL/GXM based devices

This adds the missing kernel bits for Bluetooth support on the Tronsmart Vega S95 (GXBB based) boards as well as for the GXL P230/P231 and GXM Q200/Q201 reference boards.

The Bluetooth functionality on these boards is provided by the SDIO wifi/Bluetooth combo-chip (Broadcom bcm43xx based). The Bluetooth module on that combo-chip has to be taken out of reset, which is taken care of the GPIO in the sdio_pwrseq.

Once the module is taken out of reset it can be set up from userspace using the "hciattach" tool from bluez, which talks to the Bluetooth module which is connected to one of the serial ports (in our case uart_A). To get the Bluetooth module initialized within the timeout defined by "hciattach" (and to achieve usable speeds for Bluetooth transfers) the communication uses a speed of 2000000 baud, which was not supported by meson_uart before.

NOTE: The .dts-changes from this series depends on my previous series "add support for uart_AO_B" - see [0]

[0] http://lists.infradead.org/pipermail/linux-amlogic/2017-January/001982.html

Martin Blumenstingl (4):
tty: serial: meson: allow baud-rates higher than 115200
ARM64: dts: meson-gx: add the serial CTS and RTS pin groups
ARM64: dts: meson-gx-p23x-q20x: enable the Bluetooth module
ARM64: dts: meson-gxbb-vega-s95: enable the Bluetooth module

 .../arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 12 ++++++-
 .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi      |  9 +++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        | 40 ++++++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         | 40 ++++++++++++++++++++++
 drivers/tty/serial/meson_uart.c                    |  2 +-
 5 files changed, 101 insertions(+), 2 deletions(-)
Signature · 1 line
2.11.0
author reviewer
#1 lore raw

PATCH 1/4 tty: serial: meson: allow baud-rates higher than 115200

The vendor driver allows setting baud-rates higher than 115200 baud. There is a check in the vendor driver which prevents using more than 115200 baud during startup, however it does not have such a check in .set_termios.
Higher baud-rates are often used by the bluetooth modules embedded into the SDIO wifi chips (Amlogic devices use brcmfmac based wifi chips quite often, 2000000 baud seems to be a common value for the UART baud-rate in Amlogic's "libbt").

I have tested this on a Meson GXL device with uart_A (to which the bluetooth module is connected, where initialization times out with 115200 baud) and uart_AO (which I manually set to 2000000 baud and then connected with my USB UART adapter to that).

---
 drivers/tty/serial/meson_uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/meson_uart.c +1 -1
index 6aea0f4a9165..60f16795d16b 100644
@@ -364,7 +364,7 @@ static void meson_uart_set_termios(struct uart_port *port,
 
 	writel(val, port->membase + AML_UART_CONTROL);
 
-	baud = uart_get_baud_rate(port, termios, old, 9600, 115200);
+	baud = uart_get_baud_rate(port, termios, old, 9600, 4000000);
 	meson_uart_change_speed(port, baud);
 
 	port->read_status_mask = AML_UART_TX_FIFO_WERR;
Signature · 1 line
2.11.0
#2 lore raw

PATCH 1/4 tty: serial: meson: allow baud-rates higher than 115200

Am 15.01.2017 um 23:32 schrieb Martin Blumenstingl:

Quoted 9 lines

The vendor driver allows setting baud-rates higher than 115200 baud. There is a check in the vendor driver which prevents using more than 115200 baud during startup, however it does not have such a check in .set_termios.
Higher baud-rates are often used by the bluetooth modules embedded into the SDIO wifi chips (Amlogic devices use brcmfmac based wifi chips quite often, 2000000 baud seems to be a common value for the UART baud-rate in Amlogic's "libbt").

Quoted 6 lines

I have tested this on a Meson GXL device with uart_A (to which the bluetooth module is connected, where initialization times out with 115200 baud) and uart_AO (which I manually set to 2000000 baud and then connected with my USB UART adapter to that).

Thanks,
Andreas

Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
maintainer
#3 lore raw

PATCH 1/4 tty: serial: meson: allow baud-rates higher than 115200

In reply to Martin Blumenstingl
Quoted 9 lines · Martin Blumenstingl

The vendor driver allows setting baud-rates higher than 115200 baud. There is a check in the vendor driver which prevents using more than 115200 baud during startup, however it does not have such a check in .set_termios.
Higher baud-rates are often used by the bluetooth modules embedded into the SDIO wifi chips (Amlogic devices use brcmfmac based wifi chips quite often, 2000000 baud seems to be a common value for the UART baud-rate in Amlogic's "libbt").

Quoted 6 lines

I have tested this on a Meson GXL device with uart_A (to which the bluetooth module is connected, where initialization times out with 115200 baud) and uart_AO (which I manually set to 2000000 baud and then connected with my USB UART adapter to that).

author reviewer
#4 lore raw

PATCH 2/4 ARM64: dts: meson-gx: add the serial CTS and RTS pin groups

In reply to Martin Blumenstingl

This adds pinctrl group nodes for the CTS and RTS pins of each serial controller. This makes it possible to enable the CTS and RTS pins which are controlled by the serial controller hardware (through the meson_uart driver).

---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 40 +++++++++++++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi  | 40 +++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +40 -0
index 474435e21759..f001c4d007bc 100644
@@ -138,6 +138,14 @@
 			};
 		};
 
+		uart_ao_a_cts_rts_pins: uart_ao_a_cts_rts {
+			mux {
+				groups = "uart_cts_ao_a",
+				       "uart_rts_ao_a";
+				function = "uart_ao";
+			};
+		};
+
 		uart_ao_b_pins: uart_ao_b {
 			mux {
 				groups = "uart_tx_ao_b", "uart_rx_ao_b";
@@ -145,6 +153,14 @@
 			};
 		};
 
+		uart_ao_b_cts_rts_pins: uart_ao_b_cts_rts {
+			mux {
+				groups = "uart_cts_ao_b",
+				       "uart_rts_ao_b";
+				function = "uart_ao_b";
+			};
+		};
+
 		remote_input_ao_pins: remote_input_ao {
 			mux {
 				groups = "remote_input_ao";
@@ -290,6 +306,14 @@
 			};
 		};
 
+		uart_a_cts_rts_pins: uart_a_cts_rts {
+			mux {
+				groups = "uart_cts_a",
+				       "uart_rts_a";
+				function = "uart_a";
+			};
+		};
+
 		uart_b_pins: uart_b {
 			mux {
 				groups = "uart_tx_b",
@@ -298,6 +322,14 @@
 			};
 		};
 
+		uart_b_cts_rts_pins: uart_b_cts_rts {
+			mux {
+				groups = "uart_cts_b",
+				       "uart_rts_b";
+				function = "uart_b";
+			};
+		};
+
 		uart_c_pins: uart_c {
 			mux {
 				groups = "uart_tx_c",
@@ -306,6 +338,14 @@
 			};
 		};
 
+		uart_c_cts_rts_pins: uart_c_cts_rts {
+			mux {
+				groups = "uart_cts_c",
+				       "uart_rts_c";
+				function = "uart_c";
+			};
+		};
+
 		i2c_a_pins: i2c_a {
 			mux {
 				groups = "i2c_sck_a",
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +40 -0
index 53ed7a5f50ab..7d7fd87f094b 100644
@@ -82,6 +82,14 @@
 			};
 		};
 
+		uart_ao_a_cts_rts_pins: uart_ao_a_cts_rts {
+			mux {
+				groups = "uart_cts_ao_a",
+				       "uart_rts_ao_a";
+				function = "uart_ao";
+			};
+		};
+
 		uart_ao_b_pins: uart_ao_b {
 			mux {
 				groups = "uart_tx_ao_b", "uart_rx_ao_b";
@@ -89,6 +97,14 @@
 			};
 		};
 
+		uart_ao_b_cts_rts_pins: uart_ao_b_cts_rts {
+			mux {
+				groups = "uart_cts_ao_b",
+				       "uart_rts_ao_b";
+				function = "uart_ao_b";
+			};
+		};
+
 		remote_input_ao_pins: remote_input_ao {
 			mux {
 				groups = "remote_input_ao";
@@ -164,6 +180,14 @@
 			};
 		};
 
+		uart_a_cts_rts_pins: uart_a_cts_rts {
+			mux {
+				groups = "uart_cts_a",
+				       "uart_rts_a";
+				function = "uart_a";
+			};
+		};
+
 		uart_b_pins: uart_b {
 			mux {
 				groups = "uart_tx_b",
@@ -172,6 +196,14 @@
 			};
 		};
 
+		uart_b_cts_rts_pins: uart_b_cts_rts {
+			mux {
+				groups = "uart_cts_b",
+				       "uart_rts_b";
+				function = "uart_b";
+			};
+		};
+
 		uart_c_pins: uart_c {
 			mux {
 				groups = "uart_tx_c",
@@ -180,6 +212,14 @@
 			};
 		};
 
+		uart_c_cts_rts_pins: uart_c_cts_rts {
+			mux {
+				groups = "uart_cts_c",
+				       "uart_rts_c";
+				function = "uart_c";
+			};
+		};
+
 		i2c_a_pins: i2c_a {
 			mux {
 				groups = "i2c_sck_a",
Signature · 1 line
2.11.0
#5 lore raw

PATCH 2/4 ARM64: dts: meson-gx: add the serial CTS and RTS pin groups

Am 15.01.2017 um 23:32 schrieb Martin Blumenstingl:

Quoted 6 lines

This adds pinctrl group nodes for the CTS and RTS pins of each serial controller. This makes it possible to enable the CTS and RTS pins which are controlled by the serial controller hardware (through the meson_uart driver).

Thanks,
Andreas

Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
maintainer Applied
#6 lore raw

PATCH 2/4 ARM64: dts: meson-gx: add the serial CTS and RTS pin groups

Quoted 9 lines · Andreas F?rber

Am 15.01.2017 um 23:32 schrieb Martin Blumenstingl:

Quoted 6 lines

This adds pinctrl group nodes for the CTS and RTS pins of each serial controller. This makes it possible to enable the CTS and RTS pins which are controlled by the serial controller hardware (through the meson_uart driver).

Applied to v4.11/dt64 with Andreas' ack.

Kevin

author reviewer
#7 lore raw

PATCH 3/4 ARM64: dts: meson-gx-p23x-q20x: enable the Bluetooth module

In reply to Martin Blumenstingl

This takes the Bluetooth module out of reset (the reset line is connected to GPIOX_17) and enables uart_A which is used to configure the module.
This is identical for all boards which inherit meson-gx-p23x-q20x:
- GXL S905D P230
- GXL S905D P231
- GXM S912 Q200
- GXM S912 Q201

To get the HCI interface up one has to install bluez-utils and run:
hciattach -s115200 /dev/ttyAML1 bcm43xx 2000000 flow -

---
 arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +11 -1
index 7a078bef04cd..7db779048091 100644
@@ -48,6 +48,7 @@
 / {
 	aliases {
 		serial0 = &uart_AO;
+		serial1 = &uart_A;
 	};
 
 	chosen {
@@ -94,12 +95,21 @@
 
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
-		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
+		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>,
+			      <&gpio GPIOX_17 GPIO_ACTIVE_LOW>;
 		clocks = <&wifi32k>;
 		clock-names = "ext_clock";
 	};
 };
 
+/* This is connected to the Bluetooth module of the wifi/BT combo chip: */
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins &uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
+};
+
 /* This UART is brought out to the DB9 connector */
 &uart_AO {
 	status = "okay";
Signature · 1 line
2.11.0
#8 lore raw

PATCH 3/4 ARM64: dts: meson-gx-p23x-q20x: enable the Bluetooth module

Am 15.01.2017 um 23:32 schrieb Martin Blumenstingl:

Quoted 35 lines

This takes the Bluetooth module out of reset (the reset line is connected to GPIOX_17) and enables uart_A which is used to configure the module.
This is identical for all boards which inherit meson-gx-p23x-q20x:
- GXL S905D P230
- GXL S905D P231
- GXM S912 Q200
- GXM S912 Q201

To get the HCI interface up one has to install bluez-utils and run:
hciattach -s115200 /dev/ttyAML1 bcm43xx 2000000 flow -

---
 arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +2 -1
index 7a078bef04cd..7db779048091 100644
@@ -48,6 +48,7 @@
 / {
 	aliases {
 		serial0 = &uart_AO;
+		serial1 = &uart_A;
 	};
 
 	chosen {
@@ -94,12 +95,21 @@
 
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
-		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
+		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>,

arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi line 108

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +5 -0
+			      <&gpio GPIOX_17 GPIO_ACTIVE_LOW>;
 		clocks = <&wifi32k>;
 		clock-names = "ext_clock";
 	};
 };
 
+/* This is connected to the Bluetooth module of the wifi/BT combo chip: */
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins &uart_a_cts_rts_pins>;

Nit: <&uart_a_pins>, <&uart_a_cts_rts_pins> please, like you've done for reset-gpios above.

Regards,
Andreas

Quoted 8 lines
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +4 -0
+	pinctrl-names = "default";
+	uart-has-rtscts;
+};
+
 /* This UART is brought out to the DB9 connector */
 &uart_AO {
 	status = "okay";
Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
author reviewer
#9 lore raw

PATCH 3/4 ARM64: dts: meson-gx-p23x-q20x: enable the Bluetooth module

Quoted 42 lines · Andreas F?rber

Am 15.01.2017 um 23:32 schrieb Martin Blumenstingl:

Quoted 41 lines

This takes the Bluetooth module out of reset (the reset line is connected to GPIOX_17) and enables uart_A which is used to configure the module.
This is identical for all boards which inherit meson-gx-p23x-q20x:
- GXL S905D P230
- GXL S905D P231
- GXM S912 Q200
- GXM S912 Q201

To get the HCI interface up one has to install bluez-utils and run:
hciattach -s115200 /dev/ttyAML1 bcm43xx 2000000 flow -

---
 arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +3 -1
index 7a078bef04cd..7db779048091 100644
@@ -48,6 +48,7 @@
 / {
      aliases {
              serial0 = &uart_AO;
+             serial1 = &uart_A;
      };
 
      chosen {
@@ -94,12 +95,21 @@
 
      sdio_pwrseq: sdio-pwrseq {
              compatible = "mmc-pwrseq-simple";
-             reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
+             reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>,
+                           <&gpio GPIOX_17 GPIO_ACTIVE_LOW>;
              clocks = <&wifi32k>;
              clock-names = "ext_clock";
      };
 };
 
Quoted 7 lines

arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi line 108

Quoted 4 lines
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +4 -0
+/* This is connected to the Bluetooth module of the wifi/BT combo chip: */
+&uart_A {
+     status = "okay";
+     pinctrl-0 = <&uart_a_pins &uart_a_cts_rts_pins>;

Nit: <&uart_a_pins>, <&uart_a_cts_rts_pins> please, like you've done for reset-gpios above.

indeed, not sure why I mixed it up. should I also send an update for the pinctrl-documentation (as it seems to use the same pattern): [0]?

Quoted 17 lines

Regards,
Andreas

arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi line 115

Quoted 8 lines
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +4 -0
+     pinctrl-names = "default";
+     uart-has-rtscts;
+};
+
 /* This UART is brought out to the DB9 connector */
 &uart_AO {
      status = "okay";

--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg)

[0] http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt?v=4.9#L74

author reviewer
#10 lore raw

PATCH 4/4 ARM64: dts: meson-gxbb-vega-s95: enable the Bluetooth module

In reply to Martin Blumenstingl

This takes the Bluetooth module out of reset (the reset line is connected to GPIOX_20) and enables uart_A which is used to configure the module. This is common for all Vega S95 boards.
The device can then be initialized by running the hciattach tool:
hciattach -s115200 /dev/ttyAML1 bcm43xx 2000000 flow -

---
 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi +9 -0
index ab497126c9a3..9e0a13b1ac93 100644
@@ -47,6 +47,7 @@
 
 	aliases {
 		serial0 = &uart_AO;
+		serial1 = &uart_A;
 	};
 
 	chosen {
@@ -100,6 +101,14 @@
 	};
 };
 
+/* This is connected to the Bluetooth module of the wifi/BT combo chip: */
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins &uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
+};
+
 &uart_AO {
 	status = "okay";
 	pinctrl-0 = <&uart_ao_a_pins>;
Signature · 1 line
2.11.0
#11 lore raw

PATCH 4/4 ARM64: dts: meson-gxbb-vega-s95: enable the Bluetooth module

Am 15.01.2017 um 23:32 schrieb Martin Blumenstingl:

Quoted 24 lines

This takes the Bluetooth module out of reset (the reset line is connected to GPIOX_20) and enables uart_A which is used to configure the module. This is common for all Vega S95 boards.
The device can then be initialized by running the hciattach tool:
hciattach -s115200 /dev/ttyAML1 bcm43xx 2000000 flow -

---
 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi +1 -0
index ab497126c9a3..9e0a13b1ac93 100644
@@ -47,6 +47,7 @@
 
 	aliases {
 		serial0 = &uart_AO;
+		serial1 = &uart_A;
 	};
 
 	chosen {

arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi line 104

Quoted 4 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi +1 -0
@@ -100,6 +101,14 @@
 	};
 };
 
+/* This is connected to the Bluetooth module of the wifi/BT combo chip: */

Personally I would just say "Connected to the .... chip" or even just "Bluetooth .... chip", without trailing colon, for consistency.

arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi line 114

Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi +7 -0
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins &uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
+};
+
 &uart_AO {
 	status = "okay";
 	pinctrl-0 = <&uart_ao_a_pins>;

Thanks,
Andreas

Signature · 3 lines
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
author reviewer
#12 lore raw

cover Bluetooth support for GXBB/GXL/GXM based devices

In reply to Martin Blumenstingl

Kevin,

Quoted 21 lines · Martin Blumenstingl

This adds the missing kernel bits for Bluetooth support on the Tronsmart Vega S95 (GXBB based) boards as well as for the GXL P230/P231 and GXM Q200/Q201 reference boards.

The Bluetooth functionality on these boards is provided by the SDIO wifi/Bluetooth combo-chip (Broadcom bcm43xx based). The Bluetooth module on that combo-chip has to be taken out of reset, which is taken care of the GPIO in the sdio_pwrseq.

Once the module is taken out of reset it can be set up from userspace using the "hciattach" tool from bluez, which talks to the Bluetooth module which is connected to one of the serial ports (in our case uart_A). To get the Bluetooth module initialized within the timeout defined by "hciattach" (and to achieve usable speeds for Bluetooth transfers) the communication uses a speed of 2000000 baud, which was not supported by meson_uart before.

NOTE: The .dts-changes from this series depends on my previous series "add support for uart_AO_B" - see [0]

Quoted 6 lines

[0] http://lists.infradead.org/pipermail/linux-amlogic/2017-January/001982.html

Martin Blumenstingl (4):
tty: serial: meson: allow baud-rates higher than 115200
ARM64: dts: meson-gx: add the serial CTS and RTS pin groups

Neil just informed me that Rob Herring is working on defining the UART Bluetooth device properly using devicetree (preparation for this is named "[PATCH v2 0/9] Serial slave device bus", see [0] for the mailing-list conversation and [1] for a WiP git repo).
This means that there will be a better solution than the one proposed in the meson-gx-p23x-q20x and meson-gxbb-vega-s95 patches (patches #1 and #2 are not affected by this), namely:
- I'm currently (ab)using sdio-pwrseq node to power on the UART Bluetooth module, this can solved by specifying a bluetooth { } node inside the &uart_A node in the future and providing the corresponding GPIOs there
- all the userspace commands will not be necessary once drivers/bluetooth/hci_bcm.c is changed to the serio framework and gets devicetree support

Quoted 10 lines

ARM64: dts: meson-gx-p23x-q20x: enable the Bluetooth module
ARM64: dts: meson-gxbb-vega-s95: enable the Bluetooth module

 .../arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 12 ++++++-
 .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi      |  9 +++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        | 40 ++++++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         | 40 ++++++++++++++++++++++
 drivers/tty/serial/meson_uart.c                    |  2 +-
 5 files changed, 101 insertions(+), 2 deletions(-)
Quoted 3 lines

--
2.11.0

[0] http://marc.info/?l=linux-serial&m=148460728417109&w=2
[1] https://git.kernel.org/cgit/linux/kernel/git/robh/linux.git/log/?h=serial-bus-v3

maintainer
#13 lore raw

cover Bluetooth support for GXBB/GXL/GXM based devices

Quoted 28 lines · Martin Blumenstingl

Kevin,

Quoted 24 lines · Martin Blumenstingl

This adds the missing kernel bits for Bluetooth support on the Tronsmart Vega S95 (GXBB based) boards as well as for the GXL P230/P231 and GXM Q200/Q201 reference boards.

The Bluetooth functionality on these boards is provided by the SDIO wifi/Bluetooth combo-chip (Broadcom bcm43xx based). The Bluetooth module on that combo-chip has to be taken out of reset, which is taken care of the GPIO in the sdio_pwrseq.

Once the module is taken out of reset it can be set up from userspace using the "hciattach" tool from bluez, which talks to the Bluetooth module which is connected to one of the serial ports (in our case uart_A). To get the Bluetooth module initialized within the timeout defined by "hciattach" (and to achieve usable speeds for Bluetooth transfers) the communication uses a speed of 2000000 baud, which was not supported by meson_uart before.

NOTE: The .dts-changes from this series depends on my previous series "add support for uart_AO_B" - see [0]

[0] http://lists.infradead.org/pipermail/linux-amlogic/2017-January/001982.html

Quoted 8 lines
Quoted 3 lines

Martin Blumenstingl (4):
tty: serial: meson: allow baud-rates higher than 115200
ARM64: dts: meson-gx: add the serial CTS and RTS pin groups

Neil just informed me that Rob Herring is working on defining the UART Bluetooth device properly using devicetree (preparation for this is named "[PATCH v2 0/9] Serial slave device bus", see [0] for the mailing-list conversation and [1] for a WiP git repo).

Ah, good news. I knew Rob had been talking about that for awhile, so I'm glad to see it coming into existence. Thanks for the pointers.

Quoted 7 lines

This means that there will be a better solution than the one proposed in the meson-gx-p23x-q20x and meson-gxbb-vega-s95 patches (patches #1 and #2 are not affected by this),> namely:
- I'm currently (ab)using sdio-pwrseq node to power on the UART Bluetooth module, this can solved by specifying a bluetooth { } node inside the &uart_A node in the future and providing the corresponding GPIOs there

Good. I didn't like the (ab)use of sdio_pwrseq GPIO resets for the bluetooth either.

Quoted 3 lines

- all the userspace commands will not be necessary once drivers/bluetooth/hci_bcm.c is changed to the serio framework and gets devicetree support

Cool. Maybe you can setup a WIP branch based on Rob's work for broader testing on Amlogic boards until this gets merged?

In the mean time, I've applied patch 2/4 and hopefully the drivers/tty patch will go through the serial tree.

Kevin

maintainer
#14 lore raw

cover Bluetooth support for GXBB/GXL/GXM based devices

Quoted 57 lines · Kevin Hilman
Quoted 28 lines · Martin Blumenstingl

Kevin,

Quoted 24 lines · Martin Blumenstingl

This adds the missing kernel bits for Bluetooth support on the Tronsmart Vega S95 (GXBB based) boards as well as for the GXL P230/P231 and GXM Q200/Q201 reference boards.

The Bluetooth functionality on these boards is provided by the SDIO wifi/Bluetooth combo-chip (Broadcom bcm43xx based). The Bluetooth module on that combo-chip has to be taken out of reset, which is taken care of the GPIO in the sdio_pwrseq.

Once the module is taken out of reset it can be set up from userspace using the "hciattach" tool from bluez, which talks to the Bluetooth module which is connected to one of the serial ports (in our case uart_A). To get the Bluetooth module initialized within the timeout defined by "hciattach" (and to achieve usable speeds for Bluetooth transfers) the communication uses a speed of 2000000 baud, which was not supported by meson_uart before.

NOTE: The .dts-changes from this series depends on my previous series "add support for uart_AO_B" - see [0]

[0] http://lists.infradead.org/pipermail/linux-amlogic/2017-January/001982.html

Quoted 8 lines
Quoted 3 lines

Martin Blumenstingl (4):
tty: serial: meson: allow baud-rates higher than 115200
ARM64: dts: meson-gx: add the serial CTS and RTS pin groups

Neil just informed me that Rob Herring is working on defining the UART Bluetooth device properly using devicetree (preparation for this is named "[PATCH v2 0/9] Serial slave device bus", see [0] for the mailing-list conversation and [1] for a WiP git repo).

Ah, good news. I knew Rob had been talking about that for awhile, so I'm glad to see it coming into existence. Thanks for the pointers.

Quoted 7 lines

This means that there will be a better solution than the one proposed in the meson-gx-p23x-q20x and meson-gxbb-vega-s95 patches (patches #1 and #2 are not affected by this),> namely:
- I'm currently (ab)using sdio-pwrseq node to power on the UART Bluetooth module, this can solved by specifying a bluetooth { } node inside the &uart_A node in the future and providing the corresponding GPIOs there

Good. I didn't like the (ab)use of sdio_pwrseq GPIO resets for the bluetooth either.

Quoted 3 lines

- all the userspace commands will not be necessary once drivers/bluetooth/hci_bcm.c is changed to the serio framework and gets devicetree support

Quoted 5 lines

Cool. Maybe you can setup a WIP branch based on Rob's work for broader testing on Amlogic boards until this gets merged?

In the mean time, I've applied patch 2/4 and hopefully the drivers/tty patch will go through the serial tree.

Yes, I've taken it now, thanks.

greg k-h