2019-05-27 13:23:31

by Neil Armstrong

[permalink] [raw]
Subject: [PATCH 02/10] arm64: dts: meson-gxm-khadas-vim2: fix Bluetooth support

From: Christian Hewitt <[email protected]>

- Remove serial1 alias
- Add support for uart_A rts/cts
- Add bluetooth uart_A subnode qith shutdown gpio

Fixes: b8b74dda3908 ("ARM64: dts: meson-gxm: Add support for Khadas VIM2")
Signed-off-by: Christian Hewitt <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
---
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
index 25079501f2bb..ff4f0780824d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
@@ -18,7 +18,6 @@

aliases {
serial0 = &uart_AO;
- serial1 = &uart_A;
serial2 = &uart_AO_B;
};

@@ -403,8 +402,14 @@
/* This one is connected to the Bluetooth module */
&uart_A {
status = "okay";
- pinctrl-0 = <&uart_a_pins>;
+ pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
pinctrl-names = "default";
+ uart-has-rtscts;
+
+ bluetooth {
+ compatible = "brcm,bcm43438-bt";
+ shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
+ };
};

/* This is brought out on the Linux_RX (18) and Linux_TX (19) pins: */
--
2.21.0


2019-05-27 18:43:36

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 02/10] arm64: dts: meson-gxm-khadas-vim2: fix Bluetooth support

On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <[email protected]> wrote:
>
> From: Christian Hewitt <[email protected]>
>
> - Remove serial1 alias
> - Add support for uart_A rts/cts
> - Add bluetooth uart_A subnode qith shutdown gpio
I tried this on my own Khadas VIM2:
Bluetooth: hci0: command 0x1001 tx timeout
Bluetooth: hci0: BCM: Reading local version info failed (-110)

I'm not sure whether this is specific to my board or what causes this.


Martin

2019-05-29 10:28:10

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 02/10] arm64: dts: meson-gxm-khadas-vim2: fix Bluetooth support

On 27/05/2019 20:36, Martin Blumenstingl wrote:
> On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <[email protected]> wrote:
>>
>> From: Christian Hewitt <[email protected]>
>>
>> - Remove serial1 alias
>> - Add support for uart_A rts/cts
>> - Add bluetooth uart_A subnode qith shutdown gpio
> I tried this on my own Khadas VIM2:
> Bluetooth: hci0: command 0x1001 tx timeout
> Bluetooth: hci0: BCM: Reading local version info failed (-110)
>
> I'm not sure whether this is specific to my board or what causes this.

Which kernel version ?

We often see this, growing the delay after probe removes this, it's kind of
random issue that occurs on pre-5.1 kernels.

Neil

>
>
> Martin
>

2019-05-29 18:11:35

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 02/10] arm64: dts: meson-gxm-khadas-vim2: fix Bluetooth support

On Wed, May 29, 2019 at 12:25 PM Neil Armstrong <[email protected]> wrote:
>
> On 27/05/2019 20:36, Martin Blumenstingl wrote:
> > On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <[email protected]> wrote:
> >>
> >> From: Christian Hewitt <[email protected]>
> >>
> >> - Remove serial1 alias
> >> - Add support for uart_A rts/cts
> >> - Add bluetooth uart_A subnode qith shutdown gpio
> > I tried this on my own Khadas VIM2:
> > Bluetooth: hci0: command 0x1001 tx timeout
> > Bluetooth: hci0: BCM: Reading local version info failed (-110)
> >
> > I'm not sure whether this is specific to my board or what causes this.
>
> Which kernel version ?
5.2-rc2

it's a Khadas VIM2 Basic (thus it has a AP6356S), board revision v1.2


Martin

2019-06-03 08:58:36

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 02/10] arm64: dts: meson-gxm-khadas-vim2: fix Bluetooth support

Hi,

On 29/05/2019 20:08, Martin Blumenstingl wrote:
> On Wed, May 29, 2019 at 12:25 PM Neil Armstrong <[email protected]> wrote:
>>
>> On 27/05/2019 20:36, Martin Blumenstingl wrote:
>>> On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <[email protected]> wrote:
>>>>
>>>> From: Christian Hewitt <[email protected]>
>>>>
>>>> - Remove serial1 alias
>>>> - Add support for uart_A rts/cts
>>>> - Add bluetooth uart_A subnode qith shutdown gpio
>>> I tried this on my own Khadas VIM2:
>>> Bluetooth: hci0: command 0x1001 tx timeout
>>> Bluetooth: hci0: BCM: Reading local version info failed (-110)
>>>
>>> I'm not sure whether this is specific to my board or what causes this.
>>
>> Which kernel version ?
> 5.2-rc2
>
> it's a Khadas VIM2 Basic (thus it has a AP6356S), board revision v1.2

Can you try with :

clocks = <&wifi32k>;
clock-names = "lpo";

