From: Eric Anholt <eric@anholt.net>
To: Stefan Wahren <stefan.wahren@i2se.com>,
Marcel Holtmann <marcel@holtmann.org>
Cc: "Rob Herring" <robh+dt@kernel.org>,
"Lukas Wunner" <lukas@wunner.de>,
"Johan Hedberg" <johan.hedberg@gmail.com>,
devicetree <devicetree@vger.kernel.org>,
"Loic Poulain" <loic.poulain@gmail.com>,
"Florian Fainelli" <f.fainelli@gmail.com>,
linux-rpi-kernel@lists.infradead.org,
"Mark Rutland" <mark.rutland@arm.com>,
"Phil Elwell" <phil@raspberrypi.org>,
"Frédéric Danis" <frederic.danis.oss@gmail.com>,
"Linux Bluetooth mailing list" <linux-bluetooth@vger.kernel.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/4] ARM: dts: bcm2835-rpi-zero-w: Add bcm43438 serial slave
Date: Wed, 07 Mar 2018 11:08:24 -0800 [thread overview]
Message-ID: <87sh9bvh3r.fsf@anholt.net> (raw)
In-Reply-To: <2071508922.276811.1520426568577@email.1und1.de>
[-- Attachment #1: Type: text/plain, Size: 4131 bytes --]
Stefan Wahren <stefan.wahren@i2se.com> writes:
> Hi Marcel,
> hi Loic,
>
>> Marcel Holtmann <marcel@holtmann.org> hat am 7. März 2018 um 13:12 geschrieben:
>>
>>
>> Hi Stefan,
>>
>> >>>>> Add BCM43438 (bluetooth) as a serdev slave device of uart0 (pl011/ttyAMA0).
>> >>>>> This allows to automatically insert the bcm43438 to the bluetooth
>> >>>>> subsystem instead of relying on patched userspace helpers (hciattach).
>> >>>>>
>> >>>>> In order to keep a debug UART we need to switch to uart1.
>> >>>>>
>> >>>>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> >>>>> ---
>> >>>>> arch/arm/boot/dts/bcm2835-rpi-zero-w.dts | 14 +++++++++++++-
>> >>>>> 1 file changed, 13 insertions(+), 1 deletion(-)
>> >>>>>
>> >>>>> diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
>> >>>>> index cf53436..b7f79f1 100644
>> >>>>> --- a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
>> >>>>> +++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
>> >>>>> @@ -131,6 +131,18 @@
>> >>>>>
>> >>>>> &uart0 {
>> >>>>> pinctrl-names = "default";
>> >>>>> - pinctrl-0 = <&uart0_gpio14>;
>> >>>>> + pinctrl-0 = <&uart0_gpio32 &uart0_ctsrts_gpio30>;
>> >>>>> + status = "okay";
>> >>>>> +
>> >>>>> + bluetooth {
>> >>>>> + compatible = "brcm,bcm43438-bt";
>> >>>>> + max-speed = <2000000>;
>> >>>>> + shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
>> >>>>> + };
>> >>>>> +};
>> >>>>
>> >>>> is the shutdown GPIO working as expected with this hardware. So even module unload and reload works fine?
>> >>>
>> >>> Yes, unload and reload works fine.
>> >>>
>> >>>> Meaning we are getting back to the 115200 default baud rate on the UART?
>> >>>
>> >>> I assume that, because reload works as expected.
>> >>
>> >> awesome. That is good news.
>> >>
>> >> Since you said that the GPIO expander driver for the RPi 3 has been accepted, did you test it there as well? If so, then it would be good to get a patch that also provides shutdown-gpios for RPi 3.
>> >
>> > after applying Loic's patch and the necessary patch for the RPi 3 dts file (see below), i will get this output:
>> >
>> > [ 4.873246] Bluetooth: HCI UART driver ver 2.3
>> > [ 4.873260] Bluetooth: HCI UART protocol H4 registered
>> > [ 4.873265] Bluetooth: HCI UART protocol Three-wire (H5) registered
>> > [ 4.873751] Bluetooth: HCI UART protocol Broadcom registered
>> > [ 4.877279] uart-pl011 3f201000.serial: no DMA platform data
>> > [ 6.952382] Bluetooth: hci0: command 0xfc18 tx timeout
>> > [ 15.192298] Bluetooth: hci0: BCM: failed to write update baudrate (-110)
>> > [ 15.192312] Bluetooth: hci0: Failed to set baudrate
>> > [ 15.316415] Bluetooth: hci0: BCM: chip id 94
>> > [ 15.318567] Bluetooth: hci0: BCM: features 0x2e
>> > [ 15.341538] Bluetooth: hci0: BCM43430A1
>> > [ 15.341560] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
>> > [ 19.112670] Bluetooth: hci0: BCM (001.002.009) build 0360
>> > [ 274.713732] Bluetooth: hci0: command 0x0c14 tx timeout
>> > [ 274.714085] Bluetooth: hci0: Frame reassembly failed (-84)
>> > [ 317.275941] Bluetooth: hci0: last event is not cmd complete (0x0f)
>> >
>> > I don't see these errors on RPi Zero W. Maybe the reason for this is the lack of hardware flowcontrol on RPi 3. Or some of the downstream patches on BlueZ must be adapted for the kernel [1].
>> >
>> > Btw the bcm43438 is detected even after unloading and reloading the driver. But the timeout occurs also on driver reload. Reducing the baudrate to 115200 doesn't help here.
>>
>> maybe it needs some time after switching the hardware on. Have you tried to sleep for a bit at the end of bcm_gpio_set_power?
>
> I will try, but this could also be an "issue" of the gpio expander
> driver. AFAIK the expander is connected via I2C to the GPU. In case
> the mailbox reply come before the I2C command has been handled by the
> GPIO expander, we are running out of sync.
The mailbox command for setting GPIO state is synchronous in terms of
sending the i2c command to the GPIO expander HW.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2018-03-07 19:08 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-25 14:10 [PATCH 0/4] ARM: bcm2835-rpi-zero-w: Enable Bluetooth support Stefan Wahren
2018-02-25 14:10 ` [PATCH 1/4] Bluetooth: hci_bcm: Make shutdown and device wake GPIO optional Stefan Wahren
2018-02-25 15:15 ` Lukas Wunner
2018-02-25 20:17 ` Marcel Holtmann
2018-02-25 14:10 ` [PATCH 2/4] ARM: dts: bcm283x: Apply pull settings to Zero W relevant groups Stefan Wahren
2018-02-25 14:10 ` [PATCH 3/4] ARM: dts: bcm2835-rpi-zero-w: Add bcm43438 serial slave Stefan Wahren
2018-02-25 20:17 ` Marcel Holtmann
2018-02-25 21:16 ` Stefan Wahren
2018-02-25 21:38 ` Marcel Holtmann
2018-02-27 18:51 ` Stefan Wahren
2018-03-04 21:58 ` Stefan Wahren
2018-03-05 5:19 ` Marcel Holtmann
2018-03-05 6:28 ` Stefan Wahren
2018-03-05 7:06 ` Marcel Holtmann
2018-03-05 7:55 ` Loic Poulain
2018-03-05 10:04 ` Marcel Holtmann
2018-03-07 11:28 ` Stefan Wahren
2018-03-07 12:08 ` Loic Poulain
2018-03-07 12:12 ` Marcel Holtmann
2018-03-07 12:42 ` Stefan Wahren
2018-03-07 13:35 ` Marcel Holtmann
2018-03-07 19:08 ` Eric Anholt [this message]
2018-03-07 19:35 ` Marcel Holtmann
2018-03-07 22:36 ` Eric Anholt
2018-03-08 0:02 ` Stefan Wahren
2018-03-08 9:14 ` Loic Poulain
2018-03-08 10:41 ` Marcel Holtmann
2018-03-08 10:56 ` Lukas Wunner
2018-03-08 12:08 ` Marcel Holtmann
2018-03-08 12:06 ` Marcel Holtmann
2018-02-25 14:10 ` [PATCH 4/4] ARM: bcm2385_defconfig: Enable BT support for BCM43438 Stefan Wahren
2018-02-26 23:31 ` Eric Anholt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sh9bvh3r.fsf@anholt.net \
--to=eric@anholt.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=frederic.danis.oss@gmail.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=loic.poulain@gmail.com \
--cc=lukas@wunner.de \
--cc=marcel@holtmann.org \
--cc=mark.rutland@arm.com \
--cc=phil@raspberrypi.org \
--cc=robh+dt@kernel.org \
--cc=stefan.wahren@i2se.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).