-
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-20160801' of git://git.infradead.org/linux-mtd
Pull MTD updates from Brian Norris: "NAND: Quoting Boris: 'This pull request contains only one notable change: - Addition of the MTK NAND controller driver And a bunch of specific NAND driver improvements/fixes. Here are the changes that are worth mentioning: - A few fixes/improvements for the xway NAND controller driver - A few fixes for the sunxi NAND controller driver - Support for DMA in the sunxi NAND driver - Support for the sunxi NAND controller IP embedded in A23/A33 SoCs - Addition for bitflips detection in erased pages to the brcmnand driver - Support for new brcmnand IPs - Update of the OMAP-GPMC binding to support DMA channel description' In addition, some small fixes around error handling, etc., as well as one long-standing corner case issue (2.6.20, I think?) with writing 1 byte less than a page. NOR: - rework some error handling on reads and writes, so we can better handle (for instance) SPI controllers which have limitations on their maximum transfer size - add new Cadence Quad SPI flash controller driver - add new Atmel QSPI flash controller driver - add new Hisilicon SPI flash controller driver - support a few new flash, and update supported features on others - fix the logic used for detecting a fully-unlocked flash And other miscellaneous small fixes" * tag 'for-linus-20160801' of git://git.infradead.org/linux-mtd: (60 commits) mtd: spi-nor: don't build Cadence QuadSPI on non-ARM mtd: mtk-nor: remove duplicated include from mtk-quadspi.c mtd: nand: fix bug writing 1 byte less than page size mtd: update description of MTD_BCM47XXSFLASH symbol mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller mtd: spi-nor: Bindings for Cadence Quad SPI Flash Controller driver mtd: nand: brcmnand: Change BUG_ON in brcmnand_send_cmd mtd: pmcmsp-flash: Allocating too much in init_msp_flash() mtd: maps: sa1100-flash: potential NULL dereference mtd: atmel-quadspi: add driver for Atmel QSPI controller mtd: nand: omap2: fix return value check in omap_nand_probe() Documentation: atmel-quadspi: add binding file for Atmel QSPI driver mtd: spi-nor: add hisilicon spi-nor flash controller driver mtd: spi-nor: support dual, quad, and WP for Gigadevice mtd: spi-nor: Added support for n25q00a. memory: Update dependency of IFC for Layerscape mtd: nand: jz4780: Update MODULE_AUTHOR email address mtd: nand: sunxi: prevent a small memory leak mtd: nand: sunxi: add reset line support mtd: nand: sunxi: update DT bindings ...
- Loading branch information
Showing
45 changed files
with
5,837 additions
and
256 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
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,32 @@ | ||
* Atmel Quad Serial Peripheral Interface (QSPI) | ||
|
||
Required properties: | ||
- compatible: Should be "atmel,sama5d2-qspi". | ||
- reg: Should contain the locations and lengths of the base registers | ||
and the mapped memory. | ||
- reg-names: Should contain the resource reg names: | ||
- qspi_base: configuration register address space | ||
- qspi_mmap: memory mapped address space | ||
- interrupts: Should contain the interrupt for the device. | ||
- clocks: The phandle of the clock needed by the QSPI controller. | ||
- #address-cells: Should be <1>. | ||
- #size-cells: Should be <0>. | ||
|
||
Example: | ||
|
||
spi@f0020000 { | ||
compatible = "atmel,sama5d2-qspi"; | ||
reg = <0xf0020000 0x100>, <0xd0000000 0x8000000>; | ||
reg-names = "qspi_base", "qspi_mmap"; | ||
interrupts = <52 IRQ_TYPE_LEVEL_HIGH 7>; | ||
clocks = <&spi0_clk>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&pinctrl_spi0_default>; | ||
status = "okay"; | ||
|
||
m25p80@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
* Cadence Quad SPI controller | ||
|
||
Required properties: | ||
- compatible : Should be "cdns,qspi-nor". | ||
- reg : Contains two entries, each of which is a tuple consisting of a | ||
physical address and length. The first entry is the address and | ||
length of the controller register set. The second entry is the | ||
address and length of the QSPI Controller data area. | ||
- interrupts : Unit interrupt specifier for the controller interrupt. | ||
- clocks : phandle to the Quad SPI clock. | ||
- cdns,fifo-depth : Size of the data FIFO in words. | ||
- cdns,fifo-width : Bus width of the data FIFO in bytes. | ||
- cdns,trigger-address : 32-bit indirect AHB trigger address. | ||
|
||
Optional properties: | ||
- cdns,is-decoded-cs : Flag to indicate whether decoder is used or not. | ||
|
||
Optional subnodes: | ||
Subnodes of the Cadence Quad SPI controller are spi slave nodes with additional | ||
custom properties: | ||
- cdns,read-delay : Delay for read capture logic, in clock cycles | ||
- cdns,tshsl-ns : Delay in nanoseconds for the length that the master | ||
mode chip select outputs are de-asserted between | ||
transactions. | ||
- cdns,tsd2d-ns : Delay in nanoseconds between one chip select being | ||
de-activated and the activation of another. | ||
- cdns,tchsh-ns : Delay in nanoseconds between last bit of current | ||
transaction and deasserting the device chip select | ||
(qspi_n_ss_out). | ||
- cdns,tslch-ns : Delay in nanoseconds between setting qspi_n_ss_out low | ||
and first bit transfer. | ||
|
||
Example: | ||
|
||
qspi: spi@ff705000 { | ||
compatible = "cdns,qspi-nor"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
reg = <0xff705000 0x1000>, | ||
<0xffa00000 0x1000>; | ||
interrupts = <0 151 4>; | ||
clocks = <&qspi_clk>; | ||
cdns,is-decoded-cs; | ||
cdns,fifo-depth = <128>; | ||
cdns,fifo-width = <4>; | ||
cdns,trigger-address = <0x00000000>; | ||
|
||
flash0: n25q00@0 { | ||
... | ||
cdns,read-delay = <4>; | ||
cdns,tshsl-ns = <50>; | ||
cdns,tsd2d-ns = <50>; | ||
cdns,tchsh-ns = <4>; | ||
cdns,tslch-ns = <4>; | ||
}; | ||
}; |
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
24 changes: 24 additions & 0 deletions
24
Documentation/devicetree/bindings/mtd/hisilicon,fmc-spi-nor.txt
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,24 @@ | ||
HiSilicon SPI-NOR Flash Controller | ||
|
||
Required properties: | ||
- compatible : Should be "hisilicon,fmc-spi-nor" and one of the following strings: | ||
"hisilicon,hi3519-spi-nor" | ||
- address-cells : Should be 1. | ||
- size-cells : Should be 0. | ||
- reg : Offset and length of the register set for the controller device. | ||
- reg-names : Must include the following two entries: "control", "memory". | ||
- clocks : handle to spi-nor flash controller clock. | ||
|
||
Example: | ||
spi-nor-controller@10000000 { | ||
compatible = "hisilicon,hi3519-spi-nor", "hisilicon,fmc-spi-nor"; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
reg = <0x10000000 0x1000>, <0x14000000 0x1000000>; | ||
reg-names = "control", "memory"; | ||
clocks = <&clock HI3519_FMC_CLK>; | ||
spi-nor@0 { | ||
compatible = "jedec,spi-nor"; | ||
reg = <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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
MTK SoCs NAND FLASH controller (NFC) DT binding | ||
|
||
This file documents the device tree bindings for MTK SoCs NAND controllers. | ||
The functional split of the controller requires two drivers to operate: | ||
the nand controller interface driver and the ECC engine driver. | ||
|
||
The hardware description for both devices must be captured as device | ||
tree nodes. | ||
|
||
1) NFC NAND Controller Interface (NFI): | ||
======================================= | ||
|
||
The first part of NFC is NAND Controller Interface (NFI) HW. | ||
Required NFI properties: | ||
- compatible: Should be "mediatek,mtxxxx-nfc". | ||
- reg: Base physical address and size of NFI. | ||
- interrupts: Interrupts of NFI. | ||
- clocks: NFI required clocks. | ||
- clock-names: NFI clocks internal name. | ||
- status: Disabled default. Then set "okay" by platform. | ||
- ecc-engine: Required ECC Engine node. | ||
- #address-cells: NAND chip index, should be 1. | ||
- #size-cells: Should be 0. | ||
|
||
Example: | ||
|
||
nandc: nfi@1100d000 { | ||
compatible = "mediatek,mt2701-nfc"; | ||
reg = <0 0x1100d000 0 0x1000>; | ||
interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_LOW>; | ||
clocks = <&pericfg CLK_PERI_NFI>, | ||
<&pericfg CLK_PERI_NFI_PAD>; | ||
clock-names = "nfi_clk", "pad_clk"; | ||
status = "disabled"; | ||
ecc-engine = <&bch>; | ||
#address-cells = <1>; | ||
#size-cells = <0>; | ||
}; | ||
|
||
Platform related properties, should be set in {platform_name}.dts: | ||
- children nodes: NAND chips. | ||
|
||
Children nodes properties: | ||
- reg: Chip Select Signal, default 0. | ||
Set as reg = <0>, <1> when need 2 CS. | ||
Optional: | ||
- nand-on-flash-bbt: Store BBT on NAND Flash. | ||
- nand-ecc-mode: the NAND ecc mode (check driver for supported modes) | ||
- nand-ecc-step-size: Number of data bytes covered by a single ECC step. | ||
valid values: 512 and 1024. | ||
1024 is recommended for large page NANDs. | ||
- nand-ecc-strength: Number of bits to correct per ECC step. | ||
The valid values that the controller supports are: 4, 6, | ||
8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 40, 44, | ||
48, 52, 56, 60. | ||
The strength should be calculated as follows: | ||
E = (S - F) * 8 / 14 | ||
S = O / (P / Q) | ||
E : nand-ecc-strength. | ||
S : spare size per sector. | ||
F : FDM size, should be in the range [1,8]. | ||
It is used to store free oob data. | ||
O : oob size. | ||
P : page size. | ||
Q : nand-ecc-step-size. | ||
If the result does not match any one of the listed | ||
choices above, please select the smaller valid value from | ||
the list. | ||
(otherwise the driver will do the adjustment at runtime) | ||
- pinctrl-names: Default NAND pin GPIO setting name. | ||
- pinctrl-0: GPIO setting node. | ||
|
||
Example: | ||
&pio { | ||
nand_pins_default: nanddefault { | ||
pins_dat { | ||
pinmux = <MT2701_PIN_111_MSDC0_DAT7__FUNC_NLD7>, | ||
<MT2701_PIN_112_MSDC0_DAT6__FUNC_NLD6>, | ||
<MT2701_PIN_114_MSDC0_DAT4__FUNC_NLD4>, | ||
<MT2701_PIN_118_MSDC0_DAT3__FUNC_NLD3>, | ||
<MT2701_PIN_121_MSDC0_DAT0__FUNC_NLD0>, | ||
<MT2701_PIN_120_MSDC0_DAT1__FUNC_NLD1>, | ||
<MT2701_PIN_113_MSDC0_DAT5__FUNC_NLD5>, | ||
<MT2701_PIN_115_MSDC0_RSTB__FUNC_NLD8>, | ||
<MT2701_PIN_119_MSDC0_DAT2__FUNC_NLD2>; | ||
input-enable; | ||
drive-strength = <MTK_DRIVE_8mA>; | ||
bias-pull-up; | ||
}; | ||
|
||
pins_we { | ||
pinmux = <MT2701_PIN_117_MSDC0_CLK__FUNC_NWEB>; | ||
drive-strength = <MTK_DRIVE_8mA>; | ||
bias-pull-up = <MTK_PUPD_SET_R1R0_10>; | ||
}; | ||
|
||
pins_ale { | ||
pinmux = <MT2701_PIN_116_MSDC0_CMD__FUNC_NALE>; | ||
drive-strength = <MTK_DRIVE_8mA>; | ||
bias-pull-down = <MTK_PUPD_SET_R1R0_10>; | ||
}; | ||
}; | ||
}; | ||
|
||
&nandc { | ||
status = "okay"; | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&nand_pins_default>; | ||
nand@0 { | ||
reg = <0>; | ||
nand-on-flash-bbt; | ||
nand-ecc-mode = "hw"; | ||
nand-ecc-strength = <24>; | ||
nand-ecc-step-size = <1024>; | ||
}; | ||
}; | ||
|
||
NAND chip optional subnodes: | ||
- Partitions, see Documentation/devicetree/bindings/mtd/partition.txt | ||
|
||
Example: | ||
nand@0 { | ||
partitions { | ||
compatible = "fixed-partitions"; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
preloader@0 { | ||
label = "pl"; | ||
read-only; | ||
reg = <0x00000000 0x00400000>; | ||
}; | ||
android@0x00400000 { | ||
label = "android"; | ||
reg = <0x00400000 0x12c00000>; | ||
}; | ||
}; | ||
}; | ||
|
||
2) ECC Engine: | ||
============== | ||
|
||
Required BCH properties: | ||
- compatible: Should be "mediatek,mtxxxx-ecc". | ||
- reg: Base physical address and size of ECC. | ||
- interrupts: Interrupts of ECC. | ||
- clocks: ECC required clocks. | ||
- clock-names: ECC clocks internal name. | ||
- status: Disabled default. Then set "okay" by platform. | ||
|
||
Example: | ||
|
||
bch: ecc@1100e000 { | ||
compatible = "mediatek,mt2701-ecc"; | ||
reg = <0 0x1100e000 0 0x1000>; | ||
interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_LOW>; | ||
clocks = <&pericfg CLK_PERI_NFI_ECC>; | ||
clock-names = "nfiecc_clk"; | ||
status = "disabled"; | ||
}; |
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.