On Fri, Mar 13, 2020 at 12:12:18PM +0100, Rob Schmersel wrote:
> Hello,
>
> In order to use a SDIO based bwfm device a "NVRAM" configuration file
> will be needed besides the firmware file. This configuration file is
> expected to be in the /etc/firmware directory, in the form of
> brcmfmac{chip}-sdio.txt OR brcmfmac{chip}-sdio.nvram
>
> The need for this configuration file is not described in the man page.
> However the device will not be usable without one and an error message
> will be shown in the dmesg:
> "failed loadfirmware of file: brcmfmac{chip}-sdio.txt"
>
> Can I suggest to below attached patch.
>
> I'm a bit unsure on how to indicate where the configuration file comes from:
> Under Linux it is recommended that you read the NVRAM contents from
> EFI, which I don't think is possible to do under OpenBSD
>
> Hunting down the configuration file through your favorite search engine
> can be a frustrating excercise, although you can find them
> occasionally included in a windows driver or a linux distro.
>
> Question: Are there plans to include the NVRAM files in bwfm_firmware
> package?
It all depends! The NVRAM file is board-design-specific. So, let's
assume OpenBSD and NetBSD would each build their own machine, using
the same chip and firmware. The NVRAM file contains a configuration
for the chip, so that it e.g. can limit TX/antenna gain or whatever.
This is important for stuff like CE certification. There are quite a
few settings, so it's very likely that the one board's chip needs a
different configuration than the other one's chip.
So where do we get this file? If it's an x86-based machine, it's
likely they stored it as EFI variable. In OpenBSD, so far only the
ARM ports support calling into the Runtime Services using efi(4).
Since we don't have support for efi(4) on x86, OpenBSD cannot read
the EFI variables. For that you'll have to boot Linux, or some
other OS that has that feature. On some other x86 machines, the
vendor might provide the file as part of a Windows firmware package.
Is it different on ARMs? Well, yes, but not sure if worse or even
better. The NVRAM file can usually be found on the vendor's Github.
linux-firmware.git has started collecting and distributing some of
the files. So that will be a helpful source for us. Otherwise we
will have to collect them ourselves.
For ARM there's still one commit left so that we can supply per-
board NVRAM files more easily. In essence: We're working on it!
Patrick