• Miquel Raynal's avatar
    net: mvpp2: Consider NVMEM cells as possible MAC address source · 7a74c126
    Miquel Raynal authored
    The ONIE standard describes the organization of tlv (type-length-value)
    arrays commonly stored within NVMEM devices on common networking
    hardware.
    
    Several drivers already make use of NVMEM cells for purposes like
    retrieving a default MAC address provided by the manufacturer.
    
    What made ONIE tables unusable so far was the fact that the information
    where "dynamically" located within the table depending on the
    manufacturer wishes, while Linux NVMEM support only allowed statically
    defined NVMEM cells. Fortunately, this limitation was eventually tackled
    with the introduction of discoverable cells through the use of NVMEM
    layouts, making it possible to extract and consistently use the content
    of tables like ONIE's tlv arrays.
    
    Parsing this table at runtime in order to get various information is now
    possible. So, because many Marvell networking switches already follow
    this standard, let's consider using NVMEM cells as a new valid source of
    information when looking for a base MAC address, which is one of the
    primary uses of these new fields. Indeed, manufacturers following the
    ONIE standard are encouraged to provide a default MAC address there, so
    let's eventually use it if no other MAC address has been found using the
    existing methods.
    
    Link: https://opencomputeproject.github.io/onie/design-spec/hw_requirements.htmlSigned-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    7a74c126
mvpp2_main.c 208 KB