linux-gbmc: everspin: Add Linux < 5.11 compatibility for spi_nor_read_sr

Prior to Linux 5.11, spi_nor_read_sr() was a static function defined
internally in drivers/mtd/spi-nor/core.c and was not declared in core.h.
When compiling everspin.c against Linux 5.10 (such as for Nuvoton
platforms), calls to spi_nor_read_sr() fail due to implicit function
declaration warnings treated as errors.

Add a compatibility fallback implementation of spi_nor_read_sr() for
LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0) using spi_mem_exec_op()
when nor->spimem is valid, or nor->controller_ops->read_reg() otherwise,
matching upstream 5.10 core.c behavior.

Tested: Built a 5.10 platform image and ran on the platform. Verified that erase commands use nearly no CPU time even though they wait.

Fusion-Link: fusion2 N/A
Google-Bug-Id: 565629335
Change-Id: I13159c0c11c3c6ad4df9e5605d463bbc3649e66e
Signed-off-by: William A. Kennington III <wak@google.com>
1 file changed
tree: 846db219034eb786b143645fc8225d29544fc05d
  1. classes/
  2. conf/
  3. dynamic-layers/
  4. recipes-benchmark/
  5. recipes-bsp/
  6. recipes-connectivity/
  7. recipes-core/
  8. recipes-devtools/
  9. recipes-extended/
  10. recipes-google/
  11. recipes-kernel/
  12. recipes-phosphor/
  13. recipes-support/
  14. recipes-tpm1/
  15. recipes-tpm2/
  16. recipes-x86/
  17. LICENSE
  18. README.md
README.md

meta-gbmc-staging

This repository contains additions to the openbmc/meta-google layer that are not yet ready for OpenBMC inclusion.

How to use this layer

  1. Clone openbmc/openbmc from GitHub.
  2. Clone this layer from GitHub into a subdirectory of openbmc.