mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Replace the RAW SPI accesses with spi-mem API. The latter will fall back to RAW SPI accesses if spi-mem callbacks are not implemented by a controller driver. Notable advantages: - read function now allocates a bounce buffer for SPI DMA compatibility, similar to write function; - the driver can now be used in conjunction with SPI controller drivers providing spi-mem API only, e.g. spi-nxp-fspi. - during the initial probe the driver polls busy/ready status bit for 25ms instead of giving up instantly and hoping that the FW didn't write the EEPROM Notes: - mutex_lock() has been dropped from fm25_aux_read() because the latter is only being called in probe phase and therefore cannot race with at25_ee_read() or at25_ee_write() Quick 4KB block size test with CY15B102Q 256KB F-RAM over spi_omap2_mcspi driver (no spi-mem ops provided, fallback to raw SPI inside spi-mem): OP | throughput, KB/s | change --------+-----------------------+------- write | 1717.847 -> 1656.684 | -3.6% read | 1115.868 -> 1059.367 | -5.1% The lower throughtput probably comes from the 3 messages per SPI transfer inside spi-mem instead of hand-crafted 2 messages per transfer in the former at25 code. However, if the raw SPI access is not preserved, then the driver doesn't grow from the lines-of-code perspective and subjectively could be considered even a bit simpler. Higher performance impact on the read operation could be explained by the newly introduced bounce buffer in read operation. I didn't find any explanation or guarantee, why would a bounce buffer be not needed on the read side, so I assume it's a pure luck that nobody read EEPROM into some variable on stack on an architecture where kernel stack would be not DMA-able. Cc: Michael Walle <mwalle@kernel.org> Cc: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/all/28ab8b72afee1af59b628f7389f0d7f5@kernel.org/ Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com> Link: https://lore.kernel.org/r/20250702222823.864803-1-alexander.sverdlin@siemens.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
123 lines
3.9 KiB
Text
123 lines
3.9 KiB
Text
# SPDX-License-Identifier: GPL-2.0-only
|
|
menu "EEPROM support"
|
|
|
|
config EEPROM_AT24
|
|
tristate "I2C EEPROMs / RAMs / ROMs from most vendors"
|
|
depends on I2C && SYSFS
|
|
select NVMEM
|
|
select NVMEM_SYSFS
|
|
select REGMAP
|
|
select REGMAP_I2C
|
|
help
|
|
Enable this driver to get read/write support to most I2C EEPROMs
|
|
and compatible devices like FRAMs, SRAMs, ROMs etc. After you
|
|
configure the driver to know about each chip on your target
|
|
board. Use these generic chip names, instead of vendor-specific
|
|
ones like at24c64, 24lc02 or fm24c04:
|
|
|
|
24c00, 24c01, 24c02, spd (readonly 24c02), 24c04, 24c08,
|
|
24c16, 24c32, 24c64, 24c128, 24c256, 24c512, 24c1024, 24c2048
|
|
|
|
Unless you like data loss puzzles, always be sure that any chip
|
|
you configure as a 24c32 (32 kbit) or larger is NOT really a
|
|
24c16 (16 kbit) or smaller, and vice versa. Marking the chip
|
|
as read-only won't help recover from this. Also, if your chip
|
|
has any software write-protect mechanism you may want to review the
|
|
code to make sure this driver won't turn it on by accident.
|
|
|
|
If you use this with an SMBus adapter instead of an I2C adapter,
|
|
full functionality is not available. Only smaller devices are
|
|
supported (24c16 and below, max 4 kByte).
|
|
|
|
This driver can also be built as a module. If so, the module
|
|
will be called at24.
|
|
|
|
config EEPROM_AT25
|
|
tristate "SPI EEPROMs (FRAMs) from most vendors"
|
|
depends on SPI && SYSFS
|
|
select NVMEM
|
|
select NVMEM_SYSFS
|
|
select SPI_MEM
|
|
help
|
|
Enable this driver to get read/write support to most SPI EEPROMs
|
|
and Cypress FRAMs,
|
|
after you configure the board init code to know about each eeprom
|
|
on your target board.
|
|
|
|
This driver can also be built as a module. If so, the module
|
|
will be called at25.
|
|
|
|
config EEPROM_MAX6875
|
|
tristate "Maxim MAX6874/5 power supply supervisor"
|
|
depends on I2C
|
|
help
|
|
If you say yes here you get read-only support for the user EEPROM of
|
|
the Maxim MAX6874/5 EEPROM-programmable, quad power-supply
|
|
sequencer/supervisor.
|
|
|
|
All other features of this chip should be accessed via i2c-dev.
|
|
|
|
This driver can also be built as a module. If so, the module
|
|
will be called max6875.
|
|
|
|
|
|
config EEPROM_93CX6
|
|
tristate "EEPROM 93CX6 support"
|
|
help
|
|
This is a driver for the EEPROM chipsets 93c46 and 93c66.
|
|
The driver supports both read as well as write commands.
|
|
|
|
If unsure, say N.
|
|
|
|
config EEPROM_93XX46
|
|
tristate "Microwire EEPROM 93XX46 support"
|
|
depends on SPI && SYSFS
|
|
select REGMAP
|
|
select NVMEM
|
|
select NVMEM_SYSFS
|
|
help
|
|
Driver for the microwire EEPROM chipsets 93xx46x. The driver
|
|
supports both read and write commands and also the command to
|
|
erase the whole EEPROM.
|
|
|
|
This driver can also be built as a module. If so, the module
|
|
will be called eeprom_93xx46.
|
|
|
|
If unsure, say N.
|
|
|
|
config EEPROM_DIGSY_MTC_CFG
|
|
bool "DigsyMTC display configuration EEPROMs device"
|
|
depends on GPIO_MPC5200 && SPI_GPIO
|
|
help
|
|
This option enables access to display configuration EEPROMs
|
|
on digsy_mtc board. You have to additionally select Microwire
|
|
EEPROM 93XX46 driver. sysfs entries will be created for that
|
|
EEPROM allowing to read/write the configuration data or to
|
|
erase the whole EEPROM.
|
|
|
|
If unsure, say N.
|
|
|
|
config EEPROM_IDT_89HPESX
|
|
tristate "IDT 89HPESx PCIe-switches EEPROM / CSR support"
|
|
depends on I2C && SYSFS
|
|
help
|
|
Enable this driver to get read/write access to EEPROM / CSRs
|
|
over IDT PCIe-switch i2c-slave interface.
|
|
|
|
This driver can also be built as a module. If so, the module
|
|
will be called idt_89hpesx.
|
|
|
|
config EEPROM_EE1004
|
|
tristate "SPD EEPROMs on DDR4 memory modules"
|
|
depends on I2C && SYSFS
|
|
select NVMEM
|
|
select NVMEM_SYSFS
|
|
help
|
|
Enable this driver to get read support to SPD EEPROMs following
|
|
the JEDEC EE1004 standard. These are typically found on DDR4
|
|
SDRAM memory modules.
|
|
|
|
This driver can also be built as a module. If so, the module
|
|
will be called ee1004.
|
|
|
|
endmenu
|