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

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

Pull ARM SoC updates from Arnd Bergmann:
"The code changes are mostly for 32-bit platforms and include:

- Lots of updates for the Nvidia Tegra platform, including cpuidle,
pmc, and dt-binding changes

- Microchip at91 power management updates for the recently added
sam9x60 SoC

- Treewide setup_irq deprecation by afzal mohammed

- STMicroelectronics stm32 gains earlycon support

- Renesas platforms with Cortex-A9 can now use the global timer

- Some TI OMAP2+ platforms gain cpuidle support

- Various cleanups for the i.MX6 and Orion platforms, as well as
Kconfig files across all platforms"

* tag 'arm-soc-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (75 commits)
ARM: qcom: Add support for IPQ40xx
ARM: mmp: replace setup_irq() by request_irq()
ARM: cns3xxx: replace setup_irq() by request_irq()
ARM: spear: replace setup_irq() by request_irq()
ARM: ep93xx: Replace setup_irq() by request_irq()
ARM: iop32x: replace setup_irq() by request_irq()
arm: mach-dove: Mark dove_io_desc as __maybe_unused
ARM: orion: replace setup_irq() by request_irq()
ARM: debug: stm32: add UART early console support for STM32MP1
ARM: debug: stm32: add UART early console support for STM32H7
ARM: debug: stm32: add UART early console configuration for STM32F7
ARM: debug: stm32: add UART early console configuration for STM32F4
cpuidle: tegra: Disable CC6 state if LP2 unavailable
cpuidle: tegra: Squash Tegra114 driver into the common driver
cpuidle: tegra: Squash Tegra30 driver into the common driver
cpuidle: Refactor and move out NVIDIA Tegra20 driver into drivers/cpuidle
ARM: tegra: cpuidle: Remove unnecessary memory barrier
ARM: tegra: cpuidle: Make abort_flag atomic
ARM: tegra: cpuidle: Handle case where secondary CPU hangs on entering LP2
ARM: tegra: Make outer_disable() open-coded
...

