From: Stefan Wahren <stefan.wahren@i2se.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "Eric Anholt" <eric@anholt.net>,
"Frédéric Danis" <frederic.danis.oss@gmail.com>,
"Bluez mailing list" <linux-bluetooth@vger.kernel.org>
Subject: Re: Problem with re-loading hci_uart.ko on RPi3
Date: Thu, 22 Feb 2018 15:26:23 +0100 (CET) [thread overview]
Message-ID: <2139019758.47998.1519309583130@email.1und1.de> (raw)
In-Reply-To: <68D82C47-F3AE-4E03-A687-A13F4F927310@holtmann.org>
Hi Marcel,
> Marcel Holtmann <marcel@holtmann.org> hat am 19. Februar 2018 um 19:58 ge=
schrieben:
>=20
>=20
> Hi Stefan,
>=20
> >>>>>>>>> One option is of course to keep the max-speed in the DT at 1152=
00 Mbps. It would work, but seriously slow down the transport. Maybe this s=
hould be done until we get access to the GPIOs.
> >>>>>>> So I am convinced when we run on hardware that has no GPIO resour=
ces exposed (as it is with RPi right now), we should limit the operational =
speed to the initialization speed. And then my problem actually goes away. =
It also forces people to get the GPIOs exposed or they have to stick with a=
slower HCI transport.
> >>>>>>=20
> >>>>>> We may also reset to initialization speed on module unload.
> >>>>>> This will allow multiple tests on the hardware, even if it does no=
t have GPIOs exposed.
> >>>>>=20
> >>>>> I prefer this solution instead of coding workarounds within the dev=
icetree.
> >>>>=20
> >>>> DT is actually for encoding workarounds for the hardware. If the GPI=
Os are not exposed, we are actually limited. However I am going to do that =
in the hci_bcm.c driver itself since it is a more wider problem. If the GPI=
O resources are not available, the device will actually not function. This =
is actually a valid assumption for all hardwired Bluetooth chips. They all =
have some GPIO or power control option. The only reason to not have GPIOs w=
ould be external development boards. So the RPi with the not exposed GPIOs =
is kinda broken hardware right now. That we got this far supporting Bluetoo=
th on it has to be considered pure luck :)
> >>>=20
> >>> only to make sure that we talking about the same, please take a look =
at my attempt for the RPi Zero W [1].
> >>>=20
> >>> Using the BT_ON signal as shutdown-gpio is not enough? I'm sorry i di=
dn't test the reload case yet.
> >>>=20
> >>> So after the implementation of the RPI firmware expander driver, we s=
till need this baudrate limitiation?
> >>>=20
> >>> Btw Baruch said that he will send a new version of his patch series s=
oon.
> >>>=20
> >>> [1] - https://github.com/lategoodbye/rpi-zero/commit/e3085c093e56364a=
69f2e32d35827635b95cf966
> >>=20
> >> before you include "shutdown-gpios =3D <&gpio 45 GPIO_ACTIVE_HIGH>;=E2=
=80=9D we might need to figure out on how the BT_ON GPIO is working and wha=
t it is suppose to be doing. But otherwise the patch fro the Zero W looks r=
ight to me.
> >>=20
> >> Also keep in mind that the current 4.16-rc2 kernel will require the sh=
utdown-gpios and device-wakeup-gpios both to be available. We have not yet =
tested this when only shutdown-gpios is available. You might need to modify=
bcm_get_resources and bcm_gpio_set_power to test this out.
> >=20
> > i think this contradicts to the binding documentation, which defines bo=
th as optional.
>=20
> the 4.15 kernel might be fine actually while the support for Apple hardwa=
re with Broadcom UART devices might have accidentally required this now. Ma=
ybe you just want to hack your kernel and see how it goes when just having =
the shutdown-gpios available.
>=20
> I am super curious if the firmware resets and falls back to the ROM state=
or if something is actually kept.
since i don't have any schematics about the BT part, i simply retested my p=
atches against 4.15 on RPi Zero W.
modprobe -r hci_uart
modprobe hci_uart
works without any issues:
[ 233.486208] Bluetooth: HCI UART driver ver 2.3
[ 233.486258] Bluetooth: HCI UART protocol H4 registered
[ 233.487189] hci_uart_bcm serial0-0: BCM irq: -22
[ 233.488382] Bluetooth: HCI UART protocol Broadcom registered
[ 233.641217] Bluetooth: hci0: BCM: chip id 94
[ 233.642081] Bluetooth: hci0: BCM: features 0x2e
[ 233.644283] Bluetooth: hci0: BCM43430A1
[ 233.644321] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000
[ 234.360569] Bluetooth: hci0: BCM (001.002.009) build 0325
After enabling bluetooth scanning i will see these error messages periodica=
lly:
[ 815.939839] Bluetooth: hci0: last event is not cmd complete (0x0f)
[ 831.302476] Bluetooth: hci0: last event is not cmd complete (0x0f)
[ 847.303953] Bluetooth: hci0: last event is not cmd complete (0x0f)
[ 863.305284] Bluetooth: hci0: last event is not cmd complete (0x0f)
[ 879.306838] Bluetooth: hci0: last event is not cmd complete (0x0f)
Btw: Linus Wallej applied the GPIO expander driver
Stefan
>=20
> Regards
>=20
> Marcel
>
next prev parent reply other threads:[~2018-02-22 14:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-17 21:09 Problem with re-loading hci_uart.ko on RPi3 Marcel Holtmann
2018-02-18 13:54 ` Stefan Wahren
2018-02-18 17:55 ` Stefan Wahren
2018-02-18 19:07 ` Marcel Holtmann
2018-02-19 10:10 ` Frédéric Danis
2018-02-19 12:25 ` Stefan Wahren
2018-02-19 13:16 ` Marcel Holtmann
2018-02-19 18:28 ` Stefan Wahren
2018-02-19 18:38 ` Marcel Holtmann
2018-02-19 18:53 ` Stefan Wahren
2018-02-19 18:58 ` Marcel Holtmann
2018-02-22 14:26 ` Stefan Wahren [this message]
2018-02-22 15:43 ` Marcel Holtmann
2018-02-22 18:05 ` Stefan Wahren
2018-02-22 18:50 ` Marcel Holtmann
2018-02-23 13:40 ` Stefan Wahren
2018-02-26 8:13 ` Marcel Holtmann
2018-02-26 9:36 ` Stefan Wahren
2018-02-26 13:59 ` Marcel Holtmann
2018-02-19 13:12 ` Marcel Holtmann
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=2139019758.47998.1519309583130@email.1und1.de \
--to=stefan.wahren@i2se.com \
--cc=eric@anholt.net \
--cc=frederic.danis.oss@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
/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