mbox series

[v1,0/2] riscv: dts: starfive: Enable Bluetooth on JH7100 boards

Message ID 20240508111604.887466-1-emil.renner.berthing@canonical.com (mailing list archive)
Headers show
Series riscv: dts: starfive: Enable Bluetooth on JH7100 boards | expand

Message

Emil Renner Berthing May 8, 2024, 11:15 a.m. UTC
This series enables the in-kernel Bluetooth driver to work with the
Broadcom Wifi/Bluetooth module on the BeagleV Starlight and StarFive
VisionFive V1 boards.

Previously Bluetooth only worked with some GPIO twiddling and a custom
program to load firmware from userspace.

Emil Renner Berthing (2):
  riscv: dts: starfive: Add JH7100 high speed UARTs
  riscv: dts: starfive: Enable Bluetooth on JH7100 boards

 .../boot/dts/starfive/jh7100-common.dtsi      | 49 +++++++++++++++++++
 arch/riscv/boot/dts/starfive/jh7100.dtsi      | 26 ++++++++++
 2 files changed, 75 insertions(+)

Comments

Andreas Schwab May 10, 2024, 7:42 a.m. UTC | #1
On Mai 08 2024, Emil Renner Berthing wrote:

> This series enables the in-kernel Bluetooth driver to work with the
> Broadcom Wifi/Bluetooth module on the BeagleV Starlight and StarFive
> VisionFive V1 boards.

That does not work for me:

[  +0.369276] Bluetooth: hci0: command 0x1001 tx timeout
[  +0.025545] Bluetooth: hci0: BCM: Reading local version info failed (-110)
Emil Renner Berthing May 10, 2024, 9:02 a.m. UTC | #2
Andreas Schwab wrote:
> On Mai 08 2024, Emil Renner Berthing wrote:
>
> > This series enables the in-kernel Bluetooth driver to work with the
> > Broadcom Wifi/Bluetooth module on the BeagleV Starlight and StarFive
> > VisionFive V1 boards.
>
> That does not work for me:
>
> [  +0.369276] Bluetooth: hci0: command 0x1001 tx timeout
> [  +0.025545] Bluetooth: hci0: BCM: Reading local version info failed (-110)

Hi Andreas,

You don't include any information useful for debugging this, but if it get's
far enough to load the firmware could you at least make sure you run the
version below, so that's at least the same.

https://github.com/esmil/linux/blob/visionfive/firmware/brcm/BCM43430A1.hcd

/Emil
Andreas Schwab May 10, 2024, 9:35 a.m. UTC | #3
On Mai 10 2024, Emil Renner Berthing wrote:

> You don't include any information useful for debugging this, but if it get's
> far enough to load the firmware could you at least make sure you run the
> version below, so that's at least the same.
>
> https://github.com/esmil/linux/blob/visionfive/firmware/brcm/BCM43430A1.hcd

That didn't change anything (and there are no messages related to
firmware loading from hci_uart).

[  +0.879623] Bluetooth: Core ver 2.22
[  +0.004843] NET: Registered PF_BLUETOOTH protocol family
[  +0.008787] Bluetooth: HCI device and connection manager initialized
[  +0.021944] Bluetooth: HCI socket layer initialized
[  +0.008488] Bluetooth: L2CAP socket layer initialized
[  +0.006333] Bluetooth: SCO socket layer initialized
[  +0.097478] Bluetooth: HCI UART driver ver 2.3
[  +0.007943] Bluetooth: HCI UART protocol H4 registered
[  +0.006066] Bluetooth: HCI UART protocol BCSP registered
[  +0.006962] Bluetooth: HCI UART protocol LL registered
[  +0.000015] Bluetooth: HCI UART protocol ATH3K registered
[  +0.000084] Bluetooth: HCI UART protocol Three-wire (H5) registered
[  +0.000247] Bluetooth: HCI UART protocol Intel registered
[  +0.000455] Bluetooth: HCI UART protocol Broadcom registered
[  +0.000084] Bluetooth: HCI UART protocol QCA registered
[  +0.000008] Bluetooth: HCI UART protocol AG6XX registered
[  +0.000057] Bluetooth: HCI UART protocol Marvell registered
[  +0.051854] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
[  +0.000387] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
[  +0.094658] hci_uart_bcm serial0-0: No reset resource, using default baud rate
[  +0.990297] Bluetooth: hci0: command 0x1001 tx timeout
[  +0.022893] Bluetooth: hci0: BCM: Reading local version info failed (-110)
[  +3.306159] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[  +0.013336] Bluetooth: BNEP filters: protocol multicast
[  +0.124262] Bluetooth: BNEP socket layer initialized
Conor Dooley May 28, 2024, 11:30 a.m. UTC | #4
Emil,

