Re: [PATCH v3 1/3] brcmfmac: Add support for BCM4378 on Apple hardware (with their special OTP).

From: Aditya Garg
Date: Fri Dec 03 2021 - 01:41:59 EST




> On 03-Nov-2021, at 1:58 PM, Hector Martin <marcan@xxxxxxxxx> wrote:
>
> Hi,
>
> I'd been meaning to rewrite this patch because it's such a mess, but since we're here... (CCing some relevant folks)
>
> Overall: this patch combines a ton of unrelated random changes, many of which without explanation, with some completely crazy approaches. Stan (CC'ed) has so far refused to interact with the kernel community in any way whatsoever, and I do not feel comfortable using his patches without thorough review, including reverse engineering the changes to figure out what they actually do and why. We've already gone through this with some of his other patches, which ended up being largely rewritten or entirely dropped in the end.
>
> The firmware situation with this patch is completely unacceptable. It seems the original intent here is to have users load the driver, have it print the required firmware version, and then expect users to copy specifically that firmware file set from macOS, and reload again. This is obviously not the right way to do this. We need to statically copy all firmware from macOS/recovery mode with a naming scheme that this driver can use, at initial install time, and it needs to dynamically select the right firmware for any given platform it is booted on.
>
> The main issue with these machines is that there is a large set of required firmware variants; a few core firmware files plus many nvram variants for different hardware modules and device revisions. A lot of them are identical and can be symlinked, but we need to work out a naming scheme for these variations. There are several more dimensions of nvram selection than what we're used to on Linux.
Update on the firmware situation :-
Thanks to this commit (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/wireless/broadcom/brcm80211/brcmfmac?h=v5.16-rc3&id=5ff013914c62c493c206d70554cfb1d311ea481a), we can have model specific .bin files for Macs.
Example :- brcmfmac4364-pcie.Apple Inc.-MacBookPro16,1.bin is the file specific to MacBook Pro 16 inch, 2019

We would need something like this for the .clm_blob files, that is we would want additional support for per board suffix clm_blob files. This should solve the firmware problem for .bin and .clm_blob files. A patch to get the same feature would be appreciated. I am Ccing the original author of the above commit too.

Next we have is the .txt NVRAM file. This seems tricky cause I haven't been able to find a way to get the module version, on which the variants depend on.