xref: /freebsd/sys/contrib/device-tree/Bindings/mtd/mediatek,mtk-nfc.yaml (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1cb7aa33aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2cb7aa33aSEmmanuel Vadot%YAML 1.2
3cb7aa33aSEmmanuel Vadot---
4cb7aa33aSEmmanuel Vadot$id: http://devicetree.org/schemas/mtd/mediatek,mtk-nfc.yaml#
5cb7aa33aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6cb7aa33aSEmmanuel Vadot
7cb7aa33aSEmmanuel Vadottitle: MediaTek(MTK) SoCs raw NAND FLASH controller (NFC)
8cb7aa33aSEmmanuel Vadot
9cb7aa33aSEmmanuel Vadotmaintainers:
10cb7aa33aSEmmanuel Vadot  - Xiangsheng Hou <xiangsheng.hou@mediatek.com>
11cb7aa33aSEmmanuel Vadot
12cb7aa33aSEmmanuel Vadotproperties:
13cb7aa33aSEmmanuel Vadot  compatible:
14cb7aa33aSEmmanuel Vadot    enum:
15cb7aa33aSEmmanuel Vadot      - mediatek,mt2701-nfc
16cb7aa33aSEmmanuel Vadot      - mediatek,mt2712-nfc
17cb7aa33aSEmmanuel Vadot      - mediatek,mt7622-nfc
18cb7aa33aSEmmanuel Vadot
19cb7aa33aSEmmanuel Vadot  reg:
20cb7aa33aSEmmanuel Vadot    items:
21cb7aa33aSEmmanuel Vadot      - description: Base physical address and size of NFI.
22cb7aa33aSEmmanuel Vadot
23cb7aa33aSEmmanuel Vadot  interrupts:
24cb7aa33aSEmmanuel Vadot    items:
25cb7aa33aSEmmanuel Vadot      - description: NFI interrupt
26cb7aa33aSEmmanuel Vadot
27cb7aa33aSEmmanuel Vadot  clocks:
28cb7aa33aSEmmanuel Vadot    items:
29cb7aa33aSEmmanuel Vadot      - description: clock used for the controller
30cb7aa33aSEmmanuel Vadot      - description: clock used for the pad
31cb7aa33aSEmmanuel Vadot
32cb7aa33aSEmmanuel Vadot  clock-names:
33cb7aa33aSEmmanuel Vadot    items:
34cb7aa33aSEmmanuel Vadot      - const: nfi_clk
35cb7aa33aSEmmanuel Vadot      - const: pad_clk
36cb7aa33aSEmmanuel Vadot
37cb7aa33aSEmmanuel Vadot  ecc-engine:
38cb7aa33aSEmmanuel Vadot    description: device-tree node of the required ECC engine.
39cb7aa33aSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
40cb7aa33aSEmmanuel Vadot
41cb7aa33aSEmmanuel VadotpatternProperties:
42cb7aa33aSEmmanuel Vadot  "^nand@[a-f0-9]$":
43*f126890aSEmmanuel Vadot    $ref: raw-nand-chip.yaml#
44cb7aa33aSEmmanuel Vadot    unevaluatedProperties: false
45cb7aa33aSEmmanuel Vadot    properties:
46cb7aa33aSEmmanuel Vadot      reg:
47cb7aa33aSEmmanuel Vadot        maximum: 1
48cb7aa33aSEmmanuel Vadot      nand-ecc-mode:
49cb7aa33aSEmmanuel Vadot        const: hw
50cb7aa33aSEmmanuel Vadot
51cb7aa33aSEmmanuel VadotallOf:
52cb7aa33aSEmmanuel Vadot  - $ref: nand-controller.yaml#
53cb7aa33aSEmmanuel Vadot
54cb7aa33aSEmmanuel Vadot  - if:
55cb7aa33aSEmmanuel Vadot      properties:
56cb7aa33aSEmmanuel Vadot        compatible:
57cb7aa33aSEmmanuel Vadot          contains:
58cb7aa33aSEmmanuel Vadot            const: mediatek,mt2701-nfc
59cb7aa33aSEmmanuel Vadot    then:
60cb7aa33aSEmmanuel Vadot      patternProperties:
61cb7aa33aSEmmanuel Vadot        "^nand@[a-f0-9]$":
62cb7aa33aSEmmanuel Vadot          properties:
63cb7aa33aSEmmanuel Vadot            nand-ecc-step-size:
64cb7aa33aSEmmanuel Vadot              enum: [ 512, 1024 ]
65cb7aa33aSEmmanuel Vadot            nand-ecc-strength:
66cb7aa33aSEmmanuel Vadot              enum: [4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36,
67cb7aa33aSEmmanuel Vadot                     40, 44, 48, 52, 56, 60]
68cb7aa33aSEmmanuel Vadot
69cb7aa33aSEmmanuel Vadot  - if:
70cb7aa33aSEmmanuel Vadot      properties:
71cb7aa33aSEmmanuel Vadot        compatible:
72cb7aa33aSEmmanuel Vadot          contains:
73cb7aa33aSEmmanuel Vadot            const: mediatek,mt2712-nfc
74cb7aa33aSEmmanuel Vadot    then:
75cb7aa33aSEmmanuel Vadot      patternProperties:
76cb7aa33aSEmmanuel Vadot        "^nand@[a-f0-9]$":
77cb7aa33aSEmmanuel Vadot          properties:
78cb7aa33aSEmmanuel Vadot            nand-ecc-step-size:
79cb7aa33aSEmmanuel Vadot              enum: [ 512, 1024 ]
80cb7aa33aSEmmanuel Vadot            nand-ecc-strength:
81cb7aa33aSEmmanuel Vadot              enum: [4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36,
82cb7aa33aSEmmanuel Vadot                     40, 44, 48, 52, 56, 60, 68, 72, 80]
83cb7aa33aSEmmanuel Vadot
84cb7aa33aSEmmanuel Vadot  - if:
85cb7aa33aSEmmanuel Vadot      properties:
86cb7aa33aSEmmanuel Vadot        compatible:
87cb7aa33aSEmmanuel Vadot          contains:
88cb7aa33aSEmmanuel Vadot            const: mediatek,mt7622-nfc
89cb7aa33aSEmmanuel Vadot    then:
90cb7aa33aSEmmanuel Vadot      patternProperties:
91cb7aa33aSEmmanuel Vadot        "^nand@[a-f0-9]$":
92cb7aa33aSEmmanuel Vadot          properties:
93cb7aa33aSEmmanuel Vadot            nand-ecc-step-size:
94cb7aa33aSEmmanuel Vadot              const: 512
95cb7aa33aSEmmanuel Vadot            nand-ecc-strength:
96cb7aa33aSEmmanuel Vadot              enum: [4, 6, 8, 10, 12]
97cb7aa33aSEmmanuel Vadot
98cb7aa33aSEmmanuel Vadotrequired:
99cb7aa33aSEmmanuel Vadot  - compatible
100cb7aa33aSEmmanuel Vadot  - reg
101cb7aa33aSEmmanuel Vadot  - interrupts
102cb7aa33aSEmmanuel Vadot  - clocks
103cb7aa33aSEmmanuel Vadot  - clock-names
104cb7aa33aSEmmanuel Vadot  - ecc-engine
105cb7aa33aSEmmanuel Vadot
106cb7aa33aSEmmanuel VadotunevaluatedProperties: false
107cb7aa33aSEmmanuel Vadot
108cb7aa33aSEmmanuel Vadotexamples:
109cb7aa33aSEmmanuel Vadot  - |
110cb7aa33aSEmmanuel Vadot    #include <dt-bindings/clock/mt2701-clk.h>
111cb7aa33aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
112cb7aa33aSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
113cb7aa33aSEmmanuel Vadot
114cb7aa33aSEmmanuel Vadot    soc {
115cb7aa33aSEmmanuel Vadot        #address-cells = <2>;
116cb7aa33aSEmmanuel Vadot        #size-cells = <2>;
117cb7aa33aSEmmanuel Vadot
118cb7aa33aSEmmanuel Vadot        nand-controller@1100d000 {
119cb7aa33aSEmmanuel Vadot            compatible = "mediatek,mt2701-nfc";
120cb7aa33aSEmmanuel Vadot            reg = <0 0x1100d000 0 0x1000>;
121cb7aa33aSEmmanuel Vadot            interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_LOW>;
122cb7aa33aSEmmanuel Vadot            clocks = <&pericfg CLK_PERI_NFI>,
123cb7aa33aSEmmanuel Vadot                     <&pericfg CLK_PERI_NFI_PAD>;
124cb7aa33aSEmmanuel Vadot            clock-names = "nfi_clk", "pad_clk";
125cb7aa33aSEmmanuel Vadot            ecc-engine = <&bch>;
126cb7aa33aSEmmanuel Vadot            #address-cells = <1>;
127cb7aa33aSEmmanuel Vadot            #size-cells = <0>;
128cb7aa33aSEmmanuel Vadot
129cb7aa33aSEmmanuel Vadot            nand@0 {
130cb7aa33aSEmmanuel Vadot                reg = <0>;
131cb7aa33aSEmmanuel Vadot
132cb7aa33aSEmmanuel Vadot                nand-on-flash-bbt;
133cb7aa33aSEmmanuel Vadot                nand-ecc-mode = "hw";
134cb7aa33aSEmmanuel Vadot                nand-ecc-step-size = <1024>;
135cb7aa33aSEmmanuel Vadot                nand-ecc-strength = <24>;
136cb7aa33aSEmmanuel Vadot
137cb7aa33aSEmmanuel Vadot                partitions {
138cb7aa33aSEmmanuel Vadot                    compatible = "fixed-partitions";
139cb7aa33aSEmmanuel Vadot                    #address-cells = <1>;
140cb7aa33aSEmmanuel Vadot                    #size-cells = <1>;
141cb7aa33aSEmmanuel Vadot
142cb7aa33aSEmmanuel Vadot                    preloader@0 {
143cb7aa33aSEmmanuel Vadot                        label = "pl";
144cb7aa33aSEmmanuel Vadot                        read-only;
145cb7aa33aSEmmanuel Vadot                        reg = <0x0 0x400000>;
146cb7aa33aSEmmanuel Vadot                    };
147cb7aa33aSEmmanuel Vadot                    android@400000 {
148cb7aa33aSEmmanuel Vadot                        label = "android";
149cb7aa33aSEmmanuel Vadot                        reg = <0x400000 0x12c00000>;
150cb7aa33aSEmmanuel Vadot                    };
151cb7aa33aSEmmanuel Vadot                };
152cb7aa33aSEmmanuel Vadot            };
153cb7aa33aSEmmanuel Vadot        };
154cb7aa33aSEmmanuel Vadot    };
155