diff mbox series

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

Message ID 20190527132200.17377-3-narmstrong@baylibre.com (mailing list archive)
State New, archived
Headers show
Series arm64: meson-gx: misc fixes | expand

Commit Message

Neil Armstrong May 27, 2019, 1:21 p.m. UTC
From: Christian Hewitt <christianshewitt@gmail.com>

- 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 <christianshewitt@gmail.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Martin Blumenstingl May 27, 2019, 6:36 p.m. UTC | #1
On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> From: Christian Hewitt <christianshewitt@gmail.com>
>
> - 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
Neil Armstrong May 29, 2019, 10:25 a.m. UTC | #2
On 27/05/2019 20:36, Martin Blumenstingl wrote:
> On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
>>
>> From: Christian Hewitt <christianshewitt@gmail.com>
>>
>> - 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
>
Martin Blumenstingl May 29, 2019, 6:08 p.m. UTC | #3
On Wed, May 29, 2019 at 12:25 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> On 27/05/2019 20:36, Martin Blumenstingl wrote:
> > On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
> >>
> >> From: Christian Hewitt <christianshewitt@gmail.com>
> >>
> >> - 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
Neil Armstrong June 3, 2019, 8:57 a.m. UTC | #4
Hi,

On 29/05/2019 20:08, Martin Blumenstingl wrote:
> On Wed, May 29, 2019 at 12:25 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
>>
>> On 27/05/2019 20:36, Martin Blumenstingl wrote:
>>> On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
>>>>
>>>> From: Christian Hewitt <christianshewitt@gmail.com>
>>>>
>>>> - 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
>
Christian Hewitt June 3, 2019, 11:57 a.m. UTC | #5
On 3 Jun 2019, at 12:57 pm, Neil Armstrong <narmstrong@baylibre.com> wrote:
> 
> On 29/05/2019 20:08, Martin Blumenstingl wrote:
>> On Wed, May 29, 2019 at 12:25 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
>>> 
>>> On 27/05/2019 20:36, Martin Blumenstingl wrote:
>>>> On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
>>>>> 
>>>>> From: Christian Hewitt <christianshewitt@gmail.com>
>>>>> 
>>>>> - 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
Martin Blumenstingl June 6, 2019, 7:52 p.m. UTC | #6
On Mon, Jun 3, 2019 at 10:57 AM Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> Hi,
>
> On 29/05/2019 20:08, Martin Blumenstingl wrote:
> > On Wed, May 29, 2019 at 12:25 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
> >>
> >> On 27/05/2019 20:36, Martin Blumenstingl wrote:
> >>> On Mon, May 27, 2019 at 3:22 PM Neil Armstrong <narmstrong@baylibre.com> wrote:
> >>>>
> >>>> From: Christian Hewitt <christianshewitt@gmail.com>
> >>>>
> >>>> - 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
diff mbox series

Patch

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: */