dt-bindings: net: wireless: brcm,bcm4329-fmac: add nvmem-consumer reference
Subsystems (2)
PATCH 1/1 dt-bindings: net: wireless: brcm,bcm4329-fmac: add nvmem-consumer reference
The brcm,bcm4329-fmac binding has unevaluatedProperties set to false but does not allow nvmem-cells or nvmem-cell-names, which are used by DTS files (e.g. bcm4709-linksys-ea9200.dts) to supply MAC addresses.
The driver already supports nvmem-based MAC address retrieval via of_get_mac_address(), so add the nvmem-consumer schema reference to document and allow these properties.
Fixes warnings with users:
['brcm,bcm4366-fmac', 'brcm,bcm4329-fmac'] does not contain items matching the given schema from schema $id: http://devicetree.org/schemas/pci/pci-bus-common.yaml
Unevaluated properties are not allowed ('nvmem-cell-names', 'nvmem-cells' were unexpected)
--- .../devicetree/bindings/net/wireless/brcm,bcm4329-fmac.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/net/wireless/brcm,bcm4329-fmac.yaml +1 -0
@@ -17,6 +17,7 @@ description: allOf: - $ref: /schemas/net/wireless/wireless-controller.yaml# + - $ref: /schemas/nvmem/nvmem-consumer.yaml# properties: compatible:
Signature · 1 line
2.55.0
Quoted 9 lines · Rosen Penev
The brcm,bcm4329-fmac binding has unevaluatedProperties set to false but does not allow nvmem-cells or nvmem-cell-names, which are used by DTS files (e.g.
bcm4709-linksys-ea9200.dts) to supply MAC addresses.The driver already supports nvmem-based MAC address retrieval via
of_get_mac_address(), so add the nvmem-consumer schema reference to document and allow these properties.--- .../devicetree/bindings/net/wireless/brcm,bcm4329-fmac.yaml | 1 +
The problem is real but I think the fix belongs in network-class.yaml rather than the brcmfmac binding specifically. ethernet-controller.yaml already defines nvmem-cells and nvmem-cell-names for wired NICs, but the wireless binding hierarchy (wireless-controller.yaml -> network-class.yaml) is missing them. Fixing it in network-class.yaml would cover all network nodes at once instead of requiring each wireless driver to add the same reference individually.
Regards,
Arend
Rob Herring
maintainerQuoted 11 lines · Arend van Spriel
Quoted 9 lines · Rosen Penev
The brcm,bcm4329-fmac binding has unevaluatedProperties set to false but does not allow nvmem-cells or nvmem-cell-names, which are used by DTS files (e.g.
bcm4709-linksys-ea9200.dts) to supply MAC addresses.The driver already supports nvmem-based MAC address retrieval via
of_get_mac_address(), so add the nvmem-consumer schema reference to document and allow these properties.--- .../devicetree/bindings/net/wireless/brcm,bcm4329-fmac.yaml | 1 +
Quoted 7 lines
The problem is real but I think the fix belongs in
network-class.yamlrather than the brcmfmac binding specifically.ethernet-controller.yamlalready defines nvmem-cells and nvmem-cell-names for wired NICs, but the wireless binding hierarchy (wireless-controller.yaml->network-class.yaml) is missing them. Fixing it innetwork-class.yamlwould cover all network nodes at once instead of requiring each wireless driver to add the same reference individually.
It is wrong because nvmem-consumer.yaml does not define how many entries and what they are. IOW, the valid names in nvmem-cell-names must be defined.
However, expecting all network class devices to use the same nvmem-cells/nvmem-cell-names will probably not work long term. Some device may use it, but not use "mac-address" entry. Unfortunately, there's not a way to override a default in json-schema. So we'll probably have to just define this in every user rather than centrally.
So this should just add the definitions to the brcm,bcm4329-fmac binding:
nvmem-cells:
maxItems: 1
nvmem-cell-names:
const: mac-address
Rob
Quoted 30 lines · Rob Herring
Quoted 11 lines · Arend van Spriel
Quoted 9 lines · Rosen Penev
The brcm,bcm4329-fmac binding has unevaluatedProperties set to false but does not allow nvmem-cells or nvmem-cell-names, which are used by DTS files (e.g.
bcm4709-linksys-ea9200.dts) to supply MAC addresses.The driver already supports nvmem-based MAC address retrieval via
of_get_mac_address(), so add the nvmem-consumer schema reference to document and allow these properties.--- .../devicetree/bindings/net/wireless/brcm,bcm4329-fmac.yaml | 1 +Quoted 7 lines
The problem is real but I think the fix belongs in
network-class.yamlrather than the brcmfmac binding specifically.ethernet-controller.yamlalready defines nvmem-cells and nvmem-cell-names for wired NICs, but the wireless binding hierarchy (wireless-controller.yaml->network-class.yaml) is missing them. Fixing it innetwork-class.yamlwould cover all network nodes at once instead of requiring each wireless driver to add the same reference individually.It is wrong because
nvmem-consumer.yamldoes not define how many entries and what they are. IOW, the valid names in nvmem-cell-names must be defined.However, expecting all network class devices to use the same nvmem-cells/nvmem-cell-names will probably not work long term. Some device may use it, but not use "mac-address" entry. Unfortunately, there's not a way to override a default in json-schema. So we'll probably have to just define this in every user rather than centrally.
Quoted 8 lines
So this should just add the definitions to the brcm,bcm4329-fmac binding:
nvmem-cells:
maxItems: 1nvmem-cell-names:
const: mac-address
Hi, Rob
I try to stay away from devicetree bindings so I am not well-aware of the limitations to express things. Just applying my aim-for-reuse mantra ;-)
Thanks for your guidance.
Regards,
Arend