18c2ecf20Sopenharmony_ciDevice tree bindings for NVIDIA Tegra Generic Memory Interface bus 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ciThe Generic Memory Interface bus enables memory transfers between internal and 48c2ecf20Sopenharmony_ciexternal memory. Can be used to attach various high speed devices such as 58c2ecf20Sopenharmony_cisynchronous/asynchronous NOR, FPGA, UARTS and more. 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciThe actual devices are instantiated from the child nodes of a GMI node. 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciRequired properties: 108c2ecf20Sopenharmony_ci - compatible : Should contain one of the following: 118c2ecf20Sopenharmony_ci For Tegra20 must contain "nvidia,tegra20-gmi". 128c2ecf20Sopenharmony_ci For Tegra30 must contain "nvidia,tegra30-gmi". 138c2ecf20Sopenharmony_ci - reg: Should contain GMI controller registers location and length. 148c2ecf20Sopenharmony_ci - clocks: Must contain an entry for each entry in clock-names. 158c2ecf20Sopenharmony_ci - clock-names: Must include the following entries: "gmi" 168c2ecf20Sopenharmony_ci - resets : Must contain an entry for each entry in reset-names. 178c2ecf20Sopenharmony_ci - reset-names : Must include the following entries: "gmi" 188c2ecf20Sopenharmony_ci - #address-cells: The number of cells used to represent physical base 198c2ecf20Sopenharmony_ci addresses in the GMI address space. Should be 2. 208c2ecf20Sopenharmony_ci - #size-cells: The number of cells used to represent the size of an address 218c2ecf20Sopenharmony_ci range in the GMI address space. Should be 1. 228c2ecf20Sopenharmony_ci - ranges: Must be set up to reflect the memory layout with three integer values 238c2ecf20Sopenharmony_ci for each chip-select line in use (only one entry is supported, see below 248c2ecf20Sopenharmony_ci comments): 258c2ecf20Sopenharmony_ci <cs-number> <offset> <physical address of mapping> <size> 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ciNote that the GMI controller does not have any internal chip-select address 288c2ecf20Sopenharmony_cidecoding, because of that chip-selects either need to be managed via software 298c2ecf20Sopenharmony_cior by employing external chip-select decoding logic. 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciIf external chip-select logic is used to support multiple devices it is assumed 328c2ecf20Sopenharmony_cithat the devices use the same timing and so are probably the same type. It also 338c2ecf20Sopenharmony_ciassumes that they can fit in the 256MB address range. In this case only one 348c2ecf20Sopenharmony_cichild device is supported which represents the active chip-select line, see 358c2ecf20Sopenharmony_ciexamples for more insight. 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ciThe chip-select number is decoded from the child nodes second address cell of 388c2ecf20Sopenharmony_ci'ranges' property, if 'ranges' property is not present or empty chip-select will 398c2ecf20Sopenharmony_cithen be decoded from the first cell of the 'reg' property. 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ciOptional child cs node properties: 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci - nvidia,snor-data-width-32bit: Use 32bit data-bus, default is 16bit. 448c2ecf20Sopenharmony_ci - nvidia,snor-mux-mode: Enable address/data MUX mode. 458c2ecf20Sopenharmony_ci - nvidia,snor-rdy-active-before-data: Assert RDY signal one cycle before data. 468c2ecf20Sopenharmony_ci If omitted it will be asserted with data. 478c2ecf20Sopenharmony_ci - nvidia,snor-rdy-active-high: RDY signal is active high 488c2ecf20Sopenharmony_ci - nvidia,snor-adv-active-high: ADV signal is active high 498c2ecf20Sopenharmony_ci - nvidia,snor-oe-active-high: WE/OE signal is active high 508c2ecf20Sopenharmony_ci - nvidia,snor-cs-active-high: CS signal is active high 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci Note that there is some special handling for the timing values. 538c2ecf20Sopenharmony_ci From Tegra TRM: 548c2ecf20Sopenharmony_ci Programming 0 means 1 clock cycle: actual cycle = programmed cycle + 1 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci - nvidia,snor-muxed-width: Number of cycles MUX address/data asserted on the 578c2ecf20Sopenharmony_ci bus. Valid values are 0-15, default is 1 588c2ecf20Sopenharmony_ci - nvidia,snor-hold-width: Number of cycles CE stays asserted after the 598c2ecf20Sopenharmony_ci de-assertion of WR_N (in case of SLAVE/MASTER Request) or OE_N 608c2ecf20Sopenharmony_ci (in case of MASTER Request). Valid values are 0-15, default is 1 618c2ecf20Sopenharmony_ci - nvidia,snor-adv-width: Number of cycles during which ADV stays asserted. 628c2ecf20Sopenharmony_ci Valid values are 0-15, default is 1. 638c2ecf20Sopenharmony_ci - nvidia,snor-ce-width: Number of cycles before CE is asserted. 648c2ecf20Sopenharmony_ci Valid values are 0-15, default is 4 658c2ecf20Sopenharmony_ci - nvidia,snor-we-width: Number of cycles during which WE stays asserted. 668c2ecf20Sopenharmony_ci Valid values are 0-15, default is 1 678c2ecf20Sopenharmony_ci - nvidia,snor-oe-width: Number of cycles during which OE stays asserted. 688c2ecf20Sopenharmony_ci Valid values are 0-255, default is 1 698c2ecf20Sopenharmony_ci - nvidia,snor-wait-width: Number of cycles before READY is asserted. 708c2ecf20Sopenharmony_ci Valid values are 0-255, default is 3 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ciExample with two SJA1000 CAN controllers connected to the GMI bus. We wrap the 738c2ecf20Sopenharmony_cicontrollers with a simple-bus node since they are all connected to the same 748c2ecf20Sopenharmony_cichip-select (CS4), in this example external address decoding is provided: 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_cigmi@70009000 { 778c2ecf20Sopenharmony_ci compatible = "nvidia,tegra20-gmi"; 788c2ecf20Sopenharmony_ci reg = <0x70009000 0x1000>; 798c2ecf20Sopenharmony_ci #address-cells = <2>; 808c2ecf20Sopenharmony_ci #size-cells = <1>; 818c2ecf20Sopenharmony_ci clocks = <&tegra_car TEGRA20_CLK_NOR>; 828c2ecf20Sopenharmony_ci clock-names = "gmi"; 838c2ecf20Sopenharmony_ci resets = <&tegra_car 42>; 848c2ecf20Sopenharmony_ci reset-names = "gmi"; 858c2ecf20Sopenharmony_ci ranges = <4 0 0xd0000000 0xfffffff>; 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci bus@4,0 { 888c2ecf20Sopenharmony_ci compatible = "simple-bus"; 898c2ecf20Sopenharmony_ci #address-cells = <1>; 908c2ecf20Sopenharmony_ci #size-cells = <1>; 918c2ecf20Sopenharmony_ci ranges = <0 4 0 0x40100>; 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci nvidia,snor-mux-mode; 948c2ecf20Sopenharmony_ci nvidia,snor-adv-active-high; 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ci can@0 { 978c2ecf20Sopenharmony_ci reg = <0 0x100>; 988c2ecf20Sopenharmony_ci ... 998c2ecf20Sopenharmony_ci }; 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci can@40000 { 1028c2ecf20Sopenharmony_ci reg = <0x40000 0x100>; 1038c2ecf20Sopenharmony_ci ... 1048c2ecf20Sopenharmony_ci }; 1058c2ecf20Sopenharmony_ci }; 1068c2ecf20Sopenharmony_ci}; 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ciExample with one SJA1000 CAN controller connected to the GMI bus 1098c2ecf20Sopenharmony_cion CS4: 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_cigmi@70009000 { 1128c2ecf20Sopenharmony_ci compatible = "nvidia,tegra20-gmi"; 1138c2ecf20Sopenharmony_ci reg = <0x70009000 0x1000>; 1148c2ecf20Sopenharmony_ci #address-cells = <2>; 1158c2ecf20Sopenharmony_ci #size-cells = <1>; 1168c2ecf20Sopenharmony_ci clocks = <&tegra_car TEGRA20_CLK_NOR>; 1178c2ecf20Sopenharmony_ci clock-names = "gmi"; 1188c2ecf20Sopenharmony_ci resets = <&tegra_car 42>; 1198c2ecf20Sopenharmony_ci reset-names = "gmi"; 1208c2ecf20Sopenharmony_ci ranges = <4 0 0xd0000000 0xfffffff>; 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_ci can@4,0 { 1238c2ecf20Sopenharmony_ci reg = <4 0 0x100>; 1248c2ecf20Sopenharmony_ci nvidia,snor-mux-mode; 1258c2ecf20Sopenharmony_ci nvidia,snor-adv-active-high; 1268c2ecf20Sopenharmony_ci ... 1278c2ecf20Sopenharmony_ci }; 1288c2ecf20Sopenharmony_ci}; 129