0001 Marvell NAND Flash Controller (NFC)
0002
0003 Required properties:
0004 - compatible: can be one of the following:
0005 * "marvell,armada-8k-nand-controller"
0006 * "marvell,armada370-nand-controller"
0007 * "marvell,pxa3xx-nand-controller"
0008 * "marvell,armada-8k-nand" (deprecated)
0009 * "marvell,armada370-nand" (deprecated)
0010 * "marvell,pxa3xx-nand" (deprecated)
0011 Compatibles marked deprecated support only the old bindings described
0012 at the bottom.
0013 - reg: NAND flash controller memory area.
0014 - #address-cells: shall be set to 1. Encode the NAND CS.
0015 - #size-cells: shall be set to 0.
0016 - interrupts: shall define the NAND controller interrupt.
0017 - clocks: shall reference the NAND controller clocks, the second one is
0018 is only needed for the Armada 7K/8K SoCs
0019 - clock-names: mandatory if there is a second clock, in this case there
0020 should be one clock named "core" and another one named "reg"
0021 - marvell,system-controller: Set to retrieve the syscon node that handles
0022 NAND controller related registers (only required with the
0023 "marvell,armada-8k-nand[-controller]" compatibles).
0024
0025 Optional properties:
0026 - label: see partition.txt. New platforms shall omit this property.
0027 - dmas: shall reference DMA channel associated to the NAND controller.
0028 This property is only used with "marvell,pxa3xx-nand[-controller]"
0029 compatible strings.
0030 - dma-names: shall be "rxtx".
0031 This property is only used with "marvell,pxa3xx-nand[-controller]"
0032 compatible strings.
0033
0034 Optional children nodes:
0035 Children nodes represent the available NAND chips.
0036
0037 Required properties:
0038 - reg: shall contain the native Chip Select ids (0-3).
0039 - nand-rb: see nand-controller.yaml (0-1).
0040
0041 Optional properties:
0042 - marvell,nand-keep-config: orders the driver not to take the timings
0043 from the core and leaving them completely untouched. Bootloader
0044 timings will then be used.
0045 - label: MTD name.
0046 - nand-on-flash-bbt: see nand-controller.yaml.
0047 - nand-ecc-mode: see nand-controller.yaml. Will use hardware ECC if not specified.
0048 - nand-ecc-algo: see nand-controller.yaml. This property is essentially useful when
0049 not using hardware ECC. Howerver, it may be added when using hardware
0050 ECC for clarification but will be ignored by the driver because ECC
0051 mode is chosen depending on the page size and the strength required by
0052 the NAND chip. This value may be overwritten with nand-ecc-strength
0053 property.
0054 - nand-ecc-strength: see nand-controller.yaml.
0055 - nand-ecc-step-size: see nand-controller.yaml. Marvell's NAND flash controller does
0056 use fixed strength (1-bit for Hamming, 16-bit for BCH), so the actual
0057 step size will shrink or grow in order to fit the required strength.
0058 Step sizes are not completely random for all and follow certain
0059 patterns described in AN-379, "Marvell SoC NFC ECC".
0060
0061 See Documentation/devicetree/bindings/mtd/nand-controller.yaml for more details on
0062 generic bindings.
0063
0064
0065 Example:
0066 nand_controller: nand-controller@d0000 {
0067 compatible = "marvell,armada370-nand-controller";
0068 reg = <0xd0000 0x54>;
0069 #address-cells = <1>;
0070 #size-cells = <0>;
0071 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
0072 clocks = <&coredivclk 0>;
0073
0074 nand@0 {
0075 reg = <0>;
0076 label = "main-storage";
0077 nand-rb = <0>;
0078 nand-ecc-mode = "hw";
0079 marvell,nand-keep-config;
0080 nand-on-flash-bbt;
0081 nand-ecc-strength = <4>;
0082 nand-ecc-step-size = <512>;
0083
0084 partitions {
0085 compatible = "fixed-partitions";
0086 #address-cells = <1>;
0087 #size-cells = <1>;
0088
0089 partition@0 {
0090 label = "Rootfs";
0091 reg = <0x00000000 0x40000000>;
0092 };
0093 };
0094 };
0095 };
0096
0097
0098 Note on legacy bindings: One can find, in not-updated device trees,
0099 bindings slightly different than described above with other properties
0100 described below as well as the partitions node at the root of a so
0101 called "nand" node (without clear controller/chip separation).
0102
0103 Legacy properties:
0104 - marvell,nand-enable-arbiter: To enable the arbiter, all boards blindly
0105 used it, this bit was set by the bootloader for many boards and even if
0106 it is marked reserved in several datasheets, it might be needed to set
0107 it (otherwise it is harmless) so whether or not this property is set,
0108 the bit is selected by the driver.
0109 - num-cs: Number of chip-select lines to use, all boards blindly set 1
0110 to this and for a reason, other values would have failed. The value of
0111 this property is ignored.
0112
0113 Example:
0114
0115 nand0: nand@43100000 {
0116 compatible = "marvell,pxa3xx-nand";
0117 reg = <0x43100000 90>;
0118 interrupts = <45>;
0119 dmas = <&pdma 97 0>;
0120 dma-names = "rxtx";
0121 #address-cells = <1>;
0122 marvell,nand-keep-config;
0123 marvell,nand-enable-arbiter;
0124 num-cs = <1>;
0125 /* Partitions (optional) */
0126 };