Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings: memory: tegra20: emc: Convert to schema

Convert Tegra20 External Memory Controller binding to schema.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210510212320.3255-1-digetx@gmail.com
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Dmitry Osipenko and committed by
Rob Herring
de3d7018 d30e82a6

+230 -130
-130
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-emc.txt
··· 1 - Embedded Memory Controller 2 - 3 - Properties: 4 - - name : Should be emc 5 - - #address-cells : Should be 1 6 - - #size-cells : Should be 0 7 - - compatible : Should contain "nvidia,tegra20-emc". 8 - - reg : Offset and length of the register set for the device 9 - - nvidia,use-ram-code : If present, the sub-nodes will be addressed 10 - and chosen using the ramcode board selector. If omitted, only one 11 - set of tables can be present and said tables will be used 12 - irrespective of ram-code configuration. 13 - - interrupts : Should contain EMC General interrupt. 14 - - clocks : Should contain EMC clock. 15 - - nvidia,memory-controller : Phandle of the Memory Controller node. 16 - - #interconnect-cells : Should be 0. 17 - - operating-points-v2: See ../bindings/opp/opp.txt for details. 18 - 19 - For each opp entry in 'operating-points-v2' table: 20 - - opp-supported-hw: One bitfield indicating SoC process ID mask 21 - 22 - A bitwise AND is performed against this value and if any bit 23 - matches, the OPP gets enabled. 24 - 25 - Optional properties: 26 - - power-domains: Phandle of the SoC "core" power domain. 27 - 28 - Child device nodes describe the memory settings for different configurations and clock rates. 29 - 30 - Example: 31 - 32 - opp_table: opp-table { 33 - compatible = "operating-points-v2"; 34 - 35 - opp@36000000 { 36 - opp-microvolt = <950000 950000 1300000>; 37 - opp-hz = /bits/ 64 <36000000>; 38 - }; 39 - ... 40 - }; 41 - 42 - memory-controller@7000f400 { 43 - #address-cells = < 1 >; 44 - #size-cells = < 0 >; 45 - #interconnect-cells = <0>; 46 - compatible = "nvidia,tegra20-emc"; 47 - reg = <0x7000f400 0x400>; 48 - interrupts = <0 78 0x04>; 49 - clocks = <&tegra_car TEGRA20_CLK_EMC>; 50 - nvidia,memory-controller = <&mc>; 51 - power-domains = <&domain>; 52 - operating-points-v2 = <&opp_table>; 53 - } 54 - 55 - 56 - Embedded Memory Controller ram-code table 57 - 58 - If the emc node has the nvidia,use-ram-code property present, then the 59 - next level of nodes below the emc table are used to specify which settings 60 - apply for which ram-code settings. 61 - 62 - If the emc node lacks the nvidia,use-ram-code property, this level is omitted 63 - and the tables are stored directly under the emc node (see below). 64 - 65 - Properties: 66 - 67 - - name : Should be emc-tables 68 - - nvidia,ram-code : the binary representation of the ram-code board strappings 69 - for which this node (and children) are valid. 70 - 71 - 72 - 73 - Embedded Memory Controller configuration table 74 - 75 - This is a table containing the EMC register settings for the various 76 - operating speeds of the memory controller. They are always located as 77 - subnodes of the emc controller node. 78 - 79 - There are two ways of specifying which tables to use: 80 - 81 - * The simplest is if there is just one set of tables in the device tree, 82 - and they will always be used (based on which frequency is used). 83 - This is the preferred method, especially when firmware can fill in 84 - this information based on the specific system information and just 85 - pass it on to the kernel. 86 - 87 - * The slightly more complex one is when more than one memory configuration 88 - might exist on the system. The Tegra20 platform handles this during 89 - early boot by selecting one out of possible 4 memory settings based 90 - on a 2-pin "ram code" bootstrap setting on the board. The values of 91 - these strappings can be read through a register in the SoC, and thus 92 - used to select which tables to use. 93 - 94 - Properties: 95 - - name : Should be emc-table 96 - - compatible : Should contain "nvidia,tegra20-emc-table". 97 - - reg : either an opaque enumerator to tell different tables apart, or 98 - the valid frequency for which the table should be used (in kHz). 99 - - clock-frequency : the clock frequency for the EMC at which this 100 - table should be used (in kHz). 101 - - nvidia,emc-registers : a 46 word array of EMC registers to be programmed 102 - for operation at the 'clock-frequency' setting. 103 - The order and contents of the registers are: 104 - RC, RFC, RAS, RP, R2W, W2R, R2P, W2P, RD_RCD, WR_RCD, RRD, REXT, 105 - WDV, QUSE, QRST, QSAFE, RDV, REFRESH, BURST_REFRESH_NUM, PDEX2WR, 106 - PDEX2RD, PCHG2PDEN, ACT2PDEN, AR2PDEN, RW2PDEN, TXSR, TCKE, TFAW, 107 - TRPAB, TCLKSTABLE, TCLKSTOP, TREFBW, QUSE_EXTRA, FBIO_CFG6, ODT_WRITE, 108 - ODT_READ, FBIO_CFG5, CFG_DIG_DLL, DLL_XFORM_DQS, DLL_XFORM_QUSE, 109 - ZCAL_REF_CNT, ZCAL_WAIT_CNT, AUTO_CAL_INTERVAL, CFG_CLKTRIM_0, 110 - CFG_CLKTRIM_1, CFG_CLKTRIM_2 111 - 112 - emc-table@166000 { 113 - reg = <166000>; 114 - compatible = "nvidia,tegra20-emc-table"; 115 - clock-frequency = < 166000 >; 116 - nvidia,emc-registers = < 0 0 0 0 0 0 0 0 0 0 0 0 0 0 117 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 118 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 119 - 0 0 0 0 >; 120 - }; 121 - 122 - emc-table@333000 { 123 - reg = <333000>; 124 - compatible = "nvidia,tegra20-emc-table"; 125 - clock-frequency = < 333000 >; 126 - nvidia,emc-registers = < 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128 - 0 0 0 0 0 0 0 0 0 0 0 0 0 0 129 - 0 0 0 0 >; 130 - };
+230
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra20-emc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/memory-controllers/nvidia,tegra20-emc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NVIDIA Tegra20 SoC External Memory Controller 8 + 9 + maintainers: 10 + - Dmitry Osipenko <digetx@gmail.com> 11 + - Jon Hunter <jonathanh@nvidia.com> 12 + - Thierry Reding <thierry.reding@gmail.com> 13 + 14 + description: | 15 + The External Memory Controller (EMC) interfaces with the off-chip SDRAM to 16 + service the request stream sent from Memory Controller. The EMC also has 17 + various performance-affecting settings beyond the obvious SDRAM configuration 18 + parameters and initialization settings. Tegra20 EMC supports multiple JEDEC 19 + standard protocols: DDR1, LPDDR2 and DDR2. 20 + 21 + properties: 22 + compatible: 23 + const: nvidia,tegra20-emc 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + clocks: 29 + maxItems: 1 30 + 31 + interrupts: 32 + maxItems: 1 33 + 34 + "#address-cells": 35 + const: 1 36 + 37 + "#size-cells": 38 + const: 0 39 + 40 + "#interconnect-cells": 41 + const: 0 42 + 43 + nvidia,memory-controller: 44 + $ref: /schemas/types.yaml#/definitions/phandle 45 + description: 46 + Phandle of the Memory Controller node. 47 + 48 + power-domains: 49 + maxItems: 1 50 + description: 51 + Phandle of the SoC "core" power domain. 52 + 53 + operating-points-v2: 54 + description: 55 + Should contain freqs and voltages and opp-supported-hw property, which 56 + is a bitfield indicating SoC process ID mask. 57 + 58 + nvidia,use-ram-code: 59 + type: boolean 60 + description: 61 + If present, the emc-tables@ sub-nodes will be addressed. 62 + 63 + $defs: 64 + emc-table: 65 + type: object 66 + properties: 67 + compatible: 68 + const: nvidia,tegra20-emc-table 69 + 70 + clock-frequency: 71 + description: 72 + Memory clock rate in kHz. 73 + minimum: 1000 74 + maximum: 900000 75 + 76 + reg: 77 + maxItems: 1 78 + description: 79 + Either an opaque enumerator to tell different tables apart, or 80 + the valid frequency for which the table should be used (in kHz). 81 + 82 + nvidia,emc-registers: 83 + description: 84 + EMC timing characterization data. These are the registers 85 + (see section "15.4.1 EMC Registers" in the TRM) whose values 86 + need to be specified, according to the board documentation. 87 + $ref: /schemas/types.yaml#/definitions/uint32-array 88 + items: 89 + - description: EMC_RC 90 + - description: EMC_RFC 91 + - description: EMC_RAS 92 + - description: EMC_RP 93 + - description: EMC_R2W 94 + - description: EMC_W2R 95 + - description: EMC_R2P 96 + - description: EMC_W2P 97 + - description: EMC_RD_RCD 98 + - description: EMC_WR_RCD 99 + - description: EMC_RRD 100 + - description: EMC_REXT 101 + - description: EMC_WDV 102 + - description: EMC_QUSE 103 + - description: EMC_QRST 104 + - description: EMC_QSAFE 105 + - description: EMC_RDV 106 + - description: EMC_REFRESH 107 + - description: EMC_BURST_REFRESH_NUM 108 + - description: EMC_PDEX2WR 109 + - description: EMC_PDEX2RD 110 + - description: EMC_PCHG2PDEN 111 + - description: EMC_ACT2PDEN 112 + - description: EMC_AR2PDEN 113 + - description: EMC_RW2PDEN 114 + - description: EMC_TXSR 115 + - description: EMC_TCKE 116 + - description: EMC_TFAW 117 + - description: EMC_TRPAB 118 + - description: EMC_TCLKSTABLE 119 + - description: EMC_TCLKSTOP 120 + - description: EMC_TREFBW 121 + - description: EMC_QUSE_EXTRA 122 + - description: EMC_FBIO_CFG6 123 + - description: EMC_ODT_WRITE 124 + - description: EMC_ODT_READ 125 + - description: EMC_FBIO_CFG5 126 + - description: EMC_CFG_DIG_DLL 127 + - description: EMC_DLL_XFORM_DQS 128 + - description: EMC_DLL_XFORM_QUSE 129 + - description: EMC_ZCAL_REF_CNT 130 + - description: EMC_ZCAL_WAIT_CNT 131 + - description: EMC_AUTO_CAL_INTERVAL 132 + - description: EMC_CFG_CLKTRIM_0 133 + - description: EMC_CFG_CLKTRIM_1 134 + - description: EMC_CFG_CLKTRIM_2 135 + 136 + required: 137 + - clock-frequency 138 + - compatible 139 + - reg 140 + - nvidia,emc-registers 141 + 142 + additionalProperties: false 143 + 144 + patternProperties: 145 + "^emc-table@[0-9]+$": 146 + $ref: "#/$defs/emc-table" 147 + 148 + "^emc-tables@[a-z0-9-]+$": 149 + type: object 150 + properties: 151 + reg: 152 + maxItems: 1 153 + description: 154 + An opaque enumerator to tell different tables apart. 155 + 156 + nvidia,ram-code: 157 + $ref: /schemas/types.yaml#/definitions/uint32 158 + description: 159 + Value of RAM_CODE this timing set is used for. 160 + 161 + "#address-cells": 162 + const: 1 163 + 164 + "#size-cells": 165 + const: 0 166 + 167 + patternProperties: 168 + "^emc-table@[0-9]+$": 169 + $ref: "#/$defs/emc-table" 170 + 171 + required: 172 + - nvidia,ram-code 173 + 174 + additionalProperties: false 175 + 176 + required: 177 + - compatible 178 + - reg 179 + - interrupts 180 + - clocks 181 + - nvidia,memory-controller 182 + - "#interconnect-cells" 183 + - operating-points-v2 184 + 185 + additionalProperties: false 186 + 187 + examples: 188 + - | 189 + external-memory-controller@7000f400 { 190 + compatible = "nvidia,tegra20-emc"; 191 + reg = <0x7000f400 0x400>; 192 + interrupts = <0 78 4>; 193 + clocks = <&clock_controller 57>; 194 + 195 + nvidia,memory-controller = <&mc>; 196 + operating-points-v2 = <&dvfs_opp_table>; 197 + power-domains = <&domain>; 198 + 199 + #interconnect-cells = <0>; 200 + #address-cells = <1>; 201 + #size-cells = <0>; 202 + 203 + nvidia,use-ram-code; 204 + 205 + emc-tables@0 { 206 + nvidia,ram-code = <0>; 207 + reg = <0>; 208 + 209 + #address-cells = <1>; 210 + #size-cells = <0>; 211 + 212 + emc-table@333000 { 213 + reg = <333000>; 214 + compatible = "nvidia,tegra20-emc-table"; 215 + clock-frequency = <333000>; 216 + nvidia,emc-registers = <0x00000018 0x00000033 217 + 0x00000012 0x00000004 0x00000004 0x00000005 218 + 0x00000003 0x0000000c 0x00000006 0x00000006 219 + 0x00000003 0x00000001 0x00000004 0x00000005 220 + 0x00000004 0x00000009 0x0000000d 0x00000bff 221 + 0x00000000 0x00000003 0x00000003 0x00000006 222 + 0x00000006 0x00000001 0x00000011 0x000000c8 223 + 0x00000003 0x0000000e 0x00000007 0x00000008 224 + 0x00000002 0x00000000 0x00000000 0x00000002 225 + 0x00000000 0x00000000 0x00000083 0xf0440303 226 + 0x007fe010 0x00001414 0x00000000 0x00000000 227 + 0x00000000 0x00000000 0x00000000 0x00000000>; 228 + }; 229 + }; 230 + };