Seems to me that nvmem needs to be extended to allow providers to
retrieve and interpret data. Not everything is at some fixed offset and
size. Something like this is valid dts:
nvmem = <&phandle> "a-string";
But that's pretty uncommon (I can't think of a binding that actuallyIn the case of VPD, all keys are 0-terminated strings (there's also a
uses that). Perhaps the provider has an array of keys defined and the
consumer just provides the index.
length field, but the key is still 0-terminated), so that scheme could
work. (I'm not sure an indexed provider is extremely relevant right now,
although it probably could be supported if I expand the of_nvmem
retrieval to support a generic of_xlate() override anyway.) The
information represented is almost the same as in my proposal, except that:
(a) now I have to give the VPD a phandle -- so far, I've avoided that,
as it's just an auto-enumerated device underneath the
/firmware/coreboot device (see drivers/firmware/google/vpd.c)
(b) this is no longer directly useful to ACPI systems -- I'm not
actually sure how (if at all) nvmem provider/consumer is supposed to
work there
But maybe this isn't really that useful to ACPI, and it's sufficient to
just have fwnode_get_mac_address() call of_get_nvmem_mac_address() when
we're using DT.
Or we could do '<key>-nvmem = <&phandle>', but parsing that is a bitThat doesn't seem to have much advantage to me.
more complicated.