mbox series

[0/4] mtd: intel-spi: split read/write modes

Message ID 20210910211348.642103-1-mauro.lima@eclypsium.com
Headers show
Series mtd: intel-spi: split read/write modes | expand

Message

Mauro Lima Sept. 10, 2021, 9:13 p.m. UTC
The purpose of the following patchset is to split read/write
functionality from the Intel PCH/PCU SPI flash driver.
Being able to use the driver in read-only mode (harmless), the users
can get important firmware information from userspace which also
includes being able to perform firmware attestation to verify
integrity.

Currently fwupd is accessing to firmware information but only
with SecureBoot disabled. With this driver the fwupd project could
get such information with SecureBoot enabled.

Mauro Lima (4):
  mtd: intel-spi: rename intel-spi to intel-spi-base
  mtd: intel-spi: move chip internals into a defs.h
  mtd: intel-spi: moving write/erase functions
  mtd: intel-spi: add read only stubs

 drivers/mtd/spi-nor/controllers/Kconfig       |  50 +-
 drivers/mtd/spi-nor/controllers/Makefile      |   3 +
 .../{intel-spi.c => intel-spi-base.c}         | 442 ++----------------
 .../{intel-spi.h => intel-spi-base.h}         |   1 +
 .../mtd/spi-nor/controllers/intel-spi-defs.h  | 157 +++++++
 .../mtd/spi-nor/controllers/intel-spi-pci.c   |   2 +-
 .../spi-nor/controllers/intel-spi-platform.c  |   2 +-
 .../mtd/spi-nor/controllers/intel-spi-ro.c    |  50 ++
 .../mtd/spi-nor/controllers/intel-spi-rw.h    |  24 +
 drivers/mtd/spi-nor/controllers/intel-spi-w.c | 289 ++++++++++++
 include/linux/platform_data/x86/intel-spi.h   |   2 +
 11 files changed, 595 insertions(+), 427 deletions(-)
 rename drivers/mtd/spi-nor/controllers/{intel-spi.c => intel-spi-base.c} (54%)
 rename drivers/mtd/spi-nor/controllers/{intel-spi.h => intel-spi-base.h} (97%)
 create mode 100644 drivers/mtd/spi-nor/controllers/intel-spi-defs.h
 create mode 100644 drivers/mtd/spi-nor/controllers/intel-spi-ro.c
 create mode 100644 drivers/mtd/spi-nor/controllers/intel-spi-rw.h
 create mode 100644 drivers/mtd/spi-nor/controllers/intel-spi-w.c

Comments

Mika Westerberg Sept. 13, 2021, 9:59 a.m. UTC | #1
Hi,

On Fri, Sep 10, 2021 at 06:13:44PM -0300, Mauro Lima wrote:
> The purpose of the following patchset is to split read/write
> functionality from the Intel PCH/PCU SPI flash driver.
> Being able to use the driver in read-only mode (harmless), the users
> can get important firmware information from userspace which also
> includes being able to perform firmware attestation to verify
> integrity.

The SPI-NOR maintainers wanted that the driver converted first to use
"SPI MEM" framework before any new features can be added. I'm currently
working on that.