xref: /linux/Documentation/devicetree/bindings/mtd/atmel-nand.txt (revision 04eeb606a8383b306f4bc6991da8231b5f3924b0)
1Atmel NAND flash
2
3Required properties:
4- compatible : "atmel,at91rm9200-nand".
5- reg : should specify localbus address and size used for the chip,
6	and hardware ECC controller if available.
7	If the hardware ECC is PMECC, it should contain address and size for
8	PMECC, PMECC Error Location controller and ROM which has lookup tables.
9- atmel,nand-addr-offset : offset for the address latch.
10- atmel,nand-cmd-offset : offset for the command latch.
11- #address-cells, #size-cells : Must be present if the device has sub-nodes
12  representing partitions.
13
14- gpios : specifies the gpio pins to control the NAND device. detect is an
15  optional gpio and may be set to 0 if not present.
16
17Optional properties:
18- atmel,nand-has-dma : boolean to support dma transfer for nand read/write.
19- nand-ecc-mode : String, operation mode of the NAND ecc mode, soft by default.
20  Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first",
21  "soft_bch".
22- atmel,has-pmecc : boolean to enable Programmable Multibit ECC hardware.
23  Only supported by at91sam9x5 or later sam9 product.
24- atmel,pmecc-cap : error correct capability for Programmable Multibit ECC
25  Controller. Supported values are: 2, 4, 8, 12, 24.
26- atmel,pmecc-sector-size : sector size for ECC computation. Supported values
27  are: 512, 1024.
28- atmel,pmecc-lookup-table-offset : includes two offsets of lookup table in ROM
29  for different sector size. First one is for sector size 512, the next is for
30  sector size 1024.
31- nand-bus-width : 8 or 16 bus width if not present 8
32- nand-on-flash-bbt: boolean to enable on flash bbt option if not present false
33- Nand Flash Controller(NFC) is a slave driver under Atmel nand flash
34  - Required properties:
35    - compatible : "atmel,sama5d3-nfc".
36    - reg : should specify the address and size used for NFC command registers,
37            NFC registers and NFC Sram. NFC Sram address and size can be absent
38            if don't want to use it.
39    - clocks: phandle to the peripheral clock
40  - Optional properties:
41    - atmel,write-by-sram: boolean to enable NFC write by sram.
42
43Examples:
44nand0: nand@40000000,0 {
45	compatible = "atmel,at91rm9200-nand";
46	#address-cells = <1>;
47	#size-cells = <1>;
48	reg = <0x40000000 0x10000000
49	       0xffffe800 0x200
50	      >;
51	atmel,nand-addr-offset = <21>;	/* ale */
52	atmel,nand-cmd-offset = <22>;	/* cle */
53	nand-on-flash-bbt;
54	nand-ecc-mode = "soft";
55	gpios = <&pioC 13 0	/* rdy */
56		 &pioC 14 0 	/* nce */
57		 0		/* cd */
58		>;
59	partition@0 {
60		...
61	};
62};
63
64/* for PMECC supported chips */
65nand0: nand@40000000 {
66	compatible = "atmel,at91rm9200-nand";
67	#address-cells = <1>;
68	#size-cells = <1>;
69	reg = < 0x40000000 0x10000000	/* bus addr & size */
70		0xffffe000 0x00000600	/* PMECC addr & size */
71		0xffffe600 0x00000200	/* PMECC ERRLOC addr & size */
72		0x00100000 0x00100000	/* ROM addr & size */
73		>;
74	atmel,nand-addr-offset = <21>;	/* ale */
75	atmel,nand-cmd-offset = <22>;	/* cle */
76	nand-on-flash-bbt;
77	nand-ecc-mode = "hw";
78	atmel,has-pmecc;	/* enable PMECC */
79	atmel,pmecc-cap = <2>;
80	atmel,pmecc-sector-size = <512>;
81	atmel,pmecc-lookup-table-offset = <0x8000 0x10000>;
82	gpios = <&pioD 5 0	/* rdy */
83		 &pioD 4 0	/* nce */
84		 0		/* cd */
85		>;
86	partition@0 {
87		...
88	};
89};
90
91/* for NFC supported chips */
92nand0: nand@40000000 {
93	compatible = "atmel,at91rm9200-nand";
94	#address-cells = <1>;
95	#size-cells = <1>;
96	ranges;
97        ...
98        nfc@70000000 {
99		compatible = "atmel,sama5d3-nfc";
100		#address-cells = <1>;
101		#size-cells = <1>;
102		clocks = <&hsmc_clk>
103		reg = <
104			0x70000000 0x10000000	/* NFC Command Registers */
105			0xffffc000 0x00000070	/* NFC HSMC regs */
106			0x00200000 0x00100000	/* NFC SRAM banks */
107		>;
108	};
109};
110