18c2ecf20Sopenharmony_ci* Qualcomm NAND controller
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciRequired properties:
48c2ecf20Sopenharmony_ci- compatible:		must be one of the following:
58c2ecf20Sopenharmony_ci    * "qcom,ipq806x-nand" - for EBI2 NAND controller being used in IPQ806x
68c2ecf20Sopenharmony_ci			    SoC and it uses ADM DMA
78c2ecf20Sopenharmony_ci    * "qcom,ipq4019-nand" - for QPIC NAND controller v1.4.0 being used in
88c2ecf20Sopenharmony_ci                            IPQ4019 SoC and it uses BAM DMA
98c2ecf20Sopenharmony_ci    * "qcom,ipq8074-nand" - for QPIC NAND controller v1.5.0 being used in
108c2ecf20Sopenharmony_ci                            IPQ8074 SoC and it uses BAM DMA
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci- reg:			MMIO address range
138c2ecf20Sopenharmony_ci- clocks:		must contain core clock and always on clock
148c2ecf20Sopenharmony_ci- clock-names:		must contain "core" for the core clock and "aon" for the
158c2ecf20Sopenharmony_ci			always on clock
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciEBI2 specific properties:
188c2ecf20Sopenharmony_ci- dmas:			DMA specifier, consisting of a phandle to the ADM DMA
198c2ecf20Sopenharmony_ci			controller node and the channel number to be used for
208c2ecf20Sopenharmony_ci			NAND. Refer to dma.txt and qcom_adm.txt for more details
218c2ecf20Sopenharmony_ci- dma-names:		must be "rxtx"
228c2ecf20Sopenharmony_ci- qcom,cmd-crci:	must contain the ADM command type CRCI block instance
238c2ecf20Sopenharmony_ci			number specified for the NAND controller on the given
248c2ecf20Sopenharmony_ci			platform
258c2ecf20Sopenharmony_ci- qcom,data-crci:	must contain the ADM data type CRCI block instance
268c2ecf20Sopenharmony_ci			number specified for the NAND controller on the given
278c2ecf20Sopenharmony_ci			platform
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ciQPIC specific properties:
308c2ecf20Sopenharmony_ci- dmas:			DMA specifier, consisting of a phandle to the BAM DMA
318c2ecf20Sopenharmony_ci			and the channel number to be used for NAND. Refer to
328c2ecf20Sopenharmony_ci			dma.txt, qcom_bam_dma.txt for more details
338c2ecf20Sopenharmony_ci- dma-names:		must contain all 3 channel names : "tx", "rx", "cmd"
348c2ecf20Sopenharmony_ci- #address-cells:	<1> - subnodes give the chip-select number
358c2ecf20Sopenharmony_ci- #size-cells:		<0>
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci* NAND chip-select
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ciEach controller may contain one or more subnodes to represent enabled
408c2ecf20Sopenharmony_cichip-selects which (may) contain NAND flash chips. Their properties are as
418c2ecf20Sopenharmony_cifollows.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciRequired properties:
448c2ecf20Sopenharmony_ci- reg:			a single integer representing the chip-select
458c2ecf20Sopenharmony_ci			number (e.g., 0, 1, 2, etc.)
468c2ecf20Sopenharmony_ci- #address-cells:	see partition.txt
478c2ecf20Sopenharmony_ci- #size-cells:		see partition.txt
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ciOptional properties:
508c2ecf20Sopenharmony_ci- nand-bus-width:	see nand-controller.yaml
518c2ecf20Sopenharmony_ci- nand-ecc-strength:	see nand-controller.yaml. If not specified, then ECC strength will
528c2ecf20Sopenharmony_ci			be used according to chip requirement and available
538c2ecf20Sopenharmony_ci			OOB size.
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciEach nandcs device node may optionally contain a 'partitions' sub-node, which
568c2ecf20Sopenharmony_cifurther contains sub-nodes describing the flash partition mapping. See
578c2ecf20Sopenharmony_cipartition.txt for more detail.
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ciExample:
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_cinand-controller@1ac00000 {
628c2ecf20Sopenharmony_ci	compatible = "qcom,ipq806x-nand";
638c2ecf20Sopenharmony_ci	reg = <0x1ac00000 0x800>;
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci	clocks = <&gcc EBI2_CLK>,
668c2ecf20Sopenharmony_ci		 <&gcc EBI2_AON_CLK>;
678c2ecf20Sopenharmony_ci	clock-names = "core", "aon";
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci	dmas = <&adm_dma 3>;
708c2ecf20Sopenharmony_ci	dma-names = "rxtx";
718c2ecf20Sopenharmony_ci	qcom,cmd-crci = <15>;
728c2ecf20Sopenharmony_ci	qcom,data-crci = <3>;
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci	#address-cells = <1>;
758c2ecf20Sopenharmony_ci	#size-cells = <0>;
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci	nand@0 {
788c2ecf20Sopenharmony_ci		reg = <0>;
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci		nand-ecc-strength = <4>;
818c2ecf20Sopenharmony_ci		nand-bus-width = <8>;
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci		partitions {
848c2ecf20Sopenharmony_ci			compatible = "fixed-partitions";
858c2ecf20Sopenharmony_ci			#address-cells = <1>;
868c2ecf20Sopenharmony_ci			#size-cells = <1>;
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci			partition@0 {
898c2ecf20Sopenharmony_ci				label = "boot-nand";
908c2ecf20Sopenharmony_ci				reg = <0 0x58a0000>;
918c2ecf20Sopenharmony_ci			};
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci			partition@58a0000 {
948c2ecf20Sopenharmony_ci				label = "fs-nand";
958c2ecf20Sopenharmony_ci				reg = <0x58a0000 0x4000000>;
968c2ecf20Sopenharmony_ci			};
978c2ecf20Sopenharmony_ci		};
988c2ecf20Sopenharmony_ci	};
998c2ecf20Sopenharmony_ci};
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_cinand-controller@79b0000 {
1028c2ecf20Sopenharmony_ci	compatible = "qcom,ipq4019-nand";
1038c2ecf20Sopenharmony_ci	reg = <0x79b0000 0x1000>;
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci	clocks = <&gcc GCC_QPIC_CLK>,
1068c2ecf20Sopenharmony_ci		<&gcc GCC_QPIC_AHB_CLK>;
1078c2ecf20Sopenharmony_ci	clock-names = "core", "aon";
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci	dmas = <&qpicbam 0>,
1108c2ecf20Sopenharmony_ci		<&qpicbam 1>,
1118c2ecf20Sopenharmony_ci		<&qpicbam 2>;
1128c2ecf20Sopenharmony_ci	dma-names = "tx", "rx", "cmd";
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci	#address-cells = <1>;
1158c2ecf20Sopenharmony_ci	#size-cells = <0>;
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci	nand@0 {
1188c2ecf20Sopenharmony_ci		reg = <0>;
1198c2ecf20Sopenharmony_ci		nand-ecc-strength = <4>;
1208c2ecf20Sopenharmony_ci		nand-bus-width = <8>;
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci		partitions {
1238c2ecf20Sopenharmony_ci			compatible = "fixed-partitions";
1248c2ecf20Sopenharmony_ci			#address-cells = <1>;
1258c2ecf20Sopenharmony_ci			#size-cells = <1>;
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci			partition@0 {
1288c2ecf20Sopenharmony_ci				label = "boot-nand";
1298c2ecf20Sopenharmony_ci				reg = <0 0x58a0000>;
1308c2ecf20Sopenharmony_ci			};
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci			partition@58a0000 {
1338c2ecf20Sopenharmony_ci				label = "fs-nand";
1348c2ecf20Sopenharmony_ci				reg = <0x58a0000 0x4000000>;
1358c2ecf20Sopenharmony_ci			};
1368c2ecf20Sopenharmony_ci		};
1378c2ecf20Sopenharmony_ci	};
1388c2ecf20Sopenharmony_ci};
139