Commit 778572d7 authored by Vignesh R's avatar Vignesh R Committed by Jagan Teki

mtd: spi: Add lightweight SPI flash stack for SPL

Add a tiny SPI flash stack that just supports reading data/images from
SPI flash. This is useful for boards that have SPL size constraints and
would need to use SPI flash framework just to read images/data from
flash. There is approximately 1.5 to 2KB savings with this.

Based on prior work of reducing spi flash id table by
Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Signed-off-by: default avatarVignesh R <vigneshr@ti.com>
Tested-by: default avatarSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Tested-by: Stefan Roese's avatarStefan Roese <sr@denx.de>
Tested-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: default avatarJagan Teki <jagan@openedev.com>
Tested-by: Jagan Teki <jagan@amarulasolutions.com> #zynq-microzed
parent 5b66fdb2
......@@ -739,9 +739,18 @@ config SPL_SPI_FLASH_SUPPORT
if SPL_SPI_FLASH_SUPPORT
config SPL_SPI_FLASH_TINY
bool "Enable low footprint SPL SPI Flash support"
depends on !SPI_FLASH_BAR
help
Enable lightweight SPL SPI Flash support that supports just reading
data/images from flash. No support to write/erase flash. Enable
this if you have SPL size limitations and don't need full
fledged SPI flash support.
config SPL_SPI_FLASH_SFDP_SUPPORT
bool "SFDP table parsing support for SPI NOR flashes"
depends on !SPI_FLASH_BAR
depends on !SPI_FLASH_BAR && !SPL_SPI_FLASH_TINY
help
Enable support for parsing and auto discovery of parameters for
SPI NOR flashes using Serial Flash Discoverable Parameters (SFDP)
......
......@@ -4,12 +4,20 @@
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
obj-$(CONFIG_DM_SPI_FLASH) += sf-uclass.o
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)
spi-nor-y += spi-nor-tiny.o
else
spi-nor-y += spi-nor-core.o
endif
else
spi-nor-y += spi-nor-core.o
endif
obj-$(CONFIG_SPI_FLASH) += sf_probe.o spi-nor-core.o
obj-$(CONFIG_SPI_FLASH) += spi-nor.o
obj-$(CONFIG_SPI_FLASH_DATAFLASH) += sf_dataflash.o sf.o
obj-$(CONFIG_SPI_FLASH_MTD) += sf_mtd.o
obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
......@@ -16,7 +16,9 @@
#define SPI_NOR_MAX_ADDR_WIDTH 4
struct flash_info {
#if !CONFIG_IS_ENABLED(SPI_FLASH_TINY)
char *name;
#endif
/*
* This array stores the ID bytes.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment