162306a36Sopenharmony_ciDevice tree bindings for NVIDIA Tegra Generic Memory Interface bus
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciThe Generic Memory Interface bus enables memory transfers between internal and
462306a36Sopenharmony_ciexternal memory. Can be used to attach various high speed devices such as
562306a36Sopenharmony_cisynchronous/asynchronous NOR, FPGA, UARTS and more.
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciThe actual devices are instantiated from the child nodes of a GMI node.
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciRequired properties:
1062306a36Sopenharmony_ci - compatible : Should contain one of the following:
1162306a36Sopenharmony_ci        For Tegra20 must contain "nvidia,tegra20-gmi".
1262306a36Sopenharmony_ci        For Tegra30 must contain "nvidia,tegra30-gmi".
1362306a36Sopenharmony_ci - reg: Should contain GMI controller registers location and length.
1462306a36Sopenharmony_ci - clocks: Must contain an entry for each entry in clock-names.
1562306a36Sopenharmony_ci - clock-names: Must include the following entries: "gmi"
1662306a36Sopenharmony_ci - resets : Must contain an entry for each entry in reset-names.
1762306a36Sopenharmony_ci - reset-names : Must include the following entries: "gmi"
1862306a36Sopenharmony_ci - #address-cells: The number of cells used to represent physical base
1962306a36Sopenharmony_ci   addresses in the GMI address space. Should be 2.
2062306a36Sopenharmony_ci - #size-cells: The number of cells used to represent the size of an address
2162306a36Sopenharmony_ci   range in the GMI address space. Should be 1.
2262306a36Sopenharmony_ci - ranges: Must be set up to reflect the memory layout with three integer values
2362306a36Sopenharmony_ci   for each chip-select line in use (only one entry is supported, see below
2462306a36Sopenharmony_ci   comments):
2562306a36Sopenharmony_ci   <cs-number> <offset> <physical address of mapping> <size>
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ciNote that the GMI controller does not have any internal chip-select address
2862306a36Sopenharmony_cidecoding, because of that chip-selects either need to be managed via software
2962306a36Sopenharmony_cior by employing external chip-select decoding logic.
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ciIf external chip-select logic is used to support multiple devices it is assumed
3262306a36Sopenharmony_cithat the devices use the same timing and so are probably the same type. It also
3362306a36Sopenharmony_ciassumes that they can fit in the 256MB address range. In this case only one
3462306a36Sopenharmony_cichild device is supported which represents the active chip-select line, see
3562306a36Sopenharmony_ciexamples for more insight.
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ciThe chip-select number is decoded from the child nodes second address cell of
3862306a36Sopenharmony_ci'ranges' property, if 'ranges' property is not present or empty chip-select will
3962306a36Sopenharmony_cithen be decoded from the first cell of the 'reg' property.
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ciOptional child cs node properties:
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci - nvidia,snor-data-width-32bit: Use 32bit data-bus, default is 16bit.
4462306a36Sopenharmony_ci - nvidia,snor-mux-mode: Enable address/data MUX mode.
4562306a36Sopenharmony_ci - nvidia,snor-rdy-active-before-data: Assert RDY signal one cycle before data.
4662306a36Sopenharmony_ci   If omitted it will be asserted with data.
4762306a36Sopenharmony_ci - nvidia,snor-rdy-active-high: RDY signal is active high
4862306a36Sopenharmony_ci - nvidia,snor-adv-active-high: ADV signal is active high
4962306a36Sopenharmony_ci - nvidia,snor-oe-active-high: WE/OE signal is active high
5062306a36Sopenharmony_ci - nvidia,snor-cs-active-high: CS signal is active high
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci  Note that there is some special handling for the timing values.
5362306a36Sopenharmony_ci  From Tegra TRM:
5462306a36Sopenharmony_ci  Programming 0 means 1 clock cycle: actual cycle = programmed cycle + 1
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci - nvidia,snor-muxed-width: Number of cycles MUX address/data asserted on the
5762306a36Sopenharmony_ci   bus. Valid values are 0-15, default is 1
5862306a36Sopenharmony_ci - nvidia,snor-hold-width: Number of cycles CE stays asserted after the
5962306a36Sopenharmony_ci   de-assertion of WR_N (in case of SLAVE/MASTER Request) or OE_N
6062306a36Sopenharmony_ci   (in case of MASTER Request). Valid values are 0-15, default is 1
6162306a36Sopenharmony_ci - nvidia,snor-adv-width: Number of cycles during which ADV stays asserted.
6262306a36Sopenharmony_ci   Valid values are 0-15, default is 1.
6362306a36Sopenharmony_ci - nvidia,snor-ce-width: Number of cycles before CE is asserted.
6462306a36Sopenharmony_ci   Valid values are 0-15, default is 4
6562306a36Sopenharmony_ci - nvidia,snor-we-width: Number of cycles during which WE stays asserted.
6662306a36Sopenharmony_ci   Valid values are 0-15, default is 1
6762306a36Sopenharmony_ci - nvidia,snor-oe-width: Number of cycles during which OE stays asserted.
6862306a36Sopenharmony_ci   Valid values are 0-255, default is 1
6962306a36Sopenharmony_ci - nvidia,snor-wait-width: Number of cycles before READY is asserted.
7062306a36Sopenharmony_ci   Valid values are 0-255, default is 3
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ciExample with two SJA1000 CAN controllers connected to the GMI bus. We wrap the
7362306a36Sopenharmony_cicontrollers with a simple-bus node since they are all connected to the same
7462306a36Sopenharmony_cichip-select (CS4), in this example external address decoding is provided:
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_cigmi@70009000 {
7762306a36Sopenharmony_ci	compatible = "nvidia,tegra20-gmi";
7862306a36Sopenharmony_ci	reg = <0x70009000 0x1000>;
7962306a36Sopenharmony_ci	#address-cells = <2>;
8062306a36Sopenharmony_ci	#size-cells = <1>;
8162306a36Sopenharmony_ci	clocks = <&tegra_car TEGRA20_CLK_NOR>;
8262306a36Sopenharmony_ci	clock-names = "gmi";
8362306a36Sopenharmony_ci	resets = <&tegra_car 42>;
8462306a36Sopenharmony_ci	reset-names = "gmi";
8562306a36Sopenharmony_ci	ranges = <4 0 0xd0000000 0xfffffff>;
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci	bus@4,0 {
8862306a36Sopenharmony_ci		compatible = "simple-bus";
8962306a36Sopenharmony_ci		#address-cells = <1>;
9062306a36Sopenharmony_ci		#size-cells = <1>;
9162306a36Sopenharmony_ci		ranges = <0 4 0 0x40100>;
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci		nvidia,snor-mux-mode;
9462306a36Sopenharmony_ci		nvidia,snor-adv-active-high;
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci		can@0 {
9762306a36Sopenharmony_ci			reg = <0 0x100>;
9862306a36Sopenharmony_ci			...
9962306a36Sopenharmony_ci		};
10062306a36Sopenharmony_ci
10162306a36Sopenharmony_ci		can@40000 {
10262306a36Sopenharmony_ci			reg = <0x40000 0x100>;
10362306a36Sopenharmony_ci			...
10462306a36Sopenharmony_ci		};
10562306a36Sopenharmony_ci	};
10662306a36Sopenharmony_ci};
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ciExample with one SJA1000 CAN controller connected to the GMI bus
10962306a36Sopenharmony_cion CS4:
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_cigmi@70009000 {
11262306a36Sopenharmony_ci	compatible = "nvidia,tegra20-gmi";
11362306a36Sopenharmony_ci	reg = <0x70009000 0x1000>;
11462306a36Sopenharmony_ci	#address-cells = <2>;
11562306a36Sopenharmony_ci	#size-cells = <1>;
11662306a36Sopenharmony_ci	clocks = <&tegra_car TEGRA20_CLK_NOR>;
11762306a36Sopenharmony_ci	clock-names = "gmi";
11862306a36Sopenharmony_ci	resets = <&tegra_car 42>;
11962306a36Sopenharmony_ci	reset-names = "gmi";
12062306a36Sopenharmony_ci	ranges = <4 0 0xd0000000 0xfffffff>;
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci	can@4,0 {
12362306a36Sopenharmony_ci		reg = <4 0 0x100>;
12462306a36Sopenharmony_ci		nvidia,snor-mux-mode;
12562306a36Sopenharmony_ci		nvidia,snor-adv-active-high;
12662306a36Sopenharmony_ci		...
12762306a36Sopenharmony_ci	};
12862306a36Sopenharmony_ci};
129