Skip to content

Commit 3af7ade

Browse files
mtk-xiangshengmiquelraynal
authored andcommitted
dt-bindings: mtd: Split ECC engine with rawnand controller
Split MediaTek ECC engine with rawnand controller and convert to YAML schema. Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230201021500.26769-2-xiangsheng.hou@mediatek.com
1 parent b562652 commit 3af7ade

4 files changed

Lines changed: 218 additions & 177 deletions

File tree

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

Documentation/devicetree/bindings/mtd/mtk-nand.txt

Lines changed: 0 additions & 176 deletions
This file was deleted.

0 commit comments

Comments
 (0)