Skip to content

Commit

Permalink
mtd: spi-nor: add the framework for SPI NOR
Browse files Browse the repository at this point in the history
This patch cloned most of the m25p80.c. In theory, it adds a new spi-nor layer.

Before this patch, the layer is like:

                   MTD
         ------------------------
                  m25p80
         ------------------------
	       spi bus driver
         ------------------------
	        SPI NOR chip

After this patch, the layer is like:
                   MTD
         ------------------------
                  spi-nor
         ------------------------
                  m25p80
         ------------------------
	       spi bus driver
         ------------------------
	       SPI NOR chip

With the spi-nor controller driver(Freescale Quadspi), it looks like:
                   MTD
         ------------------------
                  spi-nor
         ------------------------
                fsl-quadspi
         ------------------------
	       SPI NOR chip

New APIs:
   spi_nor_scan: used to scan a spi-nor flash.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
[Brian: rebased to include additional m25p_ids[] entry]
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Huang Shijie authored and Brian Norris committed Apr 14, 2014
1 parent 6e602ef commit b199489
Show file tree
Hide file tree
Showing 6 changed files with 1,118 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mtd/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ source "drivers/mtd/onenand/Kconfig"

source "drivers/mtd/lpddr/Kconfig"

source "drivers/mtd/spi-nor/Kconfig"

source "drivers/mtd/ubi/Kconfig"

endif # MTD
1 change: 1 addition & 0 deletions drivers/mtd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ inftl-objs := inftlcore.o inftlmount.o

obj-y += chips/ lpddr/ maps/ devices/ nand/ onenand/ tests/

obj-$(CONFIG_MTD_SPI_NOR_BASE) += spi-nor/
obj-$(CONFIG_MTD_UBI) += ubi/
6 changes: 6 additions & 0 deletions drivers/mtd/spi-nor/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config MTD_SPI_NOR_BASE
bool "the framework for SPI-NOR support"
depends on MTD
help
This is the framework for the SPI NOR which can be used by the SPI
device drivers and the SPI-NOR device driver.
1 change: 1 addition & 0 deletions drivers/mtd/spi-nor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-$(CONFIG_MTD_SPI_NOR_BASE) += spi-nor.o
Loading

0 comments on commit b199489

Please sign in to comment.