+2290 -1448
+2
Documentation/devicetree/bindings/arm/cpus.yaml
··· 212 212 - rockchip,rk3066-smp 213 213 - socionext,milbeaut-m10v-smp 214 214 - ste,dbx500-smp 215 + - ti,am3352 216 + - ti,am4372 215 217 216 218 cpu-release-addr: 217 219 $ref: '/schemas/types.yaml#/definitions/uint64'
-300
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.txt
··· 1 - NVIDIA Tegra Power Management Controller (PMC) 2 - 3 - == Power Management Controller Node == 4 - 5 - The PMC block interacts with an external Power Management Unit. The PMC 6 - mostly controls the entry and exit of the system from different sleep 7 - modes. It provides power-gating controllers for SoC and CPU power-islands. 8 - 9 - Required properties: 10 - - name : Should be pmc 11 - - compatible : Should contain one of the following: 12 - For Tegra20 must contain "nvidia,tegra20-pmc". 13 - For Tegra30 must contain "nvidia,tegra30-pmc". 14 - For Tegra114 must contain "nvidia,tegra114-pmc" 15 - For Tegra124 must contain "nvidia,tegra124-pmc" 16 - For Tegra132 must contain "nvidia,tegra124-pmc" 17 - For Tegra210 must contain "nvidia,tegra210-pmc" 18 - - reg : Offset and length of the register set for the device 19 - - clocks : Must contain an entry for each entry in clock-names. 20 - See ../clocks/clock-bindings.txt for details. 21 - - clock-names : Must include the following entries: 22 - "pclk" (The Tegra clock of that name), 23 - "clk32k_in" (The 32KHz clock input to Tegra). 24 - 25 - Optional properties: 26 - - nvidia,invert-interrupt : If present, inverts the PMU interrupt signal. 27 - The PMU is an external Power Management Unit, whose interrupt output 28 - signal is fed into the PMC. This signal is optionally inverted, and then 29 - fed into the ARM GIC. The PMC is not involved in the detection or 30 - handling of this interrupt signal, merely its inversion. 31 - - nvidia,suspend-mode : The suspend mode that the platform should use. 32 - Valid values are 0, 1 and 2: 33 - 0 (LP0): CPU + Core voltage off and DRAM in self-refresh 34 - 1 (LP1): CPU voltage off and DRAM in self-refresh 35 - 2 (LP2): CPU voltage off 36 - - nvidia,core-power-req-active-high : Boolean, core power request active-high 37 - - nvidia,sys-clock-req-active-high : Boolean, system clock request active-high 38 - - nvidia,combined-power-req : Boolean, combined power request for CPU & Core 39 - - nvidia,cpu-pwr-good-en : Boolean, CPU power good signal (from PMIC to PMC) 40 - is enabled. 41 - 42 - Required properties when nvidia,suspend-mode is specified: 43 - - nvidia,cpu-pwr-good-time : CPU power good time in uS. 44 - - nvidia,cpu-pwr-off-time : CPU power off time in uS. 45 - - nvidia,core-pwr-good-time : <Oscillator-stable-time Power-stable-time> 46 - Core power good time in uS. 47 - - nvidia,core-pwr-off-time : Core power off time in uS. 48 - 49 - Required properties when nvidia,suspend-mode=<0>: 50 - - nvidia,lp0-vec : <start length> Starting address and length of LP0 vector 51 - The LP0 vector contains the warm boot code that is executed by AVP when 52 - resuming from the LP0 state. The AVP (Audio-Video Processor) is an ARM7 53 - processor and always being the first boot processor when chip is power on 54 - or resume from deep sleep mode. When the system is resumed from the deep 55 - sleep mode, the warm boot code will restore some PLLs, clocks and then 56 - bring up CPU0 for resuming the system. 57 - 58 - Hardware-triggered thermal reset: 59 - On Tegra30, Tegra114 and Tegra124, if the 'i2c-thermtrip' subnode exists, 60 - hardware-triggered thermal reset will be enabled. 61 - 62 - Required properties for hardware-triggered thermal reset (inside 'i2c-thermtrip'): 63 - - nvidia,i2c-controller-id : ID of I2C controller to send poweroff command to. Valid values are 64 - described in section 9.2.148 "APBDEV_PMC_SCRATCH53_0" of the 65 - Tegra K1 Technical Reference Manual. 66 - - nvidia,bus-addr : Bus address of the PMU on the I2C bus 67 - - nvidia,reg-addr : I2C register address to write poweroff command to 68 - - nvidia,reg-data : Poweroff command to write to PMU 69 - 70 - Optional properties for hardware-triggered thermal reset (inside 'i2c-thermtrip'): 71 - - nvidia,pinmux-id : Pinmux used by the hardware when issuing poweroff command. 72 - Defaults to 0. Valid values are described in section 12.5.2 73 - "Pinmux Support" of the Tegra4 Technical Reference Manual. 74 - 75 - Optional nodes: 76 - - powergates : This node contains a hierarchy of power domain nodes, which 77 - should match the powergates on the Tegra SoC. See "Powergate 78 - Nodes" below. 79 - 80 - Example: 81 - 82 - / SoC dts including file 83 - pmc@7000f400 { 84 - compatible = "nvidia,tegra20-pmc"; 85 - reg = <0x7000e400 0x400>; 86 - clocks = <&tegra_car 110>, <&clk32k_in>; 87 - clock-names = "pclk", "clk32k_in"; 88 - nvidia,invert-interrupt; 89 - nvidia,suspend-mode = <1>; 90 - nvidia,cpu-pwr-good-time = <2000>; 91 - nvidia,cpu-pwr-off-time = <100>; 92 - nvidia,core-pwr-good-time = <3845 3845>; 93 - nvidia,core-pwr-off-time = <458>; 94 - nvidia,core-power-req-active-high; 95 - nvidia,sys-clock-req-active-high; 96 - nvidia,lp0-vec = <0xbdffd000 0x2000>; 97 - }; 98 - 99 - / Tegra board dts file 100 - { 101 - ... 102 - pmc@7000f400 { 103 - i2c-thermtrip { 104 - nvidia,i2c-controller-id = <4>; 105 - nvidia,bus-addr = <0x40>; 106 - nvidia,reg-addr = <0x36>; 107 - nvidia,reg-data = <0x2>; 108 - }; 109 - }; 110 - ... 111 - clocks { 112 - compatible = "simple-bus"; 113 - #address-cells = <1>; 114 - #size-cells = <0>; 115 - 116 - clk32k_in: clock { 117 - compatible = "fixed-clock"; 118 - reg=<0>; 119 - #clock-cells = <0>; 120 - clock-frequency = <32768>; 121 - }; 122 - }; 123 - ... 124 - }; 125 - 126 - 127 - == Powergate Nodes == 128 - 129 - Each of the powergate nodes represents a power-domain on the Tegra SoC 130 - that can be power-gated by the Tegra PMC. The name of the powergate node 131 - should be one of the below. Note that not every powergate is applicable 132 - to all Tegra devices and the following list shows which powergates are 133 - applicable to which devices. Please refer to the Tegra TRM for more 134 - details on the various powergates. 135 - 136 - Name Description Devices Applicable 137 - 3d 3D Graphics Tegra20/114/124/210 138 - 3d0 3D Graphics 0 Tegra30 139 - 3d1 3D Graphics 1 Tegra30 140 - aud Audio Tegra210 141 - dfd Debug Tegra210 142 - dis Display A Tegra114/124/210 143 - disb Display B Tegra114/124/210 144 - heg 2D Graphics Tegra30/114/124/210 145 - iram Internal RAM Tegra124/210 146 - mpe MPEG Encode All 147 - nvdec NVIDIA Video Decode Engine Tegra210 148 - nvjpg NVIDIA JPEG Engine Tegra210 149 - pcie PCIE Tegra20/30/124/210 150 - sata SATA Tegra30/124/210 151 - sor Display interfaces Tegra124/210 152 - ve2 Video Encode Engine 2 Tegra210 153 - venc Video Encode Engine All 154 - vdec Video Decode Engine Tegra20/30/114/124 155 - vic Video Imaging Compositor Tegra124/210 156 - xusba USB Partition A Tegra114/124/210 157 - xusbb USB Partition B Tegra114/124/210 158 - xusbc USB Partition C Tegra114/124/210 159 - 160 - Required properties: 161 - - clocks: Must contain an entry for each clock required by the PMC for 162 - controlling a power-gate. See ../clocks/clock-bindings.txt for details. 163 - - resets: Must contain an entry for each reset required by the PMC for 164 - controlling a power-gate. See ../reset/reset.txt for details. 165 - - #power-domain-cells: Must be 0. 166 - 167 - Example: 168 - 169 - pmc: pmc@7000e400 { 170 - compatible = "nvidia,tegra210-pmc"; 171 - reg = <0x0 0x7000e400 0x0 0x400>; 172 - clocks = <&tegra_car TEGRA210_CLK_PCLK>, <&clk32k_in>; 173 - clock-names = "pclk", "clk32k_in"; 174 - 175 - powergates { 176 - pd_audio: aud { 177 - clocks = <&tegra_car TEGRA210_CLK_APE>, 178 - <&tegra_car TEGRA210_CLK_APB2APE>; 179 - resets = <&tegra_car 198>; 180 - #power-domain-cells = <0>; 181 - }; 182 - }; 183 - }; 184 - 185 - 186 - == Powergate Clients == 187 - 188 - Hardware blocks belonging to a power domain should contain a "power-domains" 189 - property that is a phandle pointing to the corresponding powergate node. 190 - 191 - Example: 192 - 193 - adma: adma@702e2000 { 194 - ... 195 - power-domains = <&pd_audio>; 196 - ... 197 - }; 198 - 199 - == Pad Control == 200 - 201 - On Tegra SoCs a pad is a set of pins which are configured as a group. 202 - The pin grouping is a fixed attribute of the hardware. The PMC can be 203 - used to set pad power state and signaling voltage. A pad can be either 204 - in active or power down mode. The support for power state and signaling 205 - voltage configuration varies depending on the pad in question. 3.3 V and 206 - 1.8 V signaling voltages are supported on pins where software 207 - controllable signaling voltage switching is available. 208 - 209 - The pad configuration state nodes are placed under the pmc node and they 210 - are referred to by the pinctrl client properties. For more information 211 - see Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt. 212 - The pad name should be used as the value of the pins property in pin 213 - configuration nodes. 214 - 215 - The following pads are present on Tegra124 and Tegra132: 216 - audio bb cam comp 217 - csia csb cse dsi 218 - dsib dsic dsid hdmi 219 - hsic hv lvds mipi-bias 220 - nand pex-bias pex-clk1 pex-clk2 221 - pex-cntrl sdmmc1 sdmmc3 sdmmc4 222 - sys_ddc uart usb0 usb1 223 - usb2 usb_bias 224 - 225 - The following pads are present on Tegra210: 226 - audio audio-hv cam csia 227 - csib csic csid csie 228 - csif dbg debug-nonao dmic 229 - dp dsi dsib dsic 230 - dsid emmc emmc2 gpio 231 - hdmi hsic lvds mipi-bias 232 - pex-bias pex-clk1 pex-clk2 pex-cntrl 233 - sdmmc1 sdmmc3 spi spi-hv 234 - uart usb0 usb1 usb2 235 - usb3 usb-bias 236 - 237 - Required pin configuration properties: 238 - - pins: Must contain name of the pad(s) to be configured. 239 - 240 - Optional pin configuration properties: 241 - - low-power-enable: Configure the pad into power down mode 242 - - low-power-disable: Configure the pad into active mode 243 - - power-source: Must contain either TEGRA_IO_PAD_VOLTAGE_1V8 244 - or TEGRA_IO_PAD_VOLTAGE_3V3 to select between signaling voltages. 245 - The values are defined in 246 - include/dt-bindings/pinctrl/pinctrl-tegra-io-pad.h. 247 - 248 - Note: The power state can be configured on all of the Tegra124 and 249 - Tegra132 pads. None of the Tegra124 or Tegra132 pads support 250 - signaling voltage switching. 251 - 252 - Note: All of the listed Tegra210 pads except pex-cntrl support power 253 - state configuration. Signaling voltage switching is supported on 254 - following Tegra210 pads: audio, audio-hv, cam, dbg, dmic, gpio, 255 - pex-cntrl, sdmmc1, sdmmc3, spi, spi-hv, and uart. 256 - 257 - Pad configuration state example: 258 - pmc: pmc@7000e400 { 259 - compatible = "nvidia,tegra210-pmc"; 260 - reg = <0x0 0x7000e400 0x0 0x400>; 261 - clocks = <&tegra_car TEGRA210_CLK_PCLK>, <&clk32k_in>; 262 - clock-names = "pclk", "clk32k_in"; 263 - 264 - ... 265 - 266 - sdmmc1_3v3: sdmmc1-3v3 { 267 - pins = "sdmmc1"; 268 - power-source = <TEGRA_IO_PAD_VOLTAGE_3V3>; 269 - }; 270 - 271 - sdmmc1_1v8: sdmmc1-1v8 { 272 - pins = "sdmmc1"; 273 - power-source = <TEGRA_IO_PAD_VOLTAGE_1V8>; 274 - }; 275 - 276 - hdmi_off: hdmi-off { 277 - pins = "hdmi"; 278 - low-power-enable; 279 - } 280 - 281 - hdmi_on: hdmi-on { 282 - pins = "hdmi"; 283 - low-power-disable; 284 - } 285 - }; 286 - 287 - Pinctrl client example: 288 - sdmmc1: sdhci@700b0000 { 289 - ... 290 - pinctrl-names = "sdmmc-3v3", "sdmmc-1v8"; 291 - pinctrl-0 = <&sdmmc1_3v3>; 292 - pinctrl-1 = <&sdmmc1_1v8>; 293 - }; 294 - ... 295 - sor@54540000 { 296 - ... 297 - pinctrl-0 = <&hdmi_off>; 298 - pinctrl-1 = <&hdmi_on>; 299 - pinctrl-names = "hdmi-on", "hdmi-off"; 300 - };
+354
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/arm/tegra/nvidia,tegra20-pmc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Tegra Power Management Controller (PMC) 8 + 9 + maintainers: 10 + - Thierry Reding <thierry.reding@gmail.com> 11 + - Jonathan Hunter <jonathanh@nvidia.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - nvidia,tegra20-pmc 17 + - nvidia,tegra20-pmc 18 + - nvidia,tegra30-pmc 19 + - nvidia,tegra114-pmc 20 + - nvidia,tegra124-pmc 21 + - nvidia,tegra210-pmc 22 + 23 + reg: 24 + maxItems: 1 25 + description: 26 + Offset and length of the register set for the device. 27 + 28 + clock-names: 29 + items: 30 + - const: pclk 31 + - const: clk32k_in 32 + description: 33 + Must includes entries pclk and clk32k_in. 34 + pclk is the Tegra clock of that name and clk32k_in is 32KHz clock 35 + input to Tegra. 36 + 37 + clocks: 38 + maxItems: 2 39 + description: 40 + Must contain an entry for each entry in clock-names. 41 + See ../clocks/clocks-bindings.txt for details. 42 + 43 + '#clock-cells': 44 + const: 1 45 + description: 46 + Tegra PMC has clk_out_1, clk_out_2, and clk_out_3. 47 + PMC also has blink control which allows 32Khz clock output to 48 + Tegra blink pad. 49 + Consumer of PMC clock should specify the desired clock by having 50 + the clock ID in its "clocks" phandle cell with pmc clock provider. 51 + See include/dt-bindings/soc/tegra-pmc.h for the list of Tegra PMC 52 + clock IDs. 53 + 54 + '#interrupt-cells': 55 + const: 2 56 + description: 57 + Specifies number of cells needed to encode an interrupt source. 58 + The value must be 2. 59 + 60 + interrupt-controller: true 61 + 62 + nvidia,invert-interrupt: 63 + $ref: /schemas/types.yaml#/definitions/flag 64 + description: Inverts the PMU interrupt signal. 65 + The PMU is an external Power Management Unit, whose interrupt output 66 + signal is fed into the PMC. This signal is optionally inverted, and 67 + then fed into the ARM GIC. The PMC is not involved in the detection 68 + or handling of this interrupt signal, merely its inversion. 69 + 70 + nvidia,core-power-req-active-high: 71 + $ref: /schemas/types.yaml#/definitions/flag 72 + description: Core power request active-high. 73 + 74 + nvidia,sys-clock-req-active-high: 75 + $ref: /schemas/types.yaml#/definitions/flag 76 + description: System clock request active-high. 77 + 78 + nvidia,combined-power-req: 79 + $ref: /schemas/types.yaml#/definitions/flag 80 + description: combined power request for CPU and Core. 81 + 82 + nvidia,cpu-pwr-good-en: 83 + $ref: /schemas/types.yaml#/definitions/flag 84 + description: 85 + CPU power good signal from external PMIC to PMC is enabled. 86 + 87 + nvidia,suspend-mode: 88 + allOf: 89 + - $ref: /schemas/types.yaml#/definitions/uint32 90 + - enum: [0, 1, 2] 91 + description: 92 + The suspend mode that the platform should use. 93 + Mode 0 is for LP0, CPU + Core voltage off and DRAM in self-refresh 94 + Mode 1 is for LP1, CPU voltage off and DRAM in self-refresh 95 + Mode 2 is for LP2, CPU voltage off 96 + 97 + nvidia,cpu-pwr-good-time: 98 + $ref: /schemas/types.yaml#/definitions/uint32 99 + description: CPU power good time in uSec. 100 + 101 + nvidia,cpu-pwr-off-time: 102 + $ref: /schemas/types.yaml#/definitions/uint32 103 + description: CPU power off time in uSec. 104 + 105 + nvidia,core-pwr-good-time: 106 + $ref: /schemas/types.yaml#/definitions/uint32-array 107 + description: 108 + <Oscillator-stable-time Power-stable-time> 109 + Core power good time in uSec. 110 + 111 + nvidia,core-pwr-off-time: 112 + $ref: /schemas/types.yaml#/definitions/uint32 113 + description: Core power off time in uSec. 114 + 115 + nvidia,lp0-vec: 116 + $ref: /schemas/types.yaml#/definitions/uint32-array 117 + description: 118 + <start length> Starting address and length of LP0 vector. 119 + The LP0 vector contains the warm boot code that is executed 120 + by AVP when resuming from the LP0 state. 121 + The AVP (Audio-Video Processor) is an ARM7 processor and 122 + always being the first boot processor when chip is power on 123 + or resume from deep sleep mode. When the system is resumed 124 + from the deep sleep mode, the warm boot code will restore 125 + some PLLs, clocks and then brings up CPU0 for resuming the 126 + system. 127 + 128 + i2c-thermtrip: 129 + type: object 130 + description: 131 + On Tegra30, Tegra114 and Tegra124 if i2c-thermtrip subnode exists, 132 + hardware-triggered thermal reset will be enabled. 133 + 134 + properties: 135 + nvidia,i2c-controller-id: 136 + $ref: /schemas/types.yaml#/definitions/uint32 137 + description: 138 + ID of I2C controller to send poweroff command to PMU. 139 + Valid values are described in section 9.2.148 140 + "APBDEV_PMC_SCRATCH53_0" of the Tegra K1 Technical Reference 141 + Manual. 142 + 143 + nvidia,bus-addr: 144 + $ref: /schemas/types.yaml#/definitions/uint32 145 + description: Bus address of the PMU on the I2C bus. 146 + 147 + nvidia,reg-addr: 148 + $ref: /schemas/types.yaml#/definitions/uint32 149 + description: PMU I2C register address to issue poweroff command. 150 + 151 + nvidia,reg-data: 152 + $ref: /schemas/types.yaml#/definitions/uint32 153 + description: Poweroff command to write to PMU. 154 + 155 + nvidia,pinmux-id: 156 + $ref: /schemas/types.yaml#/definitions/uint32 157 + description: 158 + Pinmux used by the hardware when issuing Poweroff command. 159 + Defaults to 0. Valid values are described in section 12.5.2 160 + "Pinmux Support" of the Tegra4 Technical Reference Manual. 161 + 162 + required: 163 + - nvidia,i2c-controller-id 164 + - nvidia,bus-addr 165 + - nvidia,reg-addr 166 + - nvidia,reg-data 167 + 168 + additionalProperties: false 169 + 170 + powergates: 171 + type: object 172 + description: | 173 + This node contains a hierarchy of power domain nodes, which should 174 + match the powergates on the Tegra SoC. Each powergate node 175 + represents a power-domain on the Tegra SoC that can be power-gated 176 + by the Tegra PMC. 177 + Hardware blocks belonging to a power domain should contain 178 + "power-domains" property that is a phandle pointing to corresponding 179 + powergate node. 180 + The name of the powergate node should be one of the below. Note that 181 + not every powergate is applicable to all Tegra devices and the following 182 + list shows which powergates are applicable to which devices. 183 + Please refer to Tegra TRM for mode details on the powergate nodes to 184 + use for each power-gate block inside Tegra. 185 + Name Description Devices Applicable 186 + 3d 3D Graphics Tegra20/114/124/210 187 + 3d0 3D Graphics 0 Tegra30 188 + 3d1 3D Graphics 1 Tegra30 189 + aud Audio Tegra210 190 + dfd Debug Tegra210 191 + dis Display A Tegra114/124/210 192 + disb Display B Tegra114/124/210 193 + heg 2D Graphics Tegra30/114/124/210 194 + iram Internal RAM Tegra124/210 195 + mpe MPEG Encode All 196 + nvdec NVIDIA Video Decode Engine Tegra210 197 + nvjpg NVIDIA JPEG Engine Tegra210 198 + pcie PCIE Tegra20/30/124/210 199 + sata SATA Tegra30/124/210 200 + sor Display interfaces Tegra124/210 201 + ve2 Video Encode Engine 2 Tegra210 202 + venc Video Encode Engine All 203 + vdec Video Decode Engine Tegra20/30/114/124 204 + vic Video Imaging Compositor Tegra124/210 205 + xusba USB Partition A Tegra114/124/210 206 + xusbb USB Partition B Tegra114/124/210 207 + xusbc USB Partition C Tegra114/124/210 208 + 209 + patternProperties: 210 + "^[a-z0-9]+$": 211 + type: object 212 + 213 + patternProperties: 214 + clocks: 215 + minItems: 1 216 + maxItems: 8 217 + description: 218 + Must contain an entry for each clock required by the PMC 219 + for controlling a power-gate. 220 + See ../clocks/clock-bindings.txt document for more details. 221 + 222 + resets: 223 + minItems: 1 224 + maxItems: 8 225 + description: 226 + Must contain an entry for each reset required by the PMC 227 + for controlling a power-gate. 228 + See ../reset/reset.txt for more details. 229 + 230 + '#power-domain-cells': 231 + const: 0 232 + description: Must be 0. 233 + 234 + required: 235 + - clocks 236 + - resets 237 + - '#power-domain-cells' 238 + 239 + additionalProperties: false 240 + 241 + patternProperties: 242 + "^[a-f0-9]+-[a-f0-9]+$": 243 + type: object 244 + description: 245 + This is a Pad configuration node. On Tegra SOCs a pad is a set of 246 + pins which are configured as a group. The pin grouping is a fixed 247 + attribute of the hardware. The PMC can be used to set pad power state 248 + and signaling voltage. A pad can be either in active or power down mode. 249 + The support for power state and signaling voltage configuration varies 250 + depending on the pad in question. 3.3V and 1.8V signaling voltages 251 + are supported on pins where software controllable signaling voltage 252 + switching is available. 253 + 254 + The pad configuration state nodes are placed under the pmc node and they 255 + are referred to by the pinctrl client properties. For more information 256 + see Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt. 257 + The pad name should be used as the value of the pins property in pin 258 + configuration nodes. 259 + 260 + The following pads are present on Tegra124 and Tegra132 261 + audio, bb, cam, comp, csia, csb, cse, dsi, dsib, dsic, dsid, hdmi, hsic, 262 + hv, lvds, mipi-bias, nand, pex-bias, pex-clk1, pex-clk2, pex-cntrl, 263 + sdmmc1, sdmmc3, sdmmc4, sys_ddc, uart, usb0, usb1, usb2, usb_bias. 264 + 265 + The following pads are present on Tegra210 266 + audio, audio-hv, cam, csia, csib, csic, csid, csie, csif, dbg, 267 + debug-nonao, dmic, dp, dsi, dsib, dsic, dsid, emmc, emmc2, gpio, hdmi, 268 + hsic, lvds, mipi-bias, pex-bias, pex-clk1, pex-clk2, pex-cntrl, sdmmc1, 269 + sdmmc3, spi, spi-hv, uart, usb0, usb1, usb2, usb3, usb-bias. 270 + 271 + properties: 272 + pins: 273 + $ref: /schemas/types.yaml#/definitions/string 274 + description: Must contain name of the pad(s) to be configured. 275 + 276 + low-power-enable: 277 + $ref: /schemas/types.yaml#/definitions/flag 278 + description: Configure the pad into power down mode. 279 + 280 + low-power-disable: 281 + $ref: /schemas/types.yaml#/definitions/flag 282 + description: Configure the pad into active mode. 283 + 284 + power-source: 285 + $ref: /schemas/types.yaml#/definitions/uint32 286 + description: 287 + Must contain either TEGRA_IO_PAD_VOLTAGE_1V8 or 288 + TEGRA_IO_PAD_VOLTAGE_3V3 to select between signaling voltages. 289 + The values are defined in 290 + include/dt-bindings/pinctrl/pinctrl-tegra-io-pad.h. 291 + Power state can be configured on all Tegra124 and Tegra132 292 + pads. None of the Tegra124 or Tegra132 pads support signaling 293 + voltage switching. 294 + All of the listed Tegra210 pads except pex-cntrl support power 295 + state configuration. Signaling voltage switching is supported 296 + on below Tegra210 pads. 297 + audio, audio-hv, cam, dbg, dmic, gpio, pex-cntrl, sdmmc1, 298 + sdmmc3, spi, spi-hv, and uart. 299 + 300 + required: 301 + - pins 302 + 303 + additionalProperties: false 304 + 305 + required: 306 + - compatible 307 + - reg 308 + - clock-names 309 + - clocks 310 + - '#clock-cells' 311 + 312 + dependencies: 313 + "nvidia,suspend-mode": ["nvidia,core-pwr-off-time", "nvidia,cpu-pwr-off-time"] 314 + "nvidia,core-pwr-off-time": ["nvidia,core-pwr-good-time"] 315 + "nvidia,cpu-pwr-off-time": ["nvidia,cpu-pwr-good-time"] 316 + 317 + examples: 318 + - | 319 + 320 + #include <dt-bindings/clock/tegra210-car.h> 321 + #include <dt-bindings/pinctrl/pinctrl-tegra-io-pad.h> 322 + #include <dt-bindings/soc/tegra-pmc.h> 323 + 324 + tegra_pmc: pmc@7000e400 { 325 + compatible = "nvidia,tegra210-pmc"; 326 + reg = <0x0 0x7000e400 0x0 0x400>; 327 + clocks = <&tegra_car TEGRA210_CLK_PCLK>, <&clk32k_in>; 328 + clock-names = "pclk", "clk32k_in"; 329 + #clock-cells = <1>; 330 + 331 + nvidia,invert-interrupt; 332 + nvidia,suspend-mode = <0>; 333 + nvidia,cpu-pwr-good-time = <0>; 334 + nvidia,cpu-pwr-off-time = <0>; 335 + nvidia,core-pwr-good-time = <4587 3876>; 336 + nvidia,core-pwr-off-time = <39065>; 337 + nvidia,core-power-req-active-high; 338 + nvidia,sys-clock-req-active-high; 339 + 340 + powergates { 341 + pd_audio: aud { 342 + clocks = <&tegra_car TEGRA210_CLK_APE>, 343 + <&tegra_car TEGRA210_CLK_APB2APE>; 344 + resets = <&tegra_car 198>; 345 + #power-domain-cells = <0>; 346 + }; 347 + 348 + pd_xusbss: xusba { 349 + clocks = <&tegra_car TEGRA210_CLK_XUSB_SS>; 350 + resets = <&tegra_car TEGRA210_CLK_XUSB_SS>; 351 + #power-domain-cells = <0>; 352 + }; 353 + }; 354 + };
+24
Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
··· 37 37 - Tegra132: "nvidia,tegra132-xusb-padctl", "nvidia,tegra124-xusb-padctl" 38 38 - Tegra210: "nvidia,tegra210-xusb-padctl" 39 39 - Tegra186: "nvidia,tegra186-xusb-padctl" 40 + - Tegra194: "nvidia,tegra194-xusb-padctl" 40 41 - reg: Physical base address and length of the controller's registers. 41 42 - resets: Must contain an entry for each entry in reset-names. 42 43 - reset-names: Must include the following entries: ··· 63 62 - vclamp-usb-supply: Bias rail for USB pad. Must supply 1.8 V. 64 63 - vddio-hsic-supply: HSIC PHY power supply. Must supply 1.2 V. 65 64 65 + For Tegra194: 66 + - avdd-usb-supply: USB I/Os, VBUS, ID, REXT, D+/D- power supply. Must supply 67 + 3.3 V. 68 + - vclamp-usb-supply: Bias rail for USB pad. Must supply 1.8 V. 66 69 67 70 Pad nodes: 68 71 ========== ··· 159 154 - sata: sata-0 160 155 - functions: "usb3-ss", "sata" 161 156 157 + For Tegra194, the list of valid PHY nodes is given below: 158 + - usb2: usb2-0, usb2-1, usb2-2, usb2-3 159 + - functions: "xusb" 160 + - usb3: usb3-0, usb3-1, usb3-2, usb3-3 161 + - functions: "xusb" 162 162 163 163 Port nodes: 164 164 =========== ··· 183 173 - "host": for USB host mode 184 174 - "device": for USB device mode 185 175 - "otg": for USB OTG mode 176 + 177 + Required properties for OTG/Peripheral capable USB2 ports: 178 + - usb-role-switch: Boolean property to indicate that the port support OTG or 179 + peripheral mode. If present, the port supports switching between USB host 180 + and peripheral roles. Connector should be added as subnode. 181 + See usb/usb-conn-gpio.txt. 186 182 187 183 Optional properties: 188 184 - nvidia,internal: A boolean property whose presence determines that a port ··· 237 221 is internal. In the absence of this property the port is considered to be 238 222 external. 239 223 224 + - maximum-speed: Only for Tegra194. A string property that specifies maximum 225 + supported speed of a usb3 port. Valid values are: 226 + - "super-speed-plus": default, the usb3 port supports USB 3.1 Gen 2 speed. 227 + - "super-speed": the usb3 port supports USB 3.1 Gen 1 speed only. 228 + 240 229 For Tegra124 and Tegra132, the XUSB pad controller exposes the following 241 230 ports: 242 231 - 3x USB2: usb2-0, usb2-1, usb2-2 ··· 254 233 - 2x HSIC: hsic-0, hsic-1 255 234 - 4x super-speed USB: usb3-0, usb3-1, usb3-2, usb3-3 256 235 236 + For Tegra194, the XUSB pad controller exposes the following ports: 237 + - 4x USB2: usb2-0, usb2-1, usb2-2, usb2-3 238 + - 4x super-speed USB: usb3-0, usb3-1, usb3-2, usb3-3 257 239 258 240 Examples: 259 241 =========
+1
Documentation/devicetree/bindings/soc/mediatek/pwrap.txt
··· 20 20 - compatible: 21 21 "mediatek,mt2701-pwrap" for MT2701/7623 SoCs 22 22 "mediatek,mt6765-pwrap" for MT6765 SoCs 23 + "mediatek,mt6779-pwrap" for MT6779 SoCs 23 24 "mediatek,mt6797-pwrap" for MT6797 SoCs 24 25 "mediatek,mt7622-pwrap" for MT7622 SoCs 25 26 "mediatek,mt8135-pwrap" for MT8135 SoCs
+190
Documentation/devicetree/bindings/usb/nvidia,tegra-xudc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: "http://devicetree.org/schemas/usb/nvidia,tegra-xudc.yaml#" 5 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 6 + 7 + title: Device tree binding for NVIDIA Tegra XUSB device mode controller (XUDC) 8 + 9 + description: 10 + The Tegra XUDC controller supports both USB 2.0 HighSpeed/FullSpeed and 11 + USB 3.0 SuperSpeed protocols. 12 + 13 + maintainers: 14 + - Nagarjuna Kristam <nkristam@nvidia.com> 15 + - JC Kuo <jckuo@nvidia.com> 16 + - Thierry Reding <treding@nvidia.com> 17 + 18 + properties: 19 + compatible: 20 + items: 21 + - enum: 22 + - nvidia,tegra210-xudc # For Tegra210 23 + - nvidia,tegra186-xudc # For Tegra186 24 + 25 + reg: 26 + minItems: 2 27 + maxItems: 3 28 + items: 29 + - description: XUSB device controller registers 30 + - description: XUSB device PCI Config registers 31 + - description: XUSB device registers. 32 + 33 + reg-names: 34 + minItems: 2 35 + maxItems: 3 36 + items: 37 + - const: base 38 + - const: fpci 39 + - const: ipfs 40 + 41 + interrupts: 42 + maxItems: 1 43 + description: Must contain the XUSB device interrupt. 44 + 45 + clocks: 46 + minItems: 4 47 + maxItems: 5 48 + items: 49 + - description: Clock to enable core XUSB dev clock. 50 + - description: Clock to enable XUSB super speed clock. 51 + - description: Clock to enable XUSB super speed dev clock. 52 + - description: Clock to enable XUSB high speed dev clock. 53 + - description: Clock to enable XUSB full speed dev clock. 54 + 55 + clock-names: 56 + minItems: 4 57 + maxItems: 5 58 + items: 59 + - const: dev 60 + - const: ss 61 + - const: ss_src 62 + - const: fs_src 63 + - const: hs_src 64 + 65 + power-domains: 66 + maxItems: 2 67 + items: 68 + - description: XUSBB(device) power-domain 69 + - description: XUSBA(superspeed) power-domain 70 + 71 + power-domain-names: 72 + maxItems: 2 73 + items: 74 + - const: dev 75 + - const: ss 76 + 77 + nvidia,xusb-padctl: 78 + $ref: /schemas/types.yaml#/definitions/phandle-array 79 + description: 80 + phandle to the XUSB pad controller that is used to configure the USB pads 81 + used by the XUDC controller. 82 + 83 + phys: 84 + minItems: 1 85 + description: 86 + Must contain an entry for each entry in phy-names. 87 + See ../phy/phy-bindings.txt for details. 88 + 89 + phy-names: 90 + minItems: 1 91 + items: 92 + - const: usb2-0 93 + - const: usb2-1 94 + - const: usb2-2 95 + - const: usb2-3 96 + - const: usb3-0 97 + - const: usb3-1 98 + - const: usb3-2 99 + - const: usb3-3 100 + 101 + avddio-usb-supply: 102 + description: PCIe/USB3 analog logic power supply. Must supply 1.05 V. 103 + 104 + hvdd-usb-supply: 105 + description: USB controller power supply. Must supply 3.3 V. 106 + 107 + required: 108 + - compatible 109 + - reg 110 + - reg-names 111 + - interrupts 112 + - clocks 113 + - clock-names 114 + - power-domains 115 + - power-domain-names 116 + - nvidia,xusb-padctl 117 + - phys 118 + - phy-names 119 + 120 + allOf: 121 + - if: 122 + properties: 123 + compatible: 124 + contains: 125 + enum: 126 + - nvidia,tegra210-xudc 127 + then: 128 + properties: 129 + reg: 130 + minItems: 3 131 + reg-names: 132 + minItems: 3 133 + clocks: 134 + minItems: 5 135 + clock-names: 136 + minItems: 5 137 + required: 138 + - avddio-usb-supply 139 + - hvdd-usb-supply 140 + 141 + - if: 142 + properties: 143 + compatible: 144 + contains: 145 + enum: 146 + - nvidia,tegra186-xudc 147 + then: 148 + properties: 149 + reg: 150 + maxItems: 2 151 + reg-names: 152 + maxItems: 2 153 + clocks: 154 + maxItems: 4 155 + clock-names: 156 + maxItems: 4 157 + 158 + examples: 159 + - | 160 + #include <dt-bindings/clock/tegra210-car.h> 161 + #include <dt-bindings/gpio/tegra-gpio.h> 162 + #include <dt-bindings/interrupt-controller/arm-gic.h> 163 + 164 + usb@700d0000 { 165 + compatible = "nvidia,tegra210-xudc"; 166 + reg = <0x0 0x700d0000 0x0 0x8000>, 167 + <0x0 0x700d8000 0x0 0x1000>, 168 + <0x0 0x700d9000 0x0 0x1000>; 169 + reg-names = "base", "fpci", "ipfs"; 170 + 171 + interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; 172 + 173 + clocks = <&tegra_car TEGRA210_CLK_XUSB_DEV>, 174 + <&tegra_car TEGRA210_CLK_XUSB_SS>, 175 + <&tegra_car TEGRA210_CLK_XUSB_SSP_SRC>, 176 + <&tegra_car TEGRA210_CLK_XUSB_FS_SRC>, 177 + <&tegra_car TEGRA210_CLK_XUSB_HS_SRC>; 178 + clock-names = "dev", "ss", "ss_src", "fs_src", "hs_src"; 179 + 180 + power-domains = <&pd_xusbdev>, <&pd_xusbss>; 181 + power-domain-names = "dev", "ss"; 182 + 183 + nvidia,xusb-padctl = <&padctl>; 184 + 185 + phys = <&micro_b>; 186 + phy-names = "usb2-0"; 187 + 188 + avddio-usb-supply = <&vdd_pex_1v05>; 189 + hvdd-usb-supply = <&vdd_3v3_sys>; 190 + };
+36 -6
arch/arm/Kconfig.debug
··· 1201 1201 1202 1202 config STM32F4_DEBUG_UART 1203 1203 bool "Use STM32F4 UART for low-level debug" 1204 - depends on ARCH_STM32 1204 + depends on MACH_STM32F429 || MACH_STM32F469 1205 1205 select DEBUG_STM32_UART 1206 1206 help 1207 1207 Say Y here if you want kernel low-level debugging support 1208 1208 on STM32F4 based platforms, which default UART is wired on 1209 - USART1. 1209 + USART1, but another UART instance can be selected by modifying 1210 + CONFIG_DEBUG_UART_PHYS. 1210 1211 1211 1212 If unsure, say N. 1212 1213 1213 1214 config STM32F7_DEBUG_UART 1214 1215 bool "Use STM32F7 UART for low-level debug" 1215 - depends on ARCH_STM32 1216 + depends on MACH_STM32F746 || MACH_STM32F769 1216 1217 select DEBUG_STM32_UART 1217 1218 help 1218 1219 Say Y here if you want kernel low-level debugging support 1219 1220 on STM32F7 based platforms, which default UART is wired on 1220 - USART1. 1221 + USART1, but another UART instance can be selected by modifying 1222 + CONFIG_DEBUG_UART_PHYS. 1223 + 1224 + If unsure, say N. 1225 + 1226 + config STM32H7_DEBUG_UART 1227 + bool "Use STM32H7 UART for low-level debug" 1228 + depends on MACH_STM32H743 1229 + select DEBUG_STM32_UART 1230 + help 1231 + Say Y here if you want kernel low-level debugging support 1232 + on STM32H7 based platforms, which default UART is wired on 1233 + USART1, but another UART instance can be selected by modifying 1234 + CONFIG_DEBUG_UART_PHYS. 1235 + 1236 + If unsure, say N. 1237 + 1238 + config STM32MP1_DEBUG_UART 1239 + bool "Use STM32MP1 UART for low-level debug" 1240 + depends on MACH_STM32MP157 1241 + select DEBUG_STM32_UART 1242 + help 1243 + Say Y here if you want kernel low-level debugging support 1244 + on STM32MP1 based platforms, wich default UART is wired on 1245 + UART4, but another UART instance can be selected by modifying 1246 + CONFIG_DEBUG_UART_PHYS and CONFIG_DEBUG_UART_VIRT. 1221 1247 1222 1248 If unsure, say N. 1223 1249 ··· 1645 1619 default 0x3e000000 if DEBUG_BCM_KONA_UART 1646 1620 default 0x3f201000 if DEBUG_BCM2836 1647 1621 default 0x4000e400 if DEBUG_LL_UART_EFM32 1622 + default 0x40010000 if STM32MP1_DEBUG_UART 1623 + default 0x40011000 if STM32F4_DEBUG_UART || STM32F7_DEBUG_UART || \ 1624 + STM32H7_DEBUG_UART 1648 1625 default 0x40028000 if DEBUG_AT91_SAMV7_USART1 1649 1626 default 0x40081000 if DEBUG_LPC18XX_UART0 1650 1627 default 0x40090000 if DEBUG_LPC32XX ··· 1742 1713 DEBUG_S3C64XX_UART || \ 1743 1714 DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ 1744 1715 DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \ 1745 - DEBUG_AT91_UART 1716 + DEBUG_AT91_UART || DEBUG_STM32_UART 1746 1717 1747 1718 config DEBUG_UART_VIRT 1748 1719 hex "Virtual base address of debug UART" ··· 1808 1779 default 0xfcfe8600 if DEBUG_BCM63XX_UART 1809 1780 default 0xfd000000 if DEBUG_SPEAR3XX || DEBUG_SPEAR13XX 1810 1781 default 0xfd883000 if DEBUG_ALPINE_UART0 1782 + default 0xfe010000 if STM32MP1_DEBUG_UART 1811 1783 default 0xfe017000 if DEBUG_MMP_UART2 1812 1784 default 0xfe018000 if DEBUG_MMP_UART3 1813 1785 default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART ··· 1853 1823 DEBUG_S3C64XX_UART || \ 1854 1824 DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ 1855 1825 DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \ 1856 - DEBUG_AT91_UART 1826 + DEBUG_AT91_UART || DEBUG_STM32_UART 1857 1827 1858 1828 config DEBUG_UART_8250_SHIFT 1859 1829 int "Register offset shift for the 8250 debug UART"
+1
arch/arm/Makefile
··· 152 152 ifeq ($(CONFIG_ARCH_SA1100),y) 153 153 textofs-$(CONFIG_SA1111) := 0x00208000 154 154 endif 155 + textofs-$(CONFIG_ARCH_IPQ40XX) := 0x00208000 155 156 textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000 156 157 textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 157 158 textofs-$(CONFIG_ARCH_MESON) := 0x00208000
+2
arch/arm/configs/omap2plus_defconfig
··· 56 56 # CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set 57 57 CONFIG_ARM_TI_CPUFREQ=y 58 58 CONFIG_CPU_IDLE=y 59 + CONFIG_ARM_CPUIDLE=y 60 + CONFIG_DT_IDLE_STATES=y 59 61 CONFIG_KERNEL_MODE_NEON=y 60 62 CONFIG_PM_DEBUG=y 61 63 CONFIG_ARM_CRYPTO=y
+4 -5
arch/arm/include/debug/stm32.S
··· 4 4 * Author: Gerald Baeza <gerald.baeza@st.com> for STMicroelectronics. 5 5 */ 6 6 7 - #define STM32_UART_BASE 0x40011000 /* USART1 */ 8 - 9 7 #ifdef CONFIG_STM32F4_DEBUG_UART 10 8 #define STM32_USART_SR_OFF 0x00 11 9 #define STM32_USART_TDR_OFF 0x04 12 10 #endif 13 11 14 - #ifdef CONFIG_STM32F7_DEBUG_UART 12 + #if defined(CONFIG_STM32F7_DEBUG_UART) || defined(CONFIG_STM32H7_DEBUG_UART) || \ 13 + defined(CONFIG_STM32MP1_DEBUG_UART) 15 14 #define STM32_USART_SR_OFF 0x1C 16 15 #define STM32_USART_TDR_OFF 0x28 17 16 #endif ··· 19 20 #define STM32_USART_TXE (1 << 7) /* Tx data reg empty */ 20 21 21 22 .macro addruart, rp, rv, tmp 22 - ldr \rp, =STM32_UART_BASE @ physical base 23 - ldr \rv, =STM32_UART_BASE @ virt base /* NoMMU */ 23 + ldr \rp, =CONFIG_DEBUG_UART_PHYS @ physical base 24 + ldr \rv, =CONFIG_DEBUG_UART_VIRT @ virt base 24 25 .endm 25 26 26 27 .macro senduart,rd,rx
-1
arch/arm/mach-at91/Kconfig
··· 153 153 154 154 config COMMON_CLK_AT91 155 155 bool 156 - select COMMON_CLK 157 156 select MFD_SYSCON 158 157 159 158 config HAVE_AT91_SMD
+30 -5
arch/arm/mach-at91/pm.c
··· 736 736 737 737 struct pmc_info { 738 738 unsigned long uhp_udp_mask; 739 + unsigned long mckr; 740 + unsigned long version; 739 741 }; 740 742 741 743 static const struct pmc_info pmc_infos[] __initconst = { 742 - { .uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP }, 743 - { .uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP }, 744 - { .uhp_udp_mask = AT91SAM926x_PMC_UHP }, 745 - { .uhp_udp_mask = 0 }, 744 + { 745 + .uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP, 746 + .mckr = 0x30, 747 + .version = AT91_PMC_V1, 748 + }, 749 + 750 + { 751 + .uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP, 752 + .mckr = 0x30, 753 + .version = AT91_PMC_V1, 754 + }, 755 + { 756 + .uhp_udp_mask = AT91SAM926x_PMC_UHP, 757 + .mckr = 0x30, 758 + .version = AT91_PMC_V1, 759 + }, 760 + { .uhp_udp_mask = 0, 761 + .mckr = 0x30, 762 + .version = AT91_PMC_V1, 763 + }, 764 + { 765 + .uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP, 766 + .mckr = 0x28, 767 + .version = AT91_PMC_V2, 768 + }, 746 769 }; 747 770 748 771 static const struct of_device_id atmel_pmc_ids[] __initconst = { ··· 780 757 { .compatible = "atmel,sama5d3-pmc", .data = &pmc_infos[1] }, 781 758 { .compatible = "atmel,sama5d4-pmc", .data = &pmc_infos[1] }, 782 759 { .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] }, 783 - { .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[1] }, 760 + { .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[4] }, 784 761 { /* sentinel */ }, 785 762 }; 786 763 ··· 802 779 803 780 pmc = of_id->data; 804 781 soc_pm.data.uhp_udp_mask = pmc->uhp_udp_mask; 782 + soc_pm.data.pmc_mckr_offset = pmc->mckr; 783 + soc_pm.data.pmc_version = pmc->version; 805 784 806 785 if (pm_idle) 807 786 arm_pm_idle = pm_idle;
+2
arch/arm/mach-at91/pm.h
··· 33 33 void __iomem *sfrbu; 34 34 unsigned int standby_mode; 35 35 unsigned int suspend_mode; 36 + unsigned int pmc_mckr_offset; 37 + unsigned int pmc_version; 36 38 }; 37 39 #endif 38 40
+4
arch/arm/mach-at91/pm_data-offsets.c
··· 12 12 DEFINE(PM_DATA_MODE, offsetof(struct at91_pm_data, mode)); 13 13 DEFINE(PM_DATA_SHDWC, offsetof(struct at91_pm_data, shdwc)); 14 14 DEFINE(PM_DATA_SFRBU, offsetof(struct at91_pm_data, sfrbu)); 15 + DEFINE(PM_DATA_PMC_MCKR_OFFSET, offsetof(struct at91_pm_data, 16 + pmc_mckr_offset)); 17 + DEFINE(PM_DATA_PMC_VERSION, offsetof(struct at91_pm_data, 18 + pmc_version)); 15 19 16 20 return 0; 17 21 }
+174 -15
arch/arm/mach-at91/pm_suspend.S
··· 18 18 pmc .req r0 19 19 tmp1 .req r4 20 20 tmp2 .req r5 21 + tmp3 .req r6 21 22 22 23 /* 23 24 * Wait until master clock is ready (after switching master clock source) ··· 94 93 str tmp1, .memtype 95 94 ldr tmp1, [r0, #PM_DATA_MODE] 96 95 str tmp1, .pm_mode 96 + ldr tmp1, [r0, #PM_DATA_PMC_MCKR_OFFSET] 97 + str tmp1, .mckr_offset 98 + ldr tmp1, [r0, #PM_DATA_PMC_VERSION] 99 + str tmp1, .pmc_version 97 100 /* Both ldrne below are here to preload their address in the TLB */ 98 101 ldr tmp1, [r0, #PM_DATA_SHDWC] 99 102 str tmp1, .shdwc 100 103 cmp tmp1, #0 101 104 ldrne tmp2, [tmp1, #0] 102 105 ldr tmp1, [r0, #PM_DATA_SFRBU] 103 - str tmp1, .sfr 106 + str tmp1, .sfrbu 104 107 cmp tmp1, #0 105 108 ldrne tmp2, [tmp1, #0x10] 106 109 ··· 143 138 ENTRY(at91_backup_mode) 144 139 /* Switch the master clock source to slow clock. */ 145 140 ldr pmc, .pmc_base 146 - ldr tmp1, [pmc, #AT91_PMC_MCKR] 141 + ldr tmp2, .mckr_offset 142 + ldr tmp1, [pmc, tmp2] 147 143 bic tmp1, tmp1, #AT91_PMC_CSS 148 - str tmp1, [pmc, #AT91_PMC_MCKR] 144 + str tmp1, [pmc, tmp2] 149 145 150 146 wait_mckrdy 151 147 152 148 /*BUMEN*/ 153 - ldr r0, .sfr 149 + ldr r0, .sfrbu 154 150 mov tmp1, #0x1 155 151 str tmp1, [r0, #0x10] 156 152 ··· 224 218 */ 225 219 .macro at91_pm_ulp1_mode 226 220 ldr pmc, .pmc_base 221 + ldr tmp2, .mckr_offset 227 222 228 223 /* Save RC oscillator state and check if it is enabled. */ 229 224 ldr tmp1, [pmc, #AT91_PMC_SR] ··· 261 254 str tmp1, [pmc, #AT91_CKGR_MOR] 262 255 263 256 /* Switch the master clock source to main clock */ 264 - ldr tmp1, [pmc, #AT91_PMC_MCKR] 257 + ldr tmp1, [pmc, tmp2] 265 258 bic tmp1, tmp1, #AT91_PMC_CSS 266 259 orr tmp1, tmp1, #AT91_PMC_CSS_MAIN 267 - str tmp1, [pmc, #AT91_PMC_MCKR] 260 + str tmp1, [pmc, tmp2] 268 261 269 262 wait_mckrdy 270 263 ··· 274 267 bic tmp1, tmp1, #AT91_PMC_KEY_MASK 275 268 orr tmp1, tmp1, #AT91_PMC_KEY 276 269 str tmp1, [pmc, #AT91_CKGR_MOR] 270 + 271 + /* Quirk for SAM9X60's PMC */ 272 + nop 273 + nop 277 274 278 275 wait_mckrdy 279 276 ··· 291 280 wait_moscrdy 292 281 293 282 /* Switch the master clock source to slow clock */ 294 - ldr tmp1, [pmc, #AT91_PMC_MCKR] 283 + ldr tmp1, [pmc, tmp2] 295 284 bic tmp1, tmp1, #AT91_PMC_CSS 296 - str tmp1, [pmc, #AT91_PMC_MCKR] 285 + str tmp1, [pmc, tmp2] 297 286 298 287 wait_mckrdy 299 288 ··· 307 296 wait_moscsels 308 297 309 298 /* Switch the master clock source to main clock */ 310 - ldr tmp1, [pmc, #AT91_PMC_MCKR] 299 + ldr tmp1, [pmc, tmp2] 311 300 bic tmp1, tmp1, #AT91_PMC_CSS 312 301 orr tmp1, tmp1, #AT91_PMC_CSS_MAIN 313 - str tmp1, [pmc, #AT91_PMC_MCKR] 302 + str tmp1, [pmc, tmp2] 314 303 315 304 wait_mckrdy 316 305 ··· 334 323 3: 335 324 .endm 336 325 326 + .macro at91_plla_disable 327 + /* Save PLLA setting and disable it */ 328 + ldr tmp1, .pmc_version 329 + cmp tmp1, #AT91_PMC_V1 330 + beq 1f 331 + 332 + #ifdef CONFIG_SOC_SAM9X60 333 + /* Save PLLA settings. */ 334 + ldr tmp2, [pmc, #AT91_PMC_PLL_UPDT] 335 + bic tmp2, tmp2, #AT91_PMC_PLL_UPDT_ID 336 + str tmp2, [pmc, #AT91_PMC_PLL_UPDT] 337 + 338 + /* save div. */ 339 + mov tmp1, #0 340 + ldr tmp2, [pmc, #AT91_PMC_PLL_CTRL0] 341 + bic tmp2, tmp2, #0xffffff00 342 + orr tmp1, tmp1, tmp2 343 + 344 + /* save mul. */ 345 + ldr tmp2, [pmc, #AT91_PMC_PLL_CTRL1] 346 + bic tmp2, tmp2, #0xffffff 347 + orr tmp1, tmp1, tmp2 348 + str tmp1, .saved_pllar 349 + 350 + /* step 2. */ 351 + ldr tmp1, [pmc, #AT91_PMC_PLL_UPDT] 352 + bic tmp1, tmp1, #AT91_PMC_PLL_UPDT_UPDATE 353 + bic tmp1, tmp1, #AT91_PMC_PLL_UPDT_ID 354 + str tmp1, [pmc, #AT91_PMC_PLL_UPDT] 355 + 356 + /* step 3. */ 357 + ldr tmp1, [pmc, #AT91_PMC_PLL_CTRL0] 358 + bic tmp1, tmp1, #AT91_PMC_PLL_CTRL0_ENPLLCK 359 + orr tmp1, tmp1, #AT91_PMC_PLL_CTRL0_ENPLL 360 + str tmp1, [pmc, #AT91_PMC_PLL_CTRL0] 361 + 362 + /* step 4. */ 363 + ldr tmp1, [pmc, #AT91_PMC_PLL_UPDT] 364 + orr tmp1, tmp1, #AT91_PMC_PLL_UPDT_UPDATE 365 + bic tmp1, tmp1, #AT91_PMC_PLL_UPDT_ID 366 + str tmp1, [pmc, #AT91_PMC_PLL_UPDT] 367 + 368 + /* step 5. */ 369 + ldr tmp1, [pmc, #AT91_PMC_PLL_CTRL0] 370 + bic tmp1, tmp1, #AT91_PMC_PLL_CTRL0_ENPLL 371 + str tmp1, [pmc, #AT91_PMC_PLL_CTRL0] 372 + 373 + /* step 7. */ 374 + ldr tmp1, [pmc, #AT91_PMC_PLL_UPDT] 375 + orr tmp1, tmp1, #AT91_PMC_PLL_UPDT_UPDATE 376 + bic tmp1, tmp1, #AT91_PMC_PLL_UPDT_ID 377 + str tmp1, [pmc, #AT91_PMC_PLL_UPDT] 378 + 379 + b 2f 380 + #endif 381 + 382 + 1: /* Save PLLA setting and disable it */ 383 + ldr tmp1, [pmc, #AT91_CKGR_PLLAR] 384 + str tmp1, .saved_pllar 385 + 386 + /* Disable PLLA. */ 387 + mov tmp1, #AT91_PMC_PLLCOUNT 388 + orr tmp1, tmp1, #(1 << 29) /* bit 29 always set */ 389 + str tmp1, [pmc, #AT91_CKGR_PLLAR] 390 + 2: 391 + .endm 392 + 393 + .macro at91_plla_enable 394 + ldr tmp2, .saved_pllar 395 + ldr tmp3, .pmc_version 396 + cmp tmp3, #AT91_PMC_V1 397 + beq 4f 398 + 399 + #ifdef CONFIG_SOC_SAM9X60 400 + /* step 1. */ 401 + ldr tmp1, [pmc, #AT91_PMC_PLL_UPDT] 402 + bic tmp1, tmp1, #AT91_PMC_PLL_UPDT_ID 403 + bic tmp1, tmp1, #AT91_PMC_PLL_UPDT_UPDATE 404 + str tmp1, [pmc, #AT91_PMC_PLL_UPDT] 405 + 406 + /* step 2. */ 407 + ldr tmp1, =#AT91_PMC_PLL_ACR_DEFAULT_PLLA 408 + str tmp1, [pmc, #AT91_PMC_PLL_ACR] 409 + 410 + /* step 3. */ 411 + ldr tmp1, [pmc, #AT91_PMC_PLL_CTRL1] 412 + mov tmp3, tmp2 413 + bic tmp3, tmp3, #0xffffff 414 + orr tmp1, tmp1, tmp3 415 + str tmp1, [pmc, #AT91_PMC_PLL_CTRL1] 416 + 417 + /* step 8. */ 418 + ldr tmp1, [pmc, #AT91_PMC_PLL_UPDT] 419 + bic tmp1, tmp1, #AT91_PMC_PLL_UPDT_ID 420 + orr tmp1, tmp1, #AT91_PMC_PLL_UPDT_UPDATE 421 + str tmp1, [pmc, #AT91_PMC_PLL_UPDT] 422 + 423 + /* step 9. */ 424 + ldr tmp1, [pmc, #AT91_PMC_PLL_CTRL0] 425 + orr tmp1, tmp1, #AT91_PMC_PLL_CTRL0_ENLOCK 426 + orr tmp1, tmp1, #AT91_PMC_PLL_CTRL0_ENPLL 427 + orr tmp1, tmp1, #AT91_PMC_PLL_CTRL0_ENPLLCK 428 + bic tmp1, tmp1, #0xff 429 + mov tmp3, tmp2 430 + bic tmp3, tmp3, #0xffffff00 431 + orr tmp1, tmp1, tmp3 432 + str tmp1, [pmc, #AT91_PMC_PLL_CTRL0] 433 + 434 + /* step 10. */ 435 + ldr tmp1, [pmc, #AT91_PMC_PLL_UPDT] 436 + orr tmp1, tmp1, #AT91_PMC_PLL_UPDT_UPDATE 437 + bic tmp1, tmp1, #AT91_PMC_PLL_UPDT_ID 438 + str tmp1, [pmc, #AT91_PMC_PLL_UPDT] 439 + 440 + /* step 11. */ 441 + 3: ldr tmp1, [pmc, #AT91_PMC_PLL_ISR0] 442 + tst tmp1, #0x1 443 + beq 3b 444 + b 2f 445 + #endif 446 + 447 + /* Restore PLLA setting */ 448 + 4: str tmp2, [pmc, #AT91_CKGR_PLLAR] 449 + 450 + /* Enable PLLA. */ 451 + tst tmp2, #(AT91_PMC_MUL & 0xff0000) 452 + bne 1f 453 + tst tmp2, #(AT91_PMC_MUL & ~0xff0000) 454 + beq 2f 455 + 456 + 1: ldr tmp1, [pmc, #AT91_PMC_SR] 457 + tst tmp1, #AT91_PMC_LOCKA 458 + beq 1b 459 + 2: 460 + .endm 461 + 337 462 ENTRY(at91_ulp_mode) 338 463 ldr pmc, .pmc_base 464 + ldr tmp2, .mckr_offset 339 465 340 466 /* Save Master clock setting */ 341 - ldr tmp1, [pmc, #AT91_PMC_MCKR] 467 + ldr tmp1, [pmc, tmp2] 342 468 str tmp1, .saved_mckr 343 469 344 470 /* 345 471 * Set the Master clock source to slow clock 346 472 */ 347 473 bic tmp1, tmp1, #AT91_PMC_CSS 348 - str tmp1, [pmc, #AT91_PMC_MCKR] 474 + str tmp1, [pmc, tmp2] 349 475 350 476 wait_mckrdy 477 + 478 + at91_plla_disable 351 479 352 480 ldr r0, .pm_mode 353 481 cmp r0, #AT91_PM_ULP1 ··· 502 352 ulp_exit: 503 353 ldr pmc, .pmc_base 504 354 355 + at91_plla_enable 356 + 505 357 /* 506 358 * Restore master clock setting 507 359 */ 508 - ldr tmp1, .saved_mckr 509 - str tmp1, [pmc, #AT91_PMC_MCKR] 360 + ldr tmp1, .mckr_offset 361 + ldr tmp2, .saved_mckr 362 + str tmp2, [pmc, tmp1] 510 363 511 364 wait_mckrdy 512 365 ··· 649 496 .word 0 650 497 .shdwc: 651 498 .word 0 652 - .sfr: 499 + .sfrbu: 653 500 .word 0 654 501 .memtype: 655 502 .word 0 656 503 .pm_mode: 657 504 .word 0 505 + .mckr_offset: 506 + .word 0 507 + .pmc_version: 508 + .word 0 658 509 .saved_mckr: 510 + .word 0 511 + .saved_pllar: 659 512 .word 0 660 513 .saved_sam9_lpr: 661 514 .word 0
-8
arch/arm/mach-bcm/Kconfig
··· 20 20 select GPIOLIB 21 21 select ARM_AMBA 22 22 select PINCTRL 23 - select PCI_DOMAINS_GENERIC if PCI 24 23 help 25 24 This enables support for systems based on Broadcom IPROC architected SoCs. 26 25 The IPROC complex contains one or more ARM CPUs along with common ··· 53 54 select ARM_ERRATA_754322 54 55 select ARM_ERRATA_775420 55 56 select ARM_ERRATA_764369 if SMP 56 - select HAVE_SMP 57 57 select THERMAL 58 58 select THERMAL_OF 59 59 help ··· 71 73 select ARM_ERRATA_754322 72 74 select ARM_ERRATA_775420 73 75 select ARM_ERRATA_764369 if SMP 74 - select HAVE_SMP 75 76 76 77 help 77 78 Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores. ··· 106 109 bool "Broadcom BCM281XX SoC family" 107 110 depends on ARCH_MULTI_V7 108 111 select ARCH_BCM_MOBILE 109 - select HAVE_SMP 110 112 help 111 113 Enable support for the BCM281XX family, which includes 112 114 BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 ··· 115 119 bool "Broadcom BCM21664 SoC family" 116 120 depends on ARCH_MULTI_V7 117 121 select ARCH_BCM_MOBILE 118 - select HAVE_SMP 119 122 help 120 123 Enable support for the BCM21664 family, which includes 121 124 BCM21663 and BCM21664 variants. ··· 123 128 bool "Broadcom BCM23550 SoC" 124 129 depends on ARCH_MULTI_V7 125 130 select ARCH_BCM_MOBILE 126 - select HAVE_SMP 127 131 help 128 132 Enable support for the BCM23550. 129 133 ··· 159 165 select ZONE_DMA if ARCH_MULTI_V7 160 166 select ARM_TIMER_SP804 161 167 select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7 162 - select TIMER_OF 163 168 select BCM2835_TIMER 164 169 select PINCTRL 165 170 select PINCTRL_BCM2835 ··· 194 201 select HAVE_ARM_ARCH_TIMER 195 202 select HAVE_ARM_TWD if SMP 196 203 select HAVE_ARM_SCU if SMP 197 - select HAVE_SMP 198 204 help 199 205 This enables support for systems based on Broadcom DSL SoCs. 200 206 It currently supports the 'BCM63XX' ARM-based family, which includes
+3 -7
arch/arm/mach-cns3xxx/core.c
··· 189 189 return IRQ_HANDLED; 190 190 } 191 191 192 - static struct irqaction cns3xxx_timer_irq = { 193 - .name = "timer", 194 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 195 - .handler = cns3xxx_timer_interrupt, 196 - }; 197 - 198 192 /* 199 193 * Set up the clock source and clock events devices 200 194 */ ··· 239 245 writel(val, cns3xxx_tmr1 + TIMER1_2_CONTROL_OFFSET); 240 246 241 247 /* Make irqs happen for the system timer */ 242 - setup_irq(timer_irq, &cns3xxx_timer_irq); 248 + if (request_irq(timer_irq, cns3xxx_timer_interrupt, 249 + IRQF_TIMER | IRQF_IRQPOLL, "timer", NULL)) 250 + pr_err("Failed to request irq %d (timer)\n", timer_irq); 243 251 244 252 cns3xxx_clockevents_init(timer_irq); 245 253 }
+1 -1
arch/arm/mach-dove/common.c
··· 48 48 /***************************************************************************** 49 49 * I/O Address Mapping 50 50 ****************************************************************************/ 51 - static struct map_desc dove_io_desc[] __initdata = { 51 + static struct map_desc __maybe_unused dove_io_desc[] __initdata = { 52 52 { 53 53 .virtual = (unsigned long) DOVE_SB_REGS_VIRT_BASE, 54 54 .pfn = __phys_to_pfn(DOVE_SB_REGS_PHYS_BASE),
+6 -8
arch/arm/mach-ep93xx/timer-ep93xx.c
··· 117 117 return IRQ_HANDLED; 118 118 } 119 119 120 - static struct irqaction ep93xx_timer_irq = { 121 - .name = "ep93xx timer", 122 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 123 - .handler = ep93xx_timer_interrupt, 124 - .dev_id = &ep93xx_clockevent, 125 - }; 126 - 127 120 void __init ep93xx_timer_init(void) 128 121 { 122 + int irq = IRQ_EP93XX_TIMER3; 123 + unsigned long flags = IRQF_TIMER | IRQF_IRQPOLL; 124 + 129 125 /* Enable and register clocksource and sched_clock on timer 4 */ 130 126 writel(EP93XX_TIMER4_VALUE_HIGH_ENABLE, 131 127 EP93XX_TIMER4_VALUE_HIGH); ··· 132 136 EP93XX_TIMER4_RATE); 133 137 134 138 /* Set up clockevent on timer 3 */ 135 - setup_irq(IRQ_EP93XX_TIMER3, &ep93xx_timer_irq); 139 + if (request_irq(irq, ep93xx_timer_interrupt, flags, "ep93xx timer", 140 + &ep93xx_clockevent)) 141 + pr_err("Failed to request irq %d (ep93xx timer)\n", irq); 136 142 clockevents_config_and_register(&ep93xx_clockevent, 137 143 EP93XX_TIMER123_RATE, 138 144 1,
+8 -2
arch/arm/mach-imx/Kconfig
··· 471 471 config SOC_IMX6 472 472 bool 473 473 select ARM_CPU_SUSPEND if (PM || CPU_IDLE) 474 - select ARM_ERRATA_754322 475 - select ARM_ERRATA_775420 476 474 select ARM_GIC 477 475 select HAVE_IMX_ANATOP 478 476 select HAVE_IMX_GPC ··· 482 484 config SOC_IMX6Q 483 485 bool "i.MX6 Quad/DualLite support" 484 486 select ARM_ERRATA_764369 if SMP 487 + select ARM_ERRATA_754322 488 + select ARM_ERRATA_775420 485 489 select HAVE_ARM_SCU if SMP 486 490 select HAVE_ARM_TWD 487 491 select PINCTRL_IMX6Q ··· 494 494 495 495 config SOC_IMX6SL 496 496 bool "i.MX6 SoloLite support" 497 + select ARM_ERRATA_754322 498 + select ARM_ERRATA_775420 497 499 select PINCTRL_IMX6SL 498 500 select SOC_IMX6 499 501 ··· 504 502 505 503 config SOC_IMX6SLL 506 504 bool "i.MX6 SoloLiteLite support" 505 + select ARM_ERRATA_754322 506 + select ARM_ERRATA_775420 507 507 select PINCTRL_IMX6SLL 508 508 select SOC_IMX6 509 509 ··· 514 510 515 511 config SOC_IMX6SX 516 512 bool "i.MX6 SoloX support" 513 + select ARM_ERRATA_754322 514 + select ARM_ERRATA_775420 517 515 select PINCTRL_IMX6SX 518 516 select SOC_IMX6 519 517
+4 -3
arch/arm/mach-imx/anatop.c
··· 89 89 90 90 if (cpu_is_imx6sl()) 91 91 imx_anatop_disconnect_high_snvs(false); 92 - 93 92 } 94 93 95 94 void __init imx_init_revision_from_anatop(void) 96 95 { 97 - struct device_node *np; 96 + struct device_node *np, *src_np; 98 97 void __iomem *anatop_base; 99 98 unsigned int revision; 100 99 u32 digprog; ··· 134 135 void __iomem *src_base; 135 136 u32 sbmr2; 136 137 137 - np = of_find_compatible_node(NULL, NULL, 138 + src_np = of_find_compatible_node(NULL, NULL, 138 139 "fsl,imx6ul-src"); 139 140 src_base = of_iomap(np, 0); 141 + of_node_put(src_np); 140 142 WARN_ON(!src_base); 141 143 sbmr2 = readl_relaxed(src_base + SRC_SBMR2); 142 144 iounmap(src_base); ··· 149 149 } 150 150 } 151 151 } 152 + of_node_put(np); 152 153 153 154 mxc_set_cpu_type(digprog >> 16 & 0xff); 154 155 imx_set_soc_revision(revision);
+2 -2
arch/arm/mach-imx/gpc.c
··· 10 10 #include <linux/of.h> 11 11 #include <linux/of_address.h> 12 12 #include <linux/of_irq.h> 13 - #include <linux/irqchip/arm-gic.h> 13 + 14 14 #include "common.h" 15 15 #include "hardware.h" 16 16 ··· 111 111 gpc_saved_imrs[i] = readl_relaxed(reg_imr1 + i * 4); 112 112 writel_relaxed(~0, reg_imr1 + i * 4); 113 113 } 114 - 115 114 } 116 115 117 116 void imx_gpc_restore_all(void) ··· 281 282 /* map GPC, so that at least CPUidle and WARs keep working */ 282 283 gpc_base = of_iomap(np, 0); 283 284 } 285 + of_node_put(np); 284 286 }
-13
arch/arm/mach-imx/mach-imx6q.c
··· 5 5 */ 6 6 7 7 #include <linux/clk.h> 8 - #include <linux/clkdev.h> 9 - #include <linux/cpu.h> 10 - #include <linux/delay.h> 11 - #include <linux/export.h> 12 - #include <linux/init.h> 13 - #include <linux/io.h> 14 - #include <linux/irq.h> 15 8 #include <linux/irqchip.h> 16 - #include <linux/of.h> 17 - #include <linux/of_address.h> 18 - #include <linux/of_irq.h> 19 9 #include <linux/of_platform.h> 20 - #include <linux/pm_opp.h> 21 10 #include <linux/pci.h> 22 11 #include <linux/phy.h> 23 - #include <linux/reboot.h> 24 12 #include <linux/regmap.h> 25 13 #include <linux/micrel_phy.h> 26 14 #include <linux/mfd/syscon.h> 27 15 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> 28 16 #include <asm/mach/arch.h> 29 17 #include <asm/mach/map.h> 30 - #include <asm/system_misc.h> 31 18 32 19 #include "common.h" 33 20 #include "cpuidle.h"
-1
arch/arm/mach-imx/mach-imx6sl.c
··· 4 4 */ 5 5 6 6 #include <linux/irqchip.h> 7 - #include <linux/of.h> 8 7 #include <linux/of_platform.h> 9 8 #include <linux/mfd/syscon.h> 10 9 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
-1
arch/arm/mach-imx/mach-imx6ul.c
··· 25 25 IMX6UL_GPR1_ENET_CLK_OUTPUT); 26 26 else 27 27 pr_err("failed to find fsl,imx6ul-iomux-gpr regmap\n"); 28 - 29 28 } 30 29 31 30 static int ksz8081_phy_fixup(struct phy_device *dev)
+1
arch/arm/mach-imx/platsmp.c
··· 109 109 110 110 np = of_find_compatible_node(NULL, NULL, "fsl,ls1021a-dcfg"); 111 111 dcfg_base = of_iomap(np, 0); 112 + of_node_put(np); 112 113 BUG_ON(!dcfg_base); 113 114 114 115 paddr = __pa_symbol(secondary_startup);
+2
arch/arm/mach-imx/pm-imx6.c
··· 655 655 656 656 if (of_property_read_bool(np, "fsl,pmic-stby-poweroff")) 657 657 imx6_pm_stby_poweroff_probe(); 658 + 659 + of_node_put(np); 658 660 } 659 661 660 662 void __init imx6q_pm_init(void)
+1
arch/arm/mach-imx/pm-imx7ulp.c
··· 62 62 63 63 np = of_find_compatible_node(NULL, NULL, "fsl,imx7ulp-smc1"); 64 64 smc1_base = of_iomap(np, 0); 65 + of_node_put(np); 65 66 WARN_ON(!smc1_base); 66 67 67 68 imx7ulp_set_lpm(ULP_PM_RUN);
-3
arch/arm/mach-imx/src.c
··· 43 43 int bit; 44 44 u32 val; 45 45 46 - if (!src_base) 47 - return -ENODEV; 48 - 49 46 if (sw_reset_idx >= ARRAY_SIZE(sw_reset_bits)) 50 47 return -EINVAL; 51 48
+4 -8
arch/arm/mach-iop32x/time.c
··· 137 137 return IRQ_HANDLED; 138 138 } 139 139 140 - static struct irqaction iop_timer_irq = { 141 - .name = "IOP Timer Tick", 142 - .handler = iop_timer_interrupt, 143 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 144 - .dev_id = &iop_clockevent, 145 - }; 146 - 147 140 static unsigned long iop_tick_rate; 148 141 unsigned long get_iop_tick_rate(void) 149 142 { ··· 147 154 void __init iop_init_time(unsigned long tick_rate) 148 155 { 149 156 u32 timer_ctl; 157 + int irq = IRQ_IOP32X_TIMER0; 150 158 151 159 sched_clock_register(iop_read_sched_clock, 32, tick_rate); 152 160 ··· 162 168 */ 163 169 write_tmr0(timer_ctl & ~IOP_TMR_EN); 164 170 write_tisr(1); 165 - setup_irq(IRQ_IOP32X_TIMER0, &iop_timer_irq); 171 + if (request_irq(irq, iop_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL, 172 + "IOP Timer Tick", &iop_clockevent)) 173 + pr_err("Failed to request irq() %d (IOP Timer Tick)\n", irq); 166 174 iop_clockevent.cpumask = cpumask_of(0); 167 175 clockevents_config_and_register(&iop_clockevent, tick_rate, 168 176 0xf, 0xfffffffe);
+3 -8
arch/arm/mach-mmp/time.c
··· 175 175 __raw_writel(0x2, mmp_timer_base + TMR_CER); 176 176 } 177 177 178 - static struct irqaction timer_irq = { 179 - .name = "timer", 180 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 181 - .handler = timer_interrupt, 182 - .dev_id = &ckevt, 183 - }; 184 - 185 178 void __init mmp_timer_init(int irq, unsigned long rate) 186 179 { 187 180 timer_config(); ··· 183 190 184 191 ckevt.cpumask = cpumask_of(0); 185 192 186 - setup_irq(irq, &timer_irq); 193 + if (request_irq(irq, timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL, 194 + "timer", &ckevt)) 195 + pr_err("Failed to request irq %d (timer)\n", irq); 187 196 188 197 clocksource_register_hz(&cksrc, rate); 189 198 clockevents_config_and_register(&ckevt, rate, MIN_DELTA, MAX_DELTA);
+6 -7
arch/arm/mach-omap1/pm.c
··· 596 596 return IRQ_HANDLED; 597 597 } 598 598 599 - static struct irqaction omap_wakeup_irq = { 600 - .name = "peripheral wakeup", 601 - .handler = omap_wakeup_interrupt 602 - }; 603 - 604 599 605 600 606 601 static const struct platform_suspend_ops omap_pm_ops = { ··· 608 613 static int __init omap_pm_init(void) 609 614 { 610 615 int error = 0; 616 + int irq; 611 617 612 618 if (!cpu_class_is_omap1()) 613 619 return -ENODEV; ··· 652 656 arm_pm_idle = omap1_pm_idle; 653 657 654 658 if (cpu_is_omap7xx()) 655 - setup_irq(INT_7XX_WAKE_UP_REQ, &omap_wakeup_irq); 659 + irq = INT_7XX_WAKE_UP_REQ; 656 660 else if (cpu_is_omap16xx()) 657 - setup_irq(INT_1610_WAKE_UP_REQ, &omap_wakeup_irq); 661 + irq = INT_1610_WAKE_UP_REQ; 662 + if (request_irq(irq, omap_wakeup_interrupt, 0, "peripheral wakeup", 663 + NULL)) 664 + pr_err("Failed to request irq %d (peripheral wakeup)\n", irq); 658 665 659 666 /* Program new power ramp-up time 660 667 * (0 for most boards since we don't lower voltage when in deep sleep)
+3 -7
arch/arm/mach-omap1/time.c
··· 155 155 return IRQ_HANDLED; 156 156 } 157 157 158 - static struct irqaction omap_mpu_timer1_irq = { 159 - .name = "mpu_timer1", 160 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 161 - .handler = omap_mpu_timer1_interrupt, 162 - }; 163 - 164 158 static __init void omap_init_mpu_timer(unsigned long rate) 165 159 { 166 - setup_irq(INT_TIMER1, &omap_mpu_timer1_irq); 160 + if (request_irq(INT_TIMER1, omap_mpu_timer1_interrupt, 161 + IRQF_TIMER | IRQF_IRQPOLL, "mpu_timer1", NULL)) 162 + pr_err("Failed to request irq %d (mpu_timer1)\n", INT_TIMER1); 167 163 omap_mpu_timer_start(0, (rate / HZ) - 1, 1); 168 164 169 165 clockevent_mpu_timer1.cpumask = cpumask_of(0);
+3 -7
arch/arm/mach-omap1/timer32k.c
··· 148 148 return IRQ_HANDLED; 149 149 } 150 150 151 - static struct irqaction omap_32k_timer_irq = { 152 - .name = "32KHz timer", 153 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 154 - .handler = omap_32k_timer_interrupt, 155 - }; 156 - 157 151 static __init void omap_init_32k_timer(void) 158 152 { 159 - setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); 153 + if (request_irq(INT_OS_TIMER, omap_32k_timer_interrupt, 154 + IRQF_TIMER | IRQF_IRQPOLL, "32KHz timer", NULL)) 155 + pr_err("Failed to request irq %d(32KHz timer)\n", INT_OS_TIMER); 160 156 161 157 clockevent_32k_timer.cpumask = cpumask_of(0); 162 158 clockevents_config_and_register(&clockevent_32k_timer,
+12 -7
arch/arm/mach-omap2/omap_hwmod.c
··· 3148 3148 /** 3149 3149 * omap_hwmod_init_regbits - init sysconfig specific register bits 3150 3150 * @dev: struct device 3151 + * @oh: module 3151 3152 * @data: module data 3152 3153 * @sysc_fields: new sysc configuration 3153 3154 */ 3154 - static int omap_hwmod_init_regbits(struct device *dev, 3155 + static int omap_hwmod_init_regbits(struct device *dev, struct omap_hwmod *oh, 3155 3156 const struct ti_sysc_module_data *data, 3156 3157 struct sysc_regbits **sysc_fields) 3157 3158 { 3158 - *sysc_fields = NULL; 3159 - 3160 3159 switch (data->cap->type) { 3161 3160 case TI_SYSC_OMAP2: 3162 3161 case TI_SYSC_OMAP2_TIMER: ··· 3190 3191 *sysc_fields = &omap_hwmod_sysc_type_usb_host_fs; 3191 3192 break; 3192 3193 default: 3194 + *sysc_fields = NULL; 3195 + if (!oh->class->sysc->sysc_fields) 3196 + return 0; 3197 + 3198 + dev_err(dev, "sysc_fields not found\n"); 3199 + 3193 3200 return -EINVAL; 3194 3201 } 3195 3202 ··· 3361 3356 if (!oh->class->sysc) 3362 3357 return -ENODEV; 3363 3358 3364 - if (sysc_fields != oh->class->sysc->sysc_fields) 3365 - dev_warn(dev, "sysc_fields %p != %p\n", sysc_fields, 3366 - oh->class->sysc->sysc_fields); 3359 + if (oh->class->sysc->sysc_fields && 3360 + sysc_fields != oh->class->sysc->sysc_fields) 3361 + dev_warn(dev, "sysc_fields mismatch\n"); 3367 3362 3368 3363 if (rev_offs != oh->class->sysc->rev_offs) 3369 3364 dev_warn(dev, "rev_offs %08x != %08x\n", rev_offs, ··· 3579 3574 3580 3575 cookie->data = oh; 3581 3576 3582 - error = omap_hwmod_init_regbits(dev, data, &sysc_fields); 3577 + error = omap_hwmod_init_regbits(dev, oh, data, &sysc_fields); 3583 3578 if (error) 3584 3579 return error; 3585 3580
+131 -6
arch/arm/mach-omap2/pm33xx-core.c
··· 6 6 * Dave Gerlach 7 7 */ 8 8 9 + #include <linux/cpuidle.h> 10 + #include <linux/platform_data/pm33xx.h> 11 + #include <asm/cpuidle.h> 9 12 #include <asm/smp_scu.h> 10 13 #include <asm/suspend.h> 11 14 #include <linux/errno.h> 12 - #include <linux/platform_data/pm33xx.h> 13 15 #include <linux/clk.h> 16 + #include <linux/cpu.h> 14 17 #include <linux/platform_data/gpio-omap.h> 15 18 #include <linux/pinctrl/pinmux.h> 16 19 #include <linux/wkup_m3_ipc.h> ··· 37 34 static struct clockdomain *gfx_l4ls_clkdm; 38 35 static void __iomem *scu_base; 39 36 static struct omap_hwmod *rtc_oh; 37 + 38 + static int (*idle_fn)(u32 wfi_flags); 39 + 40 + struct amx3_idle_state { 41 + int wfi_flags; 42 + }; 43 + 44 + static struct amx3_idle_state *idle_states; 40 45 41 46 static int am43xx_map_scu(void) 42 47 { ··· 79 68 return 0; 80 69 } 81 70 82 - static int amx3_common_init(void) 71 + static int amx3_common_init(int (*idle)(u32 wfi_flags)) 83 72 { 84 73 gfx_pwrdm = pwrdm_lookup("gfx_pwrdm"); 85 74 per_pwrdm = pwrdm_lookup("per_pwrdm"); ··· 99 88 else 100 89 omap_set_pwrdm_state(cefuse_pwrdm, PWRDM_POWER_OFF); 101 90 91 + idle_fn = idle; 92 + 102 93 return 0; 103 94 } 104 95 105 - static int am33xx_suspend_init(void) 96 + static int am33xx_suspend_init(int (*idle)(u32 wfi_flags)) 106 97 { 107 98 int ret; 108 99 ··· 115 102 return -ENODEV; 116 103 } 117 104 118 - ret = amx3_common_init(); 105 + ret = amx3_common_init(idle); 119 106 120 107 return ret; 121 108 } 122 109 123 - static int am43xx_suspend_init(void) 110 + static int am43xx_suspend_init(int (*idle)(u32 wfi_flags)) 124 111 { 125 112 int ret = 0; 126 113 ··· 130 117 return ret; 131 118 } 132 119 133 - ret = amx3_common_init(); 120 + ret = amx3_common_init(idle); 134 121 135 122 return ret; 123 + } 124 + 125 + static int amx3_suspend_deinit(void) 126 + { 127 + idle_fn = NULL; 128 + return 0; 136 129 } 137 130 138 131 static void amx3_pre_suspend_common(void) ··· 220 201 return ret; 221 202 } 222 203 204 + static int am33xx_cpu_suspend(int (*fn)(unsigned long), unsigned long args) 205 + { 206 + int ret = 0; 207 + 208 + if (omap_irq_pending() || need_resched()) 209 + return ret; 210 + 211 + ret = cpu_suspend(args, fn); 212 + 213 + return ret; 214 + } 215 + 216 + static int am43xx_cpu_suspend(int (*fn)(unsigned long), unsigned long args) 217 + { 218 + int ret = 0; 219 + 220 + if (!scu_base) 221 + return 0; 222 + 223 + scu_power_mode(scu_base, SCU_PM_DORMANT); 224 + ret = cpu_suspend(args, fn); 225 + scu_power_mode(scu_base, SCU_PM_NORMAL); 226 + 227 + return ret; 228 + } 229 + 230 + static void amx3_begin_suspend(void) 231 + { 232 + cpu_idle_poll_ctrl(true); 233 + } 234 + 235 + static void amx3_finish_suspend(void) 236 + { 237 + cpu_idle_poll_ctrl(false); 238 + } 239 + 240 + 223 241 static struct am33xx_pm_sram_addr *amx3_get_sram_addrs(void) 224 242 { 225 243 if (soc_is_am33xx()) ··· 309 253 310 254 static struct am33xx_pm_platform_data am33xx_ops = { 311 255 .init = am33xx_suspend_init, 256 + .deinit = amx3_suspend_deinit, 312 257 .soc_suspend = am33xx_suspend, 258 + .cpu_suspend = am33xx_cpu_suspend, 259 + .begin_suspend = amx3_begin_suspend, 260 + .finish_suspend = amx3_finish_suspend, 313 261 .get_sram_addrs = amx3_get_sram_addrs, 314 262 .save_context = am33xx_save_context, 315 263 .restore_context = am33xx_restore_context, ··· 325 265 326 266 static struct am33xx_pm_platform_data am43xx_ops = { 327 267 .init = am43xx_suspend_init, 268 + .deinit = amx3_suspend_deinit, 328 269 .soc_suspend = am43xx_suspend, 270 + .cpu_suspend = am43xx_cpu_suspend, 271 + .begin_suspend = amx3_begin_suspend, 272 + .finish_suspend = amx3_finish_suspend, 329 273 .get_sram_addrs = amx3_get_sram_addrs, 330 274 .save_context = am43xx_save_context, 331 275 .restore_context = am43xx_restore_context, ··· 365 301 366 302 return 0; 367 303 } 304 + 305 + static int __init amx3_idle_init(struct device_node *cpu_node, int cpu) 306 + { 307 + struct device_node *state_node; 308 + struct amx3_idle_state states[CPUIDLE_STATE_MAX]; 309 + int i; 310 + int state_count = 1; 311 + 312 + for (i = 0; ; i++) { 313 + state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i); 314 + if (!state_node) 315 + break; 316 + 317 + if (!of_device_is_available(state_node)) 318 + continue; 319 + 320 + if (i == CPUIDLE_STATE_MAX) { 321 + pr_warn("%s: cpuidle states reached max possible\n", 322 + __func__); 323 + break; 324 + } 325 + 326 + states[state_count].wfi_flags = 0; 327 + 328 + if (of_property_read_bool(state_node, "ti,idle-wkup-m3")) 329 + states[state_count].wfi_flags |= WFI_FLAG_WAKE_M3 | 330 + WFI_FLAG_FLUSH_CACHE; 331 + 332 + state_count++; 333 + } 334 + 335 + idle_states = kcalloc(state_count, sizeof(*idle_states), GFP_KERNEL); 336 + if (!idle_states) 337 + return -ENOMEM; 338 + 339 + for (i = 1; i < state_count; i++) 340 + idle_states[i].wfi_flags = states[i].wfi_flags; 341 + 342 + return 0; 343 + } 344 + 345 + static int amx3_idle_enter(unsigned long index) 346 + { 347 + struct amx3_idle_state *idle_state = &idle_states[index]; 348 + 349 + if (!idle_state) 350 + return -EINVAL; 351 + 352 + if (idle_fn) 353 + idle_fn(idle_state->wfi_flags); 354 + 355 + return 0; 356 + } 357 + 358 + static struct cpuidle_ops amx3_cpuidle_ops __initdata = { 359 + .init = amx3_idle_init, 360 + .suspend = amx3_idle_enter, 361 + }; 362 + 363 + CPUIDLE_METHOD_OF_DECLARE(pm33xx_idle, "ti,am3352", &amx3_cpuidle_ops); 364 + CPUIDLE_METHOD_OF_DECLARE(pm43xx_idle, "ti,am4372", &amx3_cpuidle_ops);
+3 -8
arch/arm/mach-omap2/timer.c
··· 91 91 return IRQ_HANDLED; 92 92 } 93 93 94 - static struct irqaction omap2_gp_timer_irq = { 95 - .name = "gp_timer", 96 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 97 - .handler = omap2_gp_timer_interrupt, 98 - }; 99 - 100 94 static int omap2_gp_timer_set_next_event(unsigned long cycles, 101 95 struct clock_event_device *evt) 102 96 { ··· 376 382 &clockevent_gpt.name, OMAP_TIMER_POSTED); 377 383 BUG_ON(res); 378 384 379 - omap2_gp_timer_irq.dev_id = &clkev; 380 - setup_irq(clkev.irq, &omap2_gp_timer_irq); 385 + if (request_irq(clkev.irq, omap2_gp_timer_interrupt, 386 + IRQF_TIMER | IRQF_IRQPOLL, "gp_timer", &clkev)) 387 + pr_err("Failed to request irq %d (gp_timer)\n", clkev.irq); 381 388 382 389 __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW); 383 390
-2
arch/arm/mach-orion5x/Kconfig
··· 3 3 bool "Marvell Orion" 4 4 depends on MMU && ARCH_MULTI_V5 5 5 select CPU_FEROCEON 6 - select GENERIC_CLOCKEVENTS 7 6 select GPIOLIB 8 7 select MVEBU_MBUS 9 8 select FORCE_PCI ··· 17 18 18 19 config ARCH_ORION5X_DT 19 20 bool "Marvell Orion5x Flattened Device Tree" 20 - select USE_OF 21 21 select ORION_CLK 22 22 select ORION_IRQCHIP 23 23 select ORION_TIMER
+1 -2
arch/arm/mach-orion5x/ts78xx-setup.c
··· 398 398 399 399 static int ts78xx_fpga_unload_devices(void) 400 400 { 401 - int ret = 0; 402 401 403 402 if (ts78xx_fpga.supports.ts_rtc.present == 1) 404 403 ts78xx_ts_rtc_unload(); ··· 406 407 if (ts78xx_fpga.supports.ts_rng.present == 1) 407 408 ts78xx_ts_rng_unload(); 408 409 409 - return ret; 410 + return 0; 410 411 } 411 412 412 413 static int ts78xx_fpga_load(void)
+5
arch/arm/mach-qcom/Kconfig
··· 12 12 13 13 if ARCH_QCOM 14 14 15 + config ARCH_IPQ40XX 16 + bool "Enable support for IPQ40XX" 17 + select CLKSRC_QCOM 18 + select HAVE_ARM_ARCH_TIMER 19 + 15 20 config ARCH_MSM8X60 16 21 bool "Enable support for MSM8X60" 17 22 select CLKSRC_QCOM
-1
arch/arm/mach-shmobile/setup-r8a7779.c
··· 72 72 DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)") 73 73 .smp = smp_ops(r8a7779_smp_ops), 74 74 .map_io = r8a7779_map_io, 75 - .init_early = shmobile_init_delay, 76 75 .init_irq = r8a7779_init_irq_dt, 77 76 .init_late = shmobile_init_late, 78 77 .dt_compat = r8a7779_compat_dt,
+1 -1
arch/arm/mach-shmobile/setup-rcar-gen2.c
··· 7 7 * Copyright (C) 2014 Ulrich Hecht 8 8 */ 9 9 10 - #include <linux/clk-provider.h> 11 10 #include <linux/clocksource.h> 12 11 #include <linux/device.h> 13 12 #include <linux/dma-contiguous.h> ··· 14 15 #include <linux/kernel.h> 15 16 #include <linux/memblock.h> 16 17 #include <linux/of.h> 18 + #include <linux/of_clk.h> 17 19 #include <linux/of_fdt.h> 18 20 #include <linux/of_platform.h> 19 21 #include <linux/psci.h>
-1
arch/arm/mach-shmobile/setup-sh73a0.c
··· 56 56 DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)") 57 57 .smp = smp_ops(sh73a0_smp_ops), 58 58 .map_io = sh73a0_map_io, 59 - .init_early = shmobile_init_delay, 60 59 .init_machine = sh73a0_generic_init, 61 60 .init_late = shmobile_init_late, 62 61 .dt_compat = sh73a0_boards_compat_dt,
+2 -7
arch/arm/mach-spear/time.c
··· 181 181 return IRQ_HANDLED; 182 182 } 183 183 184 - static struct irqaction spear_timer_irq = { 185 - .name = "timer", 186 - .flags = IRQF_TIMER, 187 - .handler = spear_timer_interrupt 188 - }; 189 - 190 184 static void __init spear_clockevent_init(int irq) 191 185 { 192 186 u32 tick_rate; ··· 195 201 196 202 clockevents_config_and_register(&clkevt, tick_rate, 3, 0xfff0); 197 203 198 - setup_irq(irq, &spear_timer_irq); 204 + if (request_irq(irq, spear_timer_interrupt, IRQF_TIMER, "timer", NULL)) 205 + pr_err("Failed to request irq %d (timer)\n", irq); 199 206 } 200 207 201 208 static const struct of_device_id timer_of_match[] __initconst = {
+1 -1
arch/arm/mach-sunxi/sunxi.c
··· 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 12 13 - #include <linux/clk-provider.h> 14 13 #include <linux/clocksource.h> 15 14 #include <linux/init.h> 15 + #include <linux/of_clk.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/reset/sunxi.h> 18 18
+2 -17
arch/arm/mach-tegra/Makefile
··· 8 8 obj-y += reset-handler.o 9 9 obj-y += sleep.o 10 10 obj-y += tegra.o 11 - obj-$(CONFIG_CPU_IDLE) += cpuidle.o 12 - obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += sleep-tegra20.o 11 + obj-y += sleep-tegra20.o 12 + obj-y += sleep-tegra30.o 13 13 obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pm-tegra20.o 14 - ifeq ($(CONFIG_CPU_IDLE),y) 15 - obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += cpuidle-tegra20.o 16 - endif 17 - obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += sleep-tegra30.o 18 14 obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += pm-tegra30.o 19 - ifeq ($(CONFIG_CPU_IDLE),y) 20 - obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += cpuidle-tegra30.o 21 - endif 22 15 obj-$(CONFIG_SMP) += platsmp.o 23 16 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 24 17 25 - obj-$(CONFIG_ARCH_TEGRA_114_SOC) += sleep-tegra30.o 26 18 obj-$(CONFIG_ARCH_TEGRA_114_SOC) += pm-tegra30.o 27 - ifeq ($(CONFIG_CPU_IDLE),y) 28 - obj-$(CONFIG_ARCH_TEGRA_114_SOC) += cpuidle-tegra114.o 29 - endif 30 - obj-$(CONFIG_ARCH_TEGRA_124_SOC) += sleep-tegra30.o 31 19 obj-$(CONFIG_ARCH_TEGRA_124_SOC) += pm-tegra30.o 32 - ifeq ($(CONFIG_CPU_IDLE),y) 33 - obj-$(CONFIG_ARCH_TEGRA_124_SOC) += cpuidle-tegra114.o 34 - endif 35 20 36 21 obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += board-paz00.o
-89
arch/arm/mach-tegra/cpuidle-tegra114.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * Copyright (c) 2013, NVIDIA Corporation. All rights reserved. 4 - */ 5 - 6 - #include <asm/firmware.h> 7 - #include <linux/tick.h> 8 - #include <linux/cpuidle.h> 9 - #include <linux/cpu_pm.h> 10 - #include <linux/kernel.h> 11 - #include <linux/module.h> 12 - 13 - #include <linux/firmware/trusted_foundations.h> 14 - 15 - #include <asm/cpuidle.h> 16 - #include <asm/smp_plat.h> 17 - #include <asm/suspend.h> 18 - #include <asm/psci.h> 19 - 20 - #include "cpuidle.h" 21 - #include "pm.h" 22 - #include "sleep.h" 23 - 24 - #ifdef CONFIG_PM_SLEEP 25 - #define TEGRA114_MAX_STATES 2 26 - #else 27 - #define TEGRA114_MAX_STATES 1 28 - #endif 29 - 30 - #ifdef CONFIG_PM_SLEEP 31 - static int tegra114_idle_power_down(struct cpuidle_device *dev, 32 - struct cpuidle_driver *drv, 33 - int index) 34 - { 35 - local_fiq_disable(); 36 - 37 - tegra_set_cpu_in_lp2(); 38 - cpu_pm_enter(); 39 - 40 - call_firmware_op(prepare_idle, TF_PM_MODE_LP2_NOFLUSH_L2); 41 - 42 - /* Do suspend by ourselves if the firmware does not implement it */ 43 - if (call_firmware_op(do_idle, 0) == -ENOSYS) 44 - cpu_suspend(0, tegra30_sleep_cpu_secondary_finish); 45 - 46 - cpu_pm_exit(); 47 - tegra_clear_cpu_in_lp2(); 48 - 49 - local_fiq_enable(); 50 - 51 - return index; 52 - } 53 - 54 - static void tegra114_idle_enter_s2idle(struct cpuidle_device *dev, 55 - struct cpuidle_driver *drv, 56 - int index) 57 - { 58 - tegra114_idle_power_down(dev, drv, index); 59 - } 60 - #endif 61 - 62 - static struct cpuidle_driver tegra_idle_driver = { 63 - .name = "tegra_idle", 64 - .owner = THIS_MODULE, 65 - .state_count = TEGRA114_MAX_STATES, 66 - .states = { 67 - [0] = ARM_CPUIDLE_WFI_STATE_PWR(600), 68 - #ifdef CONFIG_PM_SLEEP 69 - [1] = { 70 - .enter = tegra114_idle_power_down, 71 - .enter_s2idle = tegra114_idle_enter_s2idle, 72 - .exit_latency = 500, 73 - .target_residency = 1000, 74 - .flags = CPUIDLE_FLAG_TIMER_STOP, 75 - .power_usage = 0, 76 - .name = "powered-down", 77 - .desc = "CPU power gated", 78 - }, 79 - #endif 80 - }, 81 - }; 82 - 83 - int __init tegra114_cpuidle_init(void) 84 - { 85 - if (!psci_smp_available()) 86 - return cpuidle_register(&tegra_idle_driver, NULL); 87 - 88 - return 0; 89 - }
-212
arch/arm/mach-tegra/cpuidle-tegra20.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * CPU idle driver for Tegra CPUs 4 - * 5 - * Copyright (c) 2010-2012, NVIDIA Corporation. 6 - * Copyright (c) 2011 Google, Inc. 7 - * Author: Colin Cross <ccross@android.com> 8 - * Gary King <gking@nvidia.com> 9 - * 10 - * Rework for 3.3 by Peter De Schrijver <pdeschrijver@nvidia.com> 11 - */ 12 - 13 - #include <linux/clk/tegra.h> 14 - #include <linux/tick.h> 15 - #include <linux/cpuidle.h> 16 - #include <linux/cpu_pm.h> 17 - #include <linux/kernel.h> 18 - #include <linux/module.h> 19 - 20 - #include <soc/tegra/flowctrl.h> 21 - 22 - #include <asm/cpuidle.h> 23 - #include <asm/smp_plat.h> 24 - #include <asm/suspend.h> 25 - 26 - #include "cpuidle.h" 27 - #include "iomap.h" 28 - #include "irq.h" 29 - #include "pm.h" 30 - #include "reset.h" 31 - #include "sleep.h" 32 - 33 - #ifdef CONFIG_PM_SLEEP 34 - static bool abort_flag; 35 - static atomic_t abort_barrier; 36 - static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev, 37 - struct cpuidle_driver *drv, 38 - int index); 39 - #define TEGRA20_MAX_STATES 2 40 - #else 41 - #define TEGRA20_MAX_STATES 1 42 - #endif 43 - 44 - static struct cpuidle_driver tegra_idle_driver = { 45 - .name = "tegra_idle", 46 - .owner = THIS_MODULE, 47 - .states = { 48 - ARM_CPUIDLE_WFI_STATE_PWR(600), 49 - #ifdef CONFIG_PM_SLEEP 50 - { 51 - .enter = tegra20_idle_lp2_coupled, 52 - .exit_latency = 5000, 53 - .target_residency = 10000, 54 - .power_usage = 0, 55 - .flags = CPUIDLE_FLAG_COUPLED | 56 - CPUIDLE_FLAG_TIMER_STOP, 57 - .name = "powered-down", 58 - .desc = "CPU power gated", 59 - }, 60 - #endif 61 - }, 62 - .state_count = TEGRA20_MAX_STATES, 63 - .safe_state_index = 0, 64 - }; 65 - 66 - #ifdef CONFIG_PM_SLEEP 67 - #ifdef CONFIG_SMP 68 - static int tegra20_reset_sleeping_cpu_1(void) 69 - { 70 - int ret = 0; 71 - 72 - tegra_pen_lock(); 73 - 74 - if (readb(tegra20_cpu1_resettable_status) == CPU_RESETTABLE) 75 - tegra20_cpu_shutdown(1); 76 - else 77 - ret = -EINVAL; 78 - 79 - tegra_pen_unlock(); 80 - 81 - return ret; 82 - } 83 - 84 - static void tegra20_wake_cpu1_from_reset(void) 85 - { 86 - tegra_pen_lock(); 87 - 88 - tegra20_cpu_clear_resettable(); 89 - 90 - /* enable cpu clock on cpu */ 91 - tegra_enable_cpu_clock(1); 92 - 93 - /* take the CPU out of reset */ 94 - tegra_cpu_out_of_reset(1); 95 - 96 - /* unhalt the cpu */ 97 - flowctrl_write_cpu_halt(1, 0); 98 - 99 - tegra_pen_unlock(); 100 - } 101 - 102 - static int tegra20_reset_cpu_1(void) 103 - { 104 - if (!cpu_online(1) || !tegra20_reset_sleeping_cpu_1()) 105 - return 0; 106 - 107 - tegra20_wake_cpu1_from_reset(); 108 - return -EBUSY; 109 - } 110 - #else 111 - static inline void tegra20_wake_cpu1_from_reset(void) 112 - { 113 - } 114 - 115 - static inline int tegra20_reset_cpu_1(void) 116 - { 117 - return 0; 118 - } 119 - #endif 120 - 121 - static bool tegra20_cpu_cluster_power_down(struct cpuidle_device *dev, 122 - struct cpuidle_driver *drv, 123 - int index) 124 - { 125 - while (tegra20_cpu_is_resettable_soon()) 126 - cpu_relax(); 127 - 128 - if (tegra20_reset_cpu_1() || !tegra_cpu_rail_off_ready()) 129 - return false; 130 - 131 - tegra_idle_lp2_last(); 132 - 133 - if (cpu_online(1)) 134 - tegra20_wake_cpu1_from_reset(); 135 - 136 - return true; 137 - } 138 - 139 - #ifdef CONFIG_SMP 140 - static bool tegra20_idle_enter_lp2_cpu_1(struct cpuidle_device *dev, 141 - struct cpuidle_driver *drv, 142 - int index) 143 - { 144 - cpu_suspend(0, tegra20_sleep_cpu_secondary_finish); 145 - 146 - tegra20_cpu_clear_resettable(); 147 - 148 - return true; 149 - } 150 - #else 151 - static inline bool tegra20_idle_enter_lp2_cpu_1(struct cpuidle_device *dev, 152 - struct cpuidle_driver *drv, 153 - int index) 154 - { 155 - return true; 156 - } 157 - #endif 158 - 159 - static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev, 160 - struct cpuidle_driver *drv, 161 - int index) 162 - { 163 - bool entered_lp2 = false; 164 - 165 - if (tegra_pending_sgi()) 166 - WRITE_ONCE(abort_flag, true); 167 - 168 - cpuidle_coupled_parallel_barrier(dev, &abort_barrier); 169 - 170 - if (abort_flag) { 171 - cpuidle_coupled_parallel_barrier(dev, &abort_barrier); 172 - abort_flag = false; /* clean flag for next coming */ 173 - return -EINTR; 174 - } 175 - 176 - local_fiq_disable(); 177 - 178 - tegra_set_cpu_in_lp2(); 179 - cpu_pm_enter(); 180 - 181 - if (dev->cpu == 0) 182 - entered_lp2 = tegra20_cpu_cluster_power_down(dev, drv, index); 183 - else 184 - entered_lp2 = tegra20_idle_enter_lp2_cpu_1(dev, drv, index); 185 - 186 - cpu_pm_exit(); 187 - tegra_clear_cpu_in_lp2(); 188 - 189 - local_fiq_enable(); 190 - 191 - smp_rmb(); 192 - 193 - return entered_lp2 ? index : 0; 194 - } 195 - #endif 196 - 197 - /* 198 - * Tegra20 HW appears to have a bug such that PCIe device interrupts, whether 199 - * they are legacy IRQs or MSI, are lost when LP2 is enabled. To work around 200 - * this, simply disable LP2 if the PCI driver and DT node are both enabled. 201 - */ 202 - void tegra20_cpuidle_pcie_irqs_in_use(void) 203 - { 204 - pr_info_once( 205 - "Disabling cpuidle LP2 state, since PCIe IRQs are in use\n"); 206 - cpuidle_driver_state_disabled(&tegra_idle_driver, 1, true); 207 - } 208 - 209 - int __init tegra20_cpuidle_init(void) 210 - { 211 - return cpuidle_register(&tegra_idle_driver, cpu_possible_mask); 212 - }
-132
arch/arm/mach-tegra/cpuidle-tegra30.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * CPU idle driver for Tegra CPUs 4 - * 5 - * Copyright (c) 2010-2012, NVIDIA Corporation. 6 - * Copyright (c) 2011 Google, Inc. 7 - * Author: Colin Cross <ccross@android.com> 8 - * Gary King <gking@nvidia.com> 9 - * 10 - * Rework for 3.3 by Peter De Schrijver <pdeschrijver@nvidia.com> 11 - */ 12 - 13 - #include <linux/clk/tegra.h> 14 - #include <linux/tick.h> 15 - #include <linux/cpuidle.h> 16 - #include <linux/cpu_pm.h> 17 - #include <linux/kernel.h> 18 - #include <linux/module.h> 19 - 20 - #include <asm/cpuidle.h> 21 - #include <asm/smp_plat.h> 22 - #include <asm/suspend.h> 23 - 24 - #include "cpuidle.h" 25 - #include "pm.h" 26 - #include "sleep.h" 27 - 28 - #ifdef CONFIG_PM_SLEEP 29 - static int tegra30_idle_lp2(struct cpuidle_device *dev, 30 - struct cpuidle_driver *drv, 31 - int index); 32 - #endif 33 - 34 - static struct cpuidle_driver tegra_idle_driver = { 35 - .name = "tegra_idle", 36 - .owner = THIS_MODULE, 37 - #ifdef CONFIG_PM_SLEEP 38 - .state_count = 2, 39 - #else 40 - .state_count = 1, 41 - #endif 42 - .states = { 43 - [0] = ARM_CPUIDLE_WFI_STATE_PWR(600), 44 - #ifdef CONFIG_PM_SLEEP 45 - [1] = { 46 - .enter = tegra30_idle_lp2, 47 - .exit_latency = 2000, 48 - .target_residency = 2200, 49 - .power_usage = 0, 50 - .flags = CPUIDLE_FLAG_TIMER_STOP, 51 - .name = "powered-down", 52 - .desc = "CPU power gated", 53 - }, 54 - #endif 55 - }, 56 - }; 57 - 58 - #ifdef CONFIG_PM_SLEEP 59 - static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev, 60 - struct cpuidle_driver *drv, 61 - int index) 62 - { 63 - /* All CPUs entering LP2 is not working. 64 - * Don't let CPU0 enter LP2 when any secondary CPU is online. 65 - */ 66 - if (num_online_cpus() > 1 || !tegra_cpu_rail_off_ready()) { 67 - cpu_do_idle(); 68 - return false; 69 - } 70 - 71 - tegra_idle_lp2_last(); 72 - 73 - return true; 74 - } 75 - 76 - #ifdef CONFIG_SMP 77 - static bool tegra30_cpu_core_power_down(struct cpuidle_device *dev, 78 - struct cpuidle_driver *drv, 79 - int index) 80 - { 81 - smp_wmb(); 82 - 83 - cpu_suspend(0, tegra30_sleep_cpu_secondary_finish); 84 - 85 - return true; 86 - } 87 - #else 88 - static inline bool tegra30_cpu_core_power_down(struct cpuidle_device *dev, 89 - struct cpuidle_driver *drv, 90 - int index) 91 - { 92 - return true; 93 - } 94 - #endif 95 - 96 - static int tegra30_idle_lp2(struct cpuidle_device *dev, 97 - struct cpuidle_driver *drv, 98 - int index) 99 - { 100 - bool entered_lp2 = false; 101 - bool last_cpu; 102 - 103 - local_fiq_disable(); 104 - 105 - last_cpu = tegra_set_cpu_in_lp2(); 106 - cpu_pm_enter(); 107 - 108 - if (dev->cpu == 0) { 109 - if (last_cpu) 110 - entered_lp2 = tegra30_cpu_cluster_power_down(dev, drv, 111 - index); 112 - else 113 - cpu_do_idle(); 114 - } else { 115 - entered_lp2 = tegra30_cpu_core_power_down(dev, drv, index); 116 - } 117 - 118 - cpu_pm_exit(); 119 - tegra_clear_cpu_in_lp2(); 120 - 121 - local_fiq_enable(); 122 - 123 - smp_rmb(); 124 - 125 - return (entered_lp2) ? index : 0; 126 - } 127 - #endif 128 - 129 - int __init tegra30_cpuidle_init(void) 130 - { 131 - return cpuidle_register(&tegra_idle_driver, NULL); 132 - }
-50
arch/arm/mach-tegra/cpuidle.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * arch/arm/mach-tegra/cpuidle.c 4 - * 5 - * CPU idle driver for Tegra CPUs 6 - * 7 - * Copyright (c) 2010-2012, NVIDIA Corporation. 8 - * Copyright (c) 2011 Google, Inc. 9 - * Author: Colin Cross <ccross@android.com> 10 - * Gary King <gking@nvidia.com> 11 - * 12 - * Rework for 3.3 by Peter De Schrijver <pdeschrijver@nvidia.com> 13 - */ 14 - 15 - #include <linux/kernel.h> 16 - #include <linux/module.h> 17 - 18 - #include <soc/tegra/fuse.h> 19 - 20 - #include "cpuidle.h" 21 - 22 - void __init tegra_cpuidle_init(void) 23 - { 24 - switch (tegra_get_chip_id()) { 25 - case TEGRA20: 26 - if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) 27 - tegra20_cpuidle_init(); 28 - break; 29 - case TEGRA30: 30 - if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC)) 31 - tegra30_cpuidle_init(); 32 - break; 33 - case TEGRA114: 34 - case TEGRA124: 35 - if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) || 36 - IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC)) 37 - tegra114_cpuidle_init(); 38 - break; 39 - } 40 - } 41 - 42 - void tegra_cpuidle_pcie_irqs_in_use(void) 43 - { 44 - switch (tegra_get_chip_id()) { 45 - case TEGRA20: 46 - if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) 47 - tegra20_cpuidle_pcie_irqs_in_use(); 48 - break; 49 - } 50 - }
-21
arch/arm/mach-tegra/cpuidle.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright (c) 2012, NVIDIA Corporation. All rights reserved. 4 - */ 5 - 6 - #ifndef __MACH_TEGRA_CPUIDLE_H 7 - #define __MACH_TEGRA_CPUIDLE_H 8 - 9 - #ifdef CONFIG_CPU_IDLE 10 - int tegra20_cpuidle_init(void); 11 - void tegra20_cpuidle_pcie_irqs_in_use(void); 12 - int tegra30_cpuidle_init(void); 13 - int tegra114_cpuidle_init(void); 14 - void tegra_cpuidle_init(void); 15 - void tegra_cpuidle_pcie_irqs_in_use(void); 16 - #else 17 - static inline void tegra_cpuidle_init(void) {} 18 - static inline void tegra_cpuidle_pcie_irqs_in_use(void) {} 19 - #endif 20 - 21 - #endif
+2 -1
arch/arm/mach-tegra/irq.c
··· 18 18 #include <linux/of.h> 19 19 #include <linux/syscore_ops.h> 20 20 21 + #include <soc/tegra/irq.h> 22 + 21 23 #include "board.h" 22 24 #include "iomap.h" 23 - #include "irq.h" 24 25 25 26 #define SGI_MASK 0xFFFF 26 27
+5 -3
arch/arm/mach-tegra/irq.h include/soc/tegra/irq.h
··· 3 3 * Copyright (c) 2012, NVIDIA Corporation. All rights reserved. 4 4 */ 5 5 6 - #ifndef __TEGRA_IRQ_H 7 - #define __TEGRA_IRQ_H 6 + #ifndef __SOC_TEGRA_IRQ_H 7 + #define __SOC_TEGRA_IRQ_H 8 8 9 + #if defined(CONFIG_ARM) 9 10 bool tegra_pending_sgi(void); 10 - 11 11 #endif 12 + 13 + #endif /* __SOC_TEGRA_IRQ_H */
+32 -22
arch/arm/mach-tegra/pm.c
··· 110 110 flowctrl_cpu_suspend_enter(cpu); 111 111 } 112 112 113 - void tegra_clear_cpu_in_lp2(void) 113 + void tegra_pm_clear_cpu_in_lp2(void) 114 114 { 115 115 int phy_cpu_id = cpu_logical_map(smp_processor_id()); 116 116 u32 *cpu_in_lp2 = tegra_cpu_lp2_mask; ··· 123 123 spin_unlock(&tegra_lp2_lock); 124 124 } 125 125 126 - bool tegra_set_cpu_in_lp2(void) 126 + void tegra_pm_set_cpu_in_lp2(void) 127 127 { 128 128 int phy_cpu_id = cpu_logical_map(smp_processor_id()); 129 - bool last_cpu = false; 130 - cpumask_t *cpu_lp2_mask = tegra_cpu_lp2_mask; 131 129 u32 *cpu_in_lp2 = tegra_cpu_lp2_mask; 132 130 133 131 spin_lock(&tegra_lp2_lock); ··· 133 135 BUG_ON((*cpu_in_lp2 & BIT(phy_cpu_id))); 134 136 *cpu_in_lp2 |= BIT(phy_cpu_id); 135 137 136 - if ((phy_cpu_id == 0) && cpumask_equal(cpu_lp2_mask, cpu_online_mask)) 137 - last_cpu = true; 138 - else if (tegra_get_chip_id() == TEGRA20 && phy_cpu_id == 1) 139 - tegra20_cpu_set_resettable_soon(); 140 - 141 138 spin_unlock(&tegra_lp2_lock); 142 - return last_cpu; 143 - } 144 - 145 - int tegra_cpu_do_idle(void) 146 - { 147 - return cpu_do_idle(); 148 139 } 149 140 150 141 static int tegra_sleep_cpu(unsigned long v2p) 151 142 { 143 + if (tegra_cpu_car_ops->rail_off_ready && 144 + WARN_ON(!tegra_cpu_rail_off_ready())) 145 + return -EBUSY; 146 + 152 147 /* 153 148 * L2 cache disabling using kernel API only allowed when all 154 149 * secondary CPU's are offline. Cache have to be disabled with ··· 150 159 * if any of secondary CPU's is online and this is the LP2-idle 151 160 * code-path only for Tegra20/30. 152 161 */ 153 - if (trusted_foundations_registered()) 154 - outer_disable(); 155 - 162 + #ifdef CONFIG_OUTER_CACHE 163 + if (trusted_foundations_registered() && outer_cache.disable) 164 + outer_cache.disable(); 165 + #endif 156 166 /* 157 167 * Note that besides of setting up CPU reset vector this firmware 158 168 * call may also do the following, depending on the FW version: ··· 194 202 tegra_pmc_enter_suspend_mode(mode); 195 203 } 196 204 197 - void tegra_idle_lp2_last(void) 205 + int tegra_pm_enter_lp2(void) 198 206 { 207 + int err; 208 + 199 209 tegra_pm_set(TEGRA_SUSPEND_LP2); 200 210 201 211 cpu_cluster_pm_enter(); 202 212 suspend_cpu_complex(); 203 213 204 - cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu); 214 + err = cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu); 205 215 206 216 /* 207 217 * Resume L2 cache if it wasn't re-enabled early during resume, ··· 215 221 216 222 restore_cpu_complex(); 217 223 cpu_cluster_pm_exit(); 224 + 225 + return err; 218 226 } 219 227 220 228 enum tegra_suspend_mode tegra_pm_validate_suspend_mode( ··· 361 365 tegra_suspend_enter_lp1(); 362 366 break; 363 367 case TEGRA_SUSPEND_LP2: 364 - tegra_set_cpu_in_lp2(); 368 + tegra_pm_set_cpu_in_lp2(); 365 369 break; 366 370 default: 367 371 break; ··· 382 386 tegra_suspend_exit_lp1(); 383 387 break; 384 388 case TEGRA_SUSPEND_LP2: 385 - tegra_clear_cpu_in_lp2(); 389 + tegra_pm_clear_cpu_in_lp2(); 386 390 break; 387 391 default: 388 392 break; ··· 431 435 } 432 436 433 437 suspend_set_ops(&tegra_suspend_ops); 438 + } 439 + 440 + int tegra_pm_park_secondary_cpu(unsigned long cpu) 441 + { 442 + if (cpu > 0) { 443 + tegra_disable_clean_inv_dcache(TEGRA_FLUSH_CACHE_LOUIS); 444 + 445 + if (tegra_get_chip_id() == TEGRA20) 446 + tegra20_hotplug_shutdown(); 447 + else 448 + tegra30_hotplug_shutdown(); 449 + } 450 + 451 + return -EINVAL; 434 452 } 435 453 #endif
-4
arch/arm/mach-tegra/pm.h
··· 23 23 void tegra30_lp1_iram_hook(void); 24 24 void tegra30_sleep_core_init(void); 25 25 26 - void tegra_clear_cpu_in_lp2(void); 27 - bool tegra_set_cpu_in_lp2(void); 28 - int tegra_cpu_do_idle(void); 29 - void tegra_idle_lp2_last(void); 30 26 extern void (*tegra_tear_down_cpu)(void); 31 27 32 28 #ifdef CONFIG_PM_SLEEP
-11
arch/arm/mach-tegra/reset-handler.S
··· 183 183 bleq __die @ CPU not present (to OS) 184 184 #endif 185 185 186 - #ifdef CONFIG_ARCH_TEGRA_2x_SOC 187 - /* Are we on Tegra20? */ 188 - cmp r6, #TEGRA20 189 - bne 1f 190 - /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */ 191 - mov r0, #CPU_NOT_RESETTABLE 192 - cmp r10, #0 193 - strbne r0, [r12, #RESET_DATA(RESETTABLE_STATUS)] 194 - 1: 195 - #endif 196 - 197 186 /* Waking up from LP1? */ 198 187 ldr r8, [r12, #RESET_DATA(MASK_LP1)] 199 188 tst r8, r11 @ if in_lp1
+2 -7
arch/arm/mach-tegra/reset.h
··· 16 16 #define TEGRA_RESET_STARTUP_SECONDARY 3 17 17 #define TEGRA_RESET_STARTUP_LP2 4 18 18 #define TEGRA_RESET_STARTUP_LP1 5 19 - #define TEGRA_RESET_RESETTABLE_STATUS 6 20 - #define TEGRA_RESET_TF_PRESENT 7 21 - #define TEGRA_RESET_DATA_SIZE 8 19 + #define TEGRA_RESET_TF_PRESENT 6 20 + #define TEGRA_RESET_DATA_SIZE 7 22 21 23 22 #define RESET_DATA(x) ((TEGRA_RESET_##x)*4) 24 23 ··· 40 41 #define tegra_cpu_lp2_mask \ 41 42 (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \ 42 43 ((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_LP2] - \ 43 - (u32)__tegra_cpu_reset_handler_start))) 44 - #define tegra20_cpu1_resettable_status \ 45 - (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \ 46 - ((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_RESETTABLE_STATUS] - \ 47 44 (u32)__tegra_cpu_reset_handler_start))) 48 45 #endif 49 46
-170
arch/arm/mach-tegra/sleep-tegra20.S
··· 43 43 #define APB_MISC_XM2CFGCPADCTRL2 0x8e4 44 44 #define APB_MISC_XM2CFGDPADCTRL2 0x8e8 45 45 46 - #define __tegra20_cpu1_resettable_status_offset \ 47 - (__tegra_cpu_reset_handler_data_offset + RESET_DATA(RESETTABLE_STATUS)) 48 - 49 46 .macro pll_enable, rd, r_car_base, pll_base 50 47 ldr \rd, [\r_car_base, #\pll_base] 51 48 tst \rd, #(1 << 30) ··· 87 90 ENTRY(tegra20_cpu_shutdown) 88 91 cmp r0, #0 89 92 reteq lr @ must not be called for CPU 0 90 - mov32 r1, TEGRA_IRAM_RESET_BASE_VIRT 91 - ldr r2, =__tegra20_cpu1_resettable_status_offset 92 - mov r12, #CPU_RESETTABLE 93 - strb r12, [r1, r2] 94 93 95 94 cpu_to_halt_reg r1, r0 96 95 ldr r3, =TEGRA_FLOW_CTRL_VIRT ··· 109 116 #endif 110 117 111 118 #ifdef CONFIG_PM_SLEEP 112 - /* 113 - * tegra_pen_lock 114 - * 115 - * spinlock implementation with no atomic test-and-set and no coherence 116 - * using Peterson's algorithm on strongly-ordered registers 117 - * used to synchronize a cpu waking up from wfi with entering lp2 on idle 118 - * 119 - * The reference link of Peterson's algorithm: 120 - * http://en.wikipedia.org/wiki/Peterson's_algorithm 121 - * 122 - * SCRATCH37 = r1 = !turn (inverted from Peterson's algorithm) 123 - * on cpu 0: 124 - * r2 = flag[0] (in SCRATCH38) 125 - * r3 = flag[1] (in SCRATCH39) 126 - * on cpu1: 127 - * r2 = flag[1] (in SCRATCH39) 128 - * r3 = flag[0] (in SCRATCH38) 129 - * 130 - * must be called with MMU on 131 - * corrupts r0-r3, r12 132 - */ 133 - ENTRY(tegra_pen_lock) 134 - mov32 r3, TEGRA_PMC_VIRT 135 - cpu_id r0 136 - add r1, r3, #PMC_SCRATCH37 137 - cmp r0, #0 138 - addeq r2, r3, #PMC_SCRATCH38 139 - addeq r3, r3, #PMC_SCRATCH39 140 - addne r2, r3, #PMC_SCRATCH39 141 - addne r3, r3, #PMC_SCRATCH38 142 - 143 - mov r12, #1 144 - str r12, [r2] @ flag[cpu] = 1 145 - dsb 146 - str r12, [r1] @ !turn = cpu 147 - 1: dsb 148 - ldr r12, [r3] 149 - cmp r12, #1 @ flag[!cpu] == 1? 150 - ldreq r12, [r1] 151 - cmpeq r12, r0 @ !turn == cpu? 152 - beq 1b @ while !turn == cpu && flag[!cpu] == 1 153 - 154 - ret lr @ locked 155 - ENDPROC(tegra_pen_lock) 156 - 157 - ENTRY(tegra_pen_unlock) 158 - dsb 159 - mov32 r3, TEGRA_PMC_VIRT 160 - cpu_id r0 161 - cmp r0, #0 162 - addeq r2, r3, #PMC_SCRATCH38 163 - addne r2, r3, #PMC_SCRATCH39 164 - mov r12, #0 165 - str r12, [r2] 166 - ret lr 167 - ENDPROC(tegra_pen_unlock) 168 - 169 - /* 170 - * tegra20_cpu_clear_resettable(void) 171 - * 172 - * Called to clear the "resettable soon" flag in IRAM variable when 173 - * it is expected that the secondary CPU will be idle soon. 174 - */ 175 - ENTRY(tegra20_cpu_clear_resettable) 176 - mov32 r1, TEGRA_IRAM_RESET_BASE_VIRT 177 - ldr r2, =__tegra20_cpu1_resettable_status_offset 178 - mov r12, #CPU_NOT_RESETTABLE 179 - strb r12, [r1, r2] 180 - ret lr 181 - ENDPROC(tegra20_cpu_clear_resettable) 182 - 183 - /* 184 - * tegra20_cpu_set_resettable_soon(void) 185 - * 186 - * Called to set the "resettable soon" flag in IRAM variable when 187 - * it is expected that the secondary CPU will be idle soon. 188 - */ 189 - ENTRY(tegra20_cpu_set_resettable_soon) 190 - mov32 r1, TEGRA_IRAM_RESET_BASE_VIRT 191 - ldr r2, =__tegra20_cpu1_resettable_status_offset 192 - mov r12, #CPU_RESETTABLE_SOON 193 - strb r12, [r1, r2] 194 - ret lr 195 - ENDPROC(tegra20_cpu_set_resettable_soon) 196 - 197 - /* 198 - * tegra20_cpu_is_resettable_soon(void) 199 - * 200 - * Returns true if the "resettable soon" flag in IRAM variable has been 201 - * set because it is expected that the secondary CPU will be idle soon. 202 - */ 203 - ENTRY(tegra20_cpu_is_resettable_soon) 204 - mov32 r1, TEGRA_IRAM_RESET_BASE_VIRT 205 - ldr r2, =__tegra20_cpu1_resettable_status_offset 206 - ldrb r12, [r1, r2] 207 - cmp r12, #CPU_RESETTABLE_SOON 208 - moveq r0, #1 209 - movne r0, #0 210 - ret lr 211 - ENDPROC(tegra20_cpu_is_resettable_soon) 212 - 213 119 /* 214 120 * tegra20_sleep_core_finish(unsigned long v2p) 215 121 * ··· 133 241 134 242 ret r3 135 243 ENDPROC(tegra20_sleep_core_finish) 136 - 137 - /* 138 - * tegra20_sleep_cpu_secondary_finish(unsigned long v2p) 139 - * 140 - * Enters WFI on secondary CPU by exiting coherency. 141 - */ 142 - ENTRY(tegra20_sleep_cpu_secondary_finish) 143 - stmfd sp!, {r4-r11, lr} 144 - 145 - mrc p15, 0, r11, c1, c0, 1 @ save actlr before exiting coherency 146 - 147 - /* Flush and disable the L1 data cache */ 148 - mov r0, #TEGRA_FLUSH_CACHE_LOUIS 149 - bl tegra_disable_clean_inv_dcache 150 - 151 - mov32 r0, TEGRA_IRAM_RESET_BASE_VIRT 152 - ldr r4, =__tegra20_cpu1_resettable_status_offset 153 - mov r3, #CPU_RESETTABLE 154 - strb r3, [r0, r4] 155 - 156 - bl tegra_cpu_do_idle 157 - 158 - /* 159 - * cpu may be reset while in wfi, which will return through 160 - * tegra_resume to cpu_resume 161 - * or interrupt may wake wfi, which will return here 162 - * cpu state is unchanged - MMU is on, cache is on, coherency 163 - * is off, and the data cache is off 164 - * 165 - * r11 contains the original actlr 166 - */ 167 - 168 - bl tegra_pen_lock 169 - 170 - mov32 r0, TEGRA_IRAM_RESET_BASE_VIRT 171 - ldr r4, =__tegra20_cpu1_resettable_status_offset 172 - mov r3, #CPU_NOT_RESETTABLE 173 - strb r3, [r0, r4] 174 - 175 - bl tegra_pen_unlock 176 - 177 - /* Re-enable the data cache */ 178 - mrc p15, 0, r10, c1, c0, 0 179 - orr r10, r10, #CR_C 180 - mcr p15, 0, r10, c1, c0, 0 181 - isb 182 - 183 - mcr p15, 0, r11, c1, c0, 1 @ reenable coherency 184 - 185 - /* Invalidate the TLBs & BTAC */ 186 - mov r1, #0 187 - mcr p15, 0, r1, c8, c3, 0 @ invalidate shared TLBs 188 - mcr p15, 0, r1, c7, c1, 6 @ invalidate shared BTAC 189 - dsb 190 - isb 191 - 192 - /* the cpu was running with coherency disabled, 193 - * caches may be out of date */ 194 - bl v7_flush_kern_cache_louis 195 - 196 - ldmfd sp!, {r4 - r11, pc} 197 - ENDPROC(tegra20_sleep_cpu_secondary_finish) 198 244 199 245 /* 200 246 * tegra20_tear_down_cpu
+3 -3
arch/arm/mach-tegra/sleep-tegra30.S
··· 265 265 ENDPROC(tegra30_sleep_core_finish) 266 266 267 267 /* 268 - * tegra30_sleep_cpu_secondary_finish(unsigned long v2p) 268 + * tegra30_pm_secondary_cpu_suspend(unsigned long unused_arg) 269 269 * 270 270 * Enters LP2 on secondary CPU by exiting coherency and powergating the CPU. 271 271 */ 272 - ENTRY(tegra30_sleep_cpu_secondary_finish) 272 + ENTRY(tegra30_pm_secondary_cpu_suspend) 273 273 mov r7, lr 274 274 275 275 /* Flush and disable the L1 data cache */ ··· 281 281 bl tegra30_cpu_shutdown 282 282 mov r0, #1 @ never return here 283 283 ret r7 284 - ENDPROC(tegra30_sleep_cpu_secondary_finish) 284 + ENDPROC(tegra30_pm_secondary_cpu_suspend) 285 285 286 286 /* 287 287 * tegra30_tear_down_cpu
-15
arch/arm/mach-tegra/sleep.h
··· 114 114 .endm 115 115 116 116 #else 117 - void tegra_pen_lock(void); 118 - void tegra_pen_unlock(void); 119 117 void tegra_resume(void); 120 118 int tegra_sleep_cpu_finish(unsigned long); 121 119 void tegra_disable_clean_inv_dcache(u32 flag); 122 120 123 - #ifdef CONFIG_HOTPLUG_CPU 124 121 void tegra20_hotplug_shutdown(void); 125 122 void tegra30_hotplug_shutdown(void); 126 - #endif 127 123 128 - void tegra20_cpu_shutdown(int cpu); 129 - int tegra20_cpu_is_resettable_soon(void); 130 - void tegra20_cpu_clear_resettable(void); 131 - #ifdef CONFIG_ARCH_TEGRA_2x_SOC 132 - void tegra20_cpu_set_resettable_soon(void); 133 - #else 134 - static inline void tegra20_cpu_set_resettable_soon(void) {} 135 - #endif 136 - 137 - int tegra20_sleep_cpu_secondary_finish(unsigned long); 138 124 void tegra20_tear_down_cpu(void); 139 - int tegra30_sleep_cpu_secondary_finish(unsigned long); 140 125 void tegra30_tear_down_cpu(void); 141 126 142 127 #endif
+4 -3
arch/arm/mach-tegra/tegra.c
··· 36 36 #include <asm/mach/arch.h> 37 37 #include <asm/mach/time.h> 38 38 #include <asm/mach-types.h> 39 + #include <asm/psci.h> 39 40 #include <asm/setup.h> 40 41 41 42 #include "board.h" 42 43 #include "common.h" 43 - #include "cpuidle.h" 44 44 #include "iomap.h" 45 - #include "irq.h" 46 45 #include "pm.h" 47 46 #include "reset.h" 48 47 #include "sleep.h" ··· 85 86 static void __init tegra_dt_init_late(void) 86 87 { 87 88 tegra_init_suspend(); 88 - tegra_cpuidle_init(); 89 89 90 90 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && 91 91 of_machine_is_compatible("compal,paz00")) ··· 93 95 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && 94 96 of_machine_is_compatible("nvidia,tegra20")) 95 97 platform_device_register_simple("tegra20-cpufreq", -1, NULL, 0); 98 + 99 + if (IS_ENABLED(CONFIG_ARM_TEGRA_CPUIDLE) && !psci_smp_available()) 100 + platform_device_register_simple("tegra-cpuidle", -1, NULL, 0); 96 101 } 97 102 98 103 static const char * const tegra_dt_board_compat[] = {
+1 -1
arch/arm/mach-zynq/common.c
··· 12 12 #include <linux/cpumask.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/clk.h> 15 - #include <linux/clk-provider.h> 16 15 #include <linux/clk/zynq.h> 17 16 #include <linux/clocksource.h> 18 17 #include <linux/of_address.h> 18 + #include <linux/of_clk.h> 19 19 #include <linux/of_irq.h> 20 20 #include <linux/of_platform.h> 21 21 #include <linux/of.h>
+3 -7
arch/arm/plat-orion/time.c
··· 177 177 return IRQ_HANDLED; 178 178 } 179 179 180 - static struct irqaction orion_timer_irq = { 181 - .name = "orion_tick", 182 - .flags = IRQF_TIMER, 183 - .handler = orion_timer_interrupt 184 - }; 185 - 186 180 void __init 187 181 orion_time_set_base(void __iomem *_timer_base) 188 182 { ··· 230 236 /* 231 237 * Setup clockevent timer (interrupt-driven). 232 238 */ 233 - setup_irq(irq, &orion_timer_irq); 239 + if (request_irq(irq, orion_timer_interrupt, IRQF_TIMER, "orion_tick", 240 + NULL)) 241 + pr_err("Failed to request irq %u (orion_tick)\n", irq); 234 242 orion_clkevt.cpumask = cpumask_of(0); 235 243 clockevents_config_and_register(&orion_clkevt, tclk, 1, 0xfffffffe); 236 244 }
-2
arch/arm64/Kconfig.platforms
··· 39 39 select ARM_AMBA 40 40 select ARM_GIC 41 41 select ARM_TIMER_SP804 42 - select HAVE_ARM_ARCH_TIMER 43 42 help 44 43 This enables support for the Broadcom BCM2837 and BCM2711 SoC. 45 44 These SoCs are used in the Raspberry Pi 3 and 4 devices. ··· 300 301 301 302 config ARCH_ZYNQMP 302 303 bool "Xilinx ZynqMP Family" 303 - select ZYNQMP_FIRMWARE 304 304 help 305 305 This enables support for Xilinx ZynqMP Family 306 306
+37 -54
drivers/clk/at91/clk-sam9x60-pll.c
··· 14 14 15 15 #include "pmc.h" 16 16 17 - #define PMC_PLL_CTRL0 0xc 18 - #define PMC_PLL_CTRL0_DIV_MSK GENMASK(7, 0) 19 - #define PMC_PLL_CTRL0_ENPLL BIT(28) 20 - #define PMC_PLL_CTRL0_ENPLLCK BIT(29) 21 - #define PMC_PLL_CTRL0_ENLOCK BIT(31) 22 - 23 - #define PMC_PLL_CTRL1 0x10 24 - #define PMC_PLL_CTRL1_FRACR_MSK GENMASK(21, 0) 25 - #define PMC_PLL_CTRL1_MUL_MSK GENMASK(30, 24) 26 - 27 - #define PMC_PLL_ACR 0x18 28 - #define PMC_PLL_ACR_DEFAULT_UPLL 0x12020010UL 29 - #define PMC_PLL_ACR_DEFAULT_PLLA 0x00020010UL 30 - #define PMC_PLL_ACR_UTMIVR BIT(12) 31 - #define PMC_PLL_ACR_UTMIBG BIT(13) 32 - #define PMC_PLL_ACR_LOOP_FILTER_MSK GENMASK(31, 24) 33 - 34 - #define PMC_PLL_UPDT 0x1c 35 - #define PMC_PLL_UPDT_UPDATE BIT(8) 36 - 37 - #define PMC_PLL_ISR0 0xec 17 + #define PMC_PLL_CTRL0_DIV_MSK GENMASK(7, 0) 18 + #define PMC_PLL_CTRL1_MUL_MSK GENMASK(30, 24) 38 19 39 20 #define PLL_DIV_MAX (FIELD_GET(PMC_PLL_CTRL0_DIV_MSK, UINT_MAX) + 1) 40 21 #define UPLL_DIV 2 ··· 40 59 { 41 60 unsigned int status; 42 61 43 - regmap_read(regmap, PMC_PLL_ISR0, &status); 62 + regmap_read(regmap, AT91_PMC_PLL_ISR0, &status); 44 63 45 64 return !!(status & BIT(id)); 46 65 } ··· 55 74 u32 val; 56 75 57 76 spin_lock_irqsave(pll->lock, flags); 58 - regmap_write(regmap, PMC_PLL_UPDT, pll->id); 77 + regmap_write(regmap, AT91_PMC_PLL_UPDT, pll->id); 59 78 60 - regmap_read(regmap, PMC_PLL_CTRL0, &val); 79 + regmap_read(regmap, AT91_PMC_PLL_CTRL0, &val); 61 80 div = FIELD_GET(PMC_PLL_CTRL0_DIV_MSK, val); 62 81 63 - regmap_read(regmap, PMC_PLL_CTRL1, &val); 82 + regmap_read(regmap, AT91_PMC_PLL_CTRL1, &val); 64 83 mul = FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, val); 65 84 66 85 if (sam9x60_pll_ready(regmap, pll->id) && ··· 69 88 return 0; 70 89 } 71 90 72 - /* Recommended value for PMC_PLL_ACR */ 91 + /* Recommended value for AT91_PMC_PLL_ACR */ 73 92 if (pll->characteristics->upll) 74 - val = PMC_PLL_ACR_DEFAULT_UPLL; 93 + val = AT91_PMC_PLL_ACR_DEFAULT_UPLL; 75 94 else 76 - val = PMC_PLL_ACR_DEFAULT_PLLA; 77 - regmap_write(regmap, PMC_PLL_ACR, val); 95 + val = AT91_PMC_PLL_ACR_DEFAULT_PLLA; 96 + regmap_write(regmap, AT91_PMC_PLL_ACR, val); 78 97 79 - regmap_write(regmap, PMC_PLL_CTRL1, 98 + regmap_write(regmap, AT91_PMC_PLL_CTRL1, 80 99 FIELD_PREP(PMC_PLL_CTRL1_MUL_MSK, pll->mul)); 81 100 82 101 if (pll->characteristics->upll) { 83 102 /* Enable the UTMI internal bandgap */ 84 - val |= PMC_PLL_ACR_UTMIBG; 85 - regmap_write(regmap, PMC_PLL_ACR, val); 103 + val |= AT91_PMC_PLL_ACR_UTMIBG; 104 + regmap_write(regmap, AT91_PMC_PLL_ACR, val); 86 105 87 106 udelay(10); 88 107 89 108 /* Enable the UTMI internal regulator */ 90 - val |= PMC_PLL_ACR_UTMIVR; 91 - regmap_write(regmap, PMC_PLL_ACR, val); 109 + val |= AT91_PMC_PLL_ACR_UTMIVR; 110 + regmap_write(regmap, AT91_PMC_PLL_ACR, val); 92 111 93 112 udelay(10); 94 113 } 95 114 96 - regmap_update_bits(regmap, PMC_PLL_UPDT, 97 - PMC_PLL_UPDT_UPDATE, PMC_PLL_UPDT_UPDATE); 115 + regmap_update_bits(regmap, AT91_PMC_PLL_UPDT, 116 + AT91_PMC_PLL_UPDT_UPDATE, AT91_PMC_PLL_UPDT_UPDATE); 98 117 99 - regmap_write(regmap, PMC_PLL_CTRL0, 100 - PMC_PLL_CTRL0_ENLOCK | PMC_PLL_CTRL0_ENPLL | 101 - PMC_PLL_CTRL0_ENPLLCK | pll->div); 118 + regmap_write(regmap, AT91_PMC_PLL_CTRL0, 119 + AT91_PMC_PLL_CTRL0_ENLOCK | AT91_PMC_PLL_CTRL0_ENPLL | 120 + AT91_PMC_PLL_CTRL0_ENPLLCK | pll->div); 102 121 103 - regmap_update_bits(regmap, PMC_PLL_UPDT, 104 - PMC_PLL_UPDT_UPDATE, PMC_PLL_UPDT_UPDATE); 122 + regmap_update_bits(regmap, AT91_PMC_PLL_UPDT, 123 + AT91_PMC_PLL_UPDT_UPDATE, AT91_PMC_PLL_UPDT_UPDATE); 105 124 106 125 while (!sam9x60_pll_ready(regmap, pll->id)) 107 126 cpu_relax(); ··· 125 144 126 145 spin_lock_irqsave(pll->lock, flags); 127 146 128 - regmap_write(pll->regmap, PMC_PLL_UPDT, pll->id); 147 + regmap_write(pll->regmap, AT91_PMC_PLL_UPDT, pll->id); 129 148 130 - regmap_update_bits(pll->regmap, PMC_PLL_CTRL0, 131 - PMC_PLL_CTRL0_ENPLLCK, 0); 149 + regmap_update_bits(pll->regmap, AT91_PMC_PLL_CTRL0, 150 + AT91_PMC_PLL_CTRL0_ENPLLCK, 0); 132 151 133 - regmap_update_bits(pll->regmap, PMC_PLL_UPDT, 134 - PMC_PLL_UPDT_UPDATE, PMC_PLL_UPDT_UPDATE); 152 + regmap_update_bits(pll->regmap, AT91_PMC_PLL_UPDT, 153 + AT91_PMC_PLL_UPDT_UPDATE, AT91_PMC_PLL_UPDT_UPDATE); 135 154 136 - regmap_update_bits(pll->regmap, PMC_PLL_CTRL0, PMC_PLL_CTRL0_ENPLL, 0); 155 + regmap_update_bits(pll->regmap, AT91_PMC_PLL_CTRL0, 156 + AT91_PMC_PLL_CTRL0_ENPLL, 0); 137 157 138 158 if (pll->characteristics->upll) 139 - regmap_update_bits(pll->regmap, PMC_PLL_ACR, 140 - PMC_PLL_ACR_UTMIBG | PMC_PLL_ACR_UTMIVR, 0); 159 + regmap_update_bits(pll->regmap, AT91_PMC_PLL_ACR, 160 + AT91_PMC_PLL_ACR_UTMIBG | 161 + AT91_PMC_PLL_ACR_UTMIVR, 0); 141 162 142 - regmap_update_bits(pll->regmap, PMC_PLL_UPDT, 143 - PMC_PLL_UPDT_UPDATE, PMC_PLL_UPDT_UPDATE); 163 + regmap_update_bits(pll->regmap, AT91_PMC_PLL_UPDT, 164 + AT91_PMC_PLL_UPDT_UPDATE, AT91_PMC_PLL_UPDT_UPDATE); 144 165 145 166 spin_unlock_irqrestore(pll->lock, flags); 146 167 } ··· 299 316 pll->regmap = regmap; 300 317 pll->lock = lock; 301 318 302 - regmap_write(regmap, PMC_PLL_UPDT, id); 303 - regmap_read(regmap, PMC_PLL_CTRL0, &pllr); 319 + regmap_write(regmap, AT91_PMC_PLL_UPDT, id); 320 + regmap_read(regmap, AT91_PMC_PLL_CTRL0, &pllr); 304 321 pll->div = FIELD_GET(PMC_PLL_CTRL0_DIV_MSK, pllr); 305 - regmap_read(regmap, PMC_PLL_CTRL1, &pllr); 322 + regmap_read(regmap, AT91_PMC_PLL_CTRL1, &pllr); 306 323 pll->mul = FIELD_GET(PMC_PLL_CTRL1_MUL_MSK, pllr); 307 324 308 325 hw = &pll->hw;
+8
drivers/cpuidle/Kconfig.arm
··· 86 86 depends on (ARCH_MVEBU || COMPILE_TEST) && !ARM64 87 87 help 88 88 Select this to enable cpuidle on Armada 370, 38x and XP processors. 89 + 90 + config ARM_TEGRA_CPUIDLE 91 + bool "CPU Idle Driver for NVIDIA Tegra SoCs" 92 + depends on ARCH_TEGRA && !ARM64 93 + select ARCH_NEEDS_CPU_IDLE_COUPLED if SMP 94 + select ARM_CPU_SUSPEND 95 + help 96 + Select this to enable cpuidle for NVIDIA Tegra20/30/114/124 SoCs.
+1
drivers/cpuidle/Makefile
··· 24 24 obj-$(CONFIG_ARM_PSCI_CPUIDLE) += cpuidle_psci.o 25 25 cpuidle_psci-y := cpuidle-psci.o 26 26 cpuidle_psci-$(CONFIG_PM_GENERIC_DOMAINS_OF) += cpuidle-psci-domain.o 27 + obj-$(CONFIG_ARM_TEGRA_CPUIDLE) += cpuidle-tegra.o 27 28 28 29 ############################################################################### 29 30 # MIPS drivers
+392
drivers/cpuidle/cpuidle-tegra.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * CPU idle driver for Tegra CPUs 4 + * 5 + * Copyright (c) 2010-2013, NVIDIA Corporation. 6 + * Copyright (c) 2011 Google, Inc. 7 + * Author: Colin Cross <ccross@android.com> 8 + * Gary King <gking@nvidia.com> 9 + * 10 + * Rework for 3.3 by Peter De Schrijver <pdeschrijver@nvidia.com> 11 + * 12 + * Tegra20/124 driver unification by Dmitry Osipenko <digetx@gmail.com> 13 + */ 14 + 15 + #define pr_fmt(fmt) "tegra-cpuidle: " fmt 16 + 17 + #include <linux/atomic.h> 18 + #include <linux/cpuidle.h> 19 + #include <linux/cpumask.h> 20 + #include <linux/cpu_pm.h> 21 + #include <linux/delay.h> 22 + #include <linux/errno.h> 23 + #include <linux/platform_device.h> 24 + #include <linux/types.h> 25 + 26 + #include <linux/clk/tegra.h> 27 + #include <linux/firmware/trusted_foundations.h> 28 + 29 + #include <soc/tegra/cpuidle.h> 30 + #include <soc/tegra/flowctrl.h> 31 + #include <soc/tegra/fuse.h> 32 + #include <soc/tegra/irq.h> 33 + #include <soc/tegra/pm.h> 34 + #include <soc/tegra/pmc.h> 35 + 36 + #include <asm/cpuidle.h> 37 + #include <asm/firmware.h> 38 + #include <asm/smp_plat.h> 39 + #include <asm/suspend.h> 40 + 41 + enum tegra_state { 42 + TEGRA_C1, 43 + TEGRA_C7, 44 + TEGRA_CC6, 45 + TEGRA_STATE_COUNT, 46 + }; 47 + 48 + static atomic_t tegra_idle_barrier; 49 + static atomic_t tegra_abort_flag; 50 + 51 + static inline bool tegra_cpuidle_using_firmware(void) 52 + { 53 + return firmware_ops->prepare_idle && firmware_ops->do_idle; 54 + } 55 + 56 + static void tegra_cpuidle_report_cpus_state(void) 57 + { 58 + unsigned long cpu, lcpu, csr; 59 + 60 + for_each_cpu(lcpu, cpu_possible_mask) { 61 + cpu = cpu_logical_map(lcpu); 62 + csr = flowctrl_read_cpu_csr(cpu); 63 + 64 + pr_err("cpu%lu: online=%d flowctrl_csr=0x%08lx\n", 65 + cpu, cpu_online(lcpu), csr); 66 + } 67 + } 68 + 69 + static int tegra_cpuidle_wait_for_secondary_cpus_parking(void) 70 + { 71 + unsigned int retries = 3; 72 + 73 + while (retries--) { 74 + unsigned int delay_us = 10; 75 + unsigned int timeout_us = 500 * 1000 / delay_us; 76 + 77 + /* 78 + * The primary CPU0 core shall wait for the secondaries 79 + * shutdown in order to power-off CPU's cluster safely. 80 + * The timeout value depends on the current CPU frequency, 81 + * it takes about 40-150us in average and over 1000us in 82 + * a worst case scenario. 83 + */ 84 + do { 85 + if (tegra_cpu_rail_off_ready()) 86 + return 0; 87 + 88 + udelay(delay_us); 89 + 90 + } while (timeout_us--); 91 + 92 + pr_err("secondary CPU taking too long to park\n"); 93 + 94 + tegra_cpuidle_report_cpus_state(); 95 + } 96 + 97 + pr_err("timed out waiting secondaries to park\n"); 98 + 99 + return -ETIMEDOUT; 100 + } 101 + 102 + static void tegra_cpuidle_unpark_secondary_cpus(void) 103 + { 104 + unsigned int cpu, lcpu; 105 + 106 + for_each_cpu(lcpu, cpu_online_mask) { 107 + cpu = cpu_logical_map(lcpu); 108 + 109 + if (cpu > 0) { 110 + tegra_enable_cpu_clock(cpu); 111 + tegra_cpu_out_of_reset(cpu); 112 + flowctrl_write_cpu_halt(cpu, 0); 113 + } 114 + } 115 + } 116 + 117 + static int tegra_cpuidle_cc6_enter(unsigned int cpu) 118 + { 119 + int ret; 120 + 121 + if (cpu > 0) { 122 + ret = cpu_suspend(cpu, tegra_pm_park_secondary_cpu); 123 + } else { 124 + ret = tegra_cpuidle_wait_for_secondary_cpus_parking(); 125 + if (!ret) 126 + ret = tegra_pm_enter_lp2(); 127 + 128 + tegra_cpuidle_unpark_secondary_cpus(); 129 + } 130 + 131 + return ret; 132 + } 133 + 134 + static int tegra_cpuidle_c7_enter(void) 135 + { 136 + int err; 137 + 138 + if (tegra_cpuidle_using_firmware()) { 139 + err = call_firmware_op(prepare_idle, TF_PM_MODE_LP2_NOFLUSH_L2); 140 + if (err) 141 + return err; 142 + 143 + return call_firmware_op(do_idle, 0); 144 + } 145 + 146 + return cpu_suspend(0, tegra30_pm_secondary_cpu_suspend); 147 + } 148 + 149 + static int tegra_cpuidle_coupled_barrier(struct cpuidle_device *dev) 150 + { 151 + if (tegra_pending_sgi()) { 152 + /* 153 + * CPU got local interrupt that will be lost after GIC's 154 + * shutdown because GIC driver doesn't save/restore the 155 + * pending SGI state across CPU cluster PM. Abort and retry 156 + * next time. 157 + */ 158 + atomic_set(&tegra_abort_flag, 1); 159 + } 160 + 161 + cpuidle_coupled_parallel_barrier(dev, &tegra_idle_barrier); 162 + 163 + if (atomic_read(&tegra_abort_flag)) { 164 + cpuidle_coupled_parallel_barrier(dev, &tegra_idle_barrier); 165 + atomic_set(&tegra_abort_flag, 0); 166 + return -EINTR; 167 + } 168 + 169 + return 0; 170 + } 171 + 172 + static int tegra_cpuidle_state_enter(struct cpuidle_device *dev, 173 + int index, unsigned int cpu) 174 + { 175 + int ret; 176 + 177 + /* 178 + * CC6 state is the "CPU cluster power-off" state. In order to 179 + * enter this state, at first the secondary CPU cores need to be 180 + * parked into offline mode, then the last CPU should clean out 181 + * remaining dirty cache lines into DRAM and trigger Flow Controller 182 + * logic that turns off the cluster's power domain (which includes 183 + * CPU cores, GIC and L2 cache). 184 + */ 185 + if (index == TEGRA_CC6) { 186 + ret = tegra_cpuidle_coupled_barrier(dev); 187 + if (ret) 188 + return ret; 189 + } 190 + 191 + local_fiq_disable(); 192 + tegra_pm_set_cpu_in_lp2(); 193 + cpu_pm_enter(); 194 + 195 + switch (index) { 196 + case TEGRA_C7: 197 + ret = tegra_cpuidle_c7_enter(); 198 + break; 199 + 200 + case TEGRA_CC6: 201 + ret = tegra_cpuidle_cc6_enter(cpu); 202 + break; 203 + 204 + default: 205 + ret = -EINVAL; 206 + break; 207 + } 208 + 209 + cpu_pm_exit(); 210 + tegra_pm_clear_cpu_in_lp2(); 211 + local_fiq_enable(); 212 + 213 + return ret; 214 + } 215 + 216 + static int tegra_cpuidle_adjust_state_index(int index, unsigned int cpu) 217 + { 218 + /* 219 + * On Tegra30 CPU0 can't be power-gated separately from secondary 220 + * cores because it gates the whole CPU cluster. 221 + */ 222 + if (cpu > 0 || index != TEGRA_C7 || tegra_get_chip_id() != TEGRA30) 223 + return index; 224 + 225 + /* put CPU0 into C1 if C7 is requested and secondaries are online */ 226 + if (!IS_ENABLED(CONFIG_PM_SLEEP) || num_online_cpus() > 1) 227 + index = TEGRA_C1; 228 + else 229 + index = TEGRA_CC6; 230 + 231 + return index; 232 + } 233 + 234 + static int tegra_cpuidle_enter(struct cpuidle_device *dev, 235 + struct cpuidle_driver *drv, 236 + int index) 237 + { 238 + unsigned int cpu = cpu_logical_map(dev->cpu); 239 + int err; 240 + 241 + index = tegra_cpuidle_adjust_state_index(index, cpu); 242 + if (dev->states_usage[index].disable) 243 + return -1; 244 + 245 + if (index == TEGRA_C1) 246 + err = arm_cpuidle_simple_enter(dev, drv, index); 247 + else 248 + err = tegra_cpuidle_state_enter(dev, index, cpu); 249 + 250 + if (err && (err != -EINTR || index != TEGRA_CC6)) 251 + pr_err_once("failed to enter state %d err: %d\n", index, err); 252 + 253 + return err ? -1 : index; 254 + } 255 + 256 + static void tegra114_enter_s2idle(struct cpuidle_device *dev, 257 + struct cpuidle_driver *drv, 258 + int index) 259 + { 260 + tegra_cpuidle_enter(dev, drv, index); 261 + } 262 + 263 + /* 264 + * The previous versions of Tegra CPUIDLE driver used a different "legacy" 265 + * terminology for naming of the idling states, while this driver uses the 266 + * new terminology. 267 + * 268 + * Mapping of the old terms into the new ones: 269 + * 270 + * Old | New 271 + * --------- 272 + * LP3 | C1 (CPU core clock gating) 273 + * LP2 | C7 (CPU core power gating) 274 + * LP2 | CC6 (CPU cluster power gating) 275 + * 276 + * Note that that the older CPUIDLE driver versions didn't explicitly 277 + * differentiate the LP2 states because these states either used the same 278 + * code path or because CC6 wasn't supported. 279 + */ 280 + static struct cpuidle_driver tegra_idle_driver = { 281 + .name = "tegra_idle", 282 + .states = { 283 + [TEGRA_C1] = ARM_CPUIDLE_WFI_STATE_PWR(600), 284 + [TEGRA_C7] = { 285 + .enter = tegra_cpuidle_enter, 286 + .exit_latency = 2000, 287 + .target_residency = 2200, 288 + .power_usage = 100, 289 + .flags = CPUIDLE_FLAG_TIMER_STOP, 290 + .name = "C7", 291 + .desc = "CPU core powered off", 292 + }, 293 + [TEGRA_CC6] = { 294 + .enter = tegra_cpuidle_enter, 295 + .exit_latency = 5000, 296 + .target_residency = 10000, 297 + .power_usage = 0, 298 + .flags = CPUIDLE_FLAG_TIMER_STOP | 299 + CPUIDLE_FLAG_COUPLED, 300 + .name = "CC6", 301 + .desc = "CPU cluster powered off", 302 + }, 303 + }, 304 + .state_count = TEGRA_STATE_COUNT, 305 + .safe_state_index = TEGRA_C1, 306 + }; 307 + 308 + static inline void tegra_cpuidle_disable_state(enum tegra_state state) 309 + { 310 + cpuidle_driver_state_disabled(&tegra_idle_driver, state, true); 311 + } 312 + 313 + /* 314 + * Tegra20 HW appears to have a bug such that PCIe device interrupts, whether 315 + * they are legacy IRQs or MSI, are lost when CC6 is enabled. To work around 316 + * this, simply disable CC6 if the PCI driver and DT node are both enabled. 317 + */ 318 + void tegra_cpuidle_pcie_irqs_in_use(void) 319 + { 320 + struct cpuidle_state *state_cc6 = &tegra_idle_driver.states[TEGRA_CC6]; 321 + 322 + if ((state_cc6->flags & CPUIDLE_FLAG_UNUSABLE) || 323 + tegra_get_chip_id() != TEGRA20) 324 + return; 325 + 326 + pr_info("disabling CC6 state, since PCIe IRQs are in use\n"); 327 + tegra_cpuidle_disable_state(TEGRA_CC6); 328 + } 329 + 330 + static void tegra_cpuidle_setup_tegra114_c7_state(void) 331 + { 332 + struct cpuidle_state *s = &tegra_idle_driver.states[TEGRA_C7]; 333 + 334 + s->enter_s2idle = tegra114_enter_s2idle; 335 + s->target_residency = 1000; 336 + s->exit_latency = 500; 337 + } 338 + 339 + static int tegra_cpuidle_probe(struct platform_device *pdev) 340 + { 341 + /* LP2 could be disabled in device-tree */ 342 + if (tegra_pmc_get_suspend_mode() < TEGRA_SUSPEND_LP2) 343 + tegra_cpuidle_disable_state(TEGRA_CC6); 344 + 345 + /* 346 + * Required suspend-resume functionality, which is provided by the 347 + * Tegra-arch core and PMC driver, is unavailable if PM-sleep option 348 + * is disabled. 349 + */ 350 + if (!IS_ENABLED(CONFIG_PM_SLEEP)) { 351 + if (!tegra_cpuidle_using_firmware()) 352 + tegra_cpuidle_disable_state(TEGRA_C7); 353 + 354 + tegra_cpuidle_disable_state(TEGRA_CC6); 355 + } 356 + 357 + /* 358 + * Generic WFI state (also known as C1 or LP3) and the coupled CPU 359 + * cluster power-off (CC6 or LP2) states are common for all Tegra SoCs. 360 + */ 361 + switch (tegra_get_chip_id()) { 362 + case TEGRA20: 363 + /* Tegra20 isn't capable to power-off individual CPU cores */ 364 + tegra_cpuidle_disable_state(TEGRA_C7); 365 + break; 366 + 367 + case TEGRA30: 368 + tegra_cpuidle_disable_state(TEGRA_CC6); 369 + break; 370 + 371 + case TEGRA114: 372 + case TEGRA124: 373 + tegra_cpuidle_setup_tegra114_c7_state(); 374 + 375 + /* coupled CC6 (LP2) state isn't implemented yet */ 376 + tegra_cpuidle_disable_state(TEGRA_CC6); 377 + break; 378 + 379 + default: 380 + return -EINVAL; 381 + } 382 + 383 + return cpuidle_register(&tegra_idle_driver, cpu_possible_mask); 384 + } 385 + 386 + static struct platform_driver tegra_cpuidle_driver = { 387 + .probe = tegra_cpuidle_probe, 388 + .driver = { 389 + .name = "tegra-cpuidle", 390 + }, 391 + }; 392 + builtin_platform_driver(tegra_cpuidle_driver);
+2
drivers/firmware/xilinx/Kconfig
··· 6 6 7 7 config ZYNQMP_FIRMWARE 8 8 bool "Enable Xilinx Zynq MPSoC firmware interface" 9 + depends on ARCH_ZYNQMP 10 + default y if ARCH_ZYNQMP 9 11 select MFD_CORE 10 12 help 11 13 Firmware interface driver is used by different
+1
drivers/soc/mediatek/mtk-cmdq-helper.c
··· 78 78 client->pkt_cnt = 0; 79 79 client->client.dev = dev; 80 80 client->client.tx_block = false; 81 + client->client.knows_txdone = true; 81 82 client->chan = mbox_request_channel(&client->client, index); 82 83 83 84 if (IS_ERR(client->chan)) {
+128
drivers/soc/mediatek/mtk-pmic-wrap.c
··· 111 111 PWRAP_RG_SPI_CON13, 112 112 PWRAP_SPISLV_KEY, 113 113 114 + /* MT6359 only regs */ 115 + PWRAP_DEW_CRC_SWRST, 116 + PWRAP_DEW_RG_EN_RECORD, 117 + PWRAP_DEW_RECORD_CMD0, 118 + PWRAP_DEW_RECORD_CMD1, 119 + PWRAP_DEW_RECORD_CMD2, 120 + PWRAP_DEW_RECORD_CMD3, 121 + PWRAP_DEW_RECORD_CMD4, 122 + PWRAP_DEW_RECORD_CMD5, 123 + PWRAP_DEW_RECORD_WDATA0, 124 + PWRAP_DEW_RECORD_WDATA1, 125 + PWRAP_DEW_RECORD_WDATA2, 126 + PWRAP_DEW_RECORD_WDATA3, 127 + PWRAP_DEW_RECORD_WDATA4, 128 + PWRAP_DEW_RECORD_WDATA5, 129 + PWRAP_DEW_RG_ADDR_TARGET, 130 + PWRAP_DEW_RG_ADDR_MASK, 131 + PWRAP_DEW_RG_WDATA_TARGET, 132 + PWRAP_DEW_RG_WDATA_MASK, 133 + PWRAP_DEW_RG_SPI_RECORD_CLR, 134 + PWRAP_DEW_RG_CMD_ALERT_CLR, 135 + 114 136 /* MT6397 only regs */ 115 137 PWRAP_DEW_EVENT_OUT_EN, 116 138 PWRAP_DEW_EVENT_SRC_EN, ··· 216 194 [PWRAP_RG_SPI_CON7] = 0x043c, 217 195 [PWRAP_RG_SPI_CON8] = 0x043e, 218 196 [PWRAP_RG_SPI_CON13] = 0x0448, 197 + [PWRAP_SPISLV_KEY] = 0x044a, 198 + }; 199 + 200 + static const u32 mt6359_regs[] = { 201 + [PWRAP_DEW_RG_EN_RECORD] = 0x040a, 202 + [PWRAP_DEW_DIO_EN] = 0x040c, 203 + [PWRAP_DEW_READ_TEST] = 0x040e, 204 + [PWRAP_DEW_WRITE_TEST] = 0x0410, 205 + [PWRAP_DEW_CRC_SWRST] = 0x0412, 206 + [PWRAP_DEW_CRC_EN] = 0x0414, 207 + [PWRAP_DEW_CRC_VAL] = 0x0416, 208 + [PWRAP_DEW_CIPHER_KEY_SEL] = 0x0418, 209 + [PWRAP_DEW_CIPHER_IV_SEL] = 0x041a, 210 + [PWRAP_DEW_CIPHER_EN] = 0x041c, 211 + [PWRAP_DEW_CIPHER_RDY] = 0x041e, 212 + [PWRAP_DEW_CIPHER_MODE] = 0x0420, 213 + [PWRAP_DEW_CIPHER_SWRST] = 0x0422, 214 + [PWRAP_DEW_RDDMY_NO] = 0x0424, 215 + [PWRAP_DEW_RECORD_CMD0] = 0x0428, 216 + [PWRAP_DEW_RECORD_CMD1] = 0x042a, 217 + [PWRAP_DEW_RECORD_CMD2] = 0x042c, 218 + [PWRAP_DEW_RECORD_CMD3] = 0x042e, 219 + [PWRAP_DEW_RECORD_CMD4] = 0x0430, 220 + [PWRAP_DEW_RECORD_CMD5] = 0x0432, 221 + [PWRAP_DEW_RECORD_WDATA0] = 0x0434, 222 + [PWRAP_DEW_RECORD_WDATA1] = 0x0436, 223 + [PWRAP_DEW_RECORD_WDATA2] = 0x0438, 224 + [PWRAP_DEW_RECORD_WDATA3] = 0x043a, 225 + [PWRAP_DEW_RECORD_WDATA4] = 0x043c, 226 + [PWRAP_DEW_RECORD_WDATA5] = 0x043e, 227 + [PWRAP_DEW_RG_ADDR_TARGET] = 0x0440, 228 + [PWRAP_DEW_RG_ADDR_MASK] = 0x0442, 229 + [PWRAP_DEW_RG_WDATA_TARGET] = 0x0444, 230 + [PWRAP_DEW_RG_WDATA_MASK] = 0x0446, 231 + [PWRAP_DEW_RG_SPI_RECORD_CLR] = 0x0448, 232 + [PWRAP_DEW_RG_CMD_ALERT_CLR] = 0x0448, 219 233 [PWRAP_SPISLV_KEY] = 0x044a, 220 234 }; 221 235 ··· 553 495 [PWRAP_WDT_SRC_EN] = 0xF4, 554 496 [PWRAP_DCM_EN] = 0x1DC, 555 497 [PWRAP_DCM_DBC_PRD] = 0x1E0, 498 + }; 499 + 500 + static int mt6779_regs[] = { 501 + [PWRAP_MUX_SEL] = 0x0, 502 + [PWRAP_WRAP_EN] = 0x4, 503 + [PWRAP_DIO_EN] = 0x8, 504 + [PWRAP_RDDMY] = 0x20, 505 + [PWRAP_CSHEXT_WRITE] = 0x24, 506 + [PWRAP_CSHEXT_READ] = 0x28, 507 + [PWRAP_CSLEXT_WRITE] = 0x2C, 508 + [PWRAP_CSLEXT_READ] = 0x30, 509 + [PWRAP_EXT_CK_WRITE] = 0x34, 510 + [PWRAP_STAUPD_CTRL] = 0x3C, 511 + [PWRAP_STAUPD_GRPEN] = 0x40, 512 + [PWRAP_EINT_STA0_ADR] = 0x44, 513 + [PWRAP_HARB_HPRIO] = 0x68, 514 + [PWRAP_HIPRIO_ARB_EN] = 0x6C, 515 + [PWRAP_MAN_EN] = 0x7C, 516 + [PWRAP_MAN_CMD] = 0x80, 517 + [PWRAP_WACS0_EN] = 0x8C, 518 + [PWRAP_INIT_DONE0] = 0x90, 519 + [PWRAP_WACS1_EN] = 0x94, 520 + [PWRAP_WACS2_EN] = 0x9C, 521 + [PWRAP_INIT_DONE1] = 0x98, 522 + [PWRAP_INIT_DONE2] = 0xA0, 523 + [PWRAP_INT_EN] = 0xBC, 524 + [PWRAP_INT_FLG_RAW] = 0xC0, 525 + [PWRAP_INT_FLG] = 0xC4, 526 + [PWRAP_INT_CLR] = 0xC8, 527 + [PWRAP_INT1_EN] = 0xCC, 528 + [PWRAP_INT1_FLG] = 0xD4, 529 + [PWRAP_INT1_CLR] = 0xD8, 530 + [PWRAP_TIMER_EN] = 0xF0, 531 + [PWRAP_WDT_UNIT] = 0xF8, 532 + [PWRAP_WDT_SRC_EN] = 0xFC, 533 + [PWRAP_WDT_SRC_EN_1] = 0x100, 534 + [PWRAP_WACS2_CMD] = 0xC20, 535 + [PWRAP_WACS2_RDATA] = 0xC24, 536 + [PWRAP_WACS2_VLDCLR] = 0xC28, 556 537 }; 557 538 558 539 static int mt6797_regs[] = { ··· 1035 938 PMIC_MT6351, 1036 939 PMIC_MT6357, 1037 940 PMIC_MT6358, 941 + PMIC_MT6359, 1038 942 PMIC_MT6380, 1039 943 PMIC_MT6397, 1040 944 }; ··· 1043 945 enum pwrap_type { 1044 946 PWRAP_MT2701, 1045 947 PWRAP_MT6765, 948 + PWRAP_MT6779, 1046 949 PWRAP_MT6797, 1047 950 PWRAP_MT7622, 1048 951 PWRAP_MT8135, ··· 1476 1377 break; 1477 1378 case PWRAP_MT2701: 1478 1379 case PWRAP_MT6765: 1380 + case PWRAP_MT6779: 1479 1381 case PWRAP_MT6797: 1480 1382 case PWRAP_MT8173: 1481 1383 case PWRAP_MT8516: ··· 1811 1711 .pwrap_write = pwrap_write16, 1812 1712 }; 1813 1713 1714 + static const struct pwrap_slv_type pmic_mt6359 = { 1715 + .dew_regs = mt6359_regs, 1716 + .type = PMIC_MT6359, 1717 + .regmap = &pwrap_regmap_config16, 1718 + .caps = PWRAP_SLV_CAP_DUALIO, 1719 + .pwrap_read = pwrap_read16, 1720 + .pwrap_write = pwrap_write16, 1721 + }; 1722 + 1814 1723 static const struct pwrap_slv_type pmic_mt6380 = { 1815 1724 .dew_regs = NULL, 1816 1725 .type = PMIC_MT6380, ··· 1852 1743 }, { 1853 1744 .compatible = "mediatek,mt6358", 1854 1745 .data = &pmic_mt6358, 1746 + }, { 1747 + .compatible = "mediatek,mt6359", 1748 + .data = &pmic_mt6359, 1855 1749 }, { 1856 1750 /* The MT6380 PMIC only implements a regulator, so we bind it 1857 1751 * directly instead of using a MFD. ··· 1891 1779 .spi_w = PWRAP_MAN_CMD_SPI_WRITE, 1892 1780 .wdt_src = PWRAP_WDT_SRC_MASK_ALL, 1893 1781 .caps = PWRAP_CAP_RESET | PWRAP_CAP_DCM, 1782 + .init_reg_clock = pwrap_common_init_reg_clock, 1783 + .init_soc_specific = NULL, 1784 + }; 1785 + 1786 + static const struct pmic_wrapper_type pwrap_mt6779 = { 1787 + .regs = mt6779_regs, 1788 + .type = PWRAP_MT6779, 1789 + .arb_en_all = 0xfbb7f, 1790 + .int_en_all = 0xfffffffe, 1791 + .int1_en_all = 0, 1792 + .spi_w = PWRAP_MAN_CMD_SPI_WRITE, 1793 + .wdt_src = PWRAP_WDT_SRC_MASK_ALL, 1794 + .caps = 0, 1894 1795 .init_reg_clock = pwrap_common_init_reg_clock, 1895 1796 .init_soc_specific = NULL, 1896 1797 }; ··· 1992 1867 }, { 1993 1868 .compatible = "mediatek,mt6765-pwrap", 1994 1869 .data = &pwrap_mt6765, 1870 + }, { 1871 + .compatible = "mediatek,mt6779-pwrap", 1872 + .data = &pwrap_mt6779, 1995 1873 }, { 1996 1874 .compatible = "mediatek,mt6797-pwrap", 1997 1875 .data = &pwrap_mt6797,
+2
drivers/soc/renesas/Kconfig
··· 116 116 bool "R-Car H1 (R8A77790)" 117 117 select ARCH_RCAR_GEN1 118 118 select ARM_ERRATA_754322 119 + select ARM_GLOBAL_TIMER 119 120 select HAVE_ARM_SCU if SMP 120 121 select HAVE_ARM_TWD if SMP 121 122 select SYSC_R8A7779 ··· 164 163 bool "SH-Mobile AG5 (R8A73A00)" 165 164 select ARCH_RMOBILE 166 165 select ARM_ERRATA_754322 166 + select ARM_GLOBAL_TIMER 167 167 select HAVE_ARM_SCU if SMP 168 168 select HAVE_ARM_TWD if SMP 169 169 select RENESAS_INTC_IRQPIN
+527 -161
drivers/soc/tegra/pmc.c
··· 3 3 * drivers/soc/tegra/pmc.c 4 4 * 5 5 * Copyright (c) 2010 Google, Inc 6 - * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. 6 + * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. 7 7 * 8 8 * Author: 9 9 * Colin Cross <ccross@google.com> ··· 13 13 14 14 #include <linux/arm-smccc.h> 15 15 #include <linux/clk.h> 16 + #include <linux/clk-provider.h> 17 + #include <linux/clkdev.h> 18 + #include <linux/clk/clk-conf.h> 16 19 #include <linux/clk/tegra.h> 17 20 #include <linux/debugfs.h> 18 21 #include <linux/delay.h> 22 + #include <linux/device.h> 19 23 #include <linux/err.h> 20 24 #include <linux/export.h> 21 25 #include <linux/init.h> ··· 52 48 #include <dt-bindings/pinctrl/pinctrl-tegra-io-pad.h> 53 49 #include <dt-bindings/gpio/tegra186-gpio.h> 54 50 #include <dt-bindings/gpio/tegra194-gpio.h> 51 + #include <dt-bindings/soc/tegra-pmc.h> 55 52 56 53 #define PMC_CNTRL 0x0 57 54 #define PMC_CNTRL_INTR_POLARITY BIT(17) /* inverts INTR polarity */ ··· 62 57 #define PMC_CNTRL_SYSCLK_OE BIT(11) /* system clock enable */ 63 58 #define PMC_CNTRL_SYSCLK_POLARITY BIT(10) /* sys clk polarity */ 64 59 #define PMC_CNTRL_PWRREQ_POLARITY BIT(8) 60 + #define PMC_CNTRL_BLINK_EN 7 65 61 #define PMC_CNTRL_MAIN_RST BIT(4) 66 62 67 63 #define PMC_WAKE_MASK 0x0c 68 64 #define PMC_WAKE_LEVEL 0x10 69 65 #define PMC_WAKE_STATUS 0x14 70 66 #define PMC_SW_WAKE_STATUS 0x18 67 + #define PMC_DPD_PADS_ORIDE 0x1c 68 + #define PMC_DPD_PADS_ORIDE_BLINK 20 71 69 72 70 #define DPD_SAMPLE 0x020 73 71 #define DPD_SAMPLE_ENABLE BIT(0) ··· 83 75 84 76 #define PWRGATE_STATUS 0x38 85 77 78 + #define PMC_BLINK_TIMER 0x40 86 79 #define PMC_IMPL_E_33V_PWR 0x40 87 80 88 81 #define PMC_PWR_DET 0x48 ··· 109 100 #define PMC_WAKE2_STATUS 0x168 110 101 #define PMC_SW_WAKE2_STATUS 0x16c 111 102 103 + #define PMC_CLK_OUT_CNTRL 0x1a8 104 + #define PMC_CLK_OUT_MUX_MASK GENMASK(1, 0) 112 105 #define PMC_SENSOR_CTRL 0x1b0 113 106 #define PMC_SENSOR_CTRL_SCRATCH_WRITE BIT(2) 114 107 #define PMC_SENSOR_CTRL_ENABLE_RST BIT(1) ··· 165 154 #define TEGRA_SMC_PMC 0xc2fffe00 166 155 #define TEGRA_SMC_PMC_READ 0xaa 167 156 #define TEGRA_SMC_PMC_WRITE 0xbb 157 + 158 + struct pmc_clk { 159 + struct clk_hw hw; 160 + unsigned long offs; 161 + u32 mux_shift; 162 + u32 force_en_shift; 163 + }; 164 + 165 + #define to_pmc_clk(_hw) container_of(_hw, struct pmc_clk, hw) 166 + 167 + struct pmc_clk_gate { 168 + struct clk_hw hw; 169 + unsigned long offs; 170 + u32 shift; 171 + }; 172 + 173 + #define to_pmc_clk_gate(_hw) container_of(_hw, struct pmc_clk_gate, hw) 174 + 175 + struct pmc_clk_init_data { 176 + char *name; 177 + const char *const *parents; 178 + int num_parents; 179 + int clk_id; 180 + u8 mux_shift; 181 + u8 force_en_shift; 182 + }; 183 + 184 + static const char * const clk_out1_parents[] = { "osc", "osc_div2", 185 + "osc_div4", "extern1", 186 + }; 187 + 188 + static const char * const clk_out2_parents[] = { "osc", "osc_div2", 189 + "osc_div4", "extern2", 190 + }; 191 + 192 + static const char * const clk_out3_parents[] = { "osc", "osc_div2", 193 + "osc_div4", "extern3", 194 + }; 195 + 196 + static const struct pmc_clk_init_data tegra_pmc_clks_data[] = { 197 + { 198 + .name = "pmc_clk_out_1", 199 + .parents = clk_out1_parents, 200 + .num_parents = ARRAY_SIZE(clk_out1_parents), 201 + .clk_id = TEGRA_PMC_CLK_OUT_1, 202 + .mux_shift = 6, 203 + .force_en_shift = 2, 204 + }, 205 + { 206 + .name = "pmc_clk_out_2", 207 + .parents = clk_out2_parents, 208 + .num_parents = ARRAY_SIZE(clk_out2_parents), 209 + .clk_id = TEGRA_PMC_CLK_OUT_2, 210 + .mux_shift = 14, 211 + .force_en_shift = 10, 212 + }, 213 + { 214 + .name = "pmc_clk_out_3", 215 + .parents = clk_out3_parents, 216 + .num_parents = ARRAY_SIZE(clk_out3_parents), 217 + .clk_id = TEGRA_PMC_CLK_OUT_3, 218 + .mux_shift = 22, 219 + .force_en_shift = 18, 220 + }, 221 + }; 168 222 169 223 struct tegra_powergate { 170 224 struct generic_pm_domain genpd; ··· 330 254 */ 331 255 const struct tegra_wake_event *wake_events; 332 256 unsigned int num_wake_events; 257 + 258 + const struct pmc_clk_init_data *pmc_clks_data; 259 + unsigned int num_pmc_clks; 260 + bool has_blink_output; 333 261 }; 334 262 335 263 static const char * const tegra186_reset_sources[] = { ··· 2243 2163 return NOTIFY_OK; 2244 2164 } 2245 2165 2166 + static void pmc_clk_fence_udelay(u32 offset) 2167 + { 2168 + tegra_pmc_readl(pmc, offset); 2169 + /* pmc clk propagation delay 2 us */ 2170 + udelay(2); 2171 + } 2172 + 2173 + static u8 pmc_clk_mux_get_parent(struct clk_hw *hw) 2174 + { 2175 + struct pmc_clk *clk = to_pmc_clk(hw); 2176 + u32 val; 2177 + 2178 + val = tegra_pmc_readl(pmc, clk->offs) >> clk->mux_shift; 2179 + val &= PMC_CLK_OUT_MUX_MASK; 2180 + 2181 + return val; 2182 + } 2183 + 2184 + static int pmc_clk_mux_set_parent(struct clk_hw *hw, u8 index) 2185 + { 2186 + struct pmc_clk *clk = to_pmc_clk(hw); 2187 + u32 val; 2188 + 2189 + val = tegra_pmc_readl(pmc, clk->offs); 2190 + val &= ~(PMC_CLK_OUT_MUX_MASK << clk->mux_shift); 2191 + val |= index << clk->mux_shift; 2192 + tegra_pmc_writel(pmc, val, clk->offs); 2193 + pmc_clk_fence_udelay(clk->offs); 2194 + 2195 + return 0; 2196 + } 2197 + 2198 + static int pmc_clk_is_enabled(struct clk_hw *hw) 2199 + { 2200 + struct pmc_clk *clk = to_pmc_clk(hw); 2201 + u32 val; 2202 + 2203 + val = tegra_pmc_readl(pmc, clk->offs) & BIT(clk->force_en_shift); 2204 + 2205 + return val ? 1 : 0; 2206 + } 2207 + 2208 + static void pmc_clk_set_state(unsigned long offs, u32 shift, int state) 2209 + { 2210 + u32 val; 2211 + 2212 + val = tegra_pmc_readl(pmc, offs); 2213 + val = state ? (val | BIT(shift)) : (val & ~BIT(shift)); 2214 + tegra_pmc_writel(pmc, val, offs); 2215 + pmc_clk_fence_udelay(offs); 2216 + } 2217 + 2218 + static int pmc_clk_enable(struct clk_hw *hw) 2219 + { 2220 + struct pmc_clk *clk = to_pmc_clk(hw); 2221 + 2222 + pmc_clk_set_state(clk->offs, clk->force_en_shift, 1); 2223 + 2224 + return 0; 2225 + } 2226 + 2227 + static void pmc_clk_disable(struct clk_hw *hw) 2228 + { 2229 + struct pmc_clk *clk = to_pmc_clk(hw); 2230 + 2231 + pmc_clk_set_state(clk->offs, clk->force_en_shift, 0); 2232 + } 2233 + 2234 + static const struct clk_ops pmc_clk_ops = { 2235 + .get_parent = pmc_clk_mux_get_parent, 2236 + .set_parent = pmc_clk_mux_set_parent, 2237 + .determine_rate = __clk_mux_determine_rate, 2238 + .is_enabled = pmc_clk_is_enabled, 2239 + .enable = pmc_clk_enable, 2240 + .disable = pmc_clk_disable, 2241 + }; 2242 + 2243 + static struct clk * 2244 + tegra_pmc_clk_out_register(struct tegra_pmc *pmc, 2245 + const struct pmc_clk_init_data *data, 2246 + unsigned long offset) 2247 + { 2248 + struct clk_init_data init; 2249 + struct pmc_clk *pmc_clk; 2250 + 2251 + pmc_clk = devm_kzalloc(pmc->dev, sizeof(*pmc_clk), GFP_KERNEL); 2252 + if (!pmc_clk) 2253 + return ERR_PTR(-ENOMEM); 2254 + 2255 + init.name = data->name; 2256 + init.ops = &pmc_clk_ops; 2257 + init.parent_names = data->parents; 2258 + init.num_parents = data->num_parents; 2259 + init.flags = CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT | 2260 + CLK_SET_PARENT_GATE; 2261 + 2262 + pmc_clk->hw.init = &init; 2263 + pmc_clk->offs = offset; 2264 + pmc_clk->mux_shift = data->mux_shift; 2265 + pmc_clk->force_en_shift = data->force_en_shift; 2266 + 2267 + return clk_register(NULL, &pmc_clk->hw); 2268 + } 2269 + 2270 + static int pmc_clk_gate_is_enabled(struct clk_hw *hw) 2271 + { 2272 + struct pmc_clk_gate *gate = to_pmc_clk_gate(hw); 2273 + 2274 + return tegra_pmc_readl(pmc, gate->offs) & BIT(gate->shift) ? 1 : 0; 2275 + } 2276 + 2277 + static int pmc_clk_gate_enable(struct clk_hw *hw) 2278 + { 2279 + struct pmc_clk_gate *gate = to_pmc_clk_gate(hw); 2280 + 2281 + pmc_clk_set_state(gate->offs, gate->shift, 1); 2282 + 2283 + return 0; 2284 + } 2285 + 2286 + static void pmc_clk_gate_disable(struct clk_hw *hw) 2287 + { 2288 + struct pmc_clk_gate *gate = to_pmc_clk_gate(hw); 2289 + 2290 + pmc_clk_set_state(gate->offs, gate->shift, 0); 2291 + } 2292 + 2293 + static const struct clk_ops pmc_clk_gate_ops = { 2294 + .is_enabled = pmc_clk_gate_is_enabled, 2295 + .enable = pmc_clk_gate_enable, 2296 + .disable = pmc_clk_gate_disable, 2297 + }; 2298 + 2299 + static struct clk * 2300 + tegra_pmc_clk_gate_register(struct tegra_pmc *pmc, const char *name, 2301 + const char *parent_name, unsigned long offset, 2302 + u32 shift) 2303 + { 2304 + struct clk_init_data init; 2305 + struct pmc_clk_gate *gate; 2306 + 2307 + gate = devm_kzalloc(pmc->dev, sizeof(*gate), GFP_KERNEL); 2308 + if (!gate) 2309 + return ERR_PTR(-ENOMEM); 2310 + 2311 + init.name = name; 2312 + init.ops = &pmc_clk_gate_ops; 2313 + init.parent_names = &parent_name; 2314 + init.num_parents = 1; 2315 + init.flags = 0; 2316 + 2317 + gate->hw.init = &init; 2318 + gate->offs = offset; 2319 + gate->shift = shift; 2320 + 2321 + return clk_register(NULL, &gate->hw); 2322 + } 2323 + 2324 + static void tegra_pmc_clock_register(struct tegra_pmc *pmc, 2325 + struct device_node *np) 2326 + { 2327 + struct clk *clk; 2328 + struct clk_onecell_data *clk_data; 2329 + unsigned int num_clks; 2330 + int i, err; 2331 + 2332 + num_clks = pmc->soc->num_pmc_clks; 2333 + if (pmc->soc->has_blink_output) 2334 + num_clks += 1; 2335 + 2336 + if (!num_clks) 2337 + return; 2338 + 2339 + clk_data = devm_kmalloc(pmc->dev, sizeof(*clk_data), GFP_KERNEL); 2340 + if (!clk_data) 2341 + return; 2342 + 2343 + clk_data->clks = devm_kcalloc(pmc->dev, TEGRA_PMC_CLK_MAX, 2344 + sizeof(*clk_data->clks), GFP_KERNEL); 2345 + if (!clk_data->clks) 2346 + return; 2347 + 2348 + clk_data->clk_num = TEGRA_PMC_CLK_MAX; 2349 + 2350 + for (i = 0; i < TEGRA_PMC_CLK_MAX; i++) 2351 + clk_data->clks[i] = ERR_PTR(-ENOENT); 2352 + 2353 + for (i = 0; i < pmc->soc->num_pmc_clks; i++) { 2354 + const struct pmc_clk_init_data *data; 2355 + 2356 + data = pmc->soc->pmc_clks_data + i; 2357 + 2358 + clk = tegra_pmc_clk_out_register(pmc, data, PMC_CLK_OUT_CNTRL); 2359 + if (IS_ERR(clk)) { 2360 + dev_warn(pmc->dev, "unable to register clock %s: %d\n", 2361 + data->name, PTR_ERR_OR_ZERO(clk)); 2362 + return; 2363 + } 2364 + 2365 + err = clk_register_clkdev(clk, data->name, NULL); 2366 + if (err) { 2367 + dev_warn(pmc->dev, 2368 + "unable to register %s clock lookup: %d\n", 2369 + data->name, err); 2370 + return; 2371 + } 2372 + 2373 + clk_data->clks[data->clk_id] = clk; 2374 + } 2375 + 2376 + if (pmc->soc->has_blink_output) { 2377 + tegra_pmc_writel(pmc, 0x0, PMC_BLINK_TIMER); 2378 + clk = tegra_pmc_clk_gate_register(pmc, 2379 + "pmc_blink_override", 2380 + "clk_32k", 2381 + PMC_DPD_PADS_ORIDE, 2382 + PMC_DPD_PADS_ORIDE_BLINK); 2383 + if (IS_ERR(clk)) { 2384 + dev_warn(pmc->dev, 2385 + "unable to register pmc_blink_override: %d\n", 2386 + PTR_ERR_OR_ZERO(clk)); 2387 + return; 2388 + } 2389 + 2390 + clk = tegra_pmc_clk_gate_register(pmc, "pmc_blink", 2391 + "pmc_blink_override", 2392 + PMC_CNTRL, 2393 + PMC_CNTRL_BLINK_EN); 2394 + if (IS_ERR(clk)) { 2395 + dev_warn(pmc->dev, 2396 + "unable to register pmc_blink: %d\n", 2397 + PTR_ERR_OR_ZERO(clk)); 2398 + return; 2399 + } 2400 + 2401 + err = clk_register_clkdev(clk, "pmc_blink", NULL); 2402 + if (err) { 2403 + dev_warn(pmc->dev, 2404 + "unable to register pmc_blink lookup: %d\n", 2405 + err); 2406 + return; 2407 + } 2408 + 2409 + clk_data->clks[TEGRA_PMC_CLK_BLINK] = clk; 2410 + } 2411 + 2412 + err = of_clk_add_provider(np, of_clk_src_onecell_get, clk_data); 2413 + if (err) 2414 + dev_warn(pmc->dev, "failed to add pmc clock provider: %d\n", 2415 + err); 2416 + } 2417 + 2246 2418 static int tegra_pmc_probe(struct platform_device *pdev) 2247 2419 { 2248 2420 void __iomem *base; ··· 2613 2281 pmc->base = base; 2614 2282 mutex_unlock(&pmc->powergates_lock); 2615 2283 2284 + tegra_pmc_clock_register(pmc, pdev->dev.of_node); 2616 2285 platform_set_drvdata(pdev, pmc); 2617 2286 2618 2287 return 0; ··· 2755 2422 .num_reset_sources = 0, 2756 2423 .reset_levels = NULL, 2757 2424 .num_reset_levels = 0, 2425 + .pmc_clks_data = NULL, 2426 + .num_pmc_clks = 0, 2427 + .has_blink_output = true, 2758 2428 }; 2759 2429 2760 2430 static const char * const tegra30_powergates[] = { ··· 2805 2469 .num_reset_sources = ARRAY_SIZE(tegra30_reset_sources), 2806 2470 .reset_levels = NULL, 2807 2471 .num_reset_levels = 0, 2472 + .pmc_clks_data = tegra_pmc_clks_data, 2473 + .num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data), 2474 + .has_blink_output = true, 2808 2475 }; 2809 2476 2810 2477 static const char * const tegra114_powergates[] = { ··· 2859 2520 .num_reset_sources = ARRAY_SIZE(tegra30_reset_sources), 2860 2521 .reset_levels = NULL, 2861 2522 .num_reset_levels = 0, 2523 + .pmc_clks_data = tegra_pmc_clks_data, 2524 + .num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data), 2525 + .has_blink_output = true, 2862 2526 }; 2863 2527 2864 2528 static const char * const tegra124_powergates[] = { ··· 2911 2569 .name = (_name) \ 2912 2570 }) 2913 2571 2914 - #define TEGRA124_IO_PAD_TABLE(_pad) \ 2915 - /* .id .dpd .voltage .name */ \ 2916 - _pad(TEGRA_IO_PAD_AUDIO, 17, UINT_MAX, "audio"), \ 2917 - _pad(TEGRA_IO_PAD_BB, 15, UINT_MAX, "bb"), \ 2918 - _pad(TEGRA_IO_PAD_CAM, 36, UINT_MAX, "cam"), \ 2919 - _pad(TEGRA_IO_PAD_COMP, 22, UINT_MAX, "comp"), \ 2920 - _pad(TEGRA_IO_PAD_CSIA, 0, UINT_MAX, "csia"), \ 2921 - _pad(TEGRA_IO_PAD_CSIB, 1, UINT_MAX, "csb"), \ 2922 - _pad(TEGRA_IO_PAD_CSIE, 44, UINT_MAX, "cse"), \ 2923 - _pad(TEGRA_IO_PAD_DSI, 2, UINT_MAX, "dsi"), \ 2924 - _pad(TEGRA_IO_PAD_DSIB, 39, UINT_MAX, "dsib"), \ 2925 - _pad(TEGRA_IO_PAD_DSIC, 40, UINT_MAX, "dsic"), \ 2926 - _pad(TEGRA_IO_PAD_DSID, 41, UINT_MAX, "dsid"), \ 2927 - _pad(TEGRA_IO_PAD_HDMI, 28, UINT_MAX, "hdmi"), \ 2928 - _pad(TEGRA_IO_PAD_HSIC, 19, UINT_MAX, "hsic"), \ 2929 - _pad(TEGRA_IO_PAD_HV, 38, UINT_MAX, "hv"), \ 2930 - _pad(TEGRA_IO_PAD_LVDS, 57, UINT_MAX, "lvds"), \ 2931 - _pad(TEGRA_IO_PAD_MIPI_BIAS, 3, UINT_MAX, "mipi-bias"), \ 2932 - _pad(TEGRA_IO_PAD_NAND, 13, UINT_MAX, "nand"), \ 2933 - _pad(TEGRA_IO_PAD_PEX_BIAS, 4, UINT_MAX, "pex-bias"), \ 2934 - _pad(TEGRA_IO_PAD_PEX_CLK1, 5, UINT_MAX, "pex-clk1"), \ 2935 - _pad(TEGRA_IO_PAD_PEX_CLK2, 6, UINT_MAX, "pex-clk2"), \ 2936 - _pad(TEGRA_IO_PAD_PEX_CNTRL, 32, UINT_MAX, "pex-cntrl"), \ 2937 - _pad(TEGRA_IO_PAD_SDMMC1, 33, UINT_MAX, "sdmmc1"), \ 2938 - _pad(TEGRA_IO_PAD_SDMMC3, 34, UINT_MAX, "sdmmc3"), \ 2939 - _pad(TEGRA_IO_PAD_SDMMC4, 35, UINT_MAX, "sdmmc4"), \ 2940 - _pad(TEGRA_IO_PAD_SYS_DDC, 58, UINT_MAX, "sys_ddc"), \ 2941 - _pad(TEGRA_IO_PAD_UART, 14, UINT_MAX, "uart"), \ 2942 - _pad(TEGRA_IO_PAD_USB0, 9, UINT_MAX, "usb0"), \ 2943 - _pad(TEGRA_IO_PAD_USB1, 10, UINT_MAX, "usb1"), \ 2944 - _pad(TEGRA_IO_PAD_USB2, 11, UINT_MAX, "usb2"), \ 2945 - _pad(TEGRA_IO_PAD_USB_BIAS, 12, UINT_MAX, "usb_bias") 2572 + #define TEGRA124_IO_PAD_TABLE(_pad) \ 2573 + /* .id .dpd .voltage .name */ \ 2574 + _pad(TEGRA_IO_PAD_AUDIO, 17, UINT_MAX, "audio"), \ 2575 + _pad(TEGRA_IO_PAD_BB, 15, UINT_MAX, "bb"), \ 2576 + _pad(TEGRA_IO_PAD_CAM, 36, UINT_MAX, "cam"), \ 2577 + _pad(TEGRA_IO_PAD_COMP, 22, UINT_MAX, "comp"), \ 2578 + _pad(TEGRA_IO_PAD_CSIA, 0, UINT_MAX, "csia"), \ 2579 + _pad(TEGRA_IO_PAD_CSIB, 1, UINT_MAX, "csb"), \ 2580 + _pad(TEGRA_IO_PAD_CSIE, 44, UINT_MAX, "cse"), \ 2581 + _pad(TEGRA_IO_PAD_DSI, 2, UINT_MAX, "dsi"), \ 2582 + _pad(TEGRA_IO_PAD_DSIB, 39, UINT_MAX, "dsib"), \ 2583 + _pad(TEGRA_IO_PAD_DSIC, 40, UINT_MAX, "dsic"), \ 2584 + _pad(TEGRA_IO_PAD_DSID, 41, UINT_MAX, "dsid"), \ 2585 + _pad(TEGRA_IO_PAD_HDMI, 28, UINT_MAX, "hdmi"), \ 2586 + _pad(TEGRA_IO_PAD_HSIC, 19, UINT_MAX, "hsic"), \ 2587 + _pad(TEGRA_IO_PAD_HV, 38, UINT_MAX, "hv"), \ 2588 + _pad(TEGRA_IO_PAD_LVDS, 57, UINT_MAX, "lvds"), \ 2589 + _pad(TEGRA_IO_PAD_MIPI_BIAS, 3, UINT_MAX, "mipi-bias"), \ 2590 + _pad(TEGRA_IO_PAD_NAND, 13, UINT_MAX, "nand"), \ 2591 + _pad(TEGRA_IO_PAD_PEX_BIAS, 4, UINT_MAX, "pex-bias"), \ 2592 + _pad(TEGRA_IO_PAD_PEX_CLK1, 5, UINT_MAX, "pex-clk1"), \ 2593 + _pad(TEGRA_IO_PAD_PEX_CLK2, 6, UINT_MAX, "pex-clk2"), \ 2594 + _pad(TEGRA_IO_PAD_PEX_CNTRL, 32, UINT_MAX, "pex-cntrl"), \ 2595 + _pad(TEGRA_IO_PAD_SDMMC1, 33, UINT_MAX, "sdmmc1"), \ 2596 + _pad(TEGRA_IO_PAD_SDMMC3, 34, UINT_MAX, "sdmmc3"), \ 2597 + _pad(TEGRA_IO_PAD_SDMMC4, 35, UINT_MAX, "sdmmc4"), \ 2598 + _pad(TEGRA_IO_PAD_SYS_DDC, 58, UINT_MAX, "sys_ddc"), \ 2599 + _pad(TEGRA_IO_PAD_UART, 14, UINT_MAX, "uart"), \ 2600 + _pad(TEGRA_IO_PAD_USB0, 9, UINT_MAX, "usb0"), \ 2601 + _pad(TEGRA_IO_PAD_USB1, 10, UINT_MAX, "usb1"), \ 2602 + _pad(TEGRA_IO_PAD_USB2, 11, UINT_MAX, "usb2"), \ 2603 + _pad(TEGRA_IO_PAD_USB_BIAS, 12, UINT_MAX, "usb_bias") 2946 2604 2947 2605 static const struct tegra_io_pad_soc tegra124_io_pads[] = { 2948 2606 TEGRA124_IO_PAD_TABLE(TEGRA_IO_PAD) ··· 2973 2631 .num_reset_sources = ARRAY_SIZE(tegra30_reset_sources), 2974 2632 .reset_levels = NULL, 2975 2633 .num_reset_levels = 0, 2634 + .pmc_clks_data = tegra_pmc_clks_data, 2635 + .num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data), 2636 + .has_blink_output = true, 2976 2637 }; 2977 2638 2978 2639 static const char * const tegra210_powergates[] = { ··· 3012 2667 TEGRA_POWERGATE_CPU3, 3013 2668 }; 3014 2669 3015 - #define TEGRA210_IO_PAD_TABLE(_pad) \ 3016 - /* .id .dpd .voltage .name */ \ 3017 - _pad(TEGRA_IO_PAD_AUDIO, 17, 5, "audio"), \ 3018 - _pad(TEGRA_IO_PAD_AUDIO_HV, 61, 18, "audio-hv"), \ 3019 - _pad(TEGRA_IO_PAD_CAM, 36, 10, "cam"), \ 3020 - _pad(TEGRA_IO_PAD_CSIA, 0, UINT_MAX, "csia"), \ 3021 - _pad(TEGRA_IO_PAD_CSIB, 1, UINT_MAX, "csib"), \ 3022 - _pad(TEGRA_IO_PAD_CSIC, 42, UINT_MAX, "csic"), \ 3023 - _pad(TEGRA_IO_PAD_CSID, 43, UINT_MAX, "csid"), \ 3024 - _pad(TEGRA_IO_PAD_CSIE, 44, UINT_MAX, "csie"), \ 3025 - _pad(TEGRA_IO_PAD_CSIF, 45, UINT_MAX, "csif"), \ 3026 - _pad(TEGRA_IO_PAD_DBG, 25, 19, "dbg"), \ 3027 - _pad(TEGRA_IO_PAD_DEBUG_NONAO, 26, UINT_MAX, "debug-nonao"), \ 3028 - _pad(TEGRA_IO_PAD_DMIC, 50, 20, "dmic"), \ 3029 - _pad(TEGRA_IO_PAD_DP, 51, UINT_MAX, "dp"), \ 3030 - _pad(TEGRA_IO_PAD_DSI, 2, UINT_MAX, "dsi"), \ 3031 - _pad(TEGRA_IO_PAD_DSIB, 39, UINT_MAX, "dsib"), \ 3032 - _pad(TEGRA_IO_PAD_DSIC, 40, UINT_MAX, "dsic"), \ 3033 - _pad(TEGRA_IO_PAD_DSID, 41, UINT_MAX, "dsid"), \ 3034 - _pad(TEGRA_IO_PAD_EMMC, 35, UINT_MAX, "emmc"), \ 3035 - _pad(TEGRA_IO_PAD_EMMC2, 37, UINT_MAX, "emmc2"), \ 3036 - _pad(TEGRA_IO_PAD_GPIO, 27, 21, "gpio"), \ 3037 - _pad(TEGRA_IO_PAD_HDMI, 28, UINT_MAX, "hdmi"), \ 3038 - _pad(TEGRA_IO_PAD_HSIC, 19, UINT_MAX, "hsic"), \ 3039 - _pad(TEGRA_IO_PAD_LVDS, 57, UINT_MAX, "lvds"), \ 3040 - _pad(TEGRA_IO_PAD_MIPI_BIAS, 3, UINT_MAX, "mipi-bias"), \ 3041 - _pad(TEGRA_IO_PAD_PEX_BIAS, 4, UINT_MAX, "pex-bias"), \ 3042 - _pad(TEGRA_IO_PAD_PEX_CLK1, 5, UINT_MAX, "pex-clk1"), \ 3043 - _pad(TEGRA_IO_PAD_PEX_CLK2, 6, UINT_MAX, "pex-clk2"), \ 3044 - _pad(TEGRA_IO_PAD_PEX_CNTRL, UINT_MAX, 11, "pex-cntrl"), \ 3045 - _pad(TEGRA_IO_PAD_SDMMC1, 33, 12, "sdmmc1"), \ 3046 - _pad(TEGRA_IO_PAD_SDMMC3, 34, 13, "sdmmc3"), \ 3047 - _pad(TEGRA_IO_PAD_SPI, 46, 22, "spi"), \ 3048 - _pad(TEGRA_IO_PAD_SPI_HV, 47, 23, "spi-hv"), \ 3049 - _pad(TEGRA_IO_PAD_UART, 14, 2, "uart"), \ 3050 - _pad(TEGRA_IO_PAD_USB0, 9, UINT_MAX, "usb0"), \ 3051 - _pad(TEGRA_IO_PAD_USB1, 10, UINT_MAX, "usb1"), \ 3052 - _pad(TEGRA_IO_PAD_USB2, 11, UINT_MAX, "usb2"), \ 3053 - _pad(TEGRA_IO_PAD_USB3, 18, UINT_MAX, "usb3"), \ 3054 - _pad(TEGRA_IO_PAD_USB_BIAS, 12, UINT_MAX, "usb-bias") 2670 + #define TEGRA210_IO_PAD_TABLE(_pad) \ 2671 + /* .id .dpd .voltage .name */ \ 2672 + _pad(TEGRA_IO_PAD_AUDIO, 17, 5, "audio"), \ 2673 + _pad(TEGRA_IO_PAD_AUDIO_HV, 61, 18, "audio-hv"), \ 2674 + _pad(TEGRA_IO_PAD_CAM, 36, 10, "cam"), \ 2675 + _pad(TEGRA_IO_PAD_CSIA, 0, UINT_MAX, "csia"), \ 2676 + _pad(TEGRA_IO_PAD_CSIB, 1, UINT_MAX, "csib"), \ 2677 + _pad(TEGRA_IO_PAD_CSIC, 42, UINT_MAX, "csic"), \ 2678 + _pad(TEGRA_IO_PAD_CSID, 43, UINT_MAX, "csid"), \ 2679 + _pad(TEGRA_IO_PAD_CSIE, 44, UINT_MAX, "csie"), \ 2680 + _pad(TEGRA_IO_PAD_CSIF, 45, UINT_MAX, "csif"), \ 2681 + _pad(TEGRA_IO_PAD_DBG, 25, 19, "dbg"), \ 2682 + _pad(TEGRA_IO_PAD_DEBUG_NONAO, 26, UINT_MAX, "debug-nonao"), \ 2683 + _pad(TEGRA_IO_PAD_DMIC, 50, 20, "dmic"), \ 2684 + _pad(TEGRA_IO_PAD_DP, 51, UINT_MAX, "dp"), \ 2685 + _pad(TEGRA_IO_PAD_DSI, 2, UINT_MAX, "dsi"), \ 2686 + _pad(TEGRA_IO_PAD_DSIB, 39, UINT_MAX, "dsib"), \ 2687 + _pad(TEGRA_IO_PAD_DSIC, 40, UINT_MAX, "dsic"), \ 2688 + _pad(TEGRA_IO_PAD_DSID, 41, UINT_MAX, "dsid"), \ 2689 + _pad(TEGRA_IO_PAD_EMMC, 35, UINT_MAX, "emmc"), \ 2690 + _pad(TEGRA_IO_PAD_EMMC2, 37, UINT_MAX, "emmc2"), \ 2691 + _pad(TEGRA_IO_PAD_GPIO, 27, 21, "gpio"), \ 2692 + _pad(TEGRA_IO_PAD_HDMI, 28, UINT_MAX, "hdmi"), \ 2693 + _pad(TEGRA_IO_PAD_HSIC, 19, UINT_MAX, "hsic"), \ 2694 + _pad(TEGRA_IO_PAD_LVDS, 57, UINT_MAX, "lvds"), \ 2695 + _pad(TEGRA_IO_PAD_MIPI_BIAS, 3, UINT_MAX, "mipi-bias"), \ 2696 + _pad(TEGRA_IO_PAD_PEX_BIAS, 4, UINT_MAX, "pex-bias"), \ 2697 + _pad(TEGRA_IO_PAD_PEX_CLK1, 5, UINT_MAX, "pex-clk1"), \ 2698 + _pad(TEGRA_IO_PAD_PEX_CLK2, 6, UINT_MAX, "pex-clk2"), \ 2699 + _pad(TEGRA_IO_PAD_PEX_CNTRL, UINT_MAX, 11, "pex-cntrl"), \ 2700 + _pad(TEGRA_IO_PAD_SDMMC1, 33, 12, "sdmmc1"), \ 2701 + _pad(TEGRA_IO_PAD_SDMMC3, 34, 13, "sdmmc3"), \ 2702 + _pad(TEGRA_IO_PAD_SPI, 46, 22, "spi"), \ 2703 + _pad(TEGRA_IO_PAD_SPI_HV, 47, 23, "spi-hv"), \ 2704 + _pad(TEGRA_IO_PAD_UART, 14, 2, "uart"), \ 2705 + _pad(TEGRA_IO_PAD_USB0, 9, UINT_MAX, "usb0"), \ 2706 + _pad(TEGRA_IO_PAD_USB1, 10, UINT_MAX, "usb1"), \ 2707 + _pad(TEGRA_IO_PAD_USB2, 11, UINT_MAX, "usb2"), \ 2708 + _pad(TEGRA_IO_PAD_USB3, 18, UINT_MAX, "usb3"), \ 2709 + _pad(TEGRA_IO_PAD_USB_BIAS, 12, UINT_MAX, "usb-bias") 3055 2710 3056 2711 static const struct tegra_io_pad_soc tegra210_io_pads[] = { 3057 2712 TEGRA210_IO_PAD_TABLE(TEGRA_IO_PAD) ··· 3090 2745 .num_reset_levels = 0, 3091 2746 .num_wake_events = ARRAY_SIZE(tegra210_wake_events), 3092 2747 .wake_events = tegra210_wake_events, 2748 + .pmc_clks_data = tegra_pmc_clks_data, 2749 + .num_pmc_clks = ARRAY_SIZE(tegra_pmc_clks_data), 2750 + .has_blink_output = true, 3093 2751 }; 3094 2752 3095 - #define TEGRA186_IO_PAD_TABLE(_pad) \ 3096 - /* .id .dpd .voltage .name */ \ 3097 - _pad(TEGRA_IO_PAD_CSIA, 0, UINT_MAX, "csia"), \ 3098 - _pad(TEGRA_IO_PAD_CSIB, 1, UINT_MAX, "csib"), \ 3099 - _pad(TEGRA_IO_PAD_DSI, 2, UINT_MAX, "dsi"), \ 3100 - _pad(TEGRA_IO_PAD_MIPI_BIAS, 3, UINT_MAX, "mipi-bias"), \ 3101 - _pad(TEGRA_IO_PAD_PEX_CLK_BIAS, 4, UINT_MAX, "pex-clk-bias"), \ 3102 - _pad(TEGRA_IO_PAD_PEX_CLK3, 5, UINT_MAX, "pex-clk3"), \ 3103 - _pad(TEGRA_IO_PAD_PEX_CLK2, 6, UINT_MAX, "pex-clk2"), \ 3104 - _pad(TEGRA_IO_PAD_PEX_CLK1, 7, UINT_MAX, "pex-clk1"), \ 3105 - _pad(TEGRA_IO_PAD_USB0, 9, UINT_MAX, "usb0"), \ 3106 - _pad(TEGRA_IO_PAD_USB1, 10, UINT_MAX, "usb1"), \ 3107 - _pad(TEGRA_IO_PAD_USB2, 11, UINT_MAX, "usb2"), \ 3108 - _pad(TEGRA_IO_PAD_USB_BIAS, 12, UINT_MAX, "usb-bias"), \ 3109 - _pad(TEGRA_IO_PAD_UART, 14, UINT_MAX, "uart"), \ 3110 - _pad(TEGRA_IO_PAD_AUDIO, 17, UINT_MAX, "audio"), \ 3111 - _pad(TEGRA_IO_PAD_HSIC, 19, UINT_MAX, "hsic"), \ 3112 - _pad(TEGRA_IO_PAD_DBG, 25, UINT_MAX, "dbg"), \ 3113 - _pad(TEGRA_IO_PAD_HDMI_DP0, 28, UINT_MAX, "hdmi-dp0"), \ 3114 - _pad(TEGRA_IO_PAD_HDMI_DP1, 29, UINT_MAX, "hdmi-dp1"), \ 3115 - _pad(TEGRA_IO_PAD_PEX_CNTRL, 32, UINT_MAX, "pex-cntrl"), \ 3116 - _pad(TEGRA_IO_PAD_SDMMC2_HV, 34, 5, "sdmmc2-hv"), \ 3117 - _pad(TEGRA_IO_PAD_SDMMC4, 36, UINT_MAX, "sdmmc4"), \ 3118 - _pad(TEGRA_IO_PAD_CAM, 38, UINT_MAX, "cam"), \ 3119 - _pad(TEGRA_IO_PAD_DSIB, 40, UINT_MAX, "dsib"), \ 3120 - _pad(TEGRA_IO_PAD_DSIC, 41, UINT_MAX, "dsic"), \ 3121 - _pad(TEGRA_IO_PAD_DSID, 42, UINT_MAX, "dsid"), \ 3122 - _pad(TEGRA_IO_PAD_CSIC, 43, UINT_MAX, "csic"), \ 3123 - _pad(TEGRA_IO_PAD_CSID, 44, UINT_MAX, "csid"), \ 3124 - _pad(TEGRA_IO_PAD_CSIE, 45, UINT_MAX, "csie"), \ 3125 - _pad(TEGRA_IO_PAD_CSIF, 46, UINT_MAX, "csif"), \ 3126 - _pad(TEGRA_IO_PAD_SPI, 47, UINT_MAX, "spi"), \ 3127 - _pad(TEGRA_IO_PAD_UFS, 49, UINT_MAX, "ufs"), \ 3128 - _pad(TEGRA_IO_PAD_DMIC_HV, 52, 2, "dmic-hv"), \ 3129 - _pad(TEGRA_IO_PAD_EDP, 53, UINT_MAX, "edp"), \ 3130 - _pad(TEGRA_IO_PAD_SDMMC1_HV, 55, 4, "sdmmc1-hv"), \ 3131 - _pad(TEGRA_IO_PAD_SDMMC3_HV, 56, 6, "sdmmc3-hv"), \ 3132 - _pad(TEGRA_IO_PAD_CONN, 60, UINT_MAX, "conn"), \ 3133 - _pad(TEGRA_IO_PAD_AUDIO_HV, 61, 1, "audio-hv"), \ 3134 - _pad(TEGRA_IO_PAD_AO_HV, UINT_MAX, 0, "ao-hv") 2753 + #define TEGRA186_IO_PAD_TABLE(_pad) \ 2754 + /* .id .dpd .voltage .name */ \ 2755 + _pad(TEGRA_IO_PAD_CSIA, 0, UINT_MAX, "csia"), \ 2756 + _pad(TEGRA_IO_PAD_CSIB, 1, UINT_MAX, "csib"), \ 2757 + _pad(TEGRA_IO_PAD_DSI, 2, UINT_MAX, "dsi"), \ 2758 + _pad(TEGRA_IO_PAD_MIPI_BIAS, 3, UINT_MAX, "mipi-bias"), \ 2759 + _pad(TEGRA_IO_PAD_PEX_CLK_BIAS, 4, UINT_MAX, "pex-clk-bias"), \ 2760 + _pad(TEGRA_IO_PAD_PEX_CLK3, 5, UINT_MAX, "pex-clk3"), \ 2761 + _pad(TEGRA_IO_PAD_PEX_CLK2, 6, UINT_MAX, "pex-clk2"), \ 2762 + _pad(TEGRA_IO_PAD_PEX_CLK1, 7, UINT_MAX, "pex-clk1"), \ 2763 + _pad(TEGRA_IO_PAD_USB0, 9, UINT_MAX, "usb0"), \ 2764 + _pad(TEGRA_IO_PAD_USB1, 10, UINT_MAX, "usb1"), \ 2765 + _pad(TEGRA_IO_PAD_USB2, 11, UINT_MAX, "usb2"), \ 2766 + _pad(TEGRA_IO_PAD_USB_BIAS, 12, UINT_MAX, "usb-bias"), \ 2767 + _pad(TEGRA_IO_PAD_UART, 14, UINT_MAX, "uart"), \ 2768 + _pad(TEGRA_IO_PAD_AUDIO, 17, UINT_MAX, "audio"), \ 2769 + _pad(TEGRA_IO_PAD_HSIC, 19, UINT_MAX, "hsic"), \ 2770 + _pad(TEGRA_IO_PAD_DBG, 25, UINT_MAX, "dbg"), \ 2771 + _pad(TEGRA_IO_PAD_HDMI_DP0, 28, UINT_MAX, "hdmi-dp0"), \ 2772 + _pad(TEGRA_IO_PAD_HDMI_DP1, 29, UINT_MAX, "hdmi-dp1"), \ 2773 + _pad(TEGRA_IO_PAD_PEX_CNTRL, 32, UINT_MAX, "pex-cntrl"), \ 2774 + _pad(TEGRA_IO_PAD_SDMMC2_HV, 34, 5, "sdmmc2-hv"), \ 2775 + _pad(TEGRA_IO_PAD_SDMMC4, 36, UINT_MAX, "sdmmc4"), \ 2776 + _pad(TEGRA_IO_PAD_CAM, 38, UINT_MAX, "cam"), \ 2777 + _pad(TEGRA_IO_PAD_DSIB, 40, UINT_MAX, "dsib"), \ 2778 + _pad(TEGRA_IO_PAD_DSIC, 41, UINT_MAX, "dsic"), \ 2779 + _pad(TEGRA_IO_PAD_DSID, 42, UINT_MAX, "dsid"), \ 2780 + _pad(TEGRA_IO_PAD_CSIC, 43, UINT_MAX, "csic"), \ 2781 + _pad(TEGRA_IO_PAD_CSID, 44, UINT_MAX, "csid"), \ 2782 + _pad(TEGRA_IO_PAD_CSIE, 45, UINT_MAX, "csie"), \ 2783 + _pad(TEGRA_IO_PAD_CSIF, 46, UINT_MAX, "csif"), \ 2784 + _pad(TEGRA_IO_PAD_SPI, 47, UINT_MAX, "spi"), \ 2785 + _pad(TEGRA_IO_PAD_UFS, 49, UINT_MAX, "ufs"), \ 2786 + _pad(TEGRA_IO_PAD_DMIC_HV, 52, 2, "dmic-hv"), \ 2787 + _pad(TEGRA_IO_PAD_EDP, 53, UINT_MAX, "edp"), \ 2788 + _pad(TEGRA_IO_PAD_SDMMC1_HV, 55, 4, "sdmmc1-hv"), \ 2789 + _pad(TEGRA_IO_PAD_SDMMC3_HV, 56, 6, "sdmmc3-hv"), \ 2790 + _pad(TEGRA_IO_PAD_CONN, 60, UINT_MAX, "conn"), \ 2791 + _pad(TEGRA_IO_PAD_AUDIO_HV, 61, 1, "audio-hv"), \ 2792 + _pad(TEGRA_IO_PAD_AO_HV, UINT_MAX, 0, "ao-hv") 3135 2793 3136 2794 static const struct tegra_io_pad_soc tegra186_io_pads[] = { 3137 2795 TEGRA186_IO_PAD_TABLE(TEGRA_IO_PAD) ··· 3222 2874 .num_reset_levels = ARRAY_SIZE(tegra186_reset_levels), 3223 2875 .num_wake_events = ARRAY_SIZE(tegra186_wake_events), 3224 2876 .wake_events = tegra186_wake_events, 2877 + .pmc_clks_data = NULL, 2878 + .num_pmc_clks = 0, 2879 + .has_blink_output = false, 3225 2880 }; 3226 2881 2882 + #define TEGRA194_IO_PAD_TABLE(_pad) \ 2883 + /* .id .dpd .voltage .name */ \ 2884 + _pad(TEGRA_IO_PAD_CSIA, 0, UINT_MAX, "csia"), \ 2885 + _pad(TEGRA_IO_PAD_CSIB, 1, UINT_MAX, "csib"), \ 2886 + _pad(TEGRA_IO_PAD_MIPI_BIAS, 3, UINT_MAX, "mipi-bias"), \ 2887 + _pad(TEGRA_IO_PAD_PEX_CLK_BIAS, 4, UINT_MAX, "pex-clk-bias"), \ 2888 + _pad(TEGRA_IO_PAD_PEX_CLK3, 5, UINT_MAX, "pex-clk3"), \ 2889 + _pad(TEGRA_IO_PAD_PEX_CLK2, 6, UINT_MAX, "pex-clk2"), \ 2890 + _pad(TEGRA_IO_PAD_PEX_CLK1, 7, UINT_MAX, "pex-clk1"), \ 2891 + _pad(TEGRA_IO_PAD_EQOS, 8, UINT_MAX, "eqos"), \ 2892 + _pad(TEGRA_IO_PAD_PEX_CLK_2_BIAS, 9, UINT_MAX, "pex-clk-2-bias"), \ 2893 + _pad(TEGRA_IO_PAD_PEX_CLK_2, 10, UINT_MAX, "pex-clk-2"), \ 2894 + _pad(TEGRA_IO_PAD_DAP3, 11, UINT_MAX, "dap3"), \ 2895 + _pad(TEGRA_IO_PAD_DAP5, 12, UINT_MAX, "dap5"), \ 2896 + _pad(TEGRA_IO_PAD_UART, 14, UINT_MAX, "uart"), \ 2897 + _pad(TEGRA_IO_PAD_PWR_CTL, 15, UINT_MAX, "pwr-ctl"), \ 2898 + _pad(TEGRA_IO_PAD_SOC_GPIO53, 16, UINT_MAX, "soc-gpio53"), \ 2899 + _pad(TEGRA_IO_PAD_AUDIO, 17, UINT_MAX, "audio"), \ 2900 + _pad(TEGRA_IO_PAD_GP_PWM2, 18, UINT_MAX, "gp-pwm2"), \ 2901 + _pad(TEGRA_IO_PAD_GP_PWM3, 19, UINT_MAX, "gp-pwm3"), \ 2902 + _pad(TEGRA_IO_PAD_SOC_GPIO12, 20, UINT_MAX, "soc-gpio12"), \ 2903 + _pad(TEGRA_IO_PAD_SOC_GPIO13, 21, UINT_MAX, "soc-gpio13"), \ 2904 + _pad(TEGRA_IO_PAD_SOC_GPIO10, 22, UINT_MAX, "soc-gpio10"), \ 2905 + _pad(TEGRA_IO_PAD_UART4, 23, UINT_MAX, "uart4"), \ 2906 + _pad(TEGRA_IO_PAD_UART5, 24, UINT_MAX, "uart5"), \ 2907 + _pad(TEGRA_IO_PAD_DBG, 25, UINT_MAX, "dbg"), \ 2908 + _pad(TEGRA_IO_PAD_HDMI_DP3, 26, UINT_MAX, "hdmi-dp3"), \ 2909 + _pad(TEGRA_IO_PAD_HDMI_DP2, 27, UINT_MAX, "hdmi-dp2"), \ 2910 + _pad(TEGRA_IO_PAD_HDMI_DP0, 28, UINT_MAX, "hdmi-dp0"), \ 2911 + _pad(TEGRA_IO_PAD_HDMI_DP1, 29, UINT_MAX, "hdmi-dp1"), \ 2912 + _pad(TEGRA_IO_PAD_PEX_CNTRL, 32, UINT_MAX, "pex-cntrl"), \ 2913 + _pad(TEGRA_IO_PAD_PEX_CTL2, 33, UINT_MAX, "pex-ctl2"), \ 2914 + _pad(TEGRA_IO_PAD_PEX_L0_RST_N, 34, UINT_MAX, "pex-l0-rst"), \ 2915 + _pad(TEGRA_IO_PAD_PEX_L1_RST_N, 35, UINT_MAX, "pex-l1-rst"), \ 2916 + _pad(TEGRA_IO_PAD_SDMMC4, 36, UINT_MAX, "sdmmc4"), \ 2917 + _pad(TEGRA_IO_PAD_PEX_L5_RST_N, 37, UINT_MAX, "pex-l5-rst"), \ 2918 + _pad(TEGRA_IO_PAD_CAM, 38, UINT_MAX, "cam"), \ 2919 + _pad(TEGRA_IO_PAD_CSIC, 43, UINT_MAX, "csic"), \ 2920 + _pad(TEGRA_IO_PAD_CSID, 44, UINT_MAX, "csid"), \ 2921 + _pad(TEGRA_IO_PAD_CSIE, 45, UINT_MAX, "csie"), \ 2922 + _pad(TEGRA_IO_PAD_CSIF, 46, UINT_MAX, "csif"), \ 2923 + _pad(TEGRA_IO_PAD_SPI, 47, UINT_MAX, "spi"), \ 2924 + _pad(TEGRA_IO_PAD_UFS, 49, UINT_MAX, "ufs"), \ 2925 + _pad(TEGRA_IO_PAD_CSIG, 50, UINT_MAX, "csig"), \ 2926 + _pad(TEGRA_IO_PAD_CSIH, 51, UINT_MAX, "csih"), \ 2927 + _pad(TEGRA_IO_PAD_EDP, 53, UINT_MAX, "edp"), \ 2928 + _pad(TEGRA_IO_PAD_SDMMC1_HV, 55, 4, "sdmmc1-hv"), \ 2929 + _pad(TEGRA_IO_PAD_SDMMC3_HV, 56, 6, "sdmmc3-hv"), \ 2930 + _pad(TEGRA_IO_PAD_CONN, 60, UINT_MAX, "conn"), \ 2931 + _pad(TEGRA_IO_PAD_AUDIO_HV, 61, 1, "audio-hv"), \ 2932 + _pad(TEGRA_IO_PAD_AO_HV, UINT_MAX, 0, "ao-hv") 2933 + 3227 2934 static const struct tegra_io_pad_soc tegra194_io_pads[] = { 3228 - { .id = TEGRA_IO_PAD_CSIA, .dpd = 0, .voltage = UINT_MAX }, 3229 - { .id = TEGRA_IO_PAD_CSIB, .dpd = 1, .voltage = UINT_MAX }, 3230 - { .id = TEGRA_IO_PAD_MIPI_BIAS, .dpd = 3, .voltage = UINT_MAX }, 3231 - { .id = TEGRA_IO_PAD_PEX_CLK_BIAS, .dpd = 4, .voltage = UINT_MAX }, 3232 - { .id = TEGRA_IO_PAD_PEX_CLK3, .dpd = 5, .voltage = UINT_MAX }, 3233 - { .id = TEGRA_IO_PAD_PEX_CLK2, .dpd = 6, .voltage = UINT_MAX }, 3234 - { .id = TEGRA_IO_PAD_PEX_CLK1, .dpd = 7, .voltage = UINT_MAX }, 3235 - { .id = TEGRA_IO_PAD_EQOS, .dpd = 8, .voltage = UINT_MAX }, 3236 - { .id = TEGRA_IO_PAD_PEX_CLK2_BIAS, .dpd = 9, .voltage = UINT_MAX }, 3237 - { .id = TEGRA_IO_PAD_PEX_CLK2, .dpd = 10, .voltage = UINT_MAX }, 3238 - { .id = TEGRA_IO_PAD_DAP3, .dpd = 11, .voltage = UINT_MAX }, 3239 - { .id = TEGRA_IO_PAD_DAP5, .dpd = 12, .voltage = UINT_MAX }, 3240 - { .id = TEGRA_IO_PAD_UART, .dpd = 14, .voltage = UINT_MAX }, 3241 - { .id = TEGRA_IO_PAD_PWR_CTL, .dpd = 15, .voltage = UINT_MAX }, 3242 - { .id = TEGRA_IO_PAD_SOC_GPIO53, .dpd = 16, .voltage = UINT_MAX }, 3243 - { .id = TEGRA_IO_PAD_AUDIO, .dpd = 17, .voltage = UINT_MAX }, 3244 - { .id = TEGRA_IO_PAD_GP_PWM2, .dpd = 18, .voltage = UINT_MAX }, 3245 - { .id = TEGRA_IO_PAD_GP_PWM3, .dpd = 19, .voltage = UINT_MAX }, 3246 - { .id = TEGRA_IO_PAD_SOC_GPIO12, .dpd = 20, .voltage = UINT_MAX }, 3247 - { .id = TEGRA_IO_PAD_SOC_GPIO13, .dpd = 21, .voltage = UINT_MAX }, 3248 - { .id = TEGRA_IO_PAD_SOC_GPIO10, .dpd = 22, .voltage = UINT_MAX }, 3249 - { .id = TEGRA_IO_PAD_UART4, .dpd = 23, .voltage = UINT_MAX }, 3250 - { .id = TEGRA_IO_PAD_UART5, .dpd = 24, .voltage = UINT_MAX }, 3251 - { .id = TEGRA_IO_PAD_DBG, .dpd = 25, .voltage = UINT_MAX }, 3252 - { .id = TEGRA_IO_PAD_HDMI_DP3, .dpd = 26, .voltage = UINT_MAX }, 3253 - { .id = TEGRA_IO_PAD_HDMI_DP2, .dpd = 27, .voltage = UINT_MAX }, 3254 - { .id = TEGRA_IO_PAD_HDMI_DP0, .dpd = 28, .voltage = UINT_MAX }, 3255 - { .id = TEGRA_IO_PAD_HDMI_DP1, .dpd = 29, .voltage = UINT_MAX }, 3256 - { .id = TEGRA_IO_PAD_PEX_CNTRL, .dpd = 32, .voltage = UINT_MAX }, 3257 - { .id = TEGRA_IO_PAD_PEX_CTL2, .dpd = 33, .voltage = UINT_MAX }, 3258 - { .id = TEGRA_IO_PAD_PEX_L0_RST_N, .dpd = 34, .voltage = UINT_MAX }, 3259 - { .id = TEGRA_IO_PAD_PEX_L1_RST_N, .dpd = 35, .voltage = UINT_MAX }, 3260 - { .id = TEGRA_IO_PAD_SDMMC4, .dpd = 36, .voltage = UINT_MAX }, 3261 - { .id = TEGRA_IO_PAD_PEX_L5_RST_N, .dpd = 37, .voltage = UINT_MAX }, 3262 - { .id = TEGRA_IO_PAD_CSIC, .dpd = 43, .voltage = UINT_MAX }, 3263 - { .id = TEGRA_IO_PAD_CSID, .dpd = 44, .voltage = UINT_MAX }, 3264 - { .id = TEGRA_IO_PAD_CSIE, .dpd = 45, .voltage = UINT_MAX }, 3265 - { .id = TEGRA_IO_PAD_CSIF, .dpd = 46, .voltage = UINT_MAX }, 3266 - { .id = TEGRA_IO_PAD_SPI, .dpd = 47, .voltage = UINT_MAX }, 3267 - { .id = TEGRA_IO_PAD_UFS, .dpd = 49, .voltage = UINT_MAX }, 3268 - { .id = TEGRA_IO_PAD_CSIG, .dpd = 50, .voltage = UINT_MAX }, 3269 - { .id = TEGRA_IO_PAD_CSIH, .dpd = 51, .voltage = UINT_MAX }, 3270 - { .id = TEGRA_IO_PAD_EDP, .dpd = 53, .voltage = UINT_MAX }, 3271 - { .id = TEGRA_IO_PAD_SDMMC1_HV, .dpd = 55, .voltage = UINT_MAX }, 3272 - { .id = TEGRA_IO_PAD_SDMMC3_HV, .dpd = 56, .voltage = UINT_MAX }, 3273 - { .id = TEGRA_IO_PAD_CONN, .dpd = 60, .voltage = UINT_MAX }, 3274 - { .id = TEGRA_IO_PAD_AUDIO_HV, .dpd = 61, .voltage = UINT_MAX }, 2935 + TEGRA194_IO_PAD_TABLE(TEGRA_IO_PAD) 2936 + }; 2937 + 2938 + static const struct pinctrl_pin_desc tegra194_pin_descs[] = { 2939 + TEGRA194_IO_PAD_TABLE(TEGRA_IO_PIN_DESC) 3275 2940 }; 3276 2941 3277 2942 static const struct tegra_pmc_regs tegra194_pmc_regs = { ··· 3337 2976 .has_tsense_reset = false, 3338 2977 .has_gpu_clamps = false, 3339 2978 .needs_mbist_war = false, 3340 - .has_impl_33v_pwr = false, 2979 + .has_impl_33v_pwr = true, 3341 2980 .maybe_tz_only = false, 3342 2981 .num_io_pads = ARRAY_SIZE(tegra194_io_pads), 3343 2982 .io_pads = tegra194_io_pads, 2983 + .num_pin_descs = ARRAY_SIZE(tegra194_pin_descs), 2984 + .pin_descs = tegra194_pin_descs, 3344 2985 .regs = &tegra194_pmc_regs, 3345 2986 .init = NULL, 3346 2987 .setup_irq_polarity = tegra186_pmc_setup_irq_polarity, ··· 3354 2991 .num_reset_levels = ARRAY_SIZE(tegra186_reset_levels), 3355 2992 .num_wake_events = ARRAY_SIZE(tegra194_wake_events), 3356 2993 .wake_events = tegra194_wake_events, 2994 + .pmc_clks_data = NULL, 2995 + .num_pmc_clks = 0, 2996 + .has_blink_output = false, 3357 2997 }; 3358 2998 3359 2999 static const struct of_device_id tegra_pmc_match[] = {
+20 -1
drivers/soc/ti/pm33xx.c
··· 130 130 return 0; 131 131 } 132 132 133 + static int am33xx_do_sram_idle(u32 wfi_flags) 134 + { 135 + int ret = 0; 136 + 137 + if (!m3_ipc || !pm_ops) 138 + return 0; 139 + 140 + if (wfi_flags & WFI_FLAG_WAKE_M3) 141 + ret = m3_ipc->ops->prepare_low_power(m3_ipc, WKUP_M3_IDLE); 142 + 143 + return pm_ops->cpu_suspend(am33xx_do_wfi_sram, wfi_flags); 144 + } 145 + 133 146 static int __init am43xx_map_gic(void) 134 147 { 135 148 gic_dist_base = ioremap(AM43XX_GIC_DIST_BASE, SZ_4K); ··· 273 260 rtc_only_idle = 0; 274 261 } 275 262 263 + pm_ops->begin_suspend(); 264 + 276 265 switch (state) { 277 266 case PM_SUSPEND_MEM: 278 267 ret = m3_ipc->ops->prepare_low_power(m3_ipc, WKUP_M3_DEEPSLEEP); ··· 316 301 } 317 302 318 303 rtc_only_idle = 0; 304 + 305 + pm_ops->finish_suspend(); 319 306 } 320 307 321 308 static int am33xx_pm_valid(suspend_state_t state) ··· 520 503 suspend_wfi_flags |= WFI_FLAG_WAKE_M3; 521 504 #endif /* CONFIG_SUSPEND */ 522 505 523 - ret = pm_ops->init(); 506 + ret = pm_ops->init(am33xx_do_sram_idle); 524 507 if (ret) { 525 508 dev_err(dev, "Unable to call core pm init!\n"); 526 509 ret = -ENODEV; ··· 539 522 540 523 static int am33xx_pm_remove(struct platform_device *pdev) 541 524 { 525 + if (pm_ops->deinit) 526 + pm_ops->deinit(); 542 527 suspend_set_ops(NULL); 543 528 wkup_m3_ipc_put(m3_ipc); 544 529 am33xx_pm_free_sram();
+3 -1
include/dt-bindings/clock/tegra114-car.h
··· 228 228 #define TEGRA114_CLK_CLK_M 201 229 229 #define TEGRA114_CLK_CLK_M_DIV2 202 230 230 #define TEGRA114_CLK_CLK_M_DIV4 203 231 + #define TEGRA114_CLK_OSC_DIV2 202 232 + #define TEGRA114_CLK_OSC_DIV4 203 231 233 #define TEGRA114_CLK_PLL_REF 204 232 234 #define TEGRA114_CLK_PLL_C 205 233 235 #define TEGRA114_CLK_PLL_C_OUT1 206 ··· 276 274 #define TEGRA114_CLK_CLK_OUT_2 246 277 275 #define TEGRA114_CLK_CLK_OUT_3 247 278 276 #define TEGRA114_CLK_BLINK 248 279 - /* 249 */ 277 + #define TEGRA114_CLK_OSC 249 280 278 /* 250 */ 281 279 /* 251 */ 282 280 #define TEGRA114_CLK_XUSB_HOST_SRC 252
+3 -1
include/dt-bindings/clock/tegra124-car-common.h
··· 227 227 #define TEGRA124_CLK_CLK_M 201 228 228 #define TEGRA124_CLK_CLK_M_DIV2 202 229 229 #define TEGRA124_CLK_CLK_M_DIV4 203 230 + #define TEGRA124_CLK_OSC_DIV2 202 231 + #define TEGRA124_CLK_OSC_DIV4 203 230 232 #define TEGRA124_CLK_PLL_REF 204 231 233 #define TEGRA124_CLK_PLL_C 205 232 234 #define TEGRA124_CLK_PLL_C_OUT1 206 ··· 275 273 #define TEGRA124_CLK_CLK_OUT_2 246 276 274 #define TEGRA124_CLK_CLK_OUT_3 247 277 275 #define TEGRA124_CLK_BLINK 248 278 - /* 249 */ 276 + #define TEGRA124_CLK_OSC 249 279 277 /* 250 */ 280 278 /* 251 */ 281 279 #define TEGRA124_CLK_XUSB_HOST_SRC 252
+3 -1
include/dt-bindings/clock/tegra210-car.h
··· 262 262 #define TEGRA210_CLK_CLK_M 233 263 263 #define TEGRA210_CLK_CLK_M_DIV2 234 264 264 #define TEGRA210_CLK_CLK_M_DIV4 235 265 + #define TEGRA210_CLK_OSC_DIV2 234 266 + #define TEGRA210_CLK_OSC_DIV4 235 265 267 #define TEGRA210_CLK_PLL_REF 236 266 268 #define TEGRA210_CLK_PLL_C 237 267 269 #define TEGRA210_CLK_PLL_C_OUT1 238 ··· 357 355 #define TEGRA210_CLK_PLL_A_OUT_ADSP 323 358 356 #define TEGRA210_CLK_PLL_A_OUT0_OUT_ADSP 324 359 357 /* 325 */ 360 - /* 326 */ 358 + #define TEGRA210_CLK_OSC 326 361 359 /* 327 */ 362 360 /* 328 */ 363 361 /* 329 */
+3 -1
include/dt-bindings/clock/tegra30-car.h
··· 196 196 #define TEGRA30_CLK_CLK_M 171 197 197 #define TEGRA30_CLK_CLK_M_DIV2 172 198 198 #define TEGRA30_CLK_CLK_M_DIV4 173 199 + #define TEGRA30_CLK_OSC_DIV2 172 200 + #define TEGRA30_CLK_OSC_DIV4 173 199 201 #define TEGRA30_CLK_PLL_REF 174 200 202 #define TEGRA30_CLK_PLL_C 175 201 203 #define TEGRA30_CLK_PLL_C_OUT1 176 ··· 245 243 #define TEGRA30_CLK_HCLK 217 246 244 #define TEGRA30_CLK_PCLK 218 247 245 /* 219 */ 248 - /* 220 */ 246 + #define TEGRA30_CLK_OSC 220 249 247 /* 221 */ 250 248 /* 222 */ 251 249 /* 223 */
+16
include/dt-bindings/soc/tegra-pmc.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_SOC_TEGRA_PMC_H 7 + #define _DT_BINDINGS_SOC_TEGRA_PMC_H 8 + 9 + #define TEGRA_PMC_CLK_OUT_1 0 10 + #define TEGRA_PMC_CLK_OUT_2 1 11 + #define TEGRA_PMC_CLK_OUT_3 2 12 + #define TEGRA_PMC_CLK_BLINK 3 13 + 14 + #define TEGRA_PMC_CLK_MAX 4 15 + 16 + #endif /* _DT_BINDINGS_SOC_TEGRA_PMC_H */
+23
include/linux/clk/at91_pmc.h
··· 12 12 #ifndef AT91_PMC_H 13 13 #define AT91_PMC_H 14 14 15 + #define AT91_PMC_V1 (1) /* PMC version 1 */ 16 + #define AT91_PMC_V2 (2) /* PMC version 2 [SAM9X60] */ 17 + 15 18 #define AT91_PMC_SCER 0x00 /* System Clock Enable Register */ 16 19 #define AT91_PMC_SCDR 0x04 /* System Clock Disable Register */ 17 20 ··· 33 30 #define AT91_PMC_HCK0 (1 << 16) /* AHB Clock (USB host) [AT91SAM9261 only] */ 34 31 #define AT91_PMC_HCK1 (1 << 17) /* AHB Clock (LCD) [AT91SAM9261 only] */ 35 32 33 + #define AT91_PMC_PLL_CTRL0 0x0C /* PLL Control Register 0 [for SAM9X60] */ 34 + #define AT91_PMC_PLL_CTRL0_ENPLL (1 << 28) /* Enable PLL */ 35 + #define AT91_PMC_PLL_CTRL0_ENPLLCK (1 << 29) /* Enable PLL clock for PMC */ 36 + #define AT91_PMC_PLL_CTRL0_ENLOCK (1 << 31) /* Enable PLL lock */ 37 + 38 + #define AT91_PMC_PLL_CTRL1 0x10 /* PLL Control Register 1 [for SAM9X60] */ 39 + 36 40 #define AT91_PMC_PCER 0x10 /* Peripheral Clock Enable Register */ 37 41 #define AT91_PMC_PCDR 0x14 /* Peripheral Clock Disable Register */ 38 42 #define AT91_PMC_PCSR 0x18 /* Peripheral Clock Status Register */ 43 + 44 + #define AT91_PMC_PLL_ACR 0x18 /* PLL Analog Control Register [for SAM9X60] */ 45 + #define AT91_PMC_PLL_ACR_DEFAULT_UPLL 0x12020010UL /* Default PLL ACR value for UPLL */ 46 + #define AT91_PMC_PLL_ACR_DEFAULT_PLLA 0x00020010UL /* Default PLL ACR value for PLLA */ 47 + #define AT91_PMC_PLL_ACR_UTMIVR (1 << 12) /* UPLL Voltage regulator Control */ 48 + #define AT91_PMC_PLL_ACR_UTMIBG (1 << 13) /* UPLL Bandgap Control */ 39 49 40 50 #define AT91_CKGR_UCKR 0x1C /* UTMI Clock Register [some SAM9] */ 41 51 #define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */ 42 52 #define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */ 43 53 #define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */ 44 54 #define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI BIAS Start-up Time */ 55 + 56 + #define AT91_PMC_PLL_UPDT 0x1C /* PMC PLL update register [for SAM9X60] */ 57 + #define AT91_PMC_PLL_UPDT_UPDATE (1 << 8) /* Update PLL settings */ 58 + #define AT91_PMC_PLL_UPDT_ID (1 << 0) /* PLL ID */ 59 + #define AT91_PMC_PLL_UPDT_STUPTIM (0xff << 16) /* Startup time */ 45 60 46 61 #define AT91_CKGR_MOR 0x20 /* Main Oscillator Register [not on SAM9RL] */ 47 62 #define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ ··· 200 179 #define AT91_PMC_WPSR 0xe8 /* Write Protect Status Register [some SAM9] */ 201 180 #define AT91_PMC_WPVS (0x1 << 0) /* Write Protect Violation Status */ 202 181 #define AT91_PMC_WPVSRC (0xffff << 8) /* Write Protect Violation Source */ 182 + 183 + #define AT91_PMC_PLL_ISR0 0xEC /* PLL Interrupt Status Register 0 [SAM9X60 only] */ 203 184 204 185 #define AT91_PMC_PCER1 0x100 /* Peripheral Clock Enable Register 1 [SAMA5 only]*/ 205 186 #define AT91_PMC_PCDR1 0x104 /* Peripheral Clock Enable Register 1 */
+1 -1
include/linux/firmware/xlnx-zynqmp.h
··· 329 329 int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, 330 330 u32 arg2, u32 arg3, u32 *ret_payload); 331 331 332 - #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP) 332 + #if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE) 333 333 const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); 334 334 #else 335 335 static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
+5 -1
include/linux/platform_data/pm33xx.h
··· 46 46 }; 47 47 48 48 struct am33xx_pm_platform_data { 49 - int (*init)(void); 49 + int (*init)(int (*idle)(u32 wfi_flags)); 50 + int (*deinit)(void); 50 51 int (*soc_suspend)(unsigned int state, int (*fn)(unsigned long), 51 52 unsigned long args); 53 + int (*cpu_suspend)(int (*fn)(unsigned long), unsigned long args); 54 + void (*begin_suspend)(void); 55 + void (*finish_suspend)(void); 52 56 struct am33xx_pm_sram_addr *(*get_sram_addrs)(void); 53 57 void __iomem *(*get_rtc_base_addr)(void); 54 58 void (*save_context)(void);
+1 -1
include/soc/tegra/cpuidle.h
··· 6 6 #ifndef __SOC_TEGRA_CPUIDLE_H__ 7 7 #define __SOC_TEGRA_CPUIDLE_H__ 8 8 9 - #if defined(CONFIG_ARM) && defined(CONFIG_ARCH_TEGRA) && defined(CONFIG_CPU_IDLE) 9 + #ifdef CONFIG_ARM_TEGRA_CPUIDLE 10 10 void tegra_cpuidle_pcie_irqs_in_use(void); 11 11 #else 12 12 static inline void tegra_cpuidle_pcie_irqs_in_use(void)
+31
include/soc/tegra/pm.h
··· 6 6 #ifndef __SOC_TEGRA_PM_H__ 7 7 #define __SOC_TEGRA_PM_H__ 8 8 9 + #include <linux/errno.h> 10 + 9 11 enum tegra_suspend_mode { 10 12 TEGRA_SUSPEND_NONE = 0, 11 13 TEGRA_SUSPEND_LP2, /* CPU voltage off */ ··· 22 20 23 21 /* low-level resume entry point */ 24 22 void tegra_resume(void); 23 + 24 + int tegra30_pm_secondary_cpu_suspend(unsigned long arg); 25 + void tegra_pm_clear_cpu_in_lp2(void); 26 + void tegra_pm_set_cpu_in_lp2(void); 27 + int tegra_pm_enter_lp2(void); 28 + int tegra_pm_park_secondary_cpu(unsigned long cpu); 25 29 #else 26 30 static inline enum tegra_suspend_mode 27 31 tegra_pm_validate_suspend_mode(enum tegra_suspend_mode mode) ··· 37 29 38 30 static inline void tegra_resume(void) 39 31 { 32 + } 33 + 34 + static inline int tegra30_pm_secondary_cpu_suspend(unsigned long arg) 35 + { 36 + return -ENOTSUPP; 37 + } 38 + 39 + static inline void tegra_pm_clear_cpu_in_lp2(void) 40 + { 41 + } 42 + 43 + static inline void tegra_pm_set_cpu_in_lp2(void) 44 + { 45 + } 46 + 47 + static inline int tegra_pm_enter_lp2(void) 48 + { 49 + return -ENOTSUPP; 50 + } 51 + 52 + static inline int tegra_pm_park_secondary_cpu(unsigned long cpu) 53 + { 54 + return -ENOTSUPP; 40 55 } 41 56 #endif /* CONFIG_PM_SLEEP */ 42 57
+2 -1
include/soc/tegra/pmc.h
··· 113 113 TEGRA_IO_PAD_PEX_CLK_BIAS, 114 114 TEGRA_IO_PAD_PEX_CLK1, 115 115 TEGRA_IO_PAD_PEX_CLK2, 116 - TEGRA_IO_PAD_PEX_CLK2_BIAS, 117 116 TEGRA_IO_PAD_PEX_CLK3, 117 + TEGRA_IO_PAD_PEX_CLK_2_BIAS, 118 + TEGRA_IO_PAD_PEX_CLK_2, 118 119 TEGRA_IO_PAD_PEX_CNTRL, 119 120 TEGRA_IO_PAD_PEX_CTL2, 120 121 TEGRA_IO_PAD_PEX_L0_RST_N,