On Fri, May 10, 2024 at 11:35:34AM +0200, Andreas Schwab wrote:
> On Mai 10 2024, Emil Renner Berthing wrote:
> 
> > You don't include any information useful for debugging this, but if it get's
> > far enough to load the firmware could you at least make sure you run the
> > version below, so that's at least the same.
> >
> > https://github.com/esmil/linux/blob/visionfive/firmware/brcm/BCM43430A1.hcd
> 
> That didn't change anything (and there are no messages related to
> firmware loading from hci_uart).

Looking at things to apply post -rc1, are you still looking into this
issue?

Thanks,
Conor.

> 
> [  +0.879623] Bluetooth: Core ver 2.22
> [  +0.004843] NET: Registered PF_BLUETOOTH protocol family
> [  +0.008787] Bluetooth: HCI device and connection manager initialized
> [  +0.021944] Bluetooth: HCI socket layer initialized
> [  +0.008488] Bluetooth: L2CAP socket layer initialized
> [  +0.006333] Bluetooth: SCO socket layer initialized
> [  +0.097478] Bluetooth: HCI UART driver ver 2.3
> [  +0.007943] Bluetooth: HCI UART protocol H4 registered
> [  +0.006066] Bluetooth: HCI UART protocol BCSP registered
> [  +0.006962] Bluetooth: HCI UART protocol LL registered
> [  +0.000015] Bluetooth: HCI UART protocol ATH3K registered
> [  +0.000084] Bluetooth: HCI UART protocol Three-wire (H5) registered
> [  +0.000247] Bluetooth: HCI UART protocol Intel registered
> [  +0.000455] Bluetooth: HCI UART protocol Broadcom registered
> [  +0.000084] Bluetooth: HCI UART protocol QCA registered
> [  +0.000008] Bluetooth: HCI UART protocol AG6XX registered
> [  +0.000057] Bluetooth: HCI UART protocol Marvell registered
> [  +0.051854] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
> [  +0.000387] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
> [  +0.094658] hci_uart_bcm serial0-0: No reset resource, using default baud rate
> [  +0.990297] Bluetooth: hci0: command 0x1001 tx timeout
> [  +0.022893] Bluetooth: hci0: BCM: Reading local version info failed (-110)
> [  +3.306159] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
> [  +0.013336] Bluetooth: BNEP filters: protocol multicast
> [  +0.124262] Bluetooth: BNEP socket layer initialized
> 
> -- 
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
> "And now for something completely different."
Andreas Schwab May 28, 2024, 3:37 p.m. UTC | #5
On Mai 28 2024, Conor Dooley wrote:

> Looking at things to apply post -rc1, are you still looking into this
> issue?

I don't know what to look for.
Conor Dooley May 28, 2024, 3:38 p.m. UTC | #6
On Tue, May 28, 2024 at 05:37:32PM +0200, Andreas Schwab wrote:
> On Mai 28 2024, Conor Dooley wrote:
> 
> > Looking at things to apply post -rc1, are you still looking into this
> > issue?
> 
> I don't know what to look for.

