xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/bus/nvidia,tegra20-gmi.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunDevice tree bindings for NVIDIA Tegra Generic Memory Interface bus
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunThe Generic Memory Interface bus enables memory transfers between internal and
4*4882a593Smuzhiyunexternal memory. Can be used to attach various high speed devices such as
5*4882a593Smuzhiyunsynchronous/asynchronous NOR, FPGA, UARTS and more.
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunThe actual devices are instantiated from the child nodes of a GMI node.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunRequired properties:
10*4882a593Smuzhiyun - compatible : Should contain one of the following:
11*4882a593Smuzhiyun        For Tegra20 must contain "nvidia,tegra20-gmi".
12*4882a593Smuzhiyun        For Tegra30 must contain "nvidia,tegra30-gmi".
13*4882a593Smuzhiyun - reg: Should contain GMI controller registers location and length.
14*4882a593Smuzhiyun - clocks: Must contain an entry for each entry in clock-names.
15*4882a593Smuzhiyun - clock-names: Must include the following entries: "gmi"
16*4882a593Smuzhiyun - resets : Must contain an entry for each entry in reset-names.
17*4882a593Smuzhiyun - reset-names : Must include the following entries: "gmi"
18*4882a593Smuzhiyun - #address-cells: The number of cells used to represent physical base
19*4882a593Smuzhiyun   addresses in the GMI address space. Should be 2.
20*4882a593Smuzhiyun - #size-cells: The number of cells used to represent the size of an address
21*4882a593Smuzhiyun   range in the GMI address space. Should be 1.
22*4882a593Smuzhiyun - ranges: Must be set up to reflect the memory layout with three integer values
23*4882a593Smuzhiyun   for each chip-select line in use (only one entry is supported, see below
24*4882a593Smuzhiyun   comments):
25*4882a593Smuzhiyun   <cs-number> <offset> <physical address of mapping> <size>
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunNote that the GMI controller does not have any internal chip-select address
28*4882a593Smuzhiyundecoding, because of that chip-selects either need to be managed via software
29*4882a593Smuzhiyunor by employing external chip-select decoding logic.
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunIf external chip-select logic is used to support multiple devices it is assumed
32*4882a593Smuzhiyunthat the devices use the same timing and so are probably the same type. It also
33*4882a593Smuzhiyunassumes that they can fit in the 256MB address range. In this case only one
34*4882a593Smuzhiyunchild device is supported which represents the active chip-select line, see
35*4882a593Smuzhiyunexamples for more insight.
36*4882a593Smuzhiyun
37*4882a593SmuzhiyunThe chip-select number is decoded from the child nodes second address cell of
38*4882a593Smuzhiyun'ranges' property, if 'ranges' property is not present or empty chip-select will
39*4882a593Smuzhiyunthen be decoded from the first cell of the 'reg' property.
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunOptional child cs node properties:
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun - nvidia,snor-data-width-32bit: Use 32bit data-bus, default is 16bit.
44*4882a593Smuzhiyun - nvidia,snor-mux-mode: Enable address/data MUX mode.
45*4882a593Smuzhiyun - nvidia,snor-rdy-active-before-data: Assert RDY signal one cycle before data.
46*4882a593Smuzhiyun   If omitted it will be asserted with data.
47*4882a593Smuzhiyun - nvidia,snor-rdy-active-high: RDY signal is active high
48*4882a593Smuzhiyun - nvidia,snor-adv-active-high: ADV signal is active high
49*4882a593Smuzhiyun - nvidia,snor-oe-active-high: WE/OE signal is active high
50*4882a593Smuzhiyun - nvidia,snor-cs-active-high: CS signal is active high
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun  Note that there is some special handling for the timing values.
53*4882a593Smuzhiyun  From Tegra TRM:
54*4882a593Smuzhiyun  Programming 0 means 1 clock cycle: actual cycle = programmed cycle + 1
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun - nvidia,snor-muxed-width: Number of cycles MUX address/data asserted on the
57*4882a593Smuzhiyun   bus. Valid values are 0-15, default is 1
58*4882a593Smuzhiyun - nvidia,snor-hold-width: Number of cycles CE stays asserted after the
59*4882a593Smuzhiyun   de-assertion of WR_N (in case of SLAVE/MASTER Request) or OE_N
60*4882a593Smuzhiyun   (in case of MASTER Request). Valid values are 0-15, default is 1
61*4882a593Smuzhiyun - nvidia,snor-adv-width: Number of cycles during which ADV stays asserted.
62*4882a593Smuzhiyun   Valid values are 0-15, default is 1.
63*4882a593Smuzhiyun - nvidia,snor-ce-width: Number of cycles before CE is asserted.
64*4882a593Smuzhiyun   Valid values are 0-15, default is 4
65*4882a593Smuzhiyun - nvidia,snor-we-width: Number of cycles during which WE stays asserted.
66*4882a593Smuzhiyun   Valid values are 0-15, default is 1
67*4882a593Smuzhiyun - nvidia,snor-oe-width: Number of cycles during which OE stays asserted.
68*4882a593Smuzhiyun   Valid values are 0-255, default is 1
69*4882a593Smuzhiyun - nvidia,snor-wait-width: Number of cycles before READY is asserted.
70*4882a593Smuzhiyun   Valid values are 0-255, default is 3
71*4882a593Smuzhiyun
72*4882a593SmuzhiyunExample with two SJA1000 CAN controllers connected to the GMI bus. We wrap the
73*4882a593Smuzhiyuncontrollers with a simple-bus node since they are all connected to the same
74*4882a593Smuzhiyunchip-select (CS4), in this example external address decoding is provided:
75*4882a593Smuzhiyun
76*4882a593Smuzhiyungmi@70009000 {
77*4882a593Smuzhiyun	compatible = "nvidia,tegra20-gmi";
78*4882a593Smuzhiyun	reg = <0x70009000 0x1000>;
79*4882a593Smuzhiyun	#address-cells = <2>;
80*4882a593Smuzhiyun	#size-cells = <1>;
81*4882a593Smuzhiyun	clocks = <&tegra_car TEGRA20_CLK_NOR>;
82*4882a593Smuzhiyun	clock-names = "gmi";
83*4882a593Smuzhiyun	resets = <&tegra_car 42>;
84*4882a593Smuzhiyun	reset-names = "gmi";
85*4882a593Smuzhiyun	ranges = <4 0 0xd0000000 0xfffffff>;
86*4882a593Smuzhiyun
87*4882a593Smuzhiyun	bus@4,0 {
88*4882a593Smuzhiyun		compatible = "simple-bus";
89*4882a593Smuzhiyun		#address-cells = <1>;
90*4882a593Smuzhiyun		#size-cells = <1>;
91*4882a593Smuzhiyun		ranges = <0 4 0 0x40100>;
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun		nvidia,snor-mux-mode;
94*4882a593Smuzhiyun		nvidia,snor-adv-active-high;
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun		can@0 {
97*4882a593Smuzhiyun			reg = <0 0x100>;
98*4882a593Smuzhiyun			...
99*4882a593Smuzhiyun		};
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun		can@40000 {
102*4882a593Smuzhiyun			reg = <0x40000 0x100>;
103*4882a593Smuzhiyun			...
104*4882a593Smuzhiyun		};
105*4882a593Smuzhiyun	};
106*4882a593Smuzhiyun};
107*4882a593Smuzhiyun
108*4882a593SmuzhiyunExample with one SJA1000 CAN controller connected to the GMI bus
109*4882a593Smuzhiyunon CS4:
110*4882a593Smuzhiyun
111*4882a593Smuzhiyungmi@70009000 {
112*4882a593Smuzhiyun	compatible = "nvidia,tegra20-gmi";
113*4882a593Smuzhiyun	reg = <0x70009000 0x1000>;
114*4882a593Smuzhiyun	#address-cells = <2>;
115*4882a593Smuzhiyun	#size-cells = <1>;
116*4882a593Smuzhiyun	clocks = <&tegra_car TEGRA20_CLK_NOR>;
117*4882a593Smuzhiyun	clock-names = "gmi";
118*4882a593Smuzhiyun	resets = <&tegra_car 42>;
119*4882a593Smuzhiyun	reset-names = "gmi";
120*4882a593Smuzhiyun	ranges = <4 0 0xd0000000 0xfffffff>;
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun	can@4,0 {
123*4882a593Smuzhiyun		reg = <4 0 0x100>;
124*4882a593Smuzhiyun		nvidia,snor-mux-mode;
125*4882a593Smuzhiyun		nvidia,snor-adv-active-high;
126*4882a593Smuzhiyun		...
127*4882a593Smuzhiyun	};
128*4882a593Smuzhiyun};
129