RE: [PATCH] Add LAN78XX OTP_ACCESS flag support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Andrew Lunn <andrew@xxxxxxx>
> Sent: Monday, October 28, 2024 8:38 AM
> 
> On Sat, Oct 26, 2024 at 01:05:46AM +0200, Fabian Benschuh wrote:
> > With this flag we can now use ethtool to access the OTP:
> > ethtool --set-priv-flags eth0 OTP_ACCESS on ethtool -e eth0  # this
> > will read OTP if OTP_ACCESS is on, else EEPROM
> >
> > When writing to OTP we need to set OTP_ACCESS on and write with the
> > correct magic 0x7873 for OTP
> 
> Please can you tell us more about OTP vs EEPROM? Is the OTP internal while the EEPROM is external?
> What is contained in each? How does the device decide which to use when it finds it has both?
> 
>         Andrew

This is pretty much the same implementation that is already in place for the Linux driver of the LAN743x PCIe device.

OTP (one time programmable) is a configuration memory internal to the device. EEPROM is external.
The internal OTP memory always exists but it may not be programmed. The EEPROM is optional, and if present can also be programmed or not.
A signature byte at offset 0 indicates whether the OTP or EEPROM device is programmed. 
If present, EEPROM has higher priority.
More info @ Chapter 10 here;
https://ww1.microchip.com/downloads/aemDocuments/documents/UNG/ProductDocuments/DataSheets/LAN7800-Data-Sheet-DS00001992H.pdf

> I'm just wondering if we even need a private flag, if the hardware will use one or the other exclusively?
>
Yes, both can be present/used, so we need the flag so we can tell the destination of a write or source of a read.

Ronnie





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux