linux_dsm_epyc7002/drivers/net/ethernet/microchip
Bryan Whitehead 662a14d0c7 lan743x: Provide Read/Write Access to on chip OTP
The LAN743x includes on chip One-Time-Programmable (OTP) memory.

This patch extends the ethtool EEPROM read/write interface to
access OTP memory space.

The currently existing interface is limited, as it does not
allow OTP read, and OTP writes are restricted to
offset==0, length==512, and data[0]==0xF3.

This patch removes these restrictions and adds a private flag
called OTP_ACCESS, which is used to switch between EEPROM, and
OTP modes.

The private flag OTP_ACCESS is configurable through the
  ethtool --set-priv-flags command.
And visible through the
  ethtool --show-priv-flags command.

By default OTP_ACCESS is false, and there for previously existing
EEPROM commands will work exactly the same. However now access to
OTP requires one extra step of setting OTP_ACCESS to true. This
flag controls the read, write, and length reporting, functions
of ethtool.

EEPROM presence is not checked when setting or clearing this flag.
If the EEPROM is not present, the user, as before, will need to
diagnose that using existing read and write function of ethtool,
while OTP_ACCESS is false.

Updates for V2:
Added comments as to why this patch is needed.
Added comments explaining that EEPROM presence is not check
  when setting or clearing the OTP_ACCESS flag.
Added length checking to all otp/eeprom read/write functions.

Signed-off-by: Bryan Whitehead <Bryan.Whitehead@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-01-26 09:35:21 -08:00
..
enc28j60_hw.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
enc28j60.c net: microchip: enc28j60: use new api ethtool_{get|set}_link_ksettings 2017-02-12 22:32:17 -05:00
encx24j600_hw.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
encx24j600-regmap.c encx24j600: Fix some checkstyle warnings 2016-12-16 13:31:47 -05:00
encx24j600.c net: microchip: encx24j600: use new api ethtool_{get|set}_link_ksettings 2017-02-12 22:32:17 -05:00
Kconfig lan743x: Remove SPI dependency from Microchip group. 2018-10-25 16:20:48 -07:00
lan743x_ethtool.c lan743x: Provide Read/Write Access to on chip OTP 2019-01-26 09:35:21 -08:00
lan743x_ethtool.h lan743x: Add support for ethtool get_drvinfo 2018-07-23 14:09:18 -07:00
lan743x_main.c lan743x: Remove phy_read from link status change function 2019-01-08 16:26:12 -05:00
lan743x_main.h lan743x: Provide Read/Write Access to on chip OTP 2019-01-26 09:35:21 -08:00
lan743x_ptp.c net: lan743x_ptp: make function lan743x_ptp_set_sync_ts_insert() static 2018-09-05 08:07:05 -07:00
lan743x_ptp.h net: lan743x: fix building without CONFIG_PTP_1588_CLOCK 2018-08-13 20:43:47 -07:00
Makefile lan743x: lan743x: Add PTP support 2018-08-11 11:42:18 -07:00