18c2ecf20Sopenharmony_ci* Device tree bindings for Atmel EBI
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe External Bus Interface (EBI) controller is a bus where you can connect
48c2ecf20Sopenharmony_ciasynchronous (NAND, NOR, SRAM, ....) and synchronous memories (SDR/DDR SDRAMs).
58c2ecf20Sopenharmony_ciThe EBI provides a glue-less interface to asynchronous memories through the SMC
68c2ecf20Sopenharmony_ci(Static Memory Controller).
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciRequired properties:
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci- compatible:		"atmel,at91sam9260-ebi"
118c2ecf20Sopenharmony_ci			"atmel,at91sam9261-ebi"
128c2ecf20Sopenharmony_ci			"atmel,at91sam9263-ebi0"
138c2ecf20Sopenharmony_ci			"atmel,at91sam9263-ebi1"
148c2ecf20Sopenharmony_ci			"atmel,at91sam9rl-ebi"
158c2ecf20Sopenharmony_ci			"atmel,at91sam9g45-ebi"
168c2ecf20Sopenharmony_ci			"atmel,at91sam9x5-ebi"
178c2ecf20Sopenharmony_ci			"atmel,sama5d3-ebi"
188c2ecf20Sopenharmony_ci			"microchip,sam9x60-ebi"
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci- reg:			Contains offset/length value for EBI memory mapping.
218c2ecf20Sopenharmony_ci			This property might contain several entries if the EBI
228c2ecf20Sopenharmony_ci			memory range is not contiguous
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci- #address-cells:	Must be 2.
258c2ecf20Sopenharmony_ci			The first cell encodes the CS.
268c2ecf20Sopenharmony_ci			The second cell encode the offset into the CS memory
278c2ecf20Sopenharmony_ci			range.
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci- #size-cells:		Must be set to 1.
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci- ranges:		Encodes CS to memory region association.
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci- clocks:		Clock feeding the EBI controller.
348c2ecf20Sopenharmony_ci			See clock-bindings.txt
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciChildren device nodes are representing device connected to the EBI bus.
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciRequired device node properties:
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci- reg:			Contains the chip-select id, the offset and the length
418c2ecf20Sopenharmony_ci			of the memory region requested by the device.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciEBI bus configuration will be defined directly in the device subnode.
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciOptional EBI/SMC properties:
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci- atmel,smc-bus-width:		width of the asynchronous device's data bus
488c2ecf20Sopenharmony_ci				8, 16 or 32.
498c2ecf20Sopenharmony_ci				Default to 8 when undefined.
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci- atmel,smc-byte-access-type	"write" or "select" (see Atmel datasheet).
528c2ecf20Sopenharmony_ci				Default to "select" when undefined.
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci- atmel,smc-read-mode		"nrd" or "ncs".
558c2ecf20Sopenharmony_ci				Default to "ncs" when undefined.
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci- atmel,smc-write-mode		"nwe" or "ncs".
588c2ecf20Sopenharmony_ci				Default to "ncs" when undefined.
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci- atmel,smc-exnw-mode		"disabled", "frozen" or "ready".
618c2ecf20Sopenharmony_ci				Default to "disabled" when undefined.
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci- atmel,smc-page-mode		enable page mode if present. The provided value
648c2ecf20Sopenharmony_ci				defines the page size (supported values: 4, 8,
658c2ecf20Sopenharmony_ci				16 and 32).
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci- atmel,smc-tdf-mode:		"normal" or "optimized". When set to
688c2ecf20Sopenharmony_ci				"optimized" the data float time is optimized
698c2ecf20Sopenharmony_ci				depending on the next device being accessed
708c2ecf20Sopenharmony_ci				(next device setup time is subtracted to the
718c2ecf20Sopenharmony_ci				current device data float time).
728c2ecf20Sopenharmony_ci				Default to "normal" when undefined.
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ciIf at least one atmel,smc- property is defined the following SMC timing
758c2ecf20Sopenharmony_ciproperties become mandatory. In the other hand, if none of the atmel,smc-
768c2ecf20Sopenharmony_ciproperties are specified, we assume that the EBI bus configuration will be
778c2ecf20Sopenharmony_cihandled by the sub-device driver, and none of those properties should be
788c2ecf20Sopenharmony_cidefined.
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ciAll the timings are expressed in nanoseconds (see Atmel datasheet for a full
818c2ecf20Sopenharmony_cidescription).
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci- atmel,smc-ncs-rd-setup-ns
848c2ecf20Sopenharmony_ci- atmel,smc-nrd-setup-ns
858c2ecf20Sopenharmony_ci- atmel,smc-ncs-wr-setup-ns
868c2ecf20Sopenharmony_ci- atmel,smc-nwe-setup-ns
878c2ecf20Sopenharmony_ci- atmel,smc-ncs-rd-pulse-ns
888c2ecf20Sopenharmony_ci- atmel,smc-nrd-pulse-ns
898c2ecf20Sopenharmony_ci- atmel,smc-ncs-wr-pulse-ns
908c2ecf20Sopenharmony_ci- atmel,smc-nwe-pulse-ns
918c2ecf20Sopenharmony_ci- atmel,smc-nwe-cycle-ns
928c2ecf20Sopenharmony_ci- atmel,smc-nrd-cycle-ns
938c2ecf20Sopenharmony_ci- atmel,smc-tdf-ns
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ciExample:
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci	ebi: ebi@10000000 {
988c2ecf20Sopenharmony_ci		compatible = "atmel,sama5d3-ebi";
998c2ecf20Sopenharmony_ci		#address-cells = <2>;
1008c2ecf20Sopenharmony_ci		#size-cells = <1>;
1018c2ecf20Sopenharmony_ci		atmel,smc = <&hsmc>;
1028c2ecf20Sopenharmony_ci		atmel,matrix = <&matrix>;
1038c2ecf20Sopenharmony_ci		reg = <0x10000000 0x10000000
1048c2ecf20Sopenharmony_ci		       0x40000000 0x30000000>;
1058c2ecf20Sopenharmony_ci		ranges = <0x0 0x0 0x10000000 0x10000000
1068c2ecf20Sopenharmony_ci			  0x1 0x0 0x40000000 0x10000000
1078c2ecf20Sopenharmony_ci			  0x2 0x0 0x50000000 0x10000000
1088c2ecf20Sopenharmony_ci			  0x3 0x0 0x60000000 0x10000000>;
1098c2ecf20Sopenharmony_ci		clocks = <&mck>;
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci		pinctrl-names = "default";
1128c2ecf20Sopenharmony_ci		pinctrl-0 = <&pinctrl_ebi_addr>;
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci		nor: flash@0,0 {
1158c2ecf20Sopenharmony_ci			compatible = "cfi-flash";
1168c2ecf20Sopenharmony_ci			#address-cells = <1>;
1178c2ecf20Sopenharmony_ci			#size-cells = <1>;
1188c2ecf20Sopenharmony_ci			reg = <0x0 0x0 0x1000000>;
1198c2ecf20Sopenharmony_ci			bank-width = <2>;
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci			atmel,smc-read-mode = "nrd";
1228c2ecf20Sopenharmony_ci			atmel,smc-write-mode = "nwe";
1238c2ecf20Sopenharmony_ci			atmel,smc-bus-width = <16>;
1248c2ecf20Sopenharmony_ci			atmel,smc-ncs-rd-setup-ns = <0>;
1258c2ecf20Sopenharmony_ci			atmel,smc-ncs-wr-setup-ns = <0>;
1268c2ecf20Sopenharmony_ci			atmel,smc-nwe-setup-ns = <8>;
1278c2ecf20Sopenharmony_ci			atmel,smc-nrd-setup-ns = <16>;
1288c2ecf20Sopenharmony_ci			atmel,smc-ncs-rd-pulse-ns = <84>;
1298c2ecf20Sopenharmony_ci			atmel,smc-ncs-wr-pulse-ns = <84>;
1308c2ecf20Sopenharmony_ci			atmel,smc-nrd-pulse-ns = <76>;
1318c2ecf20Sopenharmony_ci			atmel,smc-nwe-pulse-ns = <76>;
1328c2ecf20Sopenharmony_ci			atmel,smc-nrd-cycle-ns = <107>;
1338c2ecf20Sopenharmony_ci			atmel,smc-nwe-cycle-ns = <84>;
1348c2ecf20Sopenharmony_ci			atmel,smc-tdf-ns = <16>;
1358c2ecf20Sopenharmony_ci		};
1368c2ecf20Sopenharmony_ci	};
1378c2ecf20Sopenharmony_ci
138