Skip to content
Permalink
Browse files

driver/spi_flash: add spi_flash sub-system with SFDP support

Currently this sub-system is used only with the QSPI controller but it
could also be used with SPI controller if its driver were reworked a
little bit.

Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
  • Loading branch information...
Cyrille Pitchen authored and wenyouya committed Jun 1, 2017
1 parent 6b33069 commit 5badc201fbad8cd02ba94df8939e8a77dd9c5c6c
@@ -148,7 +148,6 @@ CRYSTAL:=$(strip $(subst ",,$(CONFIG_CRYSTAL)))

# driver definitions
SPI_CLK:=$(strip $(subst ",,$(CONFIG_SPI_CLK)))
QSPI_CLK:=$(strip $(subst ",,$(CONFIG_QSPI_CLK)))
SPI_BOOT:=$(strip $(subst ",,$(CONFIG_SPI_BOOT)))

ifeq ($(REVISION),)
@@ -1,3 +1,26 @@
config CONFIG_SPI_FLASH
bool
default n

config ALLOW_DATAFLASH_RECOVERY
bool
default n

config CONFIG_SPI_CLK
int "SPI clock speed"
default 33000000
help
Which speed (in Hz) should the SPI run at.

config CONFIG_DATAFLASH_RECOVERY
bool "Support Dataflash recovery by pressing a button"
default y
depends on ALLOW_DATAFLASH_RECOVERY
help
Let bootstrap disassemble the first 7 double words
and check that all, except the reserved vector
contains a jump/branch

choice
prompt "SPI Interface Select"
default CONFIG_SPI
@@ -7,6 +30,7 @@ config CONFIG_SPI
depends on CPU_HAS_SPI0 || CPU_HAS_SPI1 || CPU_HAS_SPI1

config CONFIG_QSPI
select CONFIG_SPI_FLASH
bool "Quad SPI Interface"
depends on CPU_HAS_QSPI0 || CPU_HAS_QSPI1

@@ -15,32 +39,13 @@ endchoice
menu "SPI configuration"
depends on CONFIG_SPI

config CONFIG_SPI_CLK
int "SPI clock speed"
default 33000000
help
Which speed (in Hz) should the SPI run at.

config CONFIG_SMALL_DATAFLASH
bool "Support < 32 Mbit dataflashes"
default y
help
Deselect this to save some bytes of memory
at the expense of flexibility in selecting memory sizes.

config CONFIG_DATAFLASH_RECOVERY
bool "Support Dataflash recovery by pressing a button"
default y
depends on ALLOW_DATAFLASH_RECOVERY
help
Let bootstrap disassemble the first 7 double words
and check that all, except the reserved vector
contains a jump/branch

config ALLOW_DATAFLASH_RECOVERY
bool
default n

# ------- SPI boot source -----------------------------------------------------
choice
prompt "SPI Bus Select"
@@ -183,12 +188,6 @@ endmenu
menu "QSPI Configuration"
depends on CONFIG_QSPI

config CONFIG_QSPI_CLK
int "QSPI Clock Speed"
default 33000000
help
What speed (in Hz) should the QSPI run at.

choice
prompt "QSPI Bus Select"
default CONFIG_QSPI_BUS0

0 comments on commit 5badc20

Please sign in to comment.
You can’t perform that action at this time.