Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6a01661 authored by Jean-Christophe PLAGNIOL-VILLARD's avatar Jean-Christophe PLAGNIOL-VILLARD
Browse files

atmel/nand: add DT support



Use a local copy of board informatin and fill with DT data.

Signed-off-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
parent 770d7c39
Loading
Loading
Loading
Loading
+41 −0
Original line number Original line Diff line number Diff line
Atmel NAND flash

Required properties:
- compatible : "atmel,at91rm9200-nand".
- reg : should specify localbus address and size used for the chip,
	and if availlable the ECC.
- atmel,nand-addr-offset : offset for the address latch.
- atmel,nand-cmd-offset : offset for the command latch.
- #address-cells, #size-cells : Must be present if the device has sub-nodes
  representing partitions.

- gpios : specifies the gpio pins to control the NAND device. detect is an
  optional gpio and may be set to 0 if not present.

Optional properties:
- nand-ecc-mode : String, operation mode of the NAND ecc mode, soft by default.
  Supported values are: "none", "soft", "hw", "hw_syndrome", "hw_oob_first",
  "soft_bch".
- nand-bus-width : 8 or 16 bus width if not present 8
- nand-on-flash-bbt: boolean to enable on flash bbt option if not present false

Examples:
nand0: nand@40000000,0 {
	compatible = "atmel,at91rm9200-nand";
	#address-cells = <1>;
	#size-cells = <1>;
	reg = <0x40000000 0x10000000
	       0xffffe800 0x200
	      >;
	atmel,nand-addr-offset = <21>;
	atmel,nand-cmd-offset = <22>;
	nand-on-flash-bbt;
	nand-ecc-mode = "soft";
	gpios = <&pioC 13 0
		 &pioC 14 0
		 0
		>;
	partition@0 {
		...
	};
};
+16 −0
Original line number Original line Diff line number Diff line
@@ -172,5 +172,21 @@
				status = "disabled";
				status = "disabled";
			};
			};
		};
		};

		nand0: nand@40000000 {
			compatible = "atmel,at91rm9200-nand";
			#address-cells = <1>;
			#size-cells = <1>;
			reg = <0x40000000 0x10000000
			       0xffffe800 0x200
			      >;
			atmel,nand-addr-offset = <21>;
			atmel,nand-cmd-offset = <22>;
			gpios = <&pioC 13 0
				 &pioC 14 0
				 0
				>;
			status = "disabled";
		};
	};
	};
};
};
+16 −0
Original line number Original line Diff line number Diff line
@@ -180,5 +180,21 @@
				status = "disabled";
				status = "disabled";
			};
			};
		};
		};

		nand0: nand@40000000 {
			compatible = "atmel,at91rm9200-nand";
			#address-cells = <1>;
			#size-cells = <1>;
			reg = <0x40000000 0x10000000
			       0xffffe200 0x200
			      >;
			atmel,nand-addr-offset = <21>;
			atmel,nand-cmd-offset = <22>;
			gpios = <&pioC 8 0
				 &pioC 14 0
				 0
				>;
			status = "disabled";
		};
	};
	};
};
};
+24 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
	compatible = "atmel,at91sam9m10g45ek", "atmel,at91sam9g45", "atmel,at91sam9";
	compatible = "atmel,at91sam9m10g45ek", "atmel,at91sam9g45", "atmel,at91sam9";


	chosen {
	chosen {
		bootargs = "mem=64M console=ttyS0,115200 mtdparts=atmel_nand:4M(bootstrap/uboot/kernel)ro,60M(rootfs),-(data) root=/dev/mtdblock1 rw rootfstype=jffs2";
		bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
	};
	};


	memory@70000000 {
	memory@70000000 {
@@ -36,6 +36,29 @@
				status = "okay";
				status = "okay";
			};
			};
		};
		};

		nand0: nand@40000000 {
			nand-bus-width = <8>;
			nand-ecc-mode = "soft";
			nand-on-flash-bbt;
			status = "okay";

			boot@0 {
				label = "bootstrap/uboot/kernel";
				reg = <0x0 0x400000>;
			};

			rootfs@400000 {
				label = "rootfs";
				reg = <0x400000 0x3C00000>;
			};

			data@4000000 {
				label = "data";
				reg = <0x4000000 0xC000000>;
			};

		};
	};
	};


	leds {
	leds {
+43 −1
Original line number Original line Diff line number Diff line
@@ -13,7 +13,7 @@
	compatible = "calao,usb-a9g20", "atmel,at91sam9g20", "atmel,at91sam9";
	compatible = "calao,usb-a9g20", "atmel,at91sam9g20", "atmel,at91sam9";


	chosen {
	chosen {
		bootargs = "mem=64M console=ttyS0,115200 mtdparts=atmel_nand:128k(at91bootstrap),256k(barebox)ro,128k(bareboxenv),128k(bareboxenv2),4M(kernel),120M(rootfs),-(data) root=/dev/mtdblock5 rw rootfstype=ubifs";
		bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs";
	};
	};


	memory@20000000 {
	memory@20000000 {
@@ -31,6 +31,48 @@
				status = "okay";
				status = "okay";
			};
			};
		};
		};

		nand0: nand@40000000 {
			nand-bus-width = <8>;
			nand-ecc-mode = "soft";
			nand-on-flash-bbt;
			status = "okay";

			at91bootstrap@0 {
				label = "at91bootstrap";
				reg = <0x0 0x20000>;
			};

			barebox@20000 {
				label = "barebox";
				reg = <0x20000 0x40000>;
			};

			bareboxenv@60000 {
				label = "bareboxenv";
				reg = <0x60000 0x20000>;
			};

			bareboxenv2@80000 {
				label = "bareboxenv2";
				reg = <0x80000 0x20000>;
			};

			kernel@a0000 {
				label = "kernel";
				reg = <0xa0000 0x400000>;
			};

			rootfs@4a0000 {
				label = "rootfs";
				reg = <0x4a0000 0x7800000>;
			};

			data@7ca0000 {
				label = "data";
				reg = <0x7ca0000 0x8360000>;
			};
		};
	};
	};


	leds {
	leds {
Loading