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

Merge tag 'arm-drivers-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull ARM driver updates from Olof Johansson:

- Reset controllers: Adding support for Microchip Sparx5 Switch.

- Memory controllers: ARM Primecell PL35x SMC memory controller driver
cleanups and improvements.

- i.MX SoC drivers: Power domain support for i.MX8MM and i.MX8MN.

- Rockchip: RK3568 power domains support + DT binding updates,
cleanups.

- Qualcomm SoC drivers: Amend socinfo with more SoC/PMIC details,
including support for MSM8226, MDM9607, SM6125 and SC8180X.

- ARM FFA driver: "Firmware Framework for ARMv8-A", defining management
interfaces and communication (including bus model) between partitions
both in Normal and Secure Worlds.

- Tegra Memory controller changes, including major rework to deal with
identity mappings at boot and integration with ARM SMMU pieces.

* tag 'arm-drivers-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (120 commits)
firmware: turris-mox-rwtm: add marvell,armada-3700-rwtm-firmware compatible string
firmware: turris-mox-rwtm: show message about HWRNG registration
firmware: turris-mox-rwtm: fail probing when firmware does not support hwrng
firmware: turris-mox-rwtm: report failures better
firmware: turris-mox-rwtm: fix reply status decoding function
soc: imx: gpcv2: add support for i.MX8MN power domains
dt-bindings: add defines for i.MX8MN power domains
firmware: tegra: bpmp: Fix Tegra234-only builds
iommu/arm-smmu: Use Tegra implementation on Tegra186
iommu/arm-smmu: tegra: Implement SID override programming
iommu/arm-smmu: tegra: Detect number of instances at runtime
dt-bindings: arm-smmu: Add Tegra186 compatible string
firmware: qcom_scm: Add MDM9607 compatible
soc: qcom: rpmpd: Add MDM9607 RPM Power Domains
soc: renesas: Add support to read LSI DEVID register of RZ/G2{L,LC} SoC's
soc: renesas: Add ARCH_R9A07G044 for the new RZ/G2L SoC's
dt-bindings: soc: rockchip: drop unnecessary #phy-cells from grf.yaml
memory: emif: remove unused frequency and voltage notifiers
memory: fsl_ifc: fix leak of private memory on probe failure
memory: fsl_ifc: fix leak of IO mapping on probe failure
...

+8776 -5522
-16
Documentation/devicetree/bindings/arm/rockchip/pmu.txt
··· 1 - Rockchip power-management-unit: 2 - ------------------------------- 3 - 4 - The pmu is used to turn off and on different power domains of the SoCs 5 - This includes the power to the CPU cores. 6 - 7 - Required node properties: 8 - - compatible value : = "rockchip,rk3066-pmu"; 9 - - reg : physical base address and the size of the registers window 10 - 11 - Example: 12 - 13 - pmu@20004000 { 14 - compatible = "rockchip,rk3066-pmu"; 15 - reg = <0x20004000 0x100>; 16 - };
+55
Documentation/devicetree/bindings/arm/rockchip/pmu.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/rockchip/pmu.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Rockchip Power Management Unit (PMU) 8 + 9 + maintainers: 10 + - Elaine Zhang <zhangqing@rock-chips.com> 11 + - Heiko Stuebner <heiko@sntech.de> 12 + 13 + description: | 14 + The PMU is used to turn on and off different power domains of the SoCs. 15 + This includes the power to the CPU cores. 16 + 17 + select: 18 + properties: 19 + compatible: 20 + contains: 21 + enum: 22 + - rockchip,px30-pmu 23 + - rockchip,rk3066-pmu 24 + - rockchip,rk3288-pmu 25 + - rockchip,rk3399-pmu 26 + 27 + required: 28 + - compatible 29 + 30 + properties: 31 + compatible: 32 + items: 33 + - enum: 34 + - rockchip,px30-pmu 35 + - rockchip,rk3066-pmu 36 + - rockchip,rk3288-pmu 37 + - rockchip,rk3399-pmu 38 + - const: syscon 39 + - const: simple-mfd 40 + 41 + reg: 42 + maxItems: 1 43 + 44 + required: 45 + - compatible 46 + - reg 47 + 48 + additionalProperties: true 49 + 50 + examples: 51 + - | 52 + pmu@20004000 { 53 + compatible = "rockchip,rk3066-pmu", "syscon", "simple-mfd"; 54 + reg = <0x20004000 0x100>; 55 + };
+1
Documentation/devicetree/bindings/firmware/qcom,scm.txt
··· 12 12 * "qcom,scm-ipq4019" 13 13 * "qcom,scm-ipq806x" 14 14 * "qcom,scm-ipq8074" 15 + * "qcom,scm-mdm9607" 15 16 * "qcom,scm-msm8660" 16 17 * "qcom,scm-msm8916" 17 18 * "qcom,scm-msm8960"
+9 -2
Documentation/devicetree/bindings/iommu/arm,smmu.yaml
··· 54 54 - const: arm,mmu-500 55 55 - description: NVIDIA SoCs that program two ARM MMU-500s identically 56 56 items: 57 + - description: NVIDIA SoCs that require memory controller interaction 58 + and may program multiple ARM MMU-500s identically with the memory 59 + controller interleaving translations between multiple instances 60 + for improved performance. 61 + items: 57 62 - enum: 58 - - nvidia,tegra194-smmu 63 + - const: nvidia,tegra194-smmu 64 + - const: nvidia,tegra186-smmu 59 65 - const: nvidia,smmu-500 60 66 - items: 61 67 - const: arm,mmu-500 ··· 171 165 contains: 172 166 enum: 173 167 - nvidia,tegra194-smmu 168 + - nvidia,tegra186-smmu 174 169 then: 175 170 properties: 176 171 reg: 177 - minItems: 2 172 + minItems: 1 178 173 maxItems: 2 179 174 else: 180 175 properties:
+3 -8
Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml
··· 30 30 "#clock-cells": 31 31 const: 0 32 32 33 - "#phy-cells": 34 - const: 0 35 - 36 33 clocks: 37 34 maxItems: 1 38 35 ··· 117 120 - reg 118 121 - clock-output-names 119 122 - "#clock-cells" 120 - - "#phy-cells" 121 123 - host-port 122 124 - otg-port 123 125 ··· 127 131 #include <dt-bindings/clock/rk3399-cru.h> 128 132 #include <dt-bindings/interrupt-controller/arm-gic.h> 129 133 #include <dt-bindings/interrupt-controller/irq.h> 130 - u2phy0: usb2-phy@e450 { 134 + u2phy0: usb2phy@e450 { 131 135 compatible = "rockchip,rk3399-usb2phy"; 132 136 reg = <0xe450 0x10>; 133 137 clocks = <&cru SCLK_USB2PHY0_REF>; 134 138 clock-names = "phyclk"; 135 139 clock-output-names = "clk_usbphy0_480m"; 136 140 #clock-cells = <0>; 137 - #phy-cells = <0>; 138 141 139 142 u2phy0_host: host-port { 140 - #phy-cells = <0>; 141 143 interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH 0>; 142 144 interrupt-names = "linestate"; 145 + #phy-cells = <0>; 143 146 }; 144 147 145 148 u2phy0_otg: otg-port { 146 - #phy-cells = <0>; 147 149 interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH 0>, 148 150 <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH 0>, 149 151 <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH 0>; 150 152 interrupt-names = "otg-bvalid", "otg-id", "linestate"; 153 + #phy-cells = <0>; 151 154 }; 152 155 };
+3
Documentation/devicetree/bindings/power/fsl,imx-gpcv2.yaml
··· 25 25 compatible: 26 26 enum: 27 27 - fsl,imx7d-gpc 28 + - fsl,imx8mn-gpc 28 29 - fsl,imx8mq-gpc 30 + - fsl,imx8mm-gpc 29 31 30 32 reg: 31 33 maxItems: 1 ··· 56 54 Power domain index. Valid values are defined in 57 55 include/dt-bindings/power/imx7-power.h for fsl,imx7d-gpc and 58 56 include/dt-bindings/power/imx8m-power.h for fsl,imx8mq-gpc 57 + include/dt-bindings/power/imx8mm-power.h for fsl,imx8mm-gpc 59 58 maxItems: 1 60 59 61 60 clocks:
+2
Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
··· 16 16 properties: 17 17 compatible: 18 18 enum: 19 + - qcom,mdm9607-rpmpd 19 20 - qcom,msm8916-rpmpd 20 21 - qcom,msm8939-rpmpd 21 22 - qcom,msm8976-rpmpd ··· 27 26 - qcom,sdm660-rpmpd 28 27 - qcom,sc7180-rpmhpd 29 28 - qcom,sc7280-rpmhpd 29 + - qcom,sc8180x-rpmhpd 30 30 - qcom,sdm845-rpmhpd 31 31 - qcom,sdx55-rpmhpd 32 32 - qcom,sm8150-rpmhpd
+248
Documentation/devicetree/bindings/power/rockchip,power-controller.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/power/rockchip,power-controller.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Rockchip Power Domains 8 + 9 + maintainers: 10 + - Elaine Zhang <zhangqing@rock-chips.com> 11 + - Heiko Stuebner <heiko@sntech.de> 12 + 13 + description: | 14 + Rockchip processors include support for multiple power domains 15 + which can be powered up/down by software based on different 16 + application scenarios to save power. 17 + 18 + Power domains contained within power-controller node are 19 + generic power domain providers documented in 20 + Documentation/devicetree/bindings/power/power-domain.yaml. 21 + 22 + IP cores belonging to a power domain should contain a 23 + "power-domains" property that is a phandle for the 24 + power domain node representing the domain. 25 + 26 + properties: 27 + $nodename: 28 + const: power-controller 29 + 30 + compatible: 31 + enum: 32 + - rockchip,px30-power-controller 33 + - rockchip,rk3036-power-controller 34 + - rockchip,rk3066-power-controller 35 + - rockchip,rk3128-power-controller 36 + - rockchip,rk3188-power-controller 37 + - rockchip,rk3228-power-controller 38 + - rockchip,rk3288-power-controller 39 + - rockchip,rk3328-power-controller 40 + - rockchip,rk3366-power-controller 41 + - rockchip,rk3368-power-controller 42 + - rockchip,rk3399-power-controller 43 + - rockchip,rk3568-power-controller 44 + 45 + "#power-domain-cells": 46 + const: 1 47 + 48 + "#address-cells": 49 + const: 1 50 + 51 + "#size-cells": 52 + const: 0 53 + 54 + required: 55 + - compatible 56 + - "#power-domain-cells" 57 + 58 + additionalProperties: false 59 + 60 + patternProperties: 61 + "^power-domain@[0-9a-f]+$": 62 + 63 + $ref: "#/$defs/pd-node" 64 + 65 + unevaluatedProperties: false 66 + 67 + properties: 68 + "#address-cells": 69 + const: 1 70 + 71 + "#size-cells": 72 + const: 0 73 + 74 + patternProperties: 75 + "^power-domain@[0-9a-f]+$": 76 + 77 + $ref: "#/$defs/pd-node" 78 + 79 + unevaluatedProperties: false 80 + 81 + properties: 82 + "#address-cells": 83 + const: 1 84 + 85 + "#size-cells": 86 + const: 0 87 + 88 + patternProperties: 89 + "^power-domain@[0-9a-f]+$": 90 + 91 + $ref: "#/$defs/pd-node" 92 + 93 + unevaluatedProperties: false 94 + 95 + properties: 96 + "#power-domain-cells": 97 + const: 0 98 + 99 + $defs: 100 + pd-node: 101 + type: object 102 + description: | 103 + Represents the power domains within the power controller node. 104 + 105 + properties: 106 + reg: 107 + maxItems: 1 108 + description: | 109 + Power domain index. Valid values are defined in 110 + "include/dt-bindings/power/px30-power.h" 111 + "include/dt-bindings/power/rk3036-power.h" 112 + "include/dt-bindings/power/rk3066-power.h" 113 + "include/dt-bindings/power/rk3128-power.h" 114 + "include/dt-bindings/power/rk3188-power.h" 115 + "include/dt-bindings/power/rk3228-power.h" 116 + "include/dt-bindings/power/rk3288-power.h" 117 + "include/dt-bindings/power/rk3328-power.h" 118 + "include/dt-bindings/power/rk3366-power.h" 119 + "include/dt-bindings/power/rk3368-power.h" 120 + "include/dt-bindings/power/rk3399-power.h" 121 + "include/dt-bindings/power/rk3568-power.h" 122 + 123 + clocks: 124 + minItems: 1 125 + maxItems: 30 126 + description: | 127 + A number of phandles to clocks that need to be enabled 128 + while power domain switches state. 129 + 130 + pm_qos: 131 + $ref: /schemas/types.yaml#/definitions/phandle-array 132 + description: | 133 + A number of phandles to qos blocks which need to be saved and restored 134 + while power domain switches state. 135 + 136 + "#power-domain-cells": 137 + enum: [0, 1] 138 + description: 139 + Must be 0 for nodes representing a single PM domain and 1 for nodes 140 + providing multiple PM domains. 141 + 142 + required: 143 + - reg 144 + - "#power-domain-cells" 145 + 146 + examples: 147 + - | 148 + #include <dt-bindings/clock/rk3399-cru.h> 149 + #include <dt-bindings/power/rk3399-power.h> 150 + 151 + soc { 152 + #address-cells = <2>; 153 + #size-cells = <2>; 154 + 155 + qos_hdcp: qos@ffa90000 { 156 + compatible = "rockchip,rk3399-qos", "syscon"; 157 + reg = <0x0 0xffa90000 0x0 0x20>; 158 + }; 159 + 160 + qos_iep: qos@ffa98000 { 161 + compatible = "rockchip,rk3399-qos", "syscon"; 162 + reg = <0x0 0xffa98000 0x0 0x20>; 163 + }; 164 + 165 + qos_rga_r: qos@ffab0000 { 166 + compatible = "rockchip,rk3399-qos", "syscon"; 167 + reg = <0x0 0xffab0000 0x0 0x20>; 168 + }; 169 + 170 + qos_rga_w: qos@ffab0080 { 171 + compatible = "rockchip,rk3399-qos", "syscon"; 172 + reg = <0x0 0xffab0080 0x0 0x20>; 173 + }; 174 + 175 + qos_video_m0: qos@ffab8000 { 176 + compatible = "rockchip,rk3399-qos", "syscon"; 177 + reg = <0x0 0xffab8000 0x0 0x20>; 178 + }; 179 + 180 + qos_video_m1_r: qos@ffac0000 { 181 + compatible = "rockchip,rk3399-qos", "syscon"; 182 + reg = <0x0 0xffac0000 0x0 0x20>; 183 + }; 184 + 185 + qos_video_m1_w: qos@ffac0080 { 186 + compatible = "rockchip,rk3399-qos", "syscon"; 187 + reg = <0x0 0xffac0080 0x0 0x20>; 188 + }; 189 + 190 + power-management@ff310000 { 191 + compatible = "rockchip,rk3399-pmu", "syscon", "simple-mfd"; 192 + reg = <0x0 0xff310000 0x0 0x1000>; 193 + 194 + power-controller { 195 + compatible = "rockchip,rk3399-power-controller"; 196 + #power-domain-cells = <1>; 197 + #address-cells = <1>; 198 + #size-cells = <0>; 199 + 200 + /* These power domains are grouped by VD_CENTER */ 201 + power-domain@RK3399_PD_IEP { 202 + reg = <RK3399_PD_IEP>; 203 + clocks = <&cru ACLK_IEP>, 204 + <&cru HCLK_IEP>; 205 + pm_qos = <&qos_iep>; 206 + #power-domain-cells = <0>; 207 + }; 208 + power-domain@RK3399_PD_RGA { 209 + reg = <RK3399_PD_RGA>; 210 + clocks = <&cru ACLK_RGA>, 211 + <&cru HCLK_RGA>; 212 + pm_qos = <&qos_rga_r>, 213 + <&qos_rga_w>; 214 + #power-domain-cells = <0>; 215 + }; 216 + power-domain@RK3399_PD_VCODEC { 217 + reg = <RK3399_PD_VCODEC>; 218 + clocks = <&cru ACLK_VCODEC>, 219 + <&cru HCLK_VCODEC>; 220 + pm_qos = <&qos_video_m0>; 221 + #power-domain-cells = <0>; 222 + }; 223 + power-domain@RK3399_PD_VDU { 224 + reg = <RK3399_PD_VDU>; 225 + clocks = <&cru ACLK_VDU>, 226 + <&cru HCLK_VDU>; 227 + pm_qos = <&qos_video_m1_r>, 228 + <&qos_video_m1_w>; 229 + #power-domain-cells = <0>; 230 + }; 231 + power-domain@RK3399_PD_VIO { 232 + reg = <RK3399_PD_VIO>; 233 + #power-domain-cells = <1>; 234 + #address-cells = <1>; 235 + #size-cells = <0>; 236 + 237 + power-domain@RK3399_PD_HDCP { 238 + reg = <RK3399_PD_HDCP>; 239 + clocks = <&cru ACLK_HDCP>, 240 + <&cru HCLK_HDCP>, 241 + <&cru PCLK_HDCP>; 242 + pm_qos = <&qos_hdcp>; 243 + #power-domain-cells = <0>; 244 + }; 245 + }; 246 + }; 247 + }; 248 + };
+58
Documentation/devicetree/bindings/reset/microchip,rst.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: "http://devicetree.org/schemas/reset/microchip,rst.yaml#" 5 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 6 + 7 + title: Microchip Sparx5 Switch Reset Controller 8 + 9 + maintainers: 10 + - Steen Hegelund <steen.hegelund@microchip.com> 11 + - Lars Povlsen <lars.povlsen@microchip.com> 12 + 13 + description: | 14 + The Microchip Sparx5 Switch provides reset control and implements the following 15 + functions 16 + - One Time Switch Core Reset (Soft Reset) 17 + 18 + properties: 19 + $nodename: 20 + pattern: "^reset-controller@[0-9a-f]+$" 21 + 22 + compatible: 23 + const: microchip,sparx5-switch-reset 24 + 25 + reg: 26 + items: 27 + - description: global control block registers 28 + 29 + reg-names: 30 + items: 31 + - const: gcb 32 + 33 + "#reset-cells": 34 + const: 1 35 + 36 + cpu-syscon: 37 + $ref: "/schemas/types.yaml#/definitions/phandle" 38 + description: syscon used to access CPU reset 39 + 40 + required: 41 + - compatible 42 + - reg 43 + - reg-names 44 + - "#reset-cells" 45 + - cpu-syscon 46 + 47 + additionalProperties: false 48 + 49 + examples: 50 + - | 51 + reset: reset-controller@11010008 { 52 + compatible = "microchip,sparx5-switch-reset"; 53 + reg = <0x11010008 0x4>; 54 + reg-names = "gcb"; 55 + #reset-cells = <1>; 56 + cpu-syscon = <&cpu_ctrl>; 57 + }; 58 +
+1
Documentation/devicetree/bindings/soc/mediatek/pwrap.txt
··· 27 27 "mediatek,mt8135-pwrap" for MT8135 SoCs 28 28 "mediatek,mt8173-pwrap" for MT8173 SoCs 29 29 "mediatek,mt8183-pwrap" for MT8183 SoCs 30 + "mediatek,mt8195-pwrap" for MT8195 SoCs 30 31 "mediatek,mt8516-pwrap" for MT8516 SoCs 31 32 - interrupts: IRQ for pwrap in SOC 32 33 - reg-names: Must include the following entries:
+2
Documentation/devicetree/bindings/soc/qcom/qcom,smd-rpm.yaml
··· 32 32 enum: 33 33 - qcom,rpm-apq8084 34 34 - qcom,rpm-ipq6018 35 + - qcom,rpm-msm8226 35 36 - qcom,rpm-msm8916 36 37 - qcom,rpm-msm8974 37 38 - qcom,rpm-msm8976 38 39 - qcom,rpm-msm8996 39 40 - qcom,rpm-msm8998 40 41 - qcom,rpm-sdm660 42 + - qcom,rpm-sm6125 41 43 - qcom,rpm-qcs404 42 44 43 45 qcom,smd-channels:
-61
Documentation/devicetree/bindings/soc/rockchip/grf.txt
··· 1 - * Rockchip General Register Files (GRF) 2 - 3 - The general register file will be used to do static set by software, which 4 - is composed of many registers for system control. 5 - 6 - From RK3368 SoCs, the GRF is divided into two sections, 7 - - GRF, used for general non-secure system, 8 - - SGRF, used for general secure system, 9 - - PMUGRF, used for always on system 10 - 11 - On RK3328 SoCs, the GRF adds a section for USB2PHYGRF, 12 - 13 - ON RK3308 SoC, the GRF is divided into four sections: 14 - - GRF, used for general non-secure system, 15 - - SGRF, used for general secure system, 16 - - DETECTGRF, used for audio codec system, 17 - - COREGRF, used for pvtm, 18 - 19 - Required Properties: 20 - 21 - - compatible: GRF should be one of the following: 22 - - "rockchip,px30-grf", "syscon": for px30 23 - - "rockchip,rk3036-grf", "syscon": for rk3036 24 - - "rockchip,rk3066-grf", "syscon": for rk3066 25 - - "rockchip,rk3188-grf", "syscon": for rk3188 26 - - "rockchip,rk3228-grf", "syscon": for rk3228 27 - - "rockchip,rk3288-grf", "syscon": for rk3288 28 - - "rockchip,rk3308-grf", "syscon": for rk3308 29 - - "rockchip,rk3328-grf", "syscon": for rk3328 30 - - "rockchip,rk3368-grf", "syscon": for rk3368 31 - - "rockchip,rk3399-grf", "syscon": for rk3399 32 - - "rockchip,rv1108-grf", "syscon": for rv1108 33 - - compatible: DETECTGRF should be one of the following: 34 - - "rockchip,rk3308-detect-grf", "syscon": for rk3308 35 - - compatilbe: COREGRF should be one of the following: 36 - - "rockchip,rk3308-core-grf", "syscon": for rk3308 37 - - compatible: PMUGRF should be one of the following: 38 - - "rockchip,px30-pmugrf", "syscon": for px30 39 - - "rockchip,rk3368-pmugrf", "syscon": for rk3368 40 - - "rockchip,rk3399-pmugrf", "syscon": for rk3399 41 - - compatible: SGRF should be one of the following: 42 - - "rockchip,rk3288-sgrf", "syscon": for rk3288 43 - - compatible: USB2PHYGRF should be one of the following: 44 - - "rockchip,px30-usb2phy-grf", "syscon": for px30 45 - - "rockchip,rk3328-usb2phy-grf", "syscon": for rk3328 46 - - compatible: USBGRF should be one of the following: 47 - - "rockchip,rv1108-usbgrf", "syscon": for rv1108 48 - - reg: physical base address of the controller and length of memory mapped 49 - region. 50 - 51 - Example: GRF and PMUGRF of RK3399 SoCs 52 - 53 - pmugrf: syscon@ff320000 { 54 - compatible = "rockchip,rk3399-pmugrf", "syscon"; 55 - reg = <0x0 0xff320000 0x0 0x1000>; 56 - }; 57 - 58 - grf: syscon@ff770000 { 59 - compatible = "rockchip,rk3399-grf", "syscon"; 60 - reg = <0x0 0xff770000 0x0 0x10000>; 61 - };
+261
Documentation/devicetree/bindings/soc/rockchip/grf.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/soc/rockchip/grf.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Rockchip General Register Files (GRF) 8 + 9 + maintainers: 10 + - Heiko Stuebner <heiko@sntech.de> 11 + 12 + properties: 13 + compatible: 14 + oneOf: 15 + - items: 16 + - enum: 17 + - rockchip,rk3288-sgrf 18 + - rockchip,rv1108-pmugrf 19 + - rockchip,rv1108-usbgrf 20 + - const: syscon 21 + - items: 22 + - enum: 23 + - rockchip,px30-grf 24 + - rockchip,px30-pmugrf 25 + - rockchip,px30-usb2phy-grf 26 + - rockchip,rk3036-grf 27 + - rockchip,rk3066-grf 28 + - rockchip,rk3188-grf 29 + - rockchip,rk3228-grf 30 + - rockchip,rk3288-grf 31 + - rockchip,rk3308-core-grf 32 + - rockchip,rk3308-detect-grf 33 + - rockchip,rk3308-grf 34 + - rockchip,rk3308-usb2phy-grf 35 + - rockchip,rk3328-grf 36 + - rockchip,rk3328-usb2phy-grf 37 + - rockchip,rk3368-grf 38 + - rockchip,rk3368-pmugrf 39 + - rockchip,rk3399-grf 40 + - rockchip,rk3399-pmugrf 41 + - rockchip,rk3568-grf 42 + - rockchip,rk3568-pmugrf 43 + - rockchip,rv1108-grf 44 + - const: syscon 45 + - const: simple-mfd 46 + 47 + reg: 48 + maxItems: 1 49 + 50 + "#address-cells": 51 + const: 1 52 + 53 + "#size-cells": 54 + const: 1 55 + 56 + required: 57 + - compatible 58 + - reg 59 + 60 + additionalProperties: 61 + type: object 62 + 63 + allOf: 64 + - if: 65 + properties: 66 + compatible: 67 + contains: 68 + const: rockchip,px30-grf 69 + 70 + then: 71 + properties: 72 + lvds: 73 + description: 74 + Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt 75 + 76 + - if: 77 + properties: 78 + compatible: 79 + contains: 80 + const: rockchip,rk3288-grf 81 + 82 + then: 83 + properties: 84 + edp-phy: 85 + description: 86 + Documentation/devicetree/bindings/phy/rockchip-dp-phy.txt 87 + 88 + - if: 89 + properties: 90 + compatible: 91 + contains: 92 + enum: 93 + - rockchip,rk3066-grf 94 + - rockchip,rk3188-grf 95 + - rockchip,rk3288-grf 96 + 97 + then: 98 + properties: 99 + usbphy: 100 + type: object 101 + 102 + $ref: "/schemas/phy/rockchip-usb-phy.yaml#" 103 + 104 + unevaluatedProperties: false 105 + 106 + - if: 107 + properties: 108 + compatible: 109 + contains: 110 + const: rockchip,rk3328-grf 111 + 112 + then: 113 + properties: 114 + gpio: 115 + type: object 116 + 117 + $ref: "/schemas/gpio/rockchip,rk3328-grf-gpio.yaml#" 118 + 119 + unevaluatedProperties: false 120 + 121 + power-controller: 122 + type: object 123 + 124 + $ref: "/schemas/power/rockchip,power-controller.yaml#" 125 + 126 + unevaluatedProperties: false 127 + 128 + - if: 129 + properties: 130 + compatible: 131 + contains: 132 + const: rockchip,rk3399-grf 133 + 134 + then: 135 + properties: 136 + mipi-dphy-rx0: 137 + type: object 138 + 139 + $ref: "/schemas/phy/rockchip-mipi-dphy-rx0.yaml#" 140 + 141 + unevaluatedProperties: false 142 + 143 + pcie-phy: 144 + description: 145 + Documentation/devicetree/bindings/phy/rockchip-pcie-phy.txt 146 + 147 + patternProperties: 148 + "phy@[0-9a-f]+$": 149 + description: 150 + Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt 151 + 152 + - if: 153 + properties: 154 + compatible: 155 + contains: 156 + enum: 157 + - rockchip,px30-pmugrf 158 + - rockchip,rk3036-grf 159 + - rockchip,rk3308-grf 160 + - rockchip,rk3368-pmugrf 161 + 162 + then: 163 + properties: 164 + reboot-mode: 165 + type: object 166 + 167 + $ref: "/schemas/power/reset/syscon-reboot-mode.yaml#" 168 + 169 + unevaluatedProperties: false 170 + 171 + - if: 172 + properties: 173 + compatible: 174 + contains: 175 + enum: 176 + - rockchip,px30-usb2phy-grf 177 + - rockchip,rk3228-grf 178 + - rockchip,rk3308-usb2phy-grf 179 + - rockchip,rk3328-usb2phy-grf 180 + - rockchip,rk3399-grf 181 + - rockchip,rv1108-grf 182 + 183 + then: 184 + required: 185 + - "#address-cells" 186 + - "#size-cells" 187 + 188 + patternProperties: 189 + "usb2phy@[0-9a-f]+$": 190 + type: object 191 + 192 + $ref: "/schemas/phy/phy-rockchip-inno-usb2.yaml#" 193 + 194 + unevaluatedProperties: false 195 + 196 + - if: 197 + properties: 198 + compatible: 199 + contains: 200 + enum: 201 + - rockchip,px30-pmugrf 202 + - rockchip,px30-grf 203 + - rockchip,rk3228-grf 204 + - rockchip,rk3288-grf 205 + - rockchip,rk3328-grf 206 + - rockchip,rk3368-pmugrf 207 + - rockchip,rk3368-grf 208 + - rockchip,rk3399-pmugrf 209 + - rockchip,rk3399-grf 210 + 211 + then: 212 + properties: 213 + io-domains: 214 + description: 215 + Documentation/devicetree/bindings/power/rockchip-io-domain.txt 216 + 217 + examples: 218 + - | 219 + #include <dt-bindings/clock/rk3399-cru.h> 220 + #include <dt-bindings/interrupt-controller/arm-gic.h> 221 + #include <dt-bindings/power/rk3399-power.h> 222 + grf: syscon@ff770000 { 223 + compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd"; 224 + reg = <0xff770000 0x10000>; 225 + #address-cells = <1>; 226 + #size-cells = <1>; 227 + 228 + mipi_dphy_rx0: mipi-dphy-rx0 { 229 + compatible = "rockchip,rk3399-mipi-dphy-rx0"; 230 + clocks = <&cru SCLK_MIPIDPHY_REF>, 231 + <&cru SCLK_DPHY_RX0_CFG>, 232 + <&cru PCLK_VIO_GRF>; 233 + clock-names = "dphy-ref", "dphy-cfg", "grf"; 234 + power-domains = <&power RK3399_PD_VIO>; 235 + #phy-cells = <0>; 236 + }; 237 + 238 + u2phy0: usb2phy@e450 { 239 + compatible = "rockchip,rk3399-usb2phy"; 240 + reg = <0xe450 0x10>; 241 + clocks = <&cru SCLK_USB2PHY0_REF>; 242 + clock-names = "phyclk"; 243 + #clock-cells = <0>; 244 + clock-output-names = "clk_usbphy0_480m"; 245 + 246 + u2phy0_host: host-port { 247 + #phy-cells = <0>; 248 + interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH 0>; 249 + interrupt-names = "linestate"; 250 + }; 251 + 252 + u2phy0_otg: otg-port { 253 + #phy-cells = <0>; 254 + interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH 0>, 255 + <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH 0>, 256 + <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH 0>; 257 + interrupt-names = "otg-bvalid", "otg-id", 258 + "linestate"; 259 + }; 260 + }; 261 + };
-136
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
··· 1 - * Rockchip Power Domains 2 - 3 - Rockchip processors include support for multiple power domains which can be 4 - powered up/down by software based on different application scenes to save power. 5 - 6 - Required properties for power domain controller: 7 - - compatible: Should be one of the following. 8 - "rockchip,px30-power-controller" - for PX30 SoCs. 9 - "rockchip,rk3036-power-controller" - for RK3036 SoCs. 10 - "rockchip,rk3066-power-controller" - for RK3066 SoCs. 11 - "rockchip,rk3128-power-controller" - for RK3128 SoCs. 12 - "rockchip,rk3188-power-controller" - for RK3188 SoCs. 13 - "rockchip,rk3228-power-controller" - for RK3228 SoCs. 14 - "rockchip,rk3288-power-controller" - for RK3288 SoCs. 15 - "rockchip,rk3328-power-controller" - for RK3328 SoCs. 16 - "rockchip,rk3366-power-controller" - for RK3366 SoCs. 17 - "rockchip,rk3368-power-controller" - for RK3368 SoCs. 18 - "rockchip,rk3399-power-controller" - for RK3399 SoCs. 19 - - #power-domain-cells: Number of cells in a power-domain specifier. 20 - Should be 1 for multiple PM domains. 21 - - #address-cells: Should be 1. 22 - - #size-cells: Should be 0. 23 - 24 - Required properties for power domain sub nodes: 25 - - reg: index of the power domain, should use macros in: 26 - "include/dt-bindings/power/px30-power.h" - for PX30 type power domain. 27 - "include/dt-bindings/power/rk3036-power.h" - for RK3036 type power domain. 28 - "include/dt-bindings/power/rk3066-power.h" - for RK3066 type power domain. 29 - "include/dt-bindings/power/rk3128-power.h" - for RK3128 type power domain. 30 - "include/dt-bindings/power/rk3188-power.h" - for RK3188 type power domain. 31 - "include/dt-bindings/power/rk3228-power.h" - for RK3228 type power domain. 32 - "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. 33 - "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain. 34 - "include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain. 35 - "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. 36 - "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. 37 - - clocks (optional): phandles to clocks which need to be enabled while power domain 38 - switches state. 39 - - pm_qos (optional): phandles to qos blocks which need to be saved and restored 40 - while power domain switches state. 41 - 42 - Qos Example: 43 - 44 - qos_gpu: qos_gpu@ffaf0000 { 45 - compatible ="syscon"; 46 - reg = <0x0 0xffaf0000 0x0 0x20>; 47 - }; 48 - 49 - Example: 50 - 51 - power: power-controller { 52 - compatible = "rockchip,rk3288-power-controller"; 53 - #power-domain-cells = <1>; 54 - #address-cells = <1>; 55 - #size-cells = <0>; 56 - 57 - pd_gpu { 58 - reg = <RK3288_PD_GPU>; 59 - clocks = <&cru ACLK_GPU>; 60 - pm_qos = <&qos_gpu>; 61 - }; 62 - }; 63 - 64 - power: power-controller { 65 - compatible = "rockchip,rk3368-power-controller"; 66 - #power-domain-cells = <1>; 67 - #address-cells = <1>; 68 - #size-cells = <0>; 69 - 70 - pd_gpu_1 { 71 - reg = <RK3368_PD_GPU_1>; 72 - clocks = <&cru ACLK_GPU_CFG>; 73 - }; 74 - }; 75 - 76 - Example 2: 77 - power: power-controller { 78 - compatible = "rockchip,rk3399-power-controller"; 79 - #power-domain-cells = <1>; 80 - #address-cells = <1>; 81 - #size-cells = <0>; 82 - 83 - pd_vio { 84 - #address-cells = <1>; 85 - #size-cells = <0>; 86 - reg = <RK3399_PD_VIO>; 87 - 88 - pd_vo { 89 - #address-cells = <1>; 90 - #size-cells = <0>; 91 - reg = <RK3399_PD_VO>; 92 - 93 - pd_vopb { 94 - reg = <RK3399_PD_VOPB>; 95 - }; 96 - 97 - pd_vopl { 98 - reg = <RK3399_PD_VOPL>; 99 - }; 100 - }; 101 - }; 102 - }; 103 - 104 - Node of a device using power domains must have a power-domains property, 105 - containing a phandle to the power device node and an index specifying which 106 - power domain to use. 107 - The index should use macros in: 108 - "include/dt-bindings/power/px30-power.h" - for px30 type power domain. 109 - "include/dt-bindings/power/rk3036-power.h" - for rk3036 type power domain. 110 - "include/dt-bindings/power/rk3128-power.h" - for rk3128 type power domain. 111 - "include/dt-bindings/power/rk3128-power.h" - for rk3228 type power domain. 112 - "include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain. 113 - "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain. 114 - "include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain. 115 - "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. 116 - "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. 117 - 118 - Example of the node using power domain: 119 - 120 - node { 121 - /* ... */ 122 - power-domains = <&power RK3288_PD_GPU>; 123 - /* ... */ 124 - }; 125 - 126 - node { 127 - /* ... */ 128 - power-domains = <&power RK3368_PD_GPU_1>; 129 - /* ... */ 130 - }; 131 - 132 - node { 133 - /* ... */ 134 - power-domains = <&power RK3399_PD_VOPB>; 135 - /* ... */ 136 - };
+8
MAINTAINERS
··· 7182 7182 F: include/uapi/linux/firewire*.h 7183 7183 F: tools/firewire/ 7184 7184 7185 + FIRMWARE FRAMEWORK FOR ARMV8-A 7186 + M: Sudeep Holla <sudeep.holla@arm.com> 7187 + L: linux-arm-kernel@lists.infradead.org 7188 + S: Maintained 7189 + F: drivers/firmware/arm_ffa/ 7190 + F: include/linux/arm_ffa.h 7191 + 7185 7192 FIRMWARE LOADER (request_firmware) 7186 7193 M: Luis Chamberlain <mcgrof@kernel.org> 7187 7194 L: linux-kernel@vger.kernel.org ··· 11954 11947 F: Documentation/devicetree/bindings/memory-controllers/ 11955 11948 F: drivers/memory/ 11956 11949 F: include/dt-bindings/memory/ 11950 + F: include/memory/ 11957 11951 11958 11952 MEMORY FREQUENCY SCALING DRIVERS FOR NVIDIA TEGRA 11959 11953 M: Dmitry Osipenko <digetx@gmail.com>
+2 -2
drivers/bus/qcom-ebi2.c
··· 102 102 /** 103 103 * struct cs_data - struct with info on a chipselect setting 104 104 * @enable_mask: mask to enable the chipselect in the EBI2 config 105 - * @slow_cfg0: offset to XMEMC slow CS config 106 - * @fast_cfg1: offset to XMEMC fast CS config 105 + * @slow_cfg: offset to XMEMC slow CS config 106 + * @fast_cfg: offset to XMEMC fast CS config 107 107 */ 108 108 struct cs_data { 109 109 u32 enable_mask;
+2 -1
drivers/firmware/Kconfig
··· 9 9 config ARM_SCMI_PROTOCOL 10 10 tristate "ARM System Control and Management Interface (SCMI) Message Protocol" 11 11 depends on ARM || ARM64 || COMPILE_TEST 12 - depends on MAILBOX 12 + depends on MAILBOX || HAVE_ARM_SMCCC_DISCOVERY 13 13 help 14 14 ARM System Control and Management Interface (SCMI) protocol is a 15 15 set of operating system-independent software interfaces that are ··· 296 296 other manufacturing data and also utilize the Entropy Bit Generator 297 297 for hardware random number generation. 298 298 299 + source "drivers/firmware/arm_ffa/Kconfig" 299 300 source "drivers/firmware/broadcom/Kconfig" 300 301 source "drivers/firmware/google/Kconfig" 301 302 source "drivers/firmware/efi/Kconfig"
+1
drivers/firmware/Makefile
··· 22 22 obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o 23 23 obj-$(CONFIG_TURRIS_MOX_RWTM) += turris-mox-rwtm.o 24 24 25 + obj-y += arm_ffa/ 25 26 obj-y += arm_scmi/ 26 27 obj-y += broadcom/ 27 28 obj-y += meson/
+21
drivers/firmware/arm_ffa/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + config ARM_FFA_TRANSPORT 3 + tristate "Arm Firmware Framework for Armv8-A" 4 + depends on OF 5 + depends on ARM64 6 + default n 7 + help 8 + This Firmware Framework(FF) for Arm A-profile processors describes 9 + interfaces that standardize communication between the various 10 + software images which includes communication between images in 11 + the Secure world and Normal world. It also leverages the 12 + virtualization extension to isolate software images provided 13 + by an ecosystem of vendors from each other. 14 + 15 + This driver provides interface for all the client drivers making 16 + use of the features offered by ARM FF-A. 17 + 18 + config ARM_FFA_SMCCC 19 + bool 20 + default ARM_FFA_TRANSPORT 21 + depends on ARM64 && HAVE_ARM_SMCCC_DISCOVERY
+6
drivers/firmware/arm_ffa/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + ffa-bus-y = bus.o 3 + ffa-driver-y = driver.o 4 + ffa-transport-$(CONFIG_ARM_FFA_SMCCC) += smccc.o 5 + ffa-module-objs := $(ffa-bus-y) $(ffa-driver-y) $(ffa-transport-y) 6 + obj-$(CONFIG_ARM_FFA_TRANSPORT) = ffa-module.o
+210
drivers/firmware/arm_ffa/bus.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2021 ARM Ltd. 4 + */ 5 + 6 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 7 + 8 + #include <linux/arm_ffa.h> 9 + #include <linux/device.h> 10 + #include <linux/fs.h> 11 + #include <linux/kernel.h> 12 + #include <linux/module.h> 13 + #include <linux/slab.h> 14 + #include <linux/types.h> 15 + 16 + #include "common.h" 17 + 18 + static int ffa_device_match(struct device *dev, struct device_driver *drv) 19 + { 20 + const struct ffa_device_id *id_table; 21 + struct ffa_device *ffa_dev; 22 + 23 + id_table = to_ffa_driver(drv)->id_table; 24 + ffa_dev = to_ffa_dev(dev); 25 + 26 + while (!uuid_is_null(&id_table->uuid)) { 27 + /* 28 + * FF-A v1.0 doesn't provide discovery of UUIDs, just the 29 + * partition IDs, so fetch the partitions IDs for this 30 + * id_table UUID and assign the UUID to the device if the 31 + * partition ID matches 32 + */ 33 + if (uuid_is_null(&ffa_dev->uuid)) 34 + ffa_device_match_uuid(ffa_dev, &id_table->uuid); 35 + 36 + if (uuid_equal(&ffa_dev->uuid, &id_table->uuid)) 37 + return 1; 38 + id_table++; 39 + } 40 + 41 + return 0; 42 + } 43 + 44 + static int ffa_device_probe(struct device *dev) 45 + { 46 + struct ffa_driver *ffa_drv = to_ffa_driver(dev->driver); 47 + struct ffa_device *ffa_dev = to_ffa_dev(dev); 48 + 49 + if (!ffa_device_match(dev, dev->driver)) 50 + return -ENODEV; 51 + 52 + return ffa_drv->probe(ffa_dev); 53 + } 54 + 55 + static int ffa_device_uevent(struct device *dev, struct kobj_uevent_env *env) 56 + { 57 + struct ffa_device *ffa_dev = to_ffa_dev(dev); 58 + 59 + return add_uevent_var(env, "MODALIAS=arm_ffa:%04x:%pUb", 60 + ffa_dev->vm_id, &ffa_dev->uuid); 61 + } 62 + 63 + static ssize_t partition_id_show(struct device *dev, 64 + struct device_attribute *attr, char *buf) 65 + { 66 + struct ffa_device *ffa_dev = to_ffa_dev(dev); 67 + 68 + return sprintf(buf, "0x%04x\n", ffa_dev->vm_id); 69 + } 70 + static DEVICE_ATTR_RO(partition_id); 71 + 72 + static ssize_t uuid_show(struct device *dev, struct device_attribute *attr, 73 + char *buf) 74 + { 75 + struct ffa_device *ffa_dev = to_ffa_dev(dev); 76 + 77 + return sprintf(buf, "%pUb\n", &ffa_dev->uuid); 78 + } 79 + static DEVICE_ATTR_RO(uuid); 80 + 81 + static struct attribute *ffa_device_attributes_attrs[] = { 82 + &dev_attr_partition_id.attr, 83 + &dev_attr_uuid.attr, 84 + NULL, 85 + }; 86 + ATTRIBUTE_GROUPS(ffa_device_attributes); 87 + 88 + struct bus_type ffa_bus_type = { 89 + .name = "arm_ffa", 90 + .match = ffa_device_match, 91 + .probe = ffa_device_probe, 92 + .uevent = ffa_device_uevent, 93 + .dev_groups = ffa_device_attributes_groups, 94 + }; 95 + EXPORT_SYMBOL_GPL(ffa_bus_type); 96 + 97 + int ffa_driver_register(struct ffa_driver *driver, struct module *owner, 98 + const char *mod_name) 99 + { 100 + int ret; 101 + 102 + driver->driver.bus = &ffa_bus_type; 103 + driver->driver.name = driver->name; 104 + driver->driver.owner = owner; 105 + driver->driver.mod_name = mod_name; 106 + 107 + ret = driver_register(&driver->driver); 108 + if (!ret) 109 + pr_debug("registered new ffa driver %s\n", driver->name); 110 + 111 + return ret; 112 + } 113 + EXPORT_SYMBOL_GPL(ffa_driver_register); 114 + 115 + void ffa_driver_unregister(struct ffa_driver *driver) 116 + { 117 + driver_unregister(&driver->driver); 118 + } 119 + EXPORT_SYMBOL_GPL(ffa_driver_unregister); 120 + 121 + static void ffa_release_device(struct device *dev) 122 + { 123 + struct ffa_device *ffa_dev = to_ffa_dev(dev); 124 + 125 + kfree(ffa_dev); 126 + } 127 + 128 + static int __ffa_devices_unregister(struct device *dev, void *data) 129 + { 130 + ffa_release_device(dev); 131 + 132 + return 0; 133 + } 134 + 135 + static void ffa_devices_unregister(void) 136 + { 137 + bus_for_each_dev(&ffa_bus_type, NULL, NULL, 138 + __ffa_devices_unregister); 139 + } 140 + 141 + bool ffa_device_is_valid(struct ffa_device *ffa_dev) 142 + { 143 + bool valid = false; 144 + struct device *dev = NULL; 145 + struct ffa_device *tmp_dev; 146 + 147 + do { 148 + dev = bus_find_next_device(&ffa_bus_type, dev); 149 + tmp_dev = to_ffa_dev(dev); 150 + if (tmp_dev == ffa_dev) { 151 + valid = true; 152 + break; 153 + } 154 + put_device(dev); 155 + } while (dev); 156 + 157 + put_device(dev); 158 + 159 + return valid; 160 + } 161 + 162 + struct ffa_device *ffa_device_register(const uuid_t *uuid, int vm_id) 163 + { 164 + int ret; 165 + struct device *dev; 166 + struct ffa_device *ffa_dev; 167 + 168 + ffa_dev = kzalloc(sizeof(*ffa_dev), GFP_KERNEL); 169 + if (!ffa_dev) 170 + return NULL; 171 + 172 + dev = &ffa_dev->dev; 173 + dev->bus = &ffa_bus_type; 174 + dev->release = ffa_release_device; 175 + dev_set_name(&ffa_dev->dev, "arm-ffa-%04x", vm_id); 176 + 177 + ffa_dev->vm_id = vm_id; 178 + uuid_copy(&ffa_dev->uuid, uuid); 179 + 180 + ret = device_register(&ffa_dev->dev); 181 + if (ret) { 182 + dev_err(dev, "unable to register device %s err=%d\n", 183 + dev_name(dev), ret); 184 + put_device(dev); 185 + return NULL; 186 + } 187 + 188 + return ffa_dev; 189 + } 190 + EXPORT_SYMBOL_GPL(ffa_device_register); 191 + 192 + void ffa_device_unregister(struct ffa_device *ffa_dev) 193 + { 194 + if (!ffa_dev) 195 + return; 196 + 197 + device_unregister(&ffa_dev->dev); 198 + } 199 + EXPORT_SYMBOL_GPL(ffa_device_unregister); 200 + 201 + int arm_ffa_bus_init(void) 202 + { 203 + return bus_register(&ffa_bus_type); 204 + } 205 + 206 + void arm_ffa_bus_exit(void) 207 + { 208 + ffa_devices_unregister(); 209 + bus_unregister(&ffa_bus_type); 210 + }
+31
drivers/firmware/arm_ffa/common.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (C) 2021 ARM Ltd. 4 + */ 5 + 6 + #ifndef _FFA_COMMON_H 7 + #define _FFA_COMMON_H 8 + 9 + #include <linux/arm_ffa.h> 10 + #include <linux/arm-smccc.h> 11 + #include <linux/err.h> 12 + 13 + typedef struct arm_smccc_1_2_regs ffa_value_t; 14 + 15 + typedef void (ffa_fn)(ffa_value_t, ffa_value_t *); 16 + 17 + int arm_ffa_bus_init(void); 18 + void arm_ffa_bus_exit(void); 19 + bool ffa_device_is_valid(struct ffa_device *ffa_dev); 20 + void ffa_device_match_uuid(struct ffa_device *ffa_dev, const uuid_t *uuid); 21 + 22 + #ifdef CONFIG_ARM_FFA_SMCCC 23 + int __init ffa_transport_init(ffa_fn **invoke_ffa_fn); 24 + #else 25 + static inline int __init ffa_transport_init(ffa_fn **invoke_ffa_fn) 26 + { 27 + return -EOPNOTSUPP; 28 + } 29 + #endif 30 + 31 + #endif /* _FFA_COMMON_H */
+731
drivers/firmware/arm_ffa/driver.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Arm Firmware Framework for ARMv8-A(FFA) interface driver 4 + * 5 + * The Arm FFA specification[1] describes a software architecture to 6 + * leverages the virtualization extension to isolate software images 7 + * provided by an ecosystem of vendors from each other and describes 8 + * interfaces that standardize communication between the various software 9 + * images including communication between images in the Secure world and 10 + * Normal world. Any Hypervisor could use the FFA interfaces to enable 11 + * communication between VMs it manages. 12 + * 13 + * The Hypervisor a.k.a Partition managers in FFA terminology can assign 14 + * system resources(Memory regions, Devices, CPU cycles) to the partitions 15 + * and manage isolation amongst them. 16 + * 17 + * [1] https://developer.arm.com/docs/den0077/latest 18 + * 19 + * Copyright (C) 2021 ARM Ltd. 20 + */ 21 + 22 + #define DRIVER_NAME "ARM FF-A" 23 + #define pr_fmt(fmt) DRIVER_NAME ": " fmt 24 + 25 + #include <linux/arm_ffa.h> 26 + #include <linux/bitfield.h> 27 + #include <linux/device.h> 28 + #include <linux/io.h> 29 + #include <linux/kernel.h> 30 + #include <linux/module.h> 31 + #include <linux/mm.h> 32 + #include <linux/scatterlist.h> 33 + #include <linux/slab.h> 34 + #include <linux/uuid.h> 35 + 36 + #include "common.h" 37 + 38 + #define FFA_DRIVER_VERSION FFA_VERSION_1_0 39 + 40 + #define FFA_SMC(calling_convention, func_num) \ 41 + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, (calling_convention), \ 42 + ARM_SMCCC_OWNER_STANDARD, (func_num)) 43 + 44 + #define FFA_SMC_32(func_num) FFA_SMC(ARM_SMCCC_SMC_32, (func_num)) 45 + #define FFA_SMC_64(func_num) FFA_SMC(ARM_SMCCC_SMC_64, (func_num)) 46 + 47 + #define FFA_ERROR FFA_SMC_32(0x60) 48 + #define FFA_SUCCESS FFA_SMC_32(0x61) 49 + #define FFA_INTERRUPT FFA_SMC_32(0x62) 50 + #define FFA_VERSION FFA_SMC_32(0x63) 51 + #define FFA_FEATURES FFA_SMC_32(0x64) 52 + #define FFA_RX_RELEASE FFA_SMC_32(0x65) 53 + #define FFA_RXTX_MAP FFA_SMC_32(0x66) 54 + #define FFA_FN64_RXTX_MAP FFA_SMC_64(0x66) 55 + #define FFA_RXTX_UNMAP FFA_SMC_32(0x67) 56 + #define FFA_PARTITION_INFO_GET FFA_SMC_32(0x68) 57 + #define FFA_ID_GET FFA_SMC_32(0x69) 58 + #define FFA_MSG_POLL FFA_SMC_32(0x6A) 59 + #define FFA_MSG_WAIT FFA_SMC_32(0x6B) 60 + #define FFA_YIELD FFA_SMC_32(0x6C) 61 + #define FFA_RUN FFA_SMC_32(0x6D) 62 + #define FFA_MSG_SEND FFA_SMC_32(0x6E) 63 + #define FFA_MSG_SEND_DIRECT_REQ FFA_SMC_32(0x6F) 64 + #define FFA_FN64_MSG_SEND_DIRECT_REQ FFA_SMC_64(0x6F) 65 + #define FFA_MSG_SEND_DIRECT_RESP FFA_SMC_32(0x70) 66 + #define FFA_FN64_MSG_SEND_DIRECT_RESP FFA_SMC_64(0x70) 67 + #define FFA_MEM_DONATE FFA_SMC_32(0x71) 68 + #define FFA_FN64_MEM_DONATE FFA_SMC_64(0x71) 69 + #define FFA_MEM_LEND FFA_SMC_32(0x72) 70 + #define FFA_FN64_MEM_LEND FFA_SMC_64(0x72) 71 + #define FFA_MEM_SHARE FFA_SMC_32(0x73) 72 + #define FFA_FN64_MEM_SHARE FFA_SMC_64(0x73) 73 + #define FFA_MEM_RETRIEVE_REQ FFA_SMC_32(0x74) 74 + #define FFA_FN64_MEM_RETRIEVE_REQ FFA_SMC_64(0x74) 75 + #define FFA_MEM_RETRIEVE_RESP FFA_SMC_32(0x75) 76 + #define FFA_MEM_RELINQUISH FFA_SMC_32(0x76) 77 + #define FFA_MEM_RECLAIM FFA_SMC_32(0x77) 78 + #define FFA_MEM_OP_PAUSE FFA_SMC_32(0x78) 79 + #define FFA_MEM_OP_RESUME FFA_SMC_32(0x79) 80 + #define FFA_MEM_FRAG_RX FFA_SMC_32(0x7A) 81 + #define FFA_MEM_FRAG_TX FFA_SMC_32(0x7B) 82 + #define FFA_NORMAL_WORLD_RESUME FFA_SMC_32(0x7C) 83 + 84 + /* 85 + * For some calls it is necessary to use SMC64 to pass or return 64-bit values. 86 + * For such calls FFA_FN_NATIVE(name) will choose the appropriate 87 + * (native-width) function ID. 88 + */ 89 + #ifdef CONFIG_64BIT 90 + #define FFA_FN_NATIVE(name) FFA_FN64_##name 91 + #else 92 + #define FFA_FN_NATIVE(name) FFA_##name 93 + #endif 94 + 95 + /* FFA error codes. */ 96 + #define FFA_RET_SUCCESS (0) 97 + #define FFA_RET_NOT_SUPPORTED (-1) 98 + #define FFA_RET_INVALID_PARAMETERS (-2) 99 + #define FFA_RET_NO_MEMORY (-3) 100 + #define FFA_RET_BUSY (-4) 101 + #define FFA_RET_INTERRUPTED (-5) 102 + #define FFA_RET_DENIED (-6) 103 + #define FFA_RET_RETRY (-7) 104 + #define FFA_RET_ABORTED (-8) 105 + 106 + #define MAJOR_VERSION_MASK GENMASK(30, 16) 107 + #define MINOR_VERSION_MASK GENMASK(15, 0) 108 + #define MAJOR_VERSION(x) ((u16)(FIELD_GET(MAJOR_VERSION_MASK, (x)))) 109 + #define MINOR_VERSION(x) ((u16)(FIELD_GET(MINOR_VERSION_MASK, (x)))) 110 + #define PACK_VERSION_INFO(major, minor) \ 111 + (FIELD_PREP(MAJOR_VERSION_MASK, (major)) | \ 112 + FIELD_PREP(MINOR_VERSION_MASK, (minor))) 113 + #define FFA_VERSION_1_0 PACK_VERSION_INFO(1, 0) 114 + #define FFA_MIN_VERSION FFA_VERSION_1_0 115 + 116 + #define SENDER_ID_MASK GENMASK(31, 16) 117 + #define RECEIVER_ID_MASK GENMASK(15, 0) 118 + #define SENDER_ID(x) ((u16)(FIELD_GET(SENDER_ID_MASK, (x)))) 119 + #define RECEIVER_ID(x) ((u16)(FIELD_GET(RECEIVER_ID_MASK, (x)))) 120 + #define PACK_TARGET_INFO(s, r) \ 121 + (FIELD_PREP(SENDER_ID_MASK, (s)) | FIELD_PREP(RECEIVER_ID_MASK, (r))) 122 + 123 + /** 124 + * FF-A specification mentions explicitly about '4K pages'. This should 125 + * not be confused with the kernel PAGE_SIZE, which is the translation 126 + * granule kernel is configured and may be one among 4K, 16K and 64K. 127 + */ 128 + #define FFA_PAGE_SIZE SZ_4K 129 + /* 130 + * Keeping RX TX buffer size as 4K for now 131 + * 64K may be preferred to keep it min a page in 64K PAGE_SIZE config 132 + */ 133 + #define RXTX_BUFFER_SIZE SZ_4K 134 + 135 + static ffa_fn *invoke_ffa_fn; 136 + 137 + static const int ffa_linux_errmap[] = { 138 + /* better than switch case as long as return value is continuous */ 139 + 0, /* FFA_RET_SUCCESS */ 140 + -EOPNOTSUPP, /* FFA_RET_NOT_SUPPORTED */ 141 + -EINVAL, /* FFA_RET_INVALID_PARAMETERS */ 142 + -ENOMEM, /* FFA_RET_NO_MEMORY */ 143 + -EBUSY, /* FFA_RET_BUSY */ 144 + -EINTR, /* FFA_RET_INTERRUPTED */ 145 + -EACCES, /* FFA_RET_DENIED */ 146 + -EAGAIN, /* FFA_RET_RETRY */ 147 + -ECANCELED, /* FFA_RET_ABORTED */ 148 + }; 149 + 150 + static inline int ffa_to_linux_errno(int errno) 151 + { 152 + if (errno < FFA_RET_SUCCESS && errno >= -ARRAY_SIZE(ffa_linux_errmap)) 153 + return ffa_linux_errmap[-errno]; 154 + return -EINVAL; 155 + } 156 + 157 + struct ffa_drv_info { 158 + u32 version; 159 + u16 vm_id; 160 + struct mutex rx_lock; /* lock to protect Rx buffer */ 161 + struct mutex tx_lock; /* lock to protect Tx buffer */ 162 + void *rx_buffer; 163 + void *tx_buffer; 164 + }; 165 + 166 + static struct ffa_drv_info *drv_info; 167 + 168 + static int ffa_version_check(u32 *version) 169 + { 170 + ffa_value_t ver; 171 + 172 + invoke_ffa_fn((ffa_value_t){ 173 + .a0 = FFA_VERSION, .a1 = FFA_DRIVER_VERSION, 174 + }, &ver); 175 + 176 + if (ver.a0 == FFA_RET_NOT_SUPPORTED) { 177 + pr_info("FFA_VERSION returned not supported\n"); 178 + return -EOPNOTSUPP; 179 + } 180 + 181 + if (ver.a0 < FFA_MIN_VERSION || ver.a0 > FFA_DRIVER_VERSION) { 182 + pr_err("Incompatible version %d.%d found\n", 183 + MAJOR_VERSION(ver.a0), MINOR_VERSION(ver.a0)); 184 + return -EINVAL; 185 + } 186 + 187 + *version = ver.a0; 188 + pr_info("Version %d.%d found\n", MAJOR_VERSION(ver.a0), 189 + MINOR_VERSION(ver.a0)); 190 + return 0; 191 + } 192 + 193 + static int ffa_rx_release(void) 194 + { 195 + ffa_value_t ret; 196 + 197 + invoke_ffa_fn((ffa_value_t){ 198 + .a0 = FFA_RX_RELEASE, 199 + }, &ret); 200 + 201 + if (ret.a0 == FFA_ERROR) 202 + return ffa_to_linux_errno((int)ret.a2); 203 + 204 + /* check for ret.a0 == FFA_RX_RELEASE ? */ 205 + 206 + return 0; 207 + } 208 + 209 + static int ffa_rxtx_map(phys_addr_t tx_buf, phys_addr_t rx_buf, u32 pg_cnt) 210 + { 211 + ffa_value_t ret; 212 + 213 + invoke_ffa_fn((ffa_value_t){ 214 + .a0 = FFA_FN_NATIVE(RXTX_MAP), 215 + .a1 = tx_buf, .a2 = rx_buf, .a3 = pg_cnt, 216 + }, &ret); 217 + 218 + if (ret.a0 == FFA_ERROR) 219 + return ffa_to_linux_errno((int)ret.a2); 220 + 221 + return 0; 222 + } 223 + 224 + static int ffa_rxtx_unmap(u16 vm_id) 225 + { 226 + ffa_value_t ret; 227 + 228 + invoke_ffa_fn((ffa_value_t){ 229 + .a0 = FFA_RXTX_UNMAP, .a1 = PACK_TARGET_INFO(vm_id, 0), 230 + }, &ret); 231 + 232 + if (ret.a0 == FFA_ERROR) 233 + return ffa_to_linux_errno((int)ret.a2); 234 + 235 + return 0; 236 + } 237 + 238 + /* buffer must be sizeof(struct ffa_partition_info) * num_partitions */ 239 + static int 240 + __ffa_partition_info_get(u32 uuid0, u32 uuid1, u32 uuid2, u32 uuid3, 241 + struct ffa_partition_info *buffer, int num_partitions) 242 + { 243 + int count; 244 + ffa_value_t partition_info; 245 + 246 + mutex_lock(&drv_info->rx_lock); 247 + invoke_ffa_fn((ffa_value_t){ 248 + .a0 = FFA_PARTITION_INFO_GET, 249 + .a1 = uuid0, .a2 = uuid1, .a3 = uuid2, .a4 = uuid3, 250 + }, &partition_info); 251 + 252 + if (partition_info.a0 == FFA_ERROR) { 253 + mutex_unlock(&drv_info->rx_lock); 254 + return ffa_to_linux_errno((int)partition_info.a2); 255 + } 256 + 257 + count = partition_info.a2; 258 + 259 + if (buffer && count <= num_partitions) 260 + memcpy(buffer, drv_info->rx_buffer, sizeof(*buffer) * count); 261 + 262 + ffa_rx_release(); 263 + 264 + mutex_unlock(&drv_info->rx_lock); 265 + 266 + return count; 267 + } 268 + 269 + /* buffer is allocated and caller must free the same if returned count > 0 */ 270 + static int 271 + ffa_partition_probe(const uuid_t *uuid, struct ffa_partition_info **buffer) 272 + { 273 + int count; 274 + u32 uuid0_4[4]; 275 + struct ffa_partition_info *pbuf; 276 + 277 + export_uuid((u8 *)uuid0_4, uuid); 278 + count = __ffa_partition_info_get(uuid0_4[0], uuid0_4[1], uuid0_4[2], 279 + uuid0_4[3], NULL, 0); 280 + if (count <= 0) 281 + return count; 282 + 283 + pbuf = kcalloc(count, sizeof(*pbuf), GFP_KERNEL); 284 + if (!pbuf) 285 + return -ENOMEM; 286 + 287 + count = __ffa_partition_info_get(uuid0_4[0], uuid0_4[1], uuid0_4[2], 288 + uuid0_4[3], pbuf, count); 289 + if (count <= 0) 290 + kfree(pbuf); 291 + else 292 + *buffer = pbuf; 293 + 294 + return count; 295 + } 296 + 297 + #define VM_ID_MASK GENMASK(15, 0) 298 + static int ffa_id_get(u16 *vm_id) 299 + { 300 + ffa_value_t id; 301 + 302 + invoke_ffa_fn((ffa_value_t){ 303 + .a0 = FFA_ID_GET, 304 + }, &id); 305 + 306 + if (id.a0 == FFA_ERROR) 307 + return ffa_to_linux_errno((int)id.a2); 308 + 309 + *vm_id = FIELD_GET(VM_ID_MASK, (id.a2)); 310 + 311 + return 0; 312 + } 313 + 314 + static int ffa_msg_send_direct_req(u16 src_id, u16 dst_id, bool mode_32bit, 315 + struct ffa_send_direct_data *data) 316 + { 317 + u32 req_id, resp_id, src_dst_ids = PACK_TARGET_INFO(src_id, dst_id); 318 + ffa_value_t ret; 319 + 320 + if (mode_32bit) { 321 + req_id = FFA_MSG_SEND_DIRECT_REQ; 322 + resp_id = FFA_MSG_SEND_DIRECT_RESP; 323 + } else { 324 + req_id = FFA_FN_NATIVE(MSG_SEND_DIRECT_REQ); 325 + resp_id = FFA_FN_NATIVE(MSG_SEND_DIRECT_RESP); 326 + } 327 + 328 + invoke_ffa_fn((ffa_value_t){ 329 + .a0 = req_id, .a1 = src_dst_ids, .a2 = 0, 330 + .a3 = data->data0, .a4 = data->data1, .a5 = data->data2, 331 + .a6 = data->data3, .a7 = data->data4, 332 + }, &ret); 333 + 334 + while (ret.a0 == FFA_INTERRUPT) 335 + invoke_ffa_fn((ffa_value_t){ 336 + .a0 = FFA_RUN, .a1 = ret.a1, 337 + }, &ret); 338 + 339 + if (ret.a0 == FFA_ERROR) 340 + return ffa_to_linux_errno((int)ret.a2); 341 + 342 + if (ret.a0 == resp_id) { 343 + data->data0 = ret.a3; 344 + data->data1 = ret.a4; 345 + data->data2 = ret.a5; 346 + data->data3 = ret.a6; 347 + data->data4 = ret.a7; 348 + return 0; 349 + } 350 + 351 + return -EINVAL; 352 + } 353 + 354 + static int ffa_mem_first_frag(u32 func_id, phys_addr_t buf, u32 buf_sz, 355 + u32 frag_len, u32 len, u64 *handle) 356 + { 357 + ffa_value_t ret; 358 + 359 + invoke_ffa_fn((ffa_value_t){ 360 + .a0 = func_id, .a1 = len, .a2 = frag_len, 361 + .a3 = buf, .a4 = buf_sz, 362 + }, &ret); 363 + 364 + while (ret.a0 == FFA_MEM_OP_PAUSE) 365 + invoke_ffa_fn((ffa_value_t){ 366 + .a0 = FFA_MEM_OP_RESUME, 367 + .a1 = ret.a1, .a2 = ret.a2, 368 + }, &ret); 369 + 370 + if (ret.a0 == FFA_ERROR) 371 + return ffa_to_linux_errno((int)ret.a2); 372 + 373 + if (ret.a0 != FFA_SUCCESS) 374 + return -EOPNOTSUPP; 375 + 376 + if (handle) 377 + *handle = PACK_HANDLE(ret.a2, ret.a3); 378 + 379 + return frag_len; 380 + } 381 + 382 + static int ffa_mem_next_frag(u64 handle, u32 frag_len) 383 + { 384 + ffa_value_t ret; 385 + 386 + invoke_ffa_fn((ffa_value_t){ 387 + .a0 = FFA_MEM_FRAG_TX, 388 + .a1 = HANDLE_LOW(handle), .a2 = HANDLE_HIGH(handle), 389 + .a3 = frag_len, 390 + }, &ret); 391 + 392 + while (ret.a0 == FFA_MEM_OP_PAUSE) 393 + invoke_ffa_fn((ffa_value_t){ 394 + .a0 = FFA_MEM_OP_RESUME, 395 + .a1 = ret.a1, .a2 = ret.a2, 396 + }, &ret); 397 + 398 + if (ret.a0 == FFA_ERROR) 399 + return ffa_to_linux_errno((int)ret.a2); 400 + 401 + if (ret.a0 != FFA_MEM_FRAG_RX) 402 + return -EOPNOTSUPP; 403 + 404 + return ret.a3; 405 + } 406 + 407 + static int 408 + ffa_transmit_fragment(u32 func_id, phys_addr_t buf, u32 buf_sz, u32 frag_len, 409 + u32 len, u64 *handle, bool first) 410 + { 411 + if (!first) 412 + return ffa_mem_next_frag(*handle, frag_len); 413 + 414 + return ffa_mem_first_frag(func_id, buf, buf_sz, frag_len, len, handle); 415 + } 416 + 417 + static u32 ffa_get_num_pages_sg(struct scatterlist *sg) 418 + { 419 + u32 num_pages = 0; 420 + 421 + do { 422 + num_pages += sg->length / FFA_PAGE_SIZE; 423 + } while ((sg = sg_next(sg))); 424 + 425 + return num_pages; 426 + } 427 + 428 + static int 429 + ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize, 430 + struct ffa_mem_ops_args *args) 431 + { 432 + int rc = 0; 433 + bool first = true; 434 + phys_addr_t addr = 0; 435 + struct ffa_composite_mem_region *composite; 436 + struct ffa_mem_region_addr_range *constituents; 437 + struct ffa_mem_region_attributes *ep_mem_access; 438 + struct ffa_mem_region *mem_region = buffer; 439 + u32 idx, frag_len, length, buf_sz = 0, num_entries = sg_nents(args->sg); 440 + 441 + mem_region->tag = args->tag; 442 + mem_region->flags = args->flags; 443 + mem_region->sender_id = drv_info->vm_id; 444 + mem_region->attributes = FFA_MEM_NORMAL | FFA_MEM_WRITE_BACK | 445 + FFA_MEM_INNER_SHAREABLE; 446 + ep_mem_access = &mem_region->ep_mem_access[0]; 447 + 448 + for (idx = 0; idx < args->nattrs; idx++, ep_mem_access++) { 449 + ep_mem_access->receiver = args->attrs[idx].receiver; 450 + ep_mem_access->attrs = args->attrs[idx].attrs; 451 + ep_mem_access->composite_off = COMPOSITE_OFFSET(args->nattrs); 452 + } 453 + mem_region->ep_count = args->nattrs; 454 + 455 + composite = buffer + COMPOSITE_OFFSET(args->nattrs); 456 + composite->total_pg_cnt = ffa_get_num_pages_sg(args->sg); 457 + composite->addr_range_cnt = num_entries; 458 + 459 + length = COMPOSITE_CONSTITUENTS_OFFSET(args->nattrs, num_entries); 460 + frag_len = COMPOSITE_CONSTITUENTS_OFFSET(args->nattrs, 0); 461 + if (frag_len > max_fragsize) 462 + return -ENXIO; 463 + 464 + if (!args->use_txbuf) { 465 + addr = virt_to_phys(buffer); 466 + buf_sz = max_fragsize / FFA_PAGE_SIZE; 467 + } 468 + 469 + constituents = buffer + frag_len; 470 + idx = 0; 471 + do { 472 + if (frag_len == max_fragsize) { 473 + rc = ffa_transmit_fragment(func_id, addr, buf_sz, 474 + frag_len, length, 475 + &args->g_handle, first); 476 + if (rc < 0) 477 + return -ENXIO; 478 + 479 + first = false; 480 + idx = 0; 481 + frag_len = 0; 482 + constituents = buffer; 483 + } 484 + 485 + if ((void *)constituents - buffer > max_fragsize) { 486 + pr_err("Memory Region Fragment > Tx Buffer size\n"); 487 + return -EFAULT; 488 + } 489 + 490 + constituents->address = sg_phys(args->sg); 491 + constituents->pg_cnt = args->sg->length / FFA_PAGE_SIZE; 492 + constituents++; 493 + frag_len += sizeof(struct ffa_mem_region_addr_range); 494 + } while ((args->sg = sg_next(args->sg))); 495 + 496 + return ffa_transmit_fragment(func_id, addr, buf_sz, frag_len, 497 + length, &args->g_handle, first); 498 + } 499 + 500 + static int ffa_memory_ops(u32 func_id, struct ffa_mem_ops_args *args) 501 + { 502 + int ret; 503 + void *buffer; 504 + 505 + if (!args->use_txbuf) { 506 + buffer = alloc_pages_exact(RXTX_BUFFER_SIZE, GFP_KERNEL); 507 + if (!buffer) 508 + return -ENOMEM; 509 + } else { 510 + buffer = drv_info->tx_buffer; 511 + mutex_lock(&drv_info->tx_lock); 512 + } 513 + 514 + ret = ffa_setup_and_transmit(func_id, buffer, RXTX_BUFFER_SIZE, args); 515 + 516 + if (args->use_txbuf) 517 + mutex_unlock(&drv_info->tx_lock); 518 + else 519 + free_pages_exact(buffer, RXTX_BUFFER_SIZE); 520 + 521 + return ret < 0 ? ret : 0; 522 + } 523 + 524 + static int ffa_memory_reclaim(u64 g_handle, u32 flags) 525 + { 526 + ffa_value_t ret; 527 + 528 + invoke_ffa_fn((ffa_value_t){ 529 + .a0 = FFA_MEM_RECLAIM, 530 + .a1 = HANDLE_LOW(g_handle), .a2 = HANDLE_HIGH(g_handle), 531 + .a3 = flags, 532 + }, &ret); 533 + 534 + if (ret.a0 == FFA_ERROR) 535 + return ffa_to_linux_errno((int)ret.a2); 536 + 537 + return 0; 538 + } 539 + 540 + static u32 ffa_api_version_get(void) 541 + { 542 + return drv_info->version; 543 + } 544 + 545 + static int ffa_partition_info_get(const char *uuid_str, 546 + struct ffa_partition_info *buffer) 547 + { 548 + int count; 549 + uuid_t uuid; 550 + struct ffa_partition_info *pbuf; 551 + 552 + if (uuid_parse(uuid_str, &uuid)) { 553 + pr_err("invalid uuid (%s)\n", uuid_str); 554 + return -ENODEV; 555 + } 556 + 557 + count = ffa_partition_probe(&uuid_null, &pbuf); 558 + if (count <= 0) 559 + return -ENOENT; 560 + 561 + memcpy(buffer, pbuf, sizeof(*pbuf) * count); 562 + kfree(pbuf); 563 + return 0; 564 + } 565 + 566 + static void ffa_mode_32bit_set(struct ffa_device *dev) 567 + { 568 + dev->mode_32bit = true; 569 + } 570 + 571 + static int ffa_sync_send_receive(struct ffa_device *dev, 572 + struct ffa_send_direct_data *data) 573 + { 574 + return ffa_msg_send_direct_req(drv_info->vm_id, dev->vm_id, 575 + dev->mode_32bit, data); 576 + } 577 + 578 + static int 579 + ffa_memory_share(struct ffa_device *dev, struct ffa_mem_ops_args *args) 580 + { 581 + if (dev->mode_32bit) 582 + return ffa_memory_ops(FFA_MEM_SHARE, args); 583 + 584 + return ffa_memory_ops(FFA_FN_NATIVE(MEM_SHARE), args); 585 + } 586 + 587 + static const struct ffa_dev_ops ffa_ops = { 588 + .api_version_get = ffa_api_version_get, 589 + .partition_info_get = ffa_partition_info_get, 590 + .mode_32bit_set = ffa_mode_32bit_set, 591 + .sync_send_receive = ffa_sync_send_receive, 592 + .memory_reclaim = ffa_memory_reclaim, 593 + .memory_share = ffa_memory_share, 594 + }; 595 + 596 + const struct ffa_dev_ops *ffa_dev_ops_get(struct ffa_device *dev) 597 + { 598 + if (ffa_device_is_valid(dev)) 599 + return &ffa_ops; 600 + 601 + return NULL; 602 + } 603 + EXPORT_SYMBOL_GPL(ffa_dev_ops_get); 604 + 605 + void ffa_device_match_uuid(struct ffa_device *ffa_dev, const uuid_t *uuid) 606 + { 607 + int count, idx; 608 + struct ffa_partition_info *pbuf, *tpbuf; 609 + 610 + count = ffa_partition_probe(uuid, &pbuf); 611 + if (count <= 0) 612 + return; 613 + 614 + for (idx = 0, tpbuf = pbuf; idx < count; idx++, tpbuf++) 615 + if (tpbuf->id == ffa_dev->vm_id) 616 + uuid_copy(&ffa_dev->uuid, uuid); 617 + kfree(pbuf); 618 + } 619 + 620 + static void ffa_setup_partitions(void) 621 + { 622 + int count, idx; 623 + struct ffa_device *ffa_dev; 624 + struct ffa_partition_info *pbuf, *tpbuf; 625 + 626 + count = ffa_partition_probe(&uuid_null, &pbuf); 627 + if (count <= 0) { 628 + pr_info("%s: No partitions found, error %d\n", __func__, count); 629 + return; 630 + } 631 + 632 + for (idx = 0, tpbuf = pbuf; idx < count; idx++, tpbuf++) { 633 + /* Note that the &uuid_null parameter will require 634 + * ffa_device_match() to find the UUID of this partition id 635 + * with help of ffa_device_match_uuid(). Once the FF-A spec 636 + * is updated to provide correct UUID here for each partition 637 + * as part of the discovery API, we need to pass the 638 + * discovered UUID here instead. 639 + */ 640 + ffa_dev = ffa_device_register(&uuid_null, tpbuf->id); 641 + if (!ffa_dev) { 642 + pr_err("%s: failed to register partition ID 0x%x\n", 643 + __func__, tpbuf->id); 644 + continue; 645 + } 646 + 647 + ffa_dev_set_drvdata(ffa_dev, drv_info); 648 + } 649 + kfree(pbuf); 650 + } 651 + 652 + static int __init ffa_init(void) 653 + { 654 + int ret; 655 + 656 + ret = ffa_transport_init(&invoke_ffa_fn); 657 + if (ret) 658 + return ret; 659 + 660 + ret = arm_ffa_bus_init(); 661 + if (ret) 662 + return ret; 663 + 664 + drv_info = kzalloc(sizeof(*drv_info), GFP_KERNEL); 665 + if (!drv_info) { 666 + ret = -ENOMEM; 667 + goto ffa_bus_exit; 668 + } 669 + 670 + ret = ffa_version_check(&drv_info->version); 671 + if (ret) 672 + goto free_drv_info; 673 + 674 + if (ffa_id_get(&drv_info->vm_id)) { 675 + pr_err("failed to obtain VM id for self\n"); 676 + ret = -ENODEV; 677 + goto free_drv_info; 678 + } 679 + 680 + drv_info->rx_buffer = alloc_pages_exact(RXTX_BUFFER_SIZE, GFP_KERNEL); 681 + if (!drv_info->rx_buffer) { 682 + ret = -ENOMEM; 683 + goto free_pages; 684 + } 685 + 686 + drv_info->tx_buffer = alloc_pages_exact(RXTX_BUFFER_SIZE, GFP_KERNEL); 687 + if (!drv_info->tx_buffer) { 688 + ret = -ENOMEM; 689 + goto free_pages; 690 + } 691 + 692 + ret = ffa_rxtx_map(virt_to_phys(drv_info->tx_buffer), 693 + virt_to_phys(drv_info->rx_buffer), 694 + RXTX_BUFFER_SIZE / FFA_PAGE_SIZE); 695 + if (ret) { 696 + pr_err("failed to register FFA RxTx buffers\n"); 697 + goto free_pages; 698 + } 699 + 700 + mutex_init(&drv_info->rx_lock); 701 + mutex_init(&drv_info->tx_lock); 702 + 703 + ffa_setup_partitions(); 704 + 705 + return 0; 706 + free_pages: 707 + if (drv_info->tx_buffer) 708 + free_pages_exact(drv_info->tx_buffer, RXTX_BUFFER_SIZE); 709 + free_pages_exact(drv_info->rx_buffer, RXTX_BUFFER_SIZE); 710 + free_drv_info: 711 + kfree(drv_info); 712 + ffa_bus_exit: 713 + arm_ffa_bus_exit(); 714 + return ret; 715 + } 716 + subsys_initcall(ffa_init); 717 + 718 + static void __exit ffa_exit(void) 719 + { 720 + ffa_rxtx_unmap(drv_info->vm_id); 721 + free_pages_exact(drv_info->tx_buffer, RXTX_BUFFER_SIZE); 722 + free_pages_exact(drv_info->rx_buffer, RXTX_BUFFER_SIZE); 723 + kfree(drv_info); 724 + arm_ffa_bus_exit(); 725 + } 726 + module_exit(ffa_exit); 727 + 728 + MODULE_ALIAS("arm-ffa"); 729 + MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>"); 730 + MODULE_DESCRIPTION("Arm FF-A interface driver"); 731 + MODULE_LICENSE("GPL v2");
+39
drivers/firmware/arm_ffa/smccc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (C) 2021 ARM Ltd. 4 + */ 5 + 6 + #include <linux/printk.h> 7 + 8 + #include "common.h" 9 + 10 + static void __arm_ffa_fn_smc(ffa_value_t args, ffa_value_t *res) 11 + { 12 + arm_smccc_1_2_smc(&args, res); 13 + } 14 + 15 + static void __arm_ffa_fn_hvc(ffa_value_t args, ffa_value_t *res) 16 + { 17 + arm_smccc_1_2_hvc(&args, res); 18 + } 19 + 20 + int __init ffa_transport_init(ffa_fn **invoke_ffa_fn) 21 + { 22 + enum arm_smccc_conduit conduit; 23 + 24 + if (arm_smccc_get_version() < ARM_SMCCC_VERSION_1_2) 25 + return -EOPNOTSUPP; 26 + 27 + conduit = arm_smccc_1_1_get_conduit(); 28 + if (conduit == SMCCC_CONDUIT_NONE) { 29 + pr_err("%s: invalid SMCCC conduit\n", __func__); 30 + return -EOPNOTSUPP; 31 + } 32 + 33 + if (conduit == SMCCC_CONDUIT_SMC) 34 + *invoke_ffa_fn = __arm_ffa_fn_smc; 35 + else 36 + *invoke_ffa_fn = __arm_ffa_fn_hvc; 37 + 38 + return 0; 39 + }
+1 -1
drivers/firmware/arm_scmi/common.h
··· 331 331 }; 332 332 333 333 extern const struct scmi_desc scmi_mailbox_desc; 334 - #ifdef CONFIG_HAVE_ARM_SMCCC 334 + #ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY 335 335 extern const struct scmi_desc scmi_smc_desc; 336 336 #endif 337 337
+15 -9
drivers/firmware/arm_scmi/driver.c
··· 241 241 242 242 xfer = &minfo->xfer_block[xfer_id]; 243 243 xfer->hdr.seq = xfer_id; 244 - reinit_completion(&xfer->done); 245 244 xfer->transfer_id = atomic_inc_return(&transfer_last_id); 246 245 247 246 return xfer; ··· 333 334 __scmi_xfer_put(minfo, xfer); 334 335 return; 335 336 } 337 + 338 + /* rx.len could be shrunk in the sync do_xfer, so reset to maxsz */ 339 + if (msg_type == MSG_TYPE_DELAYED_RESP) 340 + xfer->rx.len = info->desc->max_msg_size; 336 341 337 342 scmi_dump_header_dbg(dev, &xfer->hdr); 338 343 ··· 432 429 struct scmi_chan_info *cinfo; 433 430 434 431 /* 435 - * Re-instate protocol id here from protocol handle so that cannot be 432 + * Initialise protocol id now from protocol handle to avoid it being 436 433 * overridden by mistake (or malice) by the protocol code mangling with 437 - * the scmi_xfer structure. 434 + * the scmi_xfer structure prior to this. 438 435 */ 439 436 xfer->hdr.protocol_id = pi->proto->id; 437 + reinit_completion(&xfer->done); 440 438 441 439 cinfo = idr_find(&info->tx_idr, xfer->hdr.protocol_id); 442 440 if (unlikely(!cinfo)) ··· 509 505 struct scmi_xfer *xfer) 510 506 { 511 507 int ret, timeout = msecs_to_jiffies(SCMI_MAX_RESPONSE_TIMEOUT); 512 - const struct scmi_protocol_instance *pi = ph_to_pi(ph); 513 508 DECLARE_COMPLETION_ONSTACK(async_response); 514 - 515 - xfer->hdr.protocol_id = pi->proto->id; 516 509 517 510 xfer->async_done = &async_response; 518 511 519 512 ret = do_xfer(ph, xfer); 520 - if (!ret && !wait_for_completion_timeout(xfer->async_done, timeout)) 521 - ret = -ETIMEDOUT; 513 + if (!ret) { 514 + if (!wait_for_completion_timeout(xfer->async_done, timeout)) 515 + ret = -ETIMEDOUT; 516 + else if (xfer->hdr.status) 517 + ret = scmi_to_linux_errno(xfer->hdr.status); 518 + } 522 519 523 520 xfer->async_done = NULL; 524 521 return ret; ··· 566 561 xfer->tx.len = tx_size; 567 562 xfer->rx.len = rx_size ? : info->desc->max_msg_size; 568 563 xfer->hdr.id = msg_id; 569 - xfer->hdr.protocol_id = pi->proto->id; 570 564 xfer->hdr.poll_completion = false; 571 565 572 566 *p = xfer; ··· 1571 1567 1572 1568 /* Each compatible listed below must have descriptor associated with it */ 1573 1569 static const struct of_device_id scmi_of_match[] = { 1570 + #ifdef CONFIG_MAILBOX 1574 1571 { .compatible = "arm,scmi", .data = &scmi_mailbox_desc }, 1572 + #endif 1575 1573 #ifdef CONFIG_HAVE_ARM_SMCCC_DISCOVERY 1576 1574 { .compatible = "arm,scmi-smc", .data = &scmi_smc_desc}, 1577 1575 #endif
+3
drivers/firmware/arm_scmi/mailbox.c
··· 69 69 return -ENOMEM; 70 70 71 71 shmem = of_parse_phandle(cdev->of_node, "shmem", idx); 72 + if (!of_device_is_compatible(shmem, "arm,scmi-shmem")) 73 + return -ENXIO; 74 + 72 75 ret = of_address_to_resource(shmem, 0, &res); 73 76 of_node_put(shmem); 74 77 if (ret) {
+26
drivers/firmware/arm_scmi/scmi_pm_domain.c
··· 8 8 #include <linux/err.h> 9 9 #include <linux/io.h> 10 10 #include <linux/module.h> 11 + #include <linux/pm_clock.h> 11 12 #include <linux/pm_domain.h> 12 13 #include <linux/scmi_protocol.h> 13 14 ··· 51 50 static int scmi_pd_power_off(struct generic_pm_domain *domain) 52 51 { 53 52 return scmi_pd_power(domain, false); 53 + } 54 + 55 + static int scmi_pd_attach_dev(struct generic_pm_domain *pd, struct device *dev) 56 + { 57 + int ret; 58 + 59 + ret = pm_clk_create(dev); 60 + if (ret) 61 + return ret; 62 + 63 + ret = of_pm_clk_add_clks(dev); 64 + if (ret >= 0) 65 + return 0; 66 + 67 + pm_clk_destroy(dev); 68 + return ret; 69 + } 70 + 71 + static void scmi_pd_detach_dev(struct generic_pm_domain *pd, struct device *dev) 72 + { 73 + pm_clk_destroy(dev); 54 74 } 55 75 56 76 static int scmi_pm_domain_probe(struct scmi_device *sdev) ··· 124 102 scmi_pd->genpd.name = scmi_pd->name; 125 103 scmi_pd->genpd.power_off = scmi_pd_power_off; 126 104 scmi_pd->genpd.power_on = scmi_pd_power_on; 105 + scmi_pd->genpd.attach_dev = scmi_pd_attach_dev; 106 + scmi_pd->genpd.detach_dev = scmi_pd_detach_dev; 107 + scmi_pd->genpd.flags = GENPD_FLAG_PM_CLK | 108 + GENPD_FLAG_ACTIVE_WAKEUP; 127 109 128 110 pm_genpd_init(&scmi_pd->genpd, NULL, 129 111 state == SCMI_POWER_STATE_GENERIC_OFF);
+3
drivers/firmware/arm_scmi/smc.c
··· 76 76 return -ENOMEM; 77 77 78 78 np = of_parse_phandle(cdev->of_node, "shmem", 0); 79 + if (!of_device_is_compatible(np, "arm,scmi-shmem")) 80 + return -ENXIO; 81 + 79 82 ret = of_address_to_resource(np, 0, &res); 80 83 of_node_put(np); 81 84 if (ret) {
+11
drivers/firmware/arm_scpi.c
··· 899 899 {}, 900 900 }; 901 901 902 + static const struct of_device_id shmem_of_match[] __maybe_unused = { 903 + { .compatible = "amlogic,meson-gxbb-scp-shmem", }, 904 + { .compatible = "amlogic,meson-axg-scp-shmem", }, 905 + { .compatible = "arm,juno-scp-shmem", }, 906 + { .compatible = "arm,scp-shmem", }, 907 + { } 908 + }; 909 + 902 910 static int scpi_probe(struct platform_device *pdev) 903 911 { 904 912 int count, idx, ret; ··· 942 934 struct scpi_chan *pchan = scpi_info->channels + idx; 943 935 struct mbox_client *cl = &pchan->cl; 944 936 struct device_node *shmem = of_parse_phandle(np, "shmem", idx); 937 + 938 + if (!of_match_node(shmem_of_match, shmem)) 939 + return -ENXIO; 945 940 946 941 ret = of_address_to_resource(shmem, 0, &res); 947 942 of_node_put(shmem);
+3
drivers/firmware/qcom_scm.c
··· 1281 1281 SCM_HAS_BUS_CLK) 1282 1282 }, 1283 1283 { .compatible = "qcom,scm-ipq4019" }, 1284 + { .compatible = "qcom,scm-mdm9607", .data = (void *)(SCM_HAS_CORE_CLK | 1285 + SCM_HAS_IFACE_CLK | 1286 + SCM_HAS_BUS_CLK) }, 1284 1287 { .compatible = "qcom,scm-msm8660", .data = (void *) SCM_HAS_CORE_CLK }, 1285 1288 { .compatible = "qcom,scm-msm8960", .data = (void *) SCM_HAS_CORE_CLK }, 1286 1289 { .compatible = "qcom,scm-msm8916", .data = (void *)(SCM_HAS_CORE_CLK |
+1
drivers/firmware/tegra/Makefile
··· 3 3 tegra-bpmp-$(CONFIG_ARCH_TEGRA_210_SOC) += bpmp-tegra210.o 4 4 tegra-bpmp-$(CONFIG_ARCH_TEGRA_186_SOC) += bpmp-tegra186.o 5 5 tegra-bpmp-$(CONFIG_ARCH_TEGRA_194_SOC) += bpmp-tegra186.o 6 + tegra-bpmp-$(CONFIG_ARCH_TEGRA_234_SOC) += bpmp-tegra186.o 6 7 tegra-bpmp-$(CONFIG_DEBUG_FS) += bpmp-debugfs.o 7 8 obj-$(CONFIG_TEGRA_BPMP) += tegra-bpmp.o 8 9 obj-$(CONFIG_TEGRA_IVC) += ivc.o
+2 -1
drivers/firmware/tegra/bpmp-private.h
··· 24 24 }; 25 25 26 26 #if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC) || \ 27 - IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) 27 + IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \ 28 + IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) 28 29 extern const struct tegra_bpmp_ops tegra186_bpmp_ops; 29 30 #endif 30 31 #if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
+1 -1
drivers/firmware/tegra/bpmp-tegra210.c
··· 210 210 priv->tx_irq_data = irq_get_irq_data(err); 211 211 if (!priv->tx_irq_data) { 212 212 dev_err(&pdev->dev, "failed to get IRQ data for TX IRQ\n"); 213 - return err; 213 + return -ENOENT; 214 214 } 215 215 216 216 err = platform_get_irq_byname(pdev, "rx");
+2 -1
drivers/firmware/tegra/bpmp.c
··· 809 809 }; 810 810 811 811 #if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC) || \ 812 - IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) 812 + IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \ 813 + IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC) 813 814 static const struct tegra_bpmp_soc tegra186_soc = { 814 815 .channels = { 815 816 .cpu_tx = {
+48 -8
drivers/firmware/turris-mox-rwtm.c
··· 147 147 148 148 static int mox_get_status(enum mbox_cmd cmd, u32 retval) 149 149 { 150 - if (MBOX_STS_CMD(retval) != cmd || 151 - MBOX_STS_ERROR(retval) != MBOX_STS_SUCCESS) 150 + if (MBOX_STS_CMD(retval) != cmd) 152 151 return -EIO; 153 152 else if (MBOX_STS_ERROR(retval) == MBOX_STS_FAIL) 154 153 return -(int)MBOX_STS_VALUE(retval); 154 + else if (MBOX_STS_ERROR(retval) == MBOX_STS_BADCMD) 155 + return -ENOSYS; 156 + else if (MBOX_STS_ERROR(retval) != MBOX_STS_SUCCESS) 157 + return -EIO; 155 158 else 156 159 return MBOX_STS_VALUE(retval); 157 160 } ··· 204 201 return ret; 205 202 206 203 ret = mox_get_status(MBOX_CMD_BOARD_INFO, reply->retval); 207 - if (ret < 0 && ret != -ENODATA) { 208 - return ret; 209 - } else if (ret == -ENODATA) { 204 + if (ret == -ENODATA) { 210 205 dev_warn(rwtm->dev, 211 206 "Board does not have manufacturing information burned!\n"); 207 + } else if (ret == -ENOSYS) { 208 + dev_notice(rwtm->dev, 209 + "Firmware does not support the BOARD_INFO command\n"); 210 + } else if (ret < 0) { 211 + return ret; 212 212 } else { 213 213 rwtm->serial_number = reply->status[1]; 214 214 rwtm->serial_number <<= 32; ··· 240 234 return ret; 241 235 242 236 ret = mox_get_status(MBOX_CMD_ECDSA_PUB_KEY, reply->retval); 243 - if (ret < 0 && ret != -ENODATA) { 244 - return ret; 245 - } else if (ret == -ENODATA) { 237 + if (ret == -ENODATA) { 246 238 dev_warn(rwtm->dev, "Board has no public key burned!\n"); 239 + } else if (ret == -ENOSYS) { 240 + dev_notice(rwtm->dev, 241 + "Firmware does not support the ECDSA_PUB_KEY command\n"); 242 + } else if (ret < 0) { 243 + return ret; 247 244 } else { 248 245 u32 *s = reply->status; 249 246 ··· 258 249 } 259 250 260 251 return 0; 252 + } 253 + 254 + static int check_get_random_support(struct mox_rwtm *rwtm) 255 + { 256 + struct armada_37xx_rwtm_tx_msg msg; 257 + int ret; 258 + 259 + msg.command = MBOX_CMD_GET_RANDOM; 260 + msg.args[0] = 1; 261 + msg.args[1] = rwtm->buf_phys; 262 + msg.args[2] = 4; 263 + 264 + ret = mbox_send_message(rwtm->mbox, &msg); 265 + if (ret < 0) 266 + return ret; 267 + 268 + ret = wait_for_completion_timeout(&rwtm->cmd_done, HZ / 2); 269 + if (ret < 0) 270 + return ret; 271 + 272 + return mox_get_status(MBOX_CMD_GET_RANDOM, rwtm->reply.retval); 261 273 } 262 274 263 275 static int mox_hwrng_read(struct hwrng *rng, void *data, size_t max, bool wait) ··· 518 488 if (ret < 0) 519 489 dev_warn(dev, "Cannot read board information: %i\n", ret); 520 490 491 + ret = check_get_random_support(rwtm); 492 + if (ret < 0) { 493 + dev_notice(dev, 494 + "Firmware does not support the GET_RANDOM command\n"); 495 + goto free_channel; 496 + } 497 + 521 498 rwtm->hwrng.name = DRIVER_NAME "_hwrng"; 522 499 rwtm->hwrng.read = mox_hwrng_read; 523 500 rwtm->hwrng.priv = (unsigned long) rwtm; ··· 541 504 dev_err(dev, "Failed creating debugfs entries: %i\n", ret); 542 505 goto free_channel; 543 506 } 507 + 508 + dev_info(dev, "HWRNG successfully registered\n"); 544 509 545 510 return 0; 546 511 ··· 569 530 570 531 static const struct of_device_id turris_mox_rwtm_match[] = { 571 532 { .compatible = "cznic,turris-mox-rwtm", }, 533 + { .compatible = "marvell,armada-3700-rwtm-firmware", }, 572 534 { }, 573 535 }; 574 536
+2 -1
drivers/iommu/arm/arm-smmu/arm-smmu-impl.c
··· 211 211 if (of_property_read_bool(np, "calxeda,smmu-secure-config-access")) 212 212 smmu->impl = &calxeda_impl; 213 213 214 - if (of_device_is_compatible(np, "nvidia,tegra194-smmu")) 214 + if (of_device_is_compatible(np, "nvidia,tegra194-smmu") || 215 + of_device_is_compatible(np, "nvidia,tegra186-smmu")) 215 216 return nvidia_smmu_impl_init(smmu); 216 217 217 218 smmu = qcom_smmu_impl_init(smmu);
+71 -19
drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c
··· 7 7 #include <linux/platform_device.h> 8 8 #include <linux/slab.h> 9 9 10 + #include <soc/tegra/mc.h> 11 + 10 12 #include "arm-smmu.h" 11 13 12 14 /* ··· 17 15 * interleaved IOVA accesses across them and translates accesses from 18 16 * non-isochronous HW devices. 19 17 * Third one is used for translating accesses from isochronous HW devices. 18 + * 19 + * In addition, the SMMU driver needs to coordinate with the memory controller 20 + * driver to ensure that the right SID override is programmed for any given 21 + * memory client. This is necessary to allow for use-case such as seamlessly 22 + * handing over the display controller configuration from the firmware to the 23 + * kernel. 24 + * 20 25 * This implementation supports programming of the two instances that must 21 - * be programmed identically. 22 - * The third instance usage is through standard arm-smmu driver itself and 23 - * is out of scope of this implementation. 26 + * be programmed identically and takes care of invoking the memory controller 27 + * driver for SID override programming after devices have been attached to an 28 + * SMMU instance. 24 29 */ 25 - #define NUM_SMMU_INSTANCES 2 30 + #define MAX_SMMU_INSTANCES 2 26 31 27 32 struct nvidia_smmu { 28 - struct arm_smmu_device smmu; 29 - void __iomem *bases[NUM_SMMU_INSTANCES]; 33 + struct arm_smmu_device smmu; 34 + void __iomem *bases[MAX_SMMU_INSTANCES]; 35 + unsigned int num_instances; 36 + struct tegra_mc *mc; 30 37 }; 38 + 39 + static inline struct nvidia_smmu *to_nvidia_smmu(struct arm_smmu_device *smmu) 40 + { 41 + return container_of(smmu, struct nvidia_smmu, smmu); 42 + } 31 43 32 44 static inline void __iomem *nvidia_smmu_page(struct arm_smmu_device *smmu, 33 45 unsigned int inst, int page) ··· 63 47 static void nvidia_smmu_write_reg(struct arm_smmu_device *smmu, 64 48 int page, int offset, u32 val) 65 49 { 50 + struct nvidia_smmu *nvidia = to_nvidia_smmu(smmu); 66 51 unsigned int i; 67 52 68 - for (i = 0; i < NUM_SMMU_INSTANCES; i++) { 53 + for (i = 0; i < nvidia->num_instances; i++) { 69 54 void __iomem *reg = nvidia_smmu_page(smmu, i, page) + offset; 70 55 71 56 writel_relaxed(val, reg); ··· 84 67 static void nvidia_smmu_write_reg64(struct arm_smmu_device *smmu, 85 68 int page, int offset, u64 val) 86 69 { 70 + struct nvidia_smmu *nvidia = to_nvidia_smmu(smmu); 87 71 unsigned int i; 88 72 89 - for (i = 0; i < NUM_SMMU_INSTANCES; i++) { 73 + for (i = 0; i < nvidia->num_instances; i++) { 90 74 void __iomem *reg = nvidia_smmu_page(smmu, i, page) + offset; 91 75 92 76 writeq_relaxed(val, reg); ··· 97 79 static void nvidia_smmu_tlb_sync(struct arm_smmu_device *smmu, int page, 98 80 int sync, int status) 99 81 { 82 + struct nvidia_smmu *nvidia = to_nvidia_smmu(smmu); 100 83 unsigned int delay; 101 84 102 85 arm_smmu_writel(smmu, page, sync, 0); ··· 109 90 u32 val = 0; 110 91 unsigned int i; 111 92 112 - for (i = 0; i < NUM_SMMU_INSTANCES; i++) { 93 + for (i = 0; i < nvidia->num_instances; i++) { 113 94 void __iomem *reg; 114 95 115 96 reg = nvidia_smmu_page(smmu, i, page) + status; ··· 131 112 132 113 static int nvidia_smmu_reset(struct arm_smmu_device *smmu) 133 114 { 115 + struct nvidia_smmu *nvidia = to_nvidia_smmu(smmu); 134 116 unsigned int i; 135 117 136 - for (i = 0; i < NUM_SMMU_INSTANCES; i++) { 118 + for (i = 0; i < nvidia->num_instances; i++) { 137 119 u32 val; 138 120 void __iomem *reg = nvidia_smmu_page(smmu, i, ARM_SMMU_GR0) + 139 121 ARM_SMMU_GR0_sGFSR; ··· 177 157 unsigned int inst; 178 158 irqreturn_t ret = IRQ_NONE; 179 159 struct arm_smmu_device *smmu = dev; 160 + struct nvidia_smmu *nvidia = to_nvidia_smmu(smmu); 180 161 181 - for (inst = 0; inst < NUM_SMMU_INSTANCES; inst++) { 162 + for (inst = 0; inst < nvidia->num_instances; inst++) { 182 163 irqreturn_t irq_ret; 183 164 184 165 irq_ret = nvidia_smmu_global_fault_inst(irq, smmu, inst); ··· 223 202 struct arm_smmu_device *smmu; 224 203 struct iommu_domain *domain = dev; 225 204 struct arm_smmu_domain *smmu_domain; 205 + struct nvidia_smmu *nvidia; 226 206 227 207 smmu_domain = container_of(domain, struct arm_smmu_domain, domain); 228 208 smmu = smmu_domain->smmu; 209 + nvidia = to_nvidia_smmu(smmu); 229 210 230 - for (inst = 0; inst < NUM_SMMU_INSTANCES; inst++) { 211 + for (inst = 0; inst < nvidia->num_instances; inst++) { 231 212 irqreturn_t irq_ret; 232 213 233 214 /* ··· 247 224 return ret; 248 225 } 249 226 227 + static void nvidia_smmu_probe_finalize(struct arm_smmu_device *smmu, struct device *dev) 228 + { 229 + struct nvidia_smmu *nvidia = to_nvidia_smmu(smmu); 230 + int err; 231 + 232 + err = tegra_mc_probe_device(nvidia->mc, dev); 233 + if (err < 0) 234 + dev_err(smmu->dev, "memory controller probe failed for %s: %d\n", 235 + dev_name(dev), err); 236 + } 237 + 250 238 static const struct arm_smmu_impl nvidia_smmu_impl = { 251 239 .read_reg = nvidia_smmu_read_reg, 252 240 .write_reg = nvidia_smmu_write_reg, ··· 267 233 .tlb_sync = nvidia_smmu_tlb_sync, 268 234 .global_fault = nvidia_smmu_global_fault, 269 235 .context_fault = nvidia_smmu_context_fault, 236 + .probe_finalize = nvidia_smmu_probe_finalize, 237 + }; 238 + 239 + static const struct arm_smmu_impl nvidia_smmu_single_impl = { 240 + .probe_finalize = nvidia_smmu_probe_finalize, 270 241 }; 271 242 272 243 struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device *smmu) ··· 280 241 struct device *dev = smmu->dev; 281 242 struct nvidia_smmu *nvidia_smmu; 282 243 struct platform_device *pdev = to_platform_device(dev); 244 + unsigned int i; 283 245 284 246 nvidia_smmu = devm_krealloc(dev, smmu, sizeof(*nvidia_smmu), GFP_KERNEL); 285 247 if (!nvidia_smmu) 286 248 return ERR_PTR(-ENOMEM); 287 249 250 + nvidia_smmu->mc = devm_tegra_memory_controller_get(dev); 251 + if (IS_ERR(nvidia_smmu->mc)) 252 + return ERR_CAST(nvidia_smmu->mc); 253 + 288 254 /* Instance 0 is ioremapped by arm-smmu.c. */ 289 255 nvidia_smmu->bases[0] = smmu->base; 256 + nvidia_smmu->num_instances++; 290 257 291 - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 292 - if (!res) 293 - return ERR_PTR(-ENODEV); 258 + for (i = 1; i < MAX_SMMU_INSTANCES; i++) { 259 + res = platform_get_resource(pdev, IORESOURCE_MEM, i); 260 + if (!res) 261 + break; 294 262 295 - nvidia_smmu->bases[1] = devm_ioremap_resource(dev, res); 296 - if (IS_ERR(nvidia_smmu->bases[1])) 297 - return ERR_CAST(nvidia_smmu->bases[1]); 263 + nvidia_smmu->bases[i] = devm_ioremap_resource(dev, res); 264 + if (IS_ERR(nvidia_smmu->bases[i])) 265 + return ERR_CAST(nvidia_smmu->bases[i]); 298 266 299 - nvidia_smmu->smmu.impl = &nvidia_smmu_impl; 267 + nvidia_smmu->num_instances++; 268 + } 269 + 270 + if (nvidia_smmu->num_instances == 1) 271 + nvidia_smmu->smmu.impl = &nvidia_smmu_single_impl; 272 + else 273 + nvidia_smmu->smmu.impl = &nvidia_smmu_impl; 300 274 301 275 return &nvidia_smmu->smmu; 302 276 }
+8 -8
drivers/iommu/tegra-smmu.c
··· 376 376 if (client->swgroup != swgroup) 377 377 continue; 378 378 379 - value = smmu_readl(smmu, client->smmu.reg); 380 - value |= BIT(client->smmu.bit); 381 - smmu_writel(smmu, value, client->smmu.reg); 379 + value = smmu_readl(smmu, client->regs.smmu.reg); 380 + value |= BIT(client->regs.smmu.bit); 381 + smmu_writel(smmu, value, client->regs.smmu.reg); 382 382 } 383 383 } 384 384 ··· 404 404 if (client->swgroup != swgroup) 405 405 continue; 406 406 407 - value = smmu_readl(smmu, client->smmu.reg); 408 - value &= ~BIT(client->smmu.bit); 409 - smmu_writel(smmu, value, client->smmu.reg); 407 + value = smmu_readl(smmu, client->regs.smmu.reg); 408 + value &= ~BIT(client->regs.smmu.bit); 409 + smmu_writel(smmu, value, client->regs.smmu.reg); 410 410 } 411 411 } 412 412 ··· 1042 1042 const struct tegra_mc_client *client = &smmu->soc->clients[i]; 1043 1043 const char *status; 1044 1044 1045 - value = smmu_readl(smmu, client->smmu.reg); 1045 + value = smmu_readl(smmu, client->regs.smmu.reg); 1046 1046 1047 - if (value & BIT(client->smmu.bit)) 1047 + if (value & BIT(client->regs.smmu.bit)) 1048 1048 status = "yes"; 1049 1049 else 1050 1050 status = "no";
+3 -1
drivers/memory/atmel-ebi.c
··· 600 600 child); 601 601 602 602 ret = atmel_ebi_dev_disable(ebi, child); 603 - if (ret) 603 + if (ret) { 604 + of_node_put(child); 604 605 return ret; 606 + } 605 607 } 606 608 } 607 609
-678
drivers/memory/emif.c
··· 41 41 * @node: node in the device list 42 42 * @base: base address of memory-mapped IO registers. 43 43 * @dev: device pointer. 44 - * @addressing table with addressing information from the spec 45 44 * @regs_cache: An array of 'struct emif_regs' that stores 46 45 * calculated register values for different 47 46 * frequencies, to avoid re-calculating them on ··· 60 61 unsigned long irq_state; 61 62 void __iomem *base; 62 63 struct device *dev; 63 - const struct lpddr2_addressing *addressing; 64 64 struct emif_regs *regs_cache[EMIF_MAX_NUM_FREQUENCIES]; 65 65 struct emif_regs *curr_regs; 66 66 struct emif_platform_data *plat_data; ··· 70 72 static struct emif_data *emif1; 71 73 static DEFINE_SPINLOCK(emif_lock); 72 74 static unsigned long irq_state; 73 - static u32 t_ck; /* DDR clock period in ps */ 74 75 static LIST_HEAD(device_list); 75 76 76 77 #ifdef CONFIG_DEBUG_FS ··· 167 170 #endif 168 171 169 172 /* 170 - * Calculate the period of DDR clock from frequency value 171 - */ 172 - static void set_ddr_clk_period(u32 freq) 173 - { 174 - /* Divide 10^12 by frequency to get period in ps */ 175 - t_ck = (u32)DIV_ROUND_UP_ULL(1000000000000ull, freq); 176 - } 177 - 178 - /* 179 173 * Get bus width used by EMIF. Note that this may be different from the 180 174 * bus width of the DDR devices used. For instance two 16-bit DDR devices 181 175 * may be connected to a given CS of EMIF. In this case bus width as far ··· 182 194 width = width == 0 ? 32 : 16; 183 195 184 196 return width; 185 - } 186 - 187 - /* 188 - * Get the CL from SDRAM_CONFIG register 189 - */ 190 - static u32 get_cl(struct emif_data *emif) 191 - { 192 - u32 cl; 193 - void __iomem *base = emif->base; 194 - 195 - cl = (readl(base + EMIF_SDRAM_CONFIG) & CL_MASK) >> CL_SHIFT; 196 - 197 - return cl; 198 197 } 199 198 200 199 static void set_lpmode(struct emif_data *emif, u8 lpmode) ··· 303 328 return &lpddr2_jedec_addressing_table[index]; 304 329 } 305 330 306 - /* 307 - * Find the the right timing table from the array of timing 308 - * tables of the device using DDR clock frequency 309 - */ 310 - static const struct lpddr2_timings *get_timings_table(struct emif_data *emif, 311 - u32 freq) 312 - { 313 - u32 i, min, max, freq_nearest; 314 - const struct lpddr2_timings *timings = NULL; 315 - const struct lpddr2_timings *timings_arr = emif->plat_data->timings; 316 - struct device *dev = emif->dev; 317 - 318 - /* Start with a very high frequency - 1GHz */ 319 - freq_nearest = 1000000000; 320 - 321 - /* 322 - * Find the timings table such that: 323 - * 1. the frequency range covers the required frequency(safe) AND 324 - * 2. the max_freq is closest to the required frequency(optimal) 325 - */ 326 - for (i = 0; i < emif->plat_data->timings_arr_size; i++) { 327 - max = timings_arr[i].max_freq; 328 - min = timings_arr[i].min_freq; 329 - if ((freq >= min) && (freq <= max) && (max < freq_nearest)) { 330 - freq_nearest = max; 331 - timings = &timings_arr[i]; 332 - } 333 - } 334 - 335 - if (!timings) 336 - dev_err(dev, "%s: couldn't find timings for - %dHz\n", 337 - __func__, freq); 338 - 339 - dev_dbg(dev, "%s: timings table: freq %d, speed bin freq %d\n", 340 - __func__, freq, freq_nearest); 341 - 342 - return timings; 343 - } 344 - 345 - static u32 get_sdram_ref_ctrl_shdw(u32 freq, 346 - const struct lpddr2_addressing *addressing) 347 - { 348 - u32 ref_ctrl_shdw = 0, val = 0, freq_khz, t_refi; 349 - 350 - /* Scale down frequency and t_refi to avoid overflow */ 351 - freq_khz = freq / 1000; 352 - t_refi = addressing->tREFI_ns / 100; 353 - 354 - /* 355 - * refresh rate to be set is 'tREFI(in us) * freq in MHz 356 - * division by 10000 to account for change in units 357 - */ 358 - val = t_refi * freq_khz / 10000; 359 - ref_ctrl_shdw |= val << REFRESH_RATE_SHIFT; 360 - 361 - return ref_ctrl_shdw; 362 - } 363 - 364 - static u32 get_sdram_tim_1_shdw(const struct lpddr2_timings *timings, 365 - const struct lpddr2_min_tck *min_tck, 366 - const struct lpddr2_addressing *addressing) 367 - { 368 - u32 tim1 = 0, val = 0; 369 - 370 - val = max(min_tck->tWTR, DIV_ROUND_UP(timings->tWTR, t_ck)) - 1; 371 - tim1 |= val << T_WTR_SHIFT; 372 - 373 - if (addressing->num_banks == B8) 374 - val = DIV_ROUND_UP(timings->tFAW, t_ck*4); 375 - else 376 - val = max(min_tck->tRRD, DIV_ROUND_UP(timings->tRRD, t_ck)); 377 - tim1 |= (val - 1) << T_RRD_SHIFT; 378 - 379 - val = DIV_ROUND_UP(timings->tRAS_min + timings->tRPab, t_ck) - 1; 380 - tim1 |= val << T_RC_SHIFT; 381 - 382 - val = max(min_tck->tRASmin, DIV_ROUND_UP(timings->tRAS_min, t_ck)); 383 - tim1 |= (val - 1) << T_RAS_SHIFT; 384 - 385 - val = max(min_tck->tWR, DIV_ROUND_UP(timings->tWR, t_ck)) - 1; 386 - tim1 |= val << T_WR_SHIFT; 387 - 388 - val = max(min_tck->tRCD, DIV_ROUND_UP(timings->tRCD, t_ck)) - 1; 389 - tim1 |= val << T_RCD_SHIFT; 390 - 391 - val = max(min_tck->tRPab, DIV_ROUND_UP(timings->tRPab, t_ck)) - 1; 392 - tim1 |= val << T_RP_SHIFT; 393 - 394 - return tim1; 395 - } 396 - 397 - static u32 get_sdram_tim_1_shdw_derated(const struct lpddr2_timings *timings, 398 - const struct lpddr2_min_tck *min_tck, 399 - const struct lpddr2_addressing *addressing) 400 - { 401 - u32 tim1 = 0, val = 0; 402 - 403 - val = max(min_tck->tWTR, DIV_ROUND_UP(timings->tWTR, t_ck)) - 1; 404 - tim1 = val << T_WTR_SHIFT; 405 - 406 - /* 407 - * tFAW is approximately 4 times tRRD. So add 1875*4 = 7500ps 408 - * to tFAW for de-rating 409 - */ 410 - if (addressing->num_banks == B8) { 411 - val = DIV_ROUND_UP(timings->tFAW + 7500, 4 * t_ck) - 1; 412 - } else { 413 - val = DIV_ROUND_UP(timings->tRRD + 1875, t_ck); 414 - val = max(min_tck->tRRD, val) - 1; 415 - } 416 - tim1 |= val << T_RRD_SHIFT; 417 - 418 - val = DIV_ROUND_UP(timings->tRAS_min + timings->tRPab + 1875, t_ck); 419 - tim1 |= (val - 1) << T_RC_SHIFT; 420 - 421 - val = DIV_ROUND_UP(timings->tRAS_min + 1875, t_ck); 422 - val = max(min_tck->tRASmin, val) - 1; 423 - tim1 |= val << T_RAS_SHIFT; 424 - 425 - val = max(min_tck->tWR, DIV_ROUND_UP(timings->tWR, t_ck)) - 1; 426 - tim1 |= val << T_WR_SHIFT; 427 - 428 - val = max(min_tck->tRCD, DIV_ROUND_UP(timings->tRCD + 1875, t_ck)); 429 - tim1 |= (val - 1) << T_RCD_SHIFT; 430 - 431 - val = max(min_tck->tRPab, DIV_ROUND_UP(timings->tRPab + 1875, t_ck)); 432 - tim1 |= (val - 1) << T_RP_SHIFT; 433 - 434 - return tim1; 435 - } 436 - 437 - static u32 get_sdram_tim_2_shdw(const struct lpddr2_timings *timings, 438 - const struct lpddr2_min_tck *min_tck, 439 - const struct lpddr2_addressing *addressing, 440 - u32 type) 441 - { 442 - u32 tim2 = 0, val = 0; 443 - 444 - val = min_tck->tCKE - 1; 445 - tim2 |= val << T_CKE_SHIFT; 446 - 447 - val = max(min_tck->tRTP, DIV_ROUND_UP(timings->tRTP, t_ck)) - 1; 448 - tim2 |= val << T_RTP_SHIFT; 449 - 450 - /* tXSNR = tRFCab_ps + 10 ns(tRFCab_ps for LPDDR2). */ 451 - val = DIV_ROUND_UP(addressing->tRFCab_ps + 10000, t_ck) - 1; 452 - tim2 |= val << T_XSNR_SHIFT; 453 - 454 - /* XSRD same as XSNR for LPDDR2 */ 455 - tim2 |= val << T_XSRD_SHIFT; 456 - 457 - val = max(min_tck->tXP, DIV_ROUND_UP(timings->tXP, t_ck)) - 1; 458 - tim2 |= val << T_XP_SHIFT; 459 - 460 - return tim2; 461 - } 462 - 463 - static u32 get_sdram_tim_3_shdw(const struct lpddr2_timings *timings, 464 - const struct lpddr2_min_tck *min_tck, 465 - const struct lpddr2_addressing *addressing, 466 - u32 type, u32 ip_rev, u32 derated) 467 - { 468 - u32 tim3 = 0, val = 0, t_dqsck; 469 - 470 - val = timings->tRAS_max_ns / addressing->tREFI_ns - 1; 471 - val = val > 0xF ? 0xF : val; 472 - tim3 |= val << T_RAS_MAX_SHIFT; 473 - 474 - val = DIV_ROUND_UP(addressing->tRFCab_ps, t_ck) - 1; 475 - tim3 |= val << T_RFC_SHIFT; 476 - 477 - t_dqsck = (derated == EMIF_DERATED_TIMINGS) ? 478 - timings->tDQSCK_max_derated : timings->tDQSCK_max; 479 - if (ip_rev == EMIF_4D5) 480 - val = DIV_ROUND_UP(t_dqsck + 1000, t_ck) - 1; 481 - else 482 - val = DIV_ROUND_UP(t_dqsck, t_ck) - 1; 483 - 484 - tim3 |= val << T_TDQSCKMAX_SHIFT; 485 - 486 - val = DIV_ROUND_UP(timings->tZQCS, t_ck) - 1; 487 - tim3 |= val << ZQ_ZQCS_SHIFT; 488 - 489 - val = DIV_ROUND_UP(timings->tCKESR, t_ck); 490 - val = max(min_tck->tCKESR, val) - 1; 491 - tim3 |= val << T_CKESR_SHIFT; 492 - 493 - if (ip_rev == EMIF_4D5) { 494 - tim3 |= (EMIF_T_CSTA - 1) << T_CSTA_SHIFT; 495 - 496 - val = DIV_ROUND_UP(EMIF_T_PDLL_UL, 128) - 1; 497 - tim3 |= val << T_PDLL_UL_SHIFT; 498 - } 499 - 500 - return tim3; 501 - } 502 - 503 331 static u32 get_zq_config_reg(const struct lpddr2_addressing *addressing, 504 332 bool cs1_used, bool cal_resistors_per_cs) 505 333 { ··· 365 587 alert |= (cs1_used ? 1 : 0) << TA_CS1EN_SHIFT; 366 588 367 589 return alert; 368 - } 369 - 370 - static u32 get_read_idle_ctrl_shdw(u8 volt_ramp) 371 - { 372 - u32 idle = 0, val = 0; 373 - 374 - /* 375 - * Maximum value in normal conditions and increased frequency 376 - * when voltage is ramping 377 - */ 378 - if (volt_ramp) 379 - val = READ_IDLE_INTERVAL_DVFS / t_ck / 64 - 1; 380 - else 381 - val = 0x1FF; 382 - 383 - /* 384 - * READ_IDLE_CTRL register in EMIF4D has same offset and fields 385 - * as DLL_CALIB_CTRL in EMIF4D5, so use the same shifts 386 - */ 387 - idle |= val << DLL_CALIB_INTERVAL_SHIFT; 388 - idle |= EMIF_READ_IDLE_LEN_VAL << ACK_WAIT_SHIFT; 389 - 390 - return idle; 391 - } 392 - 393 - static u32 get_dll_calib_ctrl_shdw(u8 volt_ramp) 394 - { 395 - u32 calib = 0, val = 0; 396 - 397 - if (volt_ramp == DDR_VOLTAGE_RAMPING) 398 - val = DLL_CALIB_INTERVAL_DVFS / t_ck / 16 - 1; 399 - else 400 - val = 0; /* Disabled when voltage is stable */ 401 - 402 - calib |= val << DLL_CALIB_INTERVAL_SHIFT; 403 - calib |= DLL_CALIB_ACK_WAIT_VAL << ACK_WAIT_SHIFT; 404 - 405 - return calib; 406 - } 407 - 408 - static u32 get_ddr_phy_ctrl_1_attilaphy_4d(const struct lpddr2_timings *timings, 409 - u32 freq, u8 RL) 410 - { 411 - u32 phy = EMIF_DDR_PHY_CTRL_1_BASE_VAL_ATTILAPHY, val = 0; 412 - 413 - val = RL + DIV_ROUND_UP(timings->tDQSCK_max, t_ck) - 1; 414 - phy |= val << READ_LATENCY_SHIFT_4D; 415 - 416 - if (freq <= 100000000) 417 - val = EMIF_DLL_SLAVE_DLY_CTRL_100_MHZ_AND_LESS_ATTILAPHY; 418 - else if (freq <= 200000000) 419 - val = EMIF_DLL_SLAVE_DLY_CTRL_200_MHZ_ATTILAPHY; 420 - else 421 - val = EMIF_DLL_SLAVE_DLY_CTRL_400_MHZ_ATTILAPHY; 422 - 423 - phy |= val << DLL_SLAVE_DLY_CTRL_SHIFT_4D; 424 - 425 - return phy; 426 - } 427 - 428 - static u32 get_phy_ctrl_1_intelliphy_4d5(u32 freq, u8 cl) 429 - { 430 - u32 phy = EMIF_DDR_PHY_CTRL_1_BASE_VAL_INTELLIPHY, half_delay; 431 - 432 - /* 433 - * DLL operates at 266 MHz. If DDR frequency is near 266 MHz, 434 - * half-delay is not needed else set half-delay 435 - */ 436 - if (freq >= 265000000 && freq < 267000000) 437 - half_delay = 0; 438 - else 439 - half_delay = 1; 440 - 441 - phy |= half_delay << DLL_HALF_DELAY_SHIFT_4D5; 442 - phy |= ((cl + DIV_ROUND_UP(EMIF_PHY_TOTAL_READ_LATENCY_INTELLIPHY_PS, 443 - t_ck) - 1) << READ_LATENCY_SHIFT_4D5); 444 - 445 - return phy; 446 - } 447 - 448 - static u32 get_ext_phy_ctrl_2_intelliphy_4d5(void) 449 - { 450 - u32 fifo_we_slave_ratio; 451 - 452 - fifo_we_slave_ratio = DIV_ROUND_CLOSEST( 453 - EMIF_INTELLI_PHY_DQS_GATE_OPENING_DELAY_PS * 256, t_ck); 454 - 455 - return fifo_we_slave_ratio | fifo_we_slave_ratio << 11 | 456 - fifo_we_slave_ratio << 22; 457 - } 458 - 459 - static u32 get_ext_phy_ctrl_3_intelliphy_4d5(void) 460 - { 461 - u32 fifo_we_slave_ratio; 462 - 463 - fifo_we_slave_ratio = DIV_ROUND_CLOSEST( 464 - EMIF_INTELLI_PHY_DQS_GATE_OPENING_DELAY_PS * 256, t_ck); 465 - 466 - return fifo_we_slave_ratio >> 10 | fifo_we_slave_ratio << 1 | 467 - fifo_we_slave_ratio << 12 | fifo_we_slave_ratio << 23; 468 - } 469 - 470 - static u32 get_ext_phy_ctrl_4_intelliphy_4d5(void) 471 - { 472 - u32 fifo_we_slave_ratio; 473 - 474 - fifo_we_slave_ratio = DIV_ROUND_CLOSEST( 475 - EMIF_INTELLI_PHY_DQS_GATE_OPENING_DELAY_PS * 256, t_ck); 476 - 477 - return fifo_we_slave_ratio >> 9 | fifo_we_slave_ratio << 2 | 478 - fifo_we_slave_ratio << 13; 479 590 } 480 591 481 592 static u32 get_pwr_mgmt_ctrl(u32 freq, struct emif_data *emif, u32 ip_rev) ··· 486 819 /* if we get reserved value in MR4 persist with the existing value */ 487 820 if (likely(temperature_level != SDRAM_TEMP_RESERVED_4)) 488 821 emif->temperature_level = temperature_level; 489 - } 490 - 491 - /* 492 - * Program EMIF shadow registers that are not dependent on temperature 493 - * or voltage 494 - */ 495 - static void setup_registers(struct emif_data *emif, struct emif_regs *regs) 496 - { 497 - void __iomem *base = emif->base; 498 - 499 - writel(regs->sdram_tim2_shdw, base + EMIF_SDRAM_TIMING_2_SHDW); 500 - writel(regs->phy_ctrl_1_shdw, base + EMIF_DDR_PHY_CTRL_1_SHDW); 501 - writel(regs->pwr_mgmt_ctrl_shdw, 502 - base + EMIF_POWER_MANAGEMENT_CTRL_SHDW); 503 - 504 - /* Settings specific for EMIF4D5 */ 505 - if (emif->plat_data->ip_rev != EMIF_4D5) 506 - return; 507 - writel(regs->ext_phy_ctrl_2_shdw, base + EMIF_EXT_PHY_CTRL_2_SHDW); 508 - writel(regs->ext_phy_ctrl_3_shdw, base + EMIF_EXT_PHY_CTRL_3_SHDW); 509 - writel(regs->ext_phy_ctrl_4_shdw, base + EMIF_EXT_PHY_CTRL_4_SHDW); 510 - } 511 - 512 - /* 513 - * When voltage ramps dll calibration and forced read idle should 514 - * happen more often 515 - */ 516 - static void setup_volt_sensitive_regs(struct emif_data *emif, 517 - struct emif_regs *regs, u32 volt_state) 518 - { 519 - u32 calib_ctrl; 520 - void __iomem *base = emif->base; 521 - 522 - /* 523 - * EMIF_READ_IDLE_CTRL in EMIF4D refers to the same register as 524 - * EMIF_DLL_CALIB_CTRL in EMIF4D5 and dll_calib_ctrl_shadow_* 525 - * is an alias of the respective read_idle_ctrl_shdw_* (members of 526 - * a union). So, the below code takes care of both cases 527 - */ 528 - if (volt_state == DDR_VOLTAGE_RAMPING) 529 - calib_ctrl = regs->dll_calib_ctrl_shdw_volt_ramp; 530 - else 531 - calib_ctrl = regs->dll_calib_ctrl_shdw_normal; 532 - 533 - writel(calib_ctrl, base + EMIF_DLL_CALIB_CTRL_SHDW); 534 822 } 535 823 536 824 /* ··· 1130 1508 } 1131 1509 1132 1510 list_add(&emif->node, &device_list); 1133 - emif->addressing = get_addressing_table(emif->plat_data->device_info); 1134 1511 1135 1512 /* Save pointers to each other in emif and device structures */ 1136 1513 emif->dev = &pdev->dev; ··· 1182 1561 struct emif_data *emif = platform_get_drvdata(pdev); 1183 1562 1184 1563 disable_and_clear_all_interrupts(emif); 1185 - } 1186 - 1187 - static int get_emif_reg_values(struct emif_data *emif, u32 freq, 1188 - struct emif_regs *regs) 1189 - { 1190 - u32 ip_rev, phy_type; 1191 - u32 cl, type; 1192 - const struct lpddr2_timings *timings; 1193 - const struct lpddr2_min_tck *min_tck; 1194 - const struct ddr_device_info *device_info; 1195 - const struct lpddr2_addressing *addressing; 1196 - struct emif_data *emif_for_calc; 1197 - struct device *dev; 1198 - 1199 - dev = emif->dev; 1200 - /* 1201 - * If the devices on this EMIF instance is duplicate of EMIF1, 1202 - * use EMIF1 details for the calculation 1203 - */ 1204 - emif_for_calc = emif->duplicate ? emif1 : emif; 1205 - timings = get_timings_table(emif_for_calc, freq); 1206 - addressing = emif_for_calc->addressing; 1207 - if (!timings || !addressing) { 1208 - dev_err(dev, "%s: not enough data available for %dHz", 1209 - __func__, freq); 1210 - return -1; 1211 - } 1212 - 1213 - device_info = emif_for_calc->plat_data->device_info; 1214 - type = device_info->type; 1215 - ip_rev = emif_for_calc->plat_data->ip_rev; 1216 - phy_type = emif_for_calc->plat_data->phy_type; 1217 - 1218 - min_tck = emif_for_calc->plat_data->min_tck; 1219 - 1220 - set_ddr_clk_period(freq); 1221 - 1222 - regs->ref_ctrl_shdw = get_sdram_ref_ctrl_shdw(freq, addressing); 1223 - regs->sdram_tim1_shdw = get_sdram_tim_1_shdw(timings, min_tck, 1224 - addressing); 1225 - regs->sdram_tim2_shdw = get_sdram_tim_2_shdw(timings, min_tck, 1226 - addressing, type); 1227 - regs->sdram_tim3_shdw = get_sdram_tim_3_shdw(timings, min_tck, 1228 - addressing, type, ip_rev, EMIF_NORMAL_TIMINGS); 1229 - 1230 - cl = get_cl(emif); 1231 - 1232 - if (phy_type == EMIF_PHY_TYPE_ATTILAPHY && ip_rev == EMIF_4D) { 1233 - regs->phy_ctrl_1_shdw = get_ddr_phy_ctrl_1_attilaphy_4d( 1234 - timings, freq, cl); 1235 - } else if (phy_type == EMIF_PHY_TYPE_INTELLIPHY && ip_rev == EMIF_4D5) { 1236 - regs->phy_ctrl_1_shdw = get_phy_ctrl_1_intelliphy_4d5(freq, cl); 1237 - regs->ext_phy_ctrl_2_shdw = get_ext_phy_ctrl_2_intelliphy_4d5(); 1238 - regs->ext_phy_ctrl_3_shdw = get_ext_phy_ctrl_3_intelliphy_4d5(); 1239 - regs->ext_phy_ctrl_4_shdw = get_ext_phy_ctrl_4_intelliphy_4d5(); 1240 - } else { 1241 - return -1; 1242 - } 1243 - 1244 - /* Only timeout values in pwr_mgmt_ctrl_shdw register */ 1245 - regs->pwr_mgmt_ctrl_shdw = 1246 - get_pwr_mgmt_ctrl(freq, emif_for_calc, ip_rev) & 1247 - (CS_TIM_MASK | SR_TIM_MASK | PD_TIM_MASK); 1248 - 1249 - if (ip_rev & EMIF_4D) { 1250 - regs->read_idle_ctrl_shdw_normal = 1251 - get_read_idle_ctrl_shdw(DDR_VOLTAGE_STABLE); 1252 - 1253 - regs->read_idle_ctrl_shdw_volt_ramp = 1254 - get_read_idle_ctrl_shdw(DDR_VOLTAGE_RAMPING); 1255 - } else if (ip_rev & EMIF_4D5) { 1256 - regs->dll_calib_ctrl_shdw_normal = 1257 - get_dll_calib_ctrl_shdw(DDR_VOLTAGE_STABLE); 1258 - 1259 - regs->dll_calib_ctrl_shdw_volt_ramp = 1260 - get_dll_calib_ctrl_shdw(DDR_VOLTAGE_RAMPING); 1261 - } 1262 - 1263 - if (type == DDR_TYPE_LPDDR2_S2 || type == DDR_TYPE_LPDDR2_S4) { 1264 - regs->ref_ctrl_shdw_derated = get_sdram_ref_ctrl_shdw(freq / 4, 1265 - addressing); 1266 - 1267 - regs->sdram_tim1_shdw_derated = 1268 - get_sdram_tim_1_shdw_derated(timings, min_tck, 1269 - addressing); 1270 - 1271 - regs->sdram_tim3_shdw_derated = get_sdram_tim_3_shdw(timings, 1272 - min_tck, addressing, type, ip_rev, 1273 - EMIF_DERATED_TIMINGS); 1274 - } 1275 - 1276 - regs->freq = freq; 1277 - 1278 - return 0; 1279 - } 1280 - 1281 - /* 1282 - * get_regs() - gets the cached emif_regs structure for a given EMIF instance 1283 - * given frequency(freq): 1284 - * 1285 - * As an optimisation, every EMIF instance other than EMIF1 shares the 1286 - * register cache with EMIF1 if the devices connected on this instance 1287 - * are same as that on EMIF1(indicated by the duplicate flag) 1288 - * 1289 - * If we do not have an entry corresponding to the frequency given, we 1290 - * allocate a new entry and calculate the values 1291 - * 1292 - * Upon finding the right reg dump, save it in curr_regs. It can be 1293 - * directly used for thermal de-rating and voltage ramping changes. 1294 - */ 1295 - static struct emif_regs *get_regs(struct emif_data *emif, u32 freq) 1296 - { 1297 - int i; 1298 - struct emif_regs **regs_cache; 1299 - struct emif_regs *regs = NULL; 1300 - struct device *dev; 1301 - 1302 - dev = emif->dev; 1303 - if (emif->curr_regs && emif->curr_regs->freq == freq) { 1304 - dev_dbg(dev, "%s: using curr_regs - %u Hz", __func__, freq); 1305 - return emif->curr_regs; 1306 - } 1307 - 1308 - if (emif->duplicate) 1309 - regs_cache = emif1->regs_cache; 1310 - else 1311 - regs_cache = emif->regs_cache; 1312 - 1313 - for (i = 0; i < EMIF_MAX_NUM_FREQUENCIES && regs_cache[i]; i++) { 1314 - if (regs_cache[i]->freq == freq) { 1315 - regs = regs_cache[i]; 1316 - dev_dbg(dev, 1317 - "%s: reg dump found in reg cache for %u Hz\n", 1318 - __func__, freq); 1319 - break; 1320 - } 1321 - } 1322 - 1323 - /* 1324 - * If we don't have an entry for this frequency in the cache create one 1325 - * and calculate the values 1326 - */ 1327 - if (!regs) { 1328 - regs = devm_kzalloc(emif->dev, sizeof(*regs), GFP_ATOMIC); 1329 - if (!regs) 1330 - return NULL; 1331 - 1332 - if (get_emif_reg_values(emif, freq, regs)) { 1333 - devm_kfree(emif->dev, regs); 1334 - return NULL; 1335 - } 1336 - 1337 - /* 1338 - * Now look for an un-used entry in the cache and save the 1339 - * newly created struct. If there are no free entries 1340 - * over-write the last entry 1341 - */ 1342 - for (i = 0; i < EMIF_MAX_NUM_FREQUENCIES && regs_cache[i]; i++) 1343 - ; 1344 - 1345 - if (i >= EMIF_MAX_NUM_FREQUENCIES) { 1346 - dev_warn(dev, "%s: regs_cache full - reusing a slot!!\n", 1347 - __func__); 1348 - i = EMIF_MAX_NUM_FREQUENCIES - 1; 1349 - devm_kfree(emif->dev, regs_cache[i]); 1350 - } 1351 - regs_cache[i] = regs; 1352 - } 1353 - 1354 - return regs; 1355 - } 1356 - 1357 - static void do_volt_notify_handling(struct emif_data *emif, u32 volt_state) 1358 - { 1359 - dev_dbg(emif->dev, "%s: voltage notification : %d", __func__, 1360 - volt_state); 1361 - 1362 - if (!emif->curr_regs) { 1363 - dev_err(emif->dev, 1364 - "%s: volt-notify before registers are ready: %d\n", 1365 - __func__, volt_state); 1366 - return; 1367 - } 1368 - 1369 - setup_volt_sensitive_regs(emif, emif->curr_regs, volt_state); 1370 - } 1371 - 1372 - /* 1373 - * TODO: voltage notify handling should be hooked up to 1374 - * regulator framework as soon as the necessary support 1375 - * is available in mainline kernel. This function is un-used 1376 - * right now. 1377 - */ 1378 - static void __attribute__((unused)) volt_notify_handling(u32 volt_state) 1379 - { 1380 - struct emif_data *emif; 1381 - 1382 - spin_lock_irqsave(&emif_lock, irq_state); 1383 - 1384 - list_for_each_entry(emif, &device_list, node) 1385 - do_volt_notify_handling(emif, volt_state); 1386 - do_freq_update(); 1387 - 1388 - spin_unlock_irqrestore(&emif_lock, irq_state); 1389 - } 1390 - 1391 - static void do_freq_pre_notify_handling(struct emif_data *emif, u32 new_freq) 1392 - { 1393 - struct emif_regs *regs; 1394 - 1395 - regs = get_regs(emif, new_freq); 1396 - if (!regs) 1397 - return; 1398 - 1399 - emif->curr_regs = regs; 1400 - 1401 - /* 1402 - * Update the shadow registers: 1403 - * Temperature and voltage-ramp sensitive settings are also configured 1404 - * in terms of DDR cycles. So, we need to update them too when there 1405 - * is a freq change 1406 - */ 1407 - dev_dbg(emif->dev, "%s: setting up shadow registers for %uHz", 1408 - __func__, new_freq); 1409 - setup_registers(emif, regs); 1410 - setup_temperature_sensitive_regs(emif, regs); 1411 - setup_volt_sensitive_regs(emif, regs, DDR_VOLTAGE_STABLE); 1412 - 1413 - /* 1414 - * Part of workaround for errata i728. See do_freq_update() 1415 - * for more details 1416 - */ 1417 - if (emif->lpmode == EMIF_LP_MODE_SELF_REFRESH) 1418 - set_lpmode(emif, EMIF_LP_MODE_DISABLE); 1419 - } 1420 - 1421 - /* 1422 - * TODO: frequency notify handling should be hooked up to 1423 - * clock framework as soon as the necessary support is 1424 - * available in mainline kernel. This function is un-used 1425 - * right now. 1426 - */ 1427 - static void __attribute__((unused)) freq_pre_notify_handling(u32 new_freq) 1428 - { 1429 - struct emif_data *emif; 1430 - 1431 - /* 1432 - * NOTE: we are taking the spin-lock here and releases it 1433 - * only in post-notifier. This doesn't look good and 1434 - * Sparse complains about it, but this seems to be 1435 - * un-avoidable. We need to lock a sequence of events 1436 - * that is split between EMIF and clock framework. 1437 - * 1438 - * 1. EMIF driver updates EMIF timings in shadow registers in the 1439 - * frequency pre-notify callback from clock framework 1440 - * 2. clock framework sets up the registers for the new frequency 1441 - * 3. clock framework initiates a hw-sequence that updates 1442 - * the frequency EMIF timings synchronously. 1443 - * 1444 - * All these 3 steps should be performed as an atomic operation 1445 - * vis-a-vis similar sequence in the EMIF interrupt handler 1446 - * for temperature events. Otherwise, there could be race 1447 - * conditions that could result in incorrect EMIF timings for 1448 - * a given frequency 1449 - */ 1450 - spin_lock_irqsave(&emif_lock, irq_state); 1451 - 1452 - list_for_each_entry(emif, &device_list, node) 1453 - do_freq_pre_notify_handling(emif, new_freq); 1454 - } 1455 - 1456 - static void do_freq_post_notify_handling(struct emif_data *emif) 1457 - { 1458 - /* 1459 - * Part of workaround for errata i728. See do_freq_update() 1460 - * for more details 1461 - */ 1462 - if (emif->lpmode == EMIF_LP_MODE_SELF_REFRESH) 1463 - set_lpmode(emif, EMIF_LP_MODE_SELF_REFRESH); 1464 - } 1465 - 1466 - /* 1467 - * TODO: frequency notify handling should be hooked up to 1468 - * clock framework as soon as the necessary support is 1469 - * available in mainline kernel. This function is un-used 1470 - * right now. 1471 - */ 1472 - static void __attribute__((unused)) freq_post_notify_handling(void) 1473 - { 1474 - struct emif_data *emif; 1475 - 1476 - list_for_each_entry(emif, &device_list, node) 1477 - do_freq_post_notify_handling(emif); 1478 - 1479 - /* 1480 - * Lock is done in pre-notify handler. See freq_pre_notify_handling() 1481 - * for more details 1482 - */ 1483 - spin_unlock_irqrestore(&emif_lock, irq_state); 1484 1564 } 1485 1565 1486 1566 #if defined(CONFIG_OF)
+4 -4
drivers/memory/fsl_ifc.c
··· 97 97 iounmap(ctrl->gregs); 98 98 99 99 dev_set_drvdata(&dev->dev, NULL); 100 - kfree(ctrl); 101 100 102 101 return 0; 103 102 } ··· 208 209 209 210 dev_info(&dev->dev, "Freescale Integrated Flash Controller\n"); 210 211 211 - fsl_ifc_ctrl_dev = kzalloc(sizeof(*fsl_ifc_ctrl_dev), GFP_KERNEL); 212 + fsl_ifc_ctrl_dev = devm_kzalloc(&dev->dev, sizeof(*fsl_ifc_ctrl_dev), 213 + GFP_KERNEL); 212 214 if (!fsl_ifc_ctrl_dev) 213 215 return -ENOMEM; 214 216 ··· 219 219 fsl_ifc_ctrl_dev->gregs = of_iomap(dev->dev.of_node, 0); 220 220 if (!fsl_ifc_ctrl_dev->gregs) { 221 221 dev_err(&dev->dev, "failed to get memory region\n"); 222 - ret = -ENODEV; 223 - goto err; 222 + return -ENODEV; 224 223 } 225 224 226 225 if (of_property_read_bool(dev->dev.of_node, "little-endian")) { ··· 294 295 free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev); 295 296 irq_dispose_mapping(fsl_ifc_ctrl_dev->irq); 296 297 err: 298 + iounmap(fsl_ifc_ctrl_dev->gregs); 297 299 return ret; 298 300 } 299 301
+1
drivers/memory/pl353-smc.c
··· 116 116 break; 117 117 } 118 118 if (!match) { 119 + err = -ENODEV; 119 120 dev_err(&adev->dev, "no matching children\n"); 120 121 goto disable_mem_clk; 121 122 }
+4
drivers/memory/stm32-fmc2-ebi.c
··· 1048 1048 if (ret) { 1049 1049 dev_err(dev, "could not retrieve reg property: %d\n", 1050 1050 ret); 1051 + of_node_put(child); 1051 1052 return ret; 1052 1053 } 1053 1054 1054 1055 if (bank >= FMC2_MAX_BANKS) { 1055 1056 dev_err(dev, "invalid reg value: %d\n", bank); 1057 + of_node_put(child); 1056 1058 return -EINVAL; 1057 1059 } 1058 1060 1059 1061 if (ebi->bank_assigned & BIT(bank)) { 1060 1062 dev_err(dev, "bank already assigned: %d\n", bank); 1063 + of_node_put(child); 1061 1064 return -EINVAL; 1062 1065 } 1063 1066 ··· 1069 1066 if (ret) { 1070 1067 dev_err(dev, "setup chip select %d failed: %d\n", 1071 1068 bank, ret); 1069 + of_node_put(child); 1072 1070 return ret; 1073 1071 } 1074 1072 }
+11 -7
drivers/memory/tegra/Kconfig
··· 2 2 config TEGRA_MC 3 3 bool "NVIDIA Tegra Memory Controller support" 4 4 default y 5 - depends on ARCH_TEGRA 5 + depends on ARCH_TEGRA || (COMPILE_TEST && COMMON_CLK) 6 6 select INTERCONNECT 7 7 help 8 8 This driver supports the Memory Controller (MC) hardware found on 9 9 NVIDIA Tegra SoCs. 10 10 11 + if TEGRA_MC 12 + 11 13 config TEGRA20_EMC 12 14 tristate "NVIDIA Tegra20 External Memory Controller driver" 13 15 default y 14 - depends on TEGRA_MC && ARCH_TEGRA_2x_SOC 16 + depends on ARCH_TEGRA_2x_SOC || COMPILE_TEST 15 17 select DEVFREQ_GOV_SIMPLE_ONDEMAND 16 18 select PM_DEVFREQ 17 19 help ··· 25 23 config TEGRA30_EMC 26 24 tristate "NVIDIA Tegra30 External Memory Controller driver" 27 25 default y 28 - depends on TEGRA_MC && ARCH_TEGRA_3x_SOC 26 + depends on ARCH_TEGRA_3x_SOC || COMPILE_TEST 29 27 select PM_OPP 30 28 help 31 29 This driver is for the External Memory Controller (EMC) found on ··· 36 34 config TEGRA124_EMC 37 35 tristate "NVIDIA Tegra124 External Memory Controller driver" 38 36 default y 39 - depends on TEGRA_MC && ARCH_TEGRA_124_SOC 40 - select TEGRA124_CLK_EMC 37 + depends on ARCH_TEGRA_124_SOC || COMPILE_TEST 38 + select TEGRA124_CLK_EMC if ARCH_TEGRA 41 39 select PM_OPP 42 40 help 43 41 This driver is for the External Memory Controller (EMC) found on ··· 47 45 48 46 config TEGRA210_EMC_TABLE 49 47 bool 50 - depends on ARCH_TEGRA_210_SOC 48 + depends on ARCH_TEGRA_210_SOC || COMPILE_TEST 51 49 52 50 config TEGRA210_EMC 53 51 tristate "NVIDIA Tegra210 External Memory Controller driver" 54 - depends on TEGRA_MC && ARCH_TEGRA_210_SOC 52 + depends on ARCH_TEGRA_210_SOC || COMPILE_TEST 55 53 select TEGRA210_EMC_TABLE 56 54 help 57 55 This driver is for the External Memory Controller (EMC) found on 58 56 Tegra210 chips. The EMC controls the external DRAM on the board. 59 57 This driver is required to change memory timings / clock rate for 60 58 external memory. 59 + 60 + endif
+4 -2
drivers/memory/tegra/Makefile
··· 7 7 tegra-mc-$(CONFIG_ARCH_TEGRA_124_SOC) += tegra124.o 8 8 tegra-mc-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra124.o 9 9 tegra-mc-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210.o 10 + tegra-mc-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186.o 11 + tegra-mc-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra186.o tegra194.o 10 12 11 13 obj-$(CONFIG_TEGRA_MC) += tegra-mc.o 12 14 ··· 17 15 obj-$(CONFIG_TEGRA124_EMC) += tegra124-emc.o 18 16 obj-$(CONFIG_TEGRA210_EMC_TABLE) += tegra210-emc-table.o 19 17 obj-$(CONFIG_TEGRA210_EMC) += tegra210-emc.o 20 - obj-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186.o tegra186-emc.o 21 - obj-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra186.o tegra186-emc.o 18 + obj-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186-emc.o 19 + obj-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra186-emc.o 22 20 23 21 tegra210-emc-y := tegra210-emc-core.o tegra210-emc-cc-r21021.o
+138 -199
drivers/memory/tegra/mc.c
··· 39 39 #ifdef CONFIG_ARCH_TEGRA_210_SOC 40 40 { .compatible = "nvidia,tegra210-mc", .data = &tegra210_mc_soc }, 41 41 #endif 42 - { } 42 + #ifdef CONFIG_ARCH_TEGRA_186_SOC 43 + { .compatible = "nvidia,tegra186-mc", .data = &tegra186_mc_soc }, 44 + #endif 45 + #ifdef CONFIG_ARCH_TEGRA_194_SOC 46 + { .compatible = "nvidia,tegra194-mc", .data = &tegra194_mc_soc }, 47 + #endif 48 + { /* sentinel */ } 43 49 }; 44 50 MODULE_DEVICE_TABLE(of, tegra_mc_of_match); 45 51 ··· 96 90 return mc; 97 91 } 98 92 EXPORT_SYMBOL_GPL(devm_tegra_memory_controller_get); 93 + 94 + int tegra_mc_probe_device(struct tegra_mc *mc, struct device *dev) 95 + { 96 + if (mc->soc->ops && mc->soc->ops->probe_device) 97 + return mc->soc->ops->probe_device(mc, dev); 98 + 99 + return 0; 100 + } 101 + EXPORT_SYMBOL_GPL(tegra_mc_probe_device); 99 102 100 103 static int tegra_mc_block_dma_common(struct tegra_mc *mc, 101 104 const struct tegra_mc_reset *rst) ··· 314 299 return 0; 315 300 } 316 301 317 - static int tegra_mc_setup_latency_allowance(struct tegra_mc *mc) 318 - { 319 - unsigned long long tick; 320 - unsigned int i; 321 - u32 value; 322 - 323 - /* compute the number of MC clock cycles per tick */ 324 - tick = (unsigned long long)mc->tick * clk_get_rate(mc->clk); 325 - do_div(tick, NSEC_PER_SEC); 326 - 327 - value = mc_readl(mc, MC_EMEM_ARB_CFG); 328 - value &= ~MC_EMEM_ARB_CFG_CYCLES_PER_UPDATE_MASK; 329 - value |= MC_EMEM_ARB_CFG_CYCLES_PER_UPDATE(tick); 330 - mc_writel(mc, value, MC_EMEM_ARB_CFG); 331 - 332 - /* write latency allowance defaults */ 333 - for (i = 0; i < mc->soc->num_clients; i++) { 334 - const struct tegra_mc_la *la = &mc->soc->clients[i].la; 335 - u32 value; 336 - 337 - value = mc_readl(mc, la->reg); 338 - value &= ~(la->mask << la->shift); 339 - value |= (la->def & la->mask) << la->shift; 340 - mc_writel(mc, value, la->reg); 341 - } 342 - 343 - /* latch new values */ 344 - mc_writel(mc, MC_TIMING_UPDATE, MC_TIMING_CONTROL); 345 - 346 - return 0; 347 - } 348 - 349 302 int tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate) 350 303 { 351 304 unsigned int i; ··· 350 367 return dram_count; 351 368 } 352 369 EXPORT_SYMBOL_GPL(tegra_mc_get_emem_device_count); 370 + 371 + #if defined(CONFIG_ARCH_TEGRA_3x_SOC) || \ 372 + defined(CONFIG_ARCH_TEGRA_114_SOC) || \ 373 + defined(CONFIG_ARCH_TEGRA_124_SOC) || \ 374 + defined(CONFIG_ARCH_TEGRA_132_SOC) || \ 375 + defined(CONFIG_ARCH_TEGRA_210_SOC) 376 + static int tegra_mc_setup_latency_allowance(struct tegra_mc *mc) 377 + { 378 + unsigned long long tick; 379 + unsigned int i; 380 + u32 value; 381 + 382 + /* compute the number of MC clock cycles per tick */ 383 + tick = (unsigned long long)mc->tick * clk_get_rate(mc->clk); 384 + do_div(tick, NSEC_PER_SEC); 385 + 386 + value = mc_readl(mc, MC_EMEM_ARB_CFG); 387 + value &= ~MC_EMEM_ARB_CFG_CYCLES_PER_UPDATE_MASK; 388 + value |= MC_EMEM_ARB_CFG_CYCLES_PER_UPDATE(tick); 389 + mc_writel(mc, value, MC_EMEM_ARB_CFG); 390 + 391 + /* write latency allowance defaults */ 392 + for (i = 0; i < mc->soc->num_clients; i++) { 393 + const struct tegra_mc_client *client = &mc->soc->clients[i]; 394 + u32 value; 395 + 396 + value = mc_readl(mc, client->regs.la.reg); 397 + value &= ~(client->regs.la.mask << client->regs.la.shift); 398 + value |= (client->regs.la.def & client->regs.la.mask) << client->regs.la.shift; 399 + mc_writel(mc, value, client->regs.la.reg); 400 + } 401 + 402 + /* latch new values */ 403 + mc_writel(mc, MC_TIMING_UPDATE, MC_TIMING_CONTROL); 404 + 405 + return 0; 406 + } 353 407 354 408 static int load_one_timing(struct tegra_mc *mc, 355 409 struct tegra_mc_timing *timing, ··· 479 459 return 0; 480 460 } 481 461 482 - static const char *const status_names[32] = { 483 - [ 1] = "External interrupt", 484 - [ 6] = "EMEM address decode error", 485 - [ 7] = "GART page fault", 486 - [ 8] = "Security violation", 487 - [ 9] = "EMEM arbitration error", 488 - [10] = "Page fault", 489 - [11] = "Invalid APB ASID update", 490 - [12] = "VPR violation", 491 - [13] = "Secure carveout violation", 492 - [16] = "MTS carveout violation", 493 - }; 462 + int tegra30_mc_probe(struct tegra_mc *mc) 463 + { 464 + int err; 494 465 495 - static const char *const error_names[8] = { 496 - [2] = "EMEM decode error", 497 - [3] = "TrustZone violation", 498 - [4] = "Carveout violation", 499 - [6] = "SMMU translation error", 500 - }; 466 + mc->clk = devm_clk_get_optional(mc->dev, "mc"); 467 + if (IS_ERR(mc->clk)) { 468 + dev_err(mc->dev, "failed to get MC clock: %ld\n", PTR_ERR(mc->clk)); 469 + return PTR_ERR(mc->clk); 470 + } 501 471 502 - static irqreturn_t tegra_mc_irq(int irq, void *data) 472 + /* ensure that debug features are disabled */ 473 + mc_writel(mc, 0x00000000, MC_TIMING_CONTROL_DBG); 474 + 475 + err = tegra_mc_setup_latency_allowance(mc); 476 + if (err < 0) { 477 + dev_err(mc->dev, "failed to setup latency allowance: %d\n", err); 478 + return err; 479 + } 480 + 481 + err = tegra_mc_setup_timings(mc); 482 + if (err < 0) { 483 + dev_err(mc->dev, "failed to setup timings: %d\n", err); 484 + return err; 485 + } 486 + 487 + return 0; 488 + } 489 + 490 + static irqreturn_t tegra30_mc_handle_irq(int irq, void *data) 503 491 { 504 492 struct tegra_mc *mc = data; 505 493 unsigned long status; ··· 519 491 return IRQ_NONE; 520 492 521 493 for_each_set_bit(bit, &status, 32) { 522 - const char *error = status_names[bit] ?: "unknown"; 494 + const char *error = tegra_mc_status_names[bit] ?: "unknown"; 523 495 const char *client = "unknown", *desc; 524 496 const char *direction, *secure; 525 497 phys_addr_t addr = 0; ··· 559 531 560 532 type = (value & MC_ERR_STATUS_TYPE_MASK) >> 561 533 MC_ERR_STATUS_TYPE_SHIFT; 562 - desc = error_names[type]; 534 + desc = tegra_mc_error_names[type]; 563 535 564 536 switch (value & MC_ERR_STATUS_TYPE_MASK) { 565 537 case MC_ERR_STATUS_TYPE_INVALID_SMMU_PAGE: ··· 604 576 return IRQ_HANDLED; 605 577 } 606 578 607 - static __maybe_unused irqreturn_t tegra20_mc_irq(int irq, void *data) 608 - { 609 - struct tegra_mc *mc = data; 610 - unsigned long status; 611 - unsigned int bit; 579 + const struct tegra_mc_ops tegra30_mc_ops = { 580 + .probe = tegra30_mc_probe, 581 + .handle_irq = tegra30_mc_handle_irq, 582 + }; 583 + #endif 612 584 613 - /* mask all interrupts to avoid flooding */ 614 - status = mc_readl(mc, MC_INTSTATUS) & mc->soc->intmask; 615 - if (!status) 616 - return IRQ_NONE; 585 + const char *const tegra_mc_status_names[32] = { 586 + [ 1] = "External interrupt", 587 + [ 6] = "EMEM address decode error", 588 + [ 7] = "GART page fault", 589 + [ 8] = "Security violation", 590 + [ 9] = "EMEM arbitration error", 591 + [10] = "Page fault", 592 + [11] = "Invalid APB ASID update", 593 + [12] = "VPR violation", 594 + [13] = "Secure carveout violation", 595 + [16] = "MTS carveout violation", 596 + }; 617 597 618 - for_each_set_bit(bit, &status, 32) { 619 - const char *direction = "read", *secure = ""; 620 - const char *error = status_names[bit]; 621 - const char *client, *desc; 622 - phys_addr_t addr; 623 - u32 value, reg; 624 - u8 id, type; 625 - 626 - switch (BIT(bit)) { 627 - case MC_INT_DECERR_EMEM: 628 - reg = MC_DECERR_EMEM_OTHERS_STATUS; 629 - value = mc_readl(mc, reg); 630 - 631 - id = value & mc->soc->client_id_mask; 632 - desc = error_names[2]; 633 - 634 - if (value & BIT(31)) 635 - direction = "write"; 636 - break; 637 - 638 - case MC_INT_INVALID_GART_PAGE: 639 - reg = MC_GART_ERROR_REQ; 640 - value = mc_readl(mc, reg); 641 - 642 - id = (value >> 1) & mc->soc->client_id_mask; 643 - desc = error_names[2]; 644 - 645 - if (value & BIT(0)) 646 - direction = "write"; 647 - break; 648 - 649 - case MC_INT_SECURITY_VIOLATION: 650 - reg = MC_SECURITY_VIOLATION_STATUS; 651 - value = mc_readl(mc, reg); 652 - 653 - id = value & mc->soc->client_id_mask; 654 - type = (value & BIT(30)) ? 4 : 3; 655 - desc = error_names[type]; 656 - secure = "secure "; 657 - 658 - if (value & BIT(31)) 659 - direction = "write"; 660 - break; 661 - 662 - default: 663 - continue; 664 - } 665 - 666 - client = mc->soc->clients[id].name; 667 - addr = mc_readl(mc, reg + sizeof(u32)); 668 - 669 - dev_err_ratelimited(mc->dev, "%s: %s%s @%pa: %s (%s)\n", 670 - client, secure, direction, &addr, error, 671 - desc); 672 - } 673 - 674 - /* clear interrupts */ 675 - mc_writel(mc, status, MC_INTSTATUS); 676 - 677 - return IRQ_HANDLED; 678 - } 598 + const char *const tegra_mc_error_names[8] = { 599 + [2] = "EMEM decode error", 600 + [3] = "TrustZone violation", 601 + [4] = "Carveout violation", 602 + [6] = "SMMU translation error", 603 + }; 679 604 680 605 /* 681 606 * Memory Controller (MC) has few Memory Clients that are issuing memory ··· 729 748 { 730 749 struct resource *res; 731 750 struct tegra_mc *mc; 732 - void *isr; 733 751 u64 mask; 734 752 int err; 735 753 ··· 757 777 if (IS_ERR(mc->regs)) 758 778 return PTR_ERR(mc->regs); 759 779 760 - mc->clk = devm_clk_get(&pdev->dev, "mc"); 761 - if (IS_ERR(mc->clk)) { 762 - dev_err(&pdev->dev, "failed to get MC clock: %ld\n", 763 - PTR_ERR(mc->clk)); 764 - return PTR_ERR(mc->clk); 765 - } 766 - 767 - #ifdef CONFIG_ARCH_TEGRA_2x_SOC 768 - if (mc->soc == &tegra20_mc_soc) { 769 - isr = tegra20_mc_irq; 770 - } else 771 - #endif 772 - { 773 - /* ensure that debug features are disabled */ 774 - mc_writel(mc, 0x00000000, MC_TIMING_CONTROL_DBG); 775 - 776 - err = tegra_mc_setup_latency_allowance(mc); 777 - if (err < 0) { 778 - dev_err(&pdev->dev, 779 - "failed to setup latency allowance: %d\n", 780 - err); 781 - return err; 782 - } 783 - 784 - isr = tegra_mc_irq; 785 - 786 - err = tegra_mc_setup_timings(mc); 787 - if (err < 0) { 788 - dev_err(&pdev->dev, "failed to setup timings: %d\n", 789 - err); 790 - return err; 791 - } 792 - } 793 - 794 - mc->irq = platform_get_irq(pdev, 0); 795 - if (mc->irq < 0) 796 - return mc->irq; 797 - 798 - WARN(!mc->soc->client_id_mask, "missing client ID mask for this SoC\n"); 799 - 800 - mc_writel(mc, mc->soc->intmask, MC_INTMASK); 801 - 802 - err = devm_request_irq(&pdev->dev, mc->irq, isr, 0, 803 - dev_name(&pdev->dev), mc); 804 - if (err < 0) { 805 - dev_err(&pdev->dev, "failed to request IRQ#%u: %d\n", mc->irq, 806 - err); 807 - return err; 808 - } 809 - 810 780 mc->debugfs.root = debugfs_create_dir("mc", NULL); 811 781 812 - if (mc->soc->init) { 813 - err = mc->soc->init(mc); 782 + if (mc->soc->ops && mc->soc->ops->probe) { 783 + err = mc->soc->ops->probe(mc); 814 784 if (err < 0) 815 - dev_err(&pdev->dev, "failed to initialize SoC driver: %d\n", 816 - err); 785 + return err; 817 786 } 818 787 819 - err = tegra_mc_reset_setup(mc); 820 - if (err < 0) 821 - dev_err(&pdev->dev, "failed to register reset controller: %d\n", 822 - err); 788 + if (mc->soc->ops && mc->soc->ops->handle_irq) { 789 + mc->irq = platform_get_irq(pdev, 0); 790 + if (mc->irq < 0) 791 + return mc->irq; 792 + 793 + WARN(!mc->soc->client_id_mask, "missing client ID mask for this SoC\n"); 794 + 795 + mc_writel(mc, mc->soc->intmask, MC_INTMASK); 796 + 797 + err = devm_request_irq(&pdev->dev, mc->irq, mc->soc->ops->handle_irq, 0, 798 + dev_name(&pdev->dev), mc); 799 + if (err < 0) { 800 + dev_err(&pdev->dev, "failed to request IRQ#%u: %d\n", mc->irq, 801 + err); 802 + return err; 803 + } 804 + } 805 + 806 + if (mc->soc->reset_ops) { 807 + err = tegra_mc_reset_setup(mc); 808 + if (err < 0) 809 + dev_err(&pdev->dev, "failed to register reset controller: %d\n", err); 810 + } 823 811 824 812 err = tegra_mc_interconnect_setup(mc); 825 813 if (err < 0) ··· 815 867 return 0; 816 868 } 817 869 818 - static int tegra_mc_suspend(struct device *dev) 870 + static int __maybe_unused tegra_mc_suspend(struct device *dev) 819 871 { 820 872 struct tegra_mc *mc = dev_get_drvdata(dev); 821 - int err; 822 873 823 - if (IS_ENABLED(CONFIG_TEGRA_IOMMU_GART) && mc->gart) { 824 - err = tegra_gart_suspend(mc->gart); 825 - if (err) 826 - return err; 827 - } 874 + if (mc->soc->ops && mc->soc->ops->suspend) 875 + return mc->soc->ops->suspend(mc); 828 876 829 877 return 0; 830 878 } 831 879 832 - static int tegra_mc_resume(struct device *dev) 880 + static int __maybe_unused tegra_mc_resume(struct device *dev) 833 881 { 834 882 struct tegra_mc *mc = dev_get_drvdata(dev); 835 - int err; 836 883 837 - if (IS_ENABLED(CONFIG_TEGRA_IOMMU_GART) && mc->gart) { 838 - err = tegra_gart_resume(mc->gart); 839 - if (err) 840 - return err; 841 - } 884 + if (mc->soc->ops && mc->soc->ops->resume) 885 + return mc->soc->ops->resume(mc); 842 886 843 887 return 0; 844 888 } 845 889 846 890 static const struct dev_pm_ops tegra_mc_pm_ops = { 847 - .suspend = tegra_mc_suspend, 848 - .resume = tegra_mc_resume, 891 + SET_SYSTEM_SLEEP_PM_OPS(tegra_mc_suspend, tegra_mc_resume) 849 892 }; 850 893 851 894 static struct platform_driver tegra_mc_driver = {
+25
drivers/memory/tegra/mc.h
··· 129 129 extern const struct tegra_mc_soc tegra210_mc_soc; 130 130 #endif 131 131 132 + #ifdef CONFIG_ARCH_TEGRA_186_SOC 133 + extern const struct tegra_mc_soc tegra186_mc_soc; 134 + #endif 135 + 136 + #ifdef CONFIG_ARCH_TEGRA_194_SOC 137 + extern const struct tegra_mc_soc tegra194_mc_soc; 138 + #endif 139 + 140 + #if defined(CONFIG_ARCH_TEGRA_3x_SOC) || \ 141 + defined(CONFIG_ARCH_TEGRA_114_SOC) || \ 142 + defined(CONFIG_ARCH_TEGRA_124_SOC) || \ 143 + defined(CONFIG_ARCH_TEGRA_132_SOC) || \ 144 + defined(CONFIG_ARCH_TEGRA_210_SOC) 145 + int tegra30_mc_probe(struct tegra_mc *mc); 146 + extern const struct tegra_mc_ops tegra30_mc_ops; 147 + #endif 148 + 149 + #if defined(CONFIG_ARCH_TEGRA_186_SOC) || \ 150 + defined(CONFIG_ARCH_TEGRA_194_SOC) 151 + extern const struct tegra_mc_ops tegra186_mc_ops; 152 + #endif 153 + 154 + extern const char * const tegra_mc_status_names[32]; 155 + extern const char * const tegra_mc_error_names[8]; 156 + 132 157 /* 133 158 * These IDs are for internal use of Tegra ICC drivers. The ID numbers are 134 159 * chosen such that they don't conflict with the device-tree ICC node IDs.
+688 -557
drivers/memory/tegra/tegra114.c
··· 15 15 .id = 0x00, 16 16 .name = "ptcr", 17 17 .swgroup = TEGRA_SWGROUP_PTC, 18 - .la = { 19 - .reg = 0x34c, 20 - .shift = 0, 21 - .mask = 0xff, 22 - .def = 0x0, 18 + .regs = { 19 + .la = { 20 + .reg = 0x34c, 21 + .shift = 0, 22 + .mask = 0xff, 23 + .def = 0x0, 24 + }, 23 25 }, 24 26 }, { 25 27 .id = 0x01, 26 28 .name = "display0a", 27 29 .swgroup = TEGRA_SWGROUP_DC, 28 - .smmu = { 29 - .reg = 0x228, 30 - .bit = 1, 31 - }, 32 - .la = { 33 - .reg = 0x2e8, 34 - .shift = 0, 35 - .mask = 0xff, 36 - .def = 0x4e, 30 + .regs = { 31 + .smmu = { 32 + .reg = 0x228, 33 + .bit = 1, 34 + }, 35 + .la = { 36 + .reg = 0x2e8, 37 + .shift = 0, 38 + .mask = 0xff, 39 + .def = 0x4e, 40 + }, 37 41 }, 38 42 }, { 39 43 .id = 0x02, 40 44 .name = "display0ab", 41 45 .swgroup = TEGRA_SWGROUP_DCB, 42 - .smmu = { 43 - .reg = 0x228, 44 - .bit = 2, 45 - }, 46 - .la = { 47 - .reg = 0x2f4, 48 - .shift = 0, 49 - .mask = 0xff, 50 - .def = 0x4e, 46 + .regs = { 47 + .smmu = { 48 + .reg = 0x228, 49 + .bit = 2, 50 + }, 51 + .la = { 52 + .reg = 0x2f4, 53 + .shift = 0, 54 + .mask = 0xff, 55 + .def = 0x4e, 56 + }, 51 57 }, 52 58 }, { 53 59 .id = 0x03, 54 60 .name = "display0b", 55 61 .swgroup = TEGRA_SWGROUP_DC, 56 - .smmu = { 57 - .reg = 0x228, 58 - .bit = 3, 59 - }, 60 - .la = { 61 - .reg = 0x2e8, 62 - .shift = 16, 63 - .mask = 0xff, 64 - .def = 0x4e, 62 + .regs = { 63 + .smmu = { 64 + .reg = 0x228, 65 + .bit = 3, 66 + }, 67 + .la = { 68 + .reg = 0x2e8, 69 + .shift = 16, 70 + .mask = 0xff, 71 + .def = 0x4e, 72 + }, 65 73 }, 66 74 }, { 67 75 .id = 0x04, 68 76 .name = "display0bb", 69 77 .swgroup = TEGRA_SWGROUP_DCB, 70 - .smmu = { 71 - .reg = 0x228, 72 - .bit = 4, 73 - }, 74 - .la = { 75 - .reg = 0x2f4, 76 - .shift = 16, 77 - .mask = 0xff, 78 - .def = 0x4e, 78 + .regs = { 79 + .smmu = { 80 + .reg = 0x228, 81 + .bit = 4, 82 + }, 83 + .la = { 84 + .reg = 0x2f4, 85 + .shift = 16, 86 + .mask = 0xff, 87 + .def = 0x4e, 88 + }, 79 89 }, 80 90 }, { 81 91 .id = 0x05, 82 92 .name = "display0c", 83 93 .swgroup = TEGRA_SWGROUP_DC, 84 - .smmu = { 85 - .reg = 0x228, 86 - .bit = 5, 87 - }, 88 - .la = { 89 - .reg = 0x2ec, 90 - .shift = 0, 91 - .mask = 0xff, 92 - .def = 0x4e, 94 + .regs = { 95 + .smmu = { 96 + .reg = 0x228, 97 + .bit = 5, 98 + }, 99 + .la = { 100 + .reg = 0x2ec, 101 + .shift = 0, 102 + .mask = 0xff, 103 + .def = 0x4e, 104 + }, 93 105 }, 94 106 }, { 95 107 .id = 0x06, 96 108 .name = "display0cb", 97 109 .swgroup = TEGRA_SWGROUP_DCB, 98 - .smmu = { 99 - .reg = 0x228, 100 - .bit = 6, 101 - }, 102 - .la = { 103 - .reg = 0x2f8, 104 - .shift = 0, 105 - .mask = 0xff, 106 - .def = 0x4e, 110 + .regs = { 111 + .smmu = { 112 + .reg = 0x228, 113 + .bit = 6, 114 + }, 115 + .la = { 116 + .reg = 0x2f8, 117 + .shift = 0, 118 + .mask = 0xff, 119 + .def = 0x4e, 120 + }, 107 121 }, 108 122 }, { 109 123 .id = 0x09, 110 124 .name = "eppup", 111 125 .swgroup = TEGRA_SWGROUP_EPP, 112 - .smmu = { 113 - .reg = 0x228, 114 - .bit = 9, 115 - }, 116 - .la = { 117 - .reg = 0x300, 118 - .shift = 0, 119 - .mask = 0xff, 120 - .def = 0x33, 126 + .regs = { 127 + .smmu = { 128 + .reg = 0x228, 129 + .bit = 9, 130 + }, 131 + .la = { 132 + .reg = 0x300, 133 + .shift = 0, 134 + .mask = 0xff, 135 + .def = 0x33, 136 + }, 121 137 }, 122 138 }, { 123 139 .id = 0x0a, 124 140 .name = "g2pr", 125 141 .swgroup = TEGRA_SWGROUP_G2, 126 - .smmu = { 127 - .reg = 0x228, 128 - .bit = 10, 129 - }, 130 - .la = { 131 - .reg = 0x308, 132 - .shift = 0, 133 - .mask = 0xff, 134 - .def = 0x09, 142 + .regs = { 143 + .smmu = { 144 + .reg = 0x228, 145 + .bit = 10, 146 + }, 147 + .la = { 148 + .reg = 0x308, 149 + .shift = 0, 150 + .mask = 0xff, 151 + .def = 0x09, 152 + }, 135 153 }, 136 154 }, { 137 155 .id = 0x0b, 138 156 .name = "g2sr", 139 157 .swgroup = TEGRA_SWGROUP_G2, 140 - .smmu = { 141 - .reg = 0x228, 142 - .bit = 11, 143 - }, 144 - .la = { 145 - .reg = 0x308, 146 - .shift = 16, 147 - .mask = 0xff, 148 - .def = 0x09, 158 + .regs = { 159 + .smmu = { 160 + .reg = 0x228, 161 + .bit = 11, 162 + }, 163 + .la = { 164 + .reg = 0x308, 165 + .shift = 16, 166 + .mask = 0xff, 167 + .def = 0x09, 168 + }, 149 169 }, 150 170 }, { 151 171 .id = 0x0f, 152 172 .name = "avpcarm7r", 153 173 .swgroup = TEGRA_SWGROUP_AVPC, 154 - .smmu = { 155 - .reg = 0x228, 156 - .bit = 15, 157 - }, 158 - .la = { 159 - .reg = 0x2e4, 160 - .shift = 0, 161 - .mask = 0xff, 162 - .def = 0x04, 174 + .regs = { 175 + .smmu = { 176 + .reg = 0x228, 177 + .bit = 15, 178 + }, 179 + .la = { 180 + .reg = 0x2e4, 181 + .shift = 0, 182 + .mask = 0xff, 183 + .def = 0x04, 184 + }, 163 185 }, 164 186 }, { 165 187 .id = 0x10, 166 188 .name = "displayhc", 167 189 .swgroup = TEGRA_SWGROUP_DC, 168 - .smmu = { 169 - .reg = 0x228, 170 - .bit = 16, 171 - }, 172 - .la = { 173 - .reg = 0x2f0, 174 - .shift = 0, 175 - .mask = 0xff, 176 - .def = 0x68, 190 + .regs = { 191 + .smmu = { 192 + .reg = 0x228, 193 + .bit = 16, 194 + }, 195 + .la = { 196 + .reg = 0x2f0, 197 + .shift = 0, 198 + .mask = 0xff, 199 + .def = 0x68, 200 + }, 177 201 }, 178 202 }, { 179 203 .id = 0x11, 180 204 .name = "displayhcb", 181 205 .swgroup = TEGRA_SWGROUP_DCB, 182 - .smmu = { 183 - .reg = 0x228, 184 - .bit = 17, 185 - }, 186 - .la = { 187 - .reg = 0x2fc, 188 - .shift = 0, 189 - .mask = 0xff, 190 - .def = 0x68, 206 + .regs = { 207 + .smmu = { 208 + .reg = 0x228, 209 + .bit = 17, 210 + }, 211 + .la = { 212 + .reg = 0x2fc, 213 + .shift = 0, 214 + .mask = 0xff, 215 + .def = 0x68, 216 + }, 191 217 }, 192 218 }, { 193 219 .id = 0x12, 194 220 .name = "fdcdrd", 195 221 .swgroup = TEGRA_SWGROUP_NV, 196 - .smmu = { 197 - .reg = 0x228, 198 - .bit = 18, 199 - }, 200 - .la = { 201 - .reg = 0x334, 202 - .shift = 0, 203 - .mask = 0xff, 204 - .def = 0x0c, 222 + .regs = { 223 + .smmu = { 224 + .reg = 0x228, 225 + .bit = 18, 226 + }, 227 + .la = { 228 + .reg = 0x334, 229 + .shift = 0, 230 + .mask = 0xff, 231 + .def = 0x0c, 232 + }, 205 233 }, 206 234 }, { 207 235 .id = 0x13, 208 236 .name = "fdcdrd2", 209 237 .swgroup = TEGRA_SWGROUP_NV, 210 - .smmu = { 211 - .reg = 0x228, 212 - .bit = 19, 213 - }, 214 - .la = { 215 - .reg = 0x33c, 216 - .shift = 0, 217 - .mask = 0xff, 218 - .def = 0x0c, 238 + .regs = { 239 + .smmu = { 240 + .reg = 0x228, 241 + .bit = 19, 242 + }, 243 + .la = { 244 + .reg = 0x33c, 245 + .shift = 0, 246 + .mask = 0xff, 247 + .def = 0x0c, 248 + }, 219 249 }, 220 250 }, { 221 251 .id = 0x14, 222 252 .name = "g2dr", 223 253 .swgroup = TEGRA_SWGROUP_G2, 224 - .smmu = { 225 - .reg = 0x228, 226 - .bit = 20, 227 - }, 228 - .la = { 229 - .reg = 0x30c, 230 - .shift = 0, 231 - .mask = 0xff, 232 - .def = 0x0a, 254 + .regs = { 255 + .smmu = { 256 + .reg = 0x228, 257 + .bit = 20, 258 + }, 259 + .la = { 260 + .reg = 0x30c, 261 + .shift = 0, 262 + .mask = 0xff, 263 + .def = 0x0a, 264 + }, 233 265 }, 234 266 }, { 235 267 .id = 0x15, 236 268 .name = "hdar", 237 269 .swgroup = TEGRA_SWGROUP_HDA, 238 - .smmu = { 239 - .reg = 0x228, 240 - .bit = 21, 241 - }, 242 - .la = { 243 - .reg = 0x318, 244 - .shift = 0, 245 - .mask = 0xff, 246 - .def = 0xff, 270 + .regs = { 271 + .smmu = { 272 + .reg = 0x228, 273 + .bit = 21, 274 + }, 275 + .la = { 276 + .reg = 0x318, 277 + .shift = 0, 278 + .mask = 0xff, 279 + .def = 0xff, 280 + }, 247 281 }, 248 282 }, { 249 283 .id = 0x16, 250 284 .name = "host1xdmar", 251 285 .swgroup = TEGRA_SWGROUP_HC, 252 - .smmu = { 253 - .reg = 0x228, 254 - .bit = 22, 255 - }, 256 - .la = { 257 - .reg = 0x310, 258 - .shift = 0, 259 - .mask = 0xff, 260 - .def = 0x10, 286 + .regs = { 287 + .smmu = { 288 + .reg = 0x228, 289 + .bit = 22, 290 + }, 291 + .la = { 292 + .reg = 0x310, 293 + .shift = 0, 294 + .mask = 0xff, 295 + .def = 0x10, 296 + }, 261 297 }, 262 298 }, { 263 299 .id = 0x17, 264 300 .name = "host1xr", 265 301 .swgroup = TEGRA_SWGROUP_HC, 266 - .smmu = { 267 - .reg = 0x228, 268 - .bit = 23, 269 - }, 270 - .la = { 271 - .reg = 0x310, 272 - .shift = 16, 273 - .mask = 0xff, 274 - .def = 0xa5, 302 + .regs = { 303 + .smmu = { 304 + .reg = 0x228, 305 + .bit = 23, 306 + }, 307 + .la = { 308 + .reg = 0x310, 309 + .shift = 16, 310 + .mask = 0xff, 311 + .def = 0xa5, 312 + }, 275 313 }, 276 314 }, { 277 315 .id = 0x18, 278 316 .name = "idxsrd", 279 317 .swgroup = TEGRA_SWGROUP_NV, 280 - .smmu = { 281 - .reg = 0x228, 282 - .bit = 24, 283 - }, 284 - .la = { 285 - .reg = 0x334, 286 - .shift = 16, 287 - .mask = 0xff, 288 - .def = 0x0b, 318 + .regs = { 319 + .smmu = { 320 + .reg = 0x228, 321 + .bit = 24, 322 + }, 323 + .la = { 324 + .reg = 0x334, 325 + .shift = 16, 326 + .mask = 0xff, 327 + .def = 0x0b, 328 + }, 289 329 }, 290 330 }, { 291 331 .id = 0x1c, 292 332 .name = "msencsrd", 293 333 .swgroup = TEGRA_SWGROUP_MSENC, 294 - .smmu = { 295 - .reg = 0x228, 296 - .bit = 28, 297 - }, 298 - .la = { 299 - .reg = 0x328, 300 - .shift = 0, 301 - .mask = 0xff, 302 - .def = 0x80, 334 + .regs = { 335 + .smmu = { 336 + .reg = 0x228, 337 + .bit = 28, 338 + }, 339 + .la = { 340 + .reg = 0x328, 341 + .shift = 0, 342 + .mask = 0xff, 343 + .def = 0x80, 344 + }, 303 345 }, 304 346 }, { 305 347 .id = 0x1d, 306 348 .name = "ppcsahbdmar", 307 349 .swgroup = TEGRA_SWGROUP_PPCS, 308 - .smmu = { 309 - .reg = 0x228, 310 - .bit = 29, 311 - }, 312 - .la = { 313 - .reg = 0x344, 314 - .shift = 0, 315 - .mask = 0xff, 316 - .def = 0x50, 350 + .regs = { 351 + .smmu = { 352 + .reg = 0x228, 353 + .bit = 29, 354 + }, 355 + .la = { 356 + .reg = 0x344, 357 + .shift = 0, 358 + .mask = 0xff, 359 + .def = 0x50, 360 + }, 317 361 }, 318 362 }, { 319 363 .id = 0x1e, 320 364 .name = "ppcsahbslvr", 321 365 .swgroup = TEGRA_SWGROUP_PPCS, 322 - .smmu = { 323 - .reg = 0x228, 324 - .bit = 30, 325 - }, 326 - .la = { 327 - .reg = 0x344, 328 - .shift = 16, 329 - .mask = 0xff, 330 - .def = 0xe8, 366 + .regs = { 367 + .smmu = { 368 + .reg = 0x228, 369 + .bit = 30, 370 + }, 371 + .la = { 372 + .reg = 0x344, 373 + .shift = 16, 374 + .mask = 0xff, 375 + .def = 0xe8, 376 + }, 331 377 }, 332 378 }, { 333 379 .id = 0x20, 334 380 .name = "texl2srd", 335 381 .swgroup = TEGRA_SWGROUP_NV, 336 - .smmu = { 337 - .reg = 0x22c, 338 - .bit = 0, 339 - }, 340 - .la = { 341 - .reg = 0x338, 342 - .shift = 0, 343 - .mask = 0xff, 344 - .def = 0x0c, 382 + .regs = { 383 + .smmu = { 384 + .reg = 0x22c, 385 + .bit = 0, 386 + }, 387 + .la = { 388 + .reg = 0x338, 389 + .shift = 0, 390 + .mask = 0xff, 391 + .def = 0x0c, 392 + }, 345 393 }, 346 394 }, { 347 395 .id = 0x22, 348 396 .name = "vdebsevr", 349 397 .swgroup = TEGRA_SWGROUP_VDE, 350 - .smmu = { 351 - .reg = 0x22c, 352 - .bit = 2, 353 - }, 354 - .la = { 355 - .reg = 0x354, 356 - .shift = 0, 357 - .mask = 0xff, 358 - .def = 0xff, 398 + .regs = { 399 + .smmu = { 400 + .reg = 0x22c, 401 + .bit = 2, 402 + }, 403 + .la = { 404 + .reg = 0x354, 405 + .shift = 0, 406 + .mask = 0xff, 407 + .def = 0xff, 408 + }, 359 409 }, 360 410 }, { 361 411 .id = 0x23, 362 412 .name = "vdember", 363 413 .swgroup = TEGRA_SWGROUP_VDE, 364 - .smmu = { 365 - .reg = 0x22c, 366 - .bit = 3, 367 - }, 368 - .la = { 369 - .reg = 0x354, 370 - .shift = 16, 371 - .mask = 0xff, 372 - .def = 0xff, 414 + .regs = { 415 + .smmu = { 416 + .reg = 0x22c, 417 + .bit = 3, 418 + }, 419 + .la = { 420 + .reg = 0x354, 421 + .shift = 16, 422 + .mask = 0xff, 423 + .def = 0xff, 424 + }, 373 425 }, 374 426 }, { 375 427 .id = 0x24, 376 428 .name = "vdemcer", 377 429 .swgroup = TEGRA_SWGROUP_VDE, 378 - .smmu = { 379 - .reg = 0x22c, 380 - .bit = 4, 381 - }, 382 - .la = { 383 - .reg = 0x358, 384 - .shift = 0, 385 - .mask = 0xff, 386 - .def = 0xb8, 430 + .regs = { 431 + .smmu = { 432 + .reg = 0x22c, 433 + .bit = 4, 434 + }, 435 + .la = { 436 + .reg = 0x358, 437 + .shift = 0, 438 + .mask = 0xff, 439 + .def = 0xb8, 440 + }, 387 441 }, 388 442 }, { 389 443 .id = 0x25, 390 444 .name = "vdetper", 391 445 .swgroup = TEGRA_SWGROUP_VDE, 392 - .smmu = { 393 - .reg = 0x22c, 394 - .bit = 5, 395 - }, 396 - .la = { 397 - .reg = 0x358, 398 - .shift = 16, 399 - .mask = 0xff, 400 - .def = 0xee, 446 + .regs = { 447 + .smmu = { 448 + .reg = 0x22c, 449 + .bit = 5, 450 + }, 451 + .la = { 452 + .reg = 0x358, 453 + .shift = 16, 454 + .mask = 0xff, 455 + .def = 0xee, 456 + }, 401 457 }, 402 458 }, { 403 459 .id = 0x26, 404 460 .name = "mpcorelpr", 405 461 .swgroup = TEGRA_SWGROUP_MPCORELP, 406 - .la = { 407 - .reg = 0x324, 408 - .shift = 0, 409 - .mask = 0xff, 410 - .def = 0x04, 462 + .regs = { 463 + .la = { 464 + .reg = 0x324, 465 + .shift = 0, 466 + .mask = 0xff, 467 + .def = 0x04, 468 + }, 411 469 }, 412 470 }, { 413 471 .id = 0x27, 414 472 .name = "mpcorer", 415 473 .swgroup = TEGRA_SWGROUP_MPCORE, 416 - .la = { 417 - .reg = 0x320, 418 - .shift = 0, 419 - .mask = 0xff, 420 - .def = 0x04, 474 + .regs = { 475 + .la = { 476 + .reg = 0x320, 477 + .shift = 0, 478 + .mask = 0xff, 479 + .def = 0x04, 480 + }, 421 481 }, 422 482 }, { 423 483 .id = 0x28, 424 484 .name = "eppu", 425 485 .swgroup = TEGRA_SWGROUP_EPP, 426 - .smmu = { 427 - .reg = 0x22c, 428 - .bit = 8, 429 - }, 430 - .la = { 431 - .reg = 0x300, 432 - .shift = 16, 433 - .mask = 0xff, 434 - .def = 0x33, 486 + .regs = { 487 + .smmu = { 488 + .reg = 0x22c, 489 + .bit = 8, 490 + }, 491 + .la = { 492 + .reg = 0x300, 493 + .shift = 16, 494 + .mask = 0xff, 495 + .def = 0x33, 496 + }, 435 497 }, 436 498 }, { 437 499 .id = 0x29, 438 500 .name = "eppv", 439 501 .swgroup = TEGRA_SWGROUP_EPP, 440 - .smmu = { 441 - .reg = 0x22c, 442 - .bit = 9, 443 - }, 444 - .la = { 445 - .reg = 0x304, 446 - .shift = 0, 447 - .mask = 0xff, 448 - .def = 0x6c, 502 + .regs = { 503 + .smmu = { 504 + .reg = 0x22c, 505 + .bit = 9, 506 + }, 507 + .la = { 508 + .reg = 0x304, 509 + .shift = 0, 510 + .mask = 0xff, 511 + .def = 0x6c, 512 + }, 449 513 }, 450 514 }, { 451 515 .id = 0x2a, 452 516 .name = "eppy", 453 517 .swgroup = TEGRA_SWGROUP_EPP, 454 - .smmu = { 455 - .reg = 0x22c, 456 - .bit = 10, 457 - }, 458 - .la = { 459 - .reg = 0x304, 460 - .shift = 16, 461 - .mask = 0xff, 462 - .def = 0x6c, 518 + .regs = { 519 + .smmu = { 520 + .reg = 0x22c, 521 + .bit = 10, 522 + }, 523 + .la = { 524 + .reg = 0x304, 525 + .shift = 16, 526 + .mask = 0xff, 527 + .def = 0x6c, 528 + }, 463 529 }, 464 530 }, { 465 531 .id = 0x2b, 466 532 .name = "msencswr", 467 533 .swgroup = TEGRA_SWGROUP_MSENC, 468 - .smmu = { 469 - .reg = 0x22c, 470 - .bit = 11, 471 - }, 472 - .la = { 473 - .reg = 0x328, 474 - .shift = 16, 475 - .mask = 0xff, 476 - .def = 0x80, 534 + .regs = { 535 + .smmu = { 536 + .reg = 0x22c, 537 + .bit = 11, 538 + }, 539 + .la = { 540 + .reg = 0x328, 541 + .shift = 16, 542 + .mask = 0xff, 543 + .def = 0x80, 544 + }, 477 545 }, 478 546 }, { 479 547 .id = 0x2c, 480 548 .name = "viwsb", 481 549 .swgroup = TEGRA_SWGROUP_VI, 482 - .smmu = { 483 - .reg = 0x22c, 484 - .bit = 12, 485 - }, 486 - .la = { 487 - .reg = 0x364, 488 - .shift = 0, 489 - .mask = 0xff, 490 - .def = 0x47, 550 + .regs = { 551 + .smmu = { 552 + .reg = 0x22c, 553 + .bit = 12, 554 + }, 555 + .la = { 556 + .reg = 0x364, 557 + .shift = 0, 558 + .mask = 0xff, 559 + .def = 0x47, 560 + }, 491 561 }, 492 562 }, { 493 563 .id = 0x2d, 494 564 .name = "viwu", 495 565 .swgroup = TEGRA_SWGROUP_VI, 496 - .smmu = { 497 - .reg = 0x22c, 498 - .bit = 13, 499 - }, 500 - .la = { 501 - .reg = 0x368, 502 - .shift = 0, 503 - .mask = 0xff, 504 - .def = 0xff, 566 + .regs = { 567 + .smmu = { 568 + .reg = 0x22c, 569 + .bit = 13, 570 + }, 571 + .la = { 572 + .reg = 0x368, 573 + .shift = 0, 574 + .mask = 0xff, 575 + .def = 0xff, 576 + }, 505 577 }, 506 578 }, { 507 579 .id = 0x2e, 508 580 .name = "viwv", 509 581 .swgroup = TEGRA_SWGROUP_VI, 510 - .smmu = { 511 - .reg = 0x22c, 512 - .bit = 14, 513 - }, 514 - .la = { 515 - .reg = 0x368, 516 - .shift = 16, 517 - .mask = 0xff, 518 - .def = 0xff, 582 + .regs = { 583 + .smmu = { 584 + .reg = 0x22c, 585 + .bit = 14, 586 + }, 587 + .la = { 588 + .reg = 0x368, 589 + .shift = 16, 590 + .mask = 0xff, 591 + .def = 0xff, 592 + }, 519 593 }, 520 594 }, { 521 595 .id = 0x2f, 522 596 .name = "viwy", 523 597 .swgroup = TEGRA_SWGROUP_VI, 524 - .smmu = { 525 - .reg = 0x22c, 526 - .bit = 15, 527 - }, 528 - .la = { 529 - .reg = 0x36c, 530 - .shift = 0, 531 - .mask = 0xff, 532 - .def = 0x47, 598 + .regs = { 599 + .smmu = { 600 + .reg = 0x22c, 601 + .bit = 15, 602 + }, 603 + .la = { 604 + .reg = 0x36c, 605 + .shift = 0, 606 + .mask = 0xff, 607 + .def = 0x47, 608 + }, 533 609 }, 534 610 }, { 535 611 .id = 0x30, 536 612 .name = "g2dw", 537 613 .swgroup = TEGRA_SWGROUP_G2, 538 - .smmu = { 539 - .reg = 0x22c, 540 - .bit = 16, 541 - }, 542 - .la = { 543 - .reg = 0x30c, 544 - .shift = 16, 545 - .mask = 0xff, 546 - .def = 0x9, 614 + .regs = { 615 + .smmu = { 616 + .reg = 0x22c, 617 + .bit = 16, 618 + }, 619 + .la = { 620 + .reg = 0x30c, 621 + .shift = 16, 622 + .mask = 0xff, 623 + .def = 0x9, 624 + }, 547 625 }, 548 626 }, { 549 627 .id = 0x32, 550 628 .name = "avpcarm7w", 551 629 .swgroup = TEGRA_SWGROUP_AVPC, 552 - .smmu = { 553 - .reg = 0x22c, 554 - .bit = 18, 555 - }, 556 - .la = { 557 - .reg = 0x2e4, 558 - .shift = 16, 559 - .mask = 0xff, 560 - .def = 0x0e, 630 + .regs = { 631 + .smmu = { 632 + .reg = 0x22c, 633 + .bit = 18, 634 + }, 635 + .la = { 636 + .reg = 0x2e4, 637 + .shift = 16, 638 + .mask = 0xff, 639 + .def = 0x0e, 640 + }, 561 641 }, 562 642 }, { 563 643 .id = 0x33, 564 644 .name = "fdcdwr", 565 645 .swgroup = TEGRA_SWGROUP_NV, 566 - .smmu = { 567 - .reg = 0x22c, 568 - .bit = 19, 569 - }, 570 - .la = { 571 - .reg = 0x338, 572 - .shift = 16, 573 - .mask = 0xff, 574 - .def = 0x10, 646 + .regs = { 647 + .smmu = { 648 + .reg = 0x22c, 649 + .bit = 19, 650 + }, 651 + .la = { 652 + .reg = 0x338, 653 + .shift = 16, 654 + .mask = 0xff, 655 + .def = 0x10, 656 + }, 575 657 }, 576 658 }, { 577 659 .id = 0x34, 578 660 .name = "fdcdwr2", 579 661 .swgroup = TEGRA_SWGROUP_NV, 580 - .smmu = { 581 - .reg = 0x22c, 582 - .bit = 20, 583 - }, 584 - .la = { 585 - .reg = 0x340, 586 - .shift = 0, 587 - .mask = 0xff, 588 - .def = 0x10, 662 + .regs = { 663 + .smmu = { 664 + .reg = 0x22c, 665 + .bit = 20, 666 + }, 667 + .la = { 668 + .reg = 0x340, 669 + .shift = 0, 670 + .mask = 0xff, 671 + .def = 0x10, 672 + }, 589 673 }, 590 674 }, { 591 675 .id = 0x35, 592 676 .name = "hdaw", 593 677 .swgroup = TEGRA_SWGROUP_HDA, 594 - .smmu = { 595 - .reg = 0x22c, 596 - .bit = 21, 597 - }, 598 - .la = { 599 - .reg = 0x318, 600 - .shift = 16, 601 - .mask = 0xff, 602 - .def = 0xff, 678 + .regs = { 679 + .smmu = { 680 + .reg = 0x22c, 681 + .bit = 21, 682 + }, 683 + .la = { 684 + .reg = 0x318, 685 + .shift = 16, 686 + .mask = 0xff, 687 + .def = 0xff, 688 + }, 603 689 }, 604 690 }, { 605 691 .id = 0x36, 606 692 .name = "host1xw", 607 693 .swgroup = TEGRA_SWGROUP_HC, 608 - .smmu = { 609 - .reg = 0x22c, 610 - .bit = 22, 611 - }, 612 - .la = { 613 - .reg = 0x314, 614 - .shift = 0, 615 - .mask = 0xff, 616 - .def = 0x25, 694 + .regs = { 695 + .smmu = { 696 + .reg = 0x22c, 697 + .bit = 22, 698 + }, 699 + .la = { 700 + .reg = 0x314, 701 + .shift = 0, 702 + .mask = 0xff, 703 + .def = 0x25, 704 + }, 617 705 }, 618 706 }, { 619 707 .id = 0x37, 620 708 .name = "ispw", 621 709 .swgroup = TEGRA_SWGROUP_ISP, 622 - .smmu = { 623 - .reg = 0x22c, 624 - .bit = 23, 625 - }, 626 - .la = { 627 - .reg = 0x31c, 628 - .shift = 0, 629 - .mask = 0xff, 630 - .def = 0xff, 710 + .regs = { 711 + .smmu = { 712 + .reg = 0x22c, 713 + .bit = 23, 714 + }, 715 + .la = { 716 + .reg = 0x31c, 717 + .shift = 0, 718 + .mask = 0xff, 719 + .def = 0xff, 720 + }, 631 721 }, 632 722 }, { 633 723 .id = 0x38, 634 724 .name = "mpcorelpw", 635 725 .swgroup = TEGRA_SWGROUP_MPCORELP, 636 - .la = { 637 - .reg = 0x324, 638 - .shift = 16, 639 - .mask = 0xff, 640 - .def = 0x80, 726 + .regs = { 727 + .la = { 728 + .reg = 0x324, 729 + .shift = 16, 730 + .mask = 0xff, 731 + .def = 0x80, 732 + }, 641 733 }, 642 734 }, { 643 735 .id = 0x39, 644 736 .name = "mpcorew", 645 737 .swgroup = TEGRA_SWGROUP_MPCORE, 646 - .la = { 647 - .reg = 0x320, 648 - .shift = 16, 649 - .mask = 0xff, 650 - .def = 0x0e, 738 + .regs = { 739 + .la = { 740 + .reg = 0x320, 741 + .shift = 16, 742 + .mask = 0xff, 743 + .def = 0x0e, 744 + }, 651 745 }, 652 746 }, { 653 747 .id = 0x3b, 654 748 .name = "ppcsahbdmaw", 655 749 .swgroup = TEGRA_SWGROUP_PPCS, 656 - .smmu = { 657 - .reg = 0x22c, 658 - .bit = 27, 659 - }, 660 - .la = { 661 - .reg = 0x348, 662 - .shift = 0, 663 - .mask = 0xff, 664 - .def = 0xa5, 750 + .regs = { 751 + .smmu = { 752 + .reg = 0x22c, 753 + .bit = 27, 754 + }, 755 + .la = { 756 + .reg = 0x348, 757 + .shift = 0, 758 + .mask = 0xff, 759 + .def = 0xa5, 760 + }, 665 761 }, 666 762 }, { 667 763 .id = 0x3c, 668 764 .name = "ppcsahbslvw", 669 765 .swgroup = TEGRA_SWGROUP_PPCS, 670 - .smmu = { 671 - .reg = 0x22c, 672 - .bit = 28, 673 - }, 674 - .la = { 675 - .reg = 0x348, 676 - .shift = 16, 677 - .mask = 0xff, 678 - .def = 0xe8, 766 + .regs = { 767 + .smmu = { 768 + .reg = 0x22c, 769 + .bit = 28, 770 + }, 771 + .la = { 772 + .reg = 0x348, 773 + .shift = 16, 774 + .mask = 0xff, 775 + .def = 0xe8, 776 + }, 679 777 }, 680 778 }, { 681 779 .id = 0x3e, 682 780 .name = "vdebsevw", 683 781 .swgroup = TEGRA_SWGROUP_VDE, 684 - .smmu = { 685 - .reg = 0x22c, 686 - .bit = 30, 687 - }, 688 - .la = { 689 - .reg = 0x35c, 690 - .shift = 0, 691 - .mask = 0xff, 692 - .def = 0xff, 782 + .regs = { 783 + .smmu = { 784 + .reg = 0x22c, 785 + .bit = 30, 786 + }, 787 + .la = { 788 + .reg = 0x35c, 789 + .shift = 0, 790 + .mask = 0xff, 791 + .def = 0xff, 792 + }, 693 793 }, 694 794 }, { 695 795 .id = 0x3f, 696 796 .name = "vdedbgw", 697 797 .swgroup = TEGRA_SWGROUP_VDE, 698 - .smmu = { 699 - .reg = 0x22c, 700 - .bit = 31, 701 - }, 702 - .la = { 703 - .reg = 0x35c, 704 - .shift = 16, 705 - .mask = 0xff, 706 - .def = 0xff, 798 + .regs = { 799 + .smmu = { 800 + .reg = 0x22c, 801 + .bit = 31, 802 + }, 803 + .la = { 804 + .reg = 0x35c, 805 + .shift = 16, 806 + .mask = 0xff, 807 + .def = 0xff, 808 + }, 707 809 }, 708 810 }, { 709 811 .id = 0x40, 710 812 .name = "vdembew", 711 813 .swgroup = TEGRA_SWGROUP_VDE, 712 - .smmu = { 713 - .reg = 0x230, 714 - .bit = 0, 715 - }, 716 - .la = { 717 - .reg = 0x360, 718 - .shift = 0, 719 - .mask = 0xff, 720 - .def = 0x89, 814 + .regs = { 815 + .smmu = { 816 + .reg = 0x230, 817 + .bit = 0, 818 + }, 819 + .la = { 820 + .reg = 0x360, 821 + .shift = 0, 822 + .mask = 0xff, 823 + .def = 0x89, 824 + }, 721 825 }, 722 826 }, { 723 827 .id = 0x41, 724 828 .name = "vdetpmw", 725 829 .swgroup = TEGRA_SWGROUP_VDE, 726 - .smmu = { 727 - .reg = 0x230, 728 - .bit = 1, 729 - }, 730 - .la = { 731 - .reg = 0x360, 732 - .shift = 16, 733 - .mask = 0xff, 734 - .def = 0x59, 830 + .regs = { 831 + .smmu = { 832 + .reg = 0x230, 833 + .bit = 1, 834 + }, 835 + .la = { 836 + .reg = 0x360, 837 + .shift = 16, 838 + .mask = 0xff, 839 + .def = 0x59, 840 + }, 735 841 }, 736 842 }, { 737 843 .id = 0x4a, 738 844 .name = "xusb_hostr", 739 845 .swgroup = TEGRA_SWGROUP_XUSB_HOST, 740 - .smmu = { 741 - .reg = 0x230, 742 - .bit = 10, 743 - }, 744 - .la = { 745 - .reg = 0x37c, 746 - .shift = 0, 747 - .mask = 0xff, 748 - .def = 0xa5, 846 + .regs = { 847 + .smmu = { 848 + .reg = 0x230, 849 + .bit = 10, 850 + }, 851 + .la = { 852 + .reg = 0x37c, 853 + .shift = 0, 854 + .mask = 0xff, 855 + .def = 0xa5, 856 + }, 749 857 }, 750 858 }, { 751 859 .id = 0x4b, 752 860 .name = "xusb_hostw", 753 861 .swgroup = TEGRA_SWGROUP_XUSB_HOST, 754 - .smmu = { 755 - .reg = 0x230, 756 - .bit = 11, 757 - }, 758 - .la = { 759 - .reg = 0x37c, 760 - .shift = 16, 761 - .mask = 0xff, 762 - .def = 0xa5, 862 + .regs = { 863 + .smmu = { 864 + .reg = 0x230, 865 + .bit = 11, 866 + }, 867 + .la = { 868 + .reg = 0x37c, 869 + .shift = 16, 870 + .mask = 0xff, 871 + .def = 0xa5, 872 + }, 763 873 }, 764 874 }, { 765 875 .id = 0x4c, 766 876 .name = "xusb_devr", 767 877 .swgroup = TEGRA_SWGROUP_XUSB_DEV, 768 - .smmu = { 769 - .reg = 0x230, 770 - .bit = 12, 771 - }, 772 - .la = { 773 - .reg = 0x380, 774 - .shift = 0, 775 - .mask = 0xff, 776 - .def = 0xa5, 878 + .regs = { 879 + .smmu = { 880 + .reg = 0x230, 881 + .bit = 12, 882 + }, 883 + .la = { 884 + .reg = 0x380, 885 + .shift = 0, 886 + .mask = 0xff, 887 + .def = 0xa5, 888 + }, 777 889 }, 778 890 }, { 779 891 .id = 0x4d, 780 892 .name = "xusb_devw", 781 893 .swgroup = TEGRA_SWGROUP_XUSB_DEV, 782 - .smmu = { 783 - .reg = 0x230, 784 - .bit = 13, 785 - }, 786 - .la = { 787 - .reg = 0x380, 788 - .shift = 16, 789 - .mask = 0xff, 790 - .def = 0xa5, 894 + .regs = { 895 + .smmu = { 896 + .reg = 0x230, 897 + .bit = 13, 898 + }, 899 + .la = { 900 + .reg = 0x380, 901 + .shift = 16, 902 + .mask = 0xff, 903 + .def = 0xa5, 904 + }, 791 905 }, 792 906 }, { 793 907 .id = 0x4e, 794 908 .name = "fdcdwr3", 795 909 .swgroup = TEGRA_SWGROUP_NV, 796 - .smmu = { 797 - .reg = 0x230, 798 - .bit = 14, 799 - }, 800 - .la = { 801 - .reg = 0x388, 802 - .shift = 0, 803 - .mask = 0xff, 804 - .def = 0x10, 910 + .regs = { 911 + .smmu = { 912 + .reg = 0x230, 913 + .bit = 14, 914 + }, 915 + .la = { 916 + .reg = 0x388, 917 + .shift = 0, 918 + .mask = 0xff, 919 + .def = 0x10, 920 + }, 805 921 }, 806 922 }, { 807 923 .id = 0x4f, 808 924 .name = "fdcdrd3", 809 925 .swgroup = TEGRA_SWGROUP_NV, 810 - .smmu = { 811 - .reg = 0x230, 812 - .bit = 15, 813 - }, 814 - .la = { 815 - .reg = 0x384, 816 - .shift = 0, 817 - .mask = 0xff, 818 - .def = 0x0c, 926 + .regs = { 927 + .smmu = { 928 + .reg = 0x230, 929 + .bit = 15, 930 + }, 931 + .la = { 932 + .reg = 0x384, 933 + .shift = 0, 934 + .mask = 0xff, 935 + .def = 0x0c, 936 + }, 819 937 }, 820 938 }, { 821 939 .id = 0x50, 822 940 .name = "fdcwr4", 823 941 .swgroup = TEGRA_SWGROUP_NV, 824 - .smmu = { 825 - .reg = 0x230, 826 - .bit = 16, 827 - }, 828 - .la = { 829 - .reg = 0x388, 830 - .shift = 16, 831 - .mask = 0xff, 832 - .def = 0x10, 942 + .regs = { 943 + .smmu = { 944 + .reg = 0x230, 945 + .bit = 16, 946 + }, 947 + .la = { 948 + .reg = 0x388, 949 + .shift = 16, 950 + .mask = 0xff, 951 + .def = 0x10, 952 + }, 833 953 }, 834 954 }, { 835 955 .id = 0x51, 836 956 .name = "fdcrd4", 837 957 .swgroup = TEGRA_SWGROUP_NV, 838 - .smmu = { 839 - .reg = 0x230, 840 - .bit = 17, 841 - }, 842 - .la = { 843 - .reg = 0x384, 844 - .shift = 16, 845 - .mask = 0xff, 846 - .def = 0x0c, 958 + .regs = { 959 + .smmu = { 960 + .reg = 0x230, 961 + .bit = 17, 962 + }, 963 + .la = { 964 + .reg = 0x384, 965 + .shift = 16, 966 + .mask = 0xff, 967 + .def = 0x0c, 968 + }, 847 969 }, 848 970 }, { 849 971 .id = 0x52, 850 972 .name = "emucifr", 851 973 .swgroup = TEGRA_SWGROUP_EMUCIF, 852 - .la = { 853 - .reg = 0x38c, 854 - .shift = 0, 855 - .mask = 0xff, 856 - .def = 0x04, 974 + .regs = { 975 + .la = { 976 + .reg = 0x38c, 977 + .shift = 0, 978 + .mask = 0xff, 979 + .def = 0x04, 980 + }, 857 981 }, 858 982 }, { 859 983 .id = 0x53, 860 984 .name = "emucifw", 861 985 .swgroup = TEGRA_SWGROUP_EMUCIF, 862 - .la = { 863 - .reg = 0x38c, 864 - .shift = 16, 865 - .mask = 0xff, 866 - .def = 0x0e, 986 + .regs = { 987 + .la = { 988 + .reg = 0x38c, 989 + .shift = 16, 990 + .mask = 0xff, 991 + .def = 0x0e, 992 + }, 867 993 }, 868 994 }, { 869 995 .id = 0x54, 870 996 .name = "tsecsrd", 871 997 .swgroup = TEGRA_SWGROUP_TSEC, 872 - .smmu = { 873 - .reg = 0x230, 874 - .bit = 20, 875 - }, 876 - .la = { 877 - .reg = 0x390, 878 - .shift = 0, 879 - .mask = 0xff, 880 - .def = 0x50, 998 + .regs = { 999 + .smmu = { 1000 + .reg = 0x230, 1001 + .bit = 20, 1002 + }, 1003 + .la = { 1004 + .reg = 0x390, 1005 + .shift = 0, 1006 + .mask = 0xff, 1007 + .def = 0x50, 1008 + }, 881 1009 }, 882 1010 }, { 883 1011 .id = 0x55, 884 1012 .name = "tsecswr", 885 1013 .swgroup = TEGRA_SWGROUP_TSEC, 886 - .smmu = { 887 - .reg = 0x230, 888 - .bit = 21, 889 - }, 890 - .la = { 891 - .reg = 0x390, 892 - .shift = 16, 893 - .mask = 0xff, 894 - .def = 0x50, 1014 + .regs = { 1015 + .smmu = { 1016 + .reg = 0x230, 1017 + .bit = 21, 1018 + }, 1019 + .la = { 1020 + .reg = 0x390, 1021 + .shift = 16, 1022 + .mask = 0xff, 1023 + .def = 0x50, 1024 + }, 895 1025 }, 896 1026 }, 897 1027 }; ··· 1113 983 .reset_ops = &tegra_mc_reset_ops_common, 1114 984 .resets = tegra114_mc_resets, 1115 985 .num_resets = ARRAY_SIZE(tegra114_mc_resets), 986 + .ops = &tegra30_mc_ops, 1116 987 };
+2 -6
drivers/memory/tegra/tegra124-emc.c
··· 272 272 #define EMC_PUTERM_ADJ 0x574 273 273 274 274 #define DRAM_DEV_SEL_ALL 0 275 - #define DRAM_DEV_SEL_0 (2 << 30) 276 - #define DRAM_DEV_SEL_1 (1 << 30) 275 + #define DRAM_DEV_SEL_0 BIT(31) 276 + #define DRAM_DEV_SEL_1 BIT(30) 277 277 278 278 #define EMC_CFG_POWER_FEATURES_MASK \ 279 279 (EMC_CFG_DYN_SREF | EMC_CFG_DRAM_ACPD | EMC_CFG_DRAM_CLKSTOP_SR | \ ··· 1269 1269 } 1270 1270 1271 1271 emc->debugfs.root = debugfs_create_dir("emc", NULL); 1272 - if (!emc->debugfs.root) { 1273 - dev_err(dev, "failed to create debugfs directory\n"); 1274 - return; 1275 - } 1276 1272 1277 1273 debugfs_create_file("available_rates", 0444, emc->debugfs.root, emc, 1278 1274 &tegra_emc_debug_available_rates_fops);
+721 -585
drivers/memory/tegra/tegra124.c
··· 16 16 .id = 0x00, 17 17 .name = "ptcr", 18 18 .swgroup = TEGRA_SWGROUP_PTC, 19 - .la = { 20 - .reg = 0x34c, 21 - .shift = 0, 22 - .mask = 0xff, 23 - .def = 0x0, 19 + .regs = { 20 + .la = { 21 + .reg = 0x34c, 22 + .shift = 0, 23 + .mask = 0xff, 24 + .def = 0x0, 25 + }, 24 26 }, 25 27 }, { 26 28 .id = 0x01, 27 29 .name = "display0a", 28 30 .swgroup = TEGRA_SWGROUP_DC, 29 - .smmu = { 30 - .reg = 0x228, 31 - .bit = 1, 32 - }, 33 - .la = { 34 - .reg = 0x2e8, 35 - .shift = 0, 36 - .mask = 0xff, 37 - .def = 0xc2, 31 + .regs = { 32 + .smmu = { 33 + .reg = 0x228, 34 + .bit = 1, 35 + }, 36 + .la = { 37 + .reg = 0x2e8, 38 + .shift = 0, 39 + .mask = 0xff, 40 + .def = 0xc2, 41 + }, 38 42 }, 39 43 }, { 40 44 .id = 0x02, 41 45 .name = "display0ab", 42 46 .swgroup = TEGRA_SWGROUP_DCB, 43 - .smmu = { 44 - .reg = 0x228, 45 - .bit = 2, 46 - }, 47 - .la = { 48 - .reg = 0x2f4, 49 - .shift = 0, 50 - .mask = 0xff, 51 - .def = 0xc6, 47 + .regs = { 48 + .smmu = { 49 + .reg = 0x228, 50 + .bit = 2, 51 + }, 52 + .la = { 53 + .reg = 0x2f4, 54 + .shift = 0, 55 + .mask = 0xff, 56 + .def = 0xc6, 57 + }, 52 58 }, 53 59 }, { 54 60 .id = 0x03, 55 61 .name = "display0b", 56 62 .swgroup = TEGRA_SWGROUP_DC, 57 - .smmu = { 58 - .reg = 0x228, 59 - .bit = 3, 60 - }, 61 - .la = { 62 - .reg = 0x2e8, 63 - .shift = 16, 64 - .mask = 0xff, 65 - .def = 0x50, 63 + .regs = { 64 + .smmu = { 65 + .reg = 0x228, 66 + .bit = 3, 67 + }, 68 + .la = { 69 + .reg = 0x2e8, 70 + .shift = 16, 71 + .mask = 0xff, 72 + .def = 0x50, 73 + }, 66 74 }, 67 75 }, { 68 76 .id = 0x04, 69 77 .name = "display0bb", 70 78 .swgroup = TEGRA_SWGROUP_DCB, 71 - .smmu = { 72 - .reg = 0x228, 73 - .bit = 4, 74 - }, 75 - .la = { 76 - .reg = 0x2f4, 77 - .shift = 16, 78 - .mask = 0xff, 79 - .def = 0x50, 79 + .regs = { 80 + .smmu = { 81 + .reg = 0x228, 82 + .bit = 4, 83 + }, 84 + .la = { 85 + .reg = 0x2f4, 86 + .shift = 16, 87 + .mask = 0xff, 88 + .def = 0x50, 89 + }, 80 90 }, 81 91 }, { 82 92 .id = 0x05, 83 93 .name = "display0c", 84 94 .swgroup = TEGRA_SWGROUP_DC, 85 - .smmu = { 86 - .reg = 0x228, 87 - .bit = 5, 88 - }, 89 - .la = { 90 - .reg = 0x2ec, 91 - .shift = 0, 92 - .mask = 0xff, 93 - .def = 0x50, 95 + .regs = { 96 + .smmu = { 97 + .reg = 0x228, 98 + .bit = 5, 99 + }, 100 + .la = { 101 + .reg = 0x2ec, 102 + .shift = 0, 103 + .mask = 0xff, 104 + .def = 0x50, 105 + }, 94 106 }, 95 107 }, { 96 108 .id = 0x06, 97 109 .name = "display0cb", 98 110 .swgroup = TEGRA_SWGROUP_DCB, 99 - .smmu = { 100 - .reg = 0x228, 101 - .bit = 6, 102 - }, 103 - .la = { 104 - .reg = 0x2f8, 105 - .shift = 0, 106 - .mask = 0xff, 107 - .def = 0x50, 111 + .regs = { 112 + .smmu = { 113 + .reg = 0x228, 114 + .bit = 6, 115 + }, 116 + .la = { 117 + .reg = 0x2f8, 118 + .shift = 0, 119 + .mask = 0xff, 120 + .def = 0x50, 121 + }, 108 122 }, 109 123 }, { 110 124 .id = 0x0e, 111 125 .name = "afir", 112 126 .swgroup = TEGRA_SWGROUP_AFI, 113 - .smmu = { 114 - .reg = 0x228, 115 - .bit = 14, 116 - }, 117 - .la = { 118 - .reg = 0x2e0, 119 - .shift = 0, 120 - .mask = 0xff, 121 - .def = 0x13, 127 + .regs = { 128 + .smmu = { 129 + .reg = 0x228, 130 + .bit = 14, 131 + }, 132 + .la = { 133 + .reg = 0x2e0, 134 + .shift = 0, 135 + .mask = 0xff, 136 + .def = 0x13, 137 + }, 122 138 }, 123 139 }, { 124 140 .id = 0x0f, 125 141 .name = "avpcarm7r", 126 142 .swgroup = TEGRA_SWGROUP_AVPC, 127 - .smmu = { 128 - .reg = 0x228, 129 - .bit = 15, 130 - }, 131 - .la = { 132 - .reg = 0x2e4, 133 - .shift = 0, 134 - .mask = 0xff, 135 - .def = 0x04, 143 + .regs = { 144 + .smmu = { 145 + .reg = 0x228, 146 + .bit = 15, 147 + }, 148 + .la = { 149 + .reg = 0x2e4, 150 + .shift = 0, 151 + .mask = 0xff, 152 + .def = 0x04, 153 + }, 136 154 }, 137 155 }, { 138 156 .id = 0x10, 139 157 .name = "displayhc", 140 158 .swgroup = TEGRA_SWGROUP_DC, 141 - .smmu = { 142 - .reg = 0x228, 143 - .bit = 16, 144 - }, 145 - .la = { 146 - .reg = 0x2f0, 147 - .shift = 0, 148 - .mask = 0xff, 149 - .def = 0x50, 159 + .regs = { 160 + .smmu = { 161 + .reg = 0x228, 162 + .bit = 16, 163 + }, 164 + .la = { 165 + .reg = 0x2f0, 166 + .shift = 0, 167 + .mask = 0xff, 168 + .def = 0x50, 169 + }, 150 170 }, 151 171 }, { 152 172 .id = 0x11, 153 173 .name = "displayhcb", 154 174 .swgroup = TEGRA_SWGROUP_DCB, 155 - .smmu = { 156 - .reg = 0x228, 157 - .bit = 17, 158 - }, 159 - .la = { 160 - .reg = 0x2fc, 161 - .shift = 0, 162 - .mask = 0xff, 163 - .def = 0x50, 175 + .regs = { 176 + .smmu = { 177 + .reg = 0x228, 178 + .bit = 17, 179 + }, 180 + .la = { 181 + .reg = 0x2fc, 182 + .shift = 0, 183 + .mask = 0xff, 184 + .def = 0x50, 185 + }, 164 186 }, 165 187 }, { 166 188 .id = 0x15, 167 189 .name = "hdar", 168 190 .swgroup = TEGRA_SWGROUP_HDA, 169 - .smmu = { 170 - .reg = 0x228, 171 - .bit = 21, 172 - }, 173 - .la = { 174 - .reg = 0x318, 175 - .shift = 0, 176 - .mask = 0xff, 177 - .def = 0x24, 191 + .regs = { 192 + .smmu = { 193 + .reg = 0x228, 194 + .bit = 21, 195 + }, 196 + .la = { 197 + .reg = 0x318, 198 + .shift = 0, 199 + .mask = 0xff, 200 + .def = 0x24, 201 + }, 178 202 }, 179 203 }, { 180 204 .id = 0x16, 181 205 .name = "host1xdmar", 182 206 .swgroup = TEGRA_SWGROUP_HC, 183 - .smmu = { 184 - .reg = 0x228, 185 - .bit = 22, 186 - }, 187 - .la = { 188 - .reg = 0x310, 189 - .shift = 0, 190 - .mask = 0xff, 191 - .def = 0x1e, 207 + .regs = { 208 + .smmu = { 209 + .reg = 0x228, 210 + .bit = 22, 211 + }, 212 + .la = { 213 + .reg = 0x310, 214 + .shift = 0, 215 + .mask = 0xff, 216 + .def = 0x1e, 217 + }, 192 218 }, 193 219 }, { 194 220 .id = 0x17, 195 221 .name = "host1xr", 196 222 .swgroup = TEGRA_SWGROUP_HC, 197 - .smmu = { 198 - .reg = 0x228, 199 - .bit = 23, 200 - }, 201 - .la = { 202 - .reg = 0x310, 203 - .shift = 16, 204 - .mask = 0xff, 205 - .def = 0x50, 223 + .regs = { 224 + .smmu = { 225 + .reg = 0x228, 226 + .bit = 23, 227 + }, 228 + .la = { 229 + .reg = 0x310, 230 + .shift = 16, 231 + .mask = 0xff, 232 + .def = 0x50, 233 + }, 206 234 }, 207 235 }, { 208 236 .id = 0x1c, 209 237 .name = "msencsrd", 210 238 .swgroup = TEGRA_SWGROUP_MSENC, 211 - .smmu = { 212 - .reg = 0x228, 213 - .bit = 28, 214 - }, 215 - .la = { 216 - .reg = 0x328, 217 - .shift = 0, 218 - .mask = 0xff, 219 - .def = 0x23, 239 + .regs = { 240 + .smmu = { 241 + .reg = 0x228, 242 + .bit = 28, 243 + }, 244 + .la = { 245 + .reg = 0x328, 246 + .shift = 0, 247 + .mask = 0xff, 248 + .def = 0x23, 249 + }, 220 250 }, 221 251 }, { 222 252 .id = 0x1d, 223 253 .name = "ppcsahbdmar", 224 254 .swgroup = TEGRA_SWGROUP_PPCS, 225 - .smmu = { 226 - .reg = 0x228, 227 - .bit = 29, 228 - }, 229 - .la = { 230 - .reg = 0x344, 231 - .shift = 0, 232 - .mask = 0xff, 233 - .def = 0x49, 255 + .regs = { 256 + .smmu = { 257 + .reg = 0x228, 258 + .bit = 29, 259 + }, 260 + .la = { 261 + .reg = 0x344, 262 + .shift = 0, 263 + .mask = 0xff, 264 + .def = 0x49, 265 + }, 234 266 }, 235 267 }, { 236 268 .id = 0x1e, 237 269 .name = "ppcsahbslvr", 238 270 .swgroup = TEGRA_SWGROUP_PPCS, 239 - .smmu = { 240 - .reg = 0x228, 241 - .bit = 30, 242 - }, 243 - .la = { 244 - .reg = 0x344, 245 - .shift = 16, 246 - .mask = 0xff, 247 - .def = 0x1a, 271 + .regs = { 272 + .smmu = { 273 + .reg = 0x228, 274 + .bit = 30, 275 + }, 276 + .la = { 277 + .reg = 0x344, 278 + .shift = 16, 279 + .mask = 0xff, 280 + .def = 0x1a, 281 + }, 248 282 }, 249 283 }, { 250 284 .id = 0x1f, 251 285 .name = "satar", 252 286 .swgroup = TEGRA_SWGROUP_SATA, 253 - .smmu = { 254 - .reg = 0x228, 255 - .bit = 31, 256 - }, 257 - .la = { 258 - .reg = 0x350, 259 - .shift = 0, 260 - .mask = 0xff, 261 - .def = 0x65, 287 + .regs = { 288 + .smmu = { 289 + .reg = 0x228, 290 + .bit = 31, 291 + }, 292 + .la = { 293 + .reg = 0x350, 294 + .shift = 0, 295 + .mask = 0xff, 296 + .def = 0x65, 297 + }, 262 298 }, 263 299 }, { 264 300 .id = 0x22, 265 301 .name = "vdebsevr", 266 302 .swgroup = TEGRA_SWGROUP_VDE, 267 - .smmu = { 268 - .reg = 0x22c, 269 - .bit = 2, 270 - }, 271 - .la = { 272 - .reg = 0x354, 273 - .shift = 0, 274 - .mask = 0xff, 275 - .def = 0x4f, 303 + .regs = { 304 + .smmu = { 305 + .reg = 0x22c, 306 + .bit = 2, 307 + }, 308 + .la = { 309 + .reg = 0x354, 310 + .shift = 0, 311 + .mask = 0xff, 312 + .def = 0x4f, 313 + }, 276 314 }, 277 315 }, { 278 316 .id = 0x23, 279 317 .name = "vdember", 280 318 .swgroup = TEGRA_SWGROUP_VDE, 281 - .smmu = { 282 - .reg = 0x22c, 283 - .bit = 3, 284 - }, 285 - .la = { 286 - .reg = 0x354, 287 - .shift = 16, 288 - .mask = 0xff, 289 - .def = 0x3d, 319 + .regs = { 320 + .smmu = { 321 + .reg = 0x22c, 322 + .bit = 3, 323 + }, 324 + .la = { 325 + .reg = 0x354, 326 + .shift = 16, 327 + .mask = 0xff, 328 + .def = 0x3d, 329 + }, 290 330 }, 291 331 }, { 292 332 .id = 0x24, 293 333 .name = "vdemcer", 294 334 .swgroup = TEGRA_SWGROUP_VDE, 295 - .smmu = { 296 - .reg = 0x22c, 297 - .bit = 4, 298 - }, 299 - .la = { 300 - .reg = 0x358, 301 - .shift = 0, 302 - .mask = 0xff, 303 - .def = 0x66, 335 + .regs = { 336 + .smmu = { 337 + .reg = 0x22c, 338 + .bit = 4, 339 + }, 340 + .la = { 341 + .reg = 0x358, 342 + .shift = 0, 343 + .mask = 0xff, 344 + .def = 0x66, 345 + }, 304 346 }, 305 347 }, { 306 348 .id = 0x25, 307 349 .name = "vdetper", 308 350 .swgroup = TEGRA_SWGROUP_VDE, 309 - .smmu = { 310 - .reg = 0x22c, 311 - .bit = 5, 312 - }, 313 - .la = { 314 - .reg = 0x358, 315 - .shift = 16, 316 - .mask = 0xff, 317 - .def = 0xa5, 351 + .regs = { 352 + .smmu = { 353 + .reg = 0x22c, 354 + .bit = 5, 355 + }, 356 + .la = { 357 + .reg = 0x358, 358 + .shift = 16, 359 + .mask = 0xff, 360 + .def = 0xa5, 361 + }, 318 362 }, 319 363 }, { 320 364 .id = 0x26, 321 365 .name = "mpcorelpr", 322 366 .swgroup = TEGRA_SWGROUP_MPCORELP, 323 - .la = { 324 - .reg = 0x324, 325 - .shift = 0, 326 - .mask = 0xff, 327 - .def = 0x04, 367 + .regs = { 368 + .la = { 369 + .reg = 0x324, 370 + .shift = 0, 371 + .mask = 0xff, 372 + .def = 0x04, 373 + }, 328 374 }, 329 375 }, { 330 376 .id = 0x27, 331 377 .name = "mpcorer", 332 378 .swgroup = TEGRA_SWGROUP_MPCORE, 333 - .la = { 334 - .reg = 0x320, 335 - .shift = 0, 336 - .mask = 0xff, 337 - .def = 0x04, 379 + .regs = { 380 + .la = { 381 + .reg = 0x320, 382 + .shift = 0, 383 + .mask = 0xff, 384 + .def = 0x04, 385 + }, 338 386 }, 339 387 }, { 340 388 .id = 0x2b, 341 389 .name = "msencswr", 342 390 .swgroup = TEGRA_SWGROUP_MSENC, 343 - .smmu = { 344 - .reg = 0x22c, 345 - .bit = 11, 346 - }, 347 - .la = { 348 - .reg = 0x328, 349 - .shift = 16, 350 - .mask = 0xff, 351 - .def = 0x80, 391 + .regs = { 392 + .smmu = { 393 + .reg = 0x22c, 394 + .bit = 11, 395 + }, 396 + .la = { 397 + .reg = 0x328, 398 + .shift = 16, 399 + .mask = 0xff, 400 + .def = 0x80, 401 + }, 352 402 }, 353 403 }, { 354 404 .id = 0x31, 355 405 .name = "afiw", 356 406 .swgroup = TEGRA_SWGROUP_AFI, 357 - .smmu = { 358 - .reg = 0x22c, 359 - .bit = 17, 360 - }, 361 - .la = { 362 - .reg = 0x2e0, 363 - .shift = 16, 364 - .mask = 0xff, 365 - .def = 0x80, 407 + .regs = { 408 + .smmu = { 409 + .reg = 0x22c, 410 + .bit = 17, 411 + }, 412 + .la = { 413 + .reg = 0x2e0, 414 + .shift = 16, 415 + .mask = 0xff, 416 + .def = 0x80, 417 + }, 366 418 }, 367 419 }, { 368 420 .id = 0x32, 369 421 .name = "avpcarm7w", 370 422 .swgroup = TEGRA_SWGROUP_AVPC, 371 - .smmu = { 372 - .reg = 0x22c, 373 - .bit = 18, 374 - }, 375 - .la = { 376 - .reg = 0x2e4, 377 - .shift = 16, 378 - .mask = 0xff, 379 - .def = 0x80, 423 + .regs = { 424 + .smmu = { 425 + .reg = 0x22c, 426 + .bit = 18, 427 + }, 428 + .la = { 429 + .reg = 0x2e4, 430 + .shift = 16, 431 + .mask = 0xff, 432 + .def = 0x80, 433 + }, 380 434 }, 381 435 }, { 382 436 .id = 0x35, 383 437 .name = "hdaw", 384 438 .swgroup = TEGRA_SWGROUP_HDA, 385 - .smmu = { 386 - .reg = 0x22c, 387 - .bit = 21, 388 - }, 389 - .la = { 390 - .reg = 0x318, 391 - .shift = 16, 392 - .mask = 0xff, 393 - .def = 0x80, 439 + .regs = { 440 + .smmu = { 441 + .reg = 0x22c, 442 + .bit = 21, 443 + }, 444 + .la = { 445 + .reg = 0x318, 446 + .shift = 16, 447 + .mask = 0xff, 448 + .def = 0x80, 449 + }, 394 450 }, 395 451 }, { 396 452 .id = 0x36, 397 453 .name = "host1xw", 398 454 .swgroup = TEGRA_SWGROUP_HC, 399 - .smmu = { 400 - .reg = 0x22c, 401 - .bit = 22, 402 - }, 403 - .la = { 404 - .reg = 0x314, 405 - .shift = 0, 406 - .mask = 0xff, 407 - .def = 0x80, 455 + .regs = { 456 + .smmu = { 457 + .reg = 0x22c, 458 + .bit = 22, 459 + }, 460 + .la = { 461 + .reg = 0x314, 462 + .shift = 0, 463 + .mask = 0xff, 464 + .def = 0x80, 465 + }, 408 466 }, 409 467 }, { 410 468 .id = 0x38, 411 469 .name = "mpcorelpw", 412 470 .swgroup = TEGRA_SWGROUP_MPCORELP, 413 - .la = { 414 - .reg = 0x324, 415 - .shift = 16, 416 - .mask = 0xff, 417 - .def = 0x80, 471 + .regs = { 472 + .la = { 473 + .reg = 0x324, 474 + .shift = 16, 475 + .mask = 0xff, 476 + .def = 0x80, 477 + }, 418 478 }, 419 479 }, { 420 480 .id = 0x39, 421 481 .name = "mpcorew", 422 482 .swgroup = TEGRA_SWGROUP_MPCORE, 423 - .la = { 424 - .reg = 0x320, 425 - .shift = 16, 426 - .mask = 0xff, 427 - .def = 0x80, 483 + .regs = { 484 + .la = { 485 + .reg = 0x320, 486 + .shift = 16, 487 + .mask = 0xff, 488 + .def = 0x80, 489 + }, 428 490 }, 429 491 }, { 430 492 .id = 0x3b, 431 493 .name = "ppcsahbdmaw", 432 494 .swgroup = TEGRA_SWGROUP_PPCS, 433 - .smmu = { 434 - .reg = 0x22c, 435 - .bit = 27, 436 - }, 437 - .la = { 438 - .reg = 0x348, 439 - .shift = 0, 440 - .mask = 0xff, 441 - .def = 0x80, 495 + .regs = { 496 + .smmu = { 497 + .reg = 0x22c, 498 + .bit = 27, 499 + }, 500 + .la = { 501 + .reg = 0x348, 502 + .shift = 0, 503 + .mask = 0xff, 504 + .def = 0x80, 505 + }, 442 506 }, 443 507 }, { 444 508 .id = 0x3c, 445 509 .name = "ppcsahbslvw", 446 510 .swgroup = TEGRA_SWGROUP_PPCS, 447 - .smmu = { 448 - .reg = 0x22c, 449 - .bit = 28, 450 - }, 451 - .la = { 452 - .reg = 0x348, 453 - .shift = 16, 454 - .mask = 0xff, 455 - .def = 0x80, 511 + .regs = { 512 + .smmu = { 513 + .reg = 0x22c, 514 + .bit = 28, 515 + }, 516 + .la = { 517 + .reg = 0x348, 518 + .shift = 16, 519 + .mask = 0xff, 520 + .def = 0x80, 521 + }, 456 522 }, 457 523 }, { 458 524 .id = 0x3d, 459 525 .name = "sataw", 460 526 .swgroup = TEGRA_SWGROUP_SATA, 461 - .smmu = { 462 - .reg = 0x22c, 463 - .bit = 29, 464 - }, 465 - .la = { 466 - .reg = 0x350, 467 - .shift = 16, 468 - .mask = 0xff, 469 - .def = 0x65, 527 + .regs = { 528 + .smmu = { 529 + .reg = 0x22c, 530 + .bit = 29, 531 + }, 532 + .la = { 533 + .reg = 0x350, 534 + .shift = 16, 535 + .mask = 0xff, 536 + .def = 0x65, 537 + }, 470 538 }, 471 539 }, { 472 540 .id = 0x3e, 473 541 .name = "vdebsevw", 474 542 .swgroup = TEGRA_SWGROUP_VDE, 475 - .smmu = { 476 - .reg = 0x22c, 477 - .bit = 30, 478 - }, 479 - .la = { 480 - .reg = 0x35c, 481 - .shift = 0, 482 - .mask = 0xff, 483 - .def = 0x80, 543 + .regs = { 544 + .smmu = { 545 + .reg = 0x22c, 546 + .bit = 30, 547 + }, 548 + .la = { 549 + .reg = 0x35c, 550 + .shift = 0, 551 + .mask = 0xff, 552 + .def = 0x80, 553 + }, 484 554 }, 485 555 }, { 486 556 .id = 0x3f, 487 557 .name = "vdedbgw", 488 558 .swgroup = TEGRA_SWGROUP_VDE, 489 - .smmu = { 490 - .reg = 0x22c, 491 - .bit = 31, 492 - }, 493 - .la = { 494 - .reg = 0x35c, 495 - .shift = 16, 496 - .mask = 0xff, 497 - .def = 0x80, 559 + .regs = { 560 + .smmu = { 561 + .reg = 0x22c, 562 + .bit = 31, 563 + }, 564 + .la = { 565 + .reg = 0x35c, 566 + .shift = 16, 567 + .mask = 0xff, 568 + .def = 0x80, 569 + }, 498 570 }, 499 571 }, { 500 572 .id = 0x40, 501 573 .name = "vdembew", 502 574 .swgroup = TEGRA_SWGROUP_VDE, 503 - .smmu = { 504 - .reg = 0x230, 505 - .bit = 0, 506 - }, 507 - .la = { 508 - .reg = 0x360, 509 - .shift = 0, 510 - .mask = 0xff, 511 - .def = 0x80, 575 + .regs = { 576 + .smmu = { 577 + .reg = 0x230, 578 + .bit = 0, 579 + }, 580 + .la = { 581 + .reg = 0x360, 582 + .shift = 0, 583 + .mask = 0xff, 584 + .def = 0x80, 585 + }, 512 586 }, 513 587 }, { 514 588 .id = 0x41, 515 589 .name = "vdetpmw", 516 590 .swgroup = TEGRA_SWGROUP_VDE, 517 - .smmu = { 518 - .reg = 0x230, 519 - .bit = 1, 520 - }, 521 - .la = { 522 - .reg = 0x360, 523 - .shift = 16, 524 - .mask = 0xff, 525 - .def = 0x80, 591 + .regs = { 592 + .smmu = { 593 + .reg = 0x230, 594 + .bit = 1, 595 + }, 596 + .la = { 597 + .reg = 0x360, 598 + .shift = 16, 599 + .mask = 0xff, 600 + .def = 0x80, 601 + }, 526 602 }, 527 603 }, { 528 604 .id = 0x44, 529 605 .name = "ispra", 530 606 .swgroup = TEGRA_SWGROUP_ISP2, 531 - .smmu = { 532 - .reg = 0x230, 533 - .bit = 4, 534 - }, 535 - .la = { 536 - .reg = 0x370, 537 - .shift = 0, 538 - .mask = 0xff, 539 - .def = 0x18, 607 + .regs = { 608 + .smmu = { 609 + .reg = 0x230, 610 + .bit = 4, 611 + }, 612 + .la = { 613 + .reg = 0x370, 614 + .shift = 0, 615 + .mask = 0xff, 616 + .def = 0x18, 617 + }, 540 618 }, 541 619 }, { 542 620 .id = 0x46, 543 621 .name = "ispwa", 544 622 .swgroup = TEGRA_SWGROUP_ISP2, 545 - .smmu = { 546 - .reg = 0x230, 547 - .bit = 6, 548 - }, 549 - .la = { 550 - .reg = 0x374, 551 - .shift = 0, 552 - .mask = 0xff, 553 - .def = 0x80, 623 + .regs = { 624 + .smmu = { 625 + .reg = 0x230, 626 + .bit = 6, 627 + }, 628 + .la = { 629 + .reg = 0x374, 630 + .shift = 0, 631 + .mask = 0xff, 632 + .def = 0x80, 633 + }, 554 634 }, 555 635 }, { 556 636 .id = 0x47, 557 637 .name = "ispwb", 558 638 .swgroup = TEGRA_SWGROUP_ISP2, 559 - .smmu = { 560 - .reg = 0x230, 561 - .bit = 7, 562 - }, 563 - .la = { 564 - .reg = 0x374, 565 - .shift = 16, 566 - .mask = 0xff, 567 - .def = 0x80, 639 + .regs = { 640 + .smmu = { 641 + .reg = 0x230, 642 + .bit = 7, 643 + }, 644 + .la = { 645 + .reg = 0x374, 646 + .shift = 16, 647 + .mask = 0xff, 648 + .def = 0x80, 649 + }, 568 650 }, 569 651 }, { 570 652 .id = 0x4a, 571 653 .name = "xusb_hostr", 572 654 .swgroup = TEGRA_SWGROUP_XUSB_HOST, 573 - .smmu = { 574 - .reg = 0x230, 575 - .bit = 10, 576 - }, 577 - .la = { 578 - .reg = 0x37c, 579 - .shift = 0, 580 - .mask = 0xff, 581 - .def = 0x39, 655 + .regs = { 656 + .smmu = { 657 + .reg = 0x230, 658 + .bit = 10, 659 + }, 660 + .la = { 661 + .reg = 0x37c, 662 + .shift = 0, 663 + .mask = 0xff, 664 + .def = 0x39, 665 + }, 582 666 }, 583 667 }, { 584 668 .id = 0x4b, 585 669 .name = "xusb_hostw", 586 670 .swgroup = TEGRA_SWGROUP_XUSB_HOST, 587 - .smmu = { 588 - .reg = 0x230, 589 - .bit = 11, 590 - }, 591 - .la = { 592 - .reg = 0x37c, 593 - .shift = 16, 594 - .mask = 0xff, 595 - .def = 0x80, 671 + .regs = { 672 + .smmu = { 673 + .reg = 0x230, 674 + .bit = 11, 675 + }, 676 + .la = { 677 + .reg = 0x37c, 678 + .shift = 16, 679 + .mask = 0xff, 680 + .def = 0x80, 681 + }, 596 682 }, 597 683 }, { 598 684 .id = 0x4c, 599 685 .name = "xusb_devr", 600 686 .swgroup = TEGRA_SWGROUP_XUSB_DEV, 601 - .smmu = { 602 - .reg = 0x230, 603 - .bit = 12, 604 - }, 605 - .la = { 606 - .reg = 0x380, 607 - .shift = 0, 608 - .mask = 0xff, 609 - .def = 0x39, 687 + .regs = { 688 + .smmu = { 689 + .reg = 0x230, 690 + .bit = 12, 691 + }, 692 + .la = { 693 + .reg = 0x380, 694 + .shift = 0, 695 + .mask = 0xff, 696 + .def = 0x39, 697 + }, 610 698 }, 611 699 }, { 612 700 .id = 0x4d, 613 701 .name = "xusb_devw", 614 702 .swgroup = TEGRA_SWGROUP_XUSB_DEV, 615 - .smmu = { 616 - .reg = 0x230, 617 - .bit = 13, 618 - }, 619 - .la = { 620 - .reg = 0x380, 621 - .shift = 16, 622 - .mask = 0xff, 623 - .def = 0x80, 703 + .regs = { 704 + .smmu = { 705 + .reg = 0x230, 706 + .bit = 13, 707 + }, 708 + .la = { 709 + .reg = 0x380, 710 + .shift = 16, 711 + .mask = 0xff, 712 + .def = 0x80, 713 + }, 624 714 }, 625 715 }, { 626 716 .id = 0x4e, 627 717 .name = "isprab", 628 718 .swgroup = TEGRA_SWGROUP_ISP2B, 629 - .smmu = { 630 - .reg = 0x230, 631 - .bit = 14, 632 - }, 633 - .la = { 634 - .reg = 0x384, 635 - .shift = 0, 636 - .mask = 0xff, 637 - .def = 0x18, 719 + .regs = { 720 + .smmu = { 721 + .reg = 0x230, 722 + .bit = 14, 723 + }, 724 + .la = { 725 + .reg = 0x384, 726 + .shift = 0, 727 + .mask = 0xff, 728 + .def = 0x18, 729 + }, 638 730 }, 639 731 }, { 640 732 .id = 0x50, 641 733 .name = "ispwab", 642 734 .swgroup = TEGRA_SWGROUP_ISP2B, 643 - .smmu = { 644 - .reg = 0x230, 645 - .bit = 16, 646 - }, 647 - .la = { 648 - .reg = 0x388, 649 - .shift = 0, 650 - .mask = 0xff, 651 - .def = 0x80, 735 + .regs = { 736 + .smmu = { 737 + .reg = 0x230, 738 + .bit = 16, 739 + }, 740 + .la = { 741 + .reg = 0x388, 742 + .shift = 0, 743 + .mask = 0xff, 744 + .def = 0x80, 745 + }, 652 746 }, 653 747 }, { 654 748 .id = 0x51, 655 749 .name = "ispwbb", 656 750 .swgroup = TEGRA_SWGROUP_ISP2B, 657 - .smmu = { 658 - .reg = 0x230, 659 - .bit = 17, 660 - }, 661 - .la = { 662 - .reg = 0x388, 663 - .shift = 16, 664 - .mask = 0xff, 665 - .def = 0x80, 751 + .regs = { 752 + .smmu = { 753 + .reg = 0x230, 754 + .bit = 17, 755 + }, 756 + .la = { 757 + .reg = 0x388, 758 + .shift = 16, 759 + .mask = 0xff, 760 + .def = 0x80, 761 + }, 666 762 }, 667 763 }, { 668 764 .id = 0x54, 669 765 .name = "tsecsrd", 670 766 .swgroup = TEGRA_SWGROUP_TSEC, 671 - .smmu = { 672 - .reg = 0x230, 673 - .bit = 20, 674 - }, 675 - .la = { 676 - .reg = 0x390, 677 - .shift = 0, 678 - .mask = 0xff, 679 - .def = 0x9b, 767 + .regs = { 768 + .smmu = { 769 + .reg = 0x230, 770 + .bit = 20, 771 + }, 772 + .la = { 773 + .reg = 0x390, 774 + .shift = 0, 775 + .mask = 0xff, 776 + .def = 0x9b, 777 + }, 680 778 }, 681 779 }, { 682 780 .id = 0x55, 683 781 .name = "tsecswr", 684 782 .swgroup = TEGRA_SWGROUP_TSEC, 685 - .smmu = { 686 - .reg = 0x230, 687 - .bit = 21, 688 - }, 689 - .la = { 690 - .reg = 0x390, 691 - .shift = 16, 692 - .mask = 0xff, 693 - .def = 0x80, 783 + .regs = { 784 + .smmu = { 785 + .reg = 0x230, 786 + .bit = 21, 787 + }, 788 + .la = { 789 + .reg = 0x390, 790 + .shift = 16, 791 + .mask = 0xff, 792 + .def = 0x80, 793 + }, 694 794 }, 695 795 }, { 696 796 .id = 0x56, 697 797 .name = "a9avpscr", 698 798 .swgroup = TEGRA_SWGROUP_A9AVP, 699 - .smmu = { 700 - .reg = 0x230, 701 - .bit = 22, 702 - }, 703 - .la = { 704 - .reg = 0x3a4, 705 - .shift = 0, 706 - .mask = 0xff, 707 - .def = 0x04, 799 + .regs = { 800 + .smmu = { 801 + .reg = 0x230, 802 + .bit = 22, 803 + }, 804 + .la = { 805 + .reg = 0x3a4, 806 + .shift = 0, 807 + .mask = 0xff, 808 + .def = 0x04, 809 + }, 708 810 }, 709 811 }, { 710 812 .id = 0x57, 711 813 .name = "a9avpscw", 712 814 .swgroup = TEGRA_SWGROUP_A9AVP, 713 - .smmu = { 714 - .reg = 0x230, 715 - .bit = 23, 716 - }, 717 - .la = { 718 - .reg = 0x3a4, 719 - .shift = 16, 720 - .mask = 0xff, 721 - .def = 0x80, 815 + .regs = { 816 + .smmu = { 817 + .reg = 0x230, 818 + .bit = 23, 819 + }, 820 + .la = { 821 + .reg = 0x3a4, 822 + .shift = 16, 823 + .mask = 0xff, 824 + .def = 0x80, 825 + }, 722 826 }, 723 827 }, { 724 828 .id = 0x58, 725 829 .name = "gpusrd", 726 830 .swgroup = TEGRA_SWGROUP_GPU, 727 - .smmu = { 728 - /* read-only */ 729 - .reg = 0x230, 730 - .bit = 24, 731 - }, 732 - .la = { 733 - .reg = 0x3c8, 734 - .shift = 0, 735 - .mask = 0xff, 736 - .def = 0x1a, 831 + .regs = { 832 + .smmu = { 833 + /* read-only */ 834 + .reg = 0x230, 835 + .bit = 24, 836 + }, 837 + .la = { 838 + .reg = 0x3c8, 839 + .shift = 0, 840 + .mask = 0xff, 841 + .def = 0x1a, 842 + }, 737 843 }, 738 844 }, { 739 845 .id = 0x59, 740 846 .name = "gpuswr", 741 847 .swgroup = TEGRA_SWGROUP_GPU, 742 - .smmu = { 743 - /* read-only */ 744 - .reg = 0x230, 745 - .bit = 25, 746 - }, 747 - .la = { 748 - .reg = 0x3c8, 749 - .shift = 16, 750 - .mask = 0xff, 751 - .def = 0x80, 848 + .regs = { 849 + .smmu = { 850 + /* read-only */ 851 + .reg = 0x230, 852 + .bit = 25, 853 + }, 854 + .la = { 855 + .reg = 0x3c8, 856 + .shift = 16, 857 + .mask = 0xff, 858 + .def = 0x80, 859 + }, 752 860 }, 753 861 }, { 754 862 .id = 0x5a, 755 863 .name = "displayt", 756 864 .swgroup = TEGRA_SWGROUP_DC, 757 - .smmu = { 758 - .reg = 0x230, 759 - .bit = 26, 760 - }, 761 - .la = { 762 - .reg = 0x2f0, 763 - .shift = 16, 764 - .mask = 0xff, 765 - .def = 0x50, 865 + .regs = { 866 + .smmu = { 867 + .reg = 0x230, 868 + .bit = 26, 869 + }, 870 + .la = { 871 + .reg = 0x2f0, 872 + .shift = 16, 873 + .mask = 0xff, 874 + .def = 0x50, 875 + }, 766 876 }, 767 877 }, { 768 878 .id = 0x60, 769 879 .name = "sdmmcra", 770 880 .swgroup = TEGRA_SWGROUP_SDMMC1A, 771 - .smmu = { 772 - .reg = 0x234, 773 - .bit = 0, 774 - }, 775 - .la = { 776 - .reg = 0x3b8, 777 - .shift = 0, 778 - .mask = 0xff, 779 - .def = 0x49, 881 + .regs = { 882 + .smmu = { 883 + .reg = 0x234, 884 + .bit = 0, 885 + }, 886 + .la = { 887 + .reg = 0x3b8, 888 + .shift = 0, 889 + .mask = 0xff, 890 + .def = 0x49, 891 + }, 780 892 }, 781 893 }, { 782 894 .id = 0x61, 783 895 .name = "sdmmcraa", 784 896 .swgroup = TEGRA_SWGROUP_SDMMC2A, 785 - .smmu = { 786 - .reg = 0x234, 787 - .bit = 1, 788 - }, 789 - .la = { 790 - .reg = 0x3bc, 791 - .shift = 0, 792 - .mask = 0xff, 793 - .def = 0x49, 897 + .regs = { 898 + .smmu = { 899 + .reg = 0x234, 900 + .bit = 1, 901 + }, 902 + .la = { 903 + .reg = 0x3bc, 904 + .shift = 0, 905 + .mask = 0xff, 906 + .def = 0x49, 907 + }, 794 908 }, 795 909 }, { 796 910 .id = 0x62, 797 911 .name = "sdmmcr", 798 912 .swgroup = TEGRA_SWGROUP_SDMMC3A, 799 - .smmu = { 800 - .reg = 0x234, 801 - .bit = 2, 802 - }, 803 - .la = { 804 - .reg = 0x3c0, 805 - .shift = 0, 806 - .mask = 0xff, 807 - .def = 0x49, 913 + .regs = { 914 + .smmu = { 915 + .reg = 0x234, 916 + .bit = 2, 917 + }, 918 + .la = { 919 + .reg = 0x3c0, 920 + .shift = 0, 921 + .mask = 0xff, 922 + .def = 0x49, 923 + }, 808 924 }, 809 925 }, { 810 926 .id = 0x63, 811 927 .swgroup = TEGRA_SWGROUP_SDMMC4A, 812 928 .name = "sdmmcrab", 813 - .smmu = { 814 - .reg = 0x234, 815 - .bit = 3, 816 - }, 817 - .la = { 818 - .reg = 0x3c4, 819 - .shift = 0, 820 - .mask = 0xff, 821 - .def = 0x49, 929 + .regs = { 930 + .smmu = { 931 + .reg = 0x234, 932 + .bit = 3, 933 + }, 934 + .la = { 935 + .reg = 0x3c4, 936 + .shift = 0, 937 + .mask = 0xff, 938 + .def = 0x49, 939 + }, 822 940 }, 823 941 }, { 824 942 .id = 0x64, 825 943 .name = "sdmmcwa", 826 944 .swgroup = TEGRA_SWGROUP_SDMMC1A, 827 - .smmu = { 828 - .reg = 0x234, 829 - .bit = 4, 830 - }, 831 - .la = { 832 - .reg = 0x3b8, 833 - .shift = 16, 834 - .mask = 0xff, 835 - .def = 0x80, 945 + .regs = { 946 + .smmu = { 947 + .reg = 0x234, 948 + .bit = 4, 949 + }, 950 + .la = { 951 + .reg = 0x3b8, 952 + .shift = 16, 953 + .mask = 0xff, 954 + .def = 0x80, 955 + }, 836 956 }, 837 957 }, { 838 958 .id = 0x65, 839 959 .name = "sdmmcwaa", 840 960 .swgroup = TEGRA_SWGROUP_SDMMC2A, 841 - .smmu = { 842 - .reg = 0x234, 843 - .bit = 5, 844 - }, 845 - .la = { 846 - .reg = 0x3bc, 847 - .shift = 16, 848 - .mask = 0xff, 849 - .def = 0x80, 961 + .regs = { 962 + .smmu = { 963 + .reg = 0x234, 964 + .bit = 5, 965 + }, 966 + .la = { 967 + .reg = 0x3bc, 968 + .shift = 16, 969 + .mask = 0xff, 970 + .def = 0x80, 971 + }, 850 972 }, 851 973 }, { 852 974 .id = 0x66, 853 975 .name = "sdmmcw", 854 976 .swgroup = TEGRA_SWGROUP_SDMMC3A, 855 - .smmu = { 856 - .reg = 0x234, 857 - .bit = 6, 858 - }, 859 - .la = { 860 - .reg = 0x3c0, 861 - .shift = 16, 862 - .mask = 0xff, 863 - .def = 0x80, 977 + .regs = { 978 + .smmu = { 979 + .reg = 0x234, 980 + .bit = 6, 981 + }, 982 + .la = { 983 + .reg = 0x3c0, 984 + .shift = 16, 985 + .mask = 0xff, 986 + .def = 0x80, 987 + }, 864 988 }, 865 989 }, { 866 990 .id = 0x67, 867 991 .name = "sdmmcwab", 868 992 .swgroup = TEGRA_SWGROUP_SDMMC4A, 869 - .smmu = { 870 - .reg = 0x234, 871 - .bit = 7, 872 - }, 873 - .la = { 874 - .reg = 0x3c4, 875 - .shift = 16, 876 - .mask = 0xff, 877 - .def = 0x80, 993 + .regs = { 994 + .smmu = { 995 + .reg = 0x234, 996 + .bit = 7, 997 + }, 998 + .la = { 999 + .reg = 0x3c4, 1000 + .shift = 16, 1001 + .mask = 0xff, 1002 + .def = 0x80, 1003 + }, 878 1004 }, 879 1005 }, { 880 1006 .id = 0x6c, 881 1007 .name = "vicsrd", 882 1008 .swgroup = TEGRA_SWGROUP_VIC, 883 - .smmu = { 884 - .reg = 0x234, 885 - .bit = 12, 886 - }, 887 - .la = { 888 - .reg = 0x394, 889 - .shift = 0, 890 - .mask = 0xff, 891 - .def = 0x1a, 1009 + .regs = { 1010 + .smmu = { 1011 + .reg = 0x234, 1012 + .bit = 12, 1013 + }, 1014 + .la = { 1015 + .reg = 0x394, 1016 + .shift = 0, 1017 + .mask = 0xff, 1018 + .def = 0x1a, 1019 + }, 892 1020 }, 893 1021 }, { 894 1022 .id = 0x6d, 895 1023 .name = "vicswr", 896 1024 .swgroup = TEGRA_SWGROUP_VIC, 897 - .smmu = { 898 - .reg = 0x234, 899 - .bit = 13, 900 - }, 901 - .la = { 902 - .reg = 0x394, 903 - .shift = 16, 904 - .mask = 0xff, 905 - .def = 0x80, 1025 + .regs = { 1026 + .smmu = { 1027 + .reg = 0x234, 1028 + .bit = 13, 1029 + }, 1030 + .la = { 1031 + .reg = 0x394, 1032 + .shift = 16, 1033 + .mask = 0xff, 1034 + .def = 0x80, 1035 + }, 906 1036 }, 907 1037 }, { 908 1038 .id = 0x72, 909 1039 .name = "viw", 910 1040 .swgroup = TEGRA_SWGROUP_VI, 911 - .smmu = { 912 - .reg = 0x234, 913 - .bit = 18, 914 - }, 915 - .la = { 916 - .reg = 0x398, 917 - .shift = 0, 918 - .mask = 0xff, 919 - .def = 0x80, 1041 + .regs = { 1042 + .smmu = { 1043 + .reg = 0x234, 1044 + .bit = 18, 1045 + }, 1046 + .la = { 1047 + .reg = 0x398, 1048 + .shift = 0, 1049 + .mask = 0xff, 1050 + .def = 0x80, 1051 + }, 920 1052 }, 921 1053 }, { 922 1054 .id = 0x73, 923 1055 .name = "displayd", 924 1056 .swgroup = TEGRA_SWGROUP_DC, 925 - .smmu = { 926 - .reg = 0x234, 927 - .bit = 19, 928 - }, 929 - .la = { 930 - .reg = 0x3c8, 931 - .shift = 0, 932 - .mask = 0xff, 933 - .def = 0x50, 1057 + .regs = { 1058 + .smmu = { 1059 + .reg = 0x234, 1060 + .bit = 19, 1061 + }, 1062 + .la = { 1063 + .reg = 0x3c8, 1064 + .shift = 0, 1065 + .mask = 0xff, 1066 + .def = 0x50, 1067 + }, 934 1068 }, 935 1069 }, 936 1070 }; ··· 1274 1140 .resets = tegra124_mc_resets, 1275 1141 .num_resets = ARRAY_SIZE(tegra124_mc_resets), 1276 1142 .icc_ops = &tegra124_mc_icc_ops, 1143 + .ops = &tegra30_mc_ops, 1277 1144 }; 1278 1145 #endif /* CONFIG_ARCH_TEGRA_124_SOC */ 1279 1146 ··· 1306 1171 .resets = tegra124_mc_resets, 1307 1172 .num_resets = ARRAY_SIZE(tegra124_mc_resets), 1308 1173 .icc_ops = &tegra124_mc_icc_ops, 1174 + .ops = &tegra30_mc_ops, 1309 1175 }; 1310 1176 #endif /* CONFIG_ARCH_TEGRA_132_SOC */
+818 -1545
drivers/memory/tegra/tegra186.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 - * Copyright (C) 2017 NVIDIA CORPORATION. All rights reserved. 3 + * Copyright (C) 2017-2021 NVIDIA CORPORATION. All rights reserved. 4 4 */ 5 5 6 6 #include <linux/io.h> 7 + #include <linux/iommu.h> 7 8 #include <linux/module.h> 8 9 #include <linux/mod_devicetable.h> 9 10 #include <linux/of_device.h> 10 11 #include <linux/platform_device.h> 11 12 13 + #include <soc/tegra/mc.h> 14 + 12 15 #if defined(CONFIG_ARCH_TEGRA_186_SOC) 13 16 #include <dt-bindings/memory/tegra186-mc.h> 14 17 #endif 15 18 16 - #if defined(CONFIG_ARCH_TEGRA_194_SOC) 17 - #include <dt-bindings/memory/tegra194-mc.h> 18 - #endif 19 + #define MC_SID_STREAMID_OVERRIDE_MASK GENMASK(7, 0) 20 + #define MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED BIT(16) 21 + #define MC_SID_STREAMID_SECURITY_OVERRIDE BIT(8) 19 22 20 - struct tegra186_mc_client { 21 - const char *name; 22 - unsigned int sid; 23 - struct { 24 - unsigned int override; 25 - unsigned int security; 26 - } regs; 27 - }; 28 - 29 - struct tegra186_mc_soc { 30 - const struct tegra186_mc_client *clients; 31 - unsigned int num_clients; 32 - }; 33 - 34 - struct tegra186_mc { 35 - struct device *dev; 36 - void __iomem *regs; 37 - 38 - const struct tegra186_mc_soc *soc; 39 - }; 40 - 41 - static void tegra186_mc_program_sid(struct tegra186_mc *mc) 23 + static void tegra186_mc_program_sid(struct tegra_mc *mc) 42 24 { 43 25 unsigned int i; 44 26 45 27 for (i = 0; i < mc->soc->num_clients; i++) { 46 - const struct tegra186_mc_client *client = &mc->soc->clients[i]; 28 + const struct tegra_mc_client *client = &mc->soc->clients[i]; 47 29 u32 override, security; 48 30 49 - override = readl(mc->regs + client->regs.override); 50 - security = readl(mc->regs + client->regs.security); 31 + override = readl(mc->regs + client->regs.sid.override); 32 + security = readl(mc->regs + client->regs.sid.security); 51 33 52 34 dev_dbg(mc->dev, "client %s: override: %x security: %x\n", 53 35 client->name, override, security); 54 36 55 37 dev_dbg(mc->dev, "setting SID %u for %s\n", client->sid, 56 38 client->name); 57 - writel(client->sid, mc->regs + client->regs.override); 39 + writel(client->sid, mc->regs + client->regs.sid.override); 58 40 59 - override = readl(mc->regs + client->regs.override); 60 - security = readl(mc->regs + client->regs.security); 41 + override = readl(mc->regs + client->regs.sid.override); 42 + security = readl(mc->regs + client->regs.sid.security); 61 43 62 44 dev_dbg(mc->dev, "client %s: override: %x security: %x\n", 63 45 client->name, override, security); 64 46 } 65 47 } 66 48 67 - #if defined(CONFIG_ARCH_TEGRA_186_SOC) 68 - static const struct tegra186_mc_client tegra186_mc_clients[] = { 69 - { 70 - .name = "ptcr", 71 - .sid = TEGRA186_SID_PASSTHROUGH, 72 - .regs = { 73 - .override = 0x000, 74 - .security = 0x004, 75 - }, 76 - }, { 77 - .name = "afir", 78 - .sid = TEGRA186_SID_AFI, 79 - .regs = { 80 - .override = 0x070, 81 - .security = 0x074, 82 - }, 83 - }, { 84 - .name = "hdar", 85 - .sid = TEGRA186_SID_HDA, 86 - .regs = { 87 - .override = 0x0a8, 88 - .security = 0x0ac, 89 - }, 90 - }, { 91 - .name = "host1xdmar", 92 - .sid = TEGRA186_SID_HOST1X, 93 - .regs = { 94 - .override = 0x0b0, 95 - .security = 0x0b4, 96 - }, 97 - }, { 98 - .name = "nvencsrd", 99 - .sid = TEGRA186_SID_NVENC, 100 - .regs = { 101 - .override = 0x0e0, 102 - .security = 0x0e4, 103 - }, 104 - }, { 105 - .name = "satar", 106 - .sid = TEGRA186_SID_SATA, 107 - .regs = { 108 - .override = 0x0f8, 109 - .security = 0x0fc, 110 - }, 111 - }, { 112 - .name = "mpcorer", 113 - .sid = TEGRA186_SID_PASSTHROUGH, 114 - .regs = { 115 - .override = 0x138, 116 - .security = 0x13c, 117 - }, 118 - }, { 119 - .name = "nvencswr", 120 - .sid = TEGRA186_SID_NVENC, 121 - .regs = { 122 - .override = 0x158, 123 - .security = 0x15c, 124 - }, 125 - }, { 126 - .name = "afiw", 127 - .sid = TEGRA186_SID_AFI, 128 - .regs = { 129 - .override = 0x188, 130 - .security = 0x18c, 131 - }, 132 - }, { 133 - .name = "hdaw", 134 - .sid = TEGRA186_SID_HDA, 135 - .regs = { 136 - .override = 0x1a8, 137 - .security = 0x1ac, 138 - }, 139 - }, { 140 - .name = "mpcorew", 141 - .sid = TEGRA186_SID_PASSTHROUGH, 142 - .regs = { 143 - .override = 0x1c8, 144 - .security = 0x1cc, 145 - }, 146 - }, { 147 - .name = "sataw", 148 - .sid = TEGRA186_SID_SATA, 149 - .regs = { 150 - .override = 0x1e8, 151 - .security = 0x1ec, 152 - }, 153 - }, { 154 - .name = "ispra", 155 - .sid = TEGRA186_SID_ISP, 156 - .regs = { 157 - .override = 0x220, 158 - .security = 0x224, 159 - }, 160 - }, { 161 - .name = "ispwa", 162 - .sid = TEGRA186_SID_ISP, 163 - .regs = { 164 - .override = 0x230, 165 - .security = 0x234, 166 - }, 167 - }, { 168 - .name = "ispwb", 169 - .sid = TEGRA186_SID_ISP, 170 - .regs = { 171 - .override = 0x238, 172 - .security = 0x23c, 173 - }, 174 - }, { 175 - .name = "xusb_hostr", 176 - .sid = TEGRA186_SID_XUSB_HOST, 177 - .regs = { 178 - .override = 0x250, 179 - .security = 0x254, 180 - }, 181 - }, { 182 - .name = "xusb_hostw", 183 - .sid = TEGRA186_SID_XUSB_HOST, 184 - .regs = { 185 - .override = 0x258, 186 - .security = 0x25c, 187 - }, 188 - }, { 189 - .name = "xusb_devr", 190 - .sid = TEGRA186_SID_XUSB_DEV, 191 - .regs = { 192 - .override = 0x260, 193 - .security = 0x264, 194 - }, 195 - }, { 196 - .name = "xusb_devw", 197 - .sid = TEGRA186_SID_XUSB_DEV, 198 - .regs = { 199 - .override = 0x268, 200 - .security = 0x26c, 201 - }, 202 - }, { 203 - .name = "tsecsrd", 204 - .sid = TEGRA186_SID_TSEC, 205 - .regs = { 206 - .override = 0x2a0, 207 - .security = 0x2a4, 208 - }, 209 - }, { 210 - .name = "tsecswr", 211 - .sid = TEGRA186_SID_TSEC, 212 - .regs = { 213 - .override = 0x2a8, 214 - .security = 0x2ac, 215 - }, 216 - }, { 217 - .name = "gpusrd", 218 - .sid = TEGRA186_SID_GPU, 219 - .regs = { 220 - .override = 0x2c0, 221 - .security = 0x2c4, 222 - }, 223 - }, { 224 - .name = "gpuswr", 225 - .sid = TEGRA186_SID_GPU, 226 - .regs = { 227 - .override = 0x2c8, 228 - .security = 0x2cc, 229 - }, 230 - }, { 231 - .name = "sdmmcra", 232 - .sid = TEGRA186_SID_SDMMC1, 233 - .regs = { 234 - .override = 0x300, 235 - .security = 0x304, 236 - }, 237 - }, { 238 - .name = "sdmmcraa", 239 - .sid = TEGRA186_SID_SDMMC2, 240 - .regs = { 241 - .override = 0x308, 242 - .security = 0x30c, 243 - }, 244 - }, { 245 - .name = "sdmmcr", 246 - .sid = TEGRA186_SID_SDMMC3, 247 - .regs = { 248 - .override = 0x310, 249 - .security = 0x314, 250 - }, 251 - }, { 252 - .name = "sdmmcrab", 253 - .sid = TEGRA186_SID_SDMMC4, 254 - .regs = { 255 - .override = 0x318, 256 - .security = 0x31c, 257 - }, 258 - }, { 259 - .name = "sdmmcwa", 260 - .sid = TEGRA186_SID_SDMMC1, 261 - .regs = { 262 - .override = 0x320, 263 - .security = 0x324, 264 - }, 265 - }, { 266 - .name = "sdmmcwaa", 267 - .sid = TEGRA186_SID_SDMMC2, 268 - .regs = { 269 - .override = 0x328, 270 - .security = 0x32c, 271 - }, 272 - }, { 273 - .name = "sdmmcw", 274 - .sid = TEGRA186_SID_SDMMC3, 275 - .regs = { 276 - .override = 0x330, 277 - .security = 0x334, 278 - }, 279 - }, { 280 - .name = "sdmmcwab", 281 - .sid = TEGRA186_SID_SDMMC4, 282 - .regs = { 283 - .override = 0x338, 284 - .security = 0x33c, 285 - }, 286 - }, { 287 - .name = "vicsrd", 288 - .sid = TEGRA186_SID_VIC, 289 - .regs = { 290 - .override = 0x360, 291 - .security = 0x364, 292 - }, 293 - }, { 294 - .name = "vicswr", 295 - .sid = TEGRA186_SID_VIC, 296 - .regs = { 297 - .override = 0x368, 298 - .security = 0x36c, 299 - }, 300 - }, { 301 - .name = "viw", 302 - .sid = TEGRA186_SID_VI, 303 - .regs = { 304 - .override = 0x390, 305 - .security = 0x394, 306 - }, 307 - }, { 308 - .name = "nvdecsrd", 309 - .sid = TEGRA186_SID_NVDEC, 310 - .regs = { 311 - .override = 0x3c0, 312 - .security = 0x3c4, 313 - }, 314 - }, { 315 - .name = "nvdecswr", 316 - .sid = TEGRA186_SID_NVDEC, 317 - .regs = { 318 - .override = 0x3c8, 319 - .security = 0x3cc, 320 - }, 321 - }, { 322 - .name = "aper", 323 - .sid = TEGRA186_SID_APE, 324 - .regs = { 325 - .override = 0x3d0, 326 - .security = 0x3d4, 327 - }, 328 - }, { 329 - .name = "apew", 330 - .sid = TEGRA186_SID_APE, 331 - .regs = { 332 - .override = 0x3d8, 333 - .security = 0x3dc, 334 - }, 335 - }, { 336 - .name = "nvjpgsrd", 337 - .sid = TEGRA186_SID_NVJPG, 338 - .regs = { 339 - .override = 0x3f0, 340 - .security = 0x3f4, 341 - }, 342 - }, { 343 - .name = "nvjpgswr", 344 - .sid = TEGRA186_SID_NVJPG, 345 - .regs = { 346 - .override = 0x3f8, 347 - .security = 0x3fc, 348 - }, 349 - }, { 350 - .name = "sesrd", 351 - .sid = TEGRA186_SID_SE, 352 - .regs = { 353 - .override = 0x400, 354 - .security = 0x404, 355 - }, 356 - }, { 357 - .name = "seswr", 358 - .sid = TEGRA186_SID_SE, 359 - .regs = { 360 - .override = 0x408, 361 - .security = 0x40c, 362 - }, 363 - }, { 364 - .name = "etrr", 365 - .sid = TEGRA186_SID_ETR, 366 - .regs = { 367 - .override = 0x420, 368 - .security = 0x424, 369 - }, 370 - }, { 371 - .name = "etrw", 372 - .sid = TEGRA186_SID_ETR, 373 - .regs = { 374 - .override = 0x428, 375 - .security = 0x42c, 376 - }, 377 - }, { 378 - .name = "tsecsrdb", 379 - .sid = TEGRA186_SID_TSECB, 380 - .regs = { 381 - .override = 0x430, 382 - .security = 0x434, 383 - }, 384 - }, { 385 - .name = "tsecswrb", 386 - .sid = TEGRA186_SID_TSECB, 387 - .regs = { 388 - .override = 0x438, 389 - .security = 0x43c, 390 - }, 391 - }, { 392 - .name = "gpusrd2", 393 - .sid = TEGRA186_SID_GPU, 394 - .regs = { 395 - .override = 0x440, 396 - .security = 0x444, 397 - }, 398 - }, { 399 - .name = "gpuswr2", 400 - .sid = TEGRA186_SID_GPU, 401 - .regs = { 402 - .override = 0x448, 403 - .security = 0x44c, 404 - }, 405 - }, { 406 - .name = "axisr", 407 - .sid = TEGRA186_SID_GPCDMA_0, 408 - .regs = { 409 - .override = 0x460, 410 - .security = 0x464, 411 - }, 412 - }, { 413 - .name = "axisw", 414 - .sid = TEGRA186_SID_GPCDMA_0, 415 - .regs = { 416 - .override = 0x468, 417 - .security = 0x46c, 418 - }, 419 - }, { 420 - .name = "eqosr", 421 - .sid = TEGRA186_SID_EQOS, 422 - .regs = { 423 - .override = 0x470, 424 - .security = 0x474, 425 - }, 426 - }, { 427 - .name = "eqosw", 428 - .sid = TEGRA186_SID_EQOS, 429 - .regs = { 430 - .override = 0x478, 431 - .security = 0x47c, 432 - }, 433 - }, { 434 - .name = "ufshcr", 435 - .sid = TEGRA186_SID_UFSHC, 436 - .regs = { 437 - .override = 0x480, 438 - .security = 0x484, 439 - }, 440 - }, { 441 - .name = "ufshcw", 442 - .sid = TEGRA186_SID_UFSHC, 443 - .regs = { 444 - .override = 0x488, 445 - .security = 0x48c, 446 - }, 447 - }, { 448 - .name = "nvdisplayr", 449 - .sid = TEGRA186_SID_NVDISPLAY, 450 - .regs = { 451 - .override = 0x490, 452 - .security = 0x494, 453 - }, 454 - }, { 455 - .name = "bpmpr", 456 - .sid = TEGRA186_SID_BPMP, 457 - .regs = { 458 - .override = 0x498, 459 - .security = 0x49c, 460 - }, 461 - }, { 462 - .name = "bpmpw", 463 - .sid = TEGRA186_SID_BPMP, 464 - .regs = { 465 - .override = 0x4a0, 466 - .security = 0x4a4, 467 - }, 468 - }, { 469 - .name = "bpmpdmar", 470 - .sid = TEGRA186_SID_BPMP, 471 - .regs = { 472 - .override = 0x4a8, 473 - .security = 0x4ac, 474 - }, 475 - }, { 476 - .name = "bpmpdmaw", 477 - .sid = TEGRA186_SID_BPMP, 478 - .regs = { 479 - .override = 0x4b0, 480 - .security = 0x4b4, 481 - }, 482 - }, { 483 - .name = "aonr", 484 - .sid = TEGRA186_SID_AON, 485 - .regs = { 486 - .override = 0x4b8, 487 - .security = 0x4bc, 488 - }, 489 - }, { 490 - .name = "aonw", 491 - .sid = TEGRA186_SID_AON, 492 - .regs = { 493 - .override = 0x4c0, 494 - .security = 0x4c4, 495 - }, 496 - }, { 497 - .name = "aondmar", 498 - .sid = TEGRA186_SID_AON, 499 - .regs = { 500 - .override = 0x4c8, 501 - .security = 0x4cc, 502 - }, 503 - }, { 504 - .name = "aondmaw", 505 - .sid = TEGRA186_SID_AON, 506 - .regs = { 507 - .override = 0x4d0, 508 - .security = 0x4d4, 509 - }, 510 - }, { 511 - .name = "scer", 512 - .sid = TEGRA186_SID_SCE, 513 - .regs = { 514 - .override = 0x4d8, 515 - .security = 0x4dc, 516 - }, 517 - }, { 518 - .name = "scew", 519 - .sid = TEGRA186_SID_SCE, 520 - .regs = { 521 - .override = 0x4e0, 522 - .security = 0x4e4, 523 - }, 524 - }, { 525 - .name = "scedmar", 526 - .sid = TEGRA186_SID_SCE, 527 - .regs = { 528 - .override = 0x4e8, 529 - .security = 0x4ec, 530 - }, 531 - }, { 532 - .name = "scedmaw", 533 - .sid = TEGRA186_SID_SCE, 534 - .regs = { 535 - .override = 0x4f0, 536 - .security = 0x4f4, 537 - }, 538 - }, { 539 - .name = "apedmar", 540 - .sid = TEGRA186_SID_APE, 541 - .regs = { 542 - .override = 0x4f8, 543 - .security = 0x4fc, 544 - }, 545 - }, { 546 - .name = "apedmaw", 547 - .sid = TEGRA186_SID_APE, 548 - .regs = { 549 - .override = 0x500, 550 - .security = 0x504, 551 - }, 552 - }, { 553 - .name = "nvdisplayr1", 554 - .sid = TEGRA186_SID_NVDISPLAY, 555 - .regs = { 556 - .override = 0x508, 557 - .security = 0x50c, 558 - }, 559 - }, { 560 - .name = "vicsrd1", 561 - .sid = TEGRA186_SID_VIC, 562 - .regs = { 563 - .override = 0x510, 564 - .security = 0x514, 565 - }, 566 - }, { 567 - .name = "nvdecsrd1", 568 - .sid = TEGRA186_SID_NVDEC, 569 - .regs = { 570 - .override = 0x518, 571 - .security = 0x51c, 572 - }, 573 - }, 574 - }; 575 - 576 - static const struct tegra186_mc_soc tegra186_mc_soc = { 577 - .num_clients = ARRAY_SIZE(tegra186_mc_clients), 578 - .clients = tegra186_mc_clients, 579 - }; 580 - #endif 581 - 582 - #if defined(CONFIG_ARCH_TEGRA_194_SOC) 583 - static const struct tegra186_mc_client tegra194_mc_clients[] = { 584 - { 585 - .name = "ptcr", 586 - .sid = TEGRA194_SID_PASSTHROUGH, 587 - .regs = { 588 - .override = 0x000, 589 - .security = 0x004, 590 - }, 591 - }, { 592 - .name = "miu7r", 593 - .sid = TEGRA194_SID_MIU, 594 - .regs = { 595 - .override = 0x008, 596 - .security = 0x00c, 597 - }, 598 - }, { 599 - .name = "miu7w", 600 - .sid = TEGRA194_SID_MIU, 601 - .regs = { 602 - .override = 0x010, 603 - .security = 0x014, 604 - }, 605 - }, { 606 - .name = "hdar", 607 - .sid = TEGRA194_SID_HDA, 608 - .regs = { 609 - .override = 0x0a8, 610 - .security = 0x0ac, 611 - }, 612 - }, { 613 - .name = "host1xdmar", 614 - .sid = TEGRA194_SID_HOST1X, 615 - .regs = { 616 - .override = 0x0b0, 617 - .security = 0x0b4, 618 - }, 619 - }, { 620 - .name = "nvencsrd", 621 - .sid = TEGRA194_SID_NVENC, 622 - .regs = { 623 - .override = 0x0e0, 624 - .security = 0x0e4, 625 - }, 626 - }, { 627 - .name = "satar", 628 - .sid = TEGRA194_SID_SATA, 629 - .regs = { 630 - .override = 0x0f8, 631 - .security = 0x0fc, 632 - }, 633 - }, { 634 - .name = "mpcorer", 635 - .sid = TEGRA194_SID_PASSTHROUGH, 636 - .regs = { 637 - .override = 0x138, 638 - .security = 0x13c, 639 - }, 640 - }, { 641 - .name = "nvencswr", 642 - .sid = TEGRA194_SID_NVENC, 643 - .regs = { 644 - .override = 0x158, 645 - .security = 0x15c, 646 - }, 647 - }, { 648 - .name = "hdaw", 649 - .sid = TEGRA194_SID_HDA, 650 - .regs = { 651 - .override = 0x1a8, 652 - .security = 0x1ac, 653 - }, 654 - }, { 655 - .name = "mpcorew", 656 - .sid = TEGRA194_SID_PASSTHROUGH, 657 - .regs = { 658 - .override = 0x1c8, 659 - .security = 0x1cc, 660 - }, 661 - }, { 662 - .name = "sataw", 663 - .sid = TEGRA194_SID_SATA, 664 - .regs = { 665 - .override = 0x1e8, 666 - .security = 0x1ec, 667 - }, 668 - }, { 669 - .name = "ispra", 670 - .sid = TEGRA194_SID_ISP, 671 - .regs = { 672 - .override = 0x220, 673 - .security = 0x224, 674 - }, 675 - }, { 676 - .name = "ispfalr", 677 - .sid = TEGRA194_SID_ISP_FALCON, 678 - .regs = { 679 - .override = 0x228, 680 - .security = 0x22c, 681 - }, 682 - }, { 683 - .name = "ispwa", 684 - .sid = TEGRA194_SID_ISP, 685 - .regs = { 686 - .override = 0x230, 687 - .security = 0x234, 688 - }, 689 - }, { 690 - .name = "ispwb", 691 - .sid = TEGRA194_SID_ISP, 692 - .regs = { 693 - .override = 0x238, 694 - .security = 0x23c, 695 - }, 696 - }, { 697 - .name = "xusb_hostr", 698 - .sid = TEGRA194_SID_XUSB_HOST, 699 - .regs = { 700 - .override = 0x250, 701 - .security = 0x254, 702 - }, 703 - }, { 704 - .name = "xusb_hostw", 705 - .sid = TEGRA194_SID_XUSB_HOST, 706 - .regs = { 707 - .override = 0x258, 708 - .security = 0x25c, 709 - }, 710 - }, { 711 - .name = "xusb_devr", 712 - .sid = TEGRA194_SID_XUSB_DEV, 713 - .regs = { 714 - .override = 0x260, 715 - .security = 0x264, 716 - }, 717 - }, { 718 - .name = "xusb_devw", 719 - .sid = TEGRA194_SID_XUSB_DEV, 720 - .regs = { 721 - .override = 0x268, 722 - .security = 0x26c, 723 - }, 724 - }, { 725 - .name = "sdmmcra", 726 - .sid = TEGRA194_SID_SDMMC1, 727 - .regs = { 728 - .override = 0x300, 729 - .security = 0x304, 730 - }, 731 - }, { 732 - .name = "sdmmcr", 733 - .sid = TEGRA194_SID_SDMMC3, 734 - .regs = { 735 - .override = 0x310, 736 - .security = 0x314, 737 - }, 738 - }, { 739 - .name = "sdmmcrab", 740 - .sid = TEGRA194_SID_SDMMC4, 741 - .regs = { 742 - .override = 0x318, 743 - .security = 0x31c, 744 - }, 745 - }, { 746 - .name = "sdmmcwa", 747 - .sid = TEGRA194_SID_SDMMC1, 748 - .regs = { 749 - .override = 0x320, 750 - .security = 0x324, 751 - }, 752 - }, { 753 - .name = "sdmmcw", 754 - .sid = TEGRA194_SID_SDMMC3, 755 - .regs = { 756 - .override = 0x330, 757 - .security = 0x334, 758 - }, 759 - }, { 760 - .name = "sdmmcwab", 761 - .sid = TEGRA194_SID_SDMMC4, 762 - .regs = { 763 - .override = 0x338, 764 - .security = 0x33c, 765 - }, 766 - }, { 767 - .name = "vicsrd", 768 - .sid = TEGRA194_SID_VIC, 769 - .regs = { 770 - .override = 0x360, 771 - .security = 0x364, 772 - }, 773 - }, { 774 - .name = "vicswr", 775 - .sid = TEGRA194_SID_VIC, 776 - .regs = { 777 - .override = 0x368, 778 - .security = 0x36c, 779 - }, 780 - }, { 781 - .name = "viw", 782 - .sid = TEGRA194_SID_VI, 783 - .regs = { 784 - .override = 0x390, 785 - .security = 0x394, 786 - }, 787 - }, { 788 - .name = "nvdecsrd", 789 - .sid = TEGRA194_SID_NVDEC, 790 - .regs = { 791 - .override = 0x3c0, 792 - .security = 0x3c4, 793 - }, 794 - }, { 795 - .name = "nvdecswr", 796 - .sid = TEGRA194_SID_NVDEC, 797 - .regs = { 798 - .override = 0x3c8, 799 - .security = 0x3cc, 800 - }, 801 - }, { 802 - .name = "aper", 803 - .sid = TEGRA194_SID_APE, 804 - .regs = { 805 - .override = 0x3c0, 806 - .security = 0x3c4, 807 - }, 808 - }, { 809 - .name = "apew", 810 - .sid = TEGRA194_SID_APE, 811 - .regs = { 812 - .override = 0x3d0, 813 - .security = 0x3d4, 814 - }, 815 - }, { 816 - .name = "nvjpgsrd", 817 - .sid = TEGRA194_SID_NVJPG, 818 - .regs = { 819 - .override = 0x3f0, 820 - .security = 0x3f4, 821 - }, 822 - }, { 823 - .name = "nvjpgswr", 824 - .sid = TEGRA194_SID_NVJPG, 825 - .regs = { 826 - .override = 0x3f0, 827 - .security = 0x3f4, 828 - }, 829 - }, { 830 - .name = "axiapr", 831 - .sid = TEGRA194_SID_PASSTHROUGH, 832 - .regs = { 833 - .override = 0x410, 834 - .security = 0x414, 835 - }, 836 - }, { 837 - .name = "axiapw", 838 - .sid = TEGRA194_SID_PASSTHROUGH, 839 - .regs = { 840 - .override = 0x418, 841 - .security = 0x41c, 842 - }, 843 - }, { 844 - .name = "etrr", 845 - .sid = TEGRA194_SID_ETR, 846 - .regs = { 847 - .override = 0x420, 848 - .security = 0x424, 849 - }, 850 - }, { 851 - .name = "etrw", 852 - .sid = TEGRA194_SID_ETR, 853 - .regs = { 854 - .override = 0x428, 855 - .security = 0x42c, 856 - }, 857 - }, { 858 - .name = "axisr", 859 - .sid = TEGRA194_SID_PASSTHROUGH, 860 - .regs = { 861 - .override = 0x460, 862 - .security = 0x464, 863 - }, 864 - }, { 865 - .name = "axisw", 866 - .sid = TEGRA194_SID_PASSTHROUGH, 867 - .regs = { 868 - .override = 0x468, 869 - .security = 0x46c, 870 - }, 871 - }, { 872 - .name = "eqosr", 873 - .sid = TEGRA194_SID_EQOS, 874 - .regs = { 875 - .override = 0x470, 876 - .security = 0x474, 877 - }, 878 - }, { 879 - .name = "eqosw", 880 - .sid = TEGRA194_SID_EQOS, 881 - .regs = { 882 - .override = 0x478, 883 - .security = 0x47c, 884 - }, 885 - }, { 886 - .name = "ufshcr", 887 - .sid = TEGRA194_SID_UFSHC, 888 - .regs = { 889 - .override = 0x480, 890 - .security = 0x484, 891 - }, 892 - }, { 893 - .name = "ufshcw", 894 - .sid = TEGRA194_SID_UFSHC, 895 - .regs = { 896 - .override = 0x488, 897 - .security = 0x48c, 898 - }, 899 - }, { 900 - .name = "nvdisplayr", 901 - .sid = TEGRA194_SID_NVDISPLAY, 902 - .regs = { 903 - .override = 0x490, 904 - .security = 0x494, 905 - }, 906 - }, { 907 - .name = "bpmpr", 908 - .sid = TEGRA194_SID_BPMP, 909 - .regs = { 910 - .override = 0x498, 911 - .security = 0x49c, 912 - }, 913 - }, { 914 - .name = "bpmpw", 915 - .sid = TEGRA194_SID_BPMP, 916 - .regs = { 917 - .override = 0x4a0, 918 - .security = 0x4a4, 919 - }, 920 - }, { 921 - .name = "bpmpdmar", 922 - .sid = TEGRA194_SID_BPMP, 923 - .regs = { 924 - .override = 0x4a8, 925 - .security = 0x4ac, 926 - }, 927 - }, { 928 - .name = "bpmpdmaw", 929 - .sid = TEGRA194_SID_BPMP, 930 - .regs = { 931 - .override = 0x4b0, 932 - .security = 0x4b4, 933 - }, 934 - }, { 935 - .name = "aonr", 936 - .sid = TEGRA194_SID_AON, 937 - .regs = { 938 - .override = 0x4b8, 939 - .security = 0x4bc, 940 - }, 941 - }, { 942 - .name = "aonw", 943 - .sid = TEGRA194_SID_AON, 944 - .regs = { 945 - .override = 0x4c0, 946 - .security = 0x4c4, 947 - }, 948 - }, { 949 - .name = "aondmar", 950 - .sid = TEGRA194_SID_AON, 951 - .regs = { 952 - .override = 0x4c8, 953 - .security = 0x4cc, 954 - }, 955 - }, { 956 - .name = "aondmaw", 957 - .sid = TEGRA194_SID_AON, 958 - .regs = { 959 - .override = 0x4d0, 960 - .security = 0x4d4, 961 - }, 962 - }, { 963 - .name = "scer", 964 - .sid = TEGRA194_SID_SCE, 965 - .regs = { 966 - .override = 0x4d8, 967 - .security = 0x4dc, 968 - }, 969 - }, { 970 - .name = "scew", 971 - .sid = TEGRA194_SID_SCE, 972 - .regs = { 973 - .override = 0x4e0, 974 - .security = 0x4e4, 975 - }, 976 - }, { 977 - .name = "scedmar", 978 - .sid = TEGRA194_SID_SCE, 979 - .regs = { 980 - .override = 0x4e8, 981 - .security = 0x4ec, 982 - }, 983 - }, { 984 - .name = "scedmaw", 985 - .sid = TEGRA194_SID_SCE, 986 - .regs = { 987 - .override = 0x4f0, 988 - .security = 0x4f4, 989 - }, 990 - }, { 991 - .name = "apedmar", 992 - .sid = TEGRA194_SID_APE, 993 - .regs = { 994 - .override = 0x4f8, 995 - .security = 0x4fc, 996 - }, 997 - }, { 998 - .name = "apedmaw", 999 - .sid = TEGRA194_SID_APE, 1000 - .regs = { 1001 - .override = 0x500, 1002 - .security = 0x504, 1003 - }, 1004 - }, { 1005 - .name = "nvdisplayr1", 1006 - .sid = TEGRA194_SID_NVDISPLAY, 1007 - .regs = { 1008 - .override = 0x508, 1009 - .security = 0x50c, 1010 - }, 1011 - }, { 1012 - .name = "vicsrd1", 1013 - .sid = TEGRA194_SID_VIC, 1014 - .regs = { 1015 - .override = 0x510, 1016 - .security = 0x514, 1017 - }, 1018 - }, { 1019 - .name = "nvdecsrd1", 1020 - .sid = TEGRA194_SID_NVDEC, 1021 - .regs = { 1022 - .override = 0x518, 1023 - .security = 0x51c, 1024 - }, 1025 - }, { 1026 - .name = "miu0r", 1027 - .sid = TEGRA194_SID_MIU, 1028 - .regs = { 1029 - .override = 0x530, 1030 - .security = 0x534, 1031 - }, 1032 - }, { 1033 - .name = "miu0w", 1034 - .sid = TEGRA194_SID_MIU, 1035 - .regs = { 1036 - .override = 0x538, 1037 - .security = 0x53c, 1038 - }, 1039 - }, { 1040 - .name = "miu1r", 1041 - .sid = TEGRA194_SID_MIU, 1042 - .regs = { 1043 - .override = 0x540, 1044 - .security = 0x544, 1045 - }, 1046 - }, { 1047 - .name = "miu1w", 1048 - .sid = TEGRA194_SID_MIU, 1049 - .regs = { 1050 - .override = 0x548, 1051 - .security = 0x54c, 1052 - }, 1053 - }, { 1054 - .name = "miu2r", 1055 - .sid = TEGRA194_SID_MIU, 1056 - .regs = { 1057 - .override = 0x570, 1058 - .security = 0x574, 1059 - }, 1060 - }, { 1061 - .name = "miu2w", 1062 - .sid = TEGRA194_SID_MIU, 1063 - .regs = { 1064 - .override = 0x578, 1065 - .security = 0x57c, 1066 - }, 1067 - }, { 1068 - .name = "miu3r", 1069 - .sid = TEGRA194_SID_MIU, 1070 - .regs = { 1071 - .override = 0x580, 1072 - .security = 0x584, 1073 - }, 1074 - }, { 1075 - .name = "miu3w", 1076 - .sid = TEGRA194_SID_MIU, 1077 - .regs = { 1078 - .override = 0x588, 1079 - .security = 0x58c, 1080 - }, 1081 - }, { 1082 - .name = "miu4r", 1083 - .sid = TEGRA194_SID_MIU, 1084 - .regs = { 1085 - .override = 0x590, 1086 - .security = 0x594, 1087 - }, 1088 - }, { 1089 - .name = "miu4w", 1090 - .sid = TEGRA194_SID_MIU, 1091 - .regs = { 1092 - .override = 0x598, 1093 - .security = 0x59c, 1094 - }, 1095 - }, { 1096 - .name = "dpmur", 1097 - .sid = TEGRA194_SID_PASSTHROUGH, 1098 - .regs = { 1099 - .override = 0x598, 1100 - .security = 0x59c, 1101 - }, 1102 - }, { 1103 - .name = "vifalr", 1104 - .sid = TEGRA194_SID_VI_FALCON, 1105 - .regs = { 1106 - .override = 0x5e0, 1107 - .security = 0x5e4, 1108 - }, 1109 - }, { 1110 - .name = "vifalw", 1111 - .sid = TEGRA194_SID_VI_FALCON, 1112 - .regs = { 1113 - .override = 0x5e8, 1114 - .security = 0x5ec, 1115 - }, 1116 - }, { 1117 - .name = "dla0rda", 1118 - .sid = TEGRA194_SID_NVDLA0, 1119 - .regs = { 1120 - .override = 0x5f0, 1121 - .security = 0x5f4, 1122 - }, 1123 - }, { 1124 - .name = "dla0falrdb", 1125 - .sid = TEGRA194_SID_NVDLA0, 1126 - .regs = { 1127 - .override = 0x5f8, 1128 - .security = 0x5fc, 1129 - }, 1130 - }, { 1131 - .name = "dla0wra", 1132 - .sid = TEGRA194_SID_NVDLA0, 1133 - .regs = { 1134 - .override = 0x600, 1135 - .security = 0x604, 1136 - }, 1137 - }, { 1138 - .name = "dla0falwrb", 1139 - .sid = TEGRA194_SID_NVDLA0, 1140 - .regs = { 1141 - .override = 0x608, 1142 - .security = 0x60c, 1143 - }, 1144 - }, { 1145 - .name = "dla1rda", 1146 - .sid = TEGRA194_SID_NVDLA1, 1147 - .regs = { 1148 - .override = 0x610, 1149 - .security = 0x614, 1150 - }, 1151 - }, { 1152 - .name = "dla1falrdb", 1153 - .sid = TEGRA194_SID_NVDLA1, 1154 - .regs = { 1155 - .override = 0x618, 1156 - .security = 0x61c, 1157 - }, 1158 - }, { 1159 - .name = "dla1wra", 1160 - .sid = TEGRA194_SID_NVDLA1, 1161 - .regs = { 1162 - .override = 0x620, 1163 - .security = 0x624, 1164 - }, 1165 - }, { 1166 - .name = "dla1falwrb", 1167 - .sid = TEGRA194_SID_NVDLA1, 1168 - .regs = { 1169 - .override = 0x628, 1170 - .security = 0x62c, 1171 - }, 1172 - }, { 1173 - .name = "pva0rda", 1174 - .sid = TEGRA194_SID_PVA0, 1175 - .regs = { 1176 - .override = 0x630, 1177 - .security = 0x634, 1178 - }, 1179 - }, { 1180 - .name = "pva0rdb", 1181 - .sid = TEGRA194_SID_PVA0, 1182 - .regs = { 1183 - .override = 0x638, 1184 - .security = 0x63c, 1185 - }, 1186 - }, { 1187 - .name = "pva0rdc", 1188 - .sid = TEGRA194_SID_PVA0, 1189 - .regs = { 1190 - .override = 0x640, 1191 - .security = 0x644, 1192 - }, 1193 - }, { 1194 - .name = "pva0wra", 1195 - .sid = TEGRA194_SID_PVA0, 1196 - .regs = { 1197 - .override = 0x648, 1198 - .security = 0x64c, 1199 - }, 1200 - }, { 1201 - .name = "pva0wrb", 1202 - .sid = TEGRA194_SID_PVA0, 1203 - .regs = { 1204 - .override = 0x650, 1205 - .security = 0x654, 1206 - }, 1207 - }, { 1208 - .name = "pva0wrc", 1209 - .sid = TEGRA194_SID_PVA0, 1210 - .regs = { 1211 - .override = 0x658, 1212 - .security = 0x65c, 1213 - }, 1214 - }, { 1215 - .name = "pva1rda", 1216 - .sid = TEGRA194_SID_PVA1, 1217 - .regs = { 1218 - .override = 0x660, 1219 - .security = 0x664, 1220 - }, 1221 - }, { 1222 - .name = "pva1rdb", 1223 - .sid = TEGRA194_SID_PVA1, 1224 - .regs = { 1225 - .override = 0x668, 1226 - .security = 0x66c, 1227 - }, 1228 - }, { 1229 - .name = "pva1rdc", 1230 - .sid = TEGRA194_SID_PVA1, 1231 - .regs = { 1232 - .override = 0x670, 1233 - .security = 0x674, 1234 - }, 1235 - }, { 1236 - .name = "pva1wra", 1237 - .sid = TEGRA194_SID_PVA1, 1238 - .regs = { 1239 - .override = 0x678, 1240 - .security = 0x67c, 1241 - }, 1242 - }, { 1243 - .name = "pva1wrb", 1244 - .sid = TEGRA194_SID_PVA1, 1245 - .regs = { 1246 - .override = 0x680, 1247 - .security = 0x684, 1248 - }, 1249 - }, { 1250 - .name = "pva1wrc", 1251 - .sid = TEGRA194_SID_PVA1, 1252 - .regs = { 1253 - .override = 0x688, 1254 - .security = 0x68c, 1255 - }, 1256 - }, { 1257 - .name = "rcer", 1258 - .sid = TEGRA194_SID_RCE, 1259 - .regs = { 1260 - .override = 0x690, 1261 - .security = 0x694, 1262 - }, 1263 - }, { 1264 - .name = "rcew", 1265 - .sid = TEGRA194_SID_RCE, 1266 - .regs = { 1267 - .override = 0x698, 1268 - .security = 0x69c, 1269 - }, 1270 - }, { 1271 - .name = "rcedmar", 1272 - .sid = TEGRA194_SID_RCE, 1273 - .regs = { 1274 - .override = 0x6a0, 1275 - .security = 0x6a4, 1276 - }, 1277 - }, { 1278 - .name = "rcedmaw", 1279 - .sid = TEGRA194_SID_RCE, 1280 - .regs = { 1281 - .override = 0x6a8, 1282 - .security = 0x6ac, 1283 - }, 1284 - }, { 1285 - .name = "nvenc1srd", 1286 - .sid = TEGRA194_SID_NVENC1, 1287 - .regs = { 1288 - .override = 0x6b0, 1289 - .security = 0x6b4, 1290 - }, 1291 - }, { 1292 - .name = "nvenc1swr", 1293 - .sid = TEGRA194_SID_NVENC1, 1294 - .regs = { 1295 - .override = 0x6b8, 1296 - .security = 0x6bc, 1297 - }, 1298 - }, { 1299 - .name = "pcie0r", 1300 - .sid = TEGRA194_SID_PCIE0, 1301 - .regs = { 1302 - .override = 0x6c0, 1303 - .security = 0x6c4, 1304 - }, 1305 - }, { 1306 - .name = "pcie0w", 1307 - .sid = TEGRA194_SID_PCIE0, 1308 - .regs = { 1309 - .override = 0x6c8, 1310 - .security = 0x6cc, 1311 - }, 1312 - }, { 1313 - .name = "pcie1r", 1314 - .sid = TEGRA194_SID_PCIE1, 1315 - .regs = { 1316 - .override = 0x6d0, 1317 - .security = 0x6d4, 1318 - }, 1319 - }, { 1320 - .name = "pcie1w", 1321 - .sid = TEGRA194_SID_PCIE1, 1322 - .regs = { 1323 - .override = 0x6d8, 1324 - .security = 0x6dc, 1325 - }, 1326 - }, { 1327 - .name = "pcie2ar", 1328 - .sid = TEGRA194_SID_PCIE2, 1329 - .regs = { 1330 - .override = 0x6e0, 1331 - .security = 0x6e4, 1332 - }, 1333 - }, { 1334 - .name = "pcie2aw", 1335 - .sid = TEGRA194_SID_PCIE2, 1336 - .regs = { 1337 - .override = 0x6e8, 1338 - .security = 0x6ec, 1339 - }, 1340 - }, { 1341 - .name = "pcie3r", 1342 - .sid = TEGRA194_SID_PCIE3, 1343 - .regs = { 1344 - .override = 0x6f0, 1345 - .security = 0x6f4, 1346 - }, 1347 - }, { 1348 - .name = "pcie3w", 1349 - .sid = TEGRA194_SID_PCIE3, 1350 - .regs = { 1351 - .override = 0x6f8, 1352 - .security = 0x6fc, 1353 - }, 1354 - }, { 1355 - .name = "pcie4r", 1356 - .sid = TEGRA194_SID_PCIE4, 1357 - .regs = { 1358 - .override = 0x700, 1359 - .security = 0x704, 1360 - }, 1361 - }, { 1362 - .name = "pcie4w", 1363 - .sid = TEGRA194_SID_PCIE4, 1364 - .regs = { 1365 - .override = 0x708, 1366 - .security = 0x70c, 1367 - }, 1368 - }, { 1369 - .name = "pcie5r", 1370 - .sid = TEGRA194_SID_PCIE5, 1371 - .regs = { 1372 - .override = 0x710, 1373 - .security = 0x714, 1374 - }, 1375 - }, { 1376 - .name = "pcie5w", 1377 - .sid = TEGRA194_SID_PCIE5, 1378 - .regs = { 1379 - .override = 0x718, 1380 - .security = 0x71c, 1381 - }, 1382 - }, { 1383 - .name = "ispfalw", 1384 - .sid = TEGRA194_SID_ISP_FALCON, 1385 - .regs = { 1386 - .override = 0x720, 1387 - .security = 0x724, 1388 - }, 1389 - }, { 1390 - .name = "dla0rda1", 1391 - .sid = TEGRA194_SID_NVDLA0, 1392 - .regs = { 1393 - .override = 0x748, 1394 - .security = 0x74c, 1395 - }, 1396 - }, { 1397 - .name = "dla1rda1", 1398 - .sid = TEGRA194_SID_NVDLA1, 1399 - .regs = { 1400 - .override = 0x750, 1401 - .security = 0x754, 1402 - }, 1403 - }, { 1404 - .name = "pva0rda1", 1405 - .sid = TEGRA194_SID_PVA0, 1406 - .regs = { 1407 - .override = 0x758, 1408 - .security = 0x75c, 1409 - }, 1410 - }, { 1411 - .name = "pva0rdb1", 1412 - .sid = TEGRA194_SID_PVA0, 1413 - .regs = { 1414 - .override = 0x760, 1415 - .security = 0x764, 1416 - }, 1417 - }, { 1418 - .name = "pva1rda1", 1419 - .sid = TEGRA194_SID_PVA1, 1420 - .regs = { 1421 - .override = 0x768, 1422 - .security = 0x76c, 1423 - }, 1424 - }, { 1425 - .name = "pva1rdb1", 1426 - .sid = TEGRA194_SID_PVA1, 1427 - .regs = { 1428 - .override = 0x770, 1429 - .security = 0x774, 1430 - }, 1431 - }, { 1432 - .name = "pcie5r1", 1433 - .sid = TEGRA194_SID_PCIE5, 1434 - .regs = { 1435 - .override = 0x778, 1436 - .security = 0x77c, 1437 - }, 1438 - }, { 1439 - .name = "nvencsrd1", 1440 - .sid = TEGRA194_SID_NVENC, 1441 - .regs = { 1442 - .override = 0x780, 1443 - .security = 0x784, 1444 - }, 1445 - }, { 1446 - .name = "nvenc1srd1", 1447 - .sid = TEGRA194_SID_NVENC1, 1448 - .regs = { 1449 - .override = 0x788, 1450 - .security = 0x78c, 1451 - }, 1452 - }, { 1453 - .name = "ispra1", 1454 - .sid = TEGRA194_SID_ISP, 1455 - .regs = { 1456 - .override = 0x790, 1457 - .security = 0x794, 1458 - }, 1459 - }, { 1460 - .name = "pcie0r1", 1461 - .sid = TEGRA194_SID_PCIE0, 1462 - .regs = { 1463 - .override = 0x798, 1464 - .security = 0x79c, 1465 - }, 1466 - }, { 1467 - .name = "nvdec1srd", 1468 - .sid = TEGRA194_SID_NVDEC1, 1469 - .regs = { 1470 - .override = 0x7c8, 1471 - .security = 0x7cc, 1472 - }, 1473 - }, { 1474 - .name = "nvdec1srd1", 1475 - .sid = TEGRA194_SID_NVDEC1, 1476 - .regs = { 1477 - .override = 0x7d0, 1478 - .security = 0x7d4, 1479 - }, 1480 - }, { 1481 - .name = "nvdec1swr", 1482 - .sid = TEGRA194_SID_NVDEC1, 1483 - .regs = { 1484 - .override = 0x7d8, 1485 - .security = 0x7dc, 1486 - }, 1487 - }, { 1488 - .name = "miu5r", 1489 - .sid = TEGRA194_SID_MIU, 1490 - .regs = { 1491 - .override = 0x7e0, 1492 - .security = 0x7e4, 1493 - }, 1494 - }, { 1495 - .name = "miu5w", 1496 - .sid = TEGRA194_SID_MIU, 1497 - .regs = { 1498 - .override = 0x7e8, 1499 - .security = 0x7ec, 1500 - }, 1501 - }, { 1502 - .name = "miu6r", 1503 - .sid = TEGRA194_SID_MIU, 1504 - .regs = { 1505 - .override = 0x7f0, 1506 - .security = 0x7f4, 1507 - }, 1508 - }, { 1509 - .name = "miu6w", 1510 - .sid = TEGRA194_SID_MIU, 1511 - .regs = { 1512 - .override = 0x7f8, 1513 - .security = 0x7fc, 1514 - }, 1515 - }, 1516 - }; 1517 - 1518 - static const struct tegra186_mc_soc tegra194_mc_soc = { 1519 - .num_clients = ARRAY_SIZE(tegra194_mc_clients), 1520 - .clients = tegra194_mc_clients, 1521 - }; 1522 - #endif 1523 - 1524 - static int tegra186_mc_probe(struct platform_device *pdev) 49 + static int tegra186_mc_probe(struct tegra_mc *mc) 1525 50 { 1526 - struct tegra186_mc *mc; 1527 - struct resource *res; 1528 51 int err; 1529 52 1530 - mc = devm_kzalloc(&pdev->dev, sizeof(*mc), GFP_KERNEL); 1531 - if (!mc) 1532 - return -ENOMEM; 1533 - 1534 - mc->soc = of_device_get_match_data(&pdev->dev); 1535 - 1536 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1537 - mc->regs = devm_ioremap_resource(&pdev->dev, res); 1538 - if (IS_ERR(mc->regs)) 1539 - return PTR_ERR(mc->regs); 1540 - 1541 - mc->dev = &pdev->dev; 1542 - 1543 - err = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); 53 + err = of_platform_populate(mc->dev->of_node, NULL, NULL, mc->dev); 1544 54 if (err < 0) 1545 55 return err; 1546 56 1547 - platform_set_drvdata(pdev, mc); 1548 57 tegra186_mc_program_sid(mc); 1549 58 1550 59 return 0; 1551 60 } 1552 61 1553 - static int tegra186_mc_remove(struct platform_device *pdev) 62 + static void tegra186_mc_remove(struct tegra_mc *mc) 1554 63 { 1555 - struct tegra186_mc *mc = platform_get_drvdata(pdev); 1556 - 1557 64 of_platform_depopulate(mc->dev); 1558 - 1559 - return 0; 1560 65 } 1561 66 1562 - static const struct of_device_id tegra186_mc_of_match[] = { 1563 - #if defined(CONFIG_ARCH_TEGRA_186_SOC) 1564 - { .compatible = "nvidia,tegra186-mc", .data = &tegra186_mc_soc }, 1565 - #endif 1566 - #if defined(CONFIG_ARCH_TEGRA_194_SOC) 1567 - { .compatible = "nvidia,tegra194-mc", .data = &tegra194_mc_soc }, 1568 - #endif 1569 - { /* sentinel */ } 1570 - }; 1571 - MODULE_DEVICE_TABLE(of, tegra186_mc_of_match); 1572 - 1573 - static int __maybe_unused tegra186_mc_suspend(struct device *dev) 67 + static int tegra186_mc_resume(struct tegra_mc *mc) 1574 68 { 1575 - return 0; 1576 - } 1577 - 1578 - static int __maybe_unused tegra186_mc_resume(struct device *dev) 1579 - { 1580 - struct tegra186_mc *mc = dev_get_drvdata(dev); 1581 - 1582 69 tegra186_mc_program_sid(mc); 1583 70 1584 71 return 0; 1585 72 } 1586 73 1587 - static const struct dev_pm_ops tegra186_mc_pm_ops = { 1588 - SET_SYSTEM_SLEEP_PM_OPS(tegra186_mc_suspend, tegra186_mc_resume) 1589 - }; 74 + static void tegra186_mc_client_sid_override(struct tegra_mc *mc, 75 + const struct tegra_mc_client *client, 76 + unsigned int sid) 77 + { 78 + u32 value, old; 1590 79 1591 - static struct platform_driver tegra186_mc_driver = { 1592 - .driver = { 1593 - .name = "tegra186-mc", 1594 - .of_match_table = tegra186_mc_of_match, 1595 - .pm = &tegra186_mc_pm_ops, 1596 - .suppress_bind_attrs = true, 1597 - }, 80 + value = readl(mc->regs + client->regs.sid.security); 81 + if ((value & MC_SID_STREAMID_SECURITY_OVERRIDE) == 0) { 82 + /* 83 + * If the secure firmware has locked this down the override 84 + * for this memory client, there's nothing we can do here. 85 + */ 86 + if (value & MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED) 87 + return; 88 + 89 + /* 90 + * Otherwise, try to set the override itself. Typically the 91 + * secure firmware will never have set this configuration. 92 + * Instead, it will either have disabled write access to 93 + * this field, or it will already have set an explicit 94 + * override itself. 95 + */ 96 + WARN_ON((value & MC_SID_STREAMID_SECURITY_OVERRIDE) == 0); 97 + 98 + value |= MC_SID_STREAMID_SECURITY_OVERRIDE; 99 + writel(value, mc->regs + client->regs.sid.security); 100 + } 101 + 102 + value = readl(mc->regs + client->regs.sid.override); 103 + old = value & MC_SID_STREAMID_OVERRIDE_MASK; 104 + 105 + if (old != sid) { 106 + dev_dbg(mc->dev, "overriding SID %x for %s with %x\n", old, 107 + client->name, sid); 108 + writel(sid, mc->regs + client->regs.sid.override); 109 + } 110 + } 111 + 112 + static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev) 113 + { 114 + #if IS_ENABLED(CONFIG_IOMMU_API) 115 + struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); 116 + struct of_phandle_args args; 117 + unsigned int i, index = 0; 118 + 119 + while (!of_parse_phandle_with_args(dev->of_node, "interconnects", "#interconnect-cells", 120 + index, &args)) { 121 + if (args.np == mc->dev->of_node && args.args_count != 0) { 122 + for (i = 0; i < mc->soc->num_clients; i++) { 123 + const struct tegra_mc_client *client = &mc->soc->clients[i]; 124 + 125 + if (client->id == args.args[0]) { 126 + u32 sid = fwspec->ids[0] & MC_SID_STREAMID_OVERRIDE_MASK; 127 + 128 + tegra186_mc_client_sid_override(mc, client, sid); 129 + } 130 + } 131 + } 132 + 133 + index++; 134 + } 135 + #endif 136 + 137 + return 0; 138 + } 139 + 140 + const struct tegra_mc_ops tegra186_mc_ops = { 1598 141 .probe = tegra186_mc_probe, 1599 142 .remove = tegra186_mc_remove, 143 + .resume = tegra186_mc_resume, 144 + .probe_device = tegra186_mc_probe_device, 1600 145 }; 1601 - module_platform_driver(tegra186_mc_driver); 1602 146 1603 - MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>"); 1604 - MODULE_DESCRIPTION("NVIDIA Tegra186 Memory Controller driver"); 1605 - MODULE_LICENSE("GPL v2"); 147 + #if defined(CONFIG_ARCH_TEGRA_186_SOC) 148 + static const struct tegra_mc_client tegra186_mc_clients[] = { 149 + { 150 + .id = TEGRA186_MEMORY_CLIENT_PTCR, 151 + .name = "ptcr", 152 + .sid = TEGRA186_SID_PASSTHROUGH, 153 + .regs = { 154 + .sid = { 155 + .override = 0x000, 156 + .security = 0x004, 157 + }, 158 + }, 159 + }, { 160 + .id = TEGRA186_MEMORY_CLIENT_AFIR, 161 + .name = "afir", 162 + .sid = TEGRA186_SID_AFI, 163 + .regs = { 164 + .sid = { 165 + .override = 0x070, 166 + .security = 0x074, 167 + }, 168 + }, 169 + }, { 170 + .id = TEGRA186_MEMORY_CLIENT_HDAR, 171 + .name = "hdar", 172 + .sid = TEGRA186_SID_HDA, 173 + .regs = { 174 + .sid = { 175 + .override = 0x0a8, 176 + .security = 0x0ac, 177 + }, 178 + }, 179 + }, { 180 + .id = TEGRA186_MEMORY_CLIENT_HOST1XDMAR, 181 + .name = "host1xdmar", 182 + .sid = TEGRA186_SID_HOST1X, 183 + .regs = { 184 + .sid = { 185 + .override = 0x0b0, 186 + .security = 0x0b4, 187 + }, 188 + }, 189 + }, { 190 + .id = TEGRA186_MEMORY_CLIENT_NVENCSRD, 191 + .name = "nvencsrd", 192 + .sid = TEGRA186_SID_NVENC, 193 + .regs = { 194 + .sid = { 195 + .override = 0x0e0, 196 + .security = 0x0e4, 197 + }, 198 + }, 199 + }, { 200 + .id = TEGRA186_MEMORY_CLIENT_SATAR, 201 + .name = "satar", 202 + .sid = TEGRA186_SID_SATA, 203 + .regs = { 204 + .sid = { 205 + .override = 0x0f8, 206 + .security = 0x0fc, 207 + }, 208 + }, 209 + }, { 210 + .id = TEGRA186_MEMORY_CLIENT_MPCORER, 211 + .name = "mpcorer", 212 + .sid = TEGRA186_SID_PASSTHROUGH, 213 + .regs = { 214 + .sid = { 215 + .override = 0x138, 216 + .security = 0x13c, 217 + }, 218 + }, 219 + }, { 220 + .id = TEGRA186_MEMORY_CLIENT_NVENCSWR, 221 + .name = "nvencswr", 222 + .sid = TEGRA186_SID_NVENC, 223 + .regs = { 224 + .sid = { 225 + .override = 0x158, 226 + .security = 0x15c, 227 + }, 228 + }, 229 + }, { 230 + .id = TEGRA186_MEMORY_CLIENT_AFIW, 231 + .name = "afiw", 232 + .sid = TEGRA186_SID_AFI, 233 + .regs = { 234 + .sid = { 235 + .override = 0x188, 236 + .security = 0x18c, 237 + }, 238 + }, 239 + }, { 240 + .id = TEGRA186_MEMORY_CLIENT_HDAW, 241 + .name = "hdaw", 242 + .sid = TEGRA186_SID_HDA, 243 + .regs = { 244 + .sid = { 245 + .override = 0x1a8, 246 + .security = 0x1ac, 247 + }, 248 + }, 249 + }, { 250 + .id = TEGRA186_MEMORY_CLIENT_MPCOREW, 251 + .name = "mpcorew", 252 + .sid = TEGRA186_SID_PASSTHROUGH, 253 + .regs = { 254 + .sid = { 255 + .override = 0x1c8, 256 + .security = 0x1cc, 257 + }, 258 + }, 259 + }, { 260 + .id = TEGRA186_MEMORY_CLIENT_SATAW, 261 + .name = "sataw", 262 + .sid = TEGRA186_SID_SATA, 263 + .regs = { 264 + .sid = { 265 + .override = 0x1e8, 266 + .security = 0x1ec, 267 + }, 268 + }, 269 + }, { 270 + .id = TEGRA186_MEMORY_CLIENT_ISPRA, 271 + .name = "ispra", 272 + .sid = TEGRA186_SID_ISP, 273 + .regs = { 274 + .sid = { 275 + .override = 0x220, 276 + .security = 0x224, 277 + }, 278 + }, 279 + }, { 280 + .id = TEGRA186_MEMORY_CLIENT_ISPWA, 281 + .name = "ispwa", 282 + .sid = TEGRA186_SID_ISP, 283 + .regs = { 284 + .sid = { 285 + .override = 0x230, 286 + .security = 0x234, 287 + }, 288 + }, 289 + }, { 290 + .id = TEGRA186_MEMORY_CLIENT_ISPWB, 291 + .name = "ispwb", 292 + .sid = TEGRA186_SID_ISP, 293 + .regs = { 294 + .sid = { 295 + .override = 0x238, 296 + .security = 0x23c, 297 + }, 298 + }, 299 + }, { 300 + .id = TEGRA186_MEMORY_CLIENT_XUSB_HOSTR, 301 + .name = "xusb_hostr", 302 + .sid = TEGRA186_SID_XUSB_HOST, 303 + .regs = { 304 + .sid = { 305 + .override = 0x250, 306 + .security = 0x254, 307 + }, 308 + }, 309 + }, { 310 + .id = TEGRA186_MEMORY_CLIENT_XUSB_HOSTW, 311 + .name = "xusb_hostw", 312 + .sid = TEGRA186_SID_XUSB_HOST, 313 + .regs = { 314 + .sid = { 315 + .override = 0x258, 316 + .security = 0x25c, 317 + }, 318 + }, 319 + }, { 320 + .id = TEGRA186_MEMORY_CLIENT_XUSB_DEVR, 321 + .name = "xusb_devr", 322 + .sid = TEGRA186_SID_XUSB_DEV, 323 + .regs = { 324 + .sid = { 325 + .override = 0x260, 326 + .security = 0x264, 327 + }, 328 + }, 329 + }, { 330 + .id = TEGRA186_MEMORY_CLIENT_XUSB_DEVW, 331 + .name = "xusb_devw", 332 + .sid = TEGRA186_SID_XUSB_DEV, 333 + .regs = { 334 + .sid = { 335 + .override = 0x268, 336 + .security = 0x26c, 337 + }, 338 + }, 339 + }, { 340 + .id = TEGRA186_MEMORY_CLIENT_TSECSRD, 341 + .name = "tsecsrd", 342 + .sid = TEGRA186_SID_TSEC, 343 + .regs = { 344 + .sid = { 345 + .override = 0x2a0, 346 + .security = 0x2a4, 347 + }, 348 + }, 349 + }, { 350 + .id = TEGRA186_MEMORY_CLIENT_TSECSWR, 351 + .name = "tsecswr", 352 + .sid = TEGRA186_SID_TSEC, 353 + .regs = { 354 + .sid = { 355 + .override = 0x2a8, 356 + .security = 0x2ac, 357 + }, 358 + }, 359 + }, { 360 + .id = TEGRA186_MEMORY_CLIENT_GPUSRD, 361 + .name = "gpusrd", 362 + .sid = TEGRA186_SID_GPU, 363 + .regs = { 364 + .sid = { 365 + .override = 0x2c0, 366 + .security = 0x2c4, 367 + }, 368 + }, 369 + }, { 370 + .id = TEGRA186_MEMORY_CLIENT_GPUSWR, 371 + .name = "gpuswr", 372 + .sid = TEGRA186_SID_GPU, 373 + .regs = { 374 + .sid = { 375 + .override = 0x2c8, 376 + .security = 0x2cc, 377 + }, 378 + }, 379 + }, { 380 + .id = TEGRA186_MEMORY_CLIENT_SDMMCRA, 381 + .name = "sdmmcra", 382 + .sid = TEGRA186_SID_SDMMC1, 383 + .regs = { 384 + .sid = { 385 + .override = 0x300, 386 + .security = 0x304, 387 + }, 388 + }, 389 + }, { 390 + .id = TEGRA186_MEMORY_CLIENT_SDMMCRAA, 391 + .name = "sdmmcraa", 392 + .sid = TEGRA186_SID_SDMMC2, 393 + .regs = { 394 + .sid = { 395 + .override = 0x308, 396 + .security = 0x30c, 397 + }, 398 + }, 399 + }, { 400 + .id = TEGRA186_MEMORY_CLIENT_SDMMCR, 401 + .name = "sdmmcr", 402 + .sid = TEGRA186_SID_SDMMC3, 403 + .regs = { 404 + .sid = { 405 + .override = 0x310, 406 + .security = 0x314, 407 + }, 408 + }, 409 + }, { 410 + .id = TEGRA186_MEMORY_CLIENT_SDMMCRAB, 411 + .name = "sdmmcrab", 412 + .sid = TEGRA186_SID_SDMMC4, 413 + .regs = { 414 + .sid = { 415 + .override = 0x318, 416 + .security = 0x31c, 417 + }, 418 + }, 419 + }, { 420 + .id = TEGRA186_MEMORY_CLIENT_SDMMCWA, 421 + .name = "sdmmcwa", 422 + .sid = TEGRA186_SID_SDMMC1, 423 + .regs = { 424 + .sid = { 425 + .override = 0x320, 426 + .security = 0x324, 427 + }, 428 + }, 429 + }, { 430 + .id = TEGRA186_MEMORY_CLIENT_SDMMCWAA, 431 + .name = "sdmmcwaa", 432 + .sid = TEGRA186_SID_SDMMC2, 433 + .regs = { 434 + .sid = { 435 + .override = 0x328, 436 + .security = 0x32c, 437 + }, 438 + }, 439 + }, { 440 + .id = TEGRA186_MEMORY_CLIENT_SDMMCW, 441 + .name = "sdmmcw", 442 + .sid = TEGRA186_SID_SDMMC3, 443 + .regs = { 444 + .sid = { 445 + .override = 0x330, 446 + .security = 0x334, 447 + }, 448 + }, 449 + }, { 450 + .id = TEGRA186_MEMORY_CLIENT_SDMMCWAB, 451 + .name = "sdmmcwab", 452 + .sid = TEGRA186_SID_SDMMC4, 453 + .regs = { 454 + .sid = { 455 + .override = 0x338, 456 + .security = 0x33c, 457 + }, 458 + }, 459 + }, { 460 + .id = TEGRA186_MEMORY_CLIENT_VICSRD, 461 + .name = "vicsrd", 462 + .sid = TEGRA186_SID_VIC, 463 + .regs = { 464 + .sid = { 465 + .override = 0x360, 466 + .security = 0x364, 467 + }, 468 + }, 469 + }, { 470 + .id = TEGRA186_MEMORY_CLIENT_VICSWR, 471 + .name = "vicswr", 472 + .sid = TEGRA186_SID_VIC, 473 + .regs = { 474 + .sid = { 475 + .override = 0x368, 476 + .security = 0x36c, 477 + }, 478 + }, 479 + }, { 480 + .id = TEGRA186_MEMORY_CLIENT_VIW, 481 + .name = "viw", 482 + .sid = TEGRA186_SID_VI, 483 + .regs = { 484 + .sid = { 485 + .override = 0x390, 486 + .security = 0x394, 487 + }, 488 + }, 489 + }, { 490 + .id = TEGRA186_MEMORY_CLIENT_NVDECSRD, 491 + .name = "nvdecsrd", 492 + .sid = TEGRA186_SID_NVDEC, 493 + .regs = { 494 + .sid = { 495 + .override = 0x3c0, 496 + .security = 0x3c4, 497 + }, 498 + }, 499 + }, { 500 + .id = TEGRA186_MEMORY_CLIENT_NVDECSWR, 501 + .name = "nvdecswr", 502 + .sid = TEGRA186_SID_NVDEC, 503 + .regs = { 504 + .sid = { 505 + .override = 0x3c8, 506 + .security = 0x3cc, 507 + }, 508 + }, 509 + }, { 510 + .id = TEGRA186_MEMORY_CLIENT_APER, 511 + .name = "aper", 512 + .sid = TEGRA186_SID_APE, 513 + .regs = { 514 + .sid = { 515 + .override = 0x3d0, 516 + .security = 0x3d4, 517 + }, 518 + }, 519 + }, { 520 + .id = TEGRA186_MEMORY_CLIENT_APEW, 521 + .name = "apew", 522 + .sid = TEGRA186_SID_APE, 523 + .regs = { 524 + .sid = { 525 + .override = 0x3d8, 526 + .security = 0x3dc, 527 + }, 528 + }, 529 + }, { 530 + .id = TEGRA186_MEMORY_CLIENT_NVJPGSRD, 531 + .name = "nvjpgsrd", 532 + .sid = TEGRA186_SID_NVJPG, 533 + .regs = { 534 + .sid = { 535 + .override = 0x3f0, 536 + .security = 0x3f4, 537 + }, 538 + }, 539 + }, { 540 + .id = TEGRA186_MEMORY_CLIENT_NVJPGSWR, 541 + .name = "nvjpgswr", 542 + .sid = TEGRA186_SID_NVJPG, 543 + .regs = { 544 + .sid = { 545 + .override = 0x3f8, 546 + .security = 0x3fc, 547 + }, 548 + }, 549 + }, { 550 + .id = TEGRA186_MEMORY_CLIENT_SESRD, 551 + .name = "sesrd", 552 + .sid = TEGRA186_SID_SE, 553 + .regs = { 554 + .sid = { 555 + .override = 0x400, 556 + .security = 0x404, 557 + }, 558 + }, 559 + }, { 560 + .id = TEGRA186_MEMORY_CLIENT_SESWR, 561 + .name = "seswr", 562 + .sid = TEGRA186_SID_SE, 563 + .regs = { 564 + .sid = { 565 + .override = 0x408, 566 + .security = 0x40c, 567 + }, 568 + }, 569 + }, { 570 + .id = TEGRA186_MEMORY_CLIENT_ETRR, 571 + .name = "etrr", 572 + .sid = TEGRA186_SID_ETR, 573 + .regs = { 574 + .sid = { 575 + .override = 0x420, 576 + .security = 0x424, 577 + }, 578 + }, 579 + }, { 580 + .id = TEGRA186_MEMORY_CLIENT_ETRW, 581 + .name = "etrw", 582 + .sid = TEGRA186_SID_ETR, 583 + .regs = { 584 + .sid = { 585 + .override = 0x428, 586 + .security = 0x42c, 587 + }, 588 + }, 589 + }, { 590 + .id = TEGRA186_MEMORY_CLIENT_TSECSRDB, 591 + .name = "tsecsrdb", 592 + .sid = TEGRA186_SID_TSECB, 593 + .regs = { 594 + .sid = { 595 + .override = 0x430, 596 + .security = 0x434, 597 + }, 598 + }, 599 + }, { 600 + .id = TEGRA186_MEMORY_CLIENT_TSECSWRB, 601 + .name = "tsecswrb", 602 + .sid = TEGRA186_SID_TSECB, 603 + .regs = { 604 + .sid = { 605 + .override = 0x438, 606 + .security = 0x43c, 607 + }, 608 + }, 609 + }, { 610 + .id = TEGRA186_MEMORY_CLIENT_GPUSRD2, 611 + .name = "gpusrd2", 612 + .sid = TEGRA186_SID_GPU, 613 + .regs = { 614 + .sid = { 615 + .override = 0x440, 616 + .security = 0x444, 617 + }, 618 + }, 619 + }, { 620 + .id = TEGRA186_MEMORY_CLIENT_GPUSWR2, 621 + .name = "gpuswr2", 622 + .sid = TEGRA186_SID_GPU, 623 + .regs = { 624 + .sid = { 625 + .override = 0x448, 626 + .security = 0x44c, 627 + }, 628 + }, 629 + }, { 630 + .id = TEGRA186_MEMORY_CLIENT_AXISR, 631 + .name = "axisr", 632 + .sid = TEGRA186_SID_GPCDMA_0, 633 + .regs = { 634 + .sid = { 635 + .override = 0x460, 636 + .security = 0x464, 637 + }, 638 + }, 639 + }, { 640 + .id = TEGRA186_MEMORY_CLIENT_AXISW, 641 + .name = "axisw", 642 + .sid = TEGRA186_SID_GPCDMA_0, 643 + .regs = { 644 + .sid = { 645 + .override = 0x468, 646 + .security = 0x46c, 647 + }, 648 + }, 649 + }, { 650 + .id = TEGRA186_MEMORY_CLIENT_EQOSR, 651 + .name = "eqosr", 652 + .sid = TEGRA186_SID_EQOS, 653 + .regs = { 654 + .sid = { 655 + .override = 0x470, 656 + .security = 0x474, 657 + }, 658 + }, 659 + }, { 660 + .id = TEGRA186_MEMORY_CLIENT_EQOSW, 661 + .name = "eqosw", 662 + .sid = TEGRA186_SID_EQOS, 663 + .regs = { 664 + .sid = { 665 + .override = 0x478, 666 + .security = 0x47c, 667 + }, 668 + }, 669 + }, { 670 + .id = TEGRA186_MEMORY_CLIENT_UFSHCR, 671 + .name = "ufshcr", 672 + .sid = TEGRA186_SID_UFSHC, 673 + .regs = { 674 + .sid = { 675 + .override = 0x480, 676 + .security = 0x484, 677 + }, 678 + }, 679 + }, { 680 + .id = TEGRA186_MEMORY_CLIENT_UFSHCW, 681 + .name = "ufshcw", 682 + .sid = TEGRA186_SID_UFSHC, 683 + .regs = { 684 + .sid = { 685 + .override = 0x488, 686 + .security = 0x48c, 687 + }, 688 + }, 689 + }, { 690 + .id = TEGRA186_MEMORY_CLIENT_NVDISPLAYR, 691 + .name = "nvdisplayr", 692 + .sid = TEGRA186_SID_NVDISPLAY, 693 + .regs = { 694 + .sid = { 695 + .override = 0x490, 696 + .security = 0x494, 697 + }, 698 + }, 699 + }, { 700 + .id = TEGRA186_MEMORY_CLIENT_BPMPR, 701 + .name = "bpmpr", 702 + .sid = TEGRA186_SID_BPMP, 703 + .regs = { 704 + .sid = { 705 + .override = 0x498, 706 + .security = 0x49c, 707 + }, 708 + }, 709 + }, { 710 + .id = TEGRA186_MEMORY_CLIENT_BPMPW, 711 + .name = "bpmpw", 712 + .sid = TEGRA186_SID_BPMP, 713 + .regs = { 714 + .sid = { 715 + .override = 0x4a0, 716 + .security = 0x4a4, 717 + }, 718 + }, 719 + }, { 720 + .id = TEGRA186_MEMORY_CLIENT_BPMPDMAR, 721 + .name = "bpmpdmar", 722 + .sid = TEGRA186_SID_BPMP, 723 + .regs = { 724 + .sid = { 725 + .override = 0x4a8, 726 + .security = 0x4ac, 727 + }, 728 + }, 729 + }, { 730 + .id = TEGRA186_MEMORY_CLIENT_BPMPDMAW, 731 + .name = "bpmpdmaw", 732 + .sid = TEGRA186_SID_BPMP, 733 + .regs = { 734 + .sid = { 735 + .override = 0x4b0, 736 + .security = 0x4b4, 737 + }, 738 + }, 739 + }, { 740 + .id = TEGRA186_MEMORY_CLIENT_AONR, 741 + .name = "aonr", 742 + .sid = TEGRA186_SID_AON, 743 + .regs = { 744 + .sid = { 745 + .override = 0x4b8, 746 + .security = 0x4bc, 747 + }, 748 + }, 749 + }, { 750 + .id = TEGRA186_MEMORY_CLIENT_AONW, 751 + .name = "aonw", 752 + .sid = TEGRA186_SID_AON, 753 + .regs = { 754 + .sid = { 755 + .override = 0x4c0, 756 + .security = 0x4c4, 757 + }, 758 + }, 759 + }, { 760 + .id = TEGRA186_MEMORY_CLIENT_AONDMAR, 761 + .name = "aondmar", 762 + .sid = TEGRA186_SID_AON, 763 + .regs = { 764 + .sid = { 765 + .override = 0x4c8, 766 + .security = 0x4cc, 767 + }, 768 + }, 769 + }, { 770 + .id = TEGRA186_MEMORY_CLIENT_AONDMAW, 771 + .name = "aondmaw", 772 + .sid = TEGRA186_SID_AON, 773 + .regs = { 774 + .sid = { 775 + .override = 0x4d0, 776 + .security = 0x4d4, 777 + }, 778 + }, 779 + }, { 780 + .id = TEGRA186_MEMORY_CLIENT_SCER, 781 + .name = "scer", 782 + .sid = TEGRA186_SID_SCE, 783 + .regs = { 784 + .sid = { 785 + .override = 0x4d8, 786 + .security = 0x4dc, 787 + }, 788 + }, 789 + }, { 790 + .id = TEGRA186_MEMORY_CLIENT_SCEW, 791 + .name = "scew", 792 + .sid = TEGRA186_SID_SCE, 793 + .regs = { 794 + .sid = { 795 + .override = 0x4e0, 796 + .security = 0x4e4, 797 + }, 798 + }, 799 + }, { 800 + .id = TEGRA186_MEMORY_CLIENT_SCEDMAR, 801 + .name = "scedmar", 802 + .sid = TEGRA186_SID_SCE, 803 + .regs = { 804 + .sid = { 805 + .override = 0x4e8, 806 + .security = 0x4ec, 807 + }, 808 + }, 809 + }, { 810 + .id = TEGRA186_MEMORY_CLIENT_SCEDMAW, 811 + .name = "scedmaw", 812 + .sid = TEGRA186_SID_SCE, 813 + .regs = { 814 + .sid = { 815 + .override = 0x4f0, 816 + .security = 0x4f4, 817 + }, 818 + }, 819 + }, { 820 + .id = TEGRA186_MEMORY_CLIENT_APEDMAR, 821 + .name = "apedmar", 822 + .sid = TEGRA186_SID_APE, 823 + .regs = { 824 + .sid = { 825 + .override = 0x4f8, 826 + .security = 0x4fc, 827 + }, 828 + }, 829 + }, { 830 + .id = TEGRA186_MEMORY_CLIENT_APEDMAW, 831 + .name = "apedmaw", 832 + .sid = TEGRA186_SID_APE, 833 + .regs = { 834 + .sid = { 835 + .override = 0x500, 836 + .security = 0x504, 837 + }, 838 + }, 839 + }, { 840 + .id = TEGRA186_MEMORY_CLIENT_NVDISPLAYR1, 841 + .name = "nvdisplayr1", 842 + .sid = TEGRA186_SID_NVDISPLAY, 843 + .regs = { 844 + .sid = { 845 + .override = 0x508, 846 + .security = 0x50c, 847 + }, 848 + }, 849 + }, { 850 + .id = TEGRA186_MEMORY_CLIENT_VICSRD1, 851 + .name = "vicsrd1", 852 + .sid = TEGRA186_SID_VIC, 853 + .regs = { 854 + .sid = { 855 + .override = 0x510, 856 + .security = 0x514, 857 + }, 858 + }, 859 + }, { 860 + .id = TEGRA186_MEMORY_CLIENT_NVDECSRD1, 861 + .name = "nvdecsrd1", 862 + .sid = TEGRA186_SID_NVDEC, 863 + .regs = { 864 + .sid = { 865 + .override = 0x518, 866 + .security = 0x51c, 867 + }, 868 + }, 869 + }, 870 + }; 871 + 872 + const struct tegra_mc_soc tegra186_mc_soc = { 873 + .num_clients = ARRAY_SIZE(tegra186_mc_clients), 874 + .clients = tegra186_mc_clients, 875 + .num_address_bits = 40, 876 + .ops = &tegra186_mc_ops, 877 + }; 878 + #endif
+1351
drivers/memory/tegra/tegra194.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * Copyright (C) 2017-2021 NVIDIA CORPORATION. All rights reserved. 4 + */ 5 + 6 + #include <soc/tegra/mc.h> 7 + 8 + #include <dt-bindings/memory/tegra194-mc.h> 9 + 10 + #include "mc.h" 11 + 12 + static const struct tegra_mc_client tegra194_mc_clients[] = { 13 + { 14 + .id = TEGRA194_MEMORY_CLIENT_PTCR, 15 + .name = "ptcr", 16 + .sid = TEGRA194_SID_PASSTHROUGH, 17 + .regs = { 18 + .sid = { 19 + .override = 0x000, 20 + .security = 0x004, 21 + }, 22 + }, 23 + }, { 24 + .id = TEGRA194_MEMORY_CLIENT_MIU7R, 25 + .name = "miu7r", 26 + .sid = TEGRA194_SID_MIU, 27 + .regs = { 28 + .sid = { 29 + .override = 0x008, 30 + .security = 0x00c, 31 + }, 32 + }, 33 + }, { 34 + .id = TEGRA194_MEMORY_CLIENT_MIU7W, 35 + .name = "miu7w", 36 + .sid = TEGRA194_SID_MIU, 37 + .regs = { 38 + .sid = { 39 + .override = 0x010, 40 + .security = 0x014, 41 + }, 42 + }, 43 + }, { 44 + .id = TEGRA194_MEMORY_CLIENT_HDAR, 45 + .name = "hdar", 46 + .sid = TEGRA194_SID_HDA, 47 + .regs = { 48 + .sid = { 49 + .override = 0x0a8, 50 + .security = 0x0ac, 51 + }, 52 + }, 53 + }, { 54 + .id = TEGRA194_MEMORY_CLIENT_HOST1XDMAR, 55 + .name = "host1xdmar", 56 + .sid = TEGRA194_SID_HOST1X, 57 + .regs = { 58 + .sid = { 59 + .override = 0x0b0, 60 + .security = 0x0b4, 61 + }, 62 + }, 63 + }, { 64 + .id = TEGRA194_MEMORY_CLIENT_NVENCSRD, 65 + .name = "nvencsrd", 66 + .sid = TEGRA194_SID_NVENC, 67 + .regs = { 68 + .sid = { 69 + .override = 0x0e0, 70 + .security = 0x0e4, 71 + }, 72 + }, 73 + }, { 74 + .id = TEGRA194_MEMORY_CLIENT_SATAR, 75 + .name = "satar", 76 + .sid = TEGRA194_SID_SATA, 77 + .regs = { 78 + .sid = { 79 + .override = 0x0f8, 80 + .security = 0x0fc, 81 + }, 82 + }, 83 + }, { 84 + .id = TEGRA194_MEMORY_CLIENT_MPCORER, 85 + .name = "mpcorer", 86 + .sid = TEGRA194_SID_PASSTHROUGH, 87 + .regs = { 88 + .sid = { 89 + .override = 0x138, 90 + .security = 0x13c, 91 + }, 92 + }, 93 + }, { 94 + .id = TEGRA194_MEMORY_CLIENT_NVENCSWR, 95 + .name = "nvencswr", 96 + .sid = TEGRA194_SID_NVENC, 97 + .regs = { 98 + .sid = { 99 + .override = 0x158, 100 + .security = 0x15c, 101 + }, 102 + }, 103 + }, { 104 + .id = TEGRA194_MEMORY_CLIENT_HDAW, 105 + .name = "hdaw", 106 + .sid = TEGRA194_SID_HDA, 107 + .regs = { 108 + .sid = { 109 + .override = 0x1a8, 110 + .security = 0x1ac, 111 + }, 112 + }, 113 + }, { 114 + .id = TEGRA194_MEMORY_CLIENT_MPCOREW, 115 + .name = "mpcorew", 116 + .sid = TEGRA194_SID_PASSTHROUGH, 117 + .regs = { 118 + .sid = { 119 + .override = 0x1c8, 120 + .security = 0x1cc, 121 + }, 122 + }, 123 + }, { 124 + .id = TEGRA194_MEMORY_CLIENT_SATAW, 125 + .name = "sataw", 126 + .sid = TEGRA194_SID_SATA, 127 + .regs = { 128 + .sid = { 129 + .override = 0x1e8, 130 + .security = 0x1ec, 131 + }, 132 + }, 133 + }, { 134 + .id = TEGRA194_MEMORY_CLIENT_ISPRA, 135 + .name = "ispra", 136 + .sid = TEGRA194_SID_ISP, 137 + .regs = { 138 + .sid = { 139 + .override = 0x220, 140 + .security = 0x224, 141 + }, 142 + }, 143 + }, { 144 + .id = TEGRA194_MEMORY_CLIENT_ISPFALR, 145 + .name = "ispfalr", 146 + .sid = TEGRA194_SID_ISP_FALCON, 147 + .regs = { 148 + .sid = { 149 + .override = 0x228, 150 + .security = 0x22c, 151 + }, 152 + }, 153 + }, { 154 + .id = TEGRA194_MEMORY_CLIENT_ISPWA, 155 + .name = "ispwa", 156 + .sid = TEGRA194_SID_ISP, 157 + .regs = { 158 + .sid = { 159 + .override = 0x230, 160 + .security = 0x234, 161 + }, 162 + }, 163 + }, { 164 + .id = TEGRA194_MEMORY_CLIENT_ISPWB, 165 + .name = "ispwb", 166 + .sid = TEGRA194_SID_ISP, 167 + .regs = { 168 + .sid = { 169 + .override = 0x238, 170 + .security = 0x23c, 171 + }, 172 + }, 173 + }, { 174 + .id = TEGRA194_MEMORY_CLIENT_XUSB_HOSTR, 175 + .name = "xusb_hostr", 176 + .sid = TEGRA194_SID_XUSB_HOST, 177 + .regs = { 178 + .sid = { 179 + .override = 0x250, 180 + .security = 0x254, 181 + }, 182 + }, 183 + }, { 184 + .id = TEGRA194_MEMORY_CLIENT_XUSB_HOSTW, 185 + .name = "xusb_hostw", 186 + .sid = TEGRA194_SID_XUSB_HOST, 187 + .regs = { 188 + .sid = { 189 + .override = 0x258, 190 + .security = 0x25c, 191 + }, 192 + }, 193 + }, { 194 + .id = TEGRA194_MEMORY_CLIENT_XUSB_DEVR, 195 + .name = "xusb_devr", 196 + .sid = TEGRA194_SID_XUSB_DEV, 197 + .regs = { 198 + .sid = { 199 + .override = 0x260, 200 + .security = 0x264, 201 + }, 202 + }, 203 + }, { 204 + .id = TEGRA194_MEMORY_CLIENT_XUSB_DEVW, 205 + .name = "xusb_devw", 206 + .sid = TEGRA194_SID_XUSB_DEV, 207 + .regs = { 208 + .sid = { 209 + .override = 0x268, 210 + .security = 0x26c, 211 + }, 212 + }, 213 + }, { 214 + .id = TEGRA194_MEMORY_CLIENT_SDMMCRA, 215 + .name = "sdmmcra", 216 + .sid = TEGRA194_SID_SDMMC1, 217 + .regs = { 218 + .sid = { 219 + .override = 0x300, 220 + .security = 0x304, 221 + }, 222 + }, 223 + }, { 224 + .id = TEGRA194_MEMORY_CLIENT_SDMMCR, 225 + .name = "sdmmcr", 226 + .sid = TEGRA194_SID_SDMMC3, 227 + .regs = { 228 + .sid = { 229 + .override = 0x310, 230 + .security = 0x314, 231 + }, 232 + }, 233 + }, { 234 + .id = TEGRA194_MEMORY_CLIENT_SDMMCRAB, 235 + .name = "sdmmcrab", 236 + .sid = TEGRA194_SID_SDMMC4, 237 + .regs = { 238 + .sid = { 239 + .override = 0x318, 240 + .security = 0x31c, 241 + }, 242 + }, 243 + }, { 244 + .id = TEGRA194_MEMORY_CLIENT_SDMMCWA, 245 + .name = "sdmmcwa", 246 + .sid = TEGRA194_SID_SDMMC1, 247 + .regs = { 248 + .sid = { 249 + .override = 0x320, 250 + .security = 0x324, 251 + }, 252 + }, 253 + }, { 254 + .id = TEGRA194_MEMORY_CLIENT_SDMMCW, 255 + .name = "sdmmcw", 256 + .sid = TEGRA194_SID_SDMMC3, 257 + .regs = { 258 + .sid = { 259 + .override = 0x330, 260 + .security = 0x334, 261 + }, 262 + }, 263 + }, { 264 + .id = TEGRA194_MEMORY_CLIENT_SDMMCWAB, 265 + .name = "sdmmcwab", 266 + .sid = TEGRA194_SID_SDMMC4, 267 + .regs = { 268 + .sid = { 269 + .override = 0x338, 270 + .security = 0x33c, 271 + }, 272 + }, 273 + }, { 274 + .id = TEGRA194_MEMORY_CLIENT_VICSRD, 275 + .name = "vicsrd", 276 + .sid = TEGRA194_SID_VIC, 277 + .regs = { 278 + .sid = { 279 + .override = 0x360, 280 + .security = 0x364, 281 + }, 282 + }, 283 + }, { 284 + .id = TEGRA194_MEMORY_CLIENT_VICSWR, 285 + .name = "vicswr", 286 + .sid = TEGRA194_SID_VIC, 287 + .regs = { 288 + .sid = { 289 + .override = 0x368, 290 + .security = 0x36c, 291 + }, 292 + }, 293 + }, { 294 + .id = TEGRA194_MEMORY_CLIENT_VIW, 295 + .name = "viw", 296 + .sid = TEGRA194_SID_VI, 297 + .regs = { 298 + .sid = { 299 + .override = 0x390, 300 + .security = 0x394, 301 + }, 302 + }, 303 + }, { 304 + .id = TEGRA194_MEMORY_CLIENT_NVDECSRD, 305 + .name = "nvdecsrd", 306 + .sid = TEGRA194_SID_NVDEC, 307 + .regs = { 308 + .sid = { 309 + .override = 0x3c0, 310 + .security = 0x3c4, 311 + }, 312 + }, 313 + }, { 314 + .id = TEGRA194_MEMORY_CLIENT_NVDECSWR, 315 + .name = "nvdecswr", 316 + .sid = TEGRA194_SID_NVDEC, 317 + .regs = { 318 + .sid = { 319 + .override = 0x3c8, 320 + .security = 0x3cc, 321 + }, 322 + }, 323 + }, { 324 + .id = TEGRA194_MEMORY_CLIENT_APER, 325 + .name = "aper", 326 + .sid = TEGRA194_SID_APE, 327 + .regs = { 328 + .sid = { 329 + .override = 0x3c0, 330 + .security = 0x3c4, 331 + }, 332 + }, 333 + }, { 334 + .id = TEGRA194_MEMORY_CLIENT_APEW, 335 + .name = "apew", 336 + .sid = TEGRA194_SID_APE, 337 + .regs = { 338 + .sid = { 339 + .override = 0x3d0, 340 + .security = 0x3d4, 341 + }, 342 + }, 343 + }, { 344 + .id = TEGRA194_MEMORY_CLIENT_NVJPGSRD, 345 + .name = "nvjpgsrd", 346 + .sid = TEGRA194_SID_NVJPG, 347 + .regs = { 348 + .sid = { 349 + .override = 0x3f0, 350 + .security = 0x3f4, 351 + }, 352 + }, 353 + }, { 354 + .id = TEGRA194_MEMORY_CLIENT_NVJPGSWR, 355 + .name = "nvjpgswr", 356 + .sid = TEGRA194_SID_NVJPG, 357 + .regs = { 358 + .sid = { 359 + .override = 0x3f0, 360 + .security = 0x3f4, 361 + }, 362 + }, 363 + }, { 364 + .name = "axiapr", 365 + .id = TEGRA194_MEMORY_CLIENT_AXIAPR, 366 + .sid = TEGRA194_SID_PASSTHROUGH, 367 + .regs = { 368 + .sid = { 369 + .override = 0x410, 370 + .security = 0x414, 371 + }, 372 + }, 373 + }, { 374 + .id = TEGRA194_MEMORY_CLIENT_AXIAPW, 375 + .name = "axiapw", 376 + .sid = TEGRA194_SID_PASSTHROUGH, 377 + .regs = { 378 + .sid = { 379 + .override = 0x418, 380 + .security = 0x41c, 381 + }, 382 + }, 383 + }, { 384 + .id = TEGRA194_MEMORY_CLIENT_ETRR, 385 + .name = "etrr", 386 + .sid = TEGRA194_SID_ETR, 387 + .regs = { 388 + .sid = { 389 + .override = 0x420, 390 + .security = 0x424, 391 + }, 392 + }, 393 + }, { 394 + .id = TEGRA194_MEMORY_CLIENT_ETRW, 395 + .name = "etrw", 396 + .sid = TEGRA194_SID_ETR, 397 + .regs = { 398 + .sid = { 399 + .override = 0x428, 400 + .security = 0x42c, 401 + }, 402 + }, 403 + }, { 404 + .id = TEGRA194_MEMORY_CLIENT_AXISR, 405 + .name = "axisr", 406 + .sid = TEGRA194_SID_PASSTHROUGH, 407 + .regs = { 408 + .sid = { 409 + .override = 0x460, 410 + .security = 0x464, 411 + }, 412 + }, 413 + }, { 414 + .id = TEGRA194_MEMORY_CLIENT_AXISW, 415 + .name = "axisw", 416 + .sid = TEGRA194_SID_PASSTHROUGH, 417 + .regs = { 418 + .sid = { 419 + .override = 0x468, 420 + .security = 0x46c, 421 + }, 422 + }, 423 + }, { 424 + .id = TEGRA194_MEMORY_CLIENT_EQOSR, 425 + .name = "eqosr", 426 + .sid = TEGRA194_SID_EQOS, 427 + .regs = { 428 + .sid = { 429 + .override = 0x470, 430 + .security = 0x474, 431 + }, 432 + }, 433 + }, { 434 + .name = "eqosw", 435 + .id = TEGRA194_MEMORY_CLIENT_EQOSW, 436 + .sid = TEGRA194_SID_EQOS, 437 + .regs = { 438 + .sid = { 439 + .override = 0x478, 440 + .security = 0x47c, 441 + }, 442 + }, 443 + }, { 444 + .id = TEGRA194_MEMORY_CLIENT_UFSHCR, 445 + .name = "ufshcr", 446 + .sid = TEGRA194_SID_UFSHC, 447 + .regs = { 448 + .sid = { 449 + .override = 0x480, 450 + .security = 0x484, 451 + }, 452 + }, 453 + }, { 454 + .id = TEGRA194_MEMORY_CLIENT_UFSHCW, 455 + .name = "ufshcw", 456 + .sid = TEGRA194_SID_UFSHC, 457 + .regs = { 458 + .sid = { 459 + .override = 0x488, 460 + .security = 0x48c, 461 + }, 462 + }, 463 + }, { 464 + .id = TEGRA194_MEMORY_CLIENT_NVDISPLAYR, 465 + .name = "nvdisplayr", 466 + .sid = TEGRA194_SID_NVDISPLAY, 467 + .regs = { 468 + .sid = { 469 + .override = 0x490, 470 + .security = 0x494, 471 + }, 472 + }, 473 + }, { 474 + .id = TEGRA194_MEMORY_CLIENT_BPMPR, 475 + .name = "bpmpr", 476 + .sid = TEGRA194_SID_BPMP, 477 + .regs = { 478 + .sid = { 479 + .override = 0x498, 480 + .security = 0x49c, 481 + }, 482 + }, 483 + }, { 484 + .id = TEGRA194_MEMORY_CLIENT_BPMPW, 485 + .name = "bpmpw", 486 + .sid = TEGRA194_SID_BPMP, 487 + .regs = { 488 + .sid = { 489 + .override = 0x4a0, 490 + .security = 0x4a4, 491 + }, 492 + }, 493 + }, { 494 + .id = TEGRA194_MEMORY_CLIENT_BPMPDMAR, 495 + .name = "bpmpdmar", 496 + .sid = TEGRA194_SID_BPMP, 497 + .regs = { 498 + .sid = { 499 + .override = 0x4a8, 500 + .security = 0x4ac, 501 + }, 502 + }, 503 + }, { 504 + .id = TEGRA194_MEMORY_CLIENT_BPMPDMAW, 505 + .name = "bpmpdmaw", 506 + .sid = TEGRA194_SID_BPMP, 507 + .regs = { 508 + .sid = { 509 + .override = 0x4b0, 510 + .security = 0x4b4, 511 + }, 512 + }, 513 + }, { 514 + .id = TEGRA194_MEMORY_CLIENT_AONR, 515 + .name = "aonr", 516 + .sid = TEGRA194_SID_AON, 517 + .regs = { 518 + .sid = { 519 + .override = 0x4b8, 520 + .security = 0x4bc, 521 + }, 522 + }, 523 + }, { 524 + .id = TEGRA194_MEMORY_CLIENT_AONW, 525 + .name = "aonw", 526 + .sid = TEGRA194_SID_AON, 527 + .regs = { 528 + .sid = { 529 + .override = 0x4c0, 530 + .security = 0x4c4, 531 + }, 532 + }, 533 + }, { 534 + .id = TEGRA194_MEMORY_CLIENT_AONDMAR, 535 + .name = "aondmar", 536 + .sid = TEGRA194_SID_AON, 537 + .regs = { 538 + .sid = { 539 + .override = 0x4c8, 540 + .security = 0x4cc, 541 + }, 542 + }, 543 + }, { 544 + .id = TEGRA194_MEMORY_CLIENT_AONDMAW, 545 + .name = "aondmaw", 546 + .sid = TEGRA194_SID_AON, 547 + .regs = { 548 + .sid = { 549 + .override = 0x4d0, 550 + .security = 0x4d4, 551 + }, 552 + }, 553 + }, { 554 + .id = TEGRA194_MEMORY_CLIENT_SCER, 555 + .name = "scer", 556 + .sid = TEGRA194_SID_SCE, 557 + .regs = { 558 + .sid = { 559 + .override = 0x4d8, 560 + .security = 0x4dc, 561 + }, 562 + }, 563 + }, { 564 + .id = TEGRA194_MEMORY_CLIENT_SCEW, 565 + .name = "scew", 566 + .sid = TEGRA194_SID_SCE, 567 + .regs = { 568 + .sid = { 569 + .override = 0x4e0, 570 + .security = 0x4e4, 571 + }, 572 + }, 573 + }, { 574 + .id = TEGRA194_MEMORY_CLIENT_SCEDMAR, 575 + .name = "scedmar", 576 + .sid = TEGRA194_SID_SCE, 577 + .regs = { 578 + .sid = { 579 + .override = 0x4e8, 580 + .security = 0x4ec, 581 + }, 582 + }, 583 + }, { 584 + .id = TEGRA194_MEMORY_CLIENT_SCEDMAW, 585 + .name = "scedmaw", 586 + .sid = TEGRA194_SID_SCE, 587 + .regs = { 588 + .sid = { 589 + .override = 0x4f0, 590 + .security = 0x4f4, 591 + }, 592 + }, 593 + }, { 594 + .id = TEGRA194_MEMORY_CLIENT_APEDMAR, 595 + .name = "apedmar", 596 + .sid = TEGRA194_SID_APE, 597 + .regs = { 598 + .sid = { 599 + .override = 0x4f8, 600 + .security = 0x4fc, 601 + }, 602 + }, 603 + }, { 604 + .id = TEGRA194_MEMORY_CLIENT_APEDMAW, 605 + .name = "apedmaw", 606 + .sid = TEGRA194_SID_APE, 607 + .regs = { 608 + .sid = { 609 + .override = 0x500, 610 + .security = 0x504, 611 + }, 612 + }, 613 + }, { 614 + .id = TEGRA194_MEMORY_CLIENT_NVDISPLAYR1, 615 + .name = "nvdisplayr1", 616 + .sid = TEGRA194_SID_NVDISPLAY, 617 + .regs = { 618 + .sid = { 619 + .override = 0x508, 620 + .security = 0x50c, 621 + }, 622 + }, 623 + }, { 624 + .id = TEGRA194_MEMORY_CLIENT_VICSRD1, 625 + .name = "vicsrd1", 626 + .sid = TEGRA194_SID_VIC, 627 + .regs = { 628 + .sid = { 629 + .override = 0x510, 630 + .security = 0x514, 631 + }, 632 + }, 633 + }, { 634 + .id = TEGRA194_MEMORY_CLIENT_NVDECSRD1, 635 + .name = "nvdecsrd1", 636 + .sid = TEGRA194_SID_NVDEC, 637 + .regs = { 638 + .sid = { 639 + .override = 0x518, 640 + .security = 0x51c, 641 + }, 642 + }, 643 + }, { 644 + .id = TEGRA194_MEMORY_CLIENT_MIU0R, 645 + .name = "miu0r", 646 + .sid = TEGRA194_SID_MIU, 647 + .regs = { 648 + .sid = { 649 + .override = 0x530, 650 + .security = 0x534, 651 + }, 652 + }, 653 + }, { 654 + .name = "miu0w", 655 + .id = TEGRA194_MEMORY_CLIENT_MIU0W, 656 + .sid = TEGRA194_SID_MIU, 657 + .regs = { 658 + .sid = { 659 + .override = 0x538, 660 + .security = 0x53c, 661 + }, 662 + }, 663 + }, { 664 + .id = TEGRA194_MEMORY_CLIENT_MIU1R, 665 + .name = "miu1r", 666 + .sid = TEGRA194_SID_MIU, 667 + .regs = { 668 + .sid = { 669 + .override = 0x540, 670 + .security = 0x544, 671 + }, 672 + }, 673 + }, { 674 + .id = TEGRA194_MEMORY_CLIENT_MIU1W, 675 + .name = "miu1w", 676 + .sid = TEGRA194_SID_MIU, 677 + .regs = { 678 + .sid = { 679 + .override = 0x548, 680 + .security = 0x54c, 681 + }, 682 + }, 683 + }, { 684 + .id = TEGRA194_MEMORY_CLIENT_MIU2R, 685 + .name = "miu2r", 686 + .sid = TEGRA194_SID_MIU, 687 + .regs = { 688 + .sid = { 689 + .override = 0x570, 690 + .security = 0x574, 691 + }, 692 + }, 693 + }, { 694 + .id = TEGRA194_MEMORY_CLIENT_MIU2W, 695 + .name = "miu2w", 696 + .sid = TEGRA194_SID_MIU, 697 + .regs = { 698 + .sid = { 699 + .override = 0x578, 700 + .security = 0x57c, 701 + }, 702 + }, 703 + }, { 704 + .id = TEGRA194_MEMORY_CLIENT_MIU3R, 705 + .name = "miu3r", 706 + .sid = TEGRA194_SID_MIU, 707 + .regs = { 708 + .sid = { 709 + .override = 0x580, 710 + .security = 0x584, 711 + }, 712 + }, 713 + }, { 714 + .id = TEGRA194_MEMORY_CLIENT_MIU3W, 715 + .name = "miu3w", 716 + .sid = TEGRA194_SID_MIU, 717 + .regs = { 718 + .sid = { 719 + .override = 0x588, 720 + .security = 0x58c, 721 + }, 722 + }, 723 + }, { 724 + .id = TEGRA194_MEMORY_CLIENT_MIU4R, 725 + .name = "miu4r", 726 + .sid = TEGRA194_SID_MIU, 727 + .regs = { 728 + .sid = { 729 + .override = 0x590, 730 + .security = 0x594, 731 + }, 732 + }, 733 + }, { 734 + .id = TEGRA194_MEMORY_CLIENT_MIU4W, 735 + .name = "miu4w", 736 + .sid = TEGRA194_SID_MIU, 737 + .regs = { 738 + .sid = { 739 + .override = 0x598, 740 + .security = 0x59c, 741 + }, 742 + }, 743 + }, { 744 + .id = TEGRA194_MEMORY_CLIENT_DPMUR, 745 + .name = "dpmur", 746 + .sid = TEGRA194_SID_PASSTHROUGH, 747 + .regs = { 748 + .sid = { 749 + .override = 0x598, 750 + .security = 0x59c, 751 + }, 752 + }, 753 + }, { 754 + .id = TEGRA194_MEMORY_CLIENT_VIFALR, 755 + .name = "vifalr", 756 + .sid = TEGRA194_SID_VI_FALCON, 757 + .regs = { 758 + .sid = { 759 + .override = 0x5e0, 760 + .security = 0x5e4, 761 + }, 762 + }, 763 + }, { 764 + .id = TEGRA194_MEMORY_CLIENT_VIFALW, 765 + .name = "vifalw", 766 + .sid = TEGRA194_SID_VI_FALCON, 767 + .regs = { 768 + .sid = { 769 + .override = 0x5e8, 770 + .security = 0x5ec, 771 + }, 772 + }, 773 + }, { 774 + .id = TEGRA194_MEMORY_CLIENT_DLA0RDA, 775 + .name = "dla0rda", 776 + .sid = TEGRA194_SID_NVDLA0, 777 + .regs = { 778 + .sid = { 779 + .override = 0x5f0, 780 + .security = 0x5f4, 781 + }, 782 + }, 783 + }, { 784 + .id = TEGRA194_MEMORY_CLIENT_DLA0FALRDB, 785 + .name = "dla0falrdb", 786 + .sid = TEGRA194_SID_NVDLA0, 787 + .regs = { 788 + .sid = { 789 + .override = 0x5f8, 790 + .security = 0x5fc, 791 + }, 792 + }, 793 + }, { 794 + .id = TEGRA194_MEMORY_CLIENT_DLA0WRA, 795 + .name = "dla0wra", 796 + .sid = TEGRA194_SID_NVDLA0, 797 + .regs = { 798 + .sid = { 799 + .override = 0x600, 800 + .security = 0x604, 801 + }, 802 + }, 803 + }, { 804 + .id = TEGRA194_MEMORY_CLIENT_DLA0FALWRB, 805 + .name = "dla0falwrb", 806 + .sid = TEGRA194_SID_NVDLA0, 807 + .regs = { 808 + .sid = { 809 + .override = 0x608, 810 + .security = 0x60c, 811 + }, 812 + }, 813 + }, { 814 + .id = TEGRA194_MEMORY_CLIENT_DLA1RDA, 815 + .name = "dla1rda", 816 + .sid = TEGRA194_SID_NVDLA1, 817 + .regs = { 818 + .sid = { 819 + .override = 0x610, 820 + .security = 0x614, 821 + }, 822 + }, 823 + }, { 824 + .id = TEGRA194_MEMORY_CLIENT_DLA1FALRDB, 825 + .name = "dla1falrdb", 826 + .sid = TEGRA194_SID_NVDLA1, 827 + .regs = { 828 + .sid = { 829 + .override = 0x618, 830 + .security = 0x61c, 831 + }, 832 + }, 833 + }, { 834 + .id = TEGRA194_MEMORY_CLIENT_DLA1WRA, 835 + .name = "dla1wra", 836 + .sid = TEGRA194_SID_NVDLA1, 837 + .regs = { 838 + .sid = { 839 + .override = 0x620, 840 + .security = 0x624, 841 + }, 842 + }, 843 + }, { 844 + .id = TEGRA194_MEMORY_CLIENT_DLA1FALWRB, 845 + .name = "dla1falwrb", 846 + .sid = TEGRA194_SID_NVDLA1, 847 + .regs = { 848 + .sid = { 849 + .override = 0x628, 850 + .security = 0x62c, 851 + }, 852 + }, 853 + }, { 854 + .id = TEGRA194_MEMORY_CLIENT_PVA0RDA, 855 + .name = "pva0rda", 856 + .sid = TEGRA194_SID_PVA0, 857 + .regs = { 858 + .sid = { 859 + .override = 0x630, 860 + .security = 0x634, 861 + }, 862 + }, 863 + }, { 864 + .id = TEGRA194_MEMORY_CLIENT_PVA0RDB, 865 + .name = "pva0rdb", 866 + .sid = TEGRA194_SID_PVA0, 867 + .regs = { 868 + .sid = { 869 + .override = 0x638, 870 + .security = 0x63c, 871 + }, 872 + }, 873 + }, { 874 + .id = TEGRA194_MEMORY_CLIENT_PVA0RDC, 875 + .name = "pva0rdc", 876 + .sid = TEGRA194_SID_PVA0, 877 + .regs = { 878 + .sid = { 879 + .override = 0x640, 880 + .security = 0x644, 881 + }, 882 + }, 883 + }, { 884 + .id = TEGRA194_MEMORY_CLIENT_PVA0WRA, 885 + .name = "pva0wra", 886 + .sid = TEGRA194_SID_PVA0, 887 + .regs = { 888 + .sid = { 889 + .override = 0x648, 890 + .security = 0x64c, 891 + }, 892 + }, 893 + }, { 894 + .id = TEGRA194_MEMORY_CLIENT_PVA0WRB, 895 + .name = "pva0wrb", 896 + .sid = TEGRA194_SID_PVA0, 897 + .regs = { 898 + .sid = { 899 + .override = 0x650, 900 + .security = 0x654, 901 + }, 902 + }, 903 + }, { 904 + .id = TEGRA194_MEMORY_CLIENT_PVA0WRC, 905 + .name = "pva0wrc", 906 + .sid = TEGRA194_SID_PVA0, 907 + .regs = { 908 + .sid = { 909 + .override = 0x658, 910 + .security = 0x65c, 911 + }, 912 + }, 913 + }, { 914 + .id = TEGRA194_MEMORY_CLIENT_PVA1RDA, 915 + .name = "pva1rda", 916 + .sid = TEGRA194_SID_PVA1, 917 + .regs = { 918 + .sid = { 919 + .override = 0x660, 920 + .security = 0x664, 921 + }, 922 + }, 923 + }, { 924 + .id = TEGRA194_MEMORY_CLIENT_PVA1RDB, 925 + .name = "pva1rdb", 926 + .sid = TEGRA194_SID_PVA1, 927 + .regs = { 928 + .sid = { 929 + .override = 0x668, 930 + .security = 0x66c, 931 + }, 932 + }, 933 + }, { 934 + .id = TEGRA194_MEMORY_CLIENT_PVA1RDC, 935 + .name = "pva1rdc", 936 + .sid = TEGRA194_SID_PVA1, 937 + .regs = { 938 + .sid = { 939 + .override = 0x670, 940 + .security = 0x674, 941 + }, 942 + }, 943 + }, { 944 + .id = TEGRA194_MEMORY_CLIENT_PVA1WRA, 945 + .name = "pva1wra", 946 + .sid = TEGRA194_SID_PVA1, 947 + .regs = { 948 + .sid = { 949 + .override = 0x678, 950 + .security = 0x67c, 951 + }, 952 + }, 953 + }, { 954 + .id = TEGRA194_MEMORY_CLIENT_PVA1WRB, 955 + .name = "pva1wrb", 956 + .sid = TEGRA194_SID_PVA1, 957 + .regs = { 958 + .sid = { 959 + .override = 0x680, 960 + .security = 0x684, 961 + }, 962 + }, 963 + }, { 964 + .id = TEGRA194_MEMORY_CLIENT_PVA1WRC, 965 + .name = "pva1wrc", 966 + .sid = TEGRA194_SID_PVA1, 967 + .regs = { 968 + .sid = { 969 + .override = 0x688, 970 + .security = 0x68c, 971 + }, 972 + }, 973 + }, { 974 + .id = TEGRA194_MEMORY_CLIENT_RCER, 975 + .name = "rcer", 976 + .sid = TEGRA194_SID_RCE, 977 + .regs = { 978 + .sid = { 979 + .override = 0x690, 980 + .security = 0x694, 981 + }, 982 + }, 983 + }, { 984 + .id = TEGRA194_MEMORY_CLIENT_RCEW, 985 + .name = "rcew", 986 + .sid = TEGRA194_SID_RCE, 987 + .regs = { 988 + .sid = { 989 + .override = 0x698, 990 + .security = 0x69c, 991 + }, 992 + }, 993 + }, { 994 + .id = TEGRA194_MEMORY_CLIENT_RCEDMAR, 995 + .name = "rcedmar", 996 + .sid = TEGRA194_SID_RCE, 997 + .regs = { 998 + .sid = { 999 + .override = 0x6a0, 1000 + .security = 0x6a4, 1001 + }, 1002 + }, 1003 + }, { 1004 + .id = TEGRA194_MEMORY_CLIENT_RCEDMAW, 1005 + .name = "rcedmaw", 1006 + .sid = TEGRA194_SID_RCE, 1007 + .regs = { 1008 + .sid = { 1009 + .override = 0x6a8, 1010 + .security = 0x6ac, 1011 + }, 1012 + }, 1013 + }, { 1014 + .id = TEGRA194_MEMORY_CLIENT_NVENC1SRD, 1015 + .name = "nvenc1srd", 1016 + .sid = TEGRA194_SID_NVENC1, 1017 + .regs = { 1018 + .sid = { 1019 + .override = 0x6b0, 1020 + .security = 0x6b4, 1021 + }, 1022 + }, 1023 + }, { 1024 + .id = TEGRA194_MEMORY_CLIENT_NVENC1SWR, 1025 + .name = "nvenc1swr", 1026 + .sid = TEGRA194_SID_NVENC1, 1027 + .regs = { 1028 + .sid = { 1029 + .override = 0x6b8, 1030 + .security = 0x6bc, 1031 + }, 1032 + }, 1033 + }, { 1034 + .id = TEGRA194_MEMORY_CLIENT_PCIE0R, 1035 + .name = "pcie0r", 1036 + .sid = TEGRA194_SID_PCIE0, 1037 + .regs = { 1038 + .sid = { 1039 + .override = 0x6c0, 1040 + .security = 0x6c4, 1041 + }, 1042 + }, 1043 + }, { 1044 + .id = TEGRA194_MEMORY_CLIENT_PCIE0W, 1045 + .name = "pcie0w", 1046 + .sid = TEGRA194_SID_PCIE0, 1047 + .regs = { 1048 + .sid = { 1049 + .override = 0x6c8, 1050 + .security = 0x6cc, 1051 + }, 1052 + }, 1053 + }, { 1054 + .id = TEGRA194_MEMORY_CLIENT_PCIE1R, 1055 + .name = "pcie1r", 1056 + .sid = TEGRA194_SID_PCIE1, 1057 + .regs = { 1058 + .sid = { 1059 + .override = 0x6d0, 1060 + .security = 0x6d4, 1061 + }, 1062 + }, 1063 + }, { 1064 + .id = TEGRA194_MEMORY_CLIENT_PCIE1W, 1065 + .name = "pcie1w", 1066 + .sid = TEGRA194_SID_PCIE1, 1067 + .regs = { 1068 + .sid = { 1069 + .override = 0x6d8, 1070 + .security = 0x6dc, 1071 + }, 1072 + }, 1073 + }, { 1074 + .id = TEGRA194_MEMORY_CLIENT_PCIE2AR, 1075 + .name = "pcie2ar", 1076 + .sid = TEGRA194_SID_PCIE2, 1077 + .regs = { 1078 + .sid = { 1079 + .override = 0x6e0, 1080 + .security = 0x6e4, 1081 + }, 1082 + }, 1083 + }, { 1084 + .id = TEGRA194_MEMORY_CLIENT_PCIE2AW, 1085 + .name = "pcie2aw", 1086 + .sid = TEGRA194_SID_PCIE2, 1087 + .regs = { 1088 + .sid = { 1089 + .override = 0x6e8, 1090 + .security = 0x6ec, 1091 + }, 1092 + }, 1093 + }, { 1094 + .id = TEGRA194_MEMORY_CLIENT_PCIE3R, 1095 + .name = "pcie3r", 1096 + .sid = TEGRA194_SID_PCIE3, 1097 + .regs = { 1098 + .sid = { 1099 + .override = 0x6f0, 1100 + .security = 0x6f4, 1101 + }, 1102 + }, 1103 + }, { 1104 + .id = TEGRA194_MEMORY_CLIENT_PCIE3W, 1105 + .name = "pcie3w", 1106 + .sid = TEGRA194_SID_PCIE3, 1107 + .regs = { 1108 + .sid = { 1109 + .override = 0x6f8, 1110 + .security = 0x6fc, 1111 + }, 1112 + }, 1113 + }, { 1114 + .id = TEGRA194_MEMORY_CLIENT_PCIE4R, 1115 + .name = "pcie4r", 1116 + .sid = TEGRA194_SID_PCIE4, 1117 + .regs = { 1118 + .sid = { 1119 + .override = 0x700, 1120 + .security = 0x704, 1121 + }, 1122 + }, 1123 + }, { 1124 + .id = TEGRA194_MEMORY_CLIENT_PCIE4W, 1125 + .name = "pcie4w", 1126 + .sid = TEGRA194_SID_PCIE4, 1127 + .regs = { 1128 + .sid = { 1129 + .override = 0x708, 1130 + .security = 0x70c, 1131 + }, 1132 + }, 1133 + }, { 1134 + .id = TEGRA194_MEMORY_CLIENT_PCIE5R, 1135 + .name = "pcie5r", 1136 + .sid = TEGRA194_SID_PCIE5, 1137 + .regs = { 1138 + .sid = { 1139 + .override = 0x710, 1140 + .security = 0x714, 1141 + }, 1142 + }, 1143 + }, { 1144 + .id = TEGRA194_MEMORY_CLIENT_PCIE5W, 1145 + .name = "pcie5w", 1146 + .sid = TEGRA194_SID_PCIE5, 1147 + .regs = { 1148 + .sid = { 1149 + .override = 0x718, 1150 + .security = 0x71c, 1151 + }, 1152 + }, 1153 + }, { 1154 + .id = TEGRA194_MEMORY_CLIENT_ISPFALW, 1155 + .name = "ispfalw", 1156 + .sid = TEGRA194_SID_ISP_FALCON, 1157 + .regs = { 1158 + .sid = { 1159 + .override = 0x720, 1160 + .security = 0x724, 1161 + }, 1162 + }, 1163 + }, { 1164 + .id = TEGRA194_MEMORY_CLIENT_DLA0RDA1, 1165 + .name = "dla0rda1", 1166 + .sid = TEGRA194_SID_NVDLA0, 1167 + .regs = { 1168 + .sid = { 1169 + .override = 0x748, 1170 + .security = 0x74c, 1171 + }, 1172 + }, 1173 + }, { 1174 + .id = TEGRA194_MEMORY_CLIENT_DLA1RDA1, 1175 + .name = "dla1rda1", 1176 + .sid = TEGRA194_SID_NVDLA1, 1177 + .regs = { 1178 + .sid = { 1179 + .override = 0x750, 1180 + .security = 0x754, 1181 + }, 1182 + }, 1183 + }, { 1184 + .id = TEGRA194_MEMORY_CLIENT_PVA0RDA1, 1185 + .name = "pva0rda1", 1186 + .sid = TEGRA194_SID_PVA0, 1187 + .regs = { 1188 + .sid = { 1189 + .override = 0x758, 1190 + .security = 0x75c, 1191 + }, 1192 + }, 1193 + }, { 1194 + .id = TEGRA194_MEMORY_CLIENT_PVA0RDB1, 1195 + .name = "pva0rdb1", 1196 + .sid = TEGRA194_SID_PVA0, 1197 + .regs = { 1198 + .sid = { 1199 + .override = 0x760, 1200 + .security = 0x764, 1201 + }, 1202 + }, 1203 + }, { 1204 + .id = TEGRA194_MEMORY_CLIENT_PVA1RDA1, 1205 + .name = "pva1rda1", 1206 + .sid = TEGRA194_SID_PVA1, 1207 + .regs = { 1208 + .sid = { 1209 + .override = 0x768, 1210 + .security = 0x76c, 1211 + }, 1212 + }, 1213 + }, { 1214 + .id = TEGRA194_MEMORY_CLIENT_PVA1RDB1, 1215 + .name = "pva1rdb1", 1216 + .sid = TEGRA194_SID_PVA1, 1217 + .regs = { 1218 + .sid = { 1219 + .override = 0x770, 1220 + .security = 0x774, 1221 + }, 1222 + }, 1223 + }, { 1224 + .id = TEGRA194_MEMORY_CLIENT_PCIE5R1, 1225 + .name = "pcie5r1", 1226 + .sid = TEGRA194_SID_PCIE5, 1227 + .regs = { 1228 + .sid = { 1229 + .override = 0x778, 1230 + .security = 0x77c, 1231 + }, 1232 + }, 1233 + }, { 1234 + .id = TEGRA194_MEMORY_CLIENT_NVENCSRD1, 1235 + .name = "nvencsrd1", 1236 + .sid = TEGRA194_SID_NVENC, 1237 + .regs = { 1238 + .sid = { 1239 + .override = 0x780, 1240 + .security = 0x784, 1241 + }, 1242 + }, 1243 + }, { 1244 + .id = TEGRA194_MEMORY_CLIENT_NVENC1SRD1, 1245 + .name = "nvenc1srd1", 1246 + .sid = TEGRA194_SID_NVENC1, 1247 + .regs = { 1248 + .sid = { 1249 + .override = 0x788, 1250 + .security = 0x78c, 1251 + }, 1252 + }, 1253 + }, { 1254 + .id = TEGRA194_MEMORY_CLIENT_ISPRA1, 1255 + .name = "ispra1", 1256 + .sid = TEGRA194_SID_ISP, 1257 + .regs = { 1258 + .sid = { 1259 + .override = 0x790, 1260 + .security = 0x794, 1261 + }, 1262 + }, 1263 + }, { 1264 + .id = TEGRA194_MEMORY_CLIENT_PCIE0R1, 1265 + .name = "pcie0r1", 1266 + .sid = TEGRA194_SID_PCIE0, 1267 + .regs = { 1268 + .sid = { 1269 + .override = 0x798, 1270 + .security = 0x79c, 1271 + }, 1272 + }, 1273 + }, { 1274 + .id = TEGRA194_MEMORY_CLIENT_NVDEC1SRD, 1275 + .name = "nvdec1srd", 1276 + .sid = TEGRA194_SID_NVDEC1, 1277 + .regs = { 1278 + .sid = { 1279 + .override = 0x7c8, 1280 + .security = 0x7cc, 1281 + }, 1282 + }, 1283 + }, { 1284 + .id = TEGRA194_MEMORY_CLIENT_NVDEC1SRD1, 1285 + .name = "nvdec1srd1", 1286 + .sid = TEGRA194_SID_NVDEC1, 1287 + .regs = { 1288 + .sid = { 1289 + .override = 0x7d0, 1290 + .security = 0x7d4, 1291 + }, 1292 + }, 1293 + }, { 1294 + .id = TEGRA194_MEMORY_CLIENT_NVDEC1SWR, 1295 + .name = "nvdec1swr", 1296 + .sid = TEGRA194_SID_NVDEC1, 1297 + .regs = { 1298 + .sid = { 1299 + .override = 0x7d8, 1300 + .security = 0x7dc, 1301 + }, 1302 + }, 1303 + }, { 1304 + .id = TEGRA194_MEMORY_CLIENT_MIU5R, 1305 + .name = "miu5r", 1306 + .sid = TEGRA194_SID_MIU, 1307 + .regs = { 1308 + .sid = { 1309 + .override = 0x7e0, 1310 + .security = 0x7e4, 1311 + }, 1312 + }, 1313 + }, { 1314 + .id = TEGRA194_MEMORY_CLIENT_MIU5W, 1315 + .name = "miu5w", 1316 + .sid = TEGRA194_SID_MIU, 1317 + .regs = { 1318 + .sid = { 1319 + .override = 0x7e8, 1320 + .security = 0x7ec, 1321 + }, 1322 + }, 1323 + }, { 1324 + .id = TEGRA194_MEMORY_CLIENT_MIU6R, 1325 + .name = "miu6r", 1326 + .sid = TEGRA194_SID_MIU, 1327 + .regs = { 1328 + .sid = { 1329 + .override = 0x7f0, 1330 + .security = 0x7f4, 1331 + }, 1332 + }, 1333 + }, { 1334 + .id = TEGRA194_MEMORY_CLIENT_MIU6W, 1335 + .name = "miu6w", 1336 + .sid = TEGRA194_SID_MIU, 1337 + .regs = { 1338 + .sid = { 1339 + .override = 0x7f8, 1340 + .security = 0x7fc, 1341 + }, 1342 + }, 1343 + }, 1344 + }; 1345 + 1346 + const struct tegra_mc_soc tegra194_mc_soc = { 1347 + .num_clients = ARRAY_SIZE(tegra194_mc_clients), 1348 + .clients = tegra194_mc_clients, 1349 + .num_address_bits = 40, 1350 + .ops = &tegra186_mc_ops, 1351 + };
+4 -48
drivers/memory/tegra/tegra20-emc.c
··· 776 776 } 777 777 778 778 emc->debugfs.root = debugfs_create_dir("emc", NULL); 779 - if (!emc->debugfs.root) { 780 - dev_err(emc->dev, "failed to create debugfs directory\n"); 781 - return; 782 - } 783 779 784 780 debugfs_create_file("available_rates", 0444, emc->debugfs.root, 785 781 emc, &tegra_emc_debug_available_rates_fops); ··· 900 904 icc_provider_del(&emc->provider); 901 905 err_msg: 902 906 dev_err(emc->dev, "failed to initialize ICC: %d\n", err); 903 - 904 - return err; 905 - } 906 - 907 - static int tegra_emc_opp_table_init(struct tegra_emc *emc) 908 - { 909 - u32 hw_version = BIT(tegra_sku_info.soc_process_id); 910 - struct opp_table *hw_opp_table; 911 - int err; 912 - 913 - hw_opp_table = dev_pm_opp_set_supported_hw(emc->dev, &hw_version, 1); 914 - err = PTR_ERR_OR_ZERO(hw_opp_table); 915 - if (err) { 916 - dev_err(emc->dev, "failed to set OPP supported HW: %d\n", err); 917 - return err; 918 - } 919 - 920 - err = dev_pm_opp_of_add_table(emc->dev); 921 - if (err) { 922 - if (err == -ENODEV) 923 - dev_err(emc->dev, "OPP table not found, please update your device tree\n"); 924 - else 925 - dev_err(emc->dev, "failed to add OPP table: %d\n", err); 926 - 927 - goto put_hw_table; 928 - } 929 - 930 - dev_info_once(emc->dev, "OPP HW ver. 0x%x, current clock rate %lu MHz\n", 931 - hw_version, clk_get_rate(emc->clk) / 1000000); 932 - 933 - /* first dummy rate-set initializes voltage state */ 934 - err = dev_pm_opp_set_rate(emc->dev, clk_get_rate(emc->clk)); 935 - if (err) { 936 - dev_err(emc->dev, "failed to initialize OPP clock: %d\n", err); 937 - goto remove_table; 938 - } 939 - 940 - return 0; 941 - 942 - remove_table: 943 - dev_pm_opp_of_remove_table(emc->dev); 944 - put_hw_table: 945 - dev_pm_opp_put_supported_hw(hw_opp_table); 946 907 947 908 return err; 948 909 } ··· 1030 1077 1031 1078 static int tegra_emc_probe(struct platform_device *pdev) 1032 1079 { 1080 + struct tegra_core_opp_params opp_params = {}; 1033 1081 struct device_node *np; 1034 1082 struct tegra_emc *emc; 1035 1083 int irq, err; ··· 1076 1122 if (err) 1077 1123 return err; 1078 1124 1079 - err = tegra_emc_opp_table_init(emc); 1125 + opp_params.init_state = true; 1126 + 1127 + err = devm_tegra_core_dev_init_opp_table(&pdev->dev, &opp_params); 1080 1128 if (err) 1081 1129 return err; 1082 1130
+108 -2
drivers/memory/tegra/tegra20.c
··· 679 679 return 0; 680 680 } 681 681 682 - static int tegra20_mc_init(struct tegra_mc *mc) 682 + static int tegra20_mc_probe(struct tegra_mc *mc) 683 683 { 684 684 debugfs_create_devm_seqfile(mc->dev, "stats", mc->debugfs.root, 685 685 tegra20_mc_stats_show); 686 686 687 687 return 0; 688 688 } 689 + 690 + static int tegra20_mc_suspend(struct tegra_mc *mc) 691 + { 692 + int err; 693 + 694 + if (IS_ENABLED(CONFIG_TEGRA_IOMMU_GART) && mc->gart) { 695 + err = tegra_gart_suspend(mc->gart); 696 + if (err < 0) 697 + return err; 698 + } 699 + 700 + return 0; 701 + } 702 + 703 + static int tegra20_mc_resume(struct tegra_mc *mc) 704 + { 705 + int err; 706 + 707 + if (IS_ENABLED(CONFIG_TEGRA_IOMMU_GART) && mc->gart) { 708 + err = tegra_gart_resume(mc->gart); 709 + if (err < 0) 710 + return err; 711 + } 712 + 713 + return 0; 714 + } 715 + 716 + static irqreturn_t tegra20_mc_handle_irq(int irq, void *data) 717 + { 718 + struct tegra_mc *mc = data; 719 + unsigned long status; 720 + unsigned int bit; 721 + 722 + /* mask all interrupts to avoid flooding */ 723 + status = mc_readl(mc, MC_INTSTATUS) & mc->soc->intmask; 724 + if (!status) 725 + return IRQ_NONE; 726 + 727 + for_each_set_bit(bit, &status, 32) { 728 + const char *error = tegra_mc_status_names[bit]; 729 + const char *direction = "read", *secure = ""; 730 + const char *client, *desc; 731 + phys_addr_t addr; 732 + u32 value, reg; 733 + u8 id, type; 734 + 735 + switch (BIT(bit)) { 736 + case MC_INT_DECERR_EMEM: 737 + reg = MC_DECERR_EMEM_OTHERS_STATUS; 738 + value = mc_readl(mc, reg); 739 + 740 + id = value & mc->soc->client_id_mask; 741 + desc = tegra_mc_error_names[2]; 742 + 743 + if (value & BIT(31)) 744 + direction = "write"; 745 + break; 746 + 747 + case MC_INT_INVALID_GART_PAGE: 748 + reg = MC_GART_ERROR_REQ; 749 + value = mc_readl(mc, reg); 750 + 751 + id = (value >> 1) & mc->soc->client_id_mask; 752 + desc = tegra_mc_error_names[2]; 753 + 754 + if (value & BIT(0)) 755 + direction = "write"; 756 + break; 757 + 758 + case MC_INT_SECURITY_VIOLATION: 759 + reg = MC_SECURITY_VIOLATION_STATUS; 760 + value = mc_readl(mc, reg); 761 + 762 + id = value & mc->soc->client_id_mask; 763 + type = (value & BIT(30)) ? 4 : 3; 764 + desc = tegra_mc_error_names[type]; 765 + secure = "secure "; 766 + 767 + if (value & BIT(31)) 768 + direction = "write"; 769 + break; 770 + 771 + default: 772 + continue; 773 + } 774 + 775 + client = mc->soc->clients[id].name; 776 + addr = mc_readl(mc, reg + sizeof(u32)); 777 + 778 + dev_err_ratelimited(mc->dev, "%s: %s%s @%pa: %s (%s)\n", 779 + client, secure, direction, &addr, error, 780 + desc); 781 + } 782 + 783 + /* clear interrupts */ 784 + mc_writel(mc, status, MC_INTSTATUS); 785 + 786 + return IRQ_HANDLED; 787 + } 788 + 789 + static const struct tegra_mc_ops tegra20_mc_ops = { 790 + .probe = tegra20_mc_probe, 791 + .suspend = tegra20_mc_suspend, 792 + .resume = tegra20_mc_resume, 793 + .handle_irq = tegra20_mc_handle_irq, 794 + }; 689 795 690 796 const struct tegra_mc_soc tegra20_mc_soc = { 691 797 .clients = tegra20_mc_clients, ··· 804 698 .resets = tegra20_mc_resets, 805 699 .num_resets = ARRAY_SIZE(tegra20_mc_resets), 806 700 .icc_ops = &tegra20_mc_icc_ops, 807 - .init = tegra20_mc_init, 701 + .ops = &tegra20_mc_ops, 808 702 };
-4
drivers/memory/tegra/tegra210-emc-core.c
··· 1759 1759 } 1760 1760 1761 1761 emc->debugfs.root = debugfs_create_dir("emc", NULL); 1762 - if (!emc->debugfs.root) { 1763 - dev_err(dev, "failed to create debugfs directory\n"); 1764 - return; 1765 - } 1766 1762 1767 1763 debugfs_create_file("available_rates", 0444, emc->debugfs.root, emc, 1768 1764 &tegra210_emc_debug_available_rates_fops);
+789 -644
drivers/memory/tegra/tegra210.c
··· 16 16 .id = 0x01, 17 17 .name = "display0a", 18 18 .swgroup = TEGRA_SWGROUP_DC, 19 - .smmu = { 20 - .reg = 0x228, 21 - .bit = 1, 22 - }, 23 - .la = { 24 - .reg = 0x2e8, 25 - .shift = 0, 26 - .mask = 0xff, 27 - .def = 0x1e, 19 + .regs = { 20 + .smmu = { 21 + .reg = 0x228, 22 + .bit = 1, 23 + }, 24 + .la = { 25 + .reg = 0x2e8, 26 + .shift = 0, 27 + .mask = 0xff, 28 + .def = 0x1e, 29 + }, 28 30 }, 29 31 }, { 30 32 .id = 0x02, 31 33 .name = "display0ab", 32 34 .swgroup = TEGRA_SWGROUP_DCB, 33 - .smmu = { 34 - .reg = 0x228, 35 - .bit = 2, 36 - }, 37 - .la = { 38 - .reg = 0x2f4, 39 - .shift = 0, 40 - .mask = 0xff, 41 - .def = 0x1e, 35 + .regs = { 36 + .smmu = { 37 + .reg = 0x228, 38 + .bit = 2, 39 + }, 40 + .la = { 41 + .reg = 0x2f4, 42 + .shift = 0, 43 + .mask = 0xff, 44 + .def = 0x1e, 45 + }, 42 46 }, 43 47 }, { 44 48 .id = 0x03, 45 49 .name = "display0b", 46 50 .swgroup = TEGRA_SWGROUP_DC, 47 - .smmu = { 48 - .reg = 0x228, 49 - .bit = 3, 50 - }, 51 - .la = { 52 - .reg = 0x2e8, 53 - .shift = 16, 54 - .mask = 0xff, 55 - .def = 0x1e, 51 + .regs = { 52 + .smmu = { 53 + .reg = 0x228, 54 + .bit = 3, 55 + }, 56 + .la = { 57 + .reg = 0x2e8, 58 + .shift = 16, 59 + .mask = 0xff, 60 + .def = 0x1e, 61 + }, 56 62 }, 57 63 }, { 58 64 .id = 0x04, 59 65 .name = "display0bb", 60 66 .swgroup = TEGRA_SWGROUP_DCB, 61 - .smmu = { 62 - .reg = 0x228, 63 - .bit = 4, 64 - }, 65 - .la = { 66 - .reg = 0x2f4, 67 - .shift = 16, 68 - .mask = 0xff, 69 - .def = 0x1e, 67 + .regs = { 68 + .smmu = { 69 + .reg = 0x228, 70 + .bit = 4, 71 + }, 72 + .la = { 73 + .reg = 0x2f4, 74 + .shift = 16, 75 + .mask = 0xff, 76 + .def = 0x1e, 77 + }, 70 78 }, 71 79 }, { 72 80 .id = 0x05, 73 81 .name = "display0c", 74 82 .swgroup = TEGRA_SWGROUP_DC, 75 - .smmu = { 76 - .reg = 0x228, 77 - .bit = 5, 78 - }, 79 - .la = { 80 - .reg = 0x2ec, 81 - .shift = 0, 82 - .mask = 0xff, 83 - .def = 0x1e, 83 + .regs = { 84 + .smmu = { 85 + .reg = 0x228, 86 + .bit = 5, 87 + }, 88 + .la = { 89 + .reg = 0x2ec, 90 + .shift = 0, 91 + .mask = 0xff, 92 + .def = 0x1e, 93 + }, 84 94 }, 85 95 }, { 86 96 .id = 0x06, 87 97 .name = "display0cb", 88 98 .swgroup = TEGRA_SWGROUP_DCB, 89 - .smmu = { 90 - .reg = 0x228, 91 - .bit = 6, 92 - }, 93 - .la = { 94 - .reg = 0x2f8, 95 - .shift = 0, 96 - .mask = 0xff, 97 - .def = 0x1e, 99 + .regs = { 100 + .smmu = { 101 + .reg = 0x228, 102 + .bit = 6, 103 + }, 104 + .la = { 105 + .reg = 0x2f8, 106 + .shift = 0, 107 + .mask = 0xff, 108 + .def = 0x1e, 109 + }, 98 110 }, 99 111 }, { 100 112 .id = 0x0e, 101 113 .name = "afir", 102 114 .swgroup = TEGRA_SWGROUP_AFI, 103 - .smmu = { 104 - .reg = 0x228, 105 - .bit = 14, 106 - }, 107 - .la = { 108 - .reg = 0x2e0, 109 - .shift = 0, 110 - .mask = 0xff, 111 - .def = 0x2e, 115 + .regs = { 116 + .smmu = { 117 + .reg = 0x228, 118 + .bit = 14, 119 + }, 120 + .la = { 121 + .reg = 0x2e0, 122 + .shift = 0, 123 + .mask = 0xff, 124 + .def = 0x2e, 125 + }, 112 126 }, 113 127 }, { 114 128 .id = 0x0f, 115 129 .name = "avpcarm7r", 116 130 .swgroup = TEGRA_SWGROUP_AVPC, 117 - .smmu = { 118 - .reg = 0x228, 119 - .bit = 15, 120 - }, 121 - .la = { 122 - .reg = 0x2e4, 123 - .shift = 0, 124 - .mask = 0xff, 125 - .def = 0x04, 131 + .regs = { 132 + .smmu = { 133 + .reg = 0x228, 134 + .bit = 15, 135 + }, 136 + .la = { 137 + .reg = 0x2e4, 138 + .shift = 0, 139 + .mask = 0xff, 140 + .def = 0x04, 141 + }, 126 142 }, 127 143 }, { 128 144 .id = 0x10, 129 145 .name = "displayhc", 130 146 .swgroup = TEGRA_SWGROUP_DC, 131 - .smmu = { 132 - .reg = 0x228, 133 - .bit = 16, 134 - }, 135 - .la = { 136 - .reg = 0x2f0, 137 - .shift = 0, 138 - .mask = 0xff, 139 - .def = 0x1e, 147 + .regs = { 148 + .smmu = { 149 + .reg = 0x228, 150 + .bit = 16, 151 + }, 152 + .la = { 153 + .reg = 0x2f0, 154 + .shift = 0, 155 + .mask = 0xff, 156 + .def = 0x1e, 157 + }, 140 158 }, 141 159 }, { 142 160 .id = 0x11, 143 161 .name = "displayhcb", 144 162 .swgroup = TEGRA_SWGROUP_DCB, 145 - .smmu = { 146 - .reg = 0x228, 147 - .bit = 17, 148 - }, 149 - .la = { 150 - .reg = 0x2fc, 151 - .shift = 0, 152 - .mask = 0xff, 153 - .def = 0x1e, 163 + .regs = { 164 + .smmu = { 165 + .reg = 0x228, 166 + .bit = 17, 167 + }, 168 + .la = { 169 + .reg = 0x2fc, 170 + .shift = 0, 171 + .mask = 0xff, 172 + .def = 0x1e, 173 + }, 154 174 }, 155 175 }, { 156 176 .id = 0x15, 157 177 .name = "hdar", 158 178 .swgroup = TEGRA_SWGROUP_HDA, 159 - .smmu = { 160 - .reg = 0x228, 161 - .bit = 21, 162 - }, 163 - .la = { 164 - .reg = 0x318, 165 - .shift = 0, 166 - .mask = 0xff, 167 - .def = 0x24, 179 + .regs = { 180 + .smmu = { 181 + .reg = 0x228, 182 + .bit = 21, 183 + }, 184 + .la = { 185 + .reg = 0x318, 186 + .shift = 0, 187 + .mask = 0xff, 188 + .def = 0x24, 189 + }, 168 190 }, 169 191 }, { 170 192 .id = 0x16, 171 193 .name = "host1xdmar", 172 194 .swgroup = TEGRA_SWGROUP_HC, 173 - .smmu = { 174 - .reg = 0x228, 175 - .bit = 22, 176 - }, 177 - .la = { 178 - .reg = 0x310, 179 - .shift = 0, 180 - .mask = 0xff, 181 - .def = 0x1e, 195 + .regs = { 196 + .smmu = { 197 + .reg = 0x228, 198 + .bit = 22, 199 + }, 200 + .la = { 201 + .reg = 0x310, 202 + .shift = 0, 203 + .mask = 0xff, 204 + .def = 0x1e, 205 + }, 182 206 }, 183 207 }, { 184 208 .id = 0x17, 185 209 .name = "host1xr", 186 210 .swgroup = TEGRA_SWGROUP_HC, 187 - .smmu = { 188 - .reg = 0x228, 189 - .bit = 23, 190 - }, 191 - .la = { 192 - .reg = 0x310, 193 - .shift = 16, 194 - .mask = 0xff, 195 - .def = 0x50, 211 + .regs = { 212 + .smmu = { 213 + .reg = 0x228, 214 + .bit = 23, 215 + }, 216 + .la = { 217 + .reg = 0x310, 218 + .shift = 16, 219 + .mask = 0xff, 220 + .def = 0x50, 221 + }, 196 222 }, 197 223 }, { 198 224 .id = 0x1c, 199 225 .name = "nvencsrd", 200 226 .swgroup = TEGRA_SWGROUP_NVENC, 201 - .smmu = { 202 - .reg = 0x228, 203 - .bit = 28, 204 - }, 205 - .la = { 206 - .reg = 0x328, 207 - .shift = 0, 208 - .mask = 0xff, 209 - .def = 0x23, 227 + .regs = { 228 + .smmu = { 229 + .reg = 0x228, 230 + .bit = 28, 231 + }, 232 + .la = { 233 + .reg = 0x328, 234 + .shift = 0, 235 + .mask = 0xff, 236 + .def = 0x23, 237 + }, 210 238 }, 211 239 }, { 212 240 .id = 0x1d, 213 241 .name = "ppcsahbdmar", 214 242 .swgroup = TEGRA_SWGROUP_PPCS, 215 - .smmu = { 216 - .reg = 0x228, 217 - .bit = 29, 218 - }, 219 - .la = { 220 - .reg = 0x344, 221 - .shift = 0, 222 - .mask = 0xff, 223 - .def = 0x49, 243 + .regs = { 244 + .smmu = { 245 + .reg = 0x228, 246 + .bit = 29, 247 + }, 248 + .la = { 249 + .reg = 0x344, 250 + .shift = 0, 251 + .mask = 0xff, 252 + .def = 0x49, 253 + }, 224 254 }, 225 255 }, { 226 256 .id = 0x1e, 227 257 .name = "ppcsahbslvr", 228 258 .swgroup = TEGRA_SWGROUP_PPCS, 229 - .smmu = { 230 - .reg = 0x228, 231 - .bit = 30, 232 - }, 233 - .la = { 234 - .reg = 0x344, 235 - .shift = 16, 236 - .mask = 0xff, 237 - .def = 0x1a, 259 + .regs = { 260 + .smmu = { 261 + .reg = 0x228, 262 + .bit = 30, 263 + }, 264 + .la = { 265 + .reg = 0x344, 266 + .shift = 16, 267 + .mask = 0xff, 268 + .def = 0x1a, 269 + }, 238 270 }, 239 271 }, { 240 272 .id = 0x1f, 241 273 .name = "satar", 242 274 .swgroup = TEGRA_SWGROUP_SATA, 243 - .smmu = { 244 - .reg = 0x228, 245 - .bit = 31, 246 - }, 247 - .la = { 248 - .reg = 0x350, 249 - .shift = 0, 250 - .mask = 0xff, 251 - .def = 0x65, 275 + .regs = { 276 + .smmu = { 277 + .reg = 0x228, 278 + .bit = 31, 279 + }, 280 + .la = { 281 + .reg = 0x350, 282 + .shift = 0, 283 + .mask = 0xff, 284 + .def = 0x65, 285 + }, 252 286 }, 253 287 }, { 254 288 .id = 0x27, 255 289 .name = "mpcorer", 256 290 .swgroup = TEGRA_SWGROUP_MPCORE, 257 - .la = { 258 - .reg = 0x320, 259 - .shift = 0, 260 - .mask = 0xff, 261 - .def = 0x04, 291 + .regs = { 292 + .la = { 293 + .reg = 0x320, 294 + .shift = 0, 295 + .mask = 0xff, 296 + .def = 0x04, 297 + }, 262 298 }, 263 299 }, { 264 300 .id = 0x2b, 265 301 .name = "nvencswr", 266 302 .swgroup = TEGRA_SWGROUP_NVENC, 267 - .smmu = { 268 - .reg = 0x22c, 269 - .bit = 11, 270 - }, 271 - .la = { 272 - .reg = 0x328, 273 - .shift = 16, 274 - .mask = 0xff, 275 - .def = 0x80, 303 + .regs = { 304 + .smmu = { 305 + .reg = 0x22c, 306 + .bit = 11, 307 + }, 308 + .la = { 309 + .reg = 0x328, 310 + .shift = 16, 311 + .mask = 0xff, 312 + .def = 0x80, 313 + }, 276 314 }, 277 315 }, { 278 316 .id = 0x31, 279 317 .name = "afiw", 280 318 .swgroup = TEGRA_SWGROUP_AFI, 281 - .smmu = { 282 - .reg = 0x22c, 283 - .bit = 17, 284 - }, 285 - .la = { 286 - .reg = 0x2e0, 287 - .shift = 16, 288 - .mask = 0xff, 289 - .def = 0x80, 319 + .regs = { 320 + .smmu = { 321 + .reg = 0x22c, 322 + .bit = 17, 323 + }, 324 + .la = { 325 + .reg = 0x2e0, 326 + .shift = 16, 327 + .mask = 0xff, 328 + .def = 0x80, 329 + }, 290 330 }, 291 331 }, { 292 332 .id = 0x32, 293 333 .name = "avpcarm7w", 294 334 .swgroup = TEGRA_SWGROUP_AVPC, 295 - .smmu = { 296 - .reg = 0x22c, 297 - .bit = 18, 298 - }, 299 - .la = { 300 - .reg = 0x2e4, 301 - .shift = 16, 302 - .mask = 0xff, 303 - .def = 0x80, 335 + .regs = { 336 + .smmu = { 337 + .reg = 0x22c, 338 + .bit = 18, 339 + }, 340 + .la = { 341 + .reg = 0x2e4, 342 + .shift = 16, 343 + .mask = 0xff, 344 + .def = 0x80, 345 + }, 304 346 }, 305 347 }, { 306 348 .id = 0x35, 307 349 .name = "hdaw", 308 350 .swgroup = TEGRA_SWGROUP_HDA, 309 - .smmu = { 310 - .reg = 0x22c, 311 - .bit = 21, 312 - }, 313 - .la = { 314 - .reg = 0x318, 315 - .shift = 16, 316 - .mask = 0xff, 317 - .def = 0x80, 351 + .regs = { 352 + .smmu = { 353 + .reg = 0x22c, 354 + .bit = 21, 355 + }, 356 + .la = { 357 + .reg = 0x318, 358 + .shift = 16, 359 + .mask = 0xff, 360 + .def = 0x80, 361 + }, 318 362 }, 319 363 }, { 320 364 .id = 0x36, 321 365 .name = "host1xw", 322 366 .swgroup = TEGRA_SWGROUP_HC, 323 - .smmu = { 324 - .reg = 0x22c, 325 - .bit = 22, 326 - }, 327 - .la = { 328 - .reg = 0x314, 329 - .shift = 0, 330 - .mask = 0xff, 331 - .def = 0x80, 367 + .regs = { 368 + .smmu = { 369 + .reg = 0x22c, 370 + .bit = 22, 371 + }, 372 + .la = { 373 + .reg = 0x314, 374 + .shift = 0, 375 + .mask = 0xff, 376 + .def = 0x80, 377 + }, 332 378 }, 333 379 }, { 334 380 .id = 0x39, 335 381 .name = "mpcorew", 336 382 .swgroup = TEGRA_SWGROUP_MPCORE, 337 - .la = { 338 - .reg = 0x320, 339 - .shift = 16, 340 - .mask = 0xff, 341 - .def = 0x80, 383 + .regs = { 384 + .la = { 385 + .reg = 0x320, 386 + .shift = 16, 387 + .mask = 0xff, 388 + .def = 0x80, 389 + }, 342 390 }, 343 391 }, { 344 392 .id = 0x3b, 345 393 .name = "ppcsahbdmaw", 346 394 .swgroup = TEGRA_SWGROUP_PPCS, 347 - .smmu = { 348 - .reg = 0x22c, 349 - .bit = 27, 350 - }, 351 - .la = { 352 - .reg = 0x348, 353 - .shift = 0, 354 - .mask = 0xff, 355 - .def = 0x80, 395 + .regs = { 396 + .smmu = { 397 + .reg = 0x22c, 398 + .bit = 27, 399 + }, 400 + .la = { 401 + .reg = 0x348, 402 + .shift = 0, 403 + .mask = 0xff, 404 + .def = 0x80, 405 + }, 356 406 }, 357 407 }, { 358 408 .id = 0x3c, 359 409 .name = "ppcsahbslvw", 360 410 .swgroup = TEGRA_SWGROUP_PPCS, 361 - .smmu = { 362 - .reg = 0x22c, 363 - .bit = 28, 364 - }, 365 - .la = { 366 - .reg = 0x348, 367 - .shift = 16, 368 - .mask = 0xff, 369 - .def = 0x80, 411 + .regs = { 412 + .smmu = { 413 + .reg = 0x22c, 414 + .bit = 28, 415 + }, 416 + .la = { 417 + .reg = 0x348, 418 + .shift = 16, 419 + .mask = 0xff, 420 + .def = 0x80, 421 + }, 370 422 }, 371 423 }, { 372 424 .id = 0x3d, 373 425 .name = "sataw", 374 426 .swgroup = TEGRA_SWGROUP_SATA, 375 - .smmu = { 376 - .reg = 0x22c, 377 - .bit = 29, 378 - }, 379 - .la = { 380 - .reg = 0x350, 381 - .shift = 16, 382 - .mask = 0xff, 383 - .def = 0x80, 427 + .regs = { 428 + .smmu = { 429 + .reg = 0x22c, 430 + .bit = 29, 431 + }, 432 + .la = { 433 + .reg = 0x350, 434 + .shift = 16, 435 + .mask = 0xff, 436 + .def = 0x80, 437 + }, 384 438 }, 385 439 }, { 386 440 .id = 0x44, 387 441 .name = "ispra", 388 442 .swgroup = TEGRA_SWGROUP_ISP2, 389 - .smmu = { 390 - .reg = 0x230, 391 - .bit = 4, 392 - }, 393 - .la = { 394 - .reg = 0x370, 395 - .shift = 0, 396 - .mask = 0xff, 397 - .def = 0x18, 443 + .regs = { 444 + .smmu = { 445 + .reg = 0x230, 446 + .bit = 4, 447 + }, 448 + .la = { 449 + .reg = 0x370, 450 + .shift = 0, 451 + .mask = 0xff, 452 + .def = 0x18, 453 + }, 398 454 }, 399 455 }, { 400 456 .id = 0x46, 401 457 .name = "ispwa", 402 458 .swgroup = TEGRA_SWGROUP_ISP2, 403 - .smmu = { 404 - .reg = 0x230, 405 - .bit = 6, 406 - }, 407 - .la = { 408 - .reg = 0x374, 409 - .shift = 0, 410 - .mask = 0xff, 411 - .def = 0x80, 459 + .regs = { 460 + .smmu = { 461 + .reg = 0x230, 462 + .bit = 6, 463 + }, 464 + .la = { 465 + .reg = 0x374, 466 + .shift = 0, 467 + .mask = 0xff, 468 + .def = 0x80, 469 + }, 412 470 }, 413 471 }, { 414 472 .id = 0x47, 415 473 .name = "ispwb", 416 474 .swgroup = TEGRA_SWGROUP_ISP2, 417 - .smmu = { 418 - .reg = 0x230, 419 - .bit = 7, 420 - }, 421 - .la = { 422 - .reg = 0x374, 423 - .shift = 16, 424 - .mask = 0xff, 425 - .def = 0x80, 475 + .regs = { 476 + .smmu = { 477 + .reg = 0x230, 478 + .bit = 7, 479 + }, 480 + .la = { 481 + .reg = 0x374, 482 + .shift = 16, 483 + .mask = 0xff, 484 + .def = 0x80, 485 + }, 426 486 }, 427 487 }, { 428 488 .id = 0x4a, 429 489 .name = "xusb_hostr", 430 490 .swgroup = TEGRA_SWGROUP_XUSB_HOST, 431 - .smmu = { 432 - .reg = 0x230, 433 - .bit = 10, 434 - }, 435 - .la = { 436 - .reg = 0x37c, 437 - .shift = 0, 438 - .mask = 0xff, 439 - .def = 0x7a, 491 + .regs = { 492 + .smmu = { 493 + .reg = 0x230, 494 + .bit = 10, 495 + }, 496 + .la = { 497 + .reg = 0x37c, 498 + .shift = 0, 499 + .mask = 0xff, 500 + .def = 0x7a, 501 + }, 440 502 }, 441 503 }, { 442 504 .id = 0x4b, 443 505 .name = "xusb_hostw", 444 506 .swgroup = TEGRA_SWGROUP_XUSB_HOST, 445 - .smmu = { 446 - .reg = 0x230, 447 - .bit = 11, 448 - }, 449 - .la = { 450 - .reg = 0x37c, 451 - .shift = 16, 452 - .mask = 0xff, 453 - .def = 0x80, 507 + .regs = { 508 + .smmu = { 509 + .reg = 0x230, 510 + .bit = 11, 511 + }, 512 + .la = { 513 + .reg = 0x37c, 514 + .shift = 16, 515 + .mask = 0xff, 516 + .def = 0x80, 517 + }, 454 518 }, 455 519 }, { 456 520 .id = 0x4c, 457 521 .name = "xusb_devr", 458 522 .swgroup = TEGRA_SWGROUP_XUSB_DEV, 459 - .smmu = { 460 - .reg = 0x230, 461 - .bit = 12, 462 - }, 463 - .la = { 464 - .reg = 0x380, 465 - .shift = 0, 466 - .mask = 0xff, 467 - .def = 0x39, 523 + .regs = { 524 + .smmu = { 525 + .reg = 0x230, 526 + .bit = 12, 527 + }, 528 + .la = { 529 + .reg = 0x380, 530 + .shift = 0, 531 + .mask = 0xff, 532 + .def = 0x39, 533 + }, 468 534 }, 469 535 }, { 470 536 .id = 0x4d, 471 537 .name = "xusb_devw", 472 538 .swgroup = TEGRA_SWGROUP_XUSB_DEV, 473 - .smmu = { 474 - .reg = 0x230, 475 - .bit = 13, 476 - }, 477 - .la = { 478 - .reg = 0x380, 479 - .shift = 16, 480 - .mask = 0xff, 481 - .def = 0x80, 539 + .regs = { 540 + .smmu = { 541 + .reg = 0x230, 542 + .bit = 13, 543 + }, 544 + .la = { 545 + .reg = 0x380, 546 + .shift = 16, 547 + .mask = 0xff, 548 + .def = 0x80, 549 + }, 482 550 }, 483 551 }, { 484 552 .id = 0x4e, 485 553 .name = "isprab", 486 554 .swgroup = TEGRA_SWGROUP_ISP2B, 487 - .smmu = { 488 - .reg = 0x230, 489 - .bit = 14, 490 - }, 491 - .la = { 492 - .reg = 0x384, 493 - .shift = 0, 494 - .mask = 0xff, 495 - .def = 0x18, 555 + .regs = { 556 + .smmu = { 557 + .reg = 0x230, 558 + .bit = 14, 559 + }, 560 + .la = { 561 + .reg = 0x384, 562 + .shift = 0, 563 + .mask = 0xff, 564 + .def = 0x18, 565 + }, 496 566 }, 497 567 }, { 498 568 .id = 0x50, 499 569 .name = "ispwab", 500 570 .swgroup = TEGRA_SWGROUP_ISP2B, 501 - .smmu = { 502 - .reg = 0x230, 503 - .bit = 16, 504 - }, 505 - .la = { 506 - .reg = 0x388, 507 - .shift = 0, 508 - .mask = 0xff, 509 - .def = 0x80, 571 + .regs = { 572 + .smmu = { 573 + .reg = 0x230, 574 + .bit = 16, 575 + }, 576 + .la = { 577 + .reg = 0x388, 578 + .shift = 0, 579 + .mask = 0xff, 580 + .def = 0x80, 581 + }, 510 582 }, 511 583 }, { 512 584 .id = 0x51, 513 585 .name = "ispwbb", 514 586 .swgroup = TEGRA_SWGROUP_ISP2B, 515 - .smmu = { 516 - .reg = 0x230, 517 - .bit = 17, 518 - }, 519 - .la = { 520 - .reg = 0x388, 521 - .shift = 16, 522 - .mask = 0xff, 523 - .def = 0x80, 587 + .regs = { 588 + .smmu = { 589 + .reg = 0x230, 590 + .bit = 17, 591 + }, 592 + .la = { 593 + .reg = 0x388, 594 + .shift = 16, 595 + .mask = 0xff, 596 + .def = 0x80, 597 + }, 524 598 }, 525 599 }, { 526 600 .id = 0x54, 527 601 .name = "tsecsrd", 528 602 .swgroup = TEGRA_SWGROUP_TSEC, 529 - .smmu = { 530 - .reg = 0x230, 531 - .bit = 20, 532 - }, 533 - .la = { 534 - .reg = 0x390, 535 - .shift = 0, 536 - .mask = 0xff, 537 - .def = 0x9b, 603 + .regs = { 604 + .smmu = { 605 + .reg = 0x230, 606 + .bit = 20, 607 + }, 608 + .la = { 609 + .reg = 0x390, 610 + .shift = 0, 611 + .mask = 0xff, 612 + .def = 0x9b, 613 + }, 538 614 }, 539 615 }, { 540 616 .id = 0x55, 541 617 .name = "tsecswr", 542 618 .swgroup = TEGRA_SWGROUP_TSEC, 543 - .smmu = { 544 - .reg = 0x230, 545 - .bit = 21, 546 - }, 547 - .la = { 548 - .reg = 0x390, 549 - .shift = 16, 550 - .mask = 0xff, 551 - .def = 0x80, 619 + .regs = { 620 + .smmu = { 621 + .reg = 0x230, 622 + .bit = 21, 623 + }, 624 + .la = { 625 + .reg = 0x390, 626 + .shift = 16, 627 + .mask = 0xff, 628 + .def = 0x80, 629 + }, 552 630 }, 553 631 }, { 554 632 .id = 0x56, 555 633 .name = "a9avpscr", 556 634 .swgroup = TEGRA_SWGROUP_A9AVP, 557 - .smmu = { 558 - .reg = 0x230, 559 - .bit = 22, 560 - }, 561 - .la = { 562 - .reg = 0x3a4, 563 - .shift = 0, 564 - .mask = 0xff, 565 - .def = 0x04, 635 + .regs = { 636 + .smmu = { 637 + .reg = 0x230, 638 + .bit = 22, 639 + }, 640 + .la = { 641 + .reg = 0x3a4, 642 + .shift = 0, 643 + .mask = 0xff, 644 + .def = 0x04, 645 + }, 566 646 }, 567 647 }, { 568 648 .id = 0x57, 569 649 .name = "a9avpscw", 570 650 .swgroup = TEGRA_SWGROUP_A9AVP, 571 - .smmu = { 572 - .reg = 0x230, 573 - .bit = 23, 574 - }, 575 - .la = { 576 - .reg = 0x3a4, 577 - .shift = 16, 578 - .mask = 0xff, 579 - .def = 0x80, 651 + .regs = { 652 + .smmu = { 653 + .reg = 0x230, 654 + .bit = 23, 655 + }, 656 + .la = { 657 + .reg = 0x3a4, 658 + .shift = 16, 659 + .mask = 0xff, 660 + .def = 0x80, 661 + }, 580 662 }, 581 663 }, { 582 664 .id = 0x58, 583 665 .name = "gpusrd", 584 666 .swgroup = TEGRA_SWGROUP_GPU, 585 - .smmu = { 586 - /* read-only */ 587 - .reg = 0x230, 588 - .bit = 24, 589 - }, 590 - .la = { 591 - .reg = 0x3c8, 592 - .shift = 0, 593 - .mask = 0xff, 594 - .def = 0x1a, 667 + .regs = { 668 + .smmu = { 669 + /* read-only */ 670 + .reg = 0x230, 671 + .bit = 24, 672 + }, 673 + .la = { 674 + .reg = 0x3c8, 675 + .shift = 0, 676 + .mask = 0xff, 677 + .def = 0x1a, 678 + }, 595 679 }, 596 680 }, { 597 681 .id = 0x59, 598 682 .name = "gpuswr", 599 683 .swgroup = TEGRA_SWGROUP_GPU, 600 - .smmu = { 601 - /* read-only */ 602 - .reg = 0x230, 603 - .bit = 25, 604 - }, 605 - .la = { 606 - .reg = 0x3c8, 607 - .shift = 16, 608 - .mask = 0xff, 609 - .def = 0x80, 684 + .regs = { 685 + .smmu = { 686 + /* read-only */ 687 + .reg = 0x230, 688 + .bit = 25, 689 + }, 690 + .la = { 691 + .reg = 0x3c8, 692 + .shift = 16, 693 + .mask = 0xff, 694 + .def = 0x80, 695 + }, 610 696 }, 611 697 }, { 612 698 .id = 0x5a, 613 699 .name = "displayt", 614 700 .swgroup = TEGRA_SWGROUP_DC, 615 - .smmu = { 616 - .reg = 0x230, 617 - .bit = 26, 618 - }, 619 - .la = { 620 - .reg = 0x2f0, 621 - .shift = 16, 622 - .mask = 0xff, 623 - .def = 0x1e, 701 + .regs = { 702 + .smmu = { 703 + .reg = 0x230, 704 + .bit = 26, 705 + }, 706 + .la = { 707 + .reg = 0x2f0, 708 + .shift = 16, 709 + .mask = 0xff, 710 + .def = 0x1e, 711 + }, 624 712 }, 625 713 }, { 626 714 .id = 0x60, 627 715 .name = "sdmmcra", 628 716 .swgroup = TEGRA_SWGROUP_SDMMC1A, 629 - .smmu = { 630 - .reg = 0x234, 631 - .bit = 0, 632 - }, 633 - .la = { 634 - .reg = 0x3b8, 635 - .shift = 0, 636 - .mask = 0xff, 637 - .def = 0x49, 717 + .regs = { 718 + .smmu = { 719 + .reg = 0x234, 720 + .bit = 0, 721 + }, 722 + .la = { 723 + .reg = 0x3b8, 724 + .shift = 0, 725 + .mask = 0xff, 726 + .def = 0x49, 727 + }, 638 728 }, 639 729 }, { 640 730 .id = 0x61, 641 731 .name = "sdmmcraa", 642 732 .swgroup = TEGRA_SWGROUP_SDMMC2A, 643 - .smmu = { 644 - .reg = 0x234, 645 - .bit = 1, 646 - }, 647 - .la = { 648 - .reg = 0x3bc, 649 - .shift = 0, 650 - .mask = 0xff, 651 - .def = 0x5a, 733 + .regs = { 734 + .smmu = { 735 + .reg = 0x234, 736 + .bit = 1, 737 + }, 738 + .la = { 739 + .reg = 0x3bc, 740 + .shift = 0, 741 + .mask = 0xff, 742 + .def = 0x5a, 743 + }, 652 744 }, 653 745 }, { 654 746 .id = 0x62, 655 747 .name = "sdmmcr", 656 748 .swgroup = TEGRA_SWGROUP_SDMMC3A, 657 - .smmu = { 658 - .reg = 0x234, 659 - .bit = 2, 660 - }, 661 - .la = { 662 - .reg = 0x3c0, 663 - .shift = 0, 664 - .mask = 0xff, 665 - .def = 0x49, 749 + .regs = { 750 + .smmu = { 751 + .reg = 0x234, 752 + .bit = 2, 753 + }, 754 + .la = { 755 + .reg = 0x3c0, 756 + .shift = 0, 757 + .mask = 0xff, 758 + .def = 0x49, 759 + }, 666 760 }, 667 761 }, { 668 762 .id = 0x63, 669 763 .swgroup = TEGRA_SWGROUP_SDMMC4A, 670 764 .name = "sdmmcrab", 671 - .smmu = { 672 - .reg = 0x234, 673 - .bit = 3, 674 - }, 675 - .la = { 676 - .reg = 0x3c4, 677 - .shift = 0, 678 - .mask = 0xff, 679 - .def = 0x5a, 765 + .regs = { 766 + .smmu = { 767 + .reg = 0x234, 768 + .bit = 3, 769 + }, 770 + .la = { 771 + .reg = 0x3c4, 772 + .shift = 0, 773 + .mask = 0xff, 774 + .def = 0x5a, 775 + }, 680 776 }, 681 777 }, { 682 778 .id = 0x64, 683 779 .name = "sdmmcwa", 684 780 .swgroup = TEGRA_SWGROUP_SDMMC1A, 685 - .smmu = { 686 - .reg = 0x234, 687 - .bit = 4, 688 - }, 689 - .la = { 690 - .reg = 0x3b8, 691 - .shift = 16, 692 - .mask = 0xff, 693 - .def = 0x80, 781 + .regs = { 782 + .smmu = { 783 + .reg = 0x234, 784 + .bit = 4, 785 + }, 786 + .la = { 787 + .reg = 0x3b8, 788 + .shift = 16, 789 + .mask = 0xff, 790 + .def = 0x80, 791 + }, 694 792 }, 695 793 }, { 696 794 .id = 0x65, 697 795 .name = "sdmmcwaa", 698 796 .swgroup = TEGRA_SWGROUP_SDMMC2A, 699 - .smmu = { 700 - .reg = 0x234, 701 - .bit = 5, 702 - }, 703 - .la = { 704 - .reg = 0x3bc, 705 - .shift = 16, 706 - .mask = 0xff, 707 - .def = 0x80, 797 + .regs = { 798 + .smmu = { 799 + .reg = 0x234, 800 + .bit = 5, 801 + }, 802 + .la = { 803 + .reg = 0x3bc, 804 + .shift = 16, 805 + .mask = 0xff, 806 + .def = 0x80, 807 + }, 708 808 }, 709 809 }, { 710 810 .id = 0x66, 711 811 .name = "sdmmcw", 712 812 .swgroup = TEGRA_SWGROUP_SDMMC3A, 713 - .smmu = { 714 - .reg = 0x234, 715 - .bit = 6, 716 - }, 717 - .la = { 718 - .reg = 0x3c0, 719 - .shift = 16, 720 - .mask = 0xff, 721 - .def = 0x80, 813 + .regs = { 814 + .smmu = { 815 + .reg = 0x234, 816 + .bit = 6, 817 + }, 818 + .la = { 819 + .reg = 0x3c0, 820 + .shift = 16, 821 + .mask = 0xff, 822 + .def = 0x80, 823 + }, 722 824 }, 723 825 }, { 724 826 .id = 0x67, 725 827 .name = "sdmmcwab", 726 828 .swgroup = TEGRA_SWGROUP_SDMMC4A, 727 - .smmu = { 728 - .reg = 0x234, 729 - .bit = 7, 730 - }, 731 - .la = { 732 - .reg = 0x3c4, 733 - .shift = 16, 734 - .mask = 0xff, 735 - .def = 0x80, 829 + .regs = { 830 + .smmu = { 831 + .reg = 0x234, 832 + .bit = 7, 833 + }, 834 + .la = { 835 + .reg = 0x3c4, 836 + .shift = 16, 837 + .mask = 0xff, 838 + .def = 0x80, 839 + }, 736 840 }, 737 841 }, { 738 842 .id = 0x6c, 739 843 .name = "vicsrd", 740 844 .swgroup = TEGRA_SWGROUP_VIC, 741 - .smmu = { 742 - .reg = 0x234, 743 - .bit = 12, 744 - }, 745 - .la = { 746 - .reg = 0x394, 747 - .shift = 0, 748 - .mask = 0xff, 749 - .def = 0x1a, 845 + .regs = { 846 + .smmu = { 847 + .reg = 0x234, 848 + .bit = 12, 849 + }, 850 + .la = { 851 + .reg = 0x394, 852 + .shift = 0, 853 + .mask = 0xff, 854 + .def = 0x1a, 855 + }, 750 856 }, 751 857 }, { 752 858 .id = 0x6d, 753 859 .name = "vicswr", 754 860 .swgroup = TEGRA_SWGROUP_VIC, 755 - .smmu = { 756 - .reg = 0x234, 757 - .bit = 13, 758 - }, 759 - .la = { 760 - .reg = 0x394, 761 - .shift = 16, 762 - .mask = 0xff, 763 - .def = 0x80, 861 + .regs = { 862 + .smmu = { 863 + .reg = 0x234, 864 + .bit = 13, 865 + }, 866 + .la = { 867 + .reg = 0x394, 868 + .shift = 16, 869 + .mask = 0xff, 870 + .def = 0x80, 871 + }, 764 872 }, 765 873 }, { 766 874 .id = 0x72, 767 875 .name = "viw", 768 876 .swgroup = TEGRA_SWGROUP_VI, 769 - .smmu = { 770 - .reg = 0x234, 771 - .bit = 18, 772 - }, 773 - .la = { 774 - .reg = 0x398, 775 - .shift = 0, 776 - .mask = 0xff, 777 - .def = 0x80, 877 + .regs = { 878 + .smmu = { 879 + .reg = 0x234, 880 + .bit = 18, 881 + }, 882 + .la = { 883 + .reg = 0x398, 884 + .shift = 0, 885 + .mask = 0xff, 886 + .def = 0x80, 887 + }, 778 888 }, 779 889 }, { 780 890 .id = 0x73, 781 891 .name = "displayd", 782 892 .swgroup = TEGRA_SWGROUP_DC, 783 - .smmu = { 784 - .reg = 0x234, 785 - .bit = 19, 786 - }, 787 - .la = { 788 - .reg = 0x3c8, 789 - .shift = 0, 790 - .mask = 0xff, 791 - .def = 0x50, 893 + .regs = { 894 + .smmu = { 895 + .reg = 0x234, 896 + .bit = 19, 897 + }, 898 + .la = { 899 + .reg = 0x3c8, 900 + .shift = 0, 901 + .mask = 0xff, 902 + .def = 0x50, 903 + }, 792 904 }, 793 905 }, { 794 906 .id = 0x78, 795 907 .name = "nvdecsrd", 796 908 .swgroup = TEGRA_SWGROUP_NVDEC, 797 - .smmu = { 798 - .reg = 0x234, 799 - .bit = 24, 800 - }, 801 - .la = { 802 - .reg = 0x3d8, 803 - .shift = 0, 804 - .mask = 0xff, 805 - .def = 0x23, 909 + .regs = { 910 + .smmu = { 911 + .reg = 0x234, 912 + .bit = 24, 913 + }, 914 + .la = { 915 + .reg = 0x3d8, 916 + .shift = 0, 917 + .mask = 0xff, 918 + .def = 0x23, 919 + }, 806 920 }, 807 921 }, { 808 922 .id = 0x79, 809 923 .name = "nvdecswr", 810 924 .swgroup = TEGRA_SWGROUP_NVDEC, 811 - .smmu = { 812 - .reg = 0x234, 813 - .bit = 25, 814 - }, 815 - .la = { 816 - .reg = 0x3d8, 817 - .shift = 16, 818 - .mask = 0xff, 819 - .def = 0x80, 925 + .regs = { 926 + .smmu = { 927 + .reg = 0x234, 928 + .bit = 25, 929 + }, 930 + .la = { 931 + .reg = 0x3d8, 932 + .shift = 16, 933 + .mask = 0xff, 934 + .def = 0x80, 935 + }, 820 936 }, 821 937 }, { 822 938 .id = 0x7a, 823 939 .name = "aper", 824 940 .swgroup = TEGRA_SWGROUP_APE, 825 - .smmu = { 826 - .reg = 0x234, 827 - .bit = 26, 828 - }, 829 - .la = { 830 - .reg = 0x3dc, 831 - .shift = 0, 832 - .mask = 0xff, 833 - .def = 0xff, 941 + .regs = { 942 + .smmu = { 943 + .reg = 0x234, 944 + .bit = 26, 945 + }, 946 + .la = { 947 + .reg = 0x3dc, 948 + .shift = 0, 949 + .mask = 0xff, 950 + .def = 0xff, 951 + }, 834 952 }, 835 953 }, { 836 954 .id = 0x7b, 837 955 .name = "apew", 838 956 .swgroup = TEGRA_SWGROUP_APE, 839 - .smmu = { 840 - .reg = 0x234, 841 - .bit = 27, 842 - }, 843 - .la = { 844 - .reg = 0x3dc, 845 - .shift = 16, 846 - .mask = 0xff, 847 - .def = 0x80, 957 + .regs = { 958 + .smmu = { 959 + .reg = 0x234, 960 + .bit = 27, 961 + }, 962 + .la = { 963 + .reg = 0x3dc, 964 + .shift = 16, 965 + .mask = 0xff, 966 + .def = 0x80, 967 + }, 848 968 }, 849 969 }, { 850 970 .id = 0x7e, 851 971 .name = "nvjpgsrd", 852 972 .swgroup = TEGRA_SWGROUP_NVJPG, 853 - .smmu = { 854 - .reg = 0x234, 855 - .bit = 30, 856 - }, 857 - .la = { 858 - .reg = 0x3e4, 859 - .shift = 0, 860 - .mask = 0xff, 861 - .def = 0x23, 973 + .regs = { 974 + .smmu = { 975 + .reg = 0x234, 976 + .bit = 30, 977 + }, 978 + .la = { 979 + .reg = 0x3e4, 980 + .shift = 0, 981 + .mask = 0xff, 982 + .def = 0x23, 983 + }, 862 984 }, 863 985 }, { 864 986 .id = 0x7f, 865 987 .name = "nvjpgswr", 866 988 .swgroup = TEGRA_SWGROUP_NVJPG, 867 - .smmu = { 868 - .reg = 0x234, 869 - .bit = 31, 870 - }, 871 - .la = { 872 - .reg = 0x3e4, 873 - .shift = 16, 874 - .mask = 0xff, 875 - .def = 0x80, 989 + .regs = { 990 + .smmu = { 991 + .reg = 0x234, 992 + .bit = 31, 993 + }, 994 + .la = { 995 + .reg = 0x3e4, 996 + .shift = 16, 997 + .mask = 0xff, 998 + .def = 0x80, 999 + }, 876 1000 }, 877 1001 }, { 878 1002 .id = 0x80, 879 1003 .name = "sesrd", 880 1004 .swgroup = TEGRA_SWGROUP_SE, 881 - .smmu = { 882 - .reg = 0xb98, 883 - .bit = 0, 884 - }, 885 - .la = { 886 - .reg = 0x3e0, 887 - .shift = 0, 888 - .mask = 0xff, 889 - .def = 0x2e, 1005 + .regs = { 1006 + .smmu = { 1007 + .reg = 0xb98, 1008 + .bit = 0, 1009 + }, 1010 + .la = { 1011 + .reg = 0x3e0, 1012 + .shift = 0, 1013 + .mask = 0xff, 1014 + .def = 0x2e, 1015 + }, 890 1016 }, 891 1017 }, { 892 1018 .id = 0x81, 893 1019 .name = "seswr", 894 1020 .swgroup = TEGRA_SWGROUP_SE, 895 - .smmu = { 896 - .reg = 0xb98, 897 - .bit = 1, 898 - }, 899 - .la = { 900 - .reg = 0x3e0, 901 - .shift = 16, 902 - .mask = 0xff, 903 - .def = 0x80, 1021 + .regs = { 1022 + .smmu = { 1023 + .reg = 0xb98, 1024 + .bit = 1, 1025 + }, 1026 + .la = { 1027 + .reg = 0x3e0, 1028 + .shift = 16, 1029 + .mask = 0xff, 1030 + .def = 0x80, 1031 + }, 904 1032 }, 905 1033 }, { 906 1034 .id = 0x82, 907 1035 .name = "axiapr", 908 1036 .swgroup = TEGRA_SWGROUP_AXIAP, 909 - .smmu = { 910 - .reg = 0xb98, 911 - .bit = 2, 912 - }, 913 - .la = { 914 - .reg = 0x3a0, 915 - .shift = 0, 916 - .mask = 0xff, 917 - .def = 0xff, 1037 + .regs = { 1038 + .smmu = { 1039 + .reg = 0xb98, 1040 + .bit = 2, 1041 + }, 1042 + .la = { 1043 + .reg = 0x3a0, 1044 + .shift = 0, 1045 + .mask = 0xff, 1046 + .def = 0xff, 1047 + }, 918 1048 }, 919 1049 }, { 920 1050 .id = 0x83, 921 1051 .name = "axiapw", 922 1052 .swgroup = TEGRA_SWGROUP_AXIAP, 923 - .smmu = { 924 - .reg = 0xb98, 925 - .bit = 3, 926 - }, 927 - .la = { 928 - .reg = 0x3a0, 929 - .shift = 16, 930 - .mask = 0xff, 931 - .def = 0x80, 1053 + .regs = { 1054 + .smmu = { 1055 + .reg = 0xb98, 1056 + .bit = 3, 1057 + }, 1058 + .la = { 1059 + .reg = 0x3a0, 1060 + .shift = 16, 1061 + .mask = 0xff, 1062 + .def = 0x80, 1063 + }, 932 1064 }, 933 1065 }, { 934 1066 .id = 0x84, 935 1067 .name = "etrr", 936 1068 .swgroup = TEGRA_SWGROUP_ETR, 937 - .smmu = { 938 - .reg = 0xb98, 939 - .bit = 4, 940 - }, 941 - .la = { 942 - .reg = 0x3ec, 943 - .shift = 0, 944 - .mask = 0xff, 945 - .def = 0xff, 1069 + .regs = { 1070 + .smmu = { 1071 + .reg = 0xb98, 1072 + .bit = 4, 1073 + }, 1074 + .la = { 1075 + .reg = 0x3ec, 1076 + .shift = 0, 1077 + .mask = 0xff, 1078 + .def = 0xff, 1079 + }, 946 1080 }, 947 1081 }, { 948 1082 .id = 0x85, 949 1083 .name = "etrw", 950 1084 .swgroup = TEGRA_SWGROUP_ETR, 951 - .smmu = { 952 - .reg = 0xb98, 953 - .bit = 5, 954 - }, 955 - .la = { 956 - .reg = 0x3ec, 957 - .shift = 16, 958 - .mask = 0xff, 959 - .def = 0x80, 1085 + .regs = { 1086 + .smmu = { 1087 + .reg = 0xb98, 1088 + .bit = 5, 1089 + }, 1090 + .la = { 1091 + .reg = 0x3ec, 1092 + .shift = 16, 1093 + .mask = 0xff, 1094 + .def = 0x80, 1095 + }, 960 1096 }, 961 1097 }, { 962 1098 .id = 0x86, 963 1099 .name = "tsecsrdb", 964 1100 .swgroup = TEGRA_SWGROUP_TSECB, 965 - .smmu = { 966 - .reg = 0xb98, 967 - .bit = 6, 968 - }, 969 - .la = { 970 - .reg = 0x3f0, 971 - .shift = 0, 972 - .mask = 0xff, 973 - .def = 0x9b, 1101 + .regs = { 1102 + .smmu = { 1103 + .reg = 0xb98, 1104 + .bit = 6, 1105 + }, 1106 + .la = { 1107 + .reg = 0x3f0, 1108 + .shift = 0, 1109 + .mask = 0xff, 1110 + .def = 0x9b, 1111 + }, 974 1112 }, 975 1113 }, { 976 1114 .id = 0x87, 977 1115 .name = "tsecswrb", 978 1116 .swgroup = TEGRA_SWGROUP_TSECB, 979 - .smmu = { 980 - .reg = 0xb98, 981 - .bit = 7, 982 - }, 983 - .la = { 984 - .reg = 0x3f0, 985 - .shift = 16, 986 - .mask = 0xff, 987 - .def = 0x80, 1117 + .regs = { 1118 + .smmu = { 1119 + .reg = 0xb98, 1120 + .bit = 7, 1121 + }, 1122 + .la = { 1123 + .reg = 0x3f0, 1124 + .shift = 16, 1125 + .mask = 0xff, 1126 + .def = 0x80, 1127 + }, 988 1128 }, 989 1129 }, { 990 1130 .id = 0x88, 991 1131 .name = "gpusrd2", 992 1132 .swgroup = TEGRA_SWGROUP_GPU, 993 - .smmu = { 994 - /* read-only */ 995 - .reg = 0xb98, 996 - .bit = 8, 997 - }, 998 - .la = { 999 - .reg = 0x3e8, 1000 - .shift = 0, 1001 - .mask = 0xff, 1002 - .def = 0x1a, 1133 + .regs = { 1134 + .smmu = { 1135 + /* read-only */ 1136 + .reg = 0xb98, 1137 + .bit = 8, 1138 + }, 1139 + .la = { 1140 + .reg = 0x3e8, 1141 + .shift = 0, 1142 + .mask = 0xff, 1143 + .def = 0x1a, 1144 + }, 1003 1145 }, 1004 1146 }, { 1005 1147 .id = 0x89, 1006 1148 .name = "gpuswr2", 1007 1149 .swgroup = TEGRA_SWGROUP_GPU, 1008 - .smmu = { 1009 - /* read-only */ 1010 - .reg = 0xb98, 1011 - .bit = 9, 1012 - }, 1013 - .la = { 1014 - .reg = 0x3e8, 1015 - .shift = 16, 1016 - .mask = 0xff, 1017 - .def = 0x80, 1150 + .regs = { 1151 + .smmu = { 1152 + /* read-only */ 1153 + .reg = 0xb98, 1154 + .bit = 9, 1155 + }, 1156 + .la = { 1157 + .reg = 0x3e8, 1158 + .shift = 16, 1159 + .mask = 0xff, 1160 + .def = 0x80, 1161 + }, 1018 1162 }, 1019 1163 }, 1020 1164 }; ··· 1286 1142 .reset_ops = &tegra_mc_reset_ops_common, 1287 1143 .resets = tegra210_mc_resets, 1288 1144 .num_resets = ARRAY_SIZE(tegra210_mc_resets), 1145 + .ops = &tegra30_mc_ops, 1289 1146 };
+6 -50
drivers/memory/tegra/tegra30-emc.c
··· 150 150 #define EMC_SELF_REF_CMD_ENABLED BIT(0) 151 151 152 152 #define DRAM_DEV_SEL_ALL (0 << 30) 153 - #define DRAM_DEV_SEL_0 (2 << 30) 154 - #define DRAM_DEV_SEL_1 (1 << 30) 153 + #define DRAM_DEV_SEL_0 BIT(31) 154 + #define DRAM_DEV_SEL_1 BIT(30) 155 155 #define DRAM_BROADCAST(num) \ 156 156 ((num) > 1 ? DRAM_DEV_SEL_ALL : DRAM_DEV_SEL_0) 157 157 ··· 1354 1354 } 1355 1355 1356 1356 emc->debugfs.root = debugfs_create_dir("emc", NULL); 1357 - if (!emc->debugfs.root) { 1358 - dev_err(emc->dev, "failed to create debugfs directory\n"); 1359 - return; 1360 - } 1361 1357 1362 1358 debugfs_create_file("available_rates", 0444, emc->debugfs.root, 1363 1359 emc, &tegra_emc_debug_available_rates_fops); ··· 1476 1480 return err; 1477 1481 } 1478 1482 1479 - static int tegra_emc_opp_table_init(struct tegra_emc *emc) 1480 - { 1481 - u32 hw_version = BIT(tegra_sku_info.soc_speedo_id); 1482 - struct opp_table *hw_opp_table; 1483 - int err; 1484 - 1485 - hw_opp_table = dev_pm_opp_set_supported_hw(emc->dev, &hw_version, 1); 1486 - err = PTR_ERR_OR_ZERO(hw_opp_table); 1487 - if (err) { 1488 - dev_err(emc->dev, "failed to set OPP supported HW: %d\n", err); 1489 - return err; 1490 - } 1491 - 1492 - err = dev_pm_opp_of_add_table(emc->dev); 1493 - if (err) { 1494 - if (err == -ENODEV) 1495 - dev_err(emc->dev, "OPP table not found, please update your device tree\n"); 1496 - else 1497 - dev_err(emc->dev, "failed to add OPP table: %d\n", err); 1498 - 1499 - goto put_hw_table; 1500 - } 1501 - 1502 - dev_info_once(emc->dev, "OPP HW ver. 0x%x, current clock rate %lu MHz\n", 1503 - hw_version, clk_get_rate(emc->clk) / 1000000); 1504 - 1505 - /* first dummy rate-set initializes voltage state */ 1506 - err = dev_pm_opp_set_rate(emc->dev, clk_get_rate(emc->clk)); 1507 - if (err) { 1508 - dev_err(emc->dev, "failed to initialize OPP clock: %d\n", err); 1509 - goto remove_table; 1510 - } 1511 - 1512 - return 0; 1513 - 1514 - remove_table: 1515 - dev_pm_opp_of_remove_table(emc->dev); 1516 - put_hw_table: 1517 - dev_pm_opp_put_supported_hw(hw_opp_table); 1518 - 1519 - return err; 1520 - } 1521 - 1522 1483 static void devm_tegra_emc_unset_callback(void *data) 1523 1484 { 1524 1485 tegra20_clk_set_emc_round_callback(NULL, NULL); ··· 1521 1568 1522 1569 static int tegra_emc_probe(struct platform_device *pdev) 1523 1570 { 1571 + struct tegra_core_opp_params opp_params = {}; 1524 1572 struct device_node *np; 1525 1573 struct tegra_emc *emc; 1526 1574 int err; ··· 1571 1617 if (err) 1572 1618 return err; 1573 1619 1574 - err = tegra_emc_opp_table_init(emc); 1620 + opp_params.init_state = true; 1621 + 1622 + err = devm_tegra_core_dev_init_opp_table(&pdev->dev, &opp_params); 1575 1623 if (err) 1576 1624 return err; 1577 1625
+712 -580
drivers/memory/tegra/tegra30.c
··· 37 37 .id = 0x00, 38 38 .name = "ptcr", 39 39 .swgroup = TEGRA_SWGROUP_PTC, 40 - .la = { 41 - .reg = 0x34c, 42 - .shift = 0, 43 - .mask = 0xff, 44 - .def = 0x0, 40 + .regs = { 41 + .la = { 42 + .reg = 0x34c, 43 + .shift = 0, 44 + .mask = 0xff, 45 + .def = 0x0, 46 + }, 45 47 }, 46 48 .fifo_size = 16 * 2, 47 49 }, { 48 50 .id = 0x01, 49 51 .name = "display0a", 50 52 .swgroup = TEGRA_SWGROUP_DC, 51 - .smmu = { 52 - .reg = 0x228, 53 - .bit = 1, 54 - }, 55 - .la = { 56 - .reg = 0x2e8, 57 - .shift = 0, 58 - .mask = 0xff, 59 - .def = 0x4e, 53 + .regs = { 54 + .smmu = { 55 + .reg = 0x228, 56 + .bit = 1, 57 + }, 58 + .la = { 59 + .reg = 0x2e8, 60 + .shift = 0, 61 + .mask = 0xff, 62 + .def = 0x4e, 63 + }, 60 64 }, 61 65 .fifo_size = 16 * 128, 62 66 }, { 63 67 .id = 0x02, 64 68 .name = "display0ab", 65 69 .swgroup = TEGRA_SWGROUP_DCB, 66 - .smmu = { 67 - .reg = 0x228, 68 - .bit = 2, 69 - }, 70 - .la = { 71 - .reg = 0x2f4, 72 - .shift = 0, 73 - .mask = 0xff, 74 - .def = 0x4e, 70 + .regs = { 71 + .smmu = { 72 + .reg = 0x228, 73 + .bit = 2, 74 + }, 75 + .la = { 76 + .reg = 0x2f4, 77 + .shift = 0, 78 + .mask = 0xff, 79 + .def = 0x4e, 80 + }, 75 81 }, 76 82 .fifo_size = 16 * 128, 77 83 }, { 78 84 .id = 0x03, 79 85 .name = "display0b", 80 86 .swgroup = TEGRA_SWGROUP_DC, 81 - .smmu = { 82 - .reg = 0x228, 83 - .bit = 3, 84 - }, 85 - .la = { 86 - .reg = 0x2e8, 87 - .shift = 16, 88 - .mask = 0xff, 89 - .def = 0x4e, 87 + .regs = { 88 + .smmu = { 89 + .reg = 0x228, 90 + .bit = 3, 91 + }, 92 + .la = { 93 + .reg = 0x2e8, 94 + .shift = 16, 95 + .mask = 0xff, 96 + .def = 0x4e, 97 + }, 90 98 }, 91 99 .fifo_size = 16 * 64, 92 100 }, { 93 101 .id = 0x04, 94 102 .name = "display0bb", 95 103 .swgroup = TEGRA_SWGROUP_DCB, 96 - .smmu = { 97 - .reg = 0x228, 98 - .bit = 4, 99 - }, 100 - .la = { 101 - .reg = 0x2f4, 102 - .shift = 16, 103 - .mask = 0xff, 104 - .def = 0x4e, 104 + .regs = { 105 + .smmu = { 106 + .reg = 0x228, 107 + .bit = 4, 108 + }, 109 + .la = { 110 + .reg = 0x2f4, 111 + .shift = 16, 112 + .mask = 0xff, 113 + .def = 0x4e, 114 + }, 105 115 }, 106 116 .fifo_size = 16 * 64, 107 117 }, { 108 118 .id = 0x05, 109 119 .name = "display0c", 110 120 .swgroup = TEGRA_SWGROUP_DC, 111 - .smmu = { 112 - .reg = 0x228, 113 - .bit = 5, 114 - }, 115 - .la = { 116 - .reg = 0x2ec, 117 - .shift = 0, 118 - .mask = 0xff, 119 - .def = 0x4e, 121 + .regs = { 122 + .smmu = { 123 + .reg = 0x228, 124 + .bit = 5, 125 + }, 126 + .la = { 127 + .reg = 0x2ec, 128 + .shift = 0, 129 + .mask = 0xff, 130 + .def = 0x4e, 131 + }, 120 132 }, 121 133 .fifo_size = 16 * 128, 122 134 }, { 123 135 .id = 0x06, 124 136 .name = "display0cb", 125 137 .swgroup = TEGRA_SWGROUP_DCB, 126 - .smmu = { 127 - .reg = 0x228, 128 - .bit = 6, 129 - }, 130 - .la = { 131 - .reg = 0x2f8, 132 - .shift = 0, 133 - .mask = 0xff, 134 - .def = 0x4e, 138 + .regs = { 139 + .smmu = { 140 + .reg = 0x228, 141 + .bit = 6, 142 + }, 143 + .la = { 144 + .reg = 0x2f8, 145 + .shift = 0, 146 + .mask = 0xff, 147 + .def = 0x4e, 148 + }, 135 149 }, 136 150 .fifo_size = 16 * 128, 137 151 }, { 138 152 .id = 0x07, 139 153 .name = "display1b", 140 154 .swgroup = TEGRA_SWGROUP_DC, 141 - .smmu = { 142 - .reg = 0x228, 143 - .bit = 7, 144 - }, 145 - .la = { 146 - .reg = 0x2ec, 147 - .shift = 16, 148 - .mask = 0xff, 149 - .def = 0x4e, 155 + .regs = { 156 + .smmu = { 157 + .reg = 0x228, 158 + .bit = 7, 159 + }, 160 + .la = { 161 + .reg = 0x2ec, 162 + .shift = 16, 163 + .mask = 0xff, 164 + .def = 0x4e, 165 + }, 150 166 }, 151 167 .fifo_size = 16 * 64, 152 168 }, { 153 169 .id = 0x08, 154 170 .name = "display1bb", 155 171 .swgroup = TEGRA_SWGROUP_DCB, 156 - .smmu = { 157 - .reg = 0x228, 158 - .bit = 8, 159 - }, 160 - .la = { 161 - .reg = 0x2f8, 162 - .shift = 16, 163 - .mask = 0xff, 164 - .def = 0x4e, 172 + .regs = { 173 + .smmu = { 174 + .reg = 0x228, 175 + .bit = 8, 176 + }, 177 + .la = { 178 + .reg = 0x2f8, 179 + .shift = 16, 180 + .mask = 0xff, 181 + .def = 0x4e, 182 + }, 165 183 }, 166 184 .fifo_size = 16 * 64, 167 185 }, { 168 186 .id = 0x09, 169 187 .name = "eppup", 170 188 .swgroup = TEGRA_SWGROUP_EPP, 171 - .smmu = { 172 - .reg = 0x228, 173 - .bit = 9, 174 - }, 175 - .la = { 176 - .reg = 0x300, 177 - .shift = 0, 178 - .mask = 0xff, 179 - .def = 0x17, 189 + .regs = { 190 + .smmu = { 191 + .reg = 0x228, 192 + .bit = 9, 193 + }, 194 + .la = { 195 + .reg = 0x300, 196 + .shift = 0, 197 + .mask = 0xff, 198 + .def = 0x17, 199 + }, 180 200 }, 181 201 .fifo_size = 16 * 8, 182 202 }, { 183 203 .id = 0x0a, 184 204 .name = "g2pr", 185 205 .swgroup = TEGRA_SWGROUP_G2, 186 - .smmu = { 187 - .reg = 0x228, 188 - .bit = 10, 189 - }, 190 - .la = { 191 - .reg = 0x308, 192 - .shift = 0, 193 - .mask = 0xff, 194 - .def = 0x09, 206 + .regs = { 207 + .smmu = { 208 + .reg = 0x228, 209 + .bit = 10, 210 + }, 211 + .la = { 212 + .reg = 0x308, 213 + .shift = 0, 214 + .mask = 0xff, 215 + .def = 0x09, 216 + }, 195 217 }, 196 218 .fifo_size = 16 * 64, 197 219 }, { 198 220 .id = 0x0b, 199 221 .name = "g2sr", 200 222 .swgroup = TEGRA_SWGROUP_G2, 201 - .smmu = { 202 - .reg = 0x228, 203 - .bit = 11, 204 - }, 205 - .la = { 206 - .reg = 0x308, 207 - .shift = 16, 208 - .mask = 0xff, 209 - .def = 0x09, 223 + .regs = { 224 + .smmu = { 225 + .reg = 0x228, 226 + .bit = 11, 227 + }, 228 + .la = { 229 + .reg = 0x308, 230 + .shift = 16, 231 + .mask = 0xff, 232 + .def = 0x09, 233 + }, 210 234 }, 211 235 .fifo_size = 16 * 64, 212 236 }, { 213 237 .id = 0x0c, 214 238 .name = "mpeunifbr", 215 239 .swgroup = TEGRA_SWGROUP_MPE, 216 - .smmu = { 217 - .reg = 0x228, 218 - .bit = 12, 219 - }, 220 - .la = { 221 - .reg = 0x328, 222 - .shift = 0, 223 - .mask = 0xff, 224 - .def = 0x50, 240 + .regs = { 241 + .smmu = { 242 + .reg = 0x228, 243 + .bit = 12, 244 + }, 245 + .la = { 246 + .reg = 0x328, 247 + .shift = 0, 248 + .mask = 0xff, 249 + .def = 0x50, 250 + }, 225 251 }, 226 252 .fifo_size = 16 * 8, 227 253 }, { 228 254 .id = 0x0d, 229 255 .name = "viruv", 230 256 .swgroup = TEGRA_SWGROUP_VI, 231 - .smmu = { 232 - .reg = 0x228, 233 - .bit = 13, 234 - }, 235 - .la = { 236 - .reg = 0x364, 237 - .shift = 0, 238 - .mask = 0xff, 239 - .def = 0x2c, 257 + .regs = { 258 + .smmu = { 259 + .reg = 0x228, 260 + .bit = 13, 261 + }, 262 + .la = { 263 + .reg = 0x364, 264 + .shift = 0, 265 + .mask = 0xff, 266 + .def = 0x2c, 267 + }, 240 268 }, 241 269 .fifo_size = 16 * 8, 242 270 }, { 243 271 .id = 0x0e, 244 272 .name = "afir", 245 273 .swgroup = TEGRA_SWGROUP_AFI, 246 - .smmu = { 247 - .reg = 0x228, 248 - .bit = 14, 249 - }, 250 - .la = { 251 - .reg = 0x2e0, 252 - .shift = 0, 253 - .mask = 0xff, 254 - .def = 0x10, 274 + .regs = { 275 + .smmu = { 276 + .reg = 0x228, 277 + .bit = 14, 278 + }, 279 + .la = { 280 + .reg = 0x2e0, 281 + .shift = 0, 282 + .mask = 0xff, 283 + .def = 0x10, 284 + }, 255 285 }, 256 286 .fifo_size = 16 * 32, 257 287 }, { 258 288 .id = 0x0f, 259 289 .name = "avpcarm7r", 260 290 .swgroup = TEGRA_SWGROUP_AVPC, 261 - .smmu = { 262 - .reg = 0x228, 263 - .bit = 15, 264 - }, 265 - .la = { 266 - .reg = 0x2e4, 267 - .shift = 0, 268 - .mask = 0xff, 269 - .def = 0x04, 291 + .regs = { 292 + .smmu = { 293 + .reg = 0x228, 294 + .bit = 15, 295 + }, 296 + .la = { 297 + .reg = 0x2e4, 298 + .shift = 0, 299 + .mask = 0xff, 300 + .def = 0x04, 301 + }, 270 302 }, 271 303 .fifo_size = 16 * 2, 272 304 }, { 273 305 .id = 0x10, 274 306 .name = "displayhc", 275 307 .swgroup = TEGRA_SWGROUP_DC, 276 - .smmu = { 277 - .reg = 0x228, 278 - .bit = 16, 279 - }, 280 - .la = { 281 - .reg = 0x2f0, 282 - .shift = 0, 283 - .mask = 0xff, 284 - .def = 0xff, 308 + .regs = { 309 + .smmu = { 310 + .reg = 0x228, 311 + .bit = 16, 312 + }, 313 + .la = { 314 + .reg = 0x2f0, 315 + .shift = 0, 316 + .mask = 0xff, 317 + .def = 0xff, 318 + }, 285 319 }, 286 320 .fifo_size = 16 * 2, 287 321 }, { 288 322 .id = 0x11, 289 323 .name = "displayhcb", 290 324 .swgroup = TEGRA_SWGROUP_DCB, 291 - .smmu = { 292 - .reg = 0x228, 293 - .bit = 17, 294 - }, 295 - .la = { 296 - .reg = 0x2fc, 297 - .shift = 0, 298 - .mask = 0xff, 299 - .def = 0xff, 325 + .regs = { 326 + .smmu = { 327 + .reg = 0x228, 328 + .bit = 17, 329 + }, 330 + .la = { 331 + .reg = 0x2fc, 332 + .shift = 0, 333 + .mask = 0xff, 334 + .def = 0xff, 335 + }, 300 336 }, 301 337 .fifo_size = 16 * 2, 302 338 }, { 303 339 .id = 0x12, 304 340 .name = "fdcdrd", 305 341 .swgroup = TEGRA_SWGROUP_NV, 306 - .smmu = { 307 - .reg = 0x228, 308 - .bit = 18, 309 - }, 310 - .la = { 311 - .reg = 0x334, 312 - .shift = 0, 313 - .mask = 0xff, 314 - .def = 0x0a, 342 + .regs = { 343 + .smmu = { 344 + .reg = 0x228, 345 + .bit = 18, 346 + }, 347 + .la = { 348 + .reg = 0x334, 349 + .shift = 0, 350 + .mask = 0xff, 351 + .def = 0x0a, 352 + }, 315 353 }, 316 354 .fifo_size = 16 * 48, 317 355 }, { 318 356 .id = 0x13, 319 357 .name = "fdcdrd2", 320 358 .swgroup = TEGRA_SWGROUP_NV2, 321 - .smmu = { 322 - .reg = 0x228, 323 - .bit = 19, 324 - }, 325 - .la = { 326 - .reg = 0x33c, 327 - .shift = 0, 328 - .mask = 0xff, 329 - .def = 0x0a, 359 + .regs = { 360 + .smmu = { 361 + .reg = 0x228, 362 + .bit = 19, 363 + }, 364 + .la = { 365 + .reg = 0x33c, 366 + .shift = 0, 367 + .mask = 0xff, 368 + .def = 0x0a, 369 + }, 330 370 }, 331 371 .fifo_size = 16 * 48, 332 372 }, { 333 373 .id = 0x14, 334 374 .name = "g2dr", 335 375 .swgroup = TEGRA_SWGROUP_G2, 336 - .smmu = { 337 - .reg = 0x228, 338 - .bit = 20, 339 - }, 340 - .la = { 341 - .reg = 0x30c, 342 - .shift = 0, 343 - .mask = 0xff, 344 - .def = 0x0a, 376 + .regs = { 377 + .smmu = { 378 + .reg = 0x228, 379 + .bit = 20, 380 + }, 381 + .la = { 382 + .reg = 0x30c, 383 + .shift = 0, 384 + .mask = 0xff, 385 + .def = 0x0a, 386 + }, 345 387 }, 346 388 .fifo_size = 16 * 48, 347 389 }, { 348 390 .id = 0x15, 349 391 .name = "hdar", 350 392 .swgroup = TEGRA_SWGROUP_HDA, 351 - .smmu = { 352 - .reg = 0x228, 353 - .bit = 21, 354 - }, 355 - .la = { 356 - .reg = 0x318, 357 - .shift = 0, 358 - .mask = 0xff, 359 - .def = 0xff, 393 + .regs = { 394 + .smmu = { 395 + .reg = 0x228, 396 + .bit = 21, 397 + }, 398 + .la = { 399 + .reg = 0x318, 400 + .shift = 0, 401 + .mask = 0xff, 402 + .def = 0xff, 403 + }, 360 404 }, 361 405 .fifo_size = 16 * 16, 362 406 }, { 363 407 .id = 0x16, 364 408 .name = "host1xdmar", 365 409 .swgroup = TEGRA_SWGROUP_HC, 366 - .smmu = { 367 - .reg = 0x228, 368 - .bit = 22, 369 - }, 370 - .la = { 371 - .reg = 0x310, 372 - .shift = 0, 373 - .mask = 0xff, 374 - .def = 0x05, 410 + .regs = { 411 + .smmu = { 412 + .reg = 0x228, 413 + .bit = 22, 414 + }, 415 + .la = { 416 + .reg = 0x310, 417 + .shift = 0, 418 + .mask = 0xff, 419 + .def = 0x05, 420 + }, 375 421 }, 376 422 .fifo_size = 16 * 16, 377 423 }, { 378 424 .id = 0x17, 379 425 .name = "host1xr", 380 426 .swgroup = TEGRA_SWGROUP_HC, 381 - .smmu = { 382 - .reg = 0x228, 383 - .bit = 23, 384 - }, 385 - .la = { 386 - .reg = 0x310, 387 - .shift = 16, 388 - .mask = 0xff, 389 - .def = 0x50, 427 + .regs = { 428 + .smmu = { 429 + .reg = 0x228, 430 + .bit = 23, 431 + }, 432 + .la = { 433 + .reg = 0x310, 434 + .shift = 16, 435 + .mask = 0xff, 436 + .def = 0x50, 437 + }, 390 438 }, 391 439 .fifo_size = 16 * 8, 392 440 }, { 393 441 .id = 0x18, 394 442 .name = "idxsrd", 395 443 .swgroup = TEGRA_SWGROUP_NV, 396 - .smmu = { 397 - .reg = 0x228, 398 - .bit = 24, 399 - }, 400 - .la = { 401 - .reg = 0x334, 402 - .shift = 16, 403 - .mask = 0xff, 404 - .def = 0x13, 444 + .regs = { 445 + .smmu = { 446 + .reg = 0x228, 447 + .bit = 24, 448 + }, 449 + .la = { 450 + .reg = 0x334, 451 + .shift = 16, 452 + .mask = 0xff, 453 + .def = 0x13, 454 + }, 405 455 }, 406 456 .fifo_size = 16 * 64, 407 457 }, { 408 458 .id = 0x19, 409 459 .name = "idxsrd2", 410 460 .swgroup = TEGRA_SWGROUP_NV2, 411 - .smmu = { 412 - .reg = 0x228, 413 - .bit = 25, 414 - }, 415 - .la = { 416 - .reg = 0x33c, 417 - .shift = 16, 418 - .mask = 0xff, 419 - .def = 0x13, 461 + .regs = { 462 + .smmu = { 463 + .reg = 0x228, 464 + .bit = 25, 465 + }, 466 + .la = { 467 + .reg = 0x33c, 468 + .shift = 16, 469 + .mask = 0xff, 470 + .def = 0x13, 471 + }, 420 472 }, 421 473 .fifo_size = 16 * 64, 422 474 }, { 423 475 .id = 0x1a, 424 476 .name = "mpe_ipred", 425 477 .swgroup = TEGRA_SWGROUP_MPE, 426 - .smmu = { 427 - .reg = 0x228, 428 - .bit = 26, 429 - }, 430 - .la = { 431 - .reg = 0x328, 432 - .shift = 16, 433 - .mask = 0xff, 434 - .def = 0x80, 478 + .regs = { 479 + .smmu = { 480 + .reg = 0x228, 481 + .bit = 26, 482 + }, 483 + .la = { 484 + .reg = 0x328, 485 + .shift = 16, 486 + .mask = 0xff, 487 + .def = 0x80, 488 + }, 435 489 }, 436 490 .fifo_size = 16 * 2, 437 491 }, { 438 492 .id = 0x1b, 439 493 .name = "mpeamemrd", 440 494 .swgroup = TEGRA_SWGROUP_MPE, 441 - .smmu = { 442 - .reg = 0x228, 443 - .bit = 27, 444 - }, 445 - .la = { 446 - .reg = 0x32c, 447 - .shift = 0, 448 - .mask = 0xff, 449 - .def = 0x42, 495 + .regs = { 496 + .smmu = { 497 + .reg = 0x228, 498 + .bit = 27, 499 + }, 500 + .la = { 501 + .reg = 0x32c, 502 + .shift = 0, 503 + .mask = 0xff, 504 + .def = 0x42, 505 + }, 450 506 }, 451 507 .fifo_size = 16 * 64, 452 508 }, { 453 509 .id = 0x1c, 454 510 .name = "mpecsrd", 455 511 .swgroup = TEGRA_SWGROUP_MPE, 456 - .smmu = { 457 - .reg = 0x228, 458 - .bit = 28, 459 - }, 460 - .la = { 461 - .reg = 0x32c, 462 - .shift = 16, 463 - .mask = 0xff, 464 - .def = 0xff, 512 + .regs = { 513 + .smmu = { 514 + .reg = 0x228, 515 + .bit = 28, 516 + }, 517 + .la = { 518 + .reg = 0x32c, 519 + .shift = 16, 520 + .mask = 0xff, 521 + .def = 0xff, 522 + }, 465 523 }, 466 524 .fifo_size = 16 * 8, 467 525 }, { 468 526 .id = 0x1d, 469 527 .name = "ppcsahbdmar", 470 528 .swgroup = TEGRA_SWGROUP_PPCS, 471 - .smmu = { 472 - .reg = 0x228, 473 - .bit = 29, 474 - }, 475 - .la = { 476 - .reg = 0x344, 477 - .shift = 0, 478 - .mask = 0xff, 479 - .def = 0x10, 529 + .regs = { 530 + .smmu = { 531 + .reg = 0x228, 532 + .bit = 29, 533 + }, 534 + .la = { 535 + .reg = 0x344, 536 + .shift = 0, 537 + .mask = 0xff, 538 + .def = 0x10, 539 + }, 480 540 }, 481 541 .fifo_size = 16 * 2, 482 542 }, { 483 543 .id = 0x1e, 484 544 .name = "ppcsahbslvr", 485 545 .swgroup = TEGRA_SWGROUP_PPCS, 486 - .smmu = { 487 - .reg = 0x228, 488 - .bit = 30, 489 - }, 490 - .la = { 491 - .reg = 0x344, 492 - .shift = 16, 493 - .mask = 0xff, 494 - .def = 0x12, 546 + .regs = { 547 + .smmu = { 548 + .reg = 0x228, 549 + .bit = 30, 550 + }, 551 + .la = { 552 + .reg = 0x344, 553 + .shift = 16, 554 + .mask = 0xff, 555 + .def = 0x12, 556 + }, 495 557 }, 496 558 .fifo_size = 16 * 8, 497 559 }, { 498 560 .id = 0x1f, 499 561 .name = "satar", 500 562 .swgroup = TEGRA_SWGROUP_SATA, 501 - .smmu = { 502 - .reg = 0x228, 503 - .bit = 31, 504 - }, 505 - .la = { 506 - .reg = 0x350, 507 - .shift = 0, 508 - .mask = 0xff, 509 - .def = 0x33, 563 + .regs = { 564 + .smmu = { 565 + .reg = 0x228, 566 + .bit = 31, 567 + }, 568 + .la = { 569 + .reg = 0x350, 570 + .shift = 0, 571 + .mask = 0xff, 572 + .def = 0x33, 573 + }, 510 574 }, 511 575 .fifo_size = 16 * 32, 512 576 }, { 513 577 .id = 0x20, 514 578 .name = "texsrd", 515 579 .swgroup = TEGRA_SWGROUP_NV, 516 - .smmu = { 517 - .reg = 0x22c, 518 - .bit = 0, 519 - }, 520 - .la = { 521 - .reg = 0x338, 522 - .shift = 0, 523 - .mask = 0xff, 524 - .def = 0x13, 580 + .regs = { 581 + .smmu = { 582 + .reg = 0x22c, 583 + .bit = 0, 584 + }, 585 + .la = { 586 + .reg = 0x338, 587 + .shift = 0, 588 + .mask = 0xff, 589 + .def = 0x13, 590 + }, 525 591 }, 526 592 .fifo_size = 16 * 64, 527 593 }, { 528 594 .id = 0x21, 529 595 .name = "texsrd2", 530 596 .swgroup = TEGRA_SWGROUP_NV2, 531 - .smmu = { 532 - .reg = 0x22c, 533 - .bit = 1, 534 - }, 535 - .la = { 536 - .reg = 0x340, 537 - .shift = 0, 538 - .mask = 0xff, 539 - .def = 0x13, 597 + .regs = { 598 + .smmu = { 599 + .reg = 0x22c, 600 + .bit = 1, 601 + }, 602 + .la = { 603 + .reg = 0x340, 604 + .shift = 0, 605 + .mask = 0xff, 606 + .def = 0x13, 607 + }, 540 608 }, 541 609 .fifo_size = 16 * 64, 542 610 }, { 543 611 .id = 0x22, 544 612 .name = "vdebsevr", 545 613 .swgroup = TEGRA_SWGROUP_VDE, 546 - .smmu = { 547 - .reg = 0x22c, 548 - .bit = 2, 549 - }, 550 - .la = { 551 - .reg = 0x354, 552 - .shift = 0, 553 - .mask = 0xff, 554 - .def = 0xff, 614 + .regs = { 615 + .smmu = { 616 + .reg = 0x22c, 617 + .bit = 2, 618 + }, 619 + .la = { 620 + .reg = 0x354, 621 + .shift = 0, 622 + .mask = 0xff, 623 + .def = 0xff, 624 + }, 555 625 }, 556 626 .fifo_size = 16 * 8, 557 627 }, { 558 628 .id = 0x23, 559 629 .name = "vdember", 560 630 .swgroup = TEGRA_SWGROUP_VDE, 561 - .smmu = { 562 - .reg = 0x22c, 563 - .bit = 3, 564 - }, 565 - .la = { 566 - .reg = 0x354, 567 - .shift = 16, 568 - .mask = 0xff, 569 - .def = 0xd0, 631 + .regs = { 632 + .smmu = { 633 + .reg = 0x22c, 634 + .bit = 3, 635 + }, 636 + .la = { 637 + .reg = 0x354, 638 + .shift = 16, 639 + .mask = 0xff, 640 + .def = 0xd0, 641 + }, 570 642 }, 571 643 .fifo_size = 16 * 4, 572 644 }, { 573 645 .id = 0x24, 574 646 .name = "vdemcer", 575 647 .swgroup = TEGRA_SWGROUP_VDE, 576 - .smmu = { 577 - .reg = 0x22c, 578 - .bit = 4, 579 - }, 580 - .la = { 581 - .reg = 0x358, 582 - .shift = 0, 583 - .mask = 0xff, 584 - .def = 0x2a, 648 + .regs = { 649 + .smmu = { 650 + .reg = 0x22c, 651 + .bit = 4, 652 + }, 653 + .la = { 654 + .reg = 0x358, 655 + .shift = 0, 656 + .mask = 0xff, 657 + .def = 0x2a, 658 + }, 585 659 }, 586 660 .fifo_size = 16 * 16, 587 661 }, { 588 662 .id = 0x25, 589 663 .name = "vdetper", 590 664 .swgroup = TEGRA_SWGROUP_VDE, 591 - .smmu = { 592 - .reg = 0x22c, 593 - .bit = 5, 594 - }, 595 - .la = { 596 - .reg = 0x358, 597 - .shift = 16, 598 - .mask = 0xff, 599 - .def = 0x74, 665 + .regs = { 666 + .smmu = { 667 + .reg = 0x22c, 668 + .bit = 5, 669 + }, 670 + .la = { 671 + .reg = 0x358, 672 + .shift = 16, 673 + .mask = 0xff, 674 + .def = 0x74, 675 + }, 600 676 }, 601 677 .fifo_size = 16 * 16, 602 678 }, { 603 679 .id = 0x26, 604 680 .name = "mpcorelpr", 605 681 .swgroup = TEGRA_SWGROUP_MPCORELP, 606 - .la = { 607 - .reg = 0x324, 608 - .shift = 0, 609 - .mask = 0xff, 610 - .def = 0x04, 682 + .regs = { 683 + .la = { 684 + .reg = 0x324, 685 + .shift = 0, 686 + .mask = 0xff, 687 + .def = 0x04, 688 + }, 611 689 }, 612 690 .fifo_size = 16 * 14, 613 691 }, { 614 692 .id = 0x27, 615 693 .name = "mpcorer", 616 694 .swgroup = TEGRA_SWGROUP_MPCORE, 617 - .la = { 618 - .reg = 0x320, 619 - .shift = 0, 620 - .mask = 0xff, 621 - .def = 0x04, 695 + .regs = { 696 + .la = { 697 + .reg = 0x320, 698 + .shift = 0, 699 + .mask = 0xff, 700 + .def = 0x04, 701 + }, 622 702 }, 623 703 .fifo_size = 16 * 14, 624 704 }, { 625 705 .id = 0x28, 626 706 .name = "eppu", 627 707 .swgroup = TEGRA_SWGROUP_EPP, 628 - .smmu = { 629 - .reg = 0x22c, 630 - .bit = 8, 631 - }, 632 - .la = { 633 - .reg = 0x300, 634 - .shift = 16, 635 - .mask = 0xff, 636 - .def = 0x6c, 708 + .regs = { 709 + .smmu = { 710 + .reg = 0x22c, 711 + .bit = 8, 712 + }, 713 + .la = { 714 + .reg = 0x300, 715 + .shift = 16, 716 + .mask = 0xff, 717 + .def = 0x6c, 718 + }, 637 719 }, 638 720 .fifo_size = 16 * 64, 639 721 }, { 640 722 .id = 0x29, 641 723 .name = "eppv", 642 724 .swgroup = TEGRA_SWGROUP_EPP, 643 - .smmu = { 644 - .reg = 0x22c, 645 - .bit = 9, 646 - }, 647 - .la = { 648 - .reg = 0x304, 649 - .shift = 0, 650 - .mask = 0xff, 651 - .def = 0x6c, 725 + .regs = { 726 + .smmu = { 727 + .reg = 0x22c, 728 + .bit = 9, 729 + }, 730 + .la = { 731 + .reg = 0x304, 732 + .shift = 0, 733 + .mask = 0xff, 734 + .def = 0x6c, 735 + }, 652 736 }, 653 737 .fifo_size = 16 * 64, 654 738 }, { 655 739 .id = 0x2a, 656 740 .name = "eppy", 657 741 .swgroup = TEGRA_SWGROUP_EPP, 658 - .smmu = { 659 - .reg = 0x22c, 660 - .bit = 10, 661 - }, 662 - .la = { 663 - .reg = 0x304, 664 - .shift = 16, 665 - .mask = 0xff, 666 - .def = 0x6c, 742 + .regs = { 743 + .smmu = { 744 + .reg = 0x22c, 745 + .bit = 10, 746 + }, 747 + .la = { 748 + .reg = 0x304, 749 + .shift = 16, 750 + .mask = 0xff, 751 + .def = 0x6c, 752 + }, 667 753 }, 668 754 .fifo_size = 16 * 64, 669 755 }, { 670 756 .id = 0x2b, 671 757 .name = "mpeunifbw", 672 758 .swgroup = TEGRA_SWGROUP_MPE, 673 - .smmu = { 674 - .reg = 0x22c, 675 - .bit = 11, 676 - }, 677 - .la = { 678 - .reg = 0x330, 679 - .shift = 0, 680 - .mask = 0xff, 681 - .def = 0x13, 759 + .regs = { 760 + .smmu = { 761 + .reg = 0x22c, 762 + .bit = 11, 763 + }, 764 + .la = { 765 + .reg = 0x330, 766 + .shift = 0, 767 + .mask = 0xff, 768 + .def = 0x13, 769 + }, 682 770 }, 683 771 .fifo_size = 16 * 8, 684 772 }, { 685 773 .id = 0x2c, 686 774 .name = "viwsb", 687 775 .swgroup = TEGRA_SWGROUP_VI, 688 - .smmu = { 689 - .reg = 0x22c, 690 - .bit = 12, 691 - }, 692 - .la = { 693 - .reg = 0x364, 694 - .shift = 16, 695 - .mask = 0xff, 696 - .def = 0x12, 776 + .regs = { 777 + .smmu = { 778 + .reg = 0x22c, 779 + .bit = 12, 780 + }, 781 + .la = { 782 + .reg = 0x364, 783 + .shift = 16, 784 + .mask = 0xff, 785 + .def = 0x12, 786 + }, 697 787 }, 698 788 .fifo_size = 16 * 64, 699 789 }, { 700 790 .id = 0x2d, 701 791 .name = "viwu", 702 792 .swgroup = TEGRA_SWGROUP_VI, 703 - .smmu = { 704 - .reg = 0x22c, 705 - .bit = 13, 706 - }, 707 - .la = { 708 - .reg = 0x368, 709 - .shift = 0, 710 - .mask = 0xff, 711 - .def = 0xb2, 793 + .regs = { 794 + .smmu = { 795 + .reg = 0x22c, 796 + .bit = 13, 797 + }, 798 + .la = { 799 + .reg = 0x368, 800 + .shift = 0, 801 + .mask = 0xff, 802 + .def = 0xb2, 803 + }, 712 804 }, 713 805 .fifo_size = 16 * 64, 714 806 }, { 715 807 .id = 0x2e, 716 808 .name = "viwv", 717 809 .swgroup = TEGRA_SWGROUP_VI, 718 - .smmu = { 719 - .reg = 0x22c, 720 - .bit = 14, 721 - }, 722 - .la = { 723 - .reg = 0x368, 724 - .shift = 16, 725 - .mask = 0xff, 726 - .def = 0xb2, 810 + .regs = { 811 + .smmu = { 812 + .reg = 0x22c, 813 + .bit = 14, 814 + }, 815 + .la = { 816 + .reg = 0x368, 817 + .shift = 16, 818 + .mask = 0xff, 819 + .def = 0xb2, 820 + }, 727 821 }, 728 822 .fifo_size = 16 * 64, 729 823 }, { 730 824 .id = 0x2f, 731 825 .name = "viwy", 732 826 .swgroup = TEGRA_SWGROUP_VI, 733 - .smmu = { 734 - .reg = 0x22c, 735 - .bit = 15, 736 - }, 737 - .la = { 738 - .reg = 0x36c, 739 - .shift = 0, 740 - .mask = 0xff, 741 - .def = 0x12, 827 + .regs = { 828 + .smmu = { 829 + .reg = 0x22c, 830 + .bit = 15, 831 + }, 832 + .la = { 833 + .reg = 0x36c, 834 + .shift = 0, 835 + .mask = 0xff, 836 + .def = 0x12, 837 + }, 742 838 }, 743 839 .fifo_size = 16 * 64, 744 840 }, { 745 841 .id = 0x30, 746 842 .name = "g2dw", 747 843 .swgroup = TEGRA_SWGROUP_G2, 748 - .smmu = { 749 - .reg = 0x22c, 750 - .bit = 16, 751 - }, 752 - .la = { 753 - .reg = 0x30c, 754 - .shift = 16, 755 - .mask = 0xff, 756 - .def = 0x9, 844 + .regs = { 845 + .smmu = { 846 + .reg = 0x22c, 847 + .bit = 16, 848 + }, 849 + .la = { 850 + .reg = 0x30c, 851 + .shift = 16, 852 + .mask = 0xff, 853 + .def = 0x9, 854 + }, 757 855 }, 758 856 .fifo_size = 16 * 128, 759 857 }, { 760 858 .id = 0x31, 761 859 .name = "afiw", 762 860 .swgroup = TEGRA_SWGROUP_AFI, 763 - .smmu = { 764 - .reg = 0x22c, 765 - .bit = 17, 766 - }, 767 - .la = { 768 - .reg = 0x2e0, 769 - .shift = 16, 770 - .mask = 0xff, 771 - .def = 0x0c, 861 + .regs = { 862 + .smmu = { 863 + .reg = 0x22c, 864 + .bit = 17, 865 + }, 866 + .la = { 867 + .reg = 0x2e0, 868 + .shift = 16, 869 + .mask = 0xff, 870 + .def = 0x0c, 871 + }, 772 872 }, 773 873 .fifo_size = 16 * 32, 774 874 }, { 775 875 .id = 0x32, 776 876 .name = "avpcarm7w", 777 877 .swgroup = TEGRA_SWGROUP_AVPC, 778 - .smmu = { 779 - .reg = 0x22c, 780 - .bit = 18, 781 - }, 782 - .la = { 783 - .reg = 0x2e4, 784 - .shift = 16, 785 - .mask = 0xff, 786 - .def = 0x0e, 878 + .regs = { 879 + .smmu = { 880 + .reg = 0x22c, 881 + .bit = 18, 882 + }, 883 + .la = { 884 + .reg = 0x2e4, 885 + .shift = 16, 886 + .mask = 0xff, 887 + .def = 0x0e, 888 + }, 787 889 }, 788 890 .fifo_size = 16 * 2, 789 891 }, { 790 892 .id = 0x33, 791 893 .name = "fdcdwr", 792 894 .swgroup = TEGRA_SWGROUP_NV, 793 - .smmu = { 794 - .reg = 0x22c, 795 - .bit = 19, 796 - }, 797 - .la = { 798 - .reg = 0x338, 799 - .shift = 16, 800 - .mask = 0xff, 801 - .def = 0x0a, 895 + .regs = { 896 + .smmu = { 897 + .reg = 0x22c, 898 + .bit = 19, 899 + }, 900 + .la = { 901 + .reg = 0x338, 902 + .shift = 16, 903 + .mask = 0xff, 904 + .def = 0x0a, 905 + }, 802 906 }, 803 907 .fifo_size = 16 * 48, 804 908 }, { 805 909 .id = 0x34, 806 910 .name = "fdcdwr2", 807 911 .swgroup = TEGRA_SWGROUP_NV2, 808 - .smmu = { 809 - .reg = 0x22c, 810 - .bit = 20, 811 - }, 812 - .la = { 813 - .reg = 0x340, 814 - .shift = 16, 815 - .mask = 0xff, 816 - .def = 0x0a, 912 + .regs = { 913 + .smmu = { 914 + .reg = 0x22c, 915 + .bit = 20, 916 + }, 917 + .la = { 918 + .reg = 0x340, 919 + .shift = 16, 920 + .mask = 0xff, 921 + .def = 0x0a, 922 + }, 817 923 }, 818 924 .fifo_size = 16 * 48, 819 925 }, { 820 926 .id = 0x35, 821 927 .name = "hdaw", 822 928 .swgroup = TEGRA_SWGROUP_HDA, 823 - .smmu = { 824 - .reg = 0x22c, 825 - .bit = 21, 826 - }, 827 - .la = { 828 - .reg = 0x318, 829 - .shift = 16, 830 - .mask = 0xff, 831 - .def = 0xff, 929 + .regs = { 930 + .smmu = { 931 + .reg = 0x22c, 932 + .bit = 21, 933 + }, 934 + .la = { 935 + .reg = 0x318, 936 + .shift = 16, 937 + .mask = 0xff, 938 + .def = 0xff, 939 + }, 832 940 }, 833 941 .fifo_size = 16 * 16, 834 942 }, { 835 943 .id = 0x36, 836 944 .name = "host1xw", 837 945 .swgroup = TEGRA_SWGROUP_HC, 838 - .smmu = { 839 - .reg = 0x22c, 840 - .bit = 22, 841 - }, 842 - .la = { 843 - .reg = 0x314, 844 - .shift = 0, 845 - .mask = 0xff, 846 - .def = 0x10, 946 + .regs = { 947 + .smmu = { 948 + .reg = 0x22c, 949 + .bit = 22, 950 + }, 951 + .la = { 952 + .reg = 0x314, 953 + .shift = 0, 954 + .mask = 0xff, 955 + .def = 0x10, 956 + }, 847 957 }, 848 958 .fifo_size = 16 * 32, 849 959 }, { 850 960 .id = 0x37, 851 961 .name = "ispw", 852 962 .swgroup = TEGRA_SWGROUP_ISP, 853 - .smmu = { 854 - .reg = 0x22c, 855 - .bit = 23, 856 - }, 857 - .la = { 858 - .reg = 0x31c, 859 - .shift = 0, 860 - .mask = 0xff, 861 - .def = 0xff, 963 + .regs = { 964 + .smmu = { 965 + .reg = 0x22c, 966 + .bit = 23, 967 + }, 968 + .la = { 969 + .reg = 0x31c, 970 + .shift = 0, 971 + .mask = 0xff, 972 + .def = 0xff, 973 + }, 862 974 }, 863 975 .fifo_size = 16 * 64, 864 976 }, { 865 977 .id = 0x38, 866 978 .name = "mpcorelpw", 867 979 .swgroup = TEGRA_SWGROUP_MPCORELP, 868 - .la = { 869 - .reg = 0x324, 870 - .shift = 16, 871 - .mask = 0xff, 872 - .def = 0x0e, 980 + .regs = { 981 + .la = { 982 + .reg = 0x324, 983 + .shift = 16, 984 + .mask = 0xff, 985 + .def = 0x0e, 986 + }, 873 987 }, 874 988 .fifo_size = 16 * 24, 875 989 }, { 876 990 .id = 0x39, 877 991 .name = "mpcorew", 878 992 .swgroup = TEGRA_SWGROUP_MPCORE, 879 - .la = { 880 - .reg = 0x320, 881 - .shift = 16, 882 - .mask = 0xff, 883 - .def = 0x0e, 993 + .regs = { 994 + .la = { 995 + .reg = 0x320, 996 + .shift = 16, 997 + .mask = 0xff, 998 + .def = 0x0e, 999 + }, 884 1000 }, 885 1001 .fifo_size = 16 * 24, 886 1002 }, { 887 1003 .id = 0x3a, 888 1004 .name = "mpecswr", 889 1005 .swgroup = TEGRA_SWGROUP_MPE, 890 - .smmu = { 891 - .reg = 0x22c, 892 - .bit = 26, 893 - }, 894 - .la = { 895 - .reg = 0x330, 896 - .shift = 16, 897 - .mask = 0xff, 898 - .def = 0xff, 1006 + .regs = { 1007 + .smmu = { 1008 + .reg = 0x22c, 1009 + .bit = 26, 1010 + }, 1011 + .la = { 1012 + .reg = 0x330, 1013 + .shift = 16, 1014 + .mask = 0xff, 1015 + .def = 0xff, 1016 + }, 899 1017 }, 900 1018 .fifo_size = 16 * 8, 901 1019 }, { 902 1020 .id = 0x3b, 903 1021 .name = "ppcsahbdmaw", 904 1022 .swgroup = TEGRA_SWGROUP_PPCS, 905 - .smmu = { 906 - .reg = 0x22c, 907 - .bit = 27, 908 - }, 909 - .la = { 910 - .reg = 0x348, 911 - .shift = 0, 912 - .mask = 0xff, 913 - .def = 0x10, 1023 + .regs = { 1024 + .smmu = { 1025 + .reg = 0x22c, 1026 + .bit = 27, 1027 + }, 1028 + .la = { 1029 + .reg = 0x348, 1030 + .shift = 0, 1031 + .mask = 0xff, 1032 + .def = 0x10, 1033 + }, 914 1034 }, 915 1035 .fifo_size = 16 * 2, 916 1036 }, { 917 1037 .id = 0x3c, 918 1038 .name = "ppcsahbslvw", 919 1039 .swgroup = TEGRA_SWGROUP_PPCS, 920 - .smmu = { 921 - .reg = 0x22c, 922 - .bit = 28, 923 - }, 924 - .la = { 925 - .reg = 0x348, 926 - .shift = 16, 927 - .mask = 0xff, 928 - .def = 0x06, 1040 + .regs = { 1041 + .smmu = { 1042 + .reg = 0x22c, 1043 + .bit = 28, 1044 + }, 1045 + .la = { 1046 + .reg = 0x348, 1047 + .shift = 16, 1048 + .mask = 0xff, 1049 + .def = 0x06, 1050 + }, 929 1051 }, 930 1052 .fifo_size = 16 * 4, 931 1053 }, { 932 1054 .id = 0x3d, 933 1055 .name = "sataw", 934 1056 .swgroup = TEGRA_SWGROUP_SATA, 935 - .smmu = { 936 - .reg = 0x22c, 937 - .bit = 29, 938 - }, 939 - .la = { 940 - .reg = 0x350, 941 - .shift = 16, 942 - .mask = 0xff, 943 - .def = 0x33, 1057 + .regs = { 1058 + .smmu = { 1059 + .reg = 0x22c, 1060 + .bit = 29, 1061 + }, 1062 + .la = { 1063 + .reg = 0x350, 1064 + .shift = 16, 1065 + .mask = 0xff, 1066 + .def = 0x33, 1067 + }, 944 1068 }, 945 1069 .fifo_size = 16 * 32, 946 1070 }, { 947 1071 .id = 0x3e, 948 1072 .name = "vdebsevw", 949 1073 .swgroup = TEGRA_SWGROUP_VDE, 950 - .smmu = { 951 - .reg = 0x22c, 952 - .bit = 30, 953 - }, 954 - .la = { 955 - .reg = 0x35c, 956 - .shift = 0, 957 - .mask = 0xff, 958 - .def = 0xff, 1074 + .regs = { 1075 + .smmu = { 1076 + .reg = 0x22c, 1077 + .bit = 30, 1078 + }, 1079 + .la = { 1080 + .reg = 0x35c, 1081 + .shift = 0, 1082 + .mask = 0xff, 1083 + .def = 0xff, 1084 + }, 959 1085 }, 960 1086 .fifo_size = 16 * 4, 961 1087 }, { 962 1088 .id = 0x3f, 963 1089 .name = "vdedbgw", 964 1090 .swgroup = TEGRA_SWGROUP_VDE, 965 - .smmu = { 966 - .reg = 0x22c, 967 - .bit = 31, 968 - }, 969 - .la = { 970 - .reg = 0x35c, 971 - .shift = 16, 972 - .mask = 0xff, 973 - .def = 0xff, 1091 + .regs = { 1092 + .smmu = { 1093 + .reg = 0x22c, 1094 + .bit = 31, 1095 + }, 1096 + .la = { 1097 + .reg = 0x35c, 1098 + .shift = 16, 1099 + .mask = 0xff, 1100 + .def = 0xff, 1101 + }, 974 1102 }, 975 1103 .fifo_size = 16 * 16, 976 1104 }, { 977 1105 .id = 0x40, 978 1106 .name = "vdembew", 979 1107 .swgroup = TEGRA_SWGROUP_VDE, 980 - .smmu = { 981 - .reg = 0x230, 982 - .bit = 0, 983 - }, 984 - .la = { 985 - .reg = 0x360, 986 - .shift = 0, 987 - .mask = 0xff, 988 - .def = 0x42, 1108 + .regs = { 1109 + .smmu = { 1110 + .reg = 0x230, 1111 + .bit = 0, 1112 + }, 1113 + .la = { 1114 + .reg = 0x360, 1115 + .shift = 0, 1116 + .mask = 0xff, 1117 + .def = 0x42, 1118 + }, 989 1119 }, 990 1120 .fifo_size = 16 * 2, 991 1121 }, { 992 1122 .id = 0x41, 993 1123 .name = "vdetpmw", 994 1124 .swgroup = TEGRA_SWGROUP_VDE, 995 - .smmu = { 996 - .reg = 0x230, 997 - .bit = 1, 998 - }, 999 - .la = { 1000 - .reg = 0x360, 1001 - .shift = 16, 1002 - .mask = 0xff, 1003 - .def = 0x2a, 1125 + .regs = { 1126 + .smmu = { 1127 + .reg = 0x230, 1128 + .bit = 1, 1129 + }, 1130 + .la = { 1131 + .reg = 0x360, 1132 + .shift = 16, 1133 + .mask = 0xff, 1134 + .def = 0x2a, 1135 + }, 1004 1136 }, 1005 1137 .fifo_size = 16 * 16, 1006 1138 }, ··· 1221 1089 unsigned int bandwidth_mbytes_sec) 1222 1090 { 1223 1091 u32 arb_tolerance_compensation_nsec, arb_tolerance_compensation_div; 1224 - const struct tegra_mc_la *la = &client->la; 1225 1092 unsigned int fifo_size = client->fifo_size; 1226 1093 u32 arb_nsec, la_ticks, value; 1227 1094 ··· 1280 1149 * request. 1281 1150 */ 1282 1151 la_ticks = arb_nsec / mc->tick; 1283 - la_ticks = min(la_ticks, la->mask); 1152 + la_ticks = min(la_ticks, client->regs.la.mask); 1284 1153 1285 - value = mc_readl(mc, la->reg); 1286 - value &= ~(la->mask << la->shift); 1287 - value |= la_ticks << la->shift; 1288 - mc_writel(mc, value, la->reg); 1154 + value = mc_readl(mc, client->regs.la.reg); 1155 + value &= ~(client->regs.la.mask << client->regs.la.shift); 1156 + value |= la_ticks << client->regs.la.shift; 1157 + mc_writel(mc, value, client->regs.la.reg); 1289 1158 } 1290 1159 1291 1160 static int tegra30_mc_icc_set(struct icc_node *src, struct icc_node *dst) ··· 1399 1268 .resets = tegra30_mc_resets, 1400 1269 .num_resets = ARRAY_SIZE(tegra30_mc_resets), 1401 1270 .icc_ops = &tegra30_mc_icc_ops, 1271 + .ops = &tegra30_mc_ops, 1402 1272 };
+14 -3
drivers/reset/Kconfig
··· 43 43 This enables the reset controller driver for BCM6345 SoCs. 44 44 45 45 config RESET_BERLIN 46 - bool "Berlin Reset Driver" if COMPILE_TEST 47 - default ARCH_BERLIN 46 + tristate "Berlin Reset Driver" 47 + depends on ARCH_BERLIN || COMPILE_TEST 48 + default m if ARCH_BERLIN 48 49 help 49 50 This enables the reset controller driver for Marvell Berlin SoCs. 50 51 ··· 60 59 config RESET_BRCMSTB_RESCAL 61 60 bool "Broadcom STB RESCAL reset controller" 62 61 depends on HAS_IOMEM 63 - default ARCH_BRCMSTB || COMPILE_TEST 62 + depends on ARCH_BRCMSTB || COMPILE_TEST 63 + default ARCH_BRCMSTB 64 64 help 65 65 This enables the RESCAL reset controller for SATA, PCIe0, or PCIe1 on 66 66 BCM7216. ··· 84 82 85 83 config RESET_INTEL_GW 86 84 bool "Intel Reset Controller Driver" 85 + depends on X86 || COMPILE_TEST 87 86 depends on OF && HAS_IOMEM 88 87 select REGMAP_MMIO 89 88 help ··· 113 110 default ARCH_LPC18XX 114 111 help 115 112 This enables the reset controller driver for NXP LPC18xx/43xx SoCs. 113 + 114 + config RESET_MCHP_SPARX5 115 + bool "Microchip Sparx5 reset driver" 116 + depends on HAS_IOMEM || COMPILE_TEST 117 + default y if SPARX5_SWITCH 118 + select MFD_SYSCON 119 + help 120 + This driver supports switch core reset for the Microchip Sparx5 SoC. 116 121 117 122 config RESET_MESON 118 123 tristate "Meson Reset Driver"
+1
drivers/reset/Makefile
··· 16 16 obj-$(CONFIG_RESET_K210) += reset-k210.o 17 17 obj-$(CONFIG_RESET_LANTIQ) += reset-lantiq.o 18 18 obj-$(CONFIG_RESET_LPC18XX) += reset-lpc18xx.o 19 + obj-$(CONFIG_RESET_MCHP_SPARX5) += reset-microchip-sparx5.o 19 20 obj-$(CONFIG_RESET_MESON) += reset-meson.o 20 21 obj-$(CONFIG_RESET_MESON_AUDIO_ARB) += reset-meson-audio-arb.o 21 22 obj-$(CONFIG_RESET_NPCM) += reset-npcm.o
+14 -11
drivers/reset/core.c
··· 84 84 * without gaps. 85 85 */ 86 86 static int of_reset_simple_xlate(struct reset_controller_dev *rcdev, 87 - const struct of_phandle_args *reset_spec) 87 + const struct of_phandle_args *reset_spec) 88 88 { 89 89 if (reset_spec->args[0] >= rcdev->nr_resets) 90 90 return -EINVAL; ··· 744 744 } 745 745 EXPORT_SYMBOL_GPL(reset_control_bulk_release); 746 746 747 - static struct reset_control *__reset_control_get_internal( 748 - struct reset_controller_dev *rcdev, 749 - unsigned int index, bool shared, bool acquired) 747 + static struct reset_control * 748 + __reset_control_get_internal(struct reset_controller_dev *rcdev, 749 + unsigned int index, bool shared, bool acquired) 750 750 { 751 751 struct reset_control *rstc; 752 752 ··· 774 774 if (!rstc) 775 775 return ERR_PTR(-ENOMEM); 776 776 777 - try_module_get(rcdev->owner); 777 + if (!try_module_get(rcdev->owner)) { 778 + kfree(rstc); 779 + return ERR_PTR(-ENODEV); 780 + } 778 781 779 782 rstc->rcdev = rcdev; 780 783 list_add(&rstc->list, &rcdev->reset_control_head); ··· 809 806 kref_put(&rstc->refcnt, __reset_control_release); 810 807 } 811 808 812 - struct reset_control *__of_reset_control_get(struct device_node *node, 813 - const char *id, int index, bool shared, 814 - bool optional, bool acquired) 809 + struct reset_control * 810 + __of_reset_control_get(struct device_node *node, const char *id, int index, 811 + bool shared, bool optional, bool acquired) 815 812 { 816 813 struct reset_control *rstc; 817 814 struct reset_controller_dev *r, *rcdev; ··· 1030 1027 reset_control_put(*(struct reset_control **)res); 1031 1028 } 1032 1029 1033 - struct reset_control *__devm_reset_control_get(struct device *dev, 1034 - const char *id, int index, bool shared, 1035 - bool optional, bool acquired) 1030 + struct reset_control * 1031 + __devm_reset_control_get(struct device *dev, const char *id, int index, 1032 + bool shared, bool optional, bool acquired) 1036 1033 { 1037 1034 struct reset_control **ptr, *rstc; 1038 1035
+1 -1
drivers/reset/hisilicon/hi6220_reset.c
··· 3 3 * Hisilicon Hi6220 reset controller driver 4 4 * 5 5 * Copyright (c) 2016 Linaro Limited. 6 - * Copyright (c) 2015-2016 Hisilicon Limited. 6 + * Copyright (c) 2015-2016 HiSilicon Limited. 7 7 * 8 8 * Author: Feng Chen <puck.chen@hisilicon.com> 9 9 */
+1
drivers/reset/reset-a10sr.c
··· 118 118 .probe = a10sr_reset_probe, 119 119 .driver = { 120 120 .name = "altr_a10sr_reset", 121 + .of_match_table = a10sr_reset_of_match, 121 122 }, 122 123 }; 123 124 module_platform_driver(a10sr_reset_driver);
+1 -1
drivers/reset/reset-bcm6345.c
··· 86 86 return !(__raw_readl(bcm6345_reset->base) & BIT(id)); 87 87 } 88 88 89 - static struct reset_control_ops bcm6345_reset_ops = { 89 + static const struct reset_control_ops bcm6345_reset_ops = { 90 90 .assert = bcm6345_reset_assert, 91 91 .deassert = bcm6345_reset_deassert, 92 92 .reset = bcm6345_reset_reset,
+9 -3
drivers/reset/reset-berlin.c
··· 14 14 #include <linux/delay.h> 15 15 #include <linux/io.h> 16 16 #include <linux/mfd/syscon.h> 17 - #include <linux/init.h> 17 + #include <linux/module.h> 18 18 #include <linux/of.h> 19 19 #include <linux/of_address.h> 20 20 #include <linux/platform_device.h> ··· 55 55 static int berlin_reset_xlate(struct reset_controller_dev *rcdev, 56 56 const struct of_phandle_args *reset_spec) 57 57 { 58 - unsigned offset, bit; 58 + unsigned int offset, bit; 59 59 60 60 offset = reset_spec->args[0]; 61 61 bit = reset_spec->args[1]; ··· 93 93 { .compatible = "marvell,berlin2-reset" }, 94 94 { }, 95 95 }; 96 + MODULE_DEVICE_TABLE(of, berlin_reset_dt_match); 96 97 97 98 static struct platform_driver berlin_reset_driver = { 98 99 .probe = berlin2_reset_probe, ··· 102 101 .of_match_table = berlin_reset_dt_match, 103 102 }, 104 103 }; 105 - builtin_platform_driver(berlin_reset_driver); 104 + module_platform_driver(berlin_reset_driver); 105 + 106 + MODULE_AUTHOR("Antoine Tenart <antoine.tenart@free-electrons.com>"); 107 + MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>"); 108 + MODULE_DESCRIPTION("Synaptics Berlin reset controller"); 109 + MODULE_LICENSE("GPL");
+1
drivers/reset/reset-brcmstb.c
··· 111 111 { .compatible = "brcm,brcmstb-reset" }, 112 112 { /* sentinel */ } 113 113 }; 114 + MODULE_DEVICE_TABLE(of, brcmstb_reset_of_match); 114 115 115 116 static struct platform_driver brcmstb_reset_driver = { 116 117 .probe = brcmstb_reset_probe,
+1 -1
drivers/reset/reset-lantiq.c
··· 186 186 priv->rcdev.of_xlate = lantiq_rcu_reset_xlate; 187 187 priv->rcdev.of_reset_n_cells = 2; 188 188 189 - return reset_controller_register(&priv->rcdev); 189 + return devm_reset_controller_register(&pdev->dev, &priv->rcdev); 190 190 } 191 191 192 192 static const struct of_device_id lantiq_rcu_reset_dt_ids[] = {
+146
drivers/reset/reset-microchip-sparx5.c
··· 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* Microchip Sparx5 Switch Reset driver 3 + * 4 + * Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries. 5 + * 6 + * The Sparx5 Chip Register Model can be browsed at this location: 7 + * https://github.com/microchip-ung/sparx-5_reginfo 8 + */ 9 + #include <linux/mfd/syscon.h> 10 + #include <linux/of_device.h> 11 + #include <linux/module.h> 12 + #include <linux/platform_device.h> 13 + #include <linux/regmap.h> 14 + #include <linux/reset-controller.h> 15 + 16 + #define PROTECT_REG 0x84 17 + #define PROTECT_BIT BIT(10) 18 + #define SOFT_RESET_REG 0x00 19 + #define SOFT_RESET_BIT BIT(1) 20 + 21 + struct mchp_reset_context { 22 + struct regmap *cpu_ctrl; 23 + struct regmap *gcb_ctrl; 24 + struct reset_controller_dev rcdev; 25 + }; 26 + 27 + static struct regmap_config sparx5_reset_regmap_config = { 28 + .reg_bits = 32, 29 + .val_bits = 32, 30 + .reg_stride = 4, 31 + }; 32 + 33 + static int sparx5_switch_reset(struct reset_controller_dev *rcdev, 34 + unsigned long id) 35 + { 36 + struct mchp_reset_context *ctx = 37 + container_of(rcdev, struct mchp_reset_context, rcdev); 38 + u32 val; 39 + 40 + /* Make sure the core is PROTECTED from reset */ 41 + regmap_update_bits(ctx->cpu_ctrl, PROTECT_REG, PROTECT_BIT, PROTECT_BIT); 42 + 43 + /* Start soft reset */ 44 + regmap_write(ctx->gcb_ctrl, SOFT_RESET_REG, SOFT_RESET_BIT); 45 + 46 + /* Wait for soft reset done */ 47 + return regmap_read_poll_timeout(ctx->gcb_ctrl, SOFT_RESET_REG, val, 48 + (val & SOFT_RESET_BIT) == 0, 49 + 1, 100); 50 + } 51 + 52 + static const struct reset_control_ops sparx5_reset_ops = { 53 + .reset = sparx5_switch_reset, 54 + }; 55 + 56 + static int mchp_sparx5_map_syscon(struct platform_device *pdev, char *name, 57 + struct regmap **target) 58 + { 59 + struct device_node *syscon_np; 60 + struct regmap *regmap; 61 + int err; 62 + 63 + syscon_np = of_parse_phandle(pdev->dev.of_node, name, 0); 64 + if (!syscon_np) 65 + return -ENODEV; 66 + regmap = syscon_node_to_regmap(syscon_np); 67 + of_node_put(syscon_np); 68 + if (IS_ERR(regmap)) { 69 + err = PTR_ERR(regmap); 70 + dev_err(&pdev->dev, "No '%s' map: %d\n", name, err); 71 + return err; 72 + } 73 + *target = regmap; 74 + return 0; 75 + } 76 + 77 + static int mchp_sparx5_map_io(struct platform_device *pdev, int index, 78 + struct regmap **target) 79 + { 80 + struct resource *res; 81 + struct regmap *map; 82 + void __iomem *mem; 83 + 84 + mem = devm_platform_get_and_ioremap_resource(pdev, index, &res); 85 + if (IS_ERR(mem)) { 86 + dev_err(&pdev->dev, "Could not map resource %d\n", index); 87 + return PTR_ERR(mem); 88 + } 89 + sparx5_reset_regmap_config.name = res->name; 90 + map = devm_regmap_init_mmio(&pdev->dev, mem, &sparx5_reset_regmap_config); 91 + if (IS_ERR(map)) 92 + return PTR_ERR(map); 93 + *target = map; 94 + return 0; 95 + } 96 + 97 + static int mchp_sparx5_reset_probe(struct platform_device *pdev) 98 + { 99 + struct device_node *dn = pdev->dev.of_node; 100 + struct mchp_reset_context *ctx; 101 + int err; 102 + 103 + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); 104 + if (!ctx) 105 + return -ENOMEM; 106 + 107 + err = mchp_sparx5_map_syscon(pdev, "cpu-syscon", &ctx->cpu_ctrl); 108 + if (err) 109 + return err; 110 + err = mchp_sparx5_map_io(pdev, 0, &ctx->gcb_ctrl); 111 + if (err) 112 + return err; 113 + 114 + ctx->rcdev.owner = THIS_MODULE; 115 + ctx->rcdev.nr_resets = 1; 116 + ctx->rcdev.ops = &sparx5_reset_ops; 117 + ctx->rcdev.of_node = dn; 118 + 119 + return devm_reset_controller_register(&pdev->dev, &ctx->rcdev); 120 + } 121 + 122 + static const struct of_device_id mchp_sparx5_reset_of_match[] = { 123 + { 124 + .compatible = "microchip,sparx5-switch-reset", 125 + }, 126 + { } 127 + }; 128 + 129 + static struct platform_driver mchp_sparx5_reset_driver = { 130 + .probe = mchp_sparx5_reset_probe, 131 + .driver = { 132 + .name = "sparx5-switch-reset", 133 + .of_match_table = mchp_sparx5_reset_of_match, 134 + }, 135 + }; 136 + 137 + static int __init mchp_sparx5_reset_init(void) 138 + { 139 + return platform_driver_register(&mchp_sparx5_reset_driver); 140 + } 141 + 142 + postcore_initcall(mchp_sparx5_reset_init); 143 + 144 + MODULE_DESCRIPTION("Microchip Sparx5 switch reset driver"); 145 + MODULE_AUTHOR("Steen Hegelund <steen.hegelund@microchip.com>"); 146 + MODULE_LICENSE("Dual MIT/GPL");
+1 -1
drivers/reset/reset-oxnas.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 - * drivers/reset/reset-oxnas.c 3 + * Oxford Semiconductor Reset Controller driver 4 4 * 5 5 * Copyright (C) 2016 Neil Armstrong <narmstrong@baylibre.com> 6 6 * Copyright (C) 2014 Ma Haijun <mahaijuns@gmail.com>
+2 -2
drivers/reset/reset-ti-syscon.c
··· 58 58 unsigned int nr_controls; 59 59 }; 60 60 61 - #define to_ti_syscon_reset_data(rcdev) \ 62 - container_of(rcdev, struct ti_syscon_reset_data, rcdev) 61 + #define to_ti_syscon_reset_data(_rcdev) \ 62 + container_of(_rcdev, struct ti_syscon_reset_data, rcdev) 63 63 64 64 /** 65 65 * ti_syscon_reset_assert() - assert device reset
+1 -1
drivers/reset/reset-uniphier.c
··· 20 20 #define UNIPHIER_RESET_ACTIVE_LOW BIT(0) 21 21 }; 22 22 23 - #define UNIPHIER_RESET_ID_END (unsigned int)(-1) 23 + #define UNIPHIER_RESET_ID_END ((unsigned int)(-1)) 24 24 25 25 #define UNIPHIER_RESET_END \ 26 26 { .id = UNIPHIER_RESET_ID_END }
+2 -2
drivers/reset/reset-zynqmp.c
··· 83 83 }; 84 84 85 85 static const struct zynqmp_reset_soc_data versal_reset_data = { 86 - .reset_id = 0, 87 - .num_resets = VERSAL_NR_RESETS, 86 + .reset_id = 0, 87 + .num_resets = VERSAL_NR_RESETS, 88 88 }; 89 89 90 90 static const struct reset_control_ops zynqmp_reset_ops = {
+1 -1
drivers/reset/sti/reset-syscfg.c
··· 153 153 if (!rc->channels) 154 154 return -ENOMEM; 155 155 156 - rc->rst.ops = &syscfg_reset_ops, 156 + rc->rst.ops = &syscfg_reset_ops; 157 157 rc->rst.of_node = dev->of_node; 158 158 rc->rst.nr_resets = data->nr_channels; 159 159 rc->active_low = data->active_low;
+23 -23
drivers/soc/amlogic/meson-ee-pwrc.c
··· 68 68 struct meson_ee_pwrc_top_domain *top_pd; 69 69 unsigned int mem_pd_count; 70 70 struct meson_ee_pwrc_mem_domain *mem_pd; 71 - bool (*get_power)(struct meson_ee_pwrc_domain *pwrc_domain); 71 + bool (*is_powered_off)(struct meson_ee_pwrc_domain *pwrc_domain); 72 72 }; 73 73 74 74 struct meson_ee_pwrc_domain_data { ··· 217 217 { HHI_AUDIO_MEM_PD_REG0, GENMASK(27, 26) }, 218 218 }; 219 219 220 - #define VPU_PD(__name, __top_pd, __mem, __get_power, __resets, __clks) \ 220 + #define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks) \ 221 221 { \ 222 222 .name = __name, \ 223 223 .reset_names_count = __resets, \ ··· 225 225 .top_pd = __top_pd, \ 226 226 .mem_pd_count = ARRAY_SIZE(__mem), \ 227 227 .mem_pd = __mem, \ 228 - .get_power = __get_power, \ 228 + .is_powered_off = __is_pwr_off, \ 229 229 } 230 230 231 - #define TOP_PD(__name, __top_pd, __mem, __get_power) \ 231 + #define TOP_PD(__name, __top_pd, __mem, __is_pwr_off) \ 232 232 { \ 233 233 .name = __name, \ 234 234 .top_pd = __top_pd, \ 235 235 .mem_pd_count = ARRAY_SIZE(__mem), \ 236 236 .mem_pd = __mem, \ 237 - .get_power = __get_power, \ 237 + .is_powered_off = __is_pwr_off, \ 238 238 } 239 239 240 240 #define MEM_PD(__name, __mem) \ 241 241 TOP_PD(__name, NULL, __mem, NULL) 242 242 243 - static bool pwrc_ee_get_power(struct meson_ee_pwrc_domain *pwrc_domain); 243 + static bool pwrc_ee_is_powered_off(struct meson_ee_pwrc_domain *pwrc_domain); 244 244 245 245 static struct meson_ee_pwrc_domain_desc axg_pwrc_domains[] = { 246 246 [PWRC_AXG_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, axg_pwrc_mem_vpu, 247 - pwrc_ee_get_power, 5, 2), 247 + pwrc_ee_is_powered_off, 5, 2), 248 248 [PWRC_AXG_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth), 249 249 [PWRC_AXG_AUDIO_ID] = MEM_PD("AUDIO", axg_pwrc_mem_audio), 250 250 }; 251 251 252 252 static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = { 253 253 [PWRC_G12A_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, g12a_pwrc_mem_vpu, 254 - pwrc_ee_get_power, 11, 2), 254 + pwrc_ee_is_powered_off, 11, 2), 255 255 [PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth), 256 256 }; 257 257 258 258 static struct meson_ee_pwrc_domain_desc gxbb_pwrc_domains[] = { 259 259 [PWRC_GXBB_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, gxbb_pwrc_mem_vpu, 260 - pwrc_ee_get_power, 12, 2), 260 + pwrc_ee_is_powered_off, 12, 2), 261 261 [PWRC_GXBB_ETHERNET_MEM_ID] = MEM_PD("ETH", meson_pwrc_mem_eth), 262 262 }; 263 263 264 264 static struct meson_ee_pwrc_domain_desc meson8_pwrc_domains[] = { 265 265 [PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu, 266 - meson8_pwrc_mem_vpu, pwrc_ee_get_power, 267 - 0, 1), 266 + meson8_pwrc_mem_vpu, 267 + pwrc_ee_is_powered_off, 0, 1), 268 268 [PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM", 269 269 meson_pwrc_mem_eth), 270 270 [PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM", ··· 273 273 274 274 static struct meson_ee_pwrc_domain_desc meson8b_pwrc_domains[] = { 275 275 [PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu, 276 - meson8_pwrc_mem_vpu, pwrc_ee_get_power, 277 - 11, 1), 276 + meson8_pwrc_mem_vpu, 277 + pwrc_ee_is_powered_off, 11, 1), 278 278 [PWRC_MESON8_ETHERNET_MEM_ID] = MEM_PD("ETHERNET_MEM", 279 279 meson_pwrc_mem_eth), 280 280 [PWRC_MESON8_AUDIO_DSP_MEM_ID] = MEM_PD("AUDIO_DSP_MEM", ··· 283 283 284 284 static struct meson_ee_pwrc_domain_desc sm1_pwrc_domains[] = { 285 285 [PWRC_SM1_VPU_ID] = VPU_PD("VPU", &sm1_pwrc_vpu, sm1_pwrc_mem_vpu, 286 - pwrc_ee_get_power, 11, 2), 286 + pwrc_ee_is_powered_off, 11, 2), 287 287 [PWRC_SM1_NNA_ID] = TOP_PD("NNA", &sm1_pwrc_nna, sm1_pwrc_mem_nna, 288 - pwrc_ee_get_power), 288 + pwrc_ee_is_powered_off), 289 289 [PWRC_SM1_USB_ID] = TOP_PD("USB", &sm1_pwrc_usb, sm1_pwrc_mem_usb, 290 - pwrc_ee_get_power), 290 + pwrc_ee_is_powered_off), 291 291 [PWRC_SM1_PCIE_ID] = TOP_PD("PCI", &sm1_pwrc_pci, sm1_pwrc_mem_pcie, 292 - pwrc_ee_get_power), 292 + pwrc_ee_is_powered_off), 293 293 [PWRC_SM1_GE2D_ID] = TOP_PD("GE2D", &sm1_pwrc_ge2d, sm1_pwrc_mem_ge2d, 294 - pwrc_ee_get_power), 294 + pwrc_ee_is_powered_off), 295 295 [PWRC_SM1_AUDIO_ID] = MEM_PD("AUDIO", sm1_pwrc_mem_audio), 296 296 [PWRC_SM1_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth), 297 297 }; ··· 314 314 struct genpd_onecell_data xlate; 315 315 }; 316 316 317 - static bool pwrc_ee_get_power(struct meson_ee_pwrc_domain *pwrc_domain) 317 + static bool pwrc_ee_is_powered_off(struct meson_ee_pwrc_domain *pwrc_domain) 318 318 { 319 319 u32 reg; 320 320 ··· 445 445 * we need to power the domain off, otherwise the internal clocks 446 446 * prepare/enable counters won't be in sync. 447 447 */ 448 - if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) { 448 + if (dom->num_clks && dom->desc.is_powered_off && !dom->desc.is_powered_off(dom)) { 449 449 ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks); 450 450 if (ret) 451 451 return ret; ··· 456 456 return ret; 457 457 } else { 458 458 ret = pm_genpd_init(&dom->base, NULL, 459 - (dom->desc.get_power ? 460 - dom->desc.get_power(dom) : true)); 459 + (dom->desc.is_powered_off ? 460 + dom->desc.is_powered_off(dom) : true)); 461 461 if (ret) 462 462 return ret; 463 463 } ··· 536 536 for (i = 0 ; i < pwrc->xlate.num_domains ; ++i) { 537 537 struct meson_ee_pwrc_domain *dom = &pwrc->domains[i]; 538 538 539 - if (dom->desc.get_power && !dom->desc.get_power(dom)) 539 + if (dom->desc.is_powered_off && !dom->desc.is_powered_off(dom)) 540 540 meson_ee_pwrc_off(&dom->base); 541 541 } 542 542 }
-5
drivers/soc/bcm/brcmstb/common.c
··· 14 14 static u32 family_id; 15 15 static u32 product_id; 16 16 17 - static const struct of_device_id brcmstb_machine_match[] = { 18 - { .compatible = "brcm,brcmstb", }, 19 - { } 20 - }; 21 - 22 17 u32 brcmstb_get_family_id(void) 23 18 { 24 19 return family_id;
+517 -113
drivers/soc/imx/gpcv2.c
··· 12 12 #include <linux/of_device.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/pm_domain.h> 15 + #include <linux/pm_runtime.h> 15 16 #include <linux/regmap.h> 16 17 #include <linux/regulator/consumer.h> 18 + #include <linux/reset.h> 17 19 #include <linux/sizes.h> 18 20 #include <dt-bindings/power/imx7-power.h> 19 21 #include <dt-bindings/power/imx8mq-power.h> 22 + #include <dt-bindings/power/imx8mm-power.h> 23 + #include <dt-bindings/power/imx8mn-power.h> 20 24 21 25 #define GPC_LPCR_A_CORE_BSC 0x000 22 26 ··· 46 42 #define IMX8M_PCIE1_A53_DOMAIN BIT(3) 47 43 #define IMX8M_MIPI_A53_DOMAIN BIT(2) 48 44 45 + #define IMX8MM_VPUH1_A53_DOMAIN BIT(15) 46 + #define IMX8MM_VPUG2_A53_DOMAIN BIT(14) 47 + #define IMX8MM_VPUG1_A53_DOMAIN BIT(13) 48 + #define IMX8MM_DISPMIX_A53_DOMAIN BIT(12) 49 + #define IMX8MM_VPUMIX_A53_DOMAIN BIT(10) 50 + #define IMX8MM_GPUMIX_A53_DOMAIN BIT(9) 51 + #define IMX8MM_GPU_A53_DOMAIN (BIT(8) | BIT(11)) 52 + #define IMX8MM_DDR1_A53_DOMAIN BIT(7) 53 + #define IMX8MM_OTG2_A53_DOMAIN BIT(5) 54 + #define IMX8MM_OTG1_A53_DOMAIN BIT(4) 55 + #define IMX8MM_PCIE_A53_DOMAIN BIT(3) 56 + #define IMX8MM_MIPI_A53_DOMAIN BIT(2) 57 + 58 + #define IMX8MN_DISPMIX_A53_DOMAIN BIT(12) 59 + #define IMX8MN_GPUMIX_A53_DOMAIN BIT(9) 60 + #define IMX8MN_DDR1_A53_DOMAIN BIT(7) 61 + #define IMX8MN_OTG1_A53_DOMAIN BIT(4) 62 + #define IMX8MN_MIPI_A53_DOMAIN BIT(2) 63 + 49 64 #define GPC_PU_PGC_SW_PUP_REQ 0x0f8 50 65 #define GPC_PU_PGC_SW_PDN_REQ 0x104 51 66 ··· 88 65 #define IMX8M_PCIE1_SW_Pxx_REQ BIT(1) 89 66 #define IMX8M_MIPI_SW_Pxx_REQ BIT(0) 90 67 68 + #define IMX8MM_VPUH1_SW_Pxx_REQ BIT(13) 69 + #define IMX8MM_VPUG2_SW_Pxx_REQ BIT(12) 70 + #define IMX8MM_VPUG1_SW_Pxx_REQ BIT(11) 71 + #define IMX8MM_DISPMIX_SW_Pxx_REQ BIT(10) 72 + #define IMX8MM_VPUMIX_SW_Pxx_REQ BIT(8) 73 + #define IMX8MM_GPUMIX_SW_Pxx_REQ BIT(7) 74 + #define IMX8MM_GPU_SW_Pxx_REQ (BIT(6) | BIT(9)) 75 + #define IMX8MM_DDR1_SW_Pxx_REQ BIT(5) 76 + #define IMX8MM_OTG2_SW_Pxx_REQ BIT(3) 77 + #define IMX8MM_OTG1_SW_Pxx_REQ BIT(2) 78 + #define IMX8MM_PCIE_SW_Pxx_REQ BIT(1) 79 + #define IMX8MM_MIPI_SW_Pxx_REQ BIT(0) 80 + 81 + #define IMX8MN_DISPMIX_SW_Pxx_REQ BIT(10) 82 + #define IMX8MN_GPUMIX_SW_Pxx_REQ BIT(7) 83 + #define IMX8MN_DDR1_SW_Pxx_REQ BIT(5) 84 + #define IMX8MN_OTG1_SW_Pxx_REQ BIT(2) 85 + #define IMX8MN_MIPI_SW_Pxx_REQ BIT(0) 86 + 91 87 #define GPC_M4_PU_PDN_FLG 0x1bc 92 88 93 89 #define GPC_PU_PWRHSK 0x1fc 94 90 91 + #define IMX8M_GPU_HSK_PWRDNACKN BIT(26) 92 + #define IMX8M_VPU_HSK_PWRDNACKN BIT(25) 93 + #define IMX8M_DISP_HSK_PWRDNACKN BIT(24) 95 94 #define IMX8M_GPU_HSK_PWRDNREQN BIT(6) 96 95 #define IMX8M_VPU_HSK_PWRDNREQN BIT(5) 97 96 #define IMX8M_DISP_HSK_PWRDNREQN BIT(4) 97 + 98 + 99 + #define IMX8MM_GPUMIX_HSK_PWRDNACKN BIT(29) 100 + #define IMX8MM_GPU_HSK_PWRDNACKN (BIT(27) | BIT(28)) 101 + #define IMX8MM_VPUMIX_HSK_PWRDNACKN BIT(26) 102 + #define IMX8MM_DISPMIX_HSK_PWRDNACKN BIT(25) 103 + #define IMX8MM_HSIO_HSK_PWRDNACKN (BIT(23) | BIT(24)) 104 + #define IMX8MM_GPUMIX_HSK_PWRDNREQN BIT(11) 105 + #define IMX8MM_GPU_HSK_PWRDNREQN (BIT(9) | BIT(10)) 106 + #define IMX8MM_VPUMIX_HSK_PWRDNREQN BIT(8) 107 + #define IMX8MM_DISPMIX_HSK_PWRDNREQN BIT(7) 108 + #define IMX8MM_HSIO_HSK_PWRDNREQN (BIT(5) | BIT(6)) 109 + 110 + #define IMX8MN_GPUMIX_HSK_PWRDNACKN (BIT(29) | BIT(27)) 111 + #define IMX8MN_DISPMIX_HSK_PWRDNACKN BIT(25) 112 + #define IMX8MN_HSIO_HSK_PWRDNACKN BIT(23) 113 + #define IMX8MN_GPUMIX_HSK_PWRDNREQN (BIT(11) | BIT(9)) 114 + #define IMX8MN_DISPMIX_HSK_PWRDNREQN BIT(7) 115 + #define IMX8MN_HSIO_HSK_PWRDNREQN BIT(5) 98 116 99 117 /* 100 118 * The PGC offset values in Reference Manual ··· 159 95 #define IMX8M_PGC_MIPI_CSI2 28 160 96 #define IMX8M_PGC_PCIE2 29 161 97 98 + #define IMX8MM_PGC_MIPI 16 99 + #define IMX8MM_PGC_PCIE 17 100 + #define IMX8MM_PGC_OTG1 18 101 + #define IMX8MM_PGC_OTG2 19 102 + #define IMX8MM_PGC_DDR1 21 103 + #define IMX8MM_PGC_GPU2D 22 104 + #define IMX8MM_PGC_GPUMIX 23 105 + #define IMX8MM_PGC_VPUMIX 24 106 + #define IMX8MM_PGC_GPU3D 25 107 + #define IMX8MM_PGC_DISPMIX 26 108 + #define IMX8MM_PGC_VPUG1 27 109 + #define IMX8MM_PGC_VPUG2 28 110 + #define IMX8MM_PGC_VPUH1 29 111 + 112 + #define IMX8MN_PGC_MIPI 16 113 + #define IMX8MN_PGC_OTG1 18 114 + #define IMX8MN_PGC_DDR1 21 115 + #define IMX8MN_PGC_GPUMIX 23 116 + #define IMX8MN_PGC_DISPMIX 26 117 + 162 118 #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40) 163 119 #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc) 164 120 165 121 #define GPC_PGC_CTRL_PCR BIT(0) 166 122 167 - #define GPC_CLK_MAX 6 168 - 169 123 struct imx_pgc_domain { 170 124 struct generic_pm_domain genpd; 171 125 struct regmap *regmap; 172 126 struct regulator *regulator; 173 - struct clk *clk[GPC_CLK_MAX]; 127 + struct reset_control *reset; 128 + struct clk_bulk_data *clks; 174 129 int num_clks; 175 130 176 131 unsigned int pgc; ··· 197 114 const struct { 198 115 u32 pxx; 199 116 u32 map; 200 - u32 hsk; 117 + u32 hskreq; 118 + u32 hskack; 201 119 } bits; 202 120 203 121 const int voltage; ··· 211 127 const struct regmap_access_table *reg_access_table; 212 128 }; 213 129 214 - static int imx_gpc_pu_pgc_sw_pxx_req(struct generic_pm_domain *genpd, 215 - bool on) 130 + static inline struct imx_pgc_domain * 131 + to_imx_pgc_domain(struct generic_pm_domain *genpd) 216 132 { 217 - struct imx_pgc_domain *domain = container_of(genpd, 218 - struct imx_pgc_domain, 219 - genpd); 220 - unsigned int offset = on ? 221 - GPC_PU_PGC_SW_PUP_REQ : GPC_PU_PGC_SW_PDN_REQ; 222 - const bool enable_power_control = !on; 223 - const bool has_regulator = !IS_ERR(domain->regulator); 224 - int i, ret = 0; 225 - u32 pxx_req; 133 + return container_of(genpd, struct imx_pgc_domain, genpd); 134 + } 226 135 227 - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, 228 - domain->bits.map, domain->bits.map); 136 + static int imx_pgc_power_up(struct generic_pm_domain *genpd) 137 + { 138 + struct imx_pgc_domain *domain = to_imx_pgc_domain(genpd); 139 + u32 reg_val; 140 + int ret; 229 141 230 - if (has_regulator && on) { 142 + ret = pm_runtime_get_sync(domain->dev); 143 + if (ret < 0) { 144 + pm_runtime_put_noidle(domain->dev); 145 + return ret; 146 + } 147 + 148 + if (!IS_ERR(domain->regulator)) { 231 149 ret = regulator_enable(domain->regulator); 232 150 if (ret) { 233 151 dev_err(domain->dev, "failed to enable regulator\n"); 234 - goto unmap; 152 + goto out_put_pm; 235 153 } 236 154 } 237 155 238 156 /* Enable reset clocks for all devices in the domain */ 239 - for (i = 0; i < domain->num_clks; i++) 240 - clk_prepare_enable(domain->clk[i]); 241 - 242 - if (enable_power_control) 243 - regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), 244 - GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR); 245 - 246 - if (domain->bits.hsk) 247 - regmap_update_bits(domain->regmap, GPC_PU_PWRHSK, 248 - domain->bits.hsk, on ? domain->bits.hsk : 0); 249 - 250 - regmap_update_bits(domain->regmap, offset, 251 - domain->bits.pxx, domain->bits.pxx); 252 - 253 - /* 254 - * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait 255 - * for PUP_REQ/PDN_REQ bit to be cleared 256 - */ 257 - ret = regmap_read_poll_timeout(domain->regmap, offset, pxx_req, 258 - !(pxx_req & domain->bits.pxx), 259 - 0, USEC_PER_MSEC); 157 + ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); 260 158 if (ret) { 261 - dev_err(domain->dev, "failed to command PGC\n"); 262 - /* 263 - * If we were in a process of enabling a 264 - * domain and failed we might as well disable 265 - * the regulator we just enabled. And if it 266 - * was the opposite situation and we failed to 267 - * power down -- keep the regulator on 268 - */ 269 - on = !on; 159 + dev_err(domain->dev, "failed to enable reset clocks\n"); 160 + goto out_regulator_disable; 270 161 } 271 162 272 - if (enable_power_control) 273 - regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), 274 - GPC_PGC_CTRL_PCR, 0); 163 + if (domain->bits.pxx) { 164 + /* request the domain to power up */ 165 + regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PUP_REQ, 166 + domain->bits.pxx, domain->bits.pxx); 167 + /* 168 + * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait 169 + * for PUP_REQ/PDN_REQ bit to be cleared 170 + */ 171 + ret = regmap_read_poll_timeout(domain->regmap, 172 + GPC_PU_PGC_SW_PUP_REQ, reg_val, 173 + !(reg_val & domain->bits.pxx), 174 + 0, USEC_PER_MSEC); 175 + if (ret) { 176 + dev_err(domain->dev, "failed to command PGC\n"); 177 + goto out_clk_disable; 178 + } 179 + 180 + /* disable power control */ 181 + regmap_clear_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), 182 + GPC_PGC_CTRL_PCR); 183 + } 184 + 185 + reset_control_assert(domain->reset); 186 + 187 + /* delay for reset to propagate */ 188 + udelay(5); 189 + 190 + reset_control_deassert(domain->reset); 191 + 192 + /* request the ADB400 to power up */ 193 + if (domain->bits.hskreq) { 194 + regmap_update_bits(domain->regmap, GPC_PU_PWRHSK, 195 + domain->bits.hskreq, domain->bits.hskreq); 196 + 197 + /* 198 + * ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PWRHSK, reg_val, 199 + * (reg_val & domain->bits.hskack), 0, 200 + * USEC_PER_MSEC); 201 + * Technically we need the commented code to wait handshake. But that needs 202 + * the BLK-CTL module BUS clk-en bit being set. 203 + * 204 + * There is a separate BLK-CTL module and we will have such a driver for it, 205 + * that driver will set the BUS clk-en bit and handshake will be triggered 206 + * automatically there. Just add a delay and suppose the handshake finish 207 + * after that. 208 + */ 209 + } 275 210 276 211 /* Disable reset clocks for all devices in the domain */ 277 - for (i = 0; i < domain->num_clks; i++) 278 - clk_disable_unprepare(domain->clk[i]); 212 + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); 279 213 280 - if (has_regulator && !on) { 281 - int err; 214 + return 0; 282 215 283 - err = regulator_disable(domain->regulator); 284 - if (err) 285 - dev_err(domain->dev, 286 - "failed to disable regulator: %d\n", err); 287 - /* Preserve earlier error code */ 288 - ret = ret ?: err; 289 - } 290 - unmap: 291 - regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, 292 - domain->bits.map, 0); 216 + out_clk_disable: 217 + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); 218 + out_regulator_disable: 219 + if (!IS_ERR(domain->regulator)) 220 + regulator_disable(domain->regulator); 221 + out_put_pm: 222 + pm_runtime_put(domain->dev); 223 + 293 224 return ret; 294 225 } 295 226 296 - static int imx_gpc_pu_pgc_sw_pup_req(struct generic_pm_domain *genpd) 227 + static int imx_pgc_power_down(struct generic_pm_domain *genpd) 297 228 { 298 - return imx_gpc_pu_pgc_sw_pxx_req(genpd, true); 299 - } 229 + struct imx_pgc_domain *domain = to_imx_pgc_domain(genpd); 230 + u32 reg_val; 231 + int ret; 300 232 301 - static int imx_gpc_pu_pgc_sw_pdn_req(struct generic_pm_domain *genpd) 302 - { 303 - return imx_gpc_pu_pgc_sw_pxx_req(genpd, false); 233 + /* Enable reset clocks for all devices in the domain */ 234 + ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks); 235 + if (ret) { 236 + dev_err(domain->dev, "failed to enable reset clocks\n"); 237 + return ret; 238 + } 239 + 240 + /* request the ADB400 to power down */ 241 + if (domain->bits.hskreq) { 242 + regmap_clear_bits(domain->regmap, GPC_PU_PWRHSK, 243 + domain->bits.hskreq); 244 + 245 + ret = regmap_read_poll_timeout(domain->regmap, GPC_PU_PWRHSK, 246 + reg_val, 247 + !(reg_val & domain->bits.hskack), 248 + 0, USEC_PER_MSEC); 249 + if (ret) { 250 + dev_err(domain->dev, "failed to power down ADB400\n"); 251 + goto out_clk_disable; 252 + } 253 + } 254 + 255 + if (domain->bits.pxx) { 256 + /* enable power control */ 257 + regmap_update_bits(domain->regmap, GPC_PGC_CTRL(domain->pgc), 258 + GPC_PGC_CTRL_PCR, GPC_PGC_CTRL_PCR); 259 + 260 + /* request the domain to power down */ 261 + regmap_update_bits(domain->regmap, GPC_PU_PGC_SW_PDN_REQ, 262 + domain->bits.pxx, domain->bits.pxx); 263 + /* 264 + * As per "5.5.9.4 Example Code 4" in IMX7DRM.pdf wait 265 + * for PUP_REQ/PDN_REQ bit to be cleared 266 + */ 267 + ret = regmap_read_poll_timeout(domain->regmap, 268 + GPC_PU_PGC_SW_PDN_REQ, reg_val, 269 + !(reg_val & domain->bits.pxx), 270 + 0, USEC_PER_MSEC); 271 + if (ret) { 272 + dev_err(domain->dev, "failed to command PGC\n"); 273 + goto out_clk_disable; 274 + } 275 + } 276 + 277 + /* Disable reset clocks for all devices in the domain */ 278 + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); 279 + 280 + if (!IS_ERR(domain->regulator)) { 281 + ret = regulator_disable(domain->regulator); 282 + if (ret) { 283 + dev_err(domain->dev, "failed to disable regulator\n"); 284 + return ret; 285 + } 286 + } 287 + 288 + pm_runtime_put(domain->dev); 289 + 290 + return 0; 291 + 292 + out_clk_disable: 293 + clk_bulk_disable_unprepare(domain->num_clks, domain->clks); 294 + 295 + return ret; 304 296 } 305 297 306 298 static const struct imx_pgc_domain imx7_pgc_domains[] = { ··· 502 342 .bits = { 503 343 .pxx = IMX8M_GPU_SW_Pxx_REQ, 504 344 .map = IMX8M_GPU_A53_DOMAIN, 505 - .hsk = IMX8M_GPU_HSK_PWRDNREQN, 345 + .hskreq = IMX8M_GPU_HSK_PWRDNREQN, 346 + .hskack = IMX8M_GPU_HSK_PWRDNACKN, 506 347 }, 507 348 .pgc = IMX8M_PGC_GPU, 508 349 }, ··· 515 354 .bits = { 516 355 .pxx = IMX8M_VPU_SW_Pxx_REQ, 517 356 .map = IMX8M_VPU_A53_DOMAIN, 518 - .hsk = IMX8M_VPU_HSK_PWRDNREQN, 357 + .hskreq = IMX8M_VPU_HSK_PWRDNREQN, 358 + .hskack = IMX8M_VPU_HSK_PWRDNACKN, 519 359 }, 520 360 .pgc = IMX8M_PGC_VPU, 521 361 }, ··· 528 366 .bits = { 529 367 .pxx = IMX8M_DISP_SW_Pxx_REQ, 530 368 .map = IMX8M_DISP_A53_DOMAIN, 531 - .hsk = IMX8M_DISP_HSK_PWRDNREQN, 369 + .hskreq = IMX8M_DISP_HSK_PWRDNREQN, 370 + .hskack = IMX8M_DISP_HSK_PWRDNACKN, 532 371 }, 533 372 .pgc = IMX8M_PGC_DISP, 534 373 }, ··· 606 443 .reg_access_table = &imx8m_access_table, 607 444 }; 608 445 609 - static int imx_pgc_get_clocks(struct imx_pgc_domain *domain) 610 - { 611 - int i, ret; 446 + static const struct imx_pgc_domain imx8mm_pgc_domains[] = { 447 + [IMX8MM_POWER_DOMAIN_HSIOMIX] = { 448 + .genpd = { 449 + .name = "hsiomix", 450 + }, 451 + .bits = { 452 + .pxx = 0, /* no power sequence control */ 453 + .map = 0, /* no power sequence control */ 454 + .hskreq = IMX8MM_HSIO_HSK_PWRDNREQN, 455 + .hskack = IMX8MM_HSIO_HSK_PWRDNACKN, 456 + }, 457 + }, 612 458 613 - for (i = 0; ; i++) { 614 - struct clk *clk = of_clk_get(domain->dev->of_node, i); 615 - if (IS_ERR(clk)) 616 - break; 617 - if (i >= GPC_CLK_MAX) { 618 - dev_err(domain->dev, "more than %d clocks\n", 619 - GPC_CLK_MAX); 620 - ret = -EINVAL; 621 - goto clk_err; 622 - } 623 - domain->clk[i] = clk; 624 - } 625 - domain->num_clks = i; 459 + [IMX8MM_POWER_DOMAIN_PCIE] = { 460 + .genpd = { 461 + .name = "pcie", 462 + }, 463 + .bits = { 464 + .pxx = IMX8MM_PCIE_SW_Pxx_REQ, 465 + .map = IMX8MM_PCIE_A53_DOMAIN, 466 + }, 467 + .pgc = IMX8MM_PGC_PCIE, 468 + }, 626 469 627 - return 0; 470 + [IMX8MM_POWER_DOMAIN_OTG1] = { 471 + .genpd = { 472 + .name = "usb-otg1", 473 + }, 474 + .bits = { 475 + .pxx = IMX8MM_OTG1_SW_Pxx_REQ, 476 + .map = IMX8MM_OTG1_A53_DOMAIN, 477 + }, 478 + .pgc = IMX8MM_PGC_OTG1, 479 + }, 628 480 629 - clk_err: 630 - while (i--) 631 - clk_put(domain->clk[i]); 481 + [IMX8MM_POWER_DOMAIN_OTG2] = { 482 + .genpd = { 483 + .name = "usb-otg2", 484 + }, 485 + .bits = { 486 + .pxx = IMX8MM_OTG2_SW_Pxx_REQ, 487 + .map = IMX8MM_OTG2_A53_DOMAIN, 488 + }, 489 + .pgc = IMX8MM_PGC_OTG2, 490 + }, 632 491 633 - return ret; 634 - } 492 + [IMX8MM_POWER_DOMAIN_GPUMIX] = { 493 + .genpd = { 494 + .name = "gpumix", 495 + }, 496 + .bits = { 497 + .pxx = IMX8MM_GPUMIX_SW_Pxx_REQ, 498 + .map = IMX8MM_GPUMIX_A53_DOMAIN, 499 + .hskreq = IMX8MM_GPUMIX_HSK_PWRDNREQN, 500 + .hskack = IMX8MM_GPUMIX_HSK_PWRDNACKN, 501 + }, 502 + .pgc = IMX8MM_PGC_GPUMIX, 503 + }, 635 504 636 - static void imx_pgc_put_clocks(struct imx_pgc_domain *domain) 637 - { 638 - int i; 505 + [IMX8MM_POWER_DOMAIN_GPU] = { 506 + .genpd = { 507 + .name = "gpu", 508 + }, 509 + .bits = { 510 + .pxx = IMX8MM_GPU_SW_Pxx_REQ, 511 + .map = IMX8MM_GPU_A53_DOMAIN, 512 + .hskreq = IMX8MM_GPU_HSK_PWRDNREQN, 513 + .hskack = IMX8MM_GPU_HSK_PWRDNACKN, 514 + }, 515 + .pgc = IMX8MM_PGC_GPU2D, 516 + }, 639 517 640 - for (i = domain->num_clks - 1; i >= 0; i--) 641 - clk_put(domain->clk[i]); 642 - } 518 + [IMX8MM_POWER_DOMAIN_VPUMIX] = { 519 + .genpd = { 520 + .name = "vpumix", 521 + }, 522 + .bits = { 523 + .pxx = IMX8MM_VPUMIX_SW_Pxx_REQ, 524 + .map = IMX8MM_VPUMIX_A53_DOMAIN, 525 + .hskreq = IMX8MM_VPUMIX_HSK_PWRDNREQN, 526 + .hskack = IMX8MM_VPUMIX_HSK_PWRDNACKN, 527 + }, 528 + .pgc = IMX8MM_PGC_VPUMIX, 529 + }, 530 + 531 + [IMX8MM_POWER_DOMAIN_VPUG1] = { 532 + .genpd = { 533 + .name = "vpu-g1", 534 + }, 535 + .bits = { 536 + .pxx = IMX8MM_VPUG1_SW_Pxx_REQ, 537 + .map = IMX8MM_VPUG1_A53_DOMAIN, 538 + }, 539 + .pgc = IMX8MM_PGC_VPUG1, 540 + }, 541 + 542 + [IMX8MM_POWER_DOMAIN_VPUG2] = { 543 + .genpd = { 544 + .name = "vpu-g2", 545 + }, 546 + .bits = { 547 + .pxx = IMX8MM_VPUG2_SW_Pxx_REQ, 548 + .map = IMX8MM_VPUG2_A53_DOMAIN, 549 + }, 550 + .pgc = IMX8MM_PGC_VPUG2, 551 + }, 552 + 553 + [IMX8MM_POWER_DOMAIN_VPUH1] = { 554 + .genpd = { 555 + .name = "vpu-h1", 556 + }, 557 + .bits = { 558 + .pxx = IMX8MM_VPUH1_SW_Pxx_REQ, 559 + .map = IMX8MM_VPUH1_A53_DOMAIN, 560 + }, 561 + .pgc = IMX8MM_PGC_VPUH1, 562 + }, 563 + 564 + [IMX8MM_POWER_DOMAIN_DISPMIX] = { 565 + .genpd = { 566 + .name = "dispmix", 567 + }, 568 + .bits = { 569 + .pxx = IMX8MM_DISPMIX_SW_Pxx_REQ, 570 + .map = IMX8MM_DISPMIX_A53_DOMAIN, 571 + .hskreq = IMX8MM_DISPMIX_HSK_PWRDNREQN, 572 + .hskack = IMX8MM_DISPMIX_HSK_PWRDNACKN, 573 + }, 574 + .pgc = IMX8MM_PGC_DISPMIX, 575 + }, 576 + 577 + [IMX8MM_POWER_DOMAIN_MIPI] = { 578 + .genpd = { 579 + .name = "mipi", 580 + }, 581 + .bits = { 582 + .pxx = IMX8MM_MIPI_SW_Pxx_REQ, 583 + .map = IMX8MM_MIPI_A53_DOMAIN, 584 + }, 585 + .pgc = IMX8MM_PGC_MIPI, 586 + }, 587 + }; 588 + 589 + static const struct regmap_range imx8mm_yes_ranges[] = { 590 + regmap_reg_range(GPC_LPCR_A_CORE_BSC, 591 + GPC_PU_PWRHSK), 592 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_MIPI), 593 + GPC_PGC_SR(IMX8MM_PGC_MIPI)), 594 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_PCIE), 595 + GPC_PGC_SR(IMX8MM_PGC_PCIE)), 596 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_OTG1), 597 + GPC_PGC_SR(IMX8MM_PGC_OTG1)), 598 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_OTG2), 599 + GPC_PGC_SR(IMX8MM_PGC_OTG2)), 600 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_DDR1), 601 + GPC_PGC_SR(IMX8MM_PGC_DDR1)), 602 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_GPU2D), 603 + GPC_PGC_SR(IMX8MM_PGC_GPU2D)), 604 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_GPUMIX), 605 + GPC_PGC_SR(IMX8MM_PGC_GPUMIX)), 606 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUMIX), 607 + GPC_PGC_SR(IMX8MM_PGC_VPUMIX)), 608 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_GPU3D), 609 + GPC_PGC_SR(IMX8MM_PGC_GPU3D)), 610 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_DISPMIX), 611 + GPC_PGC_SR(IMX8MM_PGC_DISPMIX)), 612 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUG1), 613 + GPC_PGC_SR(IMX8MM_PGC_VPUG1)), 614 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUG2), 615 + GPC_PGC_SR(IMX8MM_PGC_VPUG2)), 616 + regmap_reg_range(GPC_PGC_CTRL(IMX8MM_PGC_VPUH1), 617 + GPC_PGC_SR(IMX8MM_PGC_VPUH1)), 618 + }; 619 + 620 + static const struct regmap_access_table imx8mm_access_table = { 621 + .yes_ranges = imx8mm_yes_ranges, 622 + .n_yes_ranges = ARRAY_SIZE(imx8mm_yes_ranges), 623 + }; 624 + 625 + static const struct imx_pgc_domain_data imx8mm_pgc_domain_data = { 626 + .domains = imx8mm_pgc_domains, 627 + .domains_num = ARRAY_SIZE(imx8mm_pgc_domains), 628 + .reg_access_table = &imx8mm_access_table, 629 + }; 630 + 631 + static const struct imx_pgc_domain imx8mn_pgc_domains[] = { 632 + [IMX8MN_POWER_DOMAIN_HSIOMIX] = { 633 + .genpd = { 634 + .name = "hsiomix", 635 + }, 636 + .bits = { 637 + .pxx = 0, /* no power sequence control */ 638 + .map = 0, /* no power sequence control */ 639 + .hskreq = IMX8MN_HSIO_HSK_PWRDNREQN, 640 + .hskack = IMX8MN_HSIO_HSK_PWRDNACKN, 641 + }, 642 + }, 643 + 644 + [IMX8MN_POWER_DOMAIN_OTG1] = { 645 + .genpd = { 646 + .name = "usb-otg1", 647 + }, 648 + .bits = { 649 + .pxx = IMX8MN_OTG1_SW_Pxx_REQ, 650 + .map = IMX8MN_OTG1_A53_DOMAIN, 651 + }, 652 + .pgc = IMX8MN_PGC_OTG1, 653 + }, 654 + 655 + [IMX8MN_POWER_DOMAIN_GPUMIX] = { 656 + .genpd = { 657 + .name = "gpumix", 658 + }, 659 + .bits = { 660 + .pxx = IMX8MN_GPUMIX_SW_Pxx_REQ, 661 + .map = IMX8MN_GPUMIX_A53_DOMAIN, 662 + .hskreq = IMX8MN_GPUMIX_HSK_PWRDNREQN, 663 + .hskack = IMX8MN_GPUMIX_HSK_PWRDNACKN, 664 + }, 665 + .pgc = IMX8MN_PGC_GPUMIX, 666 + }, 667 + }; 668 + 669 + static const struct regmap_range imx8mn_yes_ranges[] = { 670 + regmap_reg_range(GPC_LPCR_A_CORE_BSC, 671 + GPC_PU_PWRHSK), 672 + regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_MIPI), 673 + GPC_PGC_SR(IMX8MN_PGC_MIPI)), 674 + regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_OTG1), 675 + GPC_PGC_SR(IMX8MN_PGC_OTG1)), 676 + regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_DDR1), 677 + GPC_PGC_SR(IMX8MN_PGC_DDR1)), 678 + regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_GPUMIX), 679 + GPC_PGC_SR(IMX8MN_PGC_GPUMIX)), 680 + regmap_reg_range(GPC_PGC_CTRL(IMX8MN_PGC_DISPMIX), 681 + GPC_PGC_SR(IMX8MN_PGC_DISPMIX)), 682 + }; 683 + 684 + static const struct regmap_access_table imx8mn_access_table = { 685 + .yes_ranges = imx8mn_yes_ranges, 686 + .n_yes_ranges = ARRAY_SIZE(imx8mn_yes_ranges), 687 + }; 688 + 689 + static const struct imx_pgc_domain_data imx8mn_pgc_domain_data = { 690 + .domains = imx8mn_pgc_domains, 691 + .domains_num = ARRAY_SIZE(imx8mn_pgc_domains), 692 + .reg_access_table = &imx8mn_access_table, 693 + }; 643 694 644 695 static int imx_pgc_domain_probe(struct platform_device *pdev) 645 696 { ··· 872 495 domain->voltage, domain->voltage); 873 496 } 874 497 875 - ret = imx_pgc_get_clocks(domain); 876 - if (ret) 877 - return dev_err_probe(domain->dev, ret, "Failed to get domain's clocks\n"); 498 + domain->num_clks = devm_clk_bulk_get_all(domain->dev, &domain->clks); 499 + if (domain->num_clks < 0) 500 + return dev_err_probe(domain->dev, domain->num_clks, 501 + "Failed to get domain's clocks\n"); 502 + 503 + domain->reset = devm_reset_control_array_get_optional_exclusive(domain->dev); 504 + if (IS_ERR(domain->reset)) 505 + return dev_err_probe(domain->dev, PTR_ERR(domain->reset), 506 + "Failed to get domain's resets\n"); 507 + 508 + pm_runtime_enable(domain->dev); 509 + 510 + if (domain->bits.map) 511 + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, 512 + domain->bits.map, domain->bits.map); 878 513 879 514 ret = pm_genpd_init(&domain->genpd, NULL, true); 880 515 if (ret) { 881 516 dev_err(domain->dev, "Failed to init power domain\n"); 882 - imx_pgc_put_clocks(domain); 883 - return ret; 517 + goto out_domain_unmap; 884 518 } 885 519 886 520 ret = of_genpd_add_provider_simple(domain->dev->of_node, 887 521 &domain->genpd); 888 522 if (ret) { 889 523 dev_err(domain->dev, "Failed to add genpd provider\n"); 890 - pm_genpd_remove(&domain->genpd); 891 - imx_pgc_put_clocks(domain); 524 + goto out_genpd_remove; 892 525 } 526 + 527 + return 0; 528 + 529 + out_genpd_remove: 530 + pm_genpd_remove(&domain->genpd); 531 + out_domain_unmap: 532 + if (domain->bits.map) 533 + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, 534 + domain->bits.map, 0); 535 + pm_runtime_disable(domain->dev); 893 536 894 537 return ret; 895 538 } ··· 920 523 921 524 of_genpd_del_provider(domain->dev->of_node); 922 525 pm_genpd_remove(&domain->genpd); 923 - imx_pgc_put_clocks(domain); 526 + 527 + if (domain->bits.map) 528 + regmap_update_bits(domain->regmap, GPC_PGC_CPU_MAPPING, 529 + domain->bits.map, 0); 530 + 531 + pm_runtime_disable(domain->dev); 924 532 925 533 return 0; 926 534 } ··· 1019 617 1020 618 domain = pd_pdev->dev.platform_data; 1021 619 domain->regmap = regmap; 1022 - domain->genpd.power_on = imx_gpc_pu_pgc_sw_pup_req; 1023 - domain->genpd.power_off = imx_gpc_pu_pgc_sw_pdn_req; 620 + domain->genpd.power_on = imx_pgc_power_up; 621 + domain->genpd.power_off = imx_pgc_power_down; 1024 622 1025 623 pd_pdev->dev.parent = dev; 1026 624 pd_pdev->dev.of_node = np; ··· 1038 636 1039 637 static const struct of_device_id imx_gpcv2_dt_ids[] = { 1040 638 { .compatible = "fsl,imx7d-gpc", .data = &imx7_pgc_domain_data, }, 639 + { .compatible = "fsl,imx8mm-gpc", .data = &imx8mm_pgc_domain_data, }, 640 + { .compatible = "fsl,imx8mn-gpc", .data = &imx8mn_pgc_domain_data, }, 1041 641 { .compatible = "fsl,imx8mq-gpc", .data = &imx8m_pgc_domain_data, }, 1042 642 { } 1043 643 };
+1
drivers/soc/mediatek/mtk-devapc.c
··· 234 234 }, { 235 235 }, 236 236 }; 237 + MODULE_DEVICE_TABLE(of, mtk_devapc_dt_match); 237 238 238 239 static int mtk_devapc_probe(struct platform_device *pdev) 239 240 {
+16 -26
drivers/soc/mediatek/mtk-pm-domains.c
··· 211 211 if (ret) 212 212 return ret; 213 213 214 - ret = clk_bulk_enable(pd->num_clks, pd->clks); 214 + ret = clk_bulk_prepare_enable(pd->num_clks, pd->clks); 215 215 if (ret) 216 216 goto err_reg; 217 217 ··· 229 229 regmap_clear_bits(scpsys->base, pd->data->ctl_offs, PWR_ISO_BIT); 230 230 regmap_set_bits(scpsys->base, pd->data->ctl_offs, PWR_RST_B_BIT); 231 231 232 - ret = clk_bulk_enable(pd->num_subsys_clks, pd->subsys_clks); 232 + ret = clk_bulk_prepare_enable(pd->num_subsys_clks, pd->subsys_clks); 233 233 if (ret) 234 234 goto err_pwr_ack; 235 235 ··· 246 246 err_disable_sram: 247 247 scpsys_sram_disable(pd); 248 248 err_disable_subsys_clks: 249 - clk_bulk_disable(pd->num_subsys_clks, pd->subsys_clks); 249 + clk_bulk_disable_unprepare(pd->num_subsys_clks, pd->subsys_clks); 250 250 err_pwr_ack: 251 - clk_bulk_disable(pd->num_clks, pd->clks); 251 + clk_bulk_disable_unprepare(pd->num_clks, pd->clks); 252 252 err_reg: 253 253 scpsys_regulator_disable(pd->supply); 254 254 return ret; ··· 269 269 if (ret < 0) 270 270 return ret; 271 271 272 - clk_bulk_disable(pd->num_subsys_clks, pd->subsys_clks); 272 + clk_bulk_disable_unprepare(pd->num_subsys_clks, pd->subsys_clks); 273 273 274 274 /* subsys power off */ 275 275 regmap_clear_bits(scpsys->base, pd->data->ctl_offs, PWR_RST_B_BIT); ··· 284 284 if (ret < 0) 285 285 return ret; 286 286 287 - clk_bulk_disable(pd->num_clks, pd->clks); 287 + clk_bulk_disable_unprepare(pd->num_clks, pd->clks); 288 288 289 289 scpsys_regulator_disable(pd->supply); 290 290 ··· 297 297 const struct scpsys_domain_data *domain_data; 298 298 struct scpsys_domain *pd; 299 299 struct device_node *root_node = scpsys->dev->of_node; 300 + struct device_node *smi_node; 300 301 struct property *prop; 301 302 const char *clk_name; 302 303 int i, ret, num_clks; ··· 353 352 if (IS_ERR(pd->infracfg)) 354 353 return ERR_CAST(pd->infracfg); 355 354 356 - pd->smi = syscon_regmap_lookup_by_phandle_optional(node, "mediatek,smi"); 357 - if (IS_ERR(pd->smi)) 358 - return ERR_CAST(pd->smi); 355 + smi_node = of_parse_phandle(node, "mediatek,smi", 0); 356 + if (smi_node) { 357 + pd->smi = device_node_to_regmap(smi_node); 358 + of_node_put(smi_node); 359 + if (IS_ERR(pd->smi)) 360 + return ERR_CAST(pd->smi); 361 + } 359 362 360 363 num_clks = of_clk_get_parent_count(node); 361 364 if (num_clks > 0) { ··· 410 405 pd->subsys_clks[i].clk = clk; 411 406 } 412 407 413 - ret = clk_bulk_prepare(pd->num_clks, pd->clks); 414 - if (ret) 415 - goto err_put_subsys_clocks; 416 - 417 - ret = clk_bulk_prepare(pd->num_subsys_clks, pd->subsys_clks); 418 - if (ret) 419 - goto err_unprepare_clocks; 420 - 421 408 /* 422 409 * Initially turn on all domains to make the domains usable 423 410 * with !CONFIG_PM and to get the hardware in sync with the ··· 424 427 ret = scpsys_power_on(&pd->genpd); 425 428 if (ret < 0) { 426 429 dev_err(scpsys->dev, "%pOF: failed to power on domain: %d\n", node, ret); 427 - goto err_unprepare_clocks; 430 + goto err_put_subsys_clocks; 428 431 } 429 432 } 430 433 ··· 432 435 ret = -EINVAL; 433 436 dev_err(scpsys->dev, 434 437 "power domain with id %d already exists, check your device-tree\n", id); 435 - goto err_unprepare_subsys_clocks; 438 + goto err_put_subsys_clocks; 436 439 } 437 440 438 441 if (!pd->data->name) ··· 452 455 453 456 return scpsys->pd_data.domains[id]; 454 457 455 - err_unprepare_subsys_clocks: 456 - clk_bulk_unprepare(pd->num_subsys_clks, pd->subsys_clks); 457 - err_unprepare_clocks: 458 - clk_bulk_unprepare(pd->num_clks, pd->clks); 459 458 err_put_subsys_clocks: 460 459 clk_bulk_put(pd->num_subsys_clks, pd->subsys_clks); 461 460 err_put_clocks: ··· 530 537 "failed to remove domain '%s' : %d - state may be inconsistent\n", 531 538 pd->genpd.name, ret); 532 539 533 - clk_bulk_unprepare(pd->num_clks, pd->clks); 534 540 clk_bulk_put(pd->num_clks, pd->clks); 535 - 536 - clk_bulk_unprepare(pd->num_subsys_clks, pd->subsys_clks); 537 541 clk_bulk_put(pd->num_subsys_clks, pd->subsys_clks); 538 542 } 539 543
+35
drivers/soc/mediatek/mtk-pmic-wrap.c
··· 961 961 [PWRAP_WACS2_VLDCLR] = 0xC28, 962 962 }; 963 963 964 + static int mt8195_regs[] = { 965 + [PWRAP_INIT_DONE2] = 0x0, 966 + [PWRAP_STAUPD_CTRL] = 0x4C, 967 + [PWRAP_TIMER_EN] = 0x3E4, 968 + [PWRAP_INT_EN] = 0x420, 969 + [PWRAP_INT_FLG] = 0x428, 970 + [PWRAP_INT_CLR] = 0x42C, 971 + [PWRAP_INT1_EN] = 0x450, 972 + [PWRAP_INT1_FLG] = 0x458, 973 + [PWRAP_INT1_CLR] = 0x45C, 974 + [PWRAP_WACS2_CMD] = 0x880, 975 + [PWRAP_SWINF_2_WDATA_31_0] = 0x884, 976 + [PWRAP_SWINF_2_RDATA_31_0] = 0x894, 977 + [PWRAP_WACS2_VLDCLR] = 0x8A4, 978 + [PWRAP_WACS2_RDATA] = 0x8A8, 979 + }; 980 + 964 981 static int mt8516_regs[] = { 965 982 [PWRAP_MUX_SEL] = 0x0, 966 983 [PWRAP_WRAP_EN] = 0x4, ··· 1083 1066 PWRAP_MT8135, 1084 1067 PWRAP_MT8173, 1085 1068 PWRAP_MT8183, 1069 + PWRAP_MT8195, 1086 1070 PWRAP_MT8516, 1087 1071 }; 1088 1072 ··· 1543 1525 break; 1544 1526 case PWRAP_MT6873: 1545 1527 case PWRAP_MT8183: 1528 + case PWRAP_MT8195: 1546 1529 break; 1547 1530 } 1548 1531 ··· 2044 2025 .init_soc_specific = pwrap_mt8183_init_soc_specific, 2045 2026 }; 2046 2027 2028 + static struct pmic_wrapper_type pwrap_mt8195 = { 2029 + .regs = mt8195_regs, 2030 + .type = PWRAP_MT8195, 2031 + .arb_en_all = 0x777f, /* NEED CONFIRM */ 2032 + .int_en_all = 0x180000, /* NEED CONFIRM */ 2033 + .int1_en_all = 0, 2034 + .spi_w = PWRAP_MAN_CMD_SPI_WRITE, 2035 + .wdt_src = PWRAP_WDT_SRC_MASK_ALL, 2036 + .caps = PWRAP_CAP_INT1_EN | PWRAP_CAP_ARB, 2037 + .init_reg_clock = pwrap_common_init_reg_clock, 2038 + .init_soc_specific = NULL, 2039 + }; 2040 + 2047 2041 static struct pmic_wrapper_type pwrap_mt8516 = { 2048 2042 .regs = mt8516_regs, 2049 2043 .type = PWRAP_MT8516, ··· 2097 2065 }, { 2098 2066 .compatible = "mediatek,mt8183-pwrap", 2099 2067 .data = &pwrap_mt8183, 2068 + }, { 2069 + .compatible = "mediatek,mt8195-pwrap", 2070 + .data = &pwrap_mt8195, 2100 2071 }, { 2101 2072 .compatible = "mediatek,mt8516-pwrap", 2102 2073 .data = &pwrap_mt8516,
+21
drivers/soc/qcom/rpmhpd.c
··· 271 271 .num_pds = ARRAY_SIZE(sc7280_rpmhpds), 272 272 }; 273 273 274 + /* SC8180x RPMH powerdomains */ 275 + static struct rpmhpd *sc8180x_rpmhpds[] = { 276 + [SC8180X_CX] = &sdm845_cx, 277 + [SC8180X_CX_AO] = &sdm845_cx_ao, 278 + [SC8180X_EBI] = &sdm845_ebi, 279 + [SC8180X_GFX] = &sdm845_gfx, 280 + [SC8180X_LCX] = &sdm845_lcx, 281 + [SC8180X_LMX] = &sdm845_lmx, 282 + [SC8180X_MMCX] = &sm8150_mmcx, 283 + [SC8180X_MMCX_AO] = &sm8150_mmcx_ao, 284 + [SC8180X_MSS] = &sdm845_mss, 285 + [SC8180X_MX] = &sdm845_mx, 286 + [SC8180X_MX_AO] = &sdm845_mx_ao, 287 + }; 288 + 289 + static const struct rpmhpd_desc sc8180x_desc = { 290 + .rpmhpds = sc8180x_rpmhpds, 291 + .num_pds = ARRAY_SIZE(sc8180x_rpmhpds), 292 + }; 293 + 274 294 static const struct of_device_id rpmhpd_match_table[] = { 275 295 { .compatible = "qcom,sc7180-rpmhpd", .data = &sc7180_desc }, 276 296 { .compatible = "qcom,sc7280-rpmhpd", .data = &sc7280_desc }, 297 + { .compatible = "qcom,sc8180x-rpmhpd", .data = &sc8180x_desc }, 277 298 { .compatible = "qcom,sdm845-rpmhpd", .data = &sdm845_desc }, 278 299 { .compatible = "qcom,sdx55-rpmhpd", .data = &sdx55_desc}, 279 300 { .compatible = "qcom,sm8150-rpmhpd", .data = &sm8150_desc },
+22
drivers/soc/qcom/rpmpd.c
··· 118 118 119 119 static DEFINE_MUTEX(rpmpd_lock); 120 120 121 + /* mdm9607 RPM Power Domains */ 122 + DEFINE_RPMPD_PAIR(mdm9607, vddcx, vddcx_ao, SMPA, LEVEL, 3); 123 + DEFINE_RPMPD_VFL(mdm9607, vddcx_vfl, SMPA, 3); 124 + 125 + DEFINE_RPMPD_PAIR(mdm9607, vddmx, vddmx_ao, LDOA, LEVEL, 12); 126 + DEFINE_RPMPD_VFL(mdm9607, vddmx_vfl, LDOA, 12); 127 + static struct rpmpd *mdm9607_rpmpds[] = { 128 + [MDM9607_VDDCX] = &mdm9607_vddcx, 129 + [MDM9607_VDDCX_AO] = &mdm9607_vddcx_ao, 130 + [MDM9607_VDDCX_VFL] = &mdm9607_vddcx_vfl, 131 + [MDM9607_VDDMX] = &mdm9607_vddmx, 132 + [MDM9607_VDDMX_AO] = &mdm9607_vddmx_ao, 133 + [MDM9607_VDDMX_VFL] = &mdm9607_vddmx_vfl, 134 + }; 135 + 136 + static const struct rpmpd_desc mdm9607_desc = { 137 + .rpmpds = mdm9607_rpmpds, 138 + .num_pds = ARRAY_SIZE(mdm9607_rpmpds), 139 + .max_state = RPM_SMD_LEVEL_TURBO, 140 + }; 141 + 121 142 /* msm8939 RPM Power Domains */ 122 143 DEFINE_RPMPD_PAIR(msm8939, vddmd, vddmd_ao, SMPA, CORNER, 1); 123 144 DEFINE_RPMPD_VFC(msm8939, vddmd_vfc, SMPA, 1); ··· 347 326 }; 348 327 349 328 static const struct of_device_id rpmpd_match_table[] = { 329 + { .compatible = "qcom,mdm9607-rpmpd", .data = &mdm9607_desc }, 350 330 { .compatible = "qcom,msm8916-rpmpd", .data = &msm8916_desc }, 351 331 { .compatible = "qcom,msm8939-rpmpd", .data = &msm8939_desc }, 352 332 { .compatible = "qcom,msm8976-rpmpd", .data = &msm8976_desc },
+2
drivers/soc/qcom/smd-rpm.c
··· 233 233 static const struct of_device_id qcom_smd_rpm_of_match[] = { 234 234 { .compatible = "qcom,rpm-apq8084" }, 235 235 { .compatible = "qcom,rpm-ipq6018" }, 236 + { .compatible = "qcom,rpm-msm8226" }, 236 237 { .compatible = "qcom,rpm-msm8916" }, 237 238 { .compatible = "qcom,rpm-msm8936" }, 238 239 { .compatible = "qcom,rpm-msm8974" }, ··· 242 241 { .compatible = "qcom,rpm-msm8996" }, 243 242 { .compatible = "qcom,rpm-msm8998" }, 244 243 { .compatible = "qcom,rpm-sdm660" }, 244 + { .compatible = "qcom,rpm-sm6125" }, 245 245 { .compatible = "qcom,rpm-qcs404" }, 246 246 {} 247 247 };
+50 -6
drivers/soc/qcom/socinfo.c
··· 70 70 71 71 static const char *const pmic_models[] = { 72 72 [0] = "Unknown PMIC model", 73 + [1] = "PM8941", 74 + [2] = "PM8841", 75 + [3] = "PM8019", 76 + [4] = "PM8226", 77 + [5] = "PM8110", 78 + [6] = "PMA8084", 79 + [7] = "PMI8962", 80 + [8] = "PMD9635", 73 81 [9] = "PM8994", 82 + [10] = "PMI8994", 74 83 [11] = "PM8916", 75 - [13] = "PM8058", 84 + [12] = "PM8004", 85 + [13] = "PM8909/PM8058", 76 86 [14] = "PM8028", 77 87 [15] = "PM8901", 78 - [16] = "PM8027", 79 - [17] = "ISL9519", 88 + [16] = "PM8950/PM8027", 89 + [17] = "PMI8950/ISL9519", 80 90 [18] = "PM8921", 81 91 [19] = "PM8018", 82 - [20] = "PM8015", 83 - [21] = "PM8014", 92 + [20] = "PM8998/PM8015", 93 + [21] = "PMI8998/PM8014", 84 94 [22] = "PM8821", 85 95 [23] = "PM8038", 86 - [24] = "PM8922", 96 + [24] = "PM8005/PM8922", 87 97 [25] = "PM8917", 98 + [26] = "PM660L", 99 + [27] = "PM660", 88 100 [30] = "PM8150", 89 101 [31] = "PM8150L", 90 102 [32] = "PM8150B", ··· 207 195 { 139, "APQ8060AB" }, 208 196 { 140, "MSM8260AB" }, 209 197 { 141, "MSM8660AB" }, 198 + { 145, "MSM8626" }, 199 + { 147, "MSM8610" }, 200 + { 153, "APQ8064AB" }, 201 + { 158, "MSM8226" }, 202 + { 159, "MSM8526" }, 203 + { 161, "MSM8110" }, 204 + { 162, "MSM8210" }, 205 + { 163, "MSM8810" }, 206 + { 164, "MSM8212" }, 207 + { 165, "MSM8612" }, 208 + { 166, "MSM8112" }, 209 + { 168, "MSM8225Q" }, 210 + { 169, "MSM8625Q" }, 211 + { 170, "MSM8125Q" }, 212 + { 172, "APQ8064AA" }, 210 213 { 178, "APQ8084" }, 211 214 { 184, "APQ8074" }, 212 215 { 185, "MSM8274" }, 213 216 { 186, "MSM8674" }, 214 217 { 194, "MSM8974PRO" }, 218 + { 198, "MSM8126" }, 219 + { 199, "APQ8026" }, 220 + { 200, "MSM8926" }, 221 + { 205, "MSM8326" }, 215 222 { 206, "MSM8916" }, 216 223 { 207, "MSM8994" }, 217 224 { 208, "APQ8074-AA" }, ··· 244 213 { 216, "MSM8674PRO" }, 245 214 { 217, "MSM8974-AA" }, 246 215 { 218, "MSM8974-AB" }, 216 + { 219, "APQ8028" }, 217 + { 220, "MSM8128" }, 218 + { 221, "MSM8228" }, 219 + { 222, "MSM8528" }, 220 + { 223, "MSM8628" }, 221 + { 224, "MSM8928" }, 222 + { 225, "MSM8510" }, 223 + { 226, "MSM8512" }, 247 224 { 233, "MSM8936" }, 248 225 { 239, "MSM8939" }, 249 226 { 240, "APQ8036" }, ··· 293 254 { 350, "SDA632" }, 294 255 { 351, "SDA450" }, 295 256 { 356, "SM8250" }, 257 + { 394, "SM6125" }, 296 258 { 402, "IPQ6018" }, 259 + { 403, "IPQ6028" }, 260 + { 421, "IPQ6000" }, 261 + { 422, "IPQ6010" }, 297 262 { 425, "SC7180" }, 263 + { 453, "IPQ6005" }, 298 264 { 455, "QRB5165" }, 299 265 }; 300 266
+5
drivers/soc/renesas/Kconfig
··· 279 279 help 280 280 This enables support for the Renesas RZ/G2N SoC. 281 281 282 + config ARCH_R9A07G044 283 + bool "ARM64 Platform support for RZ/G2L" 284 + help 285 + This enables support for the Renesas RZ/G2L SoC variants. 286 + 282 287 endif # ARM64 283 288 284 289 config RST_RCAR
+32 -1
drivers/soc/renesas/renesas-soc.c
··· 56 56 .reg = 0xfff00044, /* PRR (Product Register) */ 57 57 }; 58 58 59 + static const struct renesas_family fam_rzg2l __initconst __maybe_unused = { 60 + .name = "RZ/G2L", 61 + }; 62 + 59 63 static const struct renesas_family fam_shmobile __initconst __maybe_unused = { 60 64 .name = "SH-Mobile", 61 65 .reg = 0xe600101c, /* CCCR (Common Chip Code Register) */ ··· 68 64 69 65 struct renesas_soc { 70 66 const struct renesas_family *family; 71 - u8 id; 67 + u32 id; 72 68 }; 73 69 74 70 static const struct renesas_soc soc_rz_a1h __initconst __maybe_unused = { ··· 133 129 static const struct renesas_soc soc_rz_g2h __initconst __maybe_unused = { 134 130 .family = &fam_rzg2, 135 131 .id = 0x4f, 132 + }; 133 + 134 + static const struct renesas_soc soc_rz_g2l __initconst __maybe_unused = { 135 + .family = &fam_rzg2l, 136 + .id = 0x841c447, 136 137 }; 137 138 138 139 static const struct renesas_soc soc_rcar_m1a __initconst __maybe_unused = { ··· 308 299 #ifdef CONFIG_ARCH_R8A779A0 309 300 { .compatible = "renesas,r8a779a0", .data = &soc_rcar_v3u }, 310 301 #endif 302 + #if defined(CONFIG_ARCH_R9A07G044) 303 + { .compatible = "renesas,r9a07g044", .data = &soc_rz_g2l }, 304 + #endif 311 305 #ifdef CONFIG_ARCH_SH73A0 312 306 { .compatible = "renesas,sh73a0", .data = &soc_shmobile_ag5 }, 313 307 #endif ··· 356 344 * format is not known at this time so we don't know how to 357 345 * specify eshi and eslo 358 346 */ 347 + 348 + goto done; 349 + } 350 + 351 + np = of_find_compatible_node(NULL, NULL, "renesas,r9a07g044-sysc"); 352 + if (np) { 353 + chipid = of_iomap(np, 0); 354 + of_node_put(np); 355 + 356 + if (chipid) { 357 + product = readl(chipid + 0x0a04); 358 + iounmap(chipid); 359 + 360 + if (soc->id && (product & 0xfffffff) != soc->id) { 361 + pr_warn("SoC mismatch (product = 0x%x)\n", 362 + product); 363 + return -ENODEV; 364 + } 365 + } 359 366 360 367 goto done; 361 368 }
+145 -107
drivers/soc/rockchip/pm_domains.c
··· 27 27 #include <dt-bindings/power/rk3366-power.h> 28 28 #include <dt-bindings/power/rk3368-power.h> 29 29 #include <dt-bindings/power/rk3399-power.h> 30 + #include <dt-bindings/power/rk3568-power.h> 30 31 31 32 struct rockchip_domain_info { 33 + const char *name; 32 34 int pwr_mask; 33 35 int status_mask; 34 36 int req_mask; ··· 87 85 88 86 #define to_rockchip_pd(gpd) container_of(gpd, struct rockchip_pm_domain, genpd) 89 87 90 - #define DOMAIN(pwr, status, req, idle, ack, wakeup) \ 88 + #define DOMAIN(_name, pwr, status, req, idle, ack, wakeup) \ 91 89 { \ 90 + .name = _name, \ 92 91 .pwr_mask = (pwr), \ 93 92 .status_mask = (status), \ 94 93 .req_mask = (req), \ ··· 98 95 .active_wakeup = (wakeup), \ 99 96 } 100 97 101 - #define DOMAIN_M(pwr, status, req, idle, ack, wakeup) \ 98 + #define DOMAIN_M(_name, pwr, status, req, idle, ack, wakeup) \ 102 99 { \ 100 + .name = _name, \ 103 101 .pwr_w_mask = (pwr) << 16, \ 104 102 .pwr_mask = (pwr), \ 105 103 .status_mask = (status), \ ··· 111 107 .active_wakeup = wakeup, \ 112 108 } 113 109 114 - #define DOMAIN_RK3036(req, ack, idle, wakeup) \ 110 + #define DOMAIN_RK3036(_name, req, ack, idle, wakeup) \ 115 111 { \ 112 + .name = _name, \ 116 113 .req_mask = (req), \ 117 114 .req_w_mask = (req) << 16, \ 118 115 .ack_mask = (ack), \ ··· 121 116 .active_wakeup = wakeup, \ 122 117 } 123 118 124 - #define DOMAIN_PX30(pwr, status, req, wakeup) \ 125 - DOMAIN_M(pwr, status, req, (req) << 16, req, wakeup) 119 + #define DOMAIN_PX30(name, pwr, status, req, wakeup) \ 120 + DOMAIN_M(name, pwr, status, req, (req) << 16, req, wakeup) 126 121 127 - #define DOMAIN_RK3288(pwr, status, req, wakeup) \ 128 - DOMAIN(pwr, status, req, req, (req) << 16, wakeup) 122 + #define DOMAIN_RK3288(name, pwr, status, req, wakeup) \ 123 + DOMAIN(name, pwr, status, req, req, (req) << 16, wakeup) 129 124 130 - #define DOMAIN_RK3328(pwr, status, req, wakeup) \ 131 - DOMAIN_M(pwr, pwr, req, (req) << 10, req, wakeup) 125 + #define DOMAIN_RK3328(name, pwr, status, req, wakeup) \ 126 + DOMAIN_M(name, pwr, pwr, req, (req) << 10, req, wakeup) 132 127 133 - #define DOMAIN_RK3368(pwr, status, req, wakeup) \ 134 - DOMAIN(pwr, status, req, (req) << 16, req, wakeup) 128 + #define DOMAIN_RK3368(name, pwr, status, req, wakeup) \ 129 + DOMAIN(name, pwr, status, req, (req) << 16, req, wakeup) 135 130 136 - #define DOMAIN_RK3399(pwr, status, req, wakeup) \ 137 - DOMAIN(pwr, status, req, req, req, wakeup) 131 + #define DOMAIN_RK3399(name, pwr, status, req, wakeup) \ 132 + DOMAIN(name, pwr, status, req, req, req, wakeup) 133 + 134 + #define DOMAIN_RK3568(name, pwr, req, wakeup) \ 135 + DOMAIN_M(name, pwr, pwr, req, req, req, wakeup) 138 136 139 137 static bool rockchip_pmu_domain_is_idle(struct rockchip_pm_domain *pd) 140 138 { ··· 498 490 goto err_unprepare_clocks; 499 491 } 500 492 501 - pd->genpd.name = node->name; 493 + if (pd->info->name) 494 + pd->genpd.name = pd->info->name; 495 + else 496 + pd->genpd.name = kbasename(node->full_name); 502 497 pd->genpd.power_off = rockchip_pd_power_off; 503 498 pd->genpd.power_on = rockchip_pd_power_on; 504 499 pd->genpd.attach_dev = rockchip_pd_attach_dev; ··· 727 716 } 728 717 729 718 static const struct rockchip_domain_info px30_pm_domains[] = { 730 - [PX30_PD_USB] = DOMAIN_PX30(BIT(5), BIT(5), BIT(10), false), 731 - [PX30_PD_SDCARD] = DOMAIN_PX30(BIT(8), BIT(8), BIT(9), false), 732 - [PX30_PD_GMAC] = DOMAIN_PX30(BIT(10), BIT(10), BIT(6), false), 733 - [PX30_PD_MMC_NAND] = DOMAIN_PX30(BIT(11), BIT(11), BIT(5), false), 734 - [PX30_PD_VPU] = DOMAIN_PX30(BIT(12), BIT(12), BIT(14), false), 735 - [PX30_PD_VO] = DOMAIN_PX30(BIT(13), BIT(13), BIT(7), false), 736 - [PX30_PD_VI] = DOMAIN_PX30(BIT(14), BIT(14), BIT(8), false), 737 - [PX30_PD_GPU] = DOMAIN_PX30(BIT(15), BIT(15), BIT(2), false), 719 + [PX30_PD_USB] = DOMAIN_PX30("usb", BIT(5), BIT(5), BIT(10), false), 720 + [PX30_PD_SDCARD] = DOMAIN_PX30("sdcard", BIT(8), BIT(8), BIT(9), false), 721 + [PX30_PD_GMAC] = DOMAIN_PX30("gmac", BIT(10), BIT(10), BIT(6), false), 722 + [PX30_PD_MMC_NAND] = DOMAIN_PX30("mmc_nand", BIT(11), BIT(11), BIT(5), false), 723 + [PX30_PD_VPU] = DOMAIN_PX30("vpu", BIT(12), BIT(12), BIT(14), false), 724 + [PX30_PD_VO] = DOMAIN_PX30("vo", BIT(13), BIT(13), BIT(7), false), 725 + [PX30_PD_VI] = DOMAIN_PX30("vi", BIT(14), BIT(14), BIT(8), false), 726 + [PX30_PD_GPU] = DOMAIN_PX30("gpu", BIT(15), BIT(15), BIT(2), false), 738 727 }; 739 728 740 729 static const struct rockchip_domain_info rk3036_pm_domains[] = { 741 - [RK3036_PD_MSCH] = DOMAIN_RK3036(BIT(14), BIT(23), BIT(30), true), 742 - [RK3036_PD_CORE] = DOMAIN_RK3036(BIT(13), BIT(17), BIT(24), false), 743 - [RK3036_PD_PERI] = DOMAIN_RK3036(BIT(12), BIT(18), BIT(25), false), 744 - [RK3036_PD_VIO] = DOMAIN_RK3036(BIT(11), BIT(19), BIT(26), false), 745 - [RK3036_PD_VPU] = DOMAIN_RK3036(BIT(10), BIT(20), BIT(27), false), 746 - [RK3036_PD_GPU] = DOMAIN_RK3036(BIT(9), BIT(21), BIT(28), false), 747 - [RK3036_PD_SYS] = DOMAIN_RK3036(BIT(8), BIT(22), BIT(29), false), 730 + [RK3036_PD_MSCH] = DOMAIN_RK3036("msch", BIT(14), BIT(23), BIT(30), true), 731 + [RK3036_PD_CORE] = DOMAIN_RK3036("core", BIT(13), BIT(17), BIT(24), false), 732 + [RK3036_PD_PERI] = DOMAIN_RK3036("peri", BIT(12), BIT(18), BIT(25), false), 733 + [RK3036_PD_VIO] = DOMAIN_RK3036("vio", BIT(11), BIT(19), BIT(26), false), 734 + [RK3036_PD_VPU] = DOMAIN_RK3036("vpu", BIT(10), BIT(20), BIT(27), false), 735 + [RK3036_PD_GPU] = DOMAIN_RK3036("gpu", BIT(9), BIT(21), BIT(28), false), 736 + [RK3036_PD_SYS] = DOMAIN_RK3036("sys", BIT(8), BIT(22), BIT(29), false), 748 737 }; 749 738 750 739 static const struct rockchip_domain_info rk3066_pm_domains[] = { 751 - [RK3066_PD_GPU] = DOMAIN(BIT(9), BIT(9), BIT(3), BIT(24), BIT(29), false), 752 - [RK3066_PD_VIDEO] = DOMAIN(BIT(8), BIT(8), BIT(4), BIT(23), BIT(28), false), 753 - [RK3066_PD_VIO] = DOMAIN(BIT(7), BIT(7), BIT(5), BIT(22), BIT(27), false), 754 - [RK3066_PD_PERI] = DOMAIN(BIT(6), BIT(6), BIT(2), BIT(25), BIT(30), false), 755 - [RK3066_PD_CPU] = DOMAIN(0, BIT(5), BIT(1), BIT(26), BIT(31), false), 740 + [RK3066_PD_GPU] = DOMAIN("gpu", BIT(9), BIT(9), BIT(3), BIT(24), BIT(29), false), 741 + [RK3066_PD_VIDEO] = DOMAIN("video", BIT(8), BIT(8), BIT(4), BIT(23), BIT(28), false), 742 + [RK3066_PD_VIO] = DOMAIN("vio", BIT(7), BIT(7), BIT(5), BIT(22), BIT(27), false), 743 + [RK3066_PD_PERI] = DOMAIN("peri", BIT(6), BIT(6), BIT(2), BIT(25), BIT(30), false), 744 + [RK3066_PD_CPU] = DOMAIN("cpu", 0, BIT(5), BIT(1), BIT(26), BIT(31), false), 756 745 }; 757 746 758 747 static const struct rockchip_domain_info rk3128_pm_domains[] = { 759 - [RK3128_PD_CORE] = DOMAIN_RK3288(BIT(0), BIT(0), BIT(4), false), 760 - [RK3128_PD_MSCH] = DOMAIN_RK3288(0, 0, BIT(6), true), 761 - [RK3128_PD_VIO] = DOMAIN_RK3288(BIT(3), BIT(3), BIT(2), false), 762 - [RK3128_PD_VIDEO] = DOMAIN_RK3288(BIT(2), BIT(2), BIT(1), false), 763 - [RK3128_PD_GPU] = DOMAIN_RK3288(BIT(1), BIT(1), BIT(3), false), 748 + [RK3128_PD_CORE] = DOMAIN_RK3288("core", BIT(0), BIT(0), BIT(4), false), 749 + [RK3128_PD_MSCH] = DOMAIN_RK3288("msch", 0, 0, BIT(6), true), 750 + [RK3128_PD_VIO] = DOMAIN_RK3288("vio", BIT(3), BIT(3), BIT(2), false), 751 + [RK3128_PD_VIDEO] = DOMAIN_RK3288("video", BIT(2), BIT(2), BIT(1), false), 752 + [RK3128_PD_GPU] = DOMAIN_RK3288("gpu", BIT(1), BIT(1), BIT(3), false), 764 753 }; 765 754 766 755 static const struct rockchip_domain_info rk3188_pm_domains[] = { 767 - [RK3188_PD_GPU] = DOMAIN(BIT(9), BIT(9), BIT(3), BIT(24), BIT(29), false), 768 - [RK3188_PD_VIDEO] = DOMAIN(BIT(8), BIT(8), BIT(4), BIT(23), BIT(28), false), 769 - [RK3188_PD_VIO] = DOMAIN(BIT(7), BIT(7), BIT(5), BIT(22), BIT(27), false), 770 - [RK3188_PD_PERI] = DOMAIN(BIT(6), BIT(6), BIT(2), BIT(25), BIT(30), false), 771 - [RK3188_PD_CPU] = DOMAIN(BIT(5), BIT(5), BIT(1), BIT(26), BIT(31), false), 756 + [RK3188_PD_GPU] = DOMAIN("gpu", BIT(9), BIT(9), BIT(3), BIT(24), BIT(29), false), 757 + [RK3188_PD_VIDEO] = DOMAIN("video", BIT(8), BIT(8), BIT(4), BIT(23), BIT(28), false), 758 + [RK3188_PD_VIO] = DOMAIN("vio", BIT(7), BIT(7), BIT(5), BIT(22), BIT(27), false), 759 + [RK3188_PD_PERI] = DOMAIN("peri", BIT(6), BIT(6), BIT(2), BIT(25), BIT(30), false), 760 + [RK3188_PD_CPU] = DOMAIN("cpu", BIT(5), BIT(5), BIT(1), BIT(26), BIT(31), false), 772 761 }; 773 762 774 763 static const struct rockchip_domain_info rk3228_pm_domains[] = { 775 - [RK3228_PD_CORE] = DOMAIN_RK3036(BIT(0), BIT(0), BIT(16), true), 776 - [RK3228_PD_MSCH] = DOMAIN_RK3036(BIT(1), BIT(1), BIT(17), true), 777 - [RK3228_PD_BUS] = DOMAIN_RK3036(BIT(2), BIT(2), BIT(18), true), 778 - [RK3228_PD_SYS] = DOMAIN_RK3036(BIT(3), BIT(3), BIT(19), true), 779 - [RK3228_PD_VIO] = DOMAIN_RK3036(BIT(4), BIT(4), BIT(20), false), 780 - [RK3228_PD_VOP] = DOMAIN_RK3036(BIT(5), BIT(5), BIT(21), false), 781 - [RK3228_PD_VPU] = DOMAIN_RK3036(BIT(6), BIT(6), BIT(22), false), 782 - [RK3228_PD_RKVDEC] = DOMAIN_RK3036(BIT(7), BIT(7), BIT(23), false), 783 - [RK3228_PD_GPU] = DOMAIN_RK3036(BIT(8), BIT(8), BIT(24), false), 784 - [RK3228_PD_PERI] = DOMAIN_RK3036(BIT(9), BIT(9), BIT(25), true), 785 - [RK3228_PD_GMAC] = DOMAIN_RK3036(BIT(10), BIT(10), BIT(26), false), 764 + [RK3228_PD_CORE] = DOMAIN_RK3036("core", BIT(0), BIT(0), BIT(16), true), 765 + [RK3228_PD_MSCH] = DOMAIN_RK3036("msch", BIT(1), BIT(1), BIT(17), true), 766 + [RK3228_PD_BUS] = DOMAIN_RK3036("bus", BIT(2), BIT(2), BIT(18), true), 767 + [RK3228_PD_SYS] = DOMAIN_RK3036("sys", BIT(3), BIT(3), BIT(19), true), 768 + [RK3228_PD_VIO] = DOMAIN_RK3036("vio", BIT(4), BIT(4), BIT(20), false), 769 + [RK3228_PD_VOP] = DOMAIN_RK3036("vop", BIT(5), BIT(5), BIT(21), false), 770 + [RK3228_PD_VPU] = DOMAIN_RK3036("vpu", BIT(6), BIT(6), BIT(22), false), 771 + [RK3228_PD_RKVDEC] = DOMAIN_RK3036("vdec", BIT(7), BIT(7), BIT(23), false), 772 + [RK3228_PD_GPU] = DOMAIN_RK3036("gpu", BIT(8), BIT(8), BIT(24), false), 773 + [RK3228_PD_PERI] = DOMAIN_RK3036("peri", BIT(9), BIT(9), BIT(25), true), 774 + [RK3228_PD_GMAC] = DOMAIN_RK3036("gmac", BIT(10), BIT(10), BIT(26), false), 786 775 }; 787 776 788 777 static const struct rockchip_domain_info rk3288_pm_domains[] = { 789 - [RK3288_PD_VIO] = DOMAIN_RK3288(BIT(7), BIT(7), BIT(4), false), 790 - [RK3288_PD_HEVC] = DOMAIN_RK3288(BIT(14), BIT(10), BIT(9), false), 791 - [RK3288_PD_VIDEO] = DOMAIN_RK3288(BIT(8), BIT(8), BIT(3), false), 792 - [RK3288_PD_GPU] = DOMAIN_RK3288(BIT(9), BIT(9), BIT(2), false), 778 + [RK3288_PD_VIO] = DOMAIN_RK3288("vio", BIT(7), BIT(7), BIT(4), false), 779 + [RK3288_PD_HEVC] = DOMAIN_RK3288("hevc", BIT(14), BIT(10), BIT(9), false), 780 + [RK3288_PD_VIDEO] = DOMAIN_RK3288("video", BIT(8), BIT(8), BIT(3), false), 781 + [RK3288_PD_GPU] = DOMAIN_RK3288("gpu", BIT(9), BIT(9), BIT(2), false), 793 782 }; 794 783 795 784 static const struct rockchip_domain_info rk3328_pm_domains[] = { 796 - [RK3328_PD_CORE] = DOMAIN_RK3328(0, BIT(0), BIT(0), false), 797 - [RK3328_PD_GPU] = DOMAIN_RK3328(0, BIT(1), BIT(1), false), 798 - [RK3328_PD_BUS] = DOMAIN_RK3328(0, BIT(2), BIT(2), true), 799 - [RK3328_PD_MSCH] = DOMAIN_RK3328(0, BIT(3), BIT(3), true), 800 - [RK3328_PD_PERI] = DOMAIN_RK3328(0, BIT(4), BIT(4), true), 801 - [RK3328_PD_VIDEO] = DOMAIN_RK3328(0, BIT(5), BIT(5), false), 802 - [RK3328_PD_HEVC] = DOMAIN_RK3328(0, BIT(6), BIT(6), false), 803 - [RK3328_PD_VIO] = DOMAIN_RK3328(0, BIT(8), BIT(8), false), 804 - [RK3328_PD_VPU] = DOMAIN_RK3328(0, BIT(9), BIT(9), false), 785 + [RK3328_PD_CORE] = DOMAIN_RK3328("core", 0, BIT(0), BIT(0), false), 786 + [RK3328_PD_GPU] = DOMAIN_RK3328("gpu", 0, BIT(1), BIT(1), false), 787 + [RK3328_PD_BUS] = DOMAIN_RK3328("bus", 0, BIT(2), BIT(2), true), 788 + [RK3328_PD_MSCH] = DOMAIN_RK3328("msch", 0, BIT(3), BIT(3), true), 789 + [RK3328_PD_PERI] = DOMAIN_RK3328("peri", 0, BIT(4), BIT(4), true), 790 + [RK3328_PD_VIDEO] = DOMAIN_RK3328("video", 0, BIT(5), BIT(5), false), 791 + [RK3328_PD_HEVC] = DOMAIN_RK3328("hevc", 0, BIT(6), BIT(6), false), 792 + [RK3328_PD_VIO] = DOMAIN_RK3328("vio", 0, BIT(8), BIT(8), false), 793 + [RK3328_PD_VPU] = DOMAIN_RK3328("vpu", 0, BIT(9), BIT(9), false), 805 794 }; 806 795 807 796 static const struct rockchip_domain_info rk3366_pm_domains[] = { 808 - [RK3366_PD_PERI] = DOMAIN_RK3368(BIT(10), BIT(10), BIT(6), true), 809 - [RK3366_PD_VIO] = DOMAIN_RK3368(BIT(14), BIT(14), BIT(8), false), 810 - [RK3366_PD_VIDEO] = DOMAIN_RK3368(BIT(13), BIT(13), BIT(7), false), 811 - [RK3366_PD_RKVDEC] = DOMAIN_RK3368(BIT(11), BIT(11), BIT(7), false), 812 - [RK3366_PD_WIFIBT] = DOMAIN_RK3368(BIT(8), BIT(8), BIT(9), false), 813 - [RK3366_PD_VPU] = DOMAIN_RK3368(BIT(12), BIT(12), BIT(7), false), 814 - [RK3366_PD_GPU] = DOMAIN_RK3368(BIT(15), BIT(15), BIT(2), false), 797 + [RK3366_PD_PERI] = DOMAIN_RK3368("peri", BIT(10), BIT(10), BIT(6), true), 798 + [RK3366_PD_VIO] = DOMAIN_RK3368("vio", BIT(14), BIT(14), BIT(8), false), 799 + [RK3366_PD_VIDEO] = DOMAIN_RK3368("video", BIT(13), BIT(13), BIT(7), false), 800 + [RK3366_PD_RKVDEC] = DOMAIN_RK3368("vdec", BIT(11), BIT(11), BIT(7), false), 801 + [RK3366_PD_WIFIBT] = DOMAIN_RK3368("wifibt", BIT(8), BIT(8), BIT(9), false), 802 + [RK3366_PD_VPU] = DOMAIN_RK3368("vpu", BIT(12), BIT(12), BIT(7), false), 803 + [RK3366_PD_GPU] = DOMAIN_RK3368("gpu", BIT(15), BIT(15), BIT(2), false), 815 804 }; 816 805 817 806 static const struct rockchip_domain_info rk3368_pm_domains[] = { 818 - [RK3368_PD_PERI] = DOMAIN_RK3368(BIT(13), BIT(12), BIT(6), true), 819 - [RK3368_PD_VIO] = DOMAIN_RK3368(BIT(15), BIT(14), BIT(8), false), 820 - [RK3368_PD_VIDEO] = DOMAIN_RK3368(BIT(14), BIT(13), BIT(7), false), 821 - [RK3368_PD_GPU_0] = DOMAIN_RK3368(BIT(16), BIT(15), BIT(2), false), 822 - [RK3368_PD_GPU_1] = DOMAIN_RK3368(BIT(17), BIT(16), BIT(2), false), 807 + [RK3368_PD_PERI] = DOMAIN_RK3368("peri", BIT(13), BIT(12), BIT(6), true), 808 + [RK3368_PD_VIO] = DOMAIN_RK3368("vio", BIT(15), BIT(14), BIT(8), false), 809 + [RK3368_PD_VIDEO] = DOMAIN_RK3368("video", BIT(14), BIT(13), BIT(7), false), 810 + [RK3368_PD_GPU_0] = DOMAIN_RK3368("gpu_0", BIT(16), BIT(15), BIT(2), false), 811 + [RK3368_PD_GPU_1] = DOMAIN_RK3368("gpu_1", BIT(17), BIT(16), BIT(2), false), 823 812 }; 824 813 825 814 static const struct rockchip_domain_info rk3399_pm_domains[] = { 826 - [RK3399_PD_TCPD0] = DOMAIN_RK3399(BIT(8), BIT(8), 0, false), 827 - [RK3399_PD_TCPD1] = DOMAIN_RK3399(BIT(9), BIT(9), 0, false), 828 - [RK3399_PD_CCI] = DOMAIN_RK3399(BIT(10), BIT(10), 0, true), 829 - [RK3399_PD_CCI0] = DOMAIN_RK3399(0, 0, BIT(15), true), 830 - [RK3399_PD_CCI1] = DOMAIN_RK3399(0, 0, BIT(16), true), 831 - [RK3399_PD_PERILP] = DOMAIN_RK3399(BIT(11), BIT(11), BIT(1), true), 832 - [RK3399_PD_PERIHP] = DOMAIN_RK3399(BIT(12), BIT(12), BIT(2), true), 833 - [RK3399_PD_CENTER] = DOMAIN_RK3399(BIT(13), BIT(13), BIT(14), true), 834 - [RK3399_PD_VIO] = DOMAIN_RK3399(BIT(14), BIT(14), BIT(17), false), 835 - [RK3399_PD_GPU] = DOMAIN_RK3399(BIT(15), BIT(15), BIT(0), false), 836 - [RK3399_PD_VCODEC] = DOMAIN_RK3399(BIT(16), BIT(16), BIT(3), false), 837 - [RK3399_PD_VDU] = DOMAIN_RK3399(BIT(17), BIT(17), BIT(4), false), 838 - [RK3399_PD_RGA] = DOMAIN_RK3399(BIT(18), BIT(18), BIT(5), false), 839 - [RK3399_PD_IEP] = DOMAIN_RK3399(BIT(19), BIT(19), BIT(6), false), 840 - [RK3399_PD_VO] = DOMAIN_RK3399(BIT(20), BIT(20), 0, false), 841 - [RK3399_PD_VOPB] = DOMAIN_RK3399(0, 0, BIT(7), false), 842 - [RK3399_PD_VOPL] = DOMAIN_RK3399(0, 0, BIT(8), false), 843 - [RK3399_PD_ISP0] = DOMAIN_RK3399(BIT(22), BIT(22), BIT(9), false), 844 - [RK3399_PD_ISP1] = DOMAIN_RK3399(BIT(23), BIT(23), BIT(10), false), 845 - [RK3399_PD_HDCP] = DOMAIN_RK3399(BIT(24), BIT(24), BIT(11), false), 846 - [RK3399_PD_GMAC] = DOMAIN_RK3399(BIT(25), BIT(25), BIT(23), true), 847 - [RK3399_PD_EMMC] = DOMAIN_RK3399(BIT(26), BIT(26), BIT(24), true), 848 - [RK3399_PD_USB3] = DOMAIN_RK3399(BIT(27), BIT(27), BIT(12), true), 849 - [RK3399_PD_EDP] = DOMAIN_RK3399(BIT(28), BIT(28), BIT(22), false), 850 - [RK3399_PD_GIC] = DOMAIN_RK3399(BIT(29), BIT(29), BIT(27), true), 851 - [RK3399_PD_SD] = DOMAIN_RK3399(BIT(30), BIT(30), BIT(28), true), 852 - [RK3399_PD_SDIOAUDIO] = DOMAIN_RK3399(BIT(31), BIT(31), BIT(29), true), 815 + [RK3399_PD_TCPD0] = DOMAIN_RK3399("tcpd0", BIT(8), BIT(8), 0, false), 816 + [RK3399_PD_TCPD1] = DOMAIN_RK3399("tcpd1", BIT(9), BIT(9), 0, false), 817 + [RK3399_PD_CCI] = DOMAIN_RK3399("cci", BIT(10), BIT(10), 0, true), 818 + [RK3399_PD_CCI0] = DOMAIN_RK3399("cci0", 0, 0, BIT(15), true), 819 + [RK3399_PD_CCI1] = DOMAIN_RK3399("cci1", 0, 0, BIT(16), true), 820 + [RK3399_PD_PERILP] = DOMAIN_RK3399("perilp", BIT(11), BIT(11), BIT(1), true), 821 + [RK3399_PD_PERIHP] = DOMAIN_RK3399("perihp", BIT(12), BIT(12), BIT(2), true), 822 + [RK3399_PD_CENTER] = DOMAIN_RK3399("center", BIT(13), BIT(13), BIT(14), true), 823 + [RK3399_PD_VIO] = DOMAIN_RK3399("vio", BIT(14), BIT(14), BIT(17), false), 824 + [RK3399_PD_GPU] = DOMAIN_RK3399("gpu", BIT(15), BIT(15), BIT(0), false), 825 + [RK3399_PD_VCODEC] = DOMAIN_RK3399("vcodec", BIT(16), BIT(16), BIT(3), false), 826 + [RK3399_PD_VDU] = DOMAIN_RK3399("vdu", BIT(17), BIT(17), BIT(4), false), 827 + [RK3399_PD_RGA] = DOMAIN_RK3399("rga", BIT(18), BIT(18), BIT(5), false), 828 + [RK3399_PD_IEP] = DOMAIN_RK3399("iep", BIT(19), BIT(19), BIT(6), false), 829 + [RK3399_PD_VO] = DOMAIN_RK3399("vo", BIT(20), BIT(20), 0, false), 830 + [RK3399_PD_VOPB] = DOMAIN_RK3399("vopb", 0, 0, BIT(7), false), 831 + [RK3399_PD_VOPL] = DOMAIN_RK3399("vopl", 0, 0, BIT(8), false), 832 + [RK3399_PD_ISP0] = DOMAIN_RK3399("isp0", BIT(22), BIT(22), BIT(9), false), 833 + [RK3399_PD_ISP1] = DOMAIN_RK3399("isp1", BIT(23), BIT(23), BIT(10), false), 834 + [RK3399_PD_HDCP] = DOMAIN_RK3399("hdcp", BIT(24), BIT(24), BIT(11), false), 835 + [RK3399_PD_GMAC] = DOMAIN_RK3399("gmac", BIT(25), BIT(25), BIT(23), true), 836 + [RK3399_PD_EMMC] = DOMAIN_RK3399("emmc", BIT(26), BIT(26), BIT(24), true), 837 + [RK3399_PD_USB3] = DOMAIN_RK3399("usb3", BIT(27), BIT(27), BIT(12), true), 838 + [RK3399_PD_EDP] = DOMAIN_RK3399("edp", BIT(28), BIT(28), BIT(22), false), 839 + [RK3399_PD_GIC] = DOMAIN_RK3399("gic", BIT(29), BIT(29), BIT(27), true), 840 + [RK3399_PD_SD] = DOMAIN_RK3399("sd", BIT(30), BIT(30), BIT(28), true), 841 + [RK3399_PD_SDIOAUDIO] = DOMAIN_RK3399("sdioaudio", BIT(31), BIT(31), BIT(29), true), 842 + }; 843 + 844 + static const struct rockchip_domain_info rk3568_pm_domains[] = { 845 + [RK3568_PD_NPU] = DOMAIN_RK3568("npu", BIT(1), BIT(2), false), 846 + [RK3568_PD_GPU] = DOMAIN_RK3568("gpu", BIT(0), BIT(1), false), 847 + [RK3568_PD_VI] = DOMAIN_RK3568("vi", BIT(6), BIT(3), false), 848 + [RK3568_PD_VO] = DOMAIN_RK3568("vo", BIT(7), BIT(4), false), 849 + [RK3568_PD_RGA] = DOMAIN_RK3568("rga", BIT(5), BIT(5), false), 850 + [RK3568_PD_VPU] = DOMAIN_RK3568("vpu", BIT(2), BIT(6), false), 851 + [RK3568_PD_RKVDEC] = DOMAIN_RK3568("vdec", BIT(4), BIT(8), false), 852 + [RK3568_PD_RKVENC] = DOMAIN_RK3568("venc", BIT(3), BIT(7), false), 853 + [RK3568_PD_PIPE] = DOMAIN_RK3568("pipe", BIT(8), BIT(11), false), 853 854 }; 854 855 855 856 static const struct rockchip_pmu_info px30_pmu = { ··· 999 976 .domain_info = rk3399_pm_domains, 1000 977 }; 1001 978 979 + static const struct rockchip_pmu_info rk3568_pmu = { 980 + .pwr_offset = 0xa0, 981 + .status_offset = 0x98, 982 + .req_offset = 0x50, 983 + .idle_offset = 0x68, 984 + .ack_offset = 0x60, 985 + 986 + .num_domains = ARRAY_SIZE(rk3568_pm_domains), 987 + .domain_info = rk3568_pm_domains, 988 + }; 989 + 1002 990 static const struct of_device_id rockchip_pm_domain_dt_match[] = { 1003 991 { 1004 992 .compatible = "rockchip,px30-power-controller", ··· 1054 1020 { 1055 1021 .compatible = "rockchip,rk3399-power-controller", 1056 1022 .data = (void *)&rk3399_pmu, 1023 + }, 1024 + { 1025 + .compatible = "rockchip,rk3568-power-controller", 1026 + .data = (void *)&rk3568_pmu, 1057 1027 }, 1058 1028 { /* sentinel */ }, 1059 1029 };
+1 -3
drivers/soc/ti/smartreflex.c
··· 846 846 847 847 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 848 848 sr_info->base = devm_ioremap_resource(&pdev->dev, mem); 849 - if (IS_ERR(sr_info->base)) { 850 - dev_err(&pdev->dev, "%s: ioremap fail\n", __func__); 849 + if (IS_ERR(sr_info->base)) 851 850 return PTR_ERR(sr_info->base); 852 - } 853 851 854 852 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 855 853
+1 -3
drivers/soc/ti/wkup_m3_ipc.c
··· 445 445 446 446 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 447 447 m3_ipc->ipc_mem_base = devm_ioremap_resource(dev, res); 448 - if (IS_ERR(m3_ipc->ipc_mem_base)) { 449 - dev_err(dev, "could not ioremap ipc_mem\n"); 448 + if (IS_ERR(m3_ipc->ipc_mem_base)) 450 449 return PTR_ERR(m3_ipc->ipc_mem_base); 451 - } 452 450 453 451 irq = platform_get_irq(pdev, 0); 454 452 if (!irq) {
+22
include/dt-bindings/power/imx8mm-power.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */ 2 + /* 3 + * Copyright (C) 2020 Pengutronix, Lucas Stach <kernel@pengutronix.de> 4 + */ 5 + 6 + #ifndef __DT_BINDINGS_IMX8MM_POWER_H__ 7 + #define __DT_BINDINGS_IMX8MM_POWER_H__ 8 + 9 + #define IMX8MM_POWER_DOMAIN_HSIOMIX 0 10 + #define IMX8MM_POWER_DOMAIN_PCIE 1 11 + #define IMX8MM_POWER_DOMAIN_OTG1 2 12 + #define IMX8MM_POWER_DOMAIN_OTG2 3 13 + #define IMX8MM_POWER_DOMAIN_GPUMIX 4 14 + #define IMX8MM_POWER_DOMAIN_GPU 5 15 + #define IMX8MM_POWER_DOMAIN_VPUMIX 6 16 + #define IMX8MM_POWER_DOMAIN_VPUG1 7 17 + #define IMX8MM_POWER_DOMAIN_VPUG2 8 18 + #define IMX8MM_POWER_DOMAIN_VPUH1 9 19 + #define IMX8MM_POWER_DOMAIN_DISPMIX 10 20 + #define IMX8MM_POWER_DOMAIN_MIPI 11 21 + 22 + #endif
+15
include/dt-bindings/power/imx8mn-power.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */ 2 + /* 3 + * Copyright (C) 2020 Compass Electronics Group, LLC 4 + */ 5 + 6 + #ifndef __DT_BINDINGS_IMX8MN_POWER_H__ 7 + #define __DT_BINDINGS_IMX8MN_POWER_H__ 8 + 9 + #define IMX8MN_POWER_DOMAIN_HSIOMIX 0 10 + #define IMX8MN_POWER_DOMAIN_OTG1 1 11 + #define IMX8MN_POWER_DOMAIN_GPUMIX 2 12 + #define IMX8MN_POWER_DOMAIN_DISPMIX 3 13 + #define IMX8MN_POWER_DOMAIN_MIPI 4 14 + 15 + #endif
+21
include/dt-bindings/power/qcom-rpmpd.h
··· 81 81 #define SC7280_LCX 7 82 82 #define SC7280_MSS 8 83 83 84 + /* SC8180X Power Domain Indexes */ 85 + #define SC8180X_CX 0 86 + #define SC8180X_CX_AO 1 87 + #define SC8180X_EBI 2 88 + #define SC8180X_GFX 3 89 + #define SC8180X_LCX 4 90 + #define SC8180X_LMX 5 91 + #define SC8180X_MMCX 6 92 + #define SC8180X_MMCX_AO 7 93 + #define SC8180X_MSS 8 94 + #define SC8180X_MX 9 95 + #define SC8180X_MX_AO 10 96 + 84 97 /* SDM845 Power Domain performance levels */ 85 98 #define RPMH_REGULATOR_LEVEL_RETENTION 16 86 99 #define RPMH_REGULATOR_LEVEL_MIN_SVS 48 ··· 107 94 #define RPMH_REGULATOR_LEVEL_NOM_L2 336 108 95 #define RPMH_REGULATOR_LEVEL_TURBO 384 109 96 #define RPMH_REGULATOR_LEVEL_TURBO_L1 416 97 + 98 + /* MDM9607 Power Domains */ 99 + #define MDM9607_VDDCX 0 100 + #define MDM9607_VDDCX_AO 1 101 + #define MDM9607_VDDCX_VFL 2 102 + #define MDM9607_VDDMX 3 103 + #define MDM9607_VDDMX_AO 4 104 + #define MDM9607_VDDMX_VFL 5 110 105 111 106 /* MSM8939 Power Domains */ 112 107 #define MSM8939_VDDMDCX 0
+32
include/dt-bindings/power/rk3568-power.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __DT_BINDINGS_POWER_RK3568_POWER_H__ 3 + #define __DT_BINDINGS_POWER_RK3568_POWER_H__ 4 + 5 + /* VD_CORE */ 6 + #define RK3568_PD_CPU_0 0 7 + #define RK3568_PD_CPU_1 1 8 + #define RK3568_PD_CPU_2 2 9 + #define RK3568_PD_CPU_3 3 10 + #define RK3568_PD_CORE_ALIVE 4 11 + 12 + /* VD_PMU */ 13 + #define RK3568_PD_PMU 5 14 + 15 + /* VD_NPU */ 16 + #define RK3568_PD_NPU 6 17 + 18 + /* VD_GPU */ 19 + #define RK3568_PD_GPU 7 20 + 21 + /* VD_LOGIC */ 22 + #define RK3568_PD_VI 8 23 + #define RK3568_PD_VO 9 24 + #define RK3568_PD_RGA 10 25 + #define RK3568_PD_VPU 11 26 + #define RK3568_PD_CENTER 12 27 + #define RK3568_PD_RKVDEC 13 28 + #define RK3568_PD_RKVENC 14 29 + #define RK3568_PD_PIPE 15 30 + #define RK3568_PD_LOGIC_ALIVE 16 31 + 32 + #endif
+267
include/linux/arm_ffa.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * Copyright (C) 2021 ARM Ltd. 4 + */ 5 + 6 + #ifndef _LINUX_ARM_FFA_H 7 + #define _LINUX_ARM_FFA_H 8 + 9 + #include <linux/device.h> 10 + #include <linux/module.h> 11 + #include <linux/types.h> 12 + #include <linux/uuid.h> 13 + 14 + /* FFA Bus/Device/Driver related */ 15 + struct ffa_device { 16 + int vm_id; 17 + bool mode_32bit; 18 + uuid_t uuid; 19 + struct device dev; 20 + }; 21 + 22 + #define to_ffa_dev(d) container_of(d, struct ffa_device, dev) 23 + 24 + struct ffa_device_id { 25 + uuid_t uuid; 26 + }; 27 + 28 + struct ffa_driver { 29 + const char *name; 30 + int (*probe)(struct ffa_device *sdev); 31 + void (*remove)(struct ffa_device *sdev); 32 + const struct ffa_device_id *id_table; 33 + 34 + struct device_driver driver; 35 + }; 36 + 37 + #define to_ffa_driver(d) container_of(d, struct ffa_driver, driver) 38 + 39 + static inline void ffa_dev_set_drvdata(struct ffa_device *fdev, void *data) 40 + { 41 + fdev->dev.driver_data = data; 42 + } 43 + 44 + #if IS_REACHABLE(CONFIG_ARM_FFA_TRANSPORT) 45 + struct ffa_device *ffa_device_register(const uuid_t *uuid, int vm_id); 46 + void ffa_device_unregister(struct ffa_device *ffa_dev); 47 + int ffa_driver_register(struct ffa_driver *driver, struct module *owner, 48 + const char *mod_name); 49 + void ffa_driver_unregister(struct ffa_driver *driver); 50 + bool ffa_device_is_valid(struct ffa_device *ffa_dev); 51 + const struct ffa_dev_ops *ffa_dev_ops_get(struct ffa_device *dev); 52 + 53 + #else 54 + static inline 55 + struct ffa_device *ffa_device_register(const uuid_t *uuid, int vm_id) 56 + { 57 + return NULL; 58 + } 59 + 60 + static inline void ffa_device_unregister(struct ffa_device *dev) {} 61 + 62 + static inline int 63 + ffa_driver_register(struct ffa_driver *driver, struct module *owner, 64 + const char *mod_name) 65 + { 66 + return -EINVAL; 67 + } 68 + 69 + static inline void ffa_driver_unregister(struct ffa_driver *driver) {} 70 + 71 + static inline 72 + bool ffa_device_is_valid(struct ffa_device *ffa_dev) { return false; } 73 + 74 + static inline 75 + const struct ffa_dev_ops *ffa_dev_ops_get(struct ffa_device *dev) 76 + { 77 + return NULL; 78 + } 79 + #endif /* CONFIG_ARM_FFA_TRANSPORT */ 80 + 81 + #define ffa_register(driver) \ 82 + ffa_driver_register(driver, THIS_MODULE, KBUILD_MODNAME) 83 + #define ffa_unregister(driver) \ 84 + ffa_driver_unregister(driver) 85 + 86 + /** 87 + * module_ffa_driver() - Helper macro for registering a psa_ffa driver 88 + * @__ffa_driver: ffa_driver structure 89 + * 90 + * Helper macro for psa_ffa drivers to set up proper module init / exit 91 + * functions. Replaces module_init() and module_exit() and keeps people from 92 + * printing pointless things to the kernel log when their driver is loaded. 93 + */ 94 + #define module_ffa_driver(__ffa_driver) \ 95 + module_driver(__ffa_driver, ffa_register, ffa_unregister) 96 + 97 + /* FFA transport related */ 98 + struct ffa_partition_info { 99 + u16 id; 100 + u16 exec_ctxt; 101 + /* partition supports receipt of direct requests */ 102 + #define FFA_PARTITION_DIRECT_RECV BIT(0) 103 + /* partition can send direct requests. */ 104 + #define FFA_PARTITION_DIRECT_SEND BIT(1) 105 + /* partition can send and receive indirect messages. */ 106 + #define FFA_PARTITION_INDIRECT_MSG BIT(2) 107 + u32 properties; 108 + }; 109 + 110 + /* For use with FFA_MSG_SEND_DIRECT_{REQ,RESP} which pass data via registers */ 111 + struct ffa_send_direct_data { 112 + unsigned long data0; /* w3/x3 */ 113 + unsigned long data1; /* w4/x4 */ 114 + unsigned long data2; /* w5/x5 */ 115 + unsigned long data3; /* w6/x6 */ 116 + unsigned long data4; /* w7/x7 */ 117 + }; 118 + 119 + struct ffa_mem_region_addr_range { 120 + /* The base IPA of the constituent memory region, aligned to 4 kiB */ 121 + u64 address; 122 + /* The number of 4 kiB pages in the constituent memory region. */ 123 + u32 pg_cnt; 124 + u32 reserved; 125 + }; 126 + 127 + struct ffa_composite_mem_region { 128 + /* 129 + * The total number of 4 kiB pages included in this memory region. This 130 + * must be equal to the sum of page counts specified in each 131 + * `struct ffa_mem_region_addr_range`. 132 + */ 133 + u32 total_pg_cnt; 134 + /* The number of constituents included in this memory region range */ 135 + u32 addr_range_cnt; 136 + u64 reserved; 137 + /** An array of `addr_range_cnt` memory region constituents. */ 138 + struct ffa_mem_region_addr_range constituents[]; 139 + }; 140 + 141 + struct ffa_mem_region_attributes { 142 + /* The ID of the VM to which the memory is being given or shared. */ 143 + u16 receiver; 144 + /* 145 + * The permissions with which the memory region should be mapped in the 146 + * receiver's page table. 147 + */ 148 + #define FFA_MEM_EXEC BIT(3) 149 + #define FFA_MEM_NO_EXEC BIT(2) 150 + #define FFA_MEM_RW BIT(1) 151 + #define FFA_MEM_RO BIT(0) 152 + u8 attrs; 153 + /* 154 + * Flags used during FFA_MEM_RETRIEVE_REQ and FFA_MEM_RETRIEVE_RESP 155 + * for memory regions with multiple borrowers. 156 + */ 157 + #define FFA_MEM_RETRIEVE_SELF_BORROWER BIT(0) 158 + u8 flag; 159 + u32 composite_off; 160 + /* 161 + * Offset in bytes from the start of the outer `ffa_memory_region` to 162 + * an `struct ffa_mem_region_addr_range`. 163 + */ 164 + u64 reserved; 165 + }; 166 + 167 + struct ffa_mem_region { 168 + /* The ID of the VM/owner which originally sent the memory region */ 169 + u16 sender_id; 170 + #define FFA_MEM_NORMAL BIT(5) 171 + #define FFA_MEM_DEVICE BIT(4) 172 + 173 + #define FFA_MEM_WRITE_BACK (3 << 2) 174 + #define FFA_MEM_NON_CACHEABLE (1 << 2) 175 + 176 + #define FFA_DEV_nGnRnE (0 << 2) 177 + #define FFA_DEV_nGnRE (1 << 2) 178 + #define FFA_DEV_nGRE (2 << 2) 179 + #define FFA_DEV_GRE (3 << 2) 180 + 181 + #define FFA_MEM_NON_SHAREABLE (0) 182 + #define FFA_MEM_OUTER_SHAREABLE (2) 183 + #define FFA_MEM_INNER_SHAREABLE (3) 184 + u8 attributes; 185 + u8 reserved_0; 186 + /* 187 + * Clear memory region contents after unmapping it from the sender and 188 + * before mapping it for any receiver. 189 + */ 190 + #define FFA_MEM_CLEAR BIT(0) 191 + /* 192 + * Whether the hypervisor may time slice the memory sharing or retrieval 193 + * operation. 194 + */ 195 + #define FFA_TIME_SLICE_ENABLE BIT(1) 196 + 197 + #define FFA_MEM_RETRIEVE_TYPE_IN_RESP (0 << 3) 198 + #define FFA_MEM_RETRIEVE_TYPE_SHARE (1 << 3) 199 + #define FFA_MEM_RETRIEVE_TYPE_LEND (2 << 3) 200 + #define FFA_MEM_RETRIEVE_TYPE_DONATE (3 << 3) 201 + 202 + #define FFA_MEM_RETRIEVE_ADDR_ALIGN_HINT BIT(9) 203 + #define FFA_MEM_RETRIEVE_ADDR_ALIGN(x) ((x) << 5) 204 + /* Flags to control behaviour of the transaction. */ 205 + u32 flags; 206 + #define HANDLE_LOW_MASK GENMASK_ULL(31, 0) 207 + #define HANDLE_HIGH_MASK GENMASK_ULL(63, 32) 208 + #define HANDLE_LOW(x) ((u32)(FIELD_GET(HANDLE_LOW_MASK, (x)))) 209 + #define HANDLE_HIGH(x) ((u32)(FIELD_GET(HANDLE_HIGH_MASK, (x)))) 210 + 211 + #define PACK_HANDLE(l, h) \ 212 + (FIELD_PREP(HANDLE_LOW_MASK, (l)) | FIELD_PREP(HANDLE_HIGH_MASK, (h))) 213 + /* 214 + * A globally-unique ID assigned by the hypervisor for a region 215 + * of memory being sent between VMs. 216 + */ 217 + u64 handle; 218 + /* 219 + * An implementation defined value associated with the receiver and the 220 + * memory region. 221 + */ 222 + u64 tag; 223 + u32 reserved_1; 224 + /* 225 + * The number of `ffa_mem_region_attributes` entries included in this 226 + * transaction. 227 + */ 228 + u32 ep_count; 229 + /* 230 + * An array of endpoint memory access descriptors. 231 + * Each one specifies a memory region offset, an endpoint and the 232 + * attributes with which this memory region should be mapped in that 233 + * endpoint's page table. 234 + */ 235 + struct ffa_mem_region_attributes ep_mem_access[]; 236 + }; 237 + 238 + #define COMPOSITE_OFFSET(x) \ 239 + (offsetof(struct ffa_mem_region, ep_mem_access[x])) 240 + #define CONSTITUENTS_OFFSET(x) \ 241 + (offsetof(struct ffa_composite_mem_region, constituents[x])) 242 + #define COMPOSITE_CONSTITUENTS_OFFSET(x, y) \ 243 + (COMPOSITE_OFFSET(x) + CONSTITUENTS_OFFSET(y)) 244 + 245 + struct ffa_mem_ops_args { 246 + bool use_txbuf; 247 + u32 nattrs; 248 + u32 flags; 249 + u64 tag; 250 + u64 g_handle; 251 + struct scatterlist *sg; 252 + struct ffa_mem_region_attributes *attrs; 253 + }; 254 + 255 + struct ffa_dev_ops { 256 + u32 (*api_version_get)(void); 257 + int (*partition_info_get)(const char *uuid_str, 258 + struct ffa_partition_info *buffer); 259 + void (*mode_32bit_set)(struct ffa_device *dev); 260 + int (*sync_send_receive)(struct ffa_device *dev, 261 + struct ffa_send_direct_data *data); 262 + int (*memory_reclaim)(u64 g_handle, u32 flags); 263 + int (*memory_share)(struct ffa_device *dev, 264 + struct ffa_mem_ops_args *args); 265 + }; 266 + 267 + #endif /* _LINUX_ARM_FFA_H */
+22
include/linux/reset-controller.h
··· 79 79 unsigned int nr_resets; 80 80 }; 81 81 82 + #if IS_ENABLED(CONFIG_RESET_CONTROLLER) 82 83 int reset_controller_register(struct reset_controller_dev *rcdev); 83 84 void reset_controller_unregister(struct reset_controller_dev *rcdev); 84 85 ··· 89 88 90 89 void reset_controller_add_lookup(struct reset_control_lookup *lookup, 91 90 unsigned int num_entries); 91 + #else 92 + static inline int reset_controller_register(struct reset_controller_dev *rcdev) 93 + { 94 + return 0; 95 + } 96 + 97 + static inline void reset_controller_unregister(struct reset_controller_dev *rcdev) 98 + { 99 + } 100 + 101 + static inline int devm_reset_controller_register(struct device *dev, 102 + struct reset_controller_dev *rcdev) 103 + { 104 + return 0; 105 + } 106 + 107 + static inline void reset_controller_add_lookup(struct reset_control_lookup *lookup, 108 + unsigned int num_entries) 109 + { 110 + } 111 + #endif 92 112 93 113 #endif
+3 -3
include/memory/renesas-rpc-if.h
··· 19 19 RPCIF_DATA_OUT, 20 20 }; 21 21 22 - struct rpcif_op { 22 + struct rpcif_op { 23 23 struct { 24 24 u8 buswidth; 25 25 u8 opcode; ··· 57 57 } data; 58 58 }; 59 59 60 - struct rpcif { 60 + struct rpcif { 61 61 struct device *dev; 62 62 void __iomem *dirmap; 63 63 struct regmap *regmap; ··· 76 76 u32 ddr; /* DRDRENR or SMDRENR */ 77 77 }; 78 78 79 - int rpcif_sw_init(struct rpcif *rpc, struct device *dev); 79 + int rpcif_sw_init(struct rpcif *rpc, struct device *dev); 80 80 void rpcif_hw_init(struct rpcif *rpc, bool hyperflash); 81 81 void rpcif_prepare(struct rpcif *rpc, const struct rpcif_op *op, u64 *offs, 82 82 size_t *len);
+47 -18
include/soc/tegra/mc.h
··· 10 10 #include <linux/debugfs.h> 11 11 #include <linux/err.h> 12 12 #include <linux/interconnect-provider.h> 13 + #include <linux/irq.h> 13 14 #include <linux/reset-controller.h> 14 15 #include <linux/types.h> 15 16 ··· 18 17 struct device; 19 18 struct page; 20 19 21 - struct tegra_smmu_enable { 22 - unsigned int reg; 23 - unsigned int bit; 24 - }; 25 - 26 20 struct tegra_mc_timing { 27 21 unsigned long rate; 28 22 29 23 u32 *emem_data; 30 24 }; 31 25 32 - /* latency allowance */ 33 - struct tegra_mc_la { 34 - unsigned int reg; 35 - unsigned int shift; 36 - unsigned int mask; 37 - unsigned int def; 38 - }; 39 - 40 26 struct tegra_mc_client { 41 27 unsigned int id; 42 28 const char *name; 43 - unsigned int swgroup; 29 + /* 30 + * For Tegra210 and earlier, this is the SWGROUP ID used for IOVA translations in the 31 + * Tegra SMMU, whereas on Tegra186 and later this is the ID used to override the ARM SMMU 32 + * stream ID used for IOVA translations for the given memory client. 33 + */ 34 + union { 35 + unsigned int swgroup; 36 + unsigned int sid; 37 + }; 44 38 45 39 unsigned int fifo_size; 46 40 47 - struct tegra_smmu_enable smmu; 48 - struct tegra_mc_la la; 41 + struct { 42 + /* Tegra SMMU enable (Tegra210 and earlier) */ 43 + struct { 44 + unsigned int reg; 45 + unsigned int bit; 46 + } smmu; 47 + 48 + /* latency allowance */ 49 + struct { 50 + unsigned int reg; 51 + unsigned int shift; 52 + unsigned int mask; 53 + unsigned int def; 54 + } la; 55 + 56 + /* stream ID overrides (Tegra186 and later) */ 57 + struct { 58 + unsigned int override; 59 + unsigned int security; 60 + } sid; 61 + } regs; 49 62 }; 50 63 51 64 struct tegra_smmu_swgroup { ··· 170 155 void *data); 171 156 }; 172 157 158 + struct tegra_mc_ops { 159 + /* 160 + * @probe: Callback to set up SoC-specific bits of the memory controller. This is called 161 + * after basic, common set up that is done by the SoC-agnostic bits. 162 + */ 163 + int (*probe)(struct tegra_mc *mc); 164 + void (*remove)(struct tegra_mc *mc); 165 + int (*suspend)(struct tegra_mc *mc); 166 + int (*resume)(struct tegra_mc *mc); 167 + irqreturn_t (*handle_irq)(int irq, void *data); 168 + int (*probe_device)(struct tegra_mc *mc, struct device *dev); 169 + }; 170 + 173 171 struct tegra_mc_soc { 174 172 const struct tegra_mc_client *clients; 175 173 unsigned int num_clients; ··· 204 176 unsigned int num_resets; 205 177 206 178 const struct tegra_mc_icc_ops *icc_ops; 207 - 208 - int (*init)(struct tegra_mc *mc); 179 + const struct tegra_mc_ops *ops; 209 180 }; 210 181 211 182 struct tegra_mc { ··· 244 217 return ERR_PTR(-ENODEV); 245 218 } 246 219 #endif 220 + 221 + int tegra_mc_probe_device(struct tegra_mc *mc, struct device *dev); 247 222 248 223 #endif /* __SOC_TEGRA_MC_H__ */