Fortunately for you, it is Emil I was asking :) I thought I'd addressed
the mail to him.
Emil Renner Berthing May 29, 2024, 8:49 a.m. UTC | #7
Andreas Schwab wrote:
> On Mai 10 2024, Emil Renner Berthing wrote:
>
> > You don't include any information useful for debugging this, but if it get's
> > far enough to load the firmware could you at least make sure you run the
> > version below, so that's at least the same.
> >
> > https://github.com/esmil/linux/blob/visionfive/firmware/brcm/BCM43430A1.hcd
>
> That didn't change anything (and there are no messages related to
> firmware loading from hci_uart).
>
> [  +0.879623] Bluetooth: Core ver 2.22
> [  +0.004843] NET: Registered PF_BLUETOOTH protocol family
> [  +0.008787] Bluetooth: HCI device and connection manager initialized
> [  +0.021944] Bluetooth: HCI socket layer initialized
> [  +0.008488] Bluetooth: L2CAP socket layer initialized
> [  +0.006333] Bluetooth: SCO socket layer initialized
> [  +0.097478] Bluetooth: HCI UART driver ver 2.3
> [  +0.007943] Bluetooth: HCI UART protocol H4 registered
> [  +0.006066] Bluetooth: HCI UART protocol BCSP registered
> [  +0.006962] Bluetooth: HCI UART protocol LL registered
> [  +0.000015] Bluetooth: HCI UART protocol ATH3K registered
> [  +0.000084] Bluetooth: HCI UART protocol Three-wire (H5) registered
> [  +0.000247] Bluetooth: HCI UART protocol Intel registered
> [  +0.000455] Bluetooth: HCI UART protocol Broadcom registered
> [  +0.000084] Bluetooth: HCI UART protocol QCA registered
> [  +0.000008] Bluetooth: HCI UART protocol AG6XX registered
> [  +0.000057] Bluetooth: HCI UART protocol Marvell registered
> [  +0.051854] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
> [  +0.000387] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
> [  +0.094658] hci_uart_bcm serial0-0: No reset resource, using default baud rate
> [  +0.990297] Bluetooth: hci0: command 0x1001 tx timeout
> [  +0.022893] Bluetooth: hci0: BCM: Reading local version info failed (-110)
> [  +3.306159] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
> [  +0.013336] Bluetooth: BNEP filters: protocol multicast
> [  +0.124262] Bluetooth: BNEP socket layer initialized

Oddly it doesn't work on my Starlight board either. I was thinking the firmware
might set up pinconf differently, but comparing

  /sys/kernel/debug/pinctrl/11910000.pinctrl-pinctrl-starfive/pinconf-pins

on the two boards shows no differences. I've also not been able to spot any
differences in how the AP6236 module is connected in the schematics for the two
boards, so not really sure how to proceed.

If you're also testing on the Starlight board then I can update the
patch to just
enable Bluetooth on that I guess.

/Emil
Emil Renner Berthing May 29, 2024, 8:57 a.m. UTC | #8
Emil Renner Berthing wrote:
> Andreas Schwab wrote:
> > On Mai 10 2024, Emil Renner Berthing wrote:
> >
> > > You don't include any information useful for debugging this, but if it get's
> > > far enough to load the firmware could you at least make sure you run the
> > > version below, so that's at least the same.
> > >
> > > https://github.com/esmil/linux/blob/visionfive/firmware/brcm/BCM43430A1.hcd
> >
> > That didn't change anything (and there are no messages related to
> > firmware loading from hci_uart).
> >
> > [  +0.879623] Bluetooth: Core ver 2.22
> > [  +0.004843] NET: Registered PF_BLUETOOTH protocol family
> > [  +0.008787] Bluetooth: HCI device and connection manager initialized
> > [  +0.021944] Bluetooth: HCI socket layer initialized
> > [  +0.008488] Bluetooth: L2CAP socket layer initialized
> > [  +0.006333] Bluetooth: SCO socket layer initialized
> > [  +0.097478] Bluetooth: HCI UART driver ver 2.3
> > [  +0.007943] Bluetooth: HCI UART protocol H4 registered
> > [  +0.006066] Bluetooth: HCI UART protocol BCSP registered
> > [  +0.006962] Bluetooth: HCI UART protocol LL registered
> > [  +0.000015] Bluetooth: HCI UART protocol ATH3K registered
> > [  +0.000084] Bluetooth: HCI UART protocol Three-wire (H5) registered
> > [  +0.000247] Bluetooth: HCI UART protocol Intel registered
> > [  +0.000455] Bluetooth: HCI UART protocol Broadcom registered
> > [  +0.000084] Bluetooth: HCI UART protocol QCA registered
> > [  +0.000008] Bluetooth: HCI UART protocol AG6XX registered
> > [  +0.000057] Bluetooth: HCI UART protocol Marvell registered
> > [  +0.051854] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
> > [  +0.000387] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
> > [  +0.094658] hci_uart_bcm serial0-0: No reset resource, using default baud rate
> > [  +0.990297] Bluetooth: hci0: command 0x1001 tx timeout
> > [  +0.022893] Bluetooth: hci0: BCM: Reading local version info failed (-110)
> > [  +3.306159] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
> > [  +0.013336] Bluetooth: BNEP filters: protocol multicast
> > [  +0.124262] Bluetooth: BNEP socket layer initialized
>
> Oddly it doesn't work on my Starlight board either. I was thinking the firmware
> might set up pinconf differently, but comparing
>
>   /sys/kernel/debug/pinctrl/11910000.pinctrl-pinctrl-starfive/pinconf-pins
>
> on the two boards shows no differences. I've also not been able to spot any
> differences in how the AP6236 module is connected in the schematics for the two
> boards, so not really sure how to proceed.
>
> If you're also testing on the Starlight board then I can update the patch to just
> enable Bluetooth on that I guess.

