1 From 5e1c00983efeca4522ac2e8574e3e3997d26a203 Mon Sep 17 00:00:00 2001
2 From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
3 Date: Fri, 29 Apr 2016 12:17:21 -0400
4 Subject: [PATCH 074/102] mtd: mediatek: device tree docs for MTK Smart Device
7 This patch adds documentation support for Smart Device Gen1 type of
10 Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
12 Documentation/devicetree/bindings/mtd/mtk-nand.txt | 161 ++++++++++++++++++++
13 1 file changed, 161 insertions(+)
14 create mode 100644 Documentation/devicetree/bindings/mtd/mtk-nand.txt
16 diff --git a/Documentation/devicetree/bindings/mtd/mtk-nand.txt b/Documentation/devicetree/bindings/mtd/mtk-nand.txt
18 index 0000000..175767d
20 +++ b/Documentation/devicetree/bindings/mtd/mtk-nand.txt
22 +MTK SoCs NAND FLASH controller (NFC) DT binding
24 +This file documents the device tree bindings for MTK SoCs NAND controllers.
25 +The functional split of the controller requires two drivers to operate:
26 +the nand controller interface driver and the ECC engine driver.
28 +The hardware description for both devices must be captured as device
31 +1) NFC NAND Controller Interface (NFI):
32 +=======================================
34 +The first part of NFC is NAND Controller Interface (NFI) HW.
35 +Required NFI properties:
36 +- compatible: Should be "mediatek,mtxxxx-nfc".
37 +- reg: Base physical address and size of NFI.
38 +- interrupts: Interrupts of NFI.
39 +- clocks: NFI required clocks.
40 +- clock-names: NFI clocks internal name.
41 +- status: Disabled default. Then set "okay" by platform.
42 +- ecc-engine: Required ECC Engine node.
43 +- #address-cells: NAND chip index, should be 1.
44 +- #size-cells: Should be 0.
48 + nandc: nfi@1100d000 {
49 + compatible = "mediatek,mt2701-nfc";
50 + reg = <0 0x1100d000 0 0x1000>;
51 + interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_LOW>;
52 + clocks = <&pericfg CLK_PERI_NFI>,
53 + <&pericfg CLK_PERI_NFI_PAD>;
54 + clock-names = "nfi_clk", "pad_clk";
55 + status = "disabled";
56 + ecc-engine = <&bch>;
57 + #address-cells = <1>;
61 +Platform related properties, should be set in {platform_name}.dts:
62 +- children nodes: NAND chips.
64 +Children nodes properties:
65 +- reg: Chip Select Signal, default 0.
66 + Set as reg = <0>, <1> when need 2 CS.
68 +- nand-on-flash-bbt: Store BBT on NAND Flash.
69 +- nand-ecc-mode: the NAND ecc mode (check driver for supported modes)
70 +- nand-ecc-step-size: Number of data bytes covered by a single ECC step.
71 + The controller only supports 512 and 1024.
72 + For large page NANDs ther recommended value is 1024.
73 +- nand-ecc-strength: Number of bits to correct per ECC step.
74 + The valid values that the controller supports are: 4, 6,
75 + 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 40, 44,
77 + The strength should be calculated as follows:
78 + E = (S - F) * 8 / 14
80 + E :nand-ecc-strength;
81 + S :spare size per sector;
82 + F : FDM size, should be in the range [1,8].
83 + It is used to store free oob data.
86 + Q :nand-ecc-step-size
87 + If the result does not match any one of the listed
88 + choices above, please select the smaller valid value from
90 + (otherwise the driver will do the clamping at runtime).
91 +- vmch-supply: NAND power supply.
92 +- pinctrl-names: Default NAND pin GPIO setting name.
93 +- pinctrl-0: GPIO setting node.
97 + nand_pins_default: nanddefault {
99 + pinmux = <MT2701_PIN_111_MSDC0_DAT7__FUNC_NLD7>,
100 + <MT2701_PIN_112_MSDC0_DAT6__FUNC_NLD6>,
101 + <MT2701_PIN_114_MSDC0_DAT4__FUNC_NLD4>,
102 + <MT2701_PIN_118_MSDC0_DAT3__FUNC_NLD3>,
103 + <MT2701_PIN_121_MSDC0_DAT0__FUNC_NLD0>,
104 + <MT2701_PIN_120_MSDC0_DAT1__FUNC_NLD1>,
105 + <MT2701_PIN_113_MSDC0_DAT5__FUNC_NLD5>,
106 + <MT2701_PIN_115_MSDC0_RSTB__FUNC_NLD8>,
107 + <MT2701_PIN_119_MSDC0_DAT2__FUNC_NLD2>;
109 + drive-strength = <MTK_DRIVE_8mA>;
114 + pinmux = <MT2701_PIN_117_MSDC0_CLK__FUNC_NWEB>;
115 + drive-strength = <MTK_DRIVE_8mA>;
116 + bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
120 + pinmux = <MT2701_PIN_116_MSDC0_CMD__FUNC_NALE>;
121 + drive-strength = <MTK_DRIVE_8mA>;
122 + bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
129 + pinctrl-names = "default";
130 + pinctrl-0 = <&nand_pins_default>;
134 + nand-ecc-mode = "hw";
135 + nand-ecc-strength = <24>;
136 + nand-ecc-step-size = <1024>;
140 +NAND chip optional subnodes:
141 +- Partitions, see Documentation/devicetree/bindings/mtd/partition.txt
146 + compatible = "fixed-partitions";
147 + #address-cells = <1>;
153 + reg = <0x00000000 0x00400000>;
155 + android@0x00400000 {
157 + reg = <0x00400000 0x12c00000>;
165 +Required BCH properties:
166 +- compatible: Should be "mediatek,mtxxxx-ecc".
167 +- reg: Base physical address and size of ECC.
168 +- interrupts: Interrupts of ECC.
169 +- clocks: ECC required clocks.
170 +- clock-names: ECC clocks internal name.
171 +- status: Disabled default. Then set "okay" by platform.
175 + bch: ecc@1100e000 {
176 + compatible = "mediatek,mt2701-ecc";
177 + reg = <0 0x1100e000 0 0x1000>;
178 + interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_LOW>;
179 + clocks = <&pericfg CLK_PERI_NFI_ECC>;
180 + clock-names = "nfiecc_clk";
181 + status = "disabled";