1 MTK SoCs NAND FLASH controller (NFC) DT binding
3 This file documents the device tree bindings for MTK SoCs NAND controllers.
4 The functional split of the controller requires two drivers to operate:
5 the nand controller interface driver and the ECC engine driver.
7 The hardware description for both devices must be captured as device
10 1) NFC NAND Controller Interface (NFI):
11 =======================================
13 The first part of NFC is NAND Controller Interface (NFI) HW.
14 Required NFI properties:
15 - compatible: Should be one of
16 "mediatek,mt2701-nfc",
17 "mediatek,mt2712-nfc",
18 "mediatek,mt7622-nfc".
19 - reg: Base physical address and size of NFI.
20 - interrupts: Interrupts of NFI.
21 - clocks: NFI required clocks.
22 - clock-names: NFI clocks internal name.
23 - status: Disabled default. Then set "okay" by platform.
24 - ecc-engine: Required ECC Engine node.
25 - #address-cells: NAND chip index, should be 1.
26 - #size-cells: Should be 0.
31 compatible = "mediatek,mt2701-nfc";
32 reg = <0 0x1100d000 0 0x1000>;
33 interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_LOW>;
34 clocks = <&pericfg CLK_PERI_NFI>,
35 <&pericfg CLK_PERI_NFI_PAD>;
36 clock-names = "nfi_clk", "pad_clk";
43 Platform related properties, should be set in {platform_name}.dts:
44 - children nodes: NAND chips.
46 Children nodes properties:
47 - reg: Chip Select Signal, default 0.
48 Set as reg = <0>, <1> when need 2 CS.
50 - nand-on-flash-bbt: Store BBT on NAND Flash.
51 - nand-ecc-mode: the NAND ecc mode (check driver for supported modes)
52 - nand-ecc-step-size: Number of data bytes covered by a single ECC step.
53 valid values: 512 and 1024.
54 1024 is recommended for large page NANDs.
55 - nand-ecc-strength: Number of bits to correct per ECC step.
56 The valid values that the controller supports are: 4, 6,
57 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 40, 44,
59 The strength should be calculated as follows:
62 E : nand-ecc-strength.
63 S : spare size per sector.
64 F : FDM size, should be in the range [1,8].
65 It is used to store free oob data.
68 Q : nand-ecc-step-size.
69 If the result does not match any one of the listed
70 choices above, please select the smaller valid value from
72 (otherwise the driver will do the adjustment at runtime)
73 - pinctrl-names: Default NAND pin GPIO setting name.
74 - pinctrl-0: GPIO setting node.
78 nand_pins_default: nanddefault {
80 pinmux = <MT2701_PIN_111_MSDC0_DAT7__FUNC_NLD7>,
81 <MT2701_PIN_112_MSDC0_DAT6__FUNC_NLD6>,
82 <MT2701_PIN_114_MSDC0_DAT4__FUNC_NLD4>,
83 <MT2701_PIN_118_MSDC0_DAT3__FUNC_NLD3>,
84 <MT2701_PIN_121_MSDC0_DAT0__FUNC_NLD0>,
85 <MT2701_PIN_120_MSDC0_DAT1__FUNC_NLD1>,
86 <MT2701_PIN_113_MSDC0_DAT5__FUNC_NLD5>,
87 <MT2701_PIN_115_MSDC0_RSTB__FUNC_NLD8>,
88 <MT2701_PIN_119_MSDC0_DAT2__FUNC_NLD2>;
90 drive-strength = <MTK_DRIVE_8mA>;
95 pinmux = <MT2701_PIN_117_MSDC0_CLK__FUNC_NWEB>;
96 drive-strength = <MTK_DRIVE_8mA>;
97 bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
101 pinmux = <MT2701_PIN_116_MSDC0_CMD__FUNC_NALE>;
102 drive-strength = <MTK_DRIVE_8mA>;
103 bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
110 pinctrl-names = "default";
111 pinctrl-0 = <&nand_pins_default>;
115 nand-ecc-mode = "hw";
116 nand-ecc-strength = <24>;
117 nand-ecc-step-size = <1024>;
121 NAND chip optional subnodes:
122 - Partitions, see Documentation/devicetree/bindings/mtd/partition.txt
127 compatible = "fixed-partitions";
128 #address-cells = <1>;
134 reg = <0x00000000 0x00400000>;
138 reg = <0x00400000 0x12c00000>;
146 Required BCH properties:
147 - compatible: Should be one of
148 "mediatek,mt2701-ecc",
149 "mediatek,mt2712-ecc",
150 "mediatek,mt7622-ecc".
151 - reg: Base physical address and size of ECC.
152 - interrupts: Interrupts of ECC.
153 - clocks: ECC required clocks.
154 - clock-names: ECC clocks internal name.
155 - status: Disabled default. Then set "okay" by platform.
160 compatible = "mediatek,mt2701-ecc";
161 reg = <0 0x1100e000 0 0x1000>;
162 interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_LOW>;
163 clocks = <&pericfg CLK_PERI_NFI_ECC>;
164 clock-names = "nfiecc_clk";