2017-01-29 13:45:08

by Baruch Siach

[permalink] [raw]
Subject: [PATCH] hciattach: bcm43xx: delay reset after firmware download

The BCM43438 chip on the Raspberry Pi 3 board needs a delay after firmware
download for the setup to complete successfully.

Based on Yocto patch from Phil Elwell.
---
tools/hciattach_bcm43xx.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
index 81f38cbbcf92..1140379d5cc4 100644
--- a/tools/hciattach_bcm43xx.c
+++ b/tools/hciattach_bcm43xx.c
@@ -380,6 +380,7 @@ int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
return -1;
}

+ sleep(1);
if (bcm43xx_reset(fd))
return -1;
}
--
2.11.0



2017-02-01 20:10:19

by Baruch Siach

[permalink] [raw]
Subject: Re: [PATCH] hciattach: bcm43xx: delay reset after firmware download

Hi Marcel,

On Wed, Feb 01, 2017 at 08:50:10PM +0100, Marcel Holtmann wrote:
> > The BCM43438 chip on the Raspberry Pi 3 board needs a delay after firmware
> > download for the setup to complete successfully.
> >
> > Based on Yocto patch from Phil Elwell.
> > ---
> > tools/hciattach_bcm43xx.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
> > index 81f38cbbcf92..1140379d5cc4 100644
> > --- a/tools/hciattach_bcm43xx.c
> > +++ b/tools/hciattach_bcm43xx.c
> > @@ -380,6 +380,7 @@ int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
> > return -1;
> > }
> >
> > + sleep(1);
> > if (bcm43xx_reset(fd))
> > return -1;
> > }
>
> any reason not to use the hci_bcm driver support in recent kernels? That
> would be a lot better than hacking the old hciattach code.

Mainly the lack of device tree probe support in hci_bcm. I now see that Rob's
serial device work[1] would address that for hci_bcm. In the mean time,
hciattach is my only option, AFAIK.

[1] https://git.kernel.org/cgit/linux/kernel/git/robh/linux.git/log/?h=serial-bus-v4

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -

2017-02-01 19:50:10

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] hciattach: bcm43xx: delay reset after firmware download

Hi Baruch,

> The BCM43438 chip on the Raspberry Pi 3 board needs a delay after firmware
> download for the setup to complete successfully.
>
> Based on Yocto patch from Phil Elwell.
> ---
> tools/hciattach_bcm43xx.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
> index 81f38cbbcf92..1140379d5cc4 100644
> --- a/tools/hciattach_bcm43xx.c
> +++ b/tools/hciattach_bcm43xx.c
> @@ -380,6 +380,7 @@ int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
> return -1;
> }
>
> + sleep(1);
> if (bcm43xx_reset(fd))
> return -1;
> }

any reason not to use the hci_bcm driver support in recent kernels? That would be a lot better than hacking the old hciattach code.

Regards

Marcel