forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'for-linus-20140610' of git://git.infradead.org/linux-mtd
Pull MTD updates from Brian Norris: - refactor m25p80.c driver for use as a general SPI NOR framework for other drivers which may speak to SPI NOR flash without providing full SPI support (i.e., not part of drivers/spi/) - new Freescale QuadSPI driver (utilizing new SPI NOR framework) - updates for the STMicro "FSM" SPI NOR driver - fix sync/flush behavior on mtd_blkdevs - fixup subpage write support on a few NAND drivers - correct the MTD OOB test for odd-sized OOB areas - add BCH-16 support for OMAP NAND - fix warnings and trivial refactoring - utilize new ECC DT bindings in pxa3xx NAND driver - new LPDDR NVM driver - address a few assorted bugs caught by Coverity - add new imx6sx support for GPMI NAND - use a bounce buffer for NAND when non-DMA-able buffers are used * tag 'for-linus-20140610' of git://git.infradead.org/linux-mtd: (77 commits) mtd: gpmi: add gpmi support for imx6sx mtd: maps: remove check for CONFIG_MTD_SUPERH_RESERVE mtd: bf5xx_nand: use the managed version of kzalloc mtd: pxa3xx_nand: make the driver work on big-endian systems mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error mtd: nand: r852: correct write_buf loop bounds mtd: nand_bbt: handle error case for nand_create_badblock_pattern() mtd: nand_bbt: remove unused variable mtd: maps: sc520cdp: fix warnings mtd: slram: fix unused variable warning mtd: pfow: remove unused variable mtd: lpddr: fix Kconfig dependency, for I/O accessors mtd: nand: pxa3xx: Add supported ECC strength and step size to the DT binding mtd: nand: pxa3xx: Use ECC strength and step size devicetree binding mtd: nand: pxa3xx: Clean pxa_ecc_init() error handling mtd: nand: Warn the user if the selected ECC strength is too weak mtd: nand: omap: Documentation: How to select correct ECC scheme for your device ? mtd: nand: omap: add support for BCH16_ECC - NAND driver updates mtd: nand: omap: add support for BCH16_ECC - ELM driver updates mtd: nand: omap: add support for BCH16_ECC - GPMC driver updates ...
- Loading branch information
Showing
54 changed files
with
3,759 additions
and
1,618 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
* Freescale Quad Serial Peripheral Interface(QuadSPI) | ||
|
||
Required properties: | ||
- compatible : Should be "fsl,vf610-qspi" | ||
- reg : the first contains the register location and length, | ||
the second contains the memory mapping address and length | ||
- reg-names: Should contain the reg names "QuadSPI" and "QuadSPI-memory" | ||
- interrupts : Should contain the interrupt for the device | ||
- clocks : The clocks needed by the QuadSPI controller | ||
- clock-names : the name of the clocks | ||
|
||
Optional properties: | ||
- fsl,qspi-has-second-chip: The controller has two buses, bus A and bus B. | ||
Each bus can be connected with two NOR flashes. | ||
Most of the time, each bus only has one NOR flash | ||
connected, this is the default case. | ||
But if there are two NOR flashes connected to the | ||
bus, you should enable this property. | ||
(Please check the board's schematic.) | ||
|
||
Example: | ||
|
||
qspi0: quadspi@40044000 { | ||
compatible = "fsl,vf610-qspi"; | ||
reg = <0x40044000 0x1000>, <0x20000000 0x10000000>; | ||
reg-names = "QuadSPI", "QuadSPI-memory"; | ||
interrupts = <0 24 IRQ_TYPE_LEVEL_HIGH>; | ||
clocks = <&clks VF610_CLK_QSPI0_EN>, | ||
<&clks VF610_CLK_QSPI0>; | ||
clock-names = "qspi_en", "qspi"; | ||
|
||
flash0: s25fl128s@0 { | ||
.... | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
SPI NOR framework | ||
============================================ | ||
|
||
Part I - Why do we need this framework? | ||
--------------------------------------- | ||
|
||
SPI bus controllers (drivers/spi/) only deal with streams of bytes; the bus | ||
controller operates agnostic of the specific device attached. However, some | ||
controllers (such as Freescale's QuadSPI controller) cannot easily handle | ||
arbitrary streams of bytes, but rather are designed specifically for SPI NOR. | ||
|
||
In particular, Freescale's QuadSPI controller must know the NOR commands to | ||
find the right LUT sequence. Unfortunately, the SPI subsystem has no notion of | ||
opcodes, addresses, or data payloads; a SPI controller simply knows to send or | ||
receive bytes (Tx and Rx). Therefore, we must define a new layering scheme under | ||
which the controller driver is aware of the opcodes, addressing, and other | ||
details of the SPI NOR protocol. | ||
|
||
Part II - How does the framework work? | ||
-------------------------------------- | ||
|
||
This framework just adds a new layer between the MTD and the SPI bus driver. | ||
With this new layer, the SPI NOR controller driver does not depend on the | ||
m25p80 code anymore. | ||
|
||
Before this framework, the layer is like: | ||
|
||
MTD | ||
------------------------ | ||
m25p80 | ||
------------------------ | ||
SPI bus driver | ||
------------------------ | ||
SPI NOR chip | ||
|
||
After this framework, the layer is like: | ||
MTD | ||
------------------------ | ||
SPI NOR framework | ||
------------------------ | ||
m25p80 | ||
------------------------ | ||
SPI bus driver | ||
------------------------ | ||
SPI NOR chip | ||
|
||
With the SPI NOR controller driver (Freescale QuadSPI), it looks like: | ||
MTD | ||
------------------------ | ||
SPI NOR framework | ||
------------------------ | ||
fsl-quadSPI | ||
------------------------ | ||
SPI NOR chip | ||
|
||
Part III - How can drivers use the framework? | ||
--------------------------------------------- | ||
|
||
The main API is spi_nor_scan(). Before you call the hook, a driver should | ||
initialize the necessary fields for spi_nor{}. Please see | ||
drivers/mtd/spi-nor/spi-nor.c for detail. Please also refer to fsl-quadspi.c | ||
when you want to write a new driver for a SPI NOR controller. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.