Issues over broadcom brcmfmac43455 firmware

Bug #2013027 reported by Sergio Callegari
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-firmware (Ubuntu)
Expired
Undecided
Unassigned
linux-firmware-raspi2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Hi, I have a Kodlix Z83-II minicomputer that employs a broadcom chipset for WIFI.

The only way to make wifi on that PC work is to use the firmware from the windows image, even if that chipset is apparently managed in ubuntu.

With the firmware files provided by ubuntu you get no 5GHz for wifi. The problem is that every time ubuntu updates the firmware package, firmware files dropped in /lib/firmware get overwritten, linking to some file in the cypress sub-directory.

- Ideally, Ubuntu should provide all the firmware files that might be needed. Maybe this is not possible as there is a too large variety of different firmwares for broadcom chipsets or licesing issues preventing distribution.

- As a second possibility, there should be a way to drop files in /lib/firmware 'side to side' to the distro ones, without having the risk of finding the manually added files rewritten. This implies that different pieces of hardware use firmware files with different filenames. Don't know if this is truly possible, as I do not know how the linux kernel decides the name of the firmware to load.

- In cases like mine, it seems that the ubuntu firmware package puts in place symlinks to have brcmfmac43455 files point to the corresponding cypress cyfmac43455 files. Possibly, the package could avoid creating the symlinks if a brcmfmac43455 file is manually placed in lib/firmware.

- As a last resort, I think that the documentation in `/usr/share/doc/linux-firmware` should be augmented to describe the most appropriate way to prevent custom firmware files from being rewritten: marking files not-writable? introducing diversions?

Tags: kern-6281
Revision history for this message
Juerg Haefliger (juergh) wrote :

Please run 'apport-collect 2013027' and attach dmesg from both when using the original ubuntu and the windows firmware.

Changed in linux-firmware-raspi2 (Ubuntu):
status: New → Invalid
Juerg Haefliger (juergh)
Changed in linux-firmware (Ubuntu):
status: New → Incomplete
Revision history for this message
Sergio Callegari (callegar) wrote :

>apport-collect 2013027' and attach dmesg from both when using the original ubuntu and the windows firmware.

I'll add dmesg after re-install of of the original linux-firmware from ubuntu which should be close to what original ubuntu does but might not be totally equivalent to it in case some non-ubuntu file is not overwritten/removed. Hope it'll be OK.

Juerg Haefliger (juergh)
tags: added: kern-6281
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux-firmware (Ubuntu) because there has been no activity for 60 days.]

Changed in linux-firmware (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Sergio Callegari (callegar) wrote :

Reopened as I see the issue again...

Changed in linux-firmware-raspi2 (Ubuntu):
status: Invalid → New
Changed in linux-firmware (Ubuntu):
status: Expired → New
Revision history for this message
Sergio Callegari (callegar) wrote :
Revision history for this message
Sergio Callegari (callegar) wrote :
Revision history for this message
Sergio Callegari (callegar) wrote :
Revision history for this message
Sergio Callegari (callegar) wrote :

Hope that now all what is needed to identify the issue is available.

Revision history for this message
Juerg Haefliger (juergh) wrote :

If you want to keep your own firmware files and not have them being overwritten by firmware package upgrades, you can (I believe) use dpkg-divert. I don't know the exact command usage for this but you can instruct the system to place some files from linux-firmware somewhere else so that you can replace them with a local copy that doesn't get overwritten by package upgrades.

Revision history for this message
Juerg Haefliger (juergh) wrote (last edit ):

From the two dmesgs that you uploaded it looks like the same firmware binary is loaded:

dmesg with ubuntu firmware:
[ 16.730410] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Apr 15 2021 03:03:20 version 7.45.234 (4ca95bb CY) FWID 01-996384e2

dmesg with the correct firmware:
[ 16.842154] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Apr 15 2021 03:03:20 version 7.45.234 (4ca95bb CY) FWID 01-996384e2

It could be that you simply need a different sdio.txt. As you can see, the driver tries to load a board specific sdio which is not present for your HW:
[ 16.697501] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.AZW-Z83 II.txt failed with error -2

Can you copy your brcmfmac43455-sdio.txt to '/lib/firmware/brcm/brcmfmac43455-sdio.AZW-Z83 II.txt` (note the space in the filename), reload the driver (or reboot), check dmesg that it was loaded and see if it makes a difference?

Changed in linux-firmware (Ubuntu):
status: New → Incomplete
Changed in linux-firmware-raspi2 (Ubuntu):
status: New → Invalid
Revision history for this message
Sergio Callegari (callegar) wrote (last edit ):

I have diagnosed the problem as follows.

My broadcom 43455 adapter needs:

1. a different brcmfmac43455-sdio.txt file from the one supplied in ubuntu, which is a cypress provided version.

2. a different brcmfmac43455-sdio.bin file from the one supplied in ubuntu, that again is a cypress provided version

3. a different brcmfmac43455-sdio.clm_blob file from the one supplied in ubuntu

Now, 1 and 2 are no issue: I can supply the files needed by my hardware and put them side to side to the ubuntu supplied ones. This is because the system will seek `brcmfmac43455-sdio.AZW-Z83 II.{txt, bin} first.
Incidentally, the txt file can be easily taken from the nvram of my system, while the bin file is the one that is supplied in armbian, libreelec etc, that for some reason is not the same as the cypress one found in ubuntu.

The real problem is 3. And this is because without the file made for my hardware, the wifi will work in the 2.4 GHz band, but not in the 5GHz band. However the file name for this does not appear to be adapted to my system. Namely, if I put a 'brcmfmac43455-sdio.AZW-Z83 II.clm_blob' file side to side to 'brcmfmac43455-sdio.clm_blob' the former will be ignored.

This makes it impossible to place board specific brcm files *side to side* the those currently specified by the distro (unless I miss something). If this is the case, then there are two possible workarounds:

1. Make a local diversion for the clm_blob file or build a deb file with it
2. Use the brcmfmac module option `alternative_fw_path` to specify and alternative firmware path for my brcm hardware and put my bin, txt and clm_blob files there

However, I really tend to think that these are just ugly workarounds for what is ultimately an issue with the brcmfmac kernel module. If the module can determine that for my board the filename should be `brcmfmac43455-sdio.AZW-Z83 II.{txt,bin}` for the txt and bin pieces of the firmware, then why cannot it look at `brcmfmac43455-sdio.AZW-Z83 II.clm_blob` before falling back to `brcmfmac43455-sdio.clm_blob`? That would make it easy to put different firmwares in the the brcm firmware directory side by side and make the framework that is already there for the txt and bin files actually useful.

Please consider reopening the issue, passing it to the brcmfmac maintainers.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux-firmware (Ubuntu) because there has been no activity for 60 days.]

Changed in linux-firmware (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Juerg Haefliger (juergh) wrote :

Not sure why you think the driver doesn't load a vendored clm_blob. That works fine on a Raspberry Pi.

Revision history for this message
Sergio Callegari (callegar) wrote :

As mentioned it does not here. My system looks for the file `brcmfmac43455-sdio.clm_blob` not for `rcmfmac43455-sdio.<something>.clm_blob`, with <something> being the same as for the `brcmfmac43455-sdio.<something>.txt`. Maybe the system firmware has a role in this...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.