diff mbox series

[01/31] spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL

Message ID 20200719161601.495421-2-sjg@chromium.org
State Accepted
Commit f38a29997d1cdb71a85fc9dcdbee86d952b45482
Delegated to: Tom Rini
Headers show
Series dm: Avoid including dm.h in header files | expand

Commit Message

Simon Glass July 19, 2020, 4:15 p.m. UTC
In some cases SPL needs to be able to erase but TPL just needs to read.
Allow these to have separate settings for SPI_FLASH_TINY.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/spl/Kconfig       | 10 ++++++++++
 drivers/mtd/spi/Makefile |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

Comments

Tom Rini Aug. 4, 2020, 3:03 p.m. UTC | #1
On Sun, Jul 19, 2020 at 10:15:31AM -0600, Simon Glass wrote:

> In some cases SPL needs to be able to erase but TPL just needs to read.
> Allow these to have separate settings for SPI_FLASH_TINY.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index d09e52e88b..c3f063e337 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1496,6 +1496,16 @@  config TPL_SPI_FLASH_SUPPORT
 	  Enable support for using SPI flash in TPL. See SPL_SPI_FLASH_SUPPORT
 	  for details.
 
+config TPL_SPI_FLASH_TINY
+	bool "Enable low footprint TPL SPI Flash support"
+	depends on TPL_SPI_FLASH_SUPPORT && !SPI_FLASH_BAR
+	default y if SPI_FLASH
+	help
+	 Enable lightweight TPL SPI Flash support that supports just reading
+	 data/images from flash. No support to write/erase flash. Enable
+	 this if you have TPL size limitations and don't need full-fledged
+	 SPI flash support.
+
 config TPL_SPI_LOAD
 	bool "Support loading from SPI flash"
 	depends on TPL_SPI_FLASH_SUPPORT
diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index 952fd1e45a..99cc418552 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -8,7 +8,7 @@  spi-nor-y := sf_probe.o spi-nor-ids.o
 
 ifdef CONFIG_SPL_BUILD
 obj-$(CONFIG_SPL_SPI_BOOT)	+= fsl_espi_spl.o
-ifeq ($(CONFIG_SPL_SPI_FLASH_TINY),y)
+ifeq ($(CONFIG_$(SPL_TPL_)SPI_FLASH_TINY),y)
 spi-nor-y += spi-nor-tiny.o
 else
 spi-nor-y += spi-nor-core.o