xref: /freebsd-src/sys/contrib/device-tree/Bindings/memory-controllers/ti-aemif.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Device tree bindings for Texas instruments AEMIF controller
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotThe Async External Memory Interface (EMIF16/AEMIF) controller is intended to
4*c66ec88fSEmmanuel Vadotprovide a glue-less interface to a variety of asynchronous memory devices like
5*c66ec88fSEmmanuel VadotASRA M, NOR and NAND memory. A total of 256M bytes of any of these memories
6*c66ec88fSEmmanuel Vadotcan be accessed at any given time via four chip selects with 64M byte access
7*c66ec88fSEmmanuel Vadotper chip select. Synchronous memories such as DDR1 SD RAM, SDR SDRAM
8*c66ec88fSEmmanuel Vadotand Mobile SDR are not supported.
9*c66ec88fSEmmanuel Vadot
10*c66ec88fSEmmanuel VadotDocumentation:
11*c66ec88fSEmmanuel VadotDavinci DM646x - http://www.ti.com/lit/ug/sprueq7c/sprueq7c.pdf
12*c66ec88fSEmmanuel VadotOMAP-L138 (DA850) - http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf
13*c66ec88fSEmmanuel VadotKestone - http://www.ti.com/lit/ug/sprugz3a/sprugz3a.pdf
14*c66ec88fSEmmanuel Vadot
15*c66ec88fSEmmanuel VadotRequired properties:
16*c66ec88fSEmmanuel Vadot
17*c66ec88fSEmmanuel Vadot- compatible:		"ti,davinci-aemif"
18*c66ec88fSEmmanuel Vadot			"ti,keystone-aemif"
19*c66ec88fSEmmanuel Vadot			"ti,da850-aemif"
20*c66ec88fSEmmanuel Vadot
21*c66ec88fSEmmanuel Vadot- reg:			contains offset/length value for AEMIF control registers
22*c66ec88fSEmmanuel Vadot			space.
23*c66ec88fSEmmanuel Vadot
24*c66ec88fSEmmanuel Vadot- #address-cells:	Must be 2. The partition number has to be encoded in the
25*c66ec88fSEmmanuel Vadot			first address cell and it may accept values 0..N-1
26*c66ec88fSEmmanuel Vadot			(N - total number of partitions). It's recommended to
27*c66ec88fSEmmanuel Vadot			assign N-1 number for the control partition. The second
28*c66ec88fSEmmanuel Vadot			cell is the offset into the partition.
29*c66ec88fSEmmanuel Vadot
30*c66ec88fSEmmanuel Vadot- #size-cells:		Must be set to 1.
31*c66ec88fSEmmanuel Vadot
32*c66ec88fSEmmanuel Vadot- ranges:		Contains memory regions. There are two types of
33*c66ec88fSEmmanuel Vadot			ranges/partitions:
34*c66ec88fSEmmanuel Vadot			- CS-specific partition/range. If continuous, must be
35*c66ec88fSEmmanuel Vadot			set up to reflect the memory layout for 4 chipselects,
36*c66ec88fSEmmanuel Vadot			if not then additional range/partition can be added and
37*c66ec88fSEmmanuel Vadot			child device can select the proper one.
38*c66ec88fSEmmanuel Vadot			- control partition which is common for all CS
39*c66ec88fSEmmanuel Vadot			interfaces.
40*c66ec88fSEmmanuel Vadot
41*c66ec88fSEmmanuel Vadot- clocks:		the clock feeding the controller clock. Required only
42*c66ec88fSEmmanuel Vadot			if clock tree data present in device tree.
43*c66ec88fSEmmanuel Vadot			See clock-bindings.txt
44*c66ec88fSEmmanuel Vadot
45*c66ec88fSEmmanuel Vadot- clock-names:		clock name. It has to be "aemif". Required only if clock
46*c66ec88fSEmmanuel Vadot			tree data present in device tree, in another case don't
47*c66ec88fSEmmanuel Vadot			use it.
48*c66ec88fSEmmanuel Vadot			See clock-bindings.txt
49*c66ec88fSEmmanuel Vadot
50*c66ec88fSEmmanuel Vadot- clock-ranges:		Empty property indicating that child nodes can inherit
51*c66ec88fSEmmanuel Vadot			named clocks. Required only if clock tree data present
52*c66ec88fSEmmanuel Vadot			in device tree.
53*c66ec88fSEmmanuel Vadot			See clock-bindings.txt
54*c66ec88fSEmmanuel Vadot
55*c66ec88fSEmmanuel Vadot
56*c66ec88fSEmmanuel VadotChild chip-select (cs) nodes contain the memory devices nodes connected to
57*c66ec88fSEmmanuel Vadotsuch as NOR (e.g. cfi-flash) and NAND (ti,davinci-nand, see davinci-nand.txt).
58*c66ec88fSEmmanuel VadotThere might be board specific devices like FPGAs.
59*c66ec88fSEmmanuel Vadot
60*c66ec88fSEmmanuel VadotRequired child cs node properties:
61*c66ec88fSEmmanuel Vadot
62*c66ec88fSEmmanuel Vadot- #address-cells:	Must be 2.
63*c66ec88fSEmmanuel Vadot
64*c66ec88fSEmmanuel Vadot- #size-cells:		Must be 1.
65*c66ec88fSEmmanuel Vadot
66*c66ec88fSEmmanuel Vadot- ranges:		Empty property indicating that child nodes can inherit
67*c66ec88fSEmmanuel Vadot			memory layout.
68*c66ec88fSEmmanuel Vadot
69*c66ec88fSEmmanuel Vadot- clock-ranges:		Empty property indicating that child nodes can inherit
70*c66ec88fSEmmanuel Vadot			named clocks. Required only if clock tree data present
71*c66ec88fSEmmanuel Vadot			in device tree.
72*c66ec88fSEmmanuel Vadot
73*c66ec88fSEmmanuel Vadot- ti,cs-chipselect:	number of chipselect. Indicates on the aemif driver
74*c66ec88fSEmmanuel Vadot			which chipselect is used for accessing the memory. For
75*c66ec88fSEmmanuel Vadot			compatibles "ti,davinci-aemif" and "ti,keystone-aemif"
76*c66ec88fSEmmanuel Vadot			it can be in range [0-3]. For compatible
77*c66ec88fSEmmanuel Vadot			"ti,da850-aemif" range is [2-5].
78*c66ec88fSEmmanuel Vadot
79*c66ec88fSEmmanuel VadotOptional child cs node properties:
80*c66ec88fSEmmanuel Vadot
81*c66ec88fSEmmanuel Vadot- ti,cs-bus-width:		width of the asynchronous device's data bus
82*c66ec88fSEmmanuel Vadot				8 or 16 if not preset 8
83*c66ec88fSEmmanuel Vadot
84*c66ec88fSEmmanuel Vadot- ti,cs-select-strobe-mode:	enable/disable select strobe mode
85*c66ec88fSEmmanuel Vadot				In select strobe mode chip select behaves as
86*c66ec88fSEmmanuel Vadot				the strobe and is active only during the strobe
87*c66ec88fSEmmanuel Vadot				period. If present then enable.
88*c66ec88fSEmmanuel Vadot
89*c66ec88fSEmmanuel Vadot- ti,cs-extended-wait-mode:	enable/disable extended wait mode
90*c66ec88fSEmmanuel Vadot				if set, the controller monitors the EMIFWAIT pin
91*c66ec88fSEmmanuel Vadot				mapped to that chip select to determine if the
92*c66ec88fSEmmanuel Vadot				device wants to extend the strobe period. If
93*c66ec88fSEmmanuel Vadot				present then enable.
94*c66ec88fSEmmanuel Vadot
95*c66ec88fSEmmanuel Vadot- ti,cs-min-turnaround-ns:	minimum turn around time, ns
96*c66ec88fSEmmanuel Vadot				Time between the end of one asynchronous memory
97*c66ec88fSEmmanuel Vadot				access and the start of another asynchronous
98*c66ec88fSEmmanuel Vadot				memory access. This delay is not incurred
99*c66ec88fSEmmanuel Vadot				between a read followed by read or a write
100*c66ec88fSEmmanuel Vadot				followed by a write to same chip select.
101*c66ec88fSEmmanuel Vadot
102*c66ec88fSEmmanuel Vadot- ti,cs-read-setup-ns:		read setup width, ns
103*c66ec88fSEmmanuel Vadot				Time between the beginning of a memory cycle
104*c66ec88fSEmmanuel Vadot				and the activation of read strobe.
105*c66ec88fSEmmanuel Vadot				Minimum value is 1 (0 treated as 1).
106*c66ec88fSEmmanuel Vadot
107*c66ec88fSEmmanuel Vadot- ti,cs-read-strobe-ns:		read strobe width, ns
108*c66ec88fSEmmanuel Vadot				Time between the activation and deactivation of
109*c66ec88fSEmmanuel Vadot				the read strobe.
110*c66ec88fSEmmanuel Vadot				Minimum value is 1 (0 treated as 1).
111*c66ec88fSEmmanuel Vadot
112*c66ec88fSEmmanuel Vadot- ti,cs-read-hold-ns:		read hold width, ns
113*c66ec88fSEmmanuel Vadot				Time between the deactivation of the read
114*c66ec88fSEmmanuel Vadot				strobe and the end of the cycle (which may be
115*c66ec88fSEmmanuel Vadot				either an address change or the deactivation of
116*c66ec88fSEmmanuel Vadot				the chip select signal.
117*c66ec88fSEmmanuel Vadot				Minimum value is 1 (0 treated as 1).
118*c66ec88fSEmmanuel Vadot
119*c66ec88fSEmmanuel Vadot- ti,cs-write-setup-ns:		write setup width, ns
120*c66ec88fSEmmanuel Vadot				Time between the beginning of a memory cycle
121*c66ec88fSEmmanuel Vadot				and the activation of write strobe.
122*c66ec88fSEmmanuel Vadot				Minimum value is 1 (0 treated as 1).
123*c66ec88fSEmmanuel Vadot
124*c66ec88fSEmmanuel Vadot- ti,cs-write-strobe-ns:	write strobe width, ns
125*c66ec88fSEmmanuel Vadot				Time between the activation and deactivation of
126*c66ec88fSEmmanuel Vadot				the write strobe.
127*c66ec88fSEmmanuel Vadot				Minimum value is 1 (0 treated as 1).
128*c66ec88fSEmmanuel Vadot
129*c66ec88fSEmmanuel Vadot- ti,cs-write-hold-ns:		write hold width, ns
130*c66ec88fSEmmanuel Vadot				Time between the deactivation of the write
131*c66ec88fSEmmanuel Vadot				strobe and the end of the cycle (which may be
132*c66ec88fSEmmanuel Vadot				either an address change or the deactivation of
133*c66ec88fSEmmanuel Vadot				the chip select signal.
134*c66ec88fSEmmanuel Vadot				Minimum value is 1 (0 treated as 1).
135*c66ec88fSEmmanuel Vadot
136*c66ec88fSEmmanuel VadotIf any of the above parameters are absent, current parameter value will be taken
137*c66ec88fSEmmanuel Vadotfrom the corresponding HW reg.
138*c66ec88fSEmmanuel Vadot
139*c66ec88fSEmmanuel VadotExample for aemif, davinci nand and nor flash chip select shown below.
140*c66ec88fSEmmanuel Vadot
141*c66ec88fSEmmanuel Vadotmemory-controller@21000a00 {
142*c66ec88fSEmmanuel Vadot	compatible = "ti,davinci-aemif";
143*c66ec88fSEmmanuel Vadot	#address-cells = <2>;
144*c66ec88fSEmmanuel Vadot	#size-cells = <1>;
145*c66ec88fSEmmanuel Vadot	clocks = <&clkaemif 0>;
146*c66ec88fSEmmanuel Vadot	clock-names = "aemif";
147*c66ec88fSEmmanuel Vadot	clock-ranges;
148*c66ec88fSEmmanuel Vadot	reg = <0x21000A00 0x00000100>;
149*c66ec88fSEmmanuel Vadot	ranges = <0 0 0x70000000 0x10000000
150*c66ec88fSEmmanuel Vadot		  1 0 0x21000A00 0x00000100>;
151*c66ec88fSEmmanuel Vadot		  /*
152*c66ec88fSEmmanuel Vadot		   * Partition0: CS-specific memory range which is
153*c66ec88fSEmmanuel Vadot		   * implemented as continuous physical memory region
154*c66ec88fSEmmanuel Vadot		   * Partition1: control memory range
155*c66ec88fSEmmanuel Vadot		   */
156*c66ec88fSEmmanuel Vadot
157*c66ec88fSEmmanuel Vadot	nand:cs2 {
158*c66ec88fSEmmanuel Vadot		#address-cells = <2>;
159*c66ec88fSEmmanuel Vadot		#size-cells = <1>;
160*c66ec88fSEmmanuel Vadot		clock-ranges;
161*c66ec88fSEmmanuel Vadot		ranges;
162*c66ec88fSEmmanuel Vadot
163*c66ec88fSEmmanuel Vadot		ti,cs-chipselect = <2>;
164*c66ec88fSEmmanuel Vadot		/* all timings in nanoseconds */
165*c66ec88fSEmmanuel Vadot		ti,cs-min-turnaround-ns = <0>;
166*c66ec88fSEmmanuel Vadot		ti,cs-read-hold-ns = <7>;
167*c66ec88fSEmmanuel Vadot		ti,cs-read-strobe-ns = <42>;
168*c66ec88fSEmmanuel Vadot		ti,cs-read-setup-ns = <14>;
169*c66ec88fSEmmanuel Vadot		ti,cs-write-hold-ns = <7>;
170*c66ec88fSEmmanuel Vadot		ti,cs-write-strobe-ns = <42>;
171*c66ec88fSEmmanuel Vadot		ti,cs-write-setup-ns = <14>;
172*c66ec88fSEmmanuel Vadot
173*c66ec88fSEmmanuel Vadot		nand@0,0x8000000 {
174*c66ec88fSEmmanuel Vadot			compatible = "ti,davinci-nand";
175*c66ec88fSEmmanuel Vadot			reg = <0 0x8000000 0x4000000
176*c66ec88fSEmmanuel Vadot			       1 0x0000000 0x0000100>;
177*c66ec88fSEmmanuel Vadot			/*
178*c66ec88fSEmmanuel Vadot			 * Partition0, offset 0x8000000, size 0x4000000
179*c66ec88fSEmmanuel Vadot			 * Partition1, offset 0x0000000, size 0x0000100
180*c66ec88fSEmmanuel Vadot			 */
181*c66ec88fSEmmanuel Vadot
182*c66ec88fSEmmanuel Vadot			.. see davinci-nand.txt
183*c66ec88fSEmmanuel Vadot		};
184*c66ec88fSEmmanuel Vadot	};
185*c66ec88fSEmmanuel Vadot
186*c66ec88fSEmmanuel Vadot	nor:cs0 {
187*c66ec88fSEmmanuel Vadot		#address-cells = <2>;
188*c66ec88fSEmmanuel Vadot		#size-cells = <1>;
189*c66ec88fSEmmanuel Vadot		clock-ranges;
190*c66ec88fSEmmanuel Vadot		ranges;
191*c66ec88fSEmmanuel Vadot
192*c66ec88fSEmmanuel Vadot		ti,cs-chipselect = <0>;
193*c66ec88fSEmmanuel Vadot		/* all timings in nanoseconds */
194*c66ec88fSEmmanuel Vadot		ti,cs-min-turnaround-ns = <0>;
195*c66ec88fSEmmanuel Vadot		ti,cs-read-hold-ns = <8>;
196*c66ec88fSEmmanuel Vadot		ti,cs-read-strobe-ns = <40>;
197*c66ec88fSEmmanuel Vadot		ti,cs-read-setup-ns = <14>;
198*c66ec88fSEmmanuel Vadot		ti,cs-write-hold-ns = <7>;
199*c66ec88fSEmmanuel Vadot		ti,cs-write-strobe-ns = <40>;
200*c66ec88fSEmmanuel Vadot		ti,cs-write-setup-ns = <14>;
201*c66ec88fSEmmanuel Vadot		ti,cs-bus-width = <16>;
202*c66ec88fSEmmanuel Vadot
203*c66ec88fSEmmanuel Vadot		flash@0,0x0000000 {
204*c66ec88fSEmmanuel Vadot			compatible = "cfi-flash";
205*c66ec88fSEmmanuel Vadot			reg = <0 0x0000000 0x4000000>;
206*c66ec88fSEmmanuel Vadot
207*c66ec88fSEmmanuel Vadot			...
208*c66ec88fSEmmanuel Vadot		};
209*c66ec88fSEmmanuel Vadot	};
210*c66ec88fSEmmanuel Vadot};
211