* I meant update the patch to only enable bluetooth on the VisionFive V1 of
  course.

/Emil
Andreas Schwab May 29, 2024, 3:53 p.m. UTC | #9
On Mai 29 2024, Emil Renner Berthing wrote:

> Oddly it doesn't work on my Starlight board either. I was thinking the firmware
> might set up pinconf differently, but comparing
>
>   /sys/kernel/debug/pinctrl/11910000.pinctrl-pinctrl-starfive/pinconf-pins
>
> on the two boards shows no differences. I've also not been able to spot any
> differences in how the AP6236 module is connected in the schematics for the two
> boards, so not really sure how to proceed.

I see no difference between Starlight and Visionfive boards, both fail
the same way.

I also see that sometimes the firmware greeting from brcmfmac occurs
_after_ the timeout error from hci0:

# journalctl -b -2 | grep -e brcmf_c_preinit_dcmds -e hci0:
May 16 12:01:54 beaglev kernel: Bluetooth: hci0: command 0x1001 tx timeout
May 16 12:01:54 beaglev kernel: Bluetooth: hci0: BCM: Reading local version info failed (-110)
May 16 12:01:54 beaglev kernel: brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766

Is this perhaps a race with the firmware loading?
Samuel Holland May 29, 2024, 7:30 p.m. UTC | #10
Hi Andreas,

On 2024-05-29 10:53 AM, Andreas Schwab wrote:
> On Mai 29 2024, Emil Renner Berthing wrote:
> 
>> Oddly it doesn't work on my Starlight board either. I was thinking the firmware
>> might set up pinconf differently, but comparing
>>
>>   /sys/kernel/debug/pinctrl/11910000.pinctrl-pinctrl-starfive/pinconf-pins
>>
>> on the two boards shows no differences. I've also not been able to spot any
>> differences in how the AP6236 module is connected in the schematics for the two
>> boards, so not really sure how to proceed.
> 
> I see no difference between Starlight and Visionfive boards, both fail
> the same way.
> 
> I also see that sometimes the firmware greeting from brcmfmac occurs
> _after_ the timeout error from hci0:
> 
> # journalctl -b -2 | grep -e brcmf_c_preinit_dcmds -e hci0:
> May 16 12:01:54 beaglev kernel: Bluetooth: hci0: command 0x1001 tx timeout
> May 16 12:01:54 beaglev kernel: Bluetooth: hci0: BCM: Reading local version info failed (-110)
> May 16 12:01:54 beaglev kernel: brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766
> 
> Is this perhaps a race with the firmware loading?

brcmfmac is the WiFi driver. The WiFi and Bluetooth parts of the module are
functionally independent -- different drivers, different firmware, different DT
nodes. So the brcmfmac line is not relevant to debugging Bluetooth issues.

If the Bluetooth part has some dependency (pinconf, reset pin, clock, regulator,
etc.), then such dependency must be declared specifically for the Bluetooth in
the DT. Those seem to be correct, so maybe the issue is the maximum UART
frequency, if the signal integrity is marginal. Have you tried reducing that?

Regards,
Samuel
Andreas Schwab May 29, 2024, 7:49 p.m. UTC | #11
On Mai 29 2024, Samuel Holland wrote:

> If the Bluetooth part has some dependency (pinconf, reset pin, clock, regulator,
> etc.), then such dependency must be declared specifically for the Bluetooth in
> the DT. Those seem to be correct, so maybe the issue is the maximum UART
> frequency, if the signal integrity is marginal. Have you tried reducing that?

How to do that?