linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth
@ 2018-09-04 14:44 chewitt
  2018-09-04 19:05 ` Martin Blumenstingl
  2018-09-07 12:15 ` [PATCH v2] " Christian Hewitt
  0 siblings, 2 replies; 7+ messages in thread
From: chewitt @ 2018-09-04 14:44 UTC (permalink / raw)
  Cc: narmstrong, christianshewitt, Rob Herring, Mark Rutland,
	Carlo Caione, Kevin Hilman, devicetree, linux-arm-kernel,
	linux-amlogic, linux-kernel

This change adds the ttyAML1 uart used by the brmcfmac sdio module in
the WeTek Hub and WeTek Play 2 devices.

Signed-off-by: chewitt <christianshewitt@gmail.com>
---
 arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
index 70325b2..9476868 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
@@ -10,6 +10,7 @@
 / {
 	aliases {
 		serial0 = &uart_AO;
+		serial1 = &uart_A;
 		ethernet0 = &ethmac;
 	};
 
@@ -239,6 +240,13 @@
 	vqmmc-supply = <&vddio_boot>;
 };
 
+/* This is connected to the Bluetooth module: */
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+};
+
 /* This UART is brought out to the DB9 connector */
 &uart_AO {
 	status = "okay";
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth
  2018-09-04 14:44 [PATCH] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth chewitt
@ 2018-09-04 19:05 ` Martin Blumenstingl
  2018-09-04 19:42   ` Christian Hewitt
  2018-09-07 12:15 ` [PATCH v2] " Christian Hewitt
  1 sibling, 1 reply; 7+ messages in thread
From: Martin Blumenstingl @ 2018-09-04 19:05 UTC (permalink / raw)
  To: christianshewitt
  Cc: mark.rutland, devicetree, Neil Armstrong, khilman, linux-kernel,
	robh+dt, carlo, linux-amlogic, linux-arm-kernel

Hi Christian,

On Tue, Sep 4, 2018 at 4:47 PM chewitt <christianshewitt@gmail.com> wrote:
>
> This change adds the ttyAML1 uart used by the brmcfmac sdio module in
> the WeTek Hub and WeTek Play 2 devices.
do you know which Broadcom chip this is exactly?

I assume you want to use the "patchram" userspace program (or
something similar) to initialize the HCI controller?
it's been a while since a similar patch was rejected, but things have
gotten better since then. more details below

> Signed-off-by: chewitt <christianshewitt@gmail.com>
> ---
>  arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
> index 70325b2..9476868 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
> @@ -10,6 +10,7 @@
>  / {
>         aliases {
>                 serial0 = &uart_AO;
> +               serial1 = &uart_A;
this can be dropped if you read on

>                 ethernet0 = &ethmac;
>         };
>
> @@ -239,6 +240,13 @@
>         vqmmc-supply = <&vddio_boot>;
>  };
>
> +/* This is connected to the Bluetooth module: */
> +&uart_A {
> +       status = "okay";
> +       pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
> +       pinctrl-names = "default";
insert bluetooth child-node from [0] here (with the correct max-speed,
*-gpios and clock* properties for this board)

some background: with Rob's serdev framework some Bluetooth controller
drivers recently gained the ability to get the controller into a
working state without any userspace utility. if you add the bluetooth
child-node here the kernel will:
- not create a /dev/ttyAMLn
- load the matching Bluetooth controller driver (the Broadcom one in your case)
- do the "initialize this Bluetooth controller with all the vendor
specific magic" dance (toggling GPIOs, loading firmware from userspace
via standard request_firmware, etc.)
- provide you with a ready-to-use hci0 interface


Regards
Martin


[0] https://elixir.bootlin.com/linux/v4.18/source/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth
  2018-09-04 19:05 ` Martin Blumenstingl
@ 2018-09-04 19:42   ` Christian Hewitt
  0 siblings, 0 replies; 7+ messages in thread
From: Christian Hewitt @ 2018-09-04 19:42 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: mark.rutland, devicetree, Neil Armstrong, khilman, linux-kernel,
	robh+dt, carlo, linux-amlogic, linux-arm-kernel


> On 4 Sep 2018, at 11:05 pm, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote:
> 
> Hi Christian,
> 
> On Tue, Sep 4, 2018 at 4:47 PM chewitt <christianshewitt@gmail.com> wrote:
>> 
>> This change adds the ttyAML1 uart used by the brmcfmac sdio module in
>> the WeTek Hub and WeTek Play 2 devices.
> do you know which Broadcom chip this is exactly?

It’s an AMPAK 6335 module. WiFi shows as BCM4339, BT shows as BCM4335(rev C0). I’ve submitted a patch to add the BT id earlier, see:
(https://marc.info/?l=linux-bluetooth&m=153608351032693&w=2)

> I assume you want to use the "patchram" userspace program (or
> something similar) to initialize the HCI controller?
> it's been a while since a similar patch was rejected, but things have
> gotten better since then. more details below
> 
>> Signed-off-by: chewitt <christianshewitt@gmail.com>
>> ---
>> arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
>> index 70325b2..9476868 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
>> @@ -10,6 +10,7 @@
>> / {
>>        aliases {
>>                serial0 = &uart_AO;
>> +               serial1 = &uart_A;
> this can be dropped if you read on
> 
>>                ethernet0 = &ethmac;
>>        };
>> 
>> @@ -239,6 +240,13 @@
>>        vqmmc-supply = <&vddio_boot>;
>> };
>> 
>> +/* This is connected to the Bluetooth module: */
>> +&uart_A {
>> +       status = "okay";
>> +       pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
>> +       pinctrl-names = "default";
> insert bluetooth child-node from [0] here (with the correct max-speed,
> *-gpios and clock* properties for this board)
> 
> some background: with Rob's serdev framework some Bluetooth controller
> drivers recently gained the ability to get the controller into a
> working state without any userspace utility. if you add the bluetooth
> child-node here the kernel will:
> - not create a /dev/ttyAMLn
> - load the matching Bluetooth controller driver (the Broadcom one in your case)
> - do the "initialize this Bluetooth controller with all the vendor
> specific magic" dance (toggling GPIOs, loading firmware from userspace
> via standard request_firmware, etc.)
> - provide you with a ready-to-use hci0 interface

No problem, i’ve done that for another device. I’ll investigate.

> 
> Regards
> Martin
> 
> 
> [0] https://elixir.bootlin.com/linux/v4.18/source/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth
  2018-09-04 14:44 [PATCH] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth chewitt
  2018-09-04 19:05 ` Martin Blumenstingl
@ 2018-09-07 12:15 ` Christian Hewitt
  2018-09-10 16:17   ` Rob Herring
  2018-09-10 18:30   ` Martin Blumenstingl
  1 sibling, 2 replies; 7+ messages in thread
From: Christian Hewitt @ 2018-09-07 12:15 UTC (permalink / raw)
  Cc: narmstrong, christianshewitt, martin.blumenstingl, Rob Herring,
	Mark Rutland, Carlo Caione, Kevin Hilman, devicetree,
	linux-arm-kernel, linux-amlogic, linux-kernel

This change adds the uart_A used by the brmcfmac sdio module in the
WeTek Hub and WeTek Play 2 devices. meson_uart_probe seems to mandate
an alias (without it, BT is not working) so this is also included.

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
 arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
index 70325b2..e75ace7 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
@@ -10,6 +10,7 @@
 / {
 	aliases {
 		serial0 = &uart_AO;
+		serial1 = &uart_A;
 		ethernet0 = &ethmac;
 	};
 
@@ -239,6 +240,18 @@
 	vqmmc-supply = <&vddio_boot>;
 };
 
+/* This is connected to the Bluetooth module: */
+&uart_A {
+	status = "okay";
+	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
+	pinctrl-names = "default";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		shutdown-gpios = <&gpio GPIOX_20 GPIO_ACTIVE_HIGH>;
+	};
+};
+
 /* This UART is brought out to the DB9 connector */
 &uart_AO {
 	status = "okay";
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth
  2018-09-07 12:15 ` [PATCH v2] " Christian Hewitt
@ 2018-09-10 16:17   ` Rob Herring
  2018-09-10 18:30   ` Martin Blumenstingl
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2018-09-10 16:17 UTC (permalink / raw)
  To: christianshewitt
  Cc: Neil Armstrong, Martin Blumenstingl, Mark Rutland, Carlo Caione,
	Kevin Hilman, devicetree,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-amlogic, linux-kernel

On Fri, Sep 7, 2018 at 7:16 AM Christian Hewitt
<christianshewitt@gmail.com> wrote:
>

ttyAML1 has nothing to do with dts files.

> This change adds the uart_A used by the brmcfmac sdio module in the
> WeTek Hub and WeTek Play 2 devices. meson_uart_probe seems to mandate
> an alias (without it, BT is not working) so this is also included.

You should fix the alias being required. It should not be.

> Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
> ---
>  arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 13 +++++++++++++
>  1 file changed, 13 insertions(+)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth
  2018-09-07 12:15 ` [PATCH v2] " Christian Hewitt
  2018-09-10 16:17   ` Rob Herring
@ 2018-09-10 18:30   ` Martin Blumenstingl
  2018-09-11 13:27     ` Rob Herring
  1 sibling, 1 reply; 7+ messages in thread
From: Martin Blumenstingl @ 2018-09-10 18:30 UTC (permalink / raw)
  To: robh+dt
  Cc: christianshewitt, Neil Armstrong, mark.rutland, carlo, khilman,
	devicetree, linux-arm-kernel, linux-amlogic, linux-kernel

Hi Rob,

On Fri, Sep 7, 2018 at 2:16 PM Christian Hewitt
<christianshewitt@gmail.com> wrote:
>
> This change adds the uart_A used by the brmcfmac sdio module in the
> WeTek Hub and WeTek Play 2 devices. meson_uart_probe seems to mandate
> an alias (without it, BT is not working) so this is also included.
>
> Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
> ---
>  arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
> index 70325b2..e75ace7 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
> @@ -10,6 +10,7 @@
>  / {
>         aliases {
>                 serial0 = &uart_AO;
> +               serial1 = &uart_A;
>                 ethernet0 = &ethmac;
>         };
>
> @@ -239,6 +240,18 @@
>         vqmmc-supply = <&vddio_boot>;
>  };
>
> +/* This is connected to the Bluetooth module: */
> +&uart_A {
> +       status = "okay";
> +       pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
> +       pinctrl-names = "default";
> +
> +       bluetooth {
> +               compatible = "brcm,bcm43438-bt";
I have a question regarding the Broadcom Bluetooth compatible strings:
Christian mentioned earlier that the Bluetooth controller identifies
itself as BCM4335C0 (BCM4335 rev. C0)

do we need to add a new compatible string (to
Documentation/devicetree/bindings/net/broadcom-bluetooth.txt)?
if yes: should we also add a new of_device_id to hci_bcm.c or should
board.dts simply use compatible = "brcm,bcm4335c0-bt",
"brcm,bcm43438-bt"?


Regards
Martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth
  2018-09-10 18:30   ` Martin Blumenstingl
@ 2018-09-11 13:27     ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2018-09-11 13:27 UTC (permalink / raw)
  To: Martin Blumenstingl
  Cc: Christian Hewitt, Neil Armstrong, Mark Rutland, Carlo Caione,
	Kevin Hilman, devicetree,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-amlogic, linux-kernel

On Mon, Sep 10, 2018 at 1:30 PM Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
>
> Hi Rob,
>
> On Fri, Sep 7, 2018 at 2:16 PM Christian Hewitt
> <christianshewitt@gmail.com> wrote:
> >
> > This change adds the uart_A used by the brmcfmac sdio module in the
> > WeTek Hub and WeTek Play 2 devices. meson_uart_probe seems to mandate
> > an alias (without it, BT is not working) so this is also included.
> >
> > Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
> > ---
> >  arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
> > index 70325b2..e75ace7 100644
> > --- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
> > +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
> > @@ -10,6 +10,7 @@
> >  / {
> >         aliases {
> >                 serial0 = &uart_AO;
> > +               serial1 = &uart_A;
> >                 ethernet0 = &ethmac;
> >         };
> >
> > @@ -239,6 +240,18 @@
> >         vqmmc-supply = <&vddio_boot>;
> >  };
> >
> > +/* This is connected to the Bluetooth module: */
> > +&uart_A {
> > +       status = "okay";
> > +       pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
> > +       pinctrl-names = "default";
> > +
> > +       bluetooth {
> > +               compatible = "brcm,bcm43438-bt";
> I have a question regarding the Broadcom Bluetooth compatible strings:
> Christian mentioned earlier that the Bluetooth controller identifies
> itself as BCM4335C0 (BCM4335 rev. C0)
>
> do we need to add a new compatible string (to
> Documentation/devicetree/bindings/net/broadcom-bluetooth.txt)?

Probably so. Without, how do you determine firmware filenames for example?

> if yes: should we also add a new of_device_id to hci_bcm.c or should
> board.dts simply use compatible = "brcm,bcm4335c0-bt",
> "brcm,bcm43438-bt"?

A fallback is fine. I'd probably drop the 'c0' part. Is that readable
from a register?

Rob

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-11 13:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 14:44 [PATCH] ARM64: dts: meson-gxbb-wetek: add ttyAML1 uart for Bluetooth chewitt
2018-09-04 19:05 ` Martin Blumenstingl
2018-09-04 19:42   ` Christian Hewitt
2018-09-07 12:15 ` [PATCH v2] " Christian Hewitt
2018-09-10 16:17   ` Rob Herring
2018-09-10 18:30   ` Martin Blumenstingl
2018-09-11 13:27     ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).