[PATCH v3 0/2] spi: Introduce initial EEPROM driver mode support
João Loureiro
joaofl at gmail.com
Thu Jun 11 00:11:58 CEST 2026
This series introduces an initial SPI EEPROM driver model uclass,
analogous to the existing I2C EEPROM support, currently providing
read-only access.
v2 was deferred mainly because of the large number of checkpatch
issues. This v3 reworks the driver from scratch to be checkpatch
clean, drops dead code and the misleading no-op write stub, fixes the
read bounds checking, and corrects the AT25160 geometry. It is rebased
on current master.
In addition, and to address the "new uclass needs a sandbox driver and
a test" request, patch 2 adds a sandbox SPI EEPROM emulator and a
test/dm test. To make that possible the sandbox SPI controller now lets
a slave select its emulator through a "sandbox,emul" phandle (mirroring
the sandbox I2C bus), while still defaulting to the SPI flash emulator
so existing behaviour is unchanged.
Note: this work was originally submitted from a Philips address which I
no longer have; it is resent from my personal address.
Tested on sandbox: "ut dm spi_eeprom" passes, and the existing
"ut dm spi*" tests still pass.
João Loureiro (2):
spi: Introduce initial EEPROM driver mode support
sandbox: spi: Add SPI EEPROM emulator and DM test
MAINTAINERS | 8 ++
arch/sandbox/dts/test.dts | 13 ++-
configs/sandbox_defconfig | 1 +
drivers/misc/Kconfig | 6 ++
drivers/misc/Makefile | 2 +
drivers/misc/spi_eeprom.c | 185 +++++++++++++++++++++++++++++++++
drivers/misc/spi_eeprom_emul.c | 118 +++++++++++++++++++++
drivers/spi/sandbox_spi.c | 31 +++++-
include/dm/uclass-id.h | 1 +
include/spi_eeprom.h | 91 ++++++++++++++++
test/dm/Makefile | 1 +
test/dm/spi_eeprom.c | 45 ++++++++
12 files changed, 500 insertions(+), 2 deletions(-)
create mode 100644 drivers/misc/spi_eeprom.c
create mode 100644 drivers/misc/spi_eeprom_emul.c
create mode 100644 include/spi_eeprom.h
create mode 100644 test/dm/spi_eeprom.c
--
2.54.0
More information about the U-Boot
mailing list