Nand Partition details

Linux Drivers

Release Date
2023-07-22

Below example list the dts properties for operating in Software-ECC mode and its also assumes that controller is using 2 chip select lines

&nand0 {
   status = "okay";
   arasan,has-mdma;
   
   nand@0 {
     reg = <0x0>;
     #address-cells = <0x2>;
     #size-cells = <0x1>;
	 nand-ecc-mode = "soft";
	 nand-ecc-algo = "bch";
	 nand-rb = <0x0>;
	 label = "main-storage-0";
  partition@0 { /* for testing purpose */
    label = "nand-fsbl-uboot";
    reg = <0x0 0x0 0x400000>;
  };
  partition@1 { /* for testing purpose */
    label = "nand-linux";
    reg = <0x0 0x400000 0x1400000>;
  };
  partition@2 { /* for testing purpose */
    label = "nand-device-tree";
    reg = <0x0 0x1800000 0x400000>;
  };
  partition@3 { /* for testing purpose */
    label = "nand-rootfs";
    reg = <0x0 0x1C00000 0x1400000>;
  };
  partition@4 { /* for testing purpose */
    label = "nand-bitstream";
    reg = <0x0 0x3000000 0x400000>;
  };
  partition@5 { /* for testing purpose */
    label = "nand-misc";
    reg = <0x0 0x3400000 0xFCC00000>;
  };
 };
 
nand@1 {
  reg = <0x1>;
  #address-cells = <0x2>;
  #size-cells = <0x1>;
  nand-ecc-mode = "soft";
  nand-ecc-algo = "bch";
  nand-rb = <0x0>;
  label = "main-storage-1";
  partition@0 { /* for testing purpose */
    label = "nand1-fsbl-uboot";
    reg = <0x1 0x0 0x400000>;
  };
  partition@1 { /* for testing purpose */
    label = "nand1-linux";
    reg = <0x1 0x400000 0x1400000>;
  };
  partition@2 { /* for testing purpose */
    label = "nand1-device-tree";
    reg = <0x1 0x1800000 0x400000>;
  };
  partition@3 { /* for testing purpose */
    label = "nand1-rootfs";
    reg = <0x1 0x1C00000 0x1400000>;
  };
  partition@4 { /* for testing purpose */
    label = "nand1-bitstream";
    reg = <0x1 0x3000000 0x400000>;
  };
  partition@5 { /* for testing purpose */
    label = "nand1-misc";
    reg = <0x1 0x3400000 0xFCC00000>;
  };
};
};

Below example list the dts properties for operating in Hardware-ECC mode and its also assumes that controller is using 2 chip select lines

&nand0 {
   status = "okay";
   arasan,has-mdma;
   
   nand@0 {
     reg = <0x0>;
     #address-cells = <0x2>;
     #size-cells = <0x1>;
	 nand-ecc-mode = "hw";
	 nand-rb = <0x0>;
	 label = "main-storage-0";
  partition@0 { /* for testing purpose */
    label = "nand-fsbl-uboot";
    reg = <0x0 0x0 0x400000>;
  };
  partition@1 { /* for testing purpose */
    label = "nand-linux";
    reg = <0x0 0x400000 0x1400000>;
  };
  partition@2 { /* for testing purpose */
    label = "nand-device-tree";
    reg = <0x0 0x1800000 0x400000>;
  };
  partition@3 { /* for testing purpose */
    label = "nand-rootfs";
    reg = <0x0 0x1C00000 0x1400000>;
  };
  partition@4 { /* for testing purpose */
    label = "nand-bitstream";
    reg = <0x0 0x3000000 0x400000>;
  };
  partition@5 { /* for testing purpose */
    label = "nand-misc";
    reg = <0x0 0x3400000 0xFCC00000>;
  };
 };
 
nand@1 {
  reg = <0x1>;
  #address-cells = <0x2>;
  #size-cells = <0x1>;
  nand-ecc-mode = "hw";
  nand-rb = <0x0>;
  label = "main-storage-1";
  partition@0 { /* for testing purpose */
    label = "nand1-fsbl-uboot";
    reg = <0x1 0x0 0x400000>;
  };
  partition@1 { /* for testing purpose */
    label = "nand1-linux";
    reg = <0x1 0x400000 0x1400000>;
  };
  partition@2 { /* for testing purpose */
    label = "nand1-device-tree";
    reg = <0x1 0x1800000 0x400000>;
  };
  partition@3 { /* for testing purpose */
    label = "nand1-rootfs";
    reg = <0x1 0x1C00000 0x1400000>;
  };
  partition@4 { /* for testing purpose */
    label = "nand1-bitstream";
    reg = <0x1 0x3000000 0x400000>;
  };
  partition@5 { /* for testing purpose */
    label = "nand1-misc";
    reg = <0x1 0x3400000 0xFCC00000>;
  };
};
};