• Claudiu Beznea's avatar
    nvmem: microchip-otpc: add support · 98830350
    Claudiu Beznea authored
    Add support for Microchip OTP controller available on SAMA7G5. The OTPC
    controls the access to a non-volatile memory. The memory behind OTPC is
    organized into packets, packets are composed by a fixed length header
    (4 bytes long) and a variable length payload (payload length is available
    in the header). When software request the data at an offset in memory
    the OTPC will return (via header + data registers) the whole packet that
    has a word at that offset. For the OTP memory layout like below:
    
    offset  OTP Memory layout
    
             .           .
             .    ...    .
             .           .
    0x0E     +-----------+	<--- packet X
             | header  X |
    0x12     +-----------+
             | payload X |
    0x16     |           |
             |           |
    0x1A     |           |
             +-----------+
             .           .
             .    ...    .
             .           .
    
    if user requests data at address 0x16 the data started at 0x0E will be
    returned by controller. User will be able to fetch the whole packet
    starting at 0x0E (or parts of the packet) via proper registers. The same
    packet will be returned if software request the data at offset 0x0E or
    0x12 or 0x1A.
    
    The OTP will be populated by Microchip with at least 2 packets first one
    being boot configuration packet and the 2nd one being temperature
    calibration packet. The packet order will be preserved b/w different chip
    revisions but the packet sizes may change.
    
    For the above reasons and to keep the same software able to work on all
    chip variants the read function of the driver is working with a packet
    id instead of an offset in OTP memory.
    Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
    Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
    Link: https://lore.kernel.org/r/20220706100627.6534-3-srinivas.kandagatla@linaro.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    98830350
MAINTAINERS 652 KB