[PATCH RFC 0/5] nvmem: Add a UEFI variable backed NVMEM provider
Stephan Gerhold
stephan.gerhold at linaro.org
Thu Oct 15 09:27:46 PDT 2026
On Wed, Oct 14, 2026 at 04:02:38PM +0300, Abel Vesa wrote:
> This is an RFC: I do not expect it to be merged as-is, it is sent to get
> feedback on the approach.
>
> Some values a platform needs (for example the WLAN and Bluetooth MAC
> addresses on the Qualcomm laptops) are not always available to the kernel
> in a convenient form. They may live in firmware-owned SPI-NOR storage
> (e.g. a DPP partition) for which there is no straightforward, universally
> working way to read them from the non-secure world.
>
> As an alternative, this series allows such values to be provisioned once
> into a UEFI variable and consumed in the kernel. It adds a generic NVMEM
> provider that exposes the contents of a UEFI variable as an NVMEM device,
> so the data can be consumed through the standard nvmem-cells bindings.
> MAC addresses are just the motivating use case; the provider itself is
> generic.
>
> The first two patches are the actual proposal:
>
> - dt-bindings: nvmem: Add UEFI variable NVMEM provider
> - nvmem: Add UEFI variable NVMEM provider
>
> The remaining three patches are included only to illustrate how a
> consumer would use the provider; they are not meant for merging as part
> of this series:
>
> - Bluetooth: hci_qca: consume a "bd-address" nvmem cell
> - wifi: ath12k: consume a "mac-address" cell
> - arm64: dts: qcom: glymur-crd: wire both to a "MacAddresses" variable
>
> glymur-crd is used here only as a convenient example for the consumer
> patches.
>
> Feedback on the provider, and on whether sourcing such values from a UEFI
> variable is a reasonable approach when they cannot be read from the
> SPI-NOR directly, is very welcome.
>
> Assisted-by: LLM
> Signed-off-by: Abel Vesa <abel.vesa at oss.qualcomm.com>
In general, I think the idea to take NVMEM information from a UEFI
variable is reasonable. However, at the end the usability of this
approach depends on vendors actually provisioning the UEFI variable.
Is that the case for your "MacAddresses" example on Glymur laptops?
Is any of these laptops shipping with this UEFI variable provisioned?
I can't really imagine end users manually provisioning this variable.
We have too much manual setup required already to be able to use these
laptops with Linux. Ideally, we should take the information from
wherever Windows is taking it and make it work out of the box.
For existing Qualcomm laptops with the DPP partition on SPI-NOR, there
is prior work that could be extended. I would expect you only need:
1. SCM SPI-NOR storage support from
https://lore.kernel.org/linux-arm-msm/20260126-scm-storage-v2-v2-0-fa045c7e7699@radxa.com/
2. GPT partition parser (not sure if that exists for MTD but the format
is certainly well documented and supported already in Linux for
normal block devices)
3. DPP parser from
https://github.com/TravMurav/dtbloader/blob/main/src/qcom.c
4. Some way to hook it up in the device tree
See discussion in
https://lore.kernel.org/linux-arm-msm/de081bdc-4b10-4cbe-9b09-4652b63bc4b9@packett.cool/
The universal approach implemented here would obviously be cleaner, but
in my opinion it depends on vendors provisioning this variable before
shipping devices to customers.
Thanks,
Stephan
More information about the ath12k
mailing list