Il giorno ven 17 apr 2020 alle ore 17:49 Guillaume Gardet
<guillaume.gar...@arm.com> ha scritto:
>
> Hi,
>
> > -----Original Message-----
> > From: Alessio Adamo <alessio.ad...@gmail.com>
> > Sent: 17 April 2020 15:35
> > To: Guillaume Gardet <guillaume.gar...@arm.com>
> > Cc: OS-arm <opensuse-arm@opensuse.org>
> > Subject: Re: [opensuse-arm] Possible bug in install-brcmfmac.sh [pkg 
> > bcm43xx-
> > firmware]
> >
> > Hi Guillaume,
> >
> > indeed that worked and I filed a bug to suggest the fix.
> > https://bugzilla.opensuse.org/show_bug.cgi?id=1169771
>
> Thanks.
>
> >
> > Now, what do you suggest to get to the next step, that is having a fully 
> > functional
> > Bluetooth stack?
> > I have managed to get Bluetooth working on my cubox-i, but that requires a 
> > .hcd
> > file not provided by the bcm43xx-firmware package, the program
> > brcm_patchram_plus and possibly an udev rule and a systemd service.
>
> That's weird you need so much additional things.
> Please explain what does each additional components and why they are needed.
> Someone else could provide some guidance here as well.

Basically, I had to replicate this package:
https://repo.solid-build.xyz/debian/buster/bsp-imx6/cuboxi-firmware-wireless_14.tar.xz
I had to place the right .hcd file in /lib/firmware/brcm
(BCM4330B1.hcd for the chip of my cubox-i) and just for convenience I
created a symlink named bcm4330.hcd.
Then I had to compile brcm_patchram_plus.c and place the compiled
program in /usr/sbin.
To activate the Bluetooth then I have to run

  /usr/sbin/brcm_patchram_plus --patchram /lib/firmware/brcm/4330.hcd
--baudrate 1500000 --use_baudrate_for_download /dev/ttymxc3
--enable_hci --no2bytes --tosleep=50000

In that package there is also a udev rule that conveniently starts a
systemd service based on the chip model found.

Content of /lib/udev/rules.d/60-cuboxi-bt.rules :
  # brcm4329 and 4330 bluetooth
  SUBSYSTEMS=="sdio", ATTRS{vendor}=="0x02d0",
ATTRS{device}=="0x4329",
ENV{SYSTEMD_WANTS}="brcm_patchram_plus@bcm4329.service"
  SUBSYSTEMS=="sdio", ATTRS{vendor}=="0x02d0",
ATTRS{device}=="0x4330",
ENV{SYSTEMD_WANTS}="brcm_patchram_plus@bcm4330.service"

Content of /usr/lib/systemd/system/brcm_patchram_plus@.service
  [Unit]
  Description=Broadcom bluetooth firmware loader
  ConditionPathExists=/dev/ttymxc3
  
ConditionPathExists=!/proc/device-tree/soc/aips-bus@02100000/serial@021f0000/bluetooth
  After=local-fs.target remote-fs.target

  [Service]
  Type=simple
  Restart=on-success
  ExecStart=/usr/sbin/brcm_patchram_plus --patchram
/lib/firmware/brcm/%I.hcd --baudrate 1500000
--use_baudrate_for_download /dev/ttymxc3 --enable_hci --no2bytes
--tosleep=50000

I hope this helps.

Alessio


>
> Cheers,
> Guillaume
>
>
> > Should I make a stand alone package and try to have it accepted, or should 
> > I ask
> > the maintainer to integrate everything into the bcm43xx-firmware package?
> >
> > Thanks for guidance.
> >
> > Kind regards,
> >
> > Alessio
> >
> > Il giorno ven 17 apr 2020 alle ore 09:13 Guillaume Gardet
> > <guillaume.gar...@arm.com> ha scritto:
> > >
> > > Hi Alessio,
> > >
> > > > -----Original Message-----
> > > > From: Alessio Adamo <alessio.ad...@gmail.com>
> > > > Sent: 16 April 2020 21:40
> > > > To: OS-arm <opensuse-arm@opensuse.org>
> > > > Subject: [opensuse-arm] Possible bug in install-brcmfmac.sh [pkg
> > > > bcm43xx- firmware]
> > > >
> > > > Hi everybody,
> > > >
> > > > I was trying to achieve Bluetooth activation on my cubox-i, and
> > > > while tinkering I realized a putative bug in the script
> > > > 'install-brcmfmac.sh' used by the package 'bcm43xx-firmware'.
> > > > The script parses the file '/sys/firmware/devicetree/base/compatible'
> > > > looking for 'solidrun,cubox-i', however it is not successful,
> > > > because in my personal case it actually retrieves 'solidrun,cubox-i/q'.
> > > > Because of this, the symbolic link
> > > > '/lib/firmware/brcm/brcmfmac4330-sdio.txt' is not created and
> > > > brcmfmac fails with the following error messages:
> > > >
> > > > [   21.774391] brcmfmac: brcmf_fw_alloc_request: using
> > > > brcm/brcmfmac4330-sdio for chip BCM4330/4
> > > > [   21.833131] brcmfmac mmc0:0001:1: Direct firmware load for
> > > > brcm/brcmfmac4330-sdio.solidrun,cubox-i/q.txt failed with error -2
> > > > [   21.833205] brcmfmac mmc0:0001:1: Direct firmware load for
> > > > brcm/brcmfmac4330-sdio.txt failed with error -2
> > > >
> > > > The content of '/sys/firmware/devicetree/base/compatible' is:
> > > > solidrun,cubox-i/q^@fsl,imx6q^@
> > > >
> > > > Probably because it is a Cubox-i Pro Quad Core.
> > > > Should the pattern for case statement be changed into
> > > >
> > > > solidrun,cubox-i|solidrun,cubox-i/q)
> > > >
> > > > ?
> > >
> > > Could you give it a try and also report this problem on
> > https://bugzilla.opensuse.org please?
> > >
> > > Thanks,
> > > Guillaume
> > >
> > > >
> > > > Ciao
> > > > Alessio
> > > > --
> > > > To unsubscribe, e-mail: opensuse-arm+unsubscr...@opensuse.org
> > > > To contact the owner, e-mail: opensuse-arm+ow...@opensuse.org
> > >
> > > IMPORTANT NOTICE: The contents of this email and any attachments are
> > confidential and may also be privileged. If you are not the intended 
> > recipient,
> > please notify the sender immediately and do not disclose the contents to any
> > other person, use it for any purpose, or store or copy the information in 
> > any
> > medium. Thank you.
> IMPORTANT NOTICE: The contents of this email and any attachments are 
> confidential and may also be privileged. If you are not the intended 
> recipient, please notify the sender immediately and do not disclose the 
> contents to any other person, use it for any purpose, or store or copy the 
> information in any medium. Thank you.
--
To unsubscribe, e-mail: opensuse-arm+unsubscr...@opensuse.org
To contact the owner, e-mail: opensuse-arm+ow...@opensuse.org

Reply via email to