added in the bluetooth node ?

Neil

>
>
> Martin
>

2019-06-03 16:57:35

by Christian Hewitt

[permalink] [raw]
Subject: Re: [PATCH 02/10] arm64: dts: meson-gxm-khadas-vim2: fix Bluetooth support

On 3 Jun 2019, at 12:57 pm, Neil Armstrong <[email protected]> wrote:
>
> On 29/05/2019 20:08, Martin Blumenstingl wrote:
>> On Wed, May 29, 2019 at 12:25 PM Neil Armstrong <[email protected]> wrote:
>>>
>>> On 27/05/2019 20:36, Martin Blumenstingl wrote:
>>>> On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <[email protected]> wrote:
>>>>>
>>>>> From: Christian Hewitt <[email protected]>
>>>>>
>>>>> - Remove serial1 alias
>>>>> - Add support for uart_A rts/cts
>>>>> - Add bluetooth uart_A subnode qith shutdown gpio
>>>> I tried this on my own Khadas VIM2:
>>>> Bluetooth: hci0: command 0x1001 tx timeout
>>>> Bluetooth: hci0: BCM: Reading local version info failed (-110)
>>>>
>>>> I'm not sure whether this is specific to my board or what causes this.
>>>
>>> Which kernel version ?
>> 5.2-rc2
>>
>> it's a Khadas VIM2 Basic (thus it has a AP6356S), board revision v1.2
>
> Can you try with :
>
> clocks = <&wifi32k>;
> clock-names = "lpo";
>
> added in the bluetooth node ?

Tested and confirmed working with rev 1.2 ‘basic' and 5.1 kernel with those nodes added.

VIM2:~ # dmesg | grep -i blue
[ 10.793600] Bluetooth: Core ver 2.22
[ 10.793792] Bluetooth: HCI device and connection manager initialized
[ 10.793814] Bluetooth: HCI socket layer initialized
[ 10.793821] Bluetooth: L2CAP socket layer initialized
[ 10.793851] Bluetooth: SCO socket layer initialized
[ 10.801928] Bluetooth: HCI UART driver ver 2.3
[ 10.801944] Bluetooth: HCI UART protocol H4 registered
[ 10.804919] Bluetooth: HCI UART protocol Broadcom registered
[ 10.805025] Bluetooth: HCI UART protocol QCA registered
[ 11.016629] Bluetooth: hci0: BCM: chip id 101
[ 11.018537] Bluetooth: hci0: BCM: features 0x2f
[ 11.043112] Bluetooth: hci0: BCM4354A2
[ 11.043134] Bluetooth: hci0: BCM4356A2 (001.003.015) build 0000
[ 11.075919] Bluetooth: Generic Bluetooth SDIO driver ver 0.1
[ 11.359784] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 11.359793] Bluetooth: BNEP filters: protocol multicast
[ 11.359811] Bluetooth: BNEP socket layer initialized
[ 17.075509] Bluetooth: hci0: BCM4356A2 (001.003.015) build 0266

I use BT remotes to avoid issues with multiple boards responding to IR so it was working before at some point. I assume I dropped a change somewhere in the process of feeding you the batch of patches - apologies!

Christian

2019-06-06 21:48:40

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [PATCH 02/10] arm64: dts: meson-gxm-khadas-vim2: fix Bluetooth support

On Mon, Jun 3, 2019 at 10:57 AM Neil Armstrong <[email protected]> wrote:
>
> Hi,
>
> On 29/05/2019 20:08, Martin Blumenstingl wrote:
> > On Wed, May 29, 2019 at 12:25 PM Neil Armstrong <[email protected]> wrote:
> >>
> >> On 27/05/2019 20:36, Martin Blumenstingl wrote:
> >>> On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <[email protected]> wrote:
> >>>>
> >>>> From: Christian Hewitt <[email protected]>
> >>>>
> >>>> - Remove serial1 alias
> >>>> - Add support for uart_A rts/cts
> >>>> - Add bluetooth uart_A subnode qith shutdown gpio
> >>> I tried this on my own Khadas VIM2:
> >>> Bluetooth: hci0: command 0x1001 tx timeout
> >>> Bluetooth: hci0: BCM: Reading local version info failed (-110)
> >>>
> >>> I'm not sure whether this is specific to my board or what causes this.
> >>
> >> Which kernel version ?
> > 5.2-rc2
> >
> > it's a Khadas VIM2 Basic (thus it has a AP6356S), board revision v1.2
>
> Can you try with :
>
> clocks = <&wifi32k>;
> clock-names = "lpo";
>
> added in the bluetooth node ?
that did it!

I think I also found the explanation why:
on my Khadas VIM2 SD card I don't have linux-firmware installed.
Thus the wifi driver will disable the 32kHz LPO clock again, breaking Bluetooth

are you going to send patches for the existing boards or do you want
someone else to do it?


Martin