xref: /freebsd/sys/contrib/device-tree/Bindings/mtd/marvell-nand.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotMarvell NAND Flash Controller (NFC)
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotRequired properties:
4*c66ec88fSEmmanuel Vadot- compatible: can be one of the following:
5*c66ec88fSEmmanuel Vadot    * "marvell,armada-8k-nand-controller"
6*c66ec88fSEmmanuel Vadot    * "marvell,armada370-nand-controller"
7*c66ec88fSEmmanuel Vadot    * "marvell,pxa3xx-nand-controller"
8*c66ec88fSEmmanuel Vadot    * "marvell,armada-8k-nand" (deprecated)
9*c66ec88fSEmmanuel Vadot    * "marvell,armada370-nand" (deprecated)
10*c66ec88fSEmmanuel Vadot    * "marvell,pxa3xx-nand" (deprecated)
11*c66ec88fSEmmanuel Vadot  Compatibles marked deprecated support only the old bindings described
12*c66ec88fSEmmanuel Vadot  at the bottom.
13*c66ec88fSEmmanuel Vadot- reg: NAND flash controller memory area.
14*c66ec88fSEmmanuel Vadot- #address-cells: shall be set to 1. Encode the NAND CS.
15*c66ec88fSEmmanuel Vadot- #size-cells: shall be set to 0.
16*c66ec88fSEmmanuel Vadot- interrupts: shall define the NAND controller interrupt.
17*c66ec88fSEmmanuel Vadot- clocks: shall reference the NAND controller clocks, the second one is
18*c66ec88fSEmmanuel Vadot  is only needed for the Armada 7K/8K SoCs
19*c66ec88fSEmmanuel Vadot- clock-names: mandatory if there is a second clock, in this case there
20*c66ec88fSEmmanuel Vadot  should be one clock named "core" and another one named "reg"
21*c66ec88fSEmmanuel Vadot- marvell,system-controller: Set to retrieve the syscon node that handles
22*c66ec88fSEmmanuel Vadot  NAND controller related registers (only required with the
23*c66ec88fSEmmanuel Vadot  "marvell,armada-8k-nand[-controller]" compatibles).
24*c66ec88fSEmmanuel Vadot
25*c66ec88fSEmmanuel VadotOptional properties:
26*c66ec88fSEmmanuel Vadot- label: see partition.txt. New platforms shall omit this property.
27*c66ec88fSEmmanuel Vadot- dmas: shall reference DMA channel associated to the NAND controller.
28*c66ec88fSEmmanuel Vadot  This property is only used with "marvell,pxa3xx-nand[-controller]"
29*c66ec88fSEmmanuel Vadot  compatible strings.
30*c66ec88fSEmmanuel Vadot- dma-names: shall be "rxtx".
31*c66ec88fSEmmanuel Vadot  This property is only used with "marvell,pxa3xx-nand[-controller]"
32*c66ec88fSEmmanuel Vadot  compatible strings.
33*c66ec88fSEmmanuel Vadot
34*c66ec88fSEmmanuel VadotOptional children nodes:
35*c66ec88fSEmmanuel VadotChildren nodes represent the available NAND chips.
36*c66ec88fSEmmanuel Vadot
37*c66ec88fSEmmanuel VadotRequired properties:
38*c66ec88fSEmmanuel Vadot- reg: shall contain the native Chip Select ids (0-3).
39*c66ec88fSEmmanuel Vadot- nand-rb: see nand-controller.yaml (0-1).
40*c66ec88fSEmmanuel Vadot
41*c66ec88fSEmmanuel VadotOptional properties:
42*c66ec88fSEmmanuel Vadot- marvell,nand-keep-config: orders the driver not to take the timings
43*c66ec88fSEmmanuel Vadot  from the core and leaving them completely untouched. Bootloader
44*c66ec88fSEmmanuel Vadot  timings will then be used.
45*c66ec88fSEmmanuel Vadot- label: MTD name.
46*c66ec88fSEmmanuel Vadot- nand-on-flash-bbt: see nand-controller.yaml.
47*c66ec88fSEmmanuel Vadot- nand-ecc-mode: see nand-controller.yaml. Will use hardware ECC if not specified.
48*c66ec88fSEmmanuel Vadot- nand-ecc-algo: see nand-controller.yaml. This property is essentially useful when
49*c66ec88fSEmmanuel Vadot  not using hardware ECC. Howerver, it may be added when using hardware
50*c66ec88fSEmmanuel Vadot  ECC for clarification but will be ignored by the driver because ECC
51*c66ec88fSEmmanuel Vadot  mode is chosen depending on the page size and the strength required by
52*c66ec88fSEmmanuel Vadot  the NAND chip. This value may be overwritten with nand-ecc-strength
53*c66ec88fSEmmanuel Vadot  property.
54*c66ec88fSEmmanuel Vadot- nand-ecc-strength: see nand-controller.yaml.
55*c66ec88fSEmmanuel Vadot- nand-ecc-step-size: see nand-controller.yaml. Marvell's NAND flash controller does
56*c66ec88fSEmmanuel Vadot  use fixed strength (1-bit for Hamming, 16-bit for BCH), so the actual
57*c66ec88fSEmmanuel Vadot  step size will shrink or grow in order to fit the required strength.
58*c66ec88fSEmmanuel Vadot  Step sizes are not completely random for all and follow certain
59*c66ec88fSEmmanuel Vadot  patterns described in AN-379, "Marvell SoC NFC ECC".
60*c66ec88fSEmmanuel Vadot
61*c66ec88fSEmmanuel VadotSee Documentation/devicetree/bindings/mtd/nand-controller.yaml for more details on
62*c66ec88fSEmmanuel Vadotgeneric bindings.
63*c66ec88fSEmmanuel Vadot
64*c66ec88fSEmmanuel Vadot
65*c66ec88fSEmmanuel VadotExample:
66*c66ec88fSEmmanuel Vadotnand_controller: nand-controller@d0000 {
67*c66ec88fSEmmanuel Vadot	compatible = "marvell,armada370-nand-controller";
68*c66ec88fSEmmanuel Vadot	reg = <0xd0000 0x54>;
69*c66ec88fSEmmanuel Vadot	#address-cells = <1>;
70*c66ec88fSEmmanuel Vadot	#size-cells = <0>;
71*c66ec88fSEmmanuel Vadot	interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
72*c66ec88fSEmmanuel Vadot	clocks = <&coredivclk 0>;
73*c66ec88fSEmmanuel Vadot
74*c66ec88fSEmmanuel Vadot	nand@0 {
75*c66ec88fSEmmanuel Vadot		reg = <0>;
76*c66ec88fSEmmanuel Vadot		label = "main-storage";
77*c66ec88fSEmmanuel Vadot		nand-rb = <0>;
78*c66ec88fSEmmanuel Vadot		nand-ecc-mode = "hw";
79*c66ec88fSEmmanuel Vadot		marvell,nand-keep-config;
80*c66ec88fSEmmanuel Vadot		nand-on-flash-bbt;
81*c66ec88fSEmmanuel Vadot		nand-ecc-strength = <4>;
82*c66ec88fSEmmanuel Vadot		nand-ecc-step-size = <512>;
83*c66ec88fSEmmanuel Vadot
84*c66ec88fSEmmanuel Vadot		partitions {
85*c66ec88fSEmmanuel Vadot			compatible = "fixed-partitions";
86*c66ec88fSEmmanuel Vadot			#address-cells = <1>;
87*c66ec88fSEmmanuel Vadot			#size-cells = <1>;
88*c66ec88fSEmmanuel Vadot
89*c66ec88fSEmmanuel Vadot			partition@0 {
90*c66ec88fSEmmanuel Vadot				label = "Rootfs";
91*c66ec88fSEmmanuel Vadot				reg = <0x00000000 0x40000000>;
92*c66ec88fSEmmanuel Vadot			};
93*c66ec88fSEmmanuel Vadot		};
94*c66ec88fSEmmanuel Vadot	};
95*c66ec88fSEmmanuel Vadot};
96*c66ec88fSEmmanuel Vadot
97*c66ec88fSEmmanuel Vadot
98*c66ec88fSEmmanuel VadotNote on legacy bindings: One can find, in not-updated device trees,
99*c66ec88fSEmmanuel Vadotbindings slightly different than described above with other properties
100*c66ec88fSEmmanuel Vadotdescribed below as well as the partitions node at the root of a so
101*c66ec88fSEmmanuel Vadotcalled "nand" node (without clear controller/chip separation).
102*c66ec88fSEmmanuel Vadot
103*c66ec88fSEmmanuel VadotLegacy properties:
104*c66ec88fSEmmanuel Vadot- marvell,nand-enable-arbiter: To enable the arbiter, all boards blindly
105*c66ec88fSEmmanuel Vadot  used it, this bit was set by the bootloader for many boards and even if
106*c66ec88fSEmmanuel Vadot  it is marked reserved in several datasheets, it might be needed to set
107*c66ec88fSEmmanuel Vadot  it (otherwise it is harmless) so whether or not this property is set,
108*c66ec88fSEmmanuel Vadot  the bit is selected by the driver.
109*c66ec88fSEmmanuel Vadot- num-cs: Number of chip-select lines to use, all boards blindly set 1
110*c66ec88fSEmmanuel Vadot  to this and for a reason, other values would have failed. The value of
111*c66ec88fSEmmanuel Vadot  this property is ignored.
112*c66ec88fSEmmanuel Vadot
113*c66ec88fSEmmanuel VadotExample:
114*c66ec88fSEmmanuel Vadot
115*c66ec88fSEmmanuel Vadot	nand0: nand@43100000 {
116*c66ec88fSEmmanuel Vadot		compatible = "marvell,pxa3xx-nand";
117*c66ec88fSEmmanuel Vadot		reg = <0x43100000 90>;
118*c66ec88fSEmmanuel Vadot		interrupts = <45>;
119*c66ec88fSEmmanuel Vadot		dmas = <&pdma 97 0>;
120*c66ec88fSEmmanuel Vadot		dma-names = "rxtx";
121*c66ec88fSEmmanuel Vadot		#address-cells = <1>;
122*c66ec88fSEmmanuel Vadot		marvell,nand-keep-config;
123*c66ec88fSEmmanuel Vadot		marvell,nand-enable-arbiter;
124*c66ec88fSEmmanuel Vadot		num-cs = <1>;
125*c66ec88fSEmmanuel Vadot		/* Partitions (optional) */
126*c66ec88fSEmmanuel Vadot       };
127