18c2ecf20Sopenharmony_ci* Device tree bindings for Texas instruments AEMIF controller
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe Async External Memory Interface (EMIF16/AEMIF) controller is intended to
48c2ecf20Sopenharmony_ciprovide a glue-less interface to a variety of asynchronous memory devices like
58c2ecf20Sopenharmony_ciASRA M, NOR and NAND memory. A total of 256M bytes of any of these memories
68c2ecf20Sopenharmony_cican be accessed at any given time via four chip selects with 64M byte access
78c2ecf20Sopenharmony_ciper chip select. Synchronous memories such as DDR1 SD RAM, SDR SDRAM
88c2ecf20Sopenharmony_ciand Mobile SDR are not supported.
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciDocumentation:
118c2ecf20Sopenharmony_ciDavinci DM646x - http://www.ti.com/lit/ug/sprueq7c/sprueq7c.pdf
128c2ecf20Sopenharmony_ciOMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf
138c2ecf20Sopenharmony_ciKestone - http://www.ti.com/lit/ug/sprugz3a/sprugz3a.pdf
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ciRequired properties:
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci- compatible:		"ti,davinci-aemif"
188c2ecf20Sopenharmony_ci			"ti,keystone-aemif"
198c2ecf20Sopenharmony_ci			"ti,da850-aemif"
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci- reg:			contains offset/length value for AEMIF control registers
228c2ecf20Sopenharmony_ci			space.
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci- #address-cells:	Must be 2. The partition number has to be encoded in the
258c2ecf20Sopenharmony_ci			first address cell and it may accept values 0..N-1
268c2ecf20Sopenharmony_ci			(N - total number of partitions). It's recommended to
278c2ecf20Sopenharmony_ci			assign N-1 number for the control partition. The second
288c2ecf20Sopenharmony_ci			cell is the offset into the partition.
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci- #size-cells:		Must be set to 1.
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci- ranges:		Contains memory regions. There are two types of
338c2ecf20Sopenharmony_ci			ranges/partitions:
348c2ecf20Sopenharmony_ci			- CS-specific partition/range. If continuous, must be
358c2ecf20Sopenharmony_ci			set up to reflect the memory layout for 4 chipselects,
368c2ecf20Sopenharmony_ci			if not then additional range/partition can be added and
378c2ecf20Sopenharmony_ci			child device can select the proper one.
388c2ecf20Sopenharmony_ci			- control partition which is common for all CS
398c2ecf20Sopenharmony_ci			interfaces.
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci- clocks:		the clock feeding the controller clock. Required only
428c2ecf20Sopenharmony_ci			if clock tree data present in device tree.
438c2ecf20Sopenharmony_ci			See clock-bindings.txt
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci- clock-names:		clock name. It has to be "aemif". Required only if clock
468c2ecf20Sopenharmony_ci			tree data present in device tree, in another case don't
478c2ecf20Sopenharmony_ci			use it.
488c2ecf20Sopenharmony_ci			See clock-bindings.txt
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci- clock-ranges:		Empty property indicating that child nodes can inherit
518c2ecf20Sopenharmony_ci			named clocks. Required only if clock tree data present
528c2ecf20Sopenharmony_ci			in device tree.
538c2ecf20Sopenharmony_ci			See clock-bindings.txt
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ciChild chip-select (cs) nodes contain the memory devices nodes connected to
578c2ecf20Sopenharmony_cisuch as NOR (e.g. cfi-flash) and NAND (ti,davinci-nand, see davinci-nand.txt).
588c2ecf20Sopenharmony_ciThere might be board specific devices like FPGAs.
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ciRequired child cs node properties:
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci- #address-cells:	Must be 2.
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci- #size-cells:		Must be 1.
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci- ranges:		Empty property indicating that child nodes can inherit
678c2ecf20Sopenharmony_ci			memory layout.
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci- clock-ranges:		Empty property indicating that child nodes can inherit
708c2ecf20Sopenharmony_ci			named clocks. Required only if clock tree data present
718c2ecf20Sopenharmony_ci			in device tree.
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci- ti,cs-chipselect:	number of chipselect. Indicates on the aemif driver
748c2ecf20Sopenharmony_ci			which chipselect is used for accessing the memory. For
758c2ecf20Sopenharmony_ci			compatibles "ti,davinci-aemif" and "ti,keystone-aemif"
768c2ecf20Sopenharmony_ci			it can be in range [0-3]. For compatible
778c2ecf20Sopenharmony_ci			"ti,da850-aemif" range is [2-5].
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ciOptional child cs node properties:
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci- ti,cs-bus-width:		width of the asynchronous device's data bus
828c2ecf20Sopenharmony_ci				8 or 16 if not preset 8
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci- ti,cs-select-strobe-mode:	enable/disable select strobe mode
858c2ecf20Sopenharmony_ci				In select strobe mode chip select behaves as
868c2ecf20Sopenharmony_ci				the strobe and is active only during the strobe
878c2ecf20Sopenharmony_ci				period. If present then enable.
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci- ti,cs-extended-wait-mode:	enable/disable extended wait mode
908c2ecf20Sopenharmony_ci				if set, the controller monitors the EMIFWAIT pin
918c2ecf20Sopenharmony_ci				mapped to that chip select to determine if the
928c2ecf20Sopenharmony_ci				device wants to extend the strobe period. If
938c2ecf20Sopenharmony_ci				present then enable.
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci- ti,cs-min-turnaround-ns:	minimum turn around time, ns
968c2ecf20Sopenharmony_ci				Time between the end of one asynchronous memory
978c2ecf20Sopenharmony_ci				access and the start of another asynchronous
988c2ecf20Sopenharmony_ci				memory access. This delay is not incurred
998c2ecf20Sopenharmony_ci				between a read followed by read or a write
1008c2ecf20Sopenharmony_ci				followed by a write to same chip select.
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci- ti,cs-read-setup-ns:		read setup width, ns
1038c2ecf20Sopenharmony_ci				Time between the beginning of a memory cycle
1048c2ecf20Sopenharmony_ci				and the activation of read strobe.
1058c2ecf20Sopenharmony_ci				Minimum value is 1 (0 treated as 1).
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci- ti,cs-read-strobe-ns:		read strobe width, ns
1088c2ecf20Sopenharmony_ci				Time between the activation and deactivation of
1098c2ecf20Sopenharmony_ci				the read strobe.
1108c2ecf20Sopenharmony_ci				Minimum value is 1 (0 treated as 1).
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci- ti,cs-read-hold-ns:		read hold width, ns
1138c2ecf20Sopenharmony_ci				Time between the deactivation of the read
1148c2ecf20Sopenharmony_ci				strobe and the end of the cycle (which may be
1158c2ecf20Sopenharmony_ci				either an address change or the deactivation of
1168c2ecf20Sopenharmony_ci				the chip select signal.
1178c2ecf20Sopenharmony_ci				Minimum value is 1 (0 treated as 1).
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci- ti,cs-write-setup-ns:		write setup width, ns
1208c2ecf20Sopenharmony_ci				Time between the beginning of a memory cycle
1218c2ecf20Sopenharmony_ci				and the activation of write strobe.
1228c2ecf20Sopenharmony_ci				Minimum value is 1 (0 treated as 1).
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci- ti,cs-write-strobe-ns:	write strobe width, ns
1258c2ecf20Sopenharmony_ci				Time between the activation and deactivation of
1268c2ecf20Sopenharmony_ci				the write strobe.
1278c2ecf20Sopenharmony_ci				Minimum value is 1 (0 treated as 1).
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci- ti,cs-write-hold-ns:		write hold width, ns
1308c2ecf20Sopenharmony_ci				Time between the deactivation of the write
1318c2ecf20Sopenharmony_ci				strobe and the end of the cycle (which may be
1328c2ecf20Sopenharmony_ci				either an address change or the deactivation of
1338c2ecf20Sopenharmony_ci				the chip select signal.
1348c2ecf20Sopenharmony_ci				Minimum value is 1 (0 treated as 1).
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ciIf any of the above parameters are absent, current parameter value will be taken
1378c2ecf20Sopenharmony_cifrom the corresponding HW reg.
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ciExample for aemif, davinci nand and nor flash chip select shown below.
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_cimemory-controller@21000a00 {
1428c2ecf20Sopenharmony_ci	compatible = "ti,davinci-aemif";
1438c2ecf20Sopenharmony_ci	#address-cells = <2>;
1448c2ecf20Sopenharmony_ci	#size-cells = <1>;
1458c2ecf20Sopenharmony_ci	clocks = <&clkaemif 0>;
1468c2ecf20Sopenharmony_ci	clock-names = "aemif";
1478c2ecf20Sopenharmony_ci	clock-ranges;
1488c2ecf20Sopenharmony_ci	reg = <0x21000A00 0x00000100>;
1498c2ecf20Sopenharmony_ci	ranges = <0 0 0x70000000 0x10000000
1508c2ecf20Sopenharmony_ci		  1 0 0x21000A00 0x00000100>;
1518c2ecf20Sopenharmony_ci		  /*
1528c2ecf20Sopenharmony_ci		   * Partition0: CS-specific memory range which is
1538c2ecf20Sopenharmony_ci		   * implemented as continuous physical memory region
1548c2ecf20Sopenharmony_ci		   * Partition1: control memory range
1558c2ecf20Sopenharmony_ci		   */
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci	nand:cs2 {
1588c2ecf20Sopenharmony_ci		#address-cells = <2>;
1598c2ecf20Sopenharmony_ci		#size-cells = <1>;
1608c2ecf20Sopenharmony_ci		clock-ranges;
1618c2ecf20Sopenharmony_ci		ranges;
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci		ti,cs-chipselect = <2>;
1648c2ecf20Sopenharmony_ci		/* all timings in nanoseconds */
1658c2ecf20Sopenharmony_ci		ti,cs-min-turnaround-ns = <0>;
1668c2ecf20Sopenharmony_ci		ti,cs-read-hold-ns = <7>;
1678c2ecf20Sopenharmony_ci		ti,cs-read-strobe-ns = <42>;
1688c2ecf20Sopenharmony_ci		ti,cs-read-setup-ns = <14>;
1698c2ecf20Sopenharmony_ci		ti,cs-write-hold-ns = <7>;
1708c2ecf20Sopenharmony_ci		ti,cs-write-strobe-ns = <42>;
1718c2ecf20Sopenharmony_ci		ti,cs-write-setup-ns = <14>;
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci		nand@0,0x8000000 {
1748c2ecf20Sopenharmony_ci			compatible = "ti,davinci-nand";
1758c2ecf20Sopenharmony_ci			reg = <0 0x8000000 0x4000000
1768c2ecf20Sopenharmony_ci			       1 0x0000000 0x0000100>;
1778c2ecf20Sopenharmony_ci			/*
1788c2ecf20Sopenharmony_ci			 * Partition0, offset 0x8000000, size 0x4000000
1798c2ecf20Sopenharmony_ci			 * Partition1, offset 0x0000000, size 0x0000100
1808c2ecf20Sopenharmony_ci			 */
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci			.. see davinci-nand.txt
1838c2ecf20Sopenharmony_ci		};
1848c2ecf20Sopenharmony_ci	};
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci	nor:cs0 {
1878c2ecf20Sopenharmony_ci		#address-cells = <2>;
1888c2ecf20Sopenharmony_ci		#size-cells = <1>;
1898c2ecf20Sopenharmony_ci		clock-ranges;
1908c2ecf20Sopenharmony_ci		ranges;
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_ci		ti,cs-chipselect = <0>;
1938c2ecf20Sopenharmony_ci		/* all timings in nanoseconds */
1948c2ecf20Sopenharmony_ci		ti,cs-min-turnaround-ns = <0>;
1958c2ecf20Sopenharmony_ci		ti,cs-read-hold-ns = <8>;
1968c2ecf20Sopenharmony_ci		ti,cs-read-strobe-ns = <40>;
1978c2ecf20Sopenharmony_ci		ti,cs-read-setup-ns = <14>;
1988c2ecf20Sopenharmony_ci		ti,cs-write-hold-ns = <7>;
1998c2ecf20Sopenharmony_ci		ti,cs-write-strobe-ns = <40>;
2008c2ecf20Sopenharmony_ci		ti,cs-write-setup-ns = <14>;
2018c2ecf20Sopenharmony_ci		ti,cs-bus-width = <16>;
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_ci		flash@0,0x0000000 {
2048c2ecf20Sopenharmony_ci			compatible = "cfi-flash";
2058c2ecf20Sopenharmony_ci			reg = <0 0x0000000 0x4000000>;
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci			...
2088c2ecf20Sopenharmony_ci		};
2098c2ecf20Sopenharmony_ci	};
2108c2ecf20Sopenharmony_ci};
211