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

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

Pull ARM SoC updates from Olof Johansson:
"A few SoC (code) changes have queued up this cycle, mostly for minor
changes and some refactoring and cleanup of legacy platforms. This
branch also contains a few of the fixes that weren't sent in by the
end of the release (all fairly minor).

- Adding an additional maintainer for the TEE subsystem (Sumit Garg)

- Quite a significant modernization of the IXP4xx platforms by Linus
Walleij, revisiting with a new PCI host driver/binding, removing
legacy mach/* include dependencies and moving platform
detection/config to drivers/soc. Also some updates/cleanup of
platform data.

- Core power domain support for Tegra platforms, and some
improvements in build test coverage by adding stubs for compile
test targets.

- A handful of updates to i.MX platforms, adding legacy (non-PSCI)
SMP support on i.MX7D, SoC ID setup for i.MX50, removal of platform
data and board fixups for iMX6/7.

... and a few smaller changes and fixes for Samsung, OMAP, Allwinner,
Rockchip"

* tag 'arm-soc-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (53 commits)
MAINTAINERS: Add myself as TEE subsystem reviewer
ixp4xx: fix spelling mistake in Kconfig "Devce" -> "Device"
hw_random: ixp4xx: Add OF support
hw_random: ixp4xx: Add DT bindings
hw_random: ixp4xx: Turn into a module
hw_random: ixp4xx: Use SPDX license tag
hw_random: ixp4xx: enable compile-testing
pata: ixp4xx: split platform data to its own header
soc: ixp4xx: move cpu detection to linux/soc/ixp4xx/cpu.h
PCI: ixp4xx: Add a new driver for IXP4xx
PCI: ixp4xx: Add device tree bindings for IXP4xx
ARM/ixp4xx: Make NEED_MACH_IO_H optional
ARM/ixp4xx: Move the virtual IObases
MAINTAINERS: ARM/MStar/Sigmastar SoCs: Add a link to the MStar tree
ARM: debug: add UART early console support for MSTAR SoCs
ARM: dts: ux500: Fix LED probing
ARM: imx: add smp support for imx7d
ARM: imx6q: drop of_platform_default_populate() from init_machine
arm64: dts: rockchip: Update RK3399 PCI host bridge window to 32-bit address memory
soc/tegra: fuse: Fix Tegra234-only builds
...

+1841 -460
+100
Documentation/devicetree/bindings/pci/intel,ixp4xx-pci.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/pci/intel,ixp4xx-pci.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Intel IXP4xx PCI controller 8 + 9 + maintainers: 10 + - Linus Walleij <linus.walleij@linaro.org> 11 + 12 + description: PCI host controller found in the Intel IXP4xx SoC series. 13 + 14 + allOf: 15 + - $ref: /schemas/pci/pci-bus.yaml# 16 + 17 + properties: 18 + compatible: 19 + items: 20 + - enum: 21 + - intel,ixp42x-pci 22 + - intel,ixp43x-pci 23 + description: The two supported variants are ixp42x and ixp43x, 24 + though more variants may exist. 25 + 26 + reg: 27 + items: 28 + - description: IXP4xx-specific registers 29 + 30 + interrupts: 31 + items: 32 + - description: Main PCI interrupt 33 + - description: PCI DMA interrupt 1 34 + - description: PCI DMA interrupt 2 35 + 36 + ranges: 37 + maxItems: 2 38 + description: Typically one memory range of 64MB and one IO 39 + space range of 64KB. 40 + 41 + dma-ranges: 42 + maxItems: 1 43 + description: The DMA range tells the PCI host which addresses 44 + the RAM is at. It can map only 64MB so if the RAM is bigger 45 + than 64MB the DMA access has to be restricted to these 46 + addresses. 47 + 48 + "#interrupt-cells": true 49 + 50 + interrupt-map: true 51 + 52 + interrupt-map-mask: 53 + items: 54 + - const: 0xf800 55 + - const: 0 56 + - const: 0 57 + - const: 7 58 + 59 + required: 60 + - compatible 61 + - reg 62 + - dma-ranges 63 + - "#interrupt-cells" 64 + - interrupt-map 65 + - interrupt-map-mask 66 + 67 + unevaluatedProperties: false 68 + 69 + examples: 70 + - | 71 + pci@c0000000 { 72 + compatible = "intel,ixp43x-pci"; 73 + reg = <0xc0000000 0x1000>; 74 + #address-cells = <3>; 75 + #size-cells = <2>; 76 + device_type = "pci"; 77 + bus-range = <0x00 0xff>; 78 + 79 + ranges = 80 + <0x02000000 0 0x48000000 0x48000000 0 0x04000000>, 81 + <0x01000000 0 0x00000000 0x4c000000 0 0x00010000>; 82 + dma-ranges = 83 + <0x02000000 0 0x00000000 0x00000000 0 0x04000000>; 84 + 85 + #interrupt-cells = <1>; 86 + interrupt-map-mask = <0xf800 0 0 7>; 87 + interrupt-map = 88 + <0x0800 0 0 1 &gpio0 11 3>, /* INT A on slot 1 is irq 11 */ 89 + <0x0800 0 0 2 &gpio0 10 3>, /* INT B on slot 1 is irq 10 */ 90 + <0x0800 0 0 3 &gpio0 9 3>, /* INT C on slot 1 is irq 9 */ 91 + <0x0800 0 0 4 &gpio0 8 3>, /* INT D on slot 1 is irq 8 */ 92 + <0x1000 0 0 1 &gpio0 10 3>, /* INT A on slot 2 is irq 10 */ 93 + <0x1000 0 0 2 &gpio0 9 3>, /* INT B on slot 2 is irq 9 */ 94 + <0x1000 0 0 3 &gpio0 8 3>, /* INT C on slot 2 is irq 8 */ 95 + <0x1000 0 0 4 &gpio0 11 3>, /* INT D on slot 2 is irq 11 */ 96 + <0x1800 0 0 1 &gpio0 9 3>, /* INT A on slot 3 is irq 9 */ 97 + <0x1800 0 0 2 &gpio0 8 3>, /* INT B on slot 3 is irq 8 */ 98 + <0x1800 0 0 3 &gpio0 11 3>, /* INT C on slot 3 is irq 11 */ 99 + <0x1800 0 0 4 &gpio0 10 3>; /* INT D on slot 3 is irq 10 */ 100 + };
+36
Documentation/devicetree/bindings/rng/intel,ixp46x-rng.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/rng/intel,ixp46x-rng.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Intel IXP46x RNG bindings 8 + 9 + description: | 10 + The Intel IXP46x has a random number generator at a fixed physical 11 + location in memory. Each read is guaranteed to provide a unique 12 + 32 bit random number. 13 + 14 + maintainers: 15 + - Linus Walleij <linus.walleij@linaro.org> 16 + 17 + properties: 18 + compatible: 19 + const: intel,ixp46x-rng 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + required: 25 + - compatible 26 + - reg 27 + 28 + additionalProperties: false 29 + 30 + examples: 31 + - | 32 + rng@70002100 { 33 + compatible = "intel,ixp46x-rng"; 34 + reg = <0x70002100 4>; 35 + }; 36 +
+12 -6
MAINTAINERS
··· 2210 2210 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2211 2211 S: Maintained 2212 2212 W: http://linux-chenxing.org/ 2213 + T: git git://github.com/linux-chenxing/linux.git 2213 2214 F: Documentation/devicetree/bindings/arm/mstar/* 2214 2215 F: Documentation/devicetree/bindings/clock/mstar,msc313-mpll.yaml 2215 2216 F: Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml ··· 2480 2479 F: drivers/*/*s3c24* 2481 2480 F: drivers/*/*s3c64xx* 2482 2481 F: drivers/*/*s5pv210* 2482 + F: drivers/clocksource/samsung_pwm_timer.c 2483 2483 F: drivers/memory/samsung/ 2484 + F: drivers/pwm/pwm-samsung.c 2484 2485 F: drivers/soc/samsung/ 2485 2486 F: drivers/tty/serial/samsung* 2487 + F: include/clocksource/samsung_pwm.h 2486 2488 F: include/linux/platform_data/*s3c* 2487 2489 F: include/linux/serial_s3c.h 2488 2490 F: include/linux/soc/samsung/ ··· 9385 9381 INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT 9386 9382 M: Deepak Saxena <dsaxena@plexity.net> 9387 9383 S: Maintained 9384 + F: Documentation/devicetree/bindings/display/intel,ixp46x-rng.yaml 9388 9385 F: drivers/char/hw_random/ixp4xx-rng.c 9389 9386 9390 9387 INTEL KEEM BAY DRM DRIVER ··· 13515 13510 S: Maintained 13516 13511 F: arch/arm/mach-omap2/omap_hwmod*data* 13517 13512 13518 - OMAP HWMOD DATA FOR OMAP4-BASED DEVICES 13519 - M: Benoît Cousson <bcousson@baylibre.com> 13520 - L: linux-omap@vger.kernel.org 13521 - S: Maintained 13522 - F: arch/arm/mach-omap2/omap_hwmod_44xx_data.c 13523 - 13524 13513 OMAP HWMOD SUPPORT 13525 13514 M: Benoît Cousson <bcousson@baylibre.com> 13526 13515 M: Paul Walmsley <paul@pwsan.com> ··· 14177 14178 S: Maintained 14178 14179 F: Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml 14179 14180 F: drivers/pci/controller/dwc/pcie-fu740.c 14181 + 14182 + PCI DRIVER FOR INTEL IXP4XX 14183 + M: Linus Walleij <linus.walleij@linaro.org> 14184 + S: Maintained 14185 + F: Documentation/devicetree/bindings/pci/intel,ixp4xx-pci.yaml 14186 + F: drivers/pci/controller/pci-ixp4xx.c 14180 14187 14181 14188 PCI DRIVER FOR INTEL VOLUME MANAGEMENT DEVICE (VMD) 14182 14189 M: Jonathan Derrick <jonathan.derrick@intel.com> ··· 18131 18126 18132 18127 TEE SUBSYSTEM 18133 18128 M: Jens Wiklander <jens.wiklander@linaro.org> 18129 + R: Sumit Garg <sumit.garg@linaro.org> 18134 18130 L: op-tee@lists.trustedfirmware.org 18135 18131 S: Maintained 18136 18132 F: Documentation/staging/tee.rst
+2 -1
arch/arm/Kconfig
··· 394 394 select HAVE_PCI 395 395 select IXP4XX_IRQ 396 396 select IXP4XX_TIMER 397 - select NEED_MACH_IO_H 397 + # With the new PCI driver this is not needed 398 + select NEED_MACH_IO_H if PCI_IXP4XX_LEGACY 398 399 select USB_EHCI_BIG_ENDIAN_DESC 399 400 select USB_EHCI_BIG_ENDIAN_MMIO 400 401 help
+13 -2
arch/arm/Kconfig.debug
··· 609 609 when u-boot hands over to the kernel, the system 610 610 silently crashes, with no serial output at all. 611 611 612 + config DEBUG_MSTARV7_PMUART 613 + bool "Kernel low-level debugging messages via MSTARV7 PM UART" 614 + depends on ARCH_MSTARV7 615 + select DEBUG_UART_8250 616 + help 617 + Say Y here if you want kernel low-level debugging support 618 + for MSTAR ARMv7-based platforms on PM UART. 619 + 612 620 config DEBUG_MT6589_UART0 613 621 bool "Mediatek mt6589 UART0" 614 622 depends on ARCH_MEDIATEK ··· 1615 1607 default 0x18000400 if DEBUG_BCM_HR2 1616 1608 default 0x18023000 if DEBUG_BCM_IPROC_UART3 1617 1609 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1 1610 + default 0x1f221000 if DEBUG_MSTARV7_PMUART 1618 1611 default 0x20001000 if DEBUG_HIP01_UART 1619 1612 default 0x20060000 if DEBUG_RK29_UART0 1620 1613 default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 ··· 1733 1724 default 0xf0100000 if DEBUG_DIGICOLOR_UA0 1734 1725 default 0xf01fb000 if DEBUG_NOMADIK_UART 1735 1726 default 0xf0201000 if DEBUG_BCM2835 || DEBUG_BCM2836 1727 + default 0xf0221000 if DEBUG_MSTARV7_PMUART 1736 1728 default 0xf1000300 if DEBUG_BCM_5301X 1737 1729 default 0xf1000400 if DEBUG_BCM_HR2 1738 1730 default 0xf1002000 if DEBUG_MT8127_UART0 ··· 1815 1805 default 0xfedc0000 if DEBUG_EP93XX 1816 1806 default 0xfee003f8 if DEBUG_FOOTBRIDGE_COM1 1817 1807 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART 1818 - default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN 1819 - default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN 1808 + default 0xfec00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN 1809 + default 0xfec00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN 1820 1810 default 0xfef36000 if DEBUG_HIGHBANK_UART 1821 1811 default 0xfefb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1 1822 1812 default 0xfefb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2 ··· 1839 1829 default 0 if DEBUG_FOOTBRIDGE_COM1 || ARCH_IOP32X || DEBUG_BCM_5301X || \ 1840 1830 DEBUG_BCM_HR2 || DEBUG_OMAP7XXUART1 || DEBUG_OMAP7XXUART2 || \ 1841 1831 DEBUG_OMAP7XXUART3 1832 + default 3 if DEBUG_MSTARV7_PMUART 1842 1833 default 2 1843 1834 1844 1835 config DEBUG_UART_8250_WORD
+1 -5
arch/arm/boot/dts/am5718.dtsi
··· 17 17 * VCP1, VCP2 18 18 * MLB 19 19 * ISS 20 - * USB3, USB4 20 + * USB3 21 21 */ 22 22 23 23 &usb3_tm { 24 - status = "disabled"; 25 - }; 26 - 27 - &usb4_tm { 28 24 status = "disabled"; 29 25 }; 30 26
-22
arch/arm/boot/dts/dra7-l4.dtsi
··· 4129 4129 }; 4130 4130 }; 4131 4131 4132 - usb4_tm: target-module@140000 { /* 0x48940000, ap 75 3c.0 */ 4133 - compatible = "ti,sysc-omap4", "ti,sysc"; 4134 - reg = <0x140000 0x4>, 4135 - <0x140010 0x4>; 4136 - reg-names = "rev", "sysc"; 4137 - ti,sysc-mask = <SYSC_OMAP4_DMADISABLE>; 4138 - ti,sysc-midle = <SYSC_IDLE_FORCE>, 4139 - <SYSC_IDLE_NO>, 4140 - <SYSC_IDLE_SMART>, 4141 - <SYSC_IDLE_SMART_WKUP>; 4142 - ti,sysc-sidle = <SYSC_IDLE_FORCE>, 4143 - <SYSC_IDLE_NO>, 4144 - <SYSC_IDLE_SMART>, 4145 - <SYSC_IDLE_SMART_WKUP>; 4146 - /* Domains (P, C): l3init_pwrdm, l3init_clkdm */ 4147 - clocks = <&l3init_clkctrl DRA7_L3INIT_USB_OTG_SS4_CLKCTRL 0>; 4148 - clock-names = "fck"; 4149 - #address-cells = <1>; 4150 - #size-cells = <1>; 4151 - ranges = <0x0 0x140000 0x20000>; 4152 - }; 4153 - 4154 4132 target-module@170000 { /* 0x48970000, ap 21 0a.0 */ 4155 4133 compatible = "ti,sysc-omap4", "ti,sysc"; 4156 4134 reg = <0x170010 0x4>;
-4
arch/arm/boot/dts/dra71x.dtsi
··· 11 11 &rtctarget { 12 12 status = "disabled"; 13 13 }; 14 - 15 - &usb4_tm { 16 - status = "disabled"; 17 - };
-4
arch/arm/boot/dts/dra72x.dtsi
··· 108 108 &pcie2_rc { 109 109 compatible = "ti,dra726-pcie-rc", "ti,dra7-pcie"; 110 110 }; 111 - 112 - &usb4_tm { 113 - status = "disabled"; 114 - };
+49 -43
arch/arm/boot/dts/dra74x.dtsi
··· 49 49 reg = <0x41500000 0x100>; 50 50 }; 51 51 52 - target-module@48940000 { 53 - compatible = "ti,sysc-omap4", "ti,sysc"; 54 - reg = <0x48940000 0x4>, 55 - <0x48940010 0x4>; 56 - reg-names = "rev", "sysc"; 57 - ti,sysc-mask = <SYSC_OMAP4_DMADISABLE>; 58 - ti,sysc-midle = <SYSC_IDLE_FORCE>, 59 - <SYSC_IDLE_NO>, 60 - <SYSC_IDLE_SMART>, 61 - <SYSC_IDLE_SMART_WKUP>; 62 - ti,sysc-sidle = <SYSC_IDLE_FORCE>, 63 - <SYSC_IDLE_NO>, 64 - <SYSC_IDLE_SMART>, 65 - <SYSC_IDLE_SMART_WKUP>; 66 - clocks = <&l3init_clkctrl DRA7_L3INIT_USB_OTG_SS4_CLKCTRL 0>; 67 - clock-names = "fck"; 68 - #address-cells = <1>; 69 - #size-cells = <1>; 70 - ranges = <0x0 0x48940000 0x20000>; 71 - 72 - omap_dwc3_4: omap_dwc3_4@0 { 73 - compatible = "ti,dwc3"; 74 - reg = <0 0x10000>; 75 - interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>; 76 - #address-cells = <1>; 77 - #size-cells = <1>; 78 - utmi-mode = <2>; 79 - ranges; 80 - status = "disabled"; 81 - usb4: usb@10000 { 82 - compatible = "snps,dwc3"; 83 - reg = <0x10000 0x17000>; 84 - interrupts = <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>, 85 - <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>, 86 - <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>; 87 - interrupt-names = "peripheral", 88 - "host", 89 - "otg"; 90 - maximum-speed = "high-speed"; 91 - dr_mode = "otg"; 92 - }; 93 - }; 94 - }; 95 52 96 53 target-module@41501000 { 97 54 compatible = "ti,sysc-omap2", "ti,sysc"; ··· 180 223 181 224 &pcie2_rc { 182 225 compatible = "ti,dra746-pcie-rc", "ti,dra7-pcie"; 226 + }; 227 + 228 + &l4_per3 { 229 + segment@0 { 230 + usb4_tm: target-module@140000 { /* 0x48940000, ap 75 3c.0 */ 231 + compatible = "ti,sysc-omap4", "ti,sysc"; 232 + reg = <0x140000 0x4>, 233 + <0x140010 0x4>; 234 + reg-names = "rev", "sysc"; 235 + ti,sysc-mask = <SYSC_OMAP4_DMADISABLE>; 236 + ti,sysc-midle = <SYSC_IDLE_FORCE>, 237 + <SYSC_IDLE_NO>, 238 + <SYSC_IDLE_SMART>, 239 + <SYSC_IDLE_SMART_WKUP>; 240 + ti,sysc-sidle = <SYSC_IDLE_FORCE>, 241 + <SYSC_IDLE_NO>, 242 + <SYSC_IDLE_SMART>, 243 + <SYSC_IDLE_SMART_WKUP>; 244 + /* Domains (P, C): l3init_pwrdm, l3init_clkdm */ 245 + clocks = <&l3init_clkctrl DRA7_L3INIT_USB_OTG_SS4_CLKCTRL 0>; 246 + clock-names = "fck"; 247 + #address-cells = <1>; 248 + #size-cells = <1>; 249 + ranges = <0x0 0x140000 0x20000>; 250 + 251 + omap_dwc3_4: omap_dwc3_4@0 { 252 + compatible = "ti,dwc3"; 253 + reg = <0 0x10000>; 254 + interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>; 255 + #address-cells = <1>; 256 + #size-cells = <1>; 257 + utmi-mode = <2>; 258 + ranges; 259 + status = "disabled"; 260 + usb4: usb@10000 { 261 + compatible = "snps,dwc3"; 262 + reg = <0x10000 0x17000>; 263 + interrupts = <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>, 264 + <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>, 265 + <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>; 266 + interrupt-names = "peripheral", 267 + "host", 268 + "otg"; 269 + maximum-speed = "high-speed"; 270 + dr_mode = "otg"; 271 + }; 272 + }; 273 + }; 274 + }; 183 275 };
+1 -1
arch/arm/boot/dts/qcom-sdx55-t55.dts
··· 250 250 nand-ecc-step-size = <512>; 251 251 nand-bus-width = <8>; 252 252 /* efs2 partition is secured */ 253 - secure-regions = <0x500000 0xb00000>; 253 + secure-regions = /bits/ 64 <0x500000 0xb00000>; 254 254 }; 255 255 }; 256 256
+2 -2
arch/arm/boot/dts/qcom-sdx55-telit-fn980-tlb.dts
··· 250 250 nand-ecc-step-size = <512>; 251 251 nand-bus-width = <8>; 252 252 /* ico and efs2 partitions are secured */ 253 - secure-regions = <0x500000 0x500000 254 - 0xa00000 0xb00000>; 253 + secure-regions = /bits/ 64 <0x500000 0x500000 254 + 0xa00000 0xb00000>; 255 255 }; 256 256 }; 257 257
+7
arch/arm/boot/dts/ste-href.dtsi
··· 4 4 */ 5 5 6 6 #include <dt-bindings/interrupt-controller/irq.h> 7 + #include <dt-bindings/leds/common.h> 7 8 #include "ste-href-family-pinctrl.dtsi" 8 9 9 10 / { ··· 65 64 reg = <0>; 66 65 led-cur = /bits/ 8 <0x2f>; 67 66 max-cur = /bits/ 8 <0x5f>; 67 + color = <LED_COLOR_ID_BLUE>; 68 68 linux,default-trigger = "heartbeat"; 69 69 }; 70 70 chan@1 { 71 71 reg = <1>; 72 72 led-cur = /bits/ 8 <0x2f>; 73 73 max-cur = /bits/ 8 <0x5f>; 74 + color = <LED_COLOR_ID_BLUE>; 74 75 }; 75 76 chan@2 { 76 77 reg = <2>; 77 78 led-cur = /bits/ 8 <0x2f>; 78 79 max-cur = /bits/ 8 <0x5f>; 80 + color = <LED_COLOR_ID_BLUE>; 79 81 }; 80 82 }; 81 83 lp5521@34 { ··· 92 88 reg = <0>; 93 89 led-cur = /bits/ 8 <0x2f>; 94 90 max-cur = /bits/ 8 <0x5f>; 91 + color = <LED_COLOR_ID_BLUE>; 95 92 }; 96 93 chan@1 { 97 94 reg = <1>; 98 95 led-cur = /bits/ 8 <0x2f>; 99 96 max-cur = /bits/ 8 <0x5f>; 97 + color = <LED_COLOR_ID_BLUE>; 100 98 }; 101 99 chan@2 { 102 100 reg = <2>; 103 101 led-cur = /bits/ 8 <0x2f>; 104 102 max-cur = /bits/ 8 <0x5f>; 103 + color = <LED_COLOR_ID_BLUE>; 105 104 }; 106 105 }; 107 106 bh1780@29 {
+1 -1
arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts
··· 85 85 pinctrl-0 = <&emac_rgmii_pins>; 86 86 phy-supply = <&reg_gmac_3v3>; 87 87 phy-handle = <&ext_rgmii_phy>; 88 - phy-mode = "rgmii"; 88 + phy-mode = "rgmii-id"; 89 89 90 90 status = "okay"; 91 91 };
+2
arch/arm/mach-exynos/exynos.c
··· 55 55 sysram_base_addr = of_iomap(node, 0); 56 56 sysram_base_phys = of_translate_address(node, 57 57 of_get_address(node, 0, NULL, NULL)); 58 + of_node_put(node); 58 59 break; 59 60 } 60 61 ··· 63 62 if (!of_device_is_available(node)) 64 63 continue; 65 64 sysram_ns_base_addr = of_iomap(node, 0); 65 + of_node_put(node); 66 66 break; 67 67 } 68 68 }
+1 -1
arch/arm/mach-imx/Makefile
··· 35 35 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o 36 36 obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o 37 37 obj-$(CONFIG_HAVE_IMX_SRC) += src.o 38 - ifneq ($(CONFIG_SOC_IMX6)$(CONFIG_SOC_LS1021A),) 38 + ifneq ($(CONFIG_SOC_IMX6)$(CONFIG_SOC_IMX7D_CA7)$(CONFIG_SOC_LS1021A),) 39 39 AFLAGS_headsmp.o :=-Wa,-march=armv7-a 40 40 obj-$(CONFIG_SMP) += headsmp.o platsmp.o 41 41 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
+3
arch/arm/mach-imx/common.h
··· 68 68 void v7_secondary_startup(void); 69 69 void imx_scu_map_io(void); 70 70 void imx_smp_prepare(void); 71 + void imx_gpcv2_set_core1_pdn_pup_by_software(bool pdn); 71 72 #else 72 73 static inline void imx_scu_map_io(void) {} 73 74 static inline void imx_smp_prepare(void) {} 74 75 #endif 75 76 void imx_src_init(void); 77 + void imx7_src_init(void); 76 78 void imx_gpc_pre_suspend(bool arm_power_off); 77 79 void imx_gpc_post_resume(void); 78 80 void imx_gpc_mask_all(void); ··· 133 131 #endif 134 132 135 133 extern const struct smp_operations imx_smp_ops; 134 + extern const struct smp_operations imx7_smp_ops; 136 135 extern const struct smp_operations ls1021a_smp_ops; 137 136 138 137 #endif
+9
arch/arm/mach-imx/headsmp.S
··· 21 21 22 22 ENTRY(v7_secondary_startup) 23 23 ARM_BE8(setend be) @ go BE8 if entered LE 24 + mrc p15, 0, r0, c0, c0, 0 25 + lsl r0, r0, #16 26 + lsr r0, r0, #20 27 + /* 0xc07 is cortex A7's ID */ 28 + mov r1, #0xc00 29 + orr r1, #0x7 30 + cmp r0, r1 31 + beq secondary_startup 32 + 24 33 set_diag_reg 25 34 b secondary_startup 26 35 ENDPROC(v7_secondary_startup)
+3
arch/arm/mach-imx/hotplug.c
··· 11 11 #include <asm/proc-fns.h> 12 12 13 13 #include "common.h" 14 + #include "hardware.h" 14 15 15 16 /* 16 17 * platform-specific code to shutdown a CPU ··· 41 40 return 0; 42 41 imx_enable_cpu(cpu, false); 43 42 imx_set_cpu_arg(cpu, 0); 43 + if (cpu_is_imx7d()) 44 + imx_gpcv2_set_core1_pdn_pup_by_software(true); 44 45 return 1; 45 46 }
+7
arch/arm/mach-imx/mach-imx50.c
··· 9 9 #include <asm/mach/arch.h> 10 10 11 11 #include "common.h" 12 + #include "hardware.h" 13 + 14 + static void __init imx50_init_early(void) 15 + { 16 + mxc_set_cpu_type(MXC_CPU_MX50); 17 + } 12 18 13 19 static const char * const imx50_dt_board_compat[] __initconst = { 14 20 "fsl,imx50", ··· 22 16 }; 23 17 24 18 DT_MACHINE_START(IMX50_DT, "Freescale i.MX50 (Device Tree Support)") 19 + .init_early = imx50_init_early, 25 20 .dt_compat = imx50_dt_board_compat, 26 21 MACHINE_END
-88
arch/arm/mach-imx/mach-imx6q.c
··· 40 40 return 0; 41 41 } 42 42 43 - static void mmd_write_reg(struct phy_device *dev, int device, int reg, int val) 44 - { 45 - phy_write(dev, 0x0d, device); 46 - phy_write(dev, 0x0e, reg); 47 - phy_write(dev, 0x0d, (1 << 14) | device); 48 - phy_write(dev, 0x0e, val); 49 - } 50 - 51 - static int ksz9031rn_phy_fixup(struct phy_device *dev) 52 - { 53 - /* 54 - * min rx data delay, max rx/tx clock delay, 55 - * min rx/tx control delay 56 - */ 57 - mmd_write_reg(dev, 2, 4, 0); 58 - mmd_write_reg(dev, 2, 5, 0); 59 - mmd_write_reg(dev, 2, 8, 0x003ff); 60 - 61 - return 0; 62 - } 63 - 64 43 /* 65 44 * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High 66 45 * as they are used for slots1-7 PERST# ··· 68 89 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, ventana_pciesw_early_fixup); 69 90 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, ventana_pciesw_early_fixup); 70 91 71 - static int ar8031_phy_fixup(struct phy_device *dev) 72 - { 73 - u16 val; 74 - 75 - /* To enable AR8031 output a 125MHz clk from CLK_25M */ 76 - phy_write(dev, 0xd, 0x7); 77 - phy_write(dev, 0xe, 0x8016); 78 - phy_write(dev, 0xd, 0x4007); 79 - 80 - val = phy_read(dev, 0xe); 81 - val &= 0xffe3; 82 - val |= 0x18; 83 - phy_write(dev, 0xe, val); 84 - 85 - /* introduce tx clock delay */ 86 - phy_write(dev, 0x1d, 0x5); 87 - val = phy_read(dev, 0x1e); 88 - val |= 0x0100; 89 - phy_write(dev, 0x1e, val); 90 - 91 - return 0; 92 - } 93 - 94 - #define PHY_ID_AR8031 0x004dd074 95 - 96 - static int ar8035_phy_fixup(struct phy_device *dev) 97 - { 98 - u16 val; 99 - 100 - /* Ar803x phy SmartEEE feature cause link status generates glitch, 101 - * which cause ethernet link down/up issue, so disable SmartEEE 102 - */ 103 - phy_write(dev, 0xd, 0x3); 104 - phy_write(dev, 0xe, 0x805d); 105 - phy_write(dev, 0xd, 0x4003); 106 - 107 - val = phy_read(dev, 0xe); 108 - phy_write(dev, 0xe, val & ~(1 << 8)); 109 - 110 - /* 111 - * Enable 125MHz clock from CLK_25M on the AR8031. This 112 - * is fed in to the IMX6 on the ENET_REF_CLK (V22) pad. 113 - * Also, introduce a tx clock delay. 114 - * 115 - * This is the same as is the AR8031 fixup. 116 - */ 117 - ar8031_phy_fixup(dev); 118 - 119 - /*check phy power*/ 120 - val = phy_read(dev, 0x0); 121 - if (val & BMCR_PDOWN) 122 - phy_write(dev, 0x0, val & ~BMCR_PDOWN); 123 - 124 - return 0; 125 - } 126 - 127 - #define PHY_ID_AR8035 0x004dd072 128 - 129 92 static void __init imx6q_enet_phy_init(void) 130 93 { 131 94 if (IS_BUILTIN(CONFIG_PHYLIB)) { 132 95 phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, 133 96 ksz9021rn_phy_fixup); 134 - phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK, 135 - ksz9031rn_phy_fixup); 136 - phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef, 137 - ar8031_phy_fixup); 138 - phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef, 139 - ar8035_phy_fixup); 140 97 } 141 98 } 142 99 ··· 172 257 imx_get_soc_revision()); 173 258 174 259 imx6q_enet_phy_init(); 175 - 176 - of_platform_default_populate(NULL, NULL, NULL); 177 - 178 260 imx_anatop_init(); 179 261 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init(); 180 262 imx6q_1588_init();
-26
arch/arm/mach-imx/mach-imx6sx.c
··· 15 15 #include "common.h" 16 16 #include "cpuidle.h" 17 17 18 - static int ar8031_phy_fixup(struct phy_device *dev) 19 - { 20 - u16 val; 21 - 22 - /* Set RGMII IO voltage to 1.8V */ 23 - phy_write(dev, 0x1d, 0x1f); 24 - phy_write(dev, 0x1e, 0x8); 25 - 26 - /* introduce tx clock delay */ 27 - phy_write(dev, 0x1d, 0x5); 28 - val = phy_read(dev, 0x1e); 29 - val |= 0x0100; 30 - phy_write(dev, 0x1e, val); 31 - 32 - return 0; 33 - } 34 - 35 - #define PHY_ID_AR8031 0x004dd074 36 - static void __init imx6sx_enet_phy_init(void) 37 - { 38 - if (IS_BUILTIN(CONFIG_PHYLIB)) 39 - phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff, 40 - ar8031_phy_fixup); 41 - } 42 - 43 18 static void __init imx6sx_enet_clk_sel(void) 44 19 { 45 20 struct regmap *gpr; ··· 32 57 33 58 static inline void imx6sx_enet_init(void) 34 59 { 35 - imx6sx_enet_phy_init(); 36 60 imx6sx_enet_clk_sel(); 37 61 } 38 62
+2 -23
arch/arm/mach-imx/mach-imx7d.c
··· 14 14 15 15 #include "common.h" 16 16 17 - static int ar8031_phy_fixup(struct phy_device *dev) 18 - { 19 - u16 val; 20 - 21 - /* Set RGMII IO voltage to 1.8V */ 22 - phy_write(dev, 0x1d, 0x1f); 23 - phy_write(dev, 0x1e, 0x8); 24 - 25 - /* disable phy AR8031 SmartEEE function. */ 26 - phy_write(dev, 0xd, 0x3); 27 - phy_write(dev, 0xe, 0x805d); 28 - phy_write(dev, 0xd, 0x4003); 29 - val = phy_read(dev, 0xe); 30 - val &= ~(0x1 << 8); 31 - phy_write(dev, 0xe, val); 32 - 33 - return 0; 34 - } 35 - 36 17 static int bcm54220_phy_fixup(struct phy_device *dev) 37 18 { 38 19 /* enable RXC skew select RGMII copper mode */ ··· 25 44 return 0; 26 45 } 27 46 28 - #define PHY_ID_AR8031 0x004dd074 29 47 #define PHY_ID_BCM54220 0x600d8589 30 48 31 49 static void __init imx7d_enet_phy_init(void) 32 50 { 33 51 if (IS_BUILTIN(CONFIG_PHYLIB)) { 34 - phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff, 35 - ar8031_phy_fixup); 36 52 phy_register_fixup_for_uid(PHY_ID_BCM54220, 0xffffffff, 37 53 bcm54220_phy_fixup); 38 54 } ··· 69 91 static void __init imx7d_init_irq(void) 70 92 { 71 93 imx_init_revision_from_anatop(); 72 - imx_src_init(); 94 + imx7_src_init(); 73 95 irqchip_init(); 74 96 } 75 97 ··· 80 102 }; 81 103 82 104 DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual (Device Tree)") 105 + .smp = smp_ops(imx7_smp_ops), 83 106 .init_irq = imx7d_init_irq, 84 107 .init_machine = imx7d_init_machine, 85 108 .init_late = imx7d_init_late,
+26
arch/arm/mach-imx/platsmp.c
··· 92 92 #endif 93 93 }; 94 94 95 + /* 96 + * Initialise the CPU possible map early - this describes the CPUs 97 + * which may be present or become present in the system. 98 + */ 99 + static void __init imx7_smp_init_cpus(void) 100 + { 101 + struct device_node *np; 102 + int i, ncores = 0; 103 + 104 + /* The iMX7D SCU does not report core count, get it from DT */ 105 + for_each_of_cpu_node(np) 106 + ncores++; 107 + 108 + for (i = ncores; i < NR_CPUS; i++) 109 + set_cpu_possible(i, false); 110 + } 111 + 112 + const struct smp_operations imx7_smp_ops __initconst = { 113 + .smp_init_cpus = imx7_smp_init_cpus, 114 + .smp_boot_secondary = imx_boot_secondary, 115 + #ifdef CONFIG_HOTPLUG_CPU 116 + .cpu_die = imx_cpu_die, 117 + .cpu_kill = imx_cpu_kill, 118 + #endif 119 + }; 120 + 95 121 #define DCFG_CCSR_SCRATCHRW1 0x200 96 122 97 123 static int ls1021a_boot_secondary(unsigned int cpu, struct task_struct *idle)
+92 -9
arch/arm/mach-imx/src.c
··· 6 6 7 7 #include <linux/init.h> 8 8 #include <linux/io.h> 9 + #include <linux/iopoll.h> 9 10 #include <linux/of.h> 10 11 #include <linux/of_address.h> 11 12 #include <linux/reset-controller.h> 12 13 #include <linux/smp.h> 13 14 #include <asm/smp_plat.h> 14 15 #include "common.h" 16 + #include "hardware.h" 15 17 16 18 #define SRC_SCR 0x000 17 - #define SRC_GPR1 0x020 19 + #define SRC_GPR1_V1 0x020 20 + #define SRC_GPR1_V2 0x074 21 + #define SRC_GPR1(gpr_v2) ((gpr_v2) ? SRC_GPR1_V2 : SRC_GPR1_V1) 18 22 #define BP_SRC_SCR_WARM_RESET_ENABLE 0 19 23 #define BP_SRC_SCR_SW_GPU_RST 1 20 24 #define BP_SRC_SCR_SW_VPU_RST 2 ··· 27 23 #define BP_SRC_SCR_SW_IPU2_RST 12 28 24 #define BP_SRC_SCR_CORE1_RST 14 29 25 #define BP_SRC_SCR_CORE1_ENABLE 22 26 + /* below is for i.MX7D */ 27 + #define SRC_A7RCR1 0x008 28 + #define BP_SRC_A7RCR1_A7_CORE1_ENABLE 1 29 + #define GPC_CPU_PGC_SW_PUP_REQ 0xf0 30 + #define GPC_CPU_PGC_SW_PDN_REQ 0xfc 31 + #define GPC_PGC_C1 0x840 32 + #define BM_CPU_PGC_SW_PDN_PUP_REQ_CORE1_A7 0x2 30 33 31 34 static void __iomem *src_base; 32 35 static DEFINE_SPINLOCK(scr_lock); 36 + static bool gpr_v2; 37 + static void __iomem *gpc_base; 33 38 34 39 static const int sw_reset_bits[5] = { 35 40 BP_SRC_SCR_SW_GPU_RST, ··· 86 73 .nr_resets = ARRAY_SIZE(sw_reset_bits), 87 74 }; 88 75 76 + static void imx_gpcv2_set_m_core_pgc(bool enable, u32 offset) 77 + { 78 + writel_relaxed(enable, gpc_base + offset); 79 + } 80 + 81 + /* 82 + * The motivation for bringing up the second i.MX7D core inside the kernel 83 + * is that legacy vendor bootloaders usually do not implement PSCI support. 84 + * This is a significant blocker for systems in the field that are running old 85 + * bootloader versions to upgrade to a modern mainline kernel version, as only 86 + * one CPU of the i.MX7D would be brought up. 87 + * Bring up the second i.MX7D core inside the kernel to make the migration 88 + * path to mainline kernel easier for the existing iMX7D users. 89 + */ 90 + void imx_gpcv2_set_core1_pdn_pup_by_software(bool pdn) 91 + { 92 + u32 reg = pdn ? GPC_CPU_PGC_SW_PDN_REQ : GPC_CPU_PGC_SW_PUP_REQ; 93 + u32 val, pup; 94 + int ret; 95 + 96 + imx_gpcv2_set_m_core_pgc(true, GPC_PGC_C1); 97 + val = readl_relaxed(gpc_base + reg); 98 + val |= BM_CPU_PGC_SW_PDN_PUP_REQ_CORE1_A7; 99 + writel_relaxed(val, gpc_base + reg); 100 + 101 + ret = readl_relaxed_poll_timeout_atomic(gpc_base + reg, pup, 102 + !(pup & BM_CPU_PGC_SW_PDN_PUP_REQ_CORE1_A7), 103 + 5, 1000000); 104 + if (ret < 0) { 105 + pr_err("i.MX7D: CORE1_A7 power up timeout\n"); 106 + val &= ~BM_CPU_PGC_SW_PDN_PUP_REQ_CORE1_A7; 107 + writel_relaxed(val, gpc_base + reg); 108 + } 109 + 110 + imx_gpcv2_set_m_core_pgc(false, GPC_PGC_C1); 111 + } 112 + 89 113 void imx_enable_cpu(int cpu, bool enable) 90 114 { 91 115 u32 mask, val; 92 116 93 117 cpu = cpu_logical_map(cpu); 94 - mask = 1 << (BP_SRC_SCR_CORE1_ENABLE + cpu - 1); 95 118 spin_lock(&scr_lock); 96 - val = readl_relaxed(src_base + SRC_SCR); 97 - val = enable ? val | mask : val & ~mask; 98 - val |= 1 << (BP_SRC_SCR_CORE1_RST + cpu - 1); 99 - writel_relaxed(val, src_base + SRC_SCR); 119 + if (gpr_v2) { 120 + if (enable) 121 + imx_gpcv2_set_core1_pdn_pup_by_software(false); 122 + 123 + mask = 1 << (BP_SRC_A7RCR1_A7_CORE1_ENABLE + cpu - 1); 124 + val = readl_relaxed(src_base + SRC_A7RCR1); 125 + val = enable ? val | mask : val & ~mask; 126 + writel_relaxed(val, src_base + SRC_A7RCR1); 127 + } else { 128 + mask = 1 << (BP_SRC_SCR_CORE1_ENABLE + cpu - 1); 129 + val = readl_relaxed(src_base + SRC_SCR); 130 + val = enable ? val | mask : val & ~mask; 131 + val |= 1 << (BP_SRC_SCR_CORE1_RST + cpu - 1); 132 + writel_relaxed(val, src_base + SRC_SCR); 133 + } 100 134 spin_unlock(&scr_lock); 101 135 } 102 136 ··· 151 91 { 152 92 cpu = cpu_logical_map(cpu); 153 93 writel_relaxed(__pa_symbol(jump_addr), 154 - src_base + SRC_GPR1 + cpu * 8); 94 + src_base + SRC_GPR1(gpr_v2) + cpu * 8); 155 95 } 156 96 157 97 u32 imx_get_cpu_arg(int cpu) 158 98 { 159 99 cpu = cpu_logical_map(cpu); 160 - return readl_relaxed(src_base + SRC_GPR1 + cpu * 8 + 4); 100 + return readl_relaxed(src_base + SRC_GPR1(gpr_v2) + cpu * 8 + 4); 161 101 } 162 102 163 103 void imx_set_cpu_arg(int cpu, u32 arg) 164 104 { 165 105 cpu = cpu_logical_map(cpu); 166 - writel_relaxed(arg, src_base + SRC_GPR1 + cpu * 8 + 4); 106 + writel_relaxed(arg, src_base + SRC_GPR1(gpr_v2) + cpu * 8 + 4); 167 107 } 168 108 169 109 void __init imx_src_init(void) ··· 190 130 val &= ~(1 << BP_SRC_SCR_WARM_RESET_ENABLE); 191 131 writel_relaxed(val, src_base + SRC_SCR); 192 132 spin_unlock(&scr_lock); 133 + } 134 + 135 + void __init imx7_src_init(void) 136 + { 137 + struct device_node *np; 138 + 139 + gpr_v2 = true; 140 + 141 + np = of_find_compatible_node(NULL, NULL, "fsl,imx7d-src"); 142 + if (!np) 143 + return; 144 + 145 + src_base = of_iomap(np, 0); 146 + if (!src_base) 147 + return; 148 + 149 + np = of_find_compatible_node(NULL, NULL, "fsl,imx7d-gpc"); 150 + if (!np) 151 + return; 152 + 153 + gpc_base = of_iomap(np, 0); 154 + if (!gpc_base) 155 + return; 193 156 }
+2 -2
arch/arm/mach-imx/suspend-imx53.S
··· 28 28 * ^ 29 29 * ^ 30 30 * imx53_suspend code 31 - * PM_INFO structure(imx53_suspend_info) 31 + * PM_INFO structure(imx5_cpu_suspend_info) 32 32 * ======================== low address ======================= 33 33 */ 34 34 35 - /* Offsets of members of struct imx53_suspend_info */ 35 + /* Offsets of members of struct imx5_cpu_suspend_info */ 36 36 #define SUSPEND_INFO_MX53_M4IF_V_OFFSET 0x0 37 37 #define SUSPEND_INFO_MX53_IOMUXC_V_OFFSET 0x4 38 38 #define SUSPEND_INFO_MX53_IO_COUNT_OFFSET 0x8
+22 -13
arch/arm/mach-ixp4xx/Kconfig
··· 7 7 8 8 config MACH_IXP4XX_OF 9 9 bool 10 - prompt "Devce Tree IXP4xx boards" 10 + prompt "Device Tree IXP4xx boards" 11 11 default y 12 12 select ARM_APPENDED_DTB # Old Redboot bootloaders deployed 13 13 select I2C ··· 20 20 config MACH_NSLU2 21 21 bool 22 22 prompt "Linksys NSLU2" 23 - select FORCE_PCI 23 + depends on IXP4XX_PCI_LEGACY 24 24 help 25 25 Say 'Y' here if you want your kernel to support Linksys's 26 26 NSLU2 NAS device. For more information on this platform, ··· 28 28 29 29 config MACH_AVILA 30 30 bool "Avila" 31 - select FORCE_PCI 31 + depends on IXP4XX_PCI_LEGACY 32 32 help 33 33 Say 'Y' here if you want your kernel to support the Gateworks 34 34 Avila Network Platform. For more information on this platform, ··· 44 44 45 45 config ARCH_ADI_COYOTE 46 46 bool "Coyote" 47 - select FORCE_PCI 47 + depends on IXP4XX_PCI_LEGACY 48 48 help 49 49 Say 'Y' here if you want your kernel to support the ADI 50 50 Engineering Coyote Gateway Reference Platform. For more ··· 52 52 53 53 config MACH_GATEWAY7001 54 54 bool "Gateway 7001" 55 - select FORCE_PCI 55 + depends on IXP4XX_PCI_LEGACY 56 56 help 57 57 Say 'Y' here if you want your kernel to support Gateway's 58 58 7001 Access Point. For more information on this platform, ··· 60 60 61 61 config MACH_WG302V2 62 62 bool "Netgear WG302 v2 / WAG302 v2" 63 - select FORCE_PCI 63 + depends on IXP4XX_PCI_LEGACY 64 64 help 65 65 Say 'Y' here if you want your kernel to support Netgear's 66 66 WG302 v2 or WAG302 v2 Access Points. For more information ··· 68 68 69 69 config ARCH_IXDP425 70 70 bool "IXDP425" 71 + depends on IXP4XX_PCI_LEGACY 71 72 help 72 73 Say 'Y' here if you want your kernel to support Intel's 73 74 IXDP425 Development Platform (Also known as Richfield). ··· 76 75 77 76 config MACH_IXDPG425 78 77 bool "IXDPG425" 78 + depends on IXP4XX_PCI_LEGACY 79 79 help 80 80 Say 'Y' here if you want your kernel to support Intel's 81 81 IXDPG425 Development Platform (Also known as Montajade). ··· 122 120 config MACH_NAS100D 123 121 bool 124 122 prompt "NAS100D" 125 - select FORCE_PCI 123 + depends on IXP4XX_PCI_LEGACY 126 124 help 127 125 Say 'Y' here if you want your kernel to support Iomega's 128 126 NAS 100d device. For more information on this platform, ··· 131 129 config MACH_DSMG600 132 130 bool 133 131 prompt "D-Link DSM-G600 RevA" 134 - select FORCE_PCI 132 + depends on IXP4XX_PCI_LEGACY 135 133 help 136 134 Say 'Y' here if you want your kernel to support D-Link's 137 135 DSM-G600 RevA device. For more information on this platform, ··· 145 143 config MACH_FSG 146 144 bool 147 145 prompt "Freecom FSG-3" 148 - select FORCE_PCI 146 + depends on IXP4XX_PCI_LEGACY 149 147 help 150 148 Say 'Y' here if you want your kernel to support Freecom's 151 149 FSG-3 device. For more information on this platform, ··· 154 152 config MACH_ARCOM_VULCAN 155 153 bool 156 154 prompt "Arcom/Eurotech Vulcan" 157 - select FORCE_PCI 155 + depends on IXP4XX_PCI_LEGACY 158 156 help 159 157 Say 'Y' here if you want your kernel to support Arcom's 160 158 Vulcan board. ··· 175 173 config MACH_GTWX5715 176 174 bool "Gemtek WX5715 (Linksys WRV54G)" 177 175 depends on ARCH_IXP4XX 178 - select FORCE_PCI 176 + depends on IXP4XX_PCI_LEGACY 179 177 help 180 178 This board is currently inside the Linksys WRV54G Gateways. 181 179 ··· 198 196 199 197 config MACH_MICCPT 200 198 bool "Omicron MICCPT" 201 - select FORCE_PCI 199 + depends on IXP4XX_PCI_LEGACY 202 200 help 203 201 Say 'Y' here if you want your kernel to support the MICCPT 204 202 board from OMICRON electronics GmbH. ··· 211 209 212 210 comment "IXP4xx Options" 213 211 212 + config IXP4XX_PCI_LEGACY 213 + bool "IXP4xx legacy PCI driver support" 214 + depends on PCI 215 + help 216 + Selects legacy PCI driver. 217 + Not recommended for new development. 218 + 214 219 config IXP4XX_INDIRECT_PCI 215 220 bool "Use indirect PCI memory access" 216 - depends on PCI 221 + depends on IXP4XX_PCI_LEGACY 217 222 help 218 223 IXP4xx provides two methods of accessing PCI memory space: 219 224
+1
arch/arm/mach-ixp4xx/avila-setup.c
··· 19 19 #include <linux/tty.h> 20 20 #include <linux/serial_8250.h> 21 21 #include <linux/gpio/machine.h> 22 + #include <linux/platform_data/pata_ixp4xx_cf.h> 22 23 #include <asm/types.h> 23 24 #include <asm/setup.h> 24 25 #include <asm/memory.h>
+45 -2
arch/arm/mach-ixp4xx/common.c
··· 27 27 #include <linux/cpu.h> 28 28 #include <linux/pci.h> 29 29 #include <linux/sched_clock.h> 30 + #include <linux/soc/ixp4xx/cpu.h> 30 31 #include <linux/irqchip/irq-ixp4xx.h> 31 32 #include <linux/platform_data/timer-ixp4xx.h> 32 33 #include <linux/dma-map-ops.h> 33 34 #include <mach/udc.h> 34 35 #include <mach/hardware.h> 35 - #include <mach/io.h> 36 36 #include <linux/uaccess.h> 37 37 #include <asm/page.h> 38 38 #include <asm/exception.h> ··· 43 43 #include <asm/mach/time.h> 44 44 45 45 #include "irqs.h" 46 + 47 + u32 ixp4xx_read_feature_bits(void) 48 + { 49 + u32 val = ~__raw_readl(IXP4XX_EXP_CFG2); 50 + 51 + if (cpu_is_ixp42x_rev_a0()) 52 + return IXP42X_FEATURE_MASK & ~(IXP4XX_FEATURE_RCOMP | 53 + IXP4XX_FEATURE_AES); 54 + if (cpu_is_ixp42x()) 55 + return val & IXP42X_FEATURE_MASK; 56 + if (cpu_is_ixp43x()) 57 + return val & IXP43X_FEATURE_MASK; 58 + return val & IXP46X_FEATURE_MASK; 59 + } 60 + EXPORT_SYMBOL(ixp4xx_read_feature_bits); 61 + 62 + void ixp4xx_write_feature_bits(u32 value) 63 + { 64 + __raw_writel(~value, IXP4XX_EXP_CFG2); 65 + } 66 + EXPORT_SYMBOL(ixp4xx_write_feature_bits); 46 67 47 68 #define IXP4XX_TIMER_FREQ 66666000 48 69 ··· 236 215 } 237 216 }; 238 217 218 + /* A single 32-bit register on IXP46x */ 219 + #define IXP4XX_HWRANDOM_BASE_PHYS 0x70002100 220 + 221 + static struct resource ixp46x_hwrandom_resource[] = { 222 + { 223 + .start = IXP4XX_HWRANDOM_BASE_PHYS, 224 + .end = IXP4XX_HWRANDOM_BASE_PHYS + 0x3, 225 + .flags = IORESOURCE_MEM, 226 + }, 227 + }; 228 + 229 + static struct platform_device ixp46x_hwrandom_device = { 230 + .name = "ixp4xx-hwrandom", 231 + .id = -1, 232 + .dev = { 233 + .coherent_dma_mask = DMA_BIT_MASK(32), 234 + }, 235 + .resource = ixp46x_hwrandom_resource, 236 + .num_resources = ARRAY_SIZE(ixp46x_hwrandom_resource), 237 + }; 238 + 239 239 /* 240 240 * I2C controller. The IXP46x uses the same block as the IOP3xx, so 241 241 * we just use the same device name. ··· 269 227 }; 270 228 271 229 static struct platform_device *ixp46x_devices[] __initdata = { 272 - &ixp46x_i2c_controller 230 + &ixp46x_hwrandom_device, 231 + &ixp46x_i2c_controller, 273 232 }; 274 233 275 234 unsigned long ixp4xx_exp_bus_size;
+1
arch/arm/mach-ixp4xx/fsg-setup.c
··· 28 28 #include <asm/mach-types.h> 29 29 #include <asm/mach/arch.h> 30 30 #include <asm/mach/flash.h> 31 + #include <mach/hardware.h> 31 32 32 33 #include "irqs.h" 33 34
-54
arch/arm/mach-ixp4xx/include/mach/cpu.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * arch/arm/mach-ixp4xx/include/mach/cpu.h 4 - * 5 - * IXP4XX cpu type detection 6 - * 7 - * Copyright (C) 2007 MontaVista Software, Inc. 8 - */ 9 - 10 - #ifndef __ASM_ARCH_CPU_H__ 11 - #define __ASM_ARCH_CPU_H__ 12 - 13 - #include <linux/io.h> 14 - #include <asm/cputype.h> 15 - 16 - /* Processor id value in CP15 Register 0 */ 17 - #define IXP42X_PROCESSOR_ID_VALUE 0x690541c0 /* including unused 0x690541Ex */ 18 - #define IXP42X_PROCESSOR_ID_MASK 0xffffffc0 19 - 20 - #define IXP43X_PROCESSOR_ID_VALUE 0x69054040 21 - #define IXP43X_PROCESSOR_ID_MASK 0xfffffff0 22 - 23 - #define IXP46X_PROCESSOR_ID_VALUE 0x69054200 /* including IXP455 */ 24 - #define IXP46X_PROCESSOR_ID_MASK 0xfffffff0 25 - 26 - #define cpu_is_ixp42x_rev_a0() ((read_cpuid_id() & (IXP42X_PROCESSOR_ID_MASK | 0xF)) == \ 27 - IXP42X_PROCESSOR_ID_VALUE) 28 - #define cpu_is_ixp42x() ((read_cpuid_id() & IXP42X_PROCESSOR_ID_MASK) == \ 29 - IXP42X_PROCESSOR_ID_VALUE) 30 - #define cpu_is_ixp43x() ((read_cpuid_id() & IXP43X_PROCESSOR_ID_MASK) == \ 31 - IXP43X_PROCESSOR_ID_VALUE) 32 - #define cpu_is_ixp46x() ((read_cpuid_id() & IXP46X_PROCESSOR_ID_MASK) == \ 33 - IXP46X_PROCESSOR_ID_VALUE) 34 - 35 - static inline u32 ixp4xx_read_feature_bits(void) 36 - { 37 - u32 val = ~__raw_readl(IXP4XX_EXP_CFG2); 38 - 39 - if (cpu_is_ixp42x_rev_a0()) 40 - return IXP42X_FEATURE_MASK & ~(IXP4XX_FEATURE_RCOMP | 41 - IXP4XX_FEATURE_AES); 42 - if (cpu_is_ixp42x()) 43 - return val & IXP42X_FEATURE_MASK; 44 - if (cpu_is_ixp43x()) 45 - return val & IXP43X_FEATURE_MASK; 46 - return val & IXP46X_FEATURE_MASK; 47 - } 48 - 49 - static inline void ixp4xx_write_feature_bits(u32 value) 50 - { 51 - __raw_writel(~value, IXP4XX_EXP_CFG2); 52 - } 53 - 54 - #endif /* _ASM_ARCH_CPU_H */
+1 -1
arch/arm/mach-ixp4xx/include/mach/hardware.h
··· 23 23 #include "ixp4xx-regs.h" 24 24 25 25 #ifndef __ASSEMBLER__ 26 - #include <mach/cpu.h> 26 + #include <linux/soc/ixp4xx/cpu.h> 27 27 #endif 28 28 29 29 /* Platform helper functions and definitions */
+4 -57
arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
··· 45 45 * it can be used with the low-level debug code. 46 46 */ 47 47 #define IXP4XX_PERIPHERAL_BASE_PHYS 0xC8000000 48 - #define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFEF00000) 48 + #define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFEC00000) 49 49 #define IXP4XX_PERIPHERAL_REGION_SIZE 0x00013000 50 50 51 51 /* 52 52 * PCI Config registers 53 53 */ 54 54 #define IXP4XX_PCI_CFG_BASE_PHYS 0xC0000000 55 - #define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFEF13000) 55 + #define IXP4XX_PCI_CFG_BASE_VIRT IOMEM(0xFEC13000) 56 56 #define IXP4XX_PCI_CFG_REGION_SIZE 0x00001000 57 57 58 58 /* 59 59 * Expansion BUS Configuration registers 60 60 */ 61 61 #define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000 62 - #define IXP4XX_EXP_CFG_BASE_VIRT 0xFEF14000 62 + #define IXP4XX_EXP_CFG_BASE_VIRT 0xFEC14000 63 63 #define IXP4XX_EXP_CFG_REGION_SIZE 0x00001000 64 64 65 65 #define IXP4XX_EXP_CS0_OFFSET 0x00 ··· 120 120 #define IXP4XX_SSP_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x12000) 121 121 122 122 123 + /* The UART is explicitly put in the beginning of fixmap */ 123 124 #define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000) 124 125 #define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000) 125 126 #define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000) ··· 299 298 #define CRP_AD_CBE_WRITE 0x00010000 300 299 301 300 #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ 302 - 303 - /* "fuse" bits of IXP_EXP_CFG2 */ 304 - /* All IXP4xx CPUs */ 305 - #define IXP4XX_FEATURE_RCOMP (1 << 0) 306 - #define IXP4XX_FEATURE_USB_DEVICE (1 << 1) 307 - #define IXP4XX_FEATURE_HASH (1 << 2) 308 - #define IXP4XX_FEATURE_AES (1 << 3) 309 - #define IXP4XX_FEATURE_DES (1 << 4) 310 - #define IXP4XX_FEATURE_HDLC (1 << 5) 311 - #define IXP4XX_FEATURE_AAL (1 << 6) 312 - #define IXP4XX_FEATURE_HSS (1 << 7) 313 - #define IXP4XX_FEATURE_UTOPIA (1 << 8) 314 - #define IXP4XX_FEATURE_NPEB_ETH0 (1 << 9) 315 - #define IXP4XX_FEATURE_NPEC_ETH (1 << 10) 316 - #define IXP4XX_FEATURE_RESET_NPEA (1 << 11) 317 - #define IXP4XX_FEATURE_RESET_NPEB (1 << 12) 318 - #define IXP4XX_FEATURE_RESET_NPEC (1 << 13) 319 - #define IXP4XX_FEATURE_PCI (1 << 14) 320 - #define IXP4XX_FEATURE_UTOPIA_PHY_LIMIT (3 << 16) 321 - #define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22) 322 - #define IXP42X_FEATURE_MASK (IXP4XX_FEATURE_RCOMP | \ 323 - IXP4XX_FEATURE_USB_DEVICE | \ 324 - IXP4XX_FEATURE_HASH | \ 325 - IXP4XX_FEATURE_AES | \ 326 - IXP4XX_FEATURE_DES | \ 327 - IXP4XX_FEATURE_HDLC | \ 328 - IXP4XX_FEATURE_AAL | \ 329 - IXP4XX_FEATURE_HSS | \ 330 - IXP4XX_FEATURE_UTOPIA | \ 331 - IXP4XX_FEATURE_NPEB_ETH0 | \ 332 - IXP4XX_FEATURE_NPEC_ETH | \ 333 - IXP4XX_FEATURE_RESET_NPEA | \ 334 - IXP4XX_FEATURE_RESET_NPEB | \ 335 - IXP4XX_FEATURE_RESET_NPEC | \ 336 - IXP4XX_FEATURE_PCI | \ 337 - IXP4XX_FEATURE_UTOPIA_PHY_LIMIT | \ 338 - IXP4XX_FEATURE_XSCALE_MAX_FREQ) 339 - 340 - 341 - /* IXP43x/46x CPUs */ 342 - #define IXP4XX_FEATURE_ECC_TIMESYNC (1 << 15) 343 - #define IXP4XX_FEATURE_USB_HOST (1 << 18) 344 - #define IXP4XX_FEATURE_NPEA_ETH (1 << 19) 345 - #define IXP43X_FEATURE_MASK (IXP42X_FEATURE_MASK | \ 346 - IXP4XX_FEATURE_ECC_TIMESYNC | \ 347 - IXP4XX_FEATURE_USB_HOST | \ 348 - IXP4XX_FEATURE_NPEA_ETH) 349 - 350 - /* IXP46x CPU (including IXP455) only */ 351 - #define IXP4XX_FEATURE_NPEB_ETH_1_TO_3 (1 << 20) 352 - #define IXP4XX_FEATURE_RSA (1 << 21) 353 - #define IXP46X_FEATURE_MASK (IXP43X_FEATURE_MASK | \ 354 - IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \ 355 - IXP4XX_FEATURE_RSA) 356 301 357 302 #endif
-14
arch/arm/mach-ixp4xx/include/mach/platform.h
··· 80 80 #define IXP4XX_UART_XTAL 14745600 81 81 82 82 /* 83 - * This structure provide a means for the board setup code 84 - * to give information to th pata_ixp4xx driver. It is 85 - * passed as platform_data. 86 - */ 87 - struct ixp4xx_pata_data { 88 - volatile u32 *cs0_cfg; 89 - volatile u32 *cs1_cfg; 90 - unsigned long cs0_bits; 91 - unsigned long cs1_bits; 92 - void __iomem *cs0; 93 - void __iomem *cs1; 94 - }; 95 - 96 - /* 97 83 * Frequency of clock used for primary clocksource 98 84 */ 99 85 extern unsigned long ixp4xx_timer_freq;
+6 -2
arch/arm/mach-ixp4xx/ixp4xx-of.c
··· 9 9 #include <asm/mach/arch.h> 10 10 #include <asm/mach/map.h> 11 11 12 - #include <mach/hardware.h> 13 - #include <mach/ixp4xx-regs.h> 12 + /* 13 + * These are the only fixed phys to virt mappings we ever need 14 + * we put it right after the UART mapping at 0xffc80000-0xffc81fff 15 + */ 16 + #define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000 17 + #define IXP4XX_EXP_CFG_BASE_VIRT 0xFEC14000 14 18 15 19 static struct map_desc ixp4xx_of_io_desc[] __initdata = { 16 20 /*
+1
arch/arm/mach-ixp4xx/nas100d-setup.c
··· 33 33 #include <asm/mach-types.h> 34 34 #include <asm/mach/arch.h> 35 35 #include <asm/mach/flash.h> 36 + #include <mach/hardware.h> 36 37 37 38 #include "irqs.h" 38 39
+1
arch/arm/mach-ixp4xx/nslu2-setup.c
··· 31 31 #include <asm/mach/arch.h> 32 32 #include <asm/mach/flash.h> 33 33 #include <asm/mach/time.h> 34 + #include <mach/hardware.h> 34 35 35 36 #include "irqs.h" 36 37
+6 -6
arch/arm/mach-omap1/Kconfig
··· 65 65 config MACH_OMAP_H2 66 66 bool "TI H2 Support" 67 67 depends on ARCH_OMAP16XX 68 - help 68 + help 69 69 TI OMAP 1610/1611B H2 board support. Say Y here if you have such 70 70 a board. 71 71 72 72 config MACH_OMAP_H3 73 73 bool "TI H3 Support" 74 74 depends on ARCH_OMAP16XX 75 - help 75 + help 76 76 TI OMAP 1710 H3 board support. Say Y here if you have such 77 77 a board. 78 78 ··· 85 85 config MACH_OMAP_OSK 86 86 bool "TI OSK Support" 87 87 depends on ARCH_OMAP16XX 88 - help 88 + help 89 89 TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here 90 90 if you have such a board. 91 91 92 92 config OMAP_OSK_MISTRAL 93 93 bool "Mistral QVGA board Support" 94 94 depends on MACH_OMAP_OSK 95 - help 95 + help 96 96 The OSK supports an optional add-on board with a Quarter-VGA 97 97 touchscreen, PDA-ish buttons, a resume button, bicolor LED, 98 98 and camera connector. Say Y here if you have this board. ··· 100 100 config MACH_OMAP_PERSEUS2 101 101 bool "TI Perseus2" 102 102 depends on ARCH_OMAP730 103 - help 103 + help 104 104 Support for TI OMAP 730 Perseus2 board. Say Y here if you have such 105 105 a board. 106 106 107 107 config MACH_OMAP_FSAMPLE 108 108 bool "TI F-Sample" 109 109 depends on ARCH_OMAP730 110 - help 110 + help 111 111 Support for TI OMAP 850 F-Sample board. Say Y here if you have such 112 112 a board. 113 113
-1
arch/arm/mach-omap2/cm.h
··· 26 26 27 27 extern struct omap_domain_base cm_base; 28 28 extern struct omap_domain_base cm2_base; 29 - extern void omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2); 30 29 # endif 31 30 32 31 /*
-13
arch/arm/mach-omap2/cm_common.c
··· 38 38 #define CM_SINGLE_INSTANCE 0x2 39 39 40 40 /** 41 - * omap2_set_globals_cm - set the CM/CM2 base addresses (for early use) 42 - * @cm: CM base virtual address 43 - * @cm2: CM2 base virtual address (if present on the booted SoC) 44 - * 45 - * XXX Will be replaced when the PRM/CM drivers are completed. 46 - */ 47 - void __init omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2) 48 - { 49 - cm_base.va = cm; 50 - cm2_base.va = cm2; 51 - } 52 - 53 - /** 54 41 * cm_split_idlest_reg - split CM_IDLEST reg addr into its components 55 42 * @idlest_reg: CM_IDLEST* virtual address 56 43 * @prcm_inst: pointer to an s16 to return the PRCM instance offset
-1
arch/arm/mach-omap2/common.h
··· 130 130 void am35xx_init_early(void); 131 131 void ti814x_init_early(void); 132 132 void ti816x_init_early(void); 133 - void am33xx_init_early(void); 134 133 void am43xx_init_early(void); 135 134 void am43xx_init_late(void); 136 135 void omap4430_init_early(void);
-5
arch/arm/mach-omap2/control.c
··· 136 136 static struct omap3_control_regs control_context; 137 137 #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */ 138 138 139 - void __init omap2_set_globals_control(void __iomem *ctrl) 140 - { 141 - omap2_ctrl_base = ctrl; 142 - } 143 - 144 139 u8 omap_ctrl_readb(u16 offset) 145 140 { 146 141 u32 val;
-1
arch/arm/mach-omap2/control.h
··· 528 528 void omap3_ctrl_init(void); 529 529 int omap2_control_base_init(void); 530 530 int omap_control_init(void); 531 - void omap2_set_globals_control(void __iomem *ctrl); 532 531 void __init omap3_control_legacy_iomap_init(void); 533 532 #else 534 533 #define omap_ctrl_readb(x) 0
+40
arch/arm/mach-omap2/pm33xx-core.c
··· 8 8 9 9 #include <linux/cpuidle.h> 10 10 #include <linux/platform_data/pm33xx.h> 11 + #include <linux/suspend.h> 11 12 #include <asm/cpuidle.h> 12 13 #include <asm/smp_scu.h> 13 14 #include <asm/suspend.h> ··· 325 324 return NULL; 326 325 } 327 326 327 + #ifdef CONFIG_SUSPEND 328 + /* 329 + * Block system suspend initially. Later on pm33xx sets up it's own 330 + * platform_suspend_ops after probe. That depends also on loaded 331 + * wkup_m3_ipc and booted am335x-pm-firmware.elf. 332 + */ 333 + static int amx3_suspend_block(suspend_state_t state) 334 + { 335 + pr_warn("PM not initialized for pm33xx, wkup_m3_ipc, or am335x-pm-firmware.elf\n"); 336 + 337 + return -EINVAL; 338 + } 339 + 340 + static int amx3_pm_valid(suspend_state_t state) 341 + { 342 + switch (state) { 343 + case PM_SUSPEND_STANDBY: 344 + return 1; 345 + default: 346 + return 0; 347 + } 348 + } 349 + 350 + static const struct platform_suspend_ops amx3_blocked_pm_ops = { 351 + .begin = amx3_suspend_block, 352 + .valid = amx3_pm_valid, 353 + }; 354 + 355 + static void __init amx3_block_suspend(void) 356 + { 357 + suspend_set_ops(&amx3_blocked_pm_ops); 358 + } 359 + #else 360 + static inline void amx3_block_suspend(void) 361 + { 362 + } 363 + #endif /* CONFIG_SUSPEND */ 364 + 328 365 int __init amx3_common_pm_init(void) 329 366 { 330 367 struct am33xx_pm_platform_data *pdata; ··· 376 337 devinfo.size_data = sizeof(*pdata); 377 338 devinfo.id = -1; 378 339 platform_device_register_full(&devinfo); 340 + amx3_block_suspend(); 379 341 380 342 return 0; 381 343 }
-1
arch/arm/mach-s3c/mach-rx1950.c
··· 271 271 break; 272 272 default: 273 273 return -EINVAL; 274 - break; 275 274 } 276 275 277 276 if (delay_on && delay_off && !*delay_on && !*delay_off)
+1
arch/arm64/Kconfig.platforms
··· 16 16 select IRQ_FASTEOI_HIERARCHY_HANDLERS 17 17 select PINCTRL 18 18 select RESET_CONTROLLER 19 + select SUN4I_TIMER 19 20 help 20 21 This enables support for Allwinner sunxi based SoCs like the A64. 21 22
+1 -1
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts
··· 79 79 &emac { 80 80 pinctrl-names = "default"; 81 81 pinctrl-0 = <&rgmii_pins>; 82 - phy-mode = "rgmii-id"; 82 + phy-mode = "rgmii-txid"; 83 83 phy-handle = <&ext_rgmii_phy>; 84 84 phy-supply = <&reg_dc1sw>; 85 85 status = "okay";
+1 -1
arch/arm64/boot/dts/rockchip/rk3399.dtsi
··· 227 227 <&pcie_phy 2>, <&pcie_phy 3>; 228 228 phy-names = "pcie-phy-0", "pcie-phy-1", 229 229 "pcie-phy-2", "pcie-phy-3"; 230 - ranges = <0x83000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000>, 230 + ranges = <0x82000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000>, 231 231 <0x81000000 0x0 0xfbe00000 0x0 0xfbe00000 0x0 0x100000>; 232 232 resets = <&cru SRST_PCIE_CORE>, <&cru SRST_PCIE_MGMT>, 233 233 <&cru SRST_PCIE_MGMT_STICKY>, <&cru SRST_PCIE_PIPE>,
+1 -1
drivers/ata/Kconfig
··· 1058 1058 1059 1059 config PATA_IXP4XX_CF 1060 1060 tristate "IXP4XX Compact Flash support" 1061 - depends on ARCH_IXP4XX 1061 + depends on ARCH_IXP4XX || COMPILE_TEST 1062 1062 help 1063 1063 This option enables support for a Compact Flash connected on 1064 1064 the ixp4xx expansion bus. This driver had been written for
+1
drivers/ata/pata_ixp4xx_cf.c
··· 17 17 #include <linux/libata.h> 18 18 #include <linux/irq.h> 19 19 #include <linux/platform_device.h> 20 + #include <linux/platform_data/pata_ixp4xx_cf.h> 20 21 #include <scsi/scsi_host.h> 21 22 22 23 #define DRV_NAME "pata_ixp4xx_cf"
+1 -1
drivers/char/hw_random/Kconfig
··· 152 152 153 153 config HW_RANDOM_IXP4XX 154 154 tristate "Intel IXP4xx NPU HW Pseudo-Random Number Generator support" 155 - depends on ARCH_IXP4XX 155 + depends on ARCH_IXP4XX || COMPILE_TEST 156 156 default HW_RANDOM 157 157 help 158 158 This driver provides kernel-side support for the Pseudo-Random
+28 -25
drivers/char/hw_random/ixp4xx-rng.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * drivers/char/hw_random/ixp4xx-rng.c 3 4 * ··· 9 8 * Copyright 2005 (c) MontaVista Software, Inc. 10 9 * 11 10 * Fixes by Michael Buesch 12 - * 13 - * This file is licensed under the terms of the GNU General Public 14 - * License version 2. This program is licensed "as is" without any 15 - * warranty of any kind, whether express or implied. 16 11 */ 17 12 18 13 #include <linux/kernel.h> 19 14 #include <linux/types.h> 20 15 #include <linux/module.h> 21 16 #include <linux/moduleparam.h> 17 + #include <linux/platform_device.h> 22 18 #include <linux/init.h> 23 19 #include <linux/bitops.h> 24 20 #include <linux/hw_random.h> 21 + #include <linux/of.h> 22 + #include <linux/soc/ixp4xx/cpu.h> 25 23 26 24 #include <asm/io.h> 27 - #include <mach/hardware.h> 28 - 29 25 30 26 static int ixp4xx_rng_data_read(struct hwrng *rng, u32 *buffer) 31 27 { ··· 38 40 .data_read = ixp4xx_rng_data_read, 39 41 }; 40 42 41 - static int __init ixp4xx_rng_init(void) 43 + static int ixp4xx_rng_probe(struct platform_device *pdev) 42 44 { 43 45 void __iomem * rng_base; 44 - int err; 46 + struct device *dev = &pdev->dev; 47 + struct resource *res; 45 48 46 49 if (!cpu_is_ixp46x()) /* includes IXP455 */ 47 50 return -ENOSYS; 48 51 49 - rng_base = ioremap(0x70002100, 4); 50 - if (!rng_base) 51 - return -ENOMEM; 52 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 53 + rng_base = devm_ioremap_resource(dev, res); 54 + if (IS_ERR(rng_base)) 55 + return PTR_ERR(rng_base); 56 + 52 57 ixp4xx_rng_ops.priv = (unsigned long)rng_base; 53 - err = hwrng_register(&ixp4xx_rng_ops); 54 - if (err) 55 - iounmap(rng_base); 56 - 57 - return err; 58 + return devm_hwrng_register(dev, &ixp4xx_rng_ops); 58 59 } 59 60 60 - static void __exit ixp4xx_rng_exit(void) 61 - { 62 - void __iomem * rng_base = (void __iomem *)ixp4xx_rng_ops.priv; 61 + static const struct of_device_id ixp4xx_rng_of_match[] = { 62 + { 63 + .compatible = "intel,ixp46x-rng", 64 + }, 65 + {}, 66 + }; 67 + MODULE_DEVICE_TABLE(of, ixp4xx_rng_of_match); 63 68 64 - hwrng_unregister(&ixp4xx_rng_ops); 65 - iounmap(rng_base); 66 - } 67 - 68 - module_init(ixp4xx_rng_init); 69 - module_exit(ixp4xx_rng_exit); 69 + static struct platform_driver ixp4xx_rng_driver = { 70 + .driver = { 71 + .name = "ixp4xx-hwrandom", 72 + .of_match_table = ixp4xx_rng_of_match, 73 + }, 74 + .probe = ixp4xx_rng_probe, 75 + }; 76 + module_platform_driver(ixp4xx_rng_driver); 70 77 71 78 MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>"); 72 79 MODULE_DESCRIPTION("H/W Pseudo-Random Number Generator (RNG) driver for IXP45x/46x");
+4
drivers/crypto/ixp4xx_crypto.c
··· 31 31 #include <linux/soc/ixp4xx/npe.h> 32 32 #include <linux/soc/ixp4xx/qmgr.h> 33 33 34 + /* Intermittent includes, delete this after v5.14-rc1 */ 35 + #include <linux/soc/ixp4xx/cpu.h> 36 + #include <mach/ixp4xx-regs.h> 37 + 34 38 #define MAX_KEYLEN 32 35 39 36 40 /* hash: cfgword + 2 * digestlen; crypt: keylen + cfgword */
+2
drivers/net/ethernet/xscale/ixp4xx_eth.c
··· 37 37 #include <linux/module.h> 38 38 #include <linux/soc/ixp4xx/npe.h> 39 39 #include <linux/soc/ixp4xx/qmgr.h> 40 + #include <mach/hardware.h> 41 + #include <linux/soc/ixp4xx/cpu.h> 40 42 41 43 #include "ixp46x_ts.h" 42 44
+1 -2
drivers/net/ethernet/xscale/ptp_ixp46x.c
··· 12 12 #include <linux/io.h> 13 13 #include <linux/irq.h> 14 14 #include <linux/kernel.h> 15 - #include <linux/module.h> 16 - 17 15 #include <linux/ptp_clock_kernel.h> 16 + #include <linux/soc/ixp4xx/cpu.h> 18 17 19 18 #include "ixp46x_ts.h" 20 19
+1
drivers/net/wan/ixp4xx_hss.c
··· 22 22 #include <linux/slab.h> 23 23 #include <linux/soc/ixp4xx/npe.h> 24 24 #include <linux/soc/ixp4xx/qmgr.h> 25 + #include <linux/soc/ixp4xx/cpu.h> 25 26 26 27 #define DEBUG_DESC 0 27 28 #define DEBUG_RX 0
+8
drivers/pci/controller/Kconfig
··· 37 37 depends on OF 38 38 default ARCH_GEMINI 39 39 40 + config PCI_IXP4XX 41 + bool "Intel IXP4xx PCI controller" 42 + depends on ARM && OF 43 + default ARCH_IXP4XX 44 + help 45 + Say Y here if you want support for the PCI host controller found 46 + in the Intel IXP4xx XScale-based network processor SoC. 47 + 40 48 config PCI_TEGRA 41 49 bool "NVIDIA Tegra PCIe controller" 42 50 depends on ARCH_TEGRA || COMPILE_TEST
+1
drivers/pci/controller/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 obj-$(CONFIG_PCIE_CADENCE) += cadence/ 3 3 obj-$(CONFIG_PCI_FTPCI100) += pci-ftpci100.o 4 + obj-$(CONFIG_PCI_IXP4XX) += pci-ixp4xx.o 4 5 obj-$(CONFIG_PCI_HYPERV) += pci-hyperv.o 5 6 obj-$(CONFIG_PCI_HYPERV_INTERFACE) += pci-hyperv-intf.o 6 7 obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
+671
drivers/pci/controller/pci-ixp4xx.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Support for Intel IXP4xx PCI host controller 4 + * 5 + * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> 6 + * 7 + * Based on the IXP4xx arch/arm/mach-ixp4xx/common-pci.c driver 8 + * Copyright (C) 2002 Intel Corporation 9 + * Copyright (C) 2003 Greg Ungerer <gerg@linux-m68k.org> 10 + * Copyright (C) 2003-2004 MontaVista Software, Inc. 11 + * Copyright (C) 2005 Deepak Saxena <dsaxena@plexity.net> 12 + * Copyright (C) 2005 Alessandro Zummo <a.zummo@towertech.it> 13 + * 14 + * TODO: 15 + * - Test IO-space access 16 + * - DMA support 17 + */ 18 + 19 + #include <linux/init.h> 20 + #include <linux/io.h> 21 + #include <linux/kernel.h> 22 + #include <linux/of_address.h> 23 + #include <linux/of_device.h> 24 + #include <linux/of_pci.h> 25 + #include <linux/pci.h> 26 + #include <linux/platform_device.h> 27 + #include <linux/slab.h> 28 + #include <linux/bits.h> 29 + 30 + /* Register offsets */ 31 + #define IXP4XX_PCI_NP_AD 0x00 32 + #define IXP4XX_PCI_NP_CBE 0x04 33 + #define IXP4XX_PCI_NP_WDATA 0x08 34 + #define IXP4XX_PCI_NP_RDATA 0x0c 35 + #define IXP4XX_PCI_CRP_AD_CBE 0x10 36 + #define IXP4XX_PCI_CRP_WDATA 0x14 37 + #define IXP4XX_PCI_CRP_RDATA 0x18 38 + #define IXP4XX_PCI_CSR 0x1c 39 + #define IXP4XX_PCI_ISR 0x20 40 + #define IXP4XX_PCI_INTEN 0x24 41 + #define IXP4XX_PCI_DMACTRL 0x28 42 + #define IXP4XX_PCI_AHBMEMBASE 0x2c 43 + #define IXP4XX_PCI_AHBIOBASE 0x30 44 + #define IXP4XX_PCI_PCIMEMBASE 0x34 45 + #define IXP4XX_PCI_AHBDOORBELL 0x38 46 + #define IXP4XX_PCI_PCIDOORBELL 0x3c 47 + #define IXP4XX_PCI_ATPDMA0_AHBADDR 0x40 48 + #define IXP4XX_PCI_ATPDMA0_PCIADDR 0x44 49 + #define IXP4XX_PCI_ATPDMA0_LENADDR 0x48 50 + #define IXP4XX_PCI_ATPDMA1_AHBADDR 0x4c 51 + #define IXP4XX_PCI_ATPDMA1_PCIADDR 0x50 52 + #define IXP4XX_PCI_ATPDMA1_LENADDR 0x54 53 + 54 + /* CSR bit definitions */ 55 + #define IXP4XX_PCI_CSR_HOST BIT(0) 56 + #define IXP4XX_PCI_CSR_ARBEN BIT(1) 57 + #define IXP4XX_PCI_CSR_ADS BIT(2) 58 + #define IXP4XX_PCI_CSR_PDS BIT(3) 59 + #define IXP4XX_PCI_CSR_ABE BIT(4) 60 + #define IXP4XX_PCI_CSR_DBT BIT(5) 61 + #define IXP4XX_PCI_CSR_ASE BIT(8) 62 + #define IXP4XX_PCI_CSR_IC BIT(15) 63 + #define IXP4XX_PCI_CSR_PRST BIT(16) 64 + 65 + /* ISR (Interrupt status) Register bit definitions */ 66 + #define IXP4XX_PCI_ISR_PSE BIT(0) 67 + #define IXP4XX_PCI_ISR_PFE BIT(1) 68 + #define IXP4XX_PCI_ISR_PPE BIT(2) 69 + #define IXP4XX_PCI_ISR_AHBE BIT(3) 70 + #define IXP4XX_PCI_ISR_APDC BIT(4) 71 + #define IXP4XX_PCI_ISR_PADC BIT(5) 72 + #define IXP4XX_PCI_ISR_ADB BIT(6) 73 + #define IXP4XX_PCI_ISR_PDB BIT(7) 74 + 75 + /* INTEN (Interrupt Enable) Register bit definitions */ 76 + #define IXP4XX_PCI_INTEN_PSE BIT(0) 77 + #define IXP4XX_PCI_INTEN_PFE BIT(1) 78 + #define IXP4XX_PCI_INTEN_PPE BIT(2) 79 + #define IXP4XX_PCI_INTEN_AHBE BIT(3) 80 + #define IXP4XX_PCI_INTEN_APDC BIT(4) 81 + #define IXP4XX_PCI_INTEN_PADC BIT(5) 82 + #define IXP4XX_PCI_INTEN_ADB BIT(6) 83 + #define IXP4XX_PCI_INTEN_PDB BIT(7) 84 + 85 + /* Shift value for byte enable on NP cmd/byte enable register */ 86 + #define IXP4XX_PCI_NP_CBE_BESL 4 87 + 88 + /* PCI commands supported by NP access unit */ 89 + #define NP_CMD_IOREAD 0x2 90 + #define NP_CMD_IOWRITE 0x3 91 + #define NP_CMD_CONFIGREAD 0xa 92 + #define NP_CMD_CONFIGWRITE 0xb 93 + #define NP_CMD_MEMREAD 0x6 94 + #define NP_CMD_MEMWRITE 0x7 95 + 96 + /* Constants for CRP access into local config space */ 97 + #define CRP_AD_CBE_BESL 20 98 + #define CRP_AD_CBE_WRITE 0x00010000 99 + 100 + /* Special PCI configuration space registers for this controller */ 101 + #define IXP4XX_PCI_RTOTTO 0x40 102 + 103 + struct ixp4xx_pci { 104 + struct device *dev; 105 + void __iomem *base; 106 + bool errata_hammer; 107 + bool host_mode; 108 + }; 109 + 110 + /* 111 + * The IXP4xx has a peculiar address bus that will change the 112 + * byte order on SoC peripherals depending on whether the device 113 + * operates in big-endian or little-endian mode. That means that 114 + * readl() and writel() that always use little-endian access 115 + * will not work for SoC peripherals such as the PCI controller 116 + * when used in big-endian mode. The accesses to the individual 117 + * PCI devices on the other hand, are always little-endian and 118 + * can use readl() and writel(). 119 + * 120 + * For local AHB bus access we need to use __raw_[readl|writel]() 121 + * to make sure that we access the SoC devices in the CPU native 122 + * endianness. 123 + */ 124 + static inline u32 ixp4xx_readl(struct ixp4xx_pci *p, u32 reg) 125 + { 126 + return __raw_readl(p->base + reg); 127 + } 128 + 129 + static inline void ixp4xx_writel(struct ixp4xx_pci *p, u32 reg, u32 val) 130 + { 131 + __raw_writel(val, p->base + reg); 132 + } 133 + 134 + static int ixp4xx_pci_check_master_abort(struct ixp4xx_pci *p) 135 + { 136 + u32 isr = ixp4xx_readl(p, IXP4XX_PCI_ISR); 137 + 138 + if (isr & IXP4XX_PCI_ISR_PFE) { 139 + /* Make sure the master abort bit is reset */ 140 + ixp4xx_writel(p, IXP4XX_PCI_ISR, IXP4XX_PCI_ISR_PFE); 141 + dev_dbg(p->dev, "master abort detected\n"); 142 + return -EINVAL; 143 + } 144 + 145 + return 0; 146 + } 147 + 148 + static int ixp4xx_pci_read(struct ixp4xx_pci *p, u32 addr, u32 cmd, u32 *data) 149 + { 150 + ixp4xx_writel(p, IXP4XX_PCI_NP_AD, addr); 151 + 152 + if (p->errata_hammer) { 153 + int i; 154 + 155 + /* 156 + * PCI workaround - only works if NP PCI space reads have 157 + * no side effects. Hammer the register and read twice 8 158 + * times. last one will be good. 159 + */ 160 + for (i = 0; i < 8; i++) { 161 + ixp4xx_writel(p, IXP4XX_PCI_NP_CBE, cmd); 162 + *data = ixp4xx_readl(p, IXP4XX_PCI_NP_RDATA); 163 + *data = ixp4xx_readl(p, IXP4XX_PCI_NP_RDATA); 164 + } 165 + } else { 166 + ixp4xx_writel(p, IXP4XX_PCI_NP_CBE, cmd); 167 + *data = ixp4xx_readl(p, IXP4XX_PCI_NP_RDATA); 168 + } 169 + 170 + return ixp4xx_pci_check_master_abort(p); 171 + } 172 + 173 + static int ixp4xx_pci_write(struct ixp4xx_pci *p, u32 addr, u32 cmd, u32 data) 174 + { 175 + ixp4xx_writel(p, IXP4XX_PCI_NP_AD, addr); 176 + 177 + /* Set up the write */ 178 + ixp4xx_writel(p, IXP4XX_PCI_NP_CBE, cmd); 179 + 180 + /* Execute the write by writing to NP_WDATA */ 181 + ixp4xx_writel(p, IXP4XX_PCI_NP_WDATA, data); 182 + 183 + return ixp4xx_pci_check_master_abort(p); 184 + } 185 + 186 + static u32 ixp4xx_config_addr(u8 bus_num, u16 devfn, int where) 187 + { 188 + /* Root bus is always 0 in this hardware */ 189 + if (bus_num == 0) { 190 + /* type 0 */ 191 + return BIT(32-PCI_SLOT(devfn)) | ((PCI_FUNC(devfn)) << 8) | 192 + (where & ~3); 193 + } else { 194 + /* type 1 */ 195 + return (bus_num << 16) | ((PCI_SLOT(devfn)) << 11) | 196 + ((PCI_FUNC(devfn)) << 8) | (where & ~3) | 1; 197 + } 198 + } 199 + 200 + /* 201 + * CRP functions are "Controller Configuration Port" accesses 202 + * initiated from within this driver itself to read/write PCI 203 + * control information in the config space. 204 + */ 205 + static u32 ixp4xx_crp_byte_lane_enable_bits(u32 n, int size) 206 + { 207 + if (size == 1) 208 + return (0xf & ~BIT(n)) << CRP_AD_CBE_BESL; 209 + if (size == 2) 210 + return (0xf & ~(BIT(n) | BIT(n+1))) << CRP_AD_CBE_BESL; 211 + if (size == 4) 212 + return 0; 213 + return 0xffffffff; 214 + } 215 + 216 + static int ixp4xx_crp_read_config(struct ixp4xx_pci *p, int where, int size, 217 + u32 *value) 218 + { 219 + u32 n, cmd, val; 220 + 221 + n = where % 4; 222 + cmd = where & ~3; 223 + 224 + dev_dbg(p->dev, "%s from %d size %d cmd %08x\n", 225 + __func__, where, size, cmd); 226 + 227 + ixp4xx_writel(p, IXP4XX_PCI_CRP_AD_CBE, cmd); 228 + val = ixp4xx_readl(p, IXP4XX_PCI_CRP_RDATA); 229 + 230 + val >>= (8*n); 231 + switch (size) { 232 + case 1: 233 + val &= U8_MAX; 234 + dev_dbg(p->dev, "%s read byte %02x\n", __func__, val); 235 + break; 236 + case 2: 237 + val &= U16_MAX; 238 + dev_dbg(p->dev, "%s read word %04x\n", __func__, val); 239 + break; 240 + case 4: 241 + val &= U32_MAX; 242 + dev_dbg(p->dev, "%s read long %08x\n", __func__, val); 243 + break; 244 + default: 245 + /* Should not happen */ 246 + dev_err(p->dev, "%s illegal size\n", __func__); 247 + return PCIBIOS_DEVICE_NOT_FOUND; 248 + } 249 + *value = val; 250 + 251 + return PCIBIOS_SUCCESSFUL; 252 + } 253 + 254 + static int ixp4xx_crp_write_config(struct ixp4xx_pci *p, int where, int size, 255 + u32 value) 256 + { 257 + u32 n, cmd, val; 258 + 259 + n = where % 4; 260 + cmd = ixp4xx_crp_byte_lane_enable_bits(n, size); 261 + if (cmd == 0xffffffff) 262 + return PCIBIOS_BAD_REGISTER_NUMBER; 263 + cmd |= where & ~3; 264 + cmd |= CRP_AD_CBE_WRITE; 265 + 266 + val = value << (8*n); 267 + 268 + dev_dbg(p->dev, "%s to %d size %d cmd %08x val %08x\n", 269 + __func__, where, size, cmd, val); 270 + 271 + ixp4xx_writel(p, IXP4XX_PCI_CRP_AD_CBE, cmd); 272 + ixp4xx_writel(p, IXP4XX_PCI_CRP_WDATA, val); 273 + 274 + return PCIBIOS_SUCCESSFUL; 275 + } 276 + 277 + /* 278 + * Then follows the functions that read and write from the common PCI 279 + * configuration space. 280 + */ 281 + static u32 ixp4xx_byte_lane_enable_bits(u32 n, int size) 282 + { 283 + if (size == 1) 284 + return (0xf & ~BIT(n)) << 4; 285 + if (size == 2) 286 + return (0xf & ~(BIT(n) | BIT(n+1))) << 4; 287 + if (size == 4) 288 + return 0; 289 + return 0xffffffff; 290 + } 291 + 292 + static int ixp4xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, 293 + int where, int size, u32 *value) 294 + { 295 + struct ixp4xx_pci *p = bus->sysdata; 296 + u32 n, addr, val, cmd; 297 + u8 bus_num = bus->number; 298 + int ret; 299 + 300 + *value = 0xffffffff; 301 + n = where % 4; 302 + cmd = ixp4xx_byte_lane_enable_bits(n, size); 303 + if (cmd == 0xffffffff) 304 + return PCIBIOS_BAD_REGISTER_NUMBER; 305 + 306 + addr = ixp4xx_config_addr(bus_num, devfn, where); 307 + cmd |= NP_CMD_CONFIGREAD; 308 + dev_dbg(p->dev, "read_config from %d size %d dev %d:%d:%d address: %08x cmd: %08x\n", 309 + where, size, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn), addr, cmd); 310 + 311 + ret = ixp4xx_pci_read(p, addr, cmd, &val); 312 + if (ret) 313 + return PCIBIOS_DEVICE_NOT_FOUND; 314 + 315 + val >>= (8*n); 316 + switch (size) { 317 + case 1: 318 + val &= U8_MAX; 319 + dev_dbg(p->dev, "%s read byte %02x\n", __func__, val); 320 + break; 321 + case 2: 322 + val &= U16_MAX; 323 + dev_dbg(p->dev, "%s read word %04x\n", __func__, val); 324 + break; 325 + case 4: 326 + val &= U32_MAX; 327 + dev_dbg(p->dev, "%s read long %08x\n", __func__, val); 328 + break; 329 + default: 330 + /* Should not happen */ 331 + dev_err(p->dev, "%s illegal size\n", __func__); 332 + return PCIBIOS_DEVICE_NOT_FOUND; 333 + } 334 + *value = val; 335 + 336 + return PCIBIOS_SUCCESSFUL; 337 + } 338 + 339 + static int ixp4xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, 340 + int where, int size, u32 value) 341 + { 342 + struct ixp4xx_pci *p = bus->sysdata; 343 + u32 n, addr, val, cmd; 344 + u8 bus_num = bus->number; 345 + int ret; 346 + 347 + n = where % 4; 348 + cmd = ixp4xx_byte_lane_enable_bits(n, size); 349 + if (cmd == 0xffffffff) 350 + return PCIBIOS_BAD_REGISTER_NUMBER; 351 + 352 + addr = ixp4xx_config_addr(bus_num, devfn, where); 353 + cmd |= NP_CMD_CONFIGWRITE; 354 + val = value << (8*n); 355 + 356 + dev_dbg(p->dev, "write_config_byte %#x to %d size %d dev %d:%d:%d addr: %08x cmd %08x\n", 357 + value, where, size, bus_num, PCI_SLOT(devfn), PCI_FUNC(devfn), addr, cmd); 358 + 359 + ret = ixp4xx_pci_write(p, addr, cmd, val); 360 + if (ret) 361 + return PCIBIOS_DEVICE_NOT_FOUND; 362 + 363 + return PCIBIOS_SUCCESSFUL; 364 + } 365 + 366 + static struct pci_ops ixp4xx_pci_ops = { 367 + .read = ixp4xx_pci_read_config, 368 + .write = ixp4xx_pci_write_config, 369 + }; 370 + 371 + static u32 ixp4xx_pci_addr_to_64mconf(phys_addr_t addr) 372 + { 373 + u8 base; 374 + 375 + base = ((addr & 0xff000000) >> 24); 376 + return (base << 24) | ((base + 1) << 16) 377 + | ((base + 2) << 8) | (base + 3); 378 + } 379 + 380 + static int ixp4xx_pci_parse_map_ranges(struct ixp4xx_pci *p) 381 + { 382 + struct device *dev = p->dev; 383 + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(p); 384 + struct resource_entry *win; 385 + struct resource *res; 386 + phys_addr_t addr; 387 + 388 + win = resource_list_first_type(&bridge->windows, IORESOURCE_MEM); 389 + if (win) { 390 + u32 pcimembase; 391 + 392 + res = win->res; 393 + addr = res->start - win->offset; 394 + 395 + if (res->flags & IORESOURCE_PREFETCH) 396 + res->name = "IXP4xx PCI PRE-MEM"; 397 + else 398 + res->name = "IXP4xx PCI NON-PRE-MEM"; 399 + 400 + dev_dbg(dev, "%s window %pR, bus addr %pa\n", 401 + res->name, res, &addr); 402 + if (resource_size(res) != SZ_64M) { 403 + dev_err(dev, "memory range is not 64MB\n"); 404 + return -EINVAL; 405 + } 406 + 407 + pcimembase = ixp4xx_pci_addr_to_64mconf(addr); 408 + /* Commit configuration */ 409 + ixp4xx_writel(p, IXP4XX_PCI_PCIMEMBASE, pcimembase); 410 + } else { 411 + dev_err(dev, "no AHB memory mapping defined\n"); 412 + } 413 + 414 + win = resource_list_first_type(&bridge->windows, IORESOURCE_IO); 415 + if (win) { 416 + res = win->res; 417 + 418 + addr = pci_pio_to_address(res->start); 419 + if (addr & 0xff) { 420 + dev_err(dev, "IO mem at uneven address: %pa\n", &addr); 421 + return -EINVAL; 422 + } 423 + 424 + res->name = "IXP4xx PCI IO MEM"; 425 + /* 426 + * Setup I/O space location for PCI->AHB access, the 427 + * upper 24 bits of the address goes into the lower 428 + * 24 bits of this register. 429 + */ 430 + ixp4xx_writel(p, IXP4XX_PCI_AHBIOBASE, (addr >> 8)); 431 + } else { 432 + dev_info(dev, "no IO space AHB memory mapping defined\n"); 433 + } 434 + 435 + return 0; 436 + } 437 + 438 + static int ixp4xx_pci_parse_map_dma_ranges(struct ixp4xx_pci *p) 439 + { 440 + struct device *dev = p->dev; 441 + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(p); 442 + struct resource_entry *win; 443 + struct resource *res; 444 + phys_addr_t addr; 445 + u32 ahbmembase; 446 + 447 + win = resource_list_first_type(&bridge->dma_ranges, IORESOURCE_MEM); 448 + if (win) { 449 + res = win->res; 450 + addr = res->start - win->offset; 451 + 452 + if (resource_size(res) != SZ_64M) { 453 + dev_err(dev, "DMA memory range is not 64MB\n"); 454 + return -EINVAL; 455 + } 456 + 457 + dev_dbg(dev, "DMA MEM BASE: %pa\n", &addr); 458 + /* 459 + * 4 PCI-to-AHB windows of 16 MB each, write the 8 high bits 460 + * into each byte of the PCI_AHBMEMBASE register. 461 + */ 462 + ahbmembase = ixp4xx_pci_addr_to_64mconf(addr); 463 + /* Commit AHB membase */ 464 + ixp4xx_writel(p, IXP4XX_PCI_AHBMEMBASE, ahbmembase); 465 + } else { 466 + dev_err(dev, "no DMA memory range defined\n"); 467 + } 468 + 469 + return 0; 470 + } 471 + 472 + /* Only used to get context for abort handling */ 473 + static struct ixp4xx_pci *ixp4xx_pci_abort_singleton; 474 + 475 + static int ixp4xx_pci_abort_handler(unsigned long addr, unsigned int fsr, 476 + struct pt_regs *regs) 477 + { 478 + struct ixp4xx_pci *p = ixp4xx_pci_abort_singleton; 479 + u32 isr, status; 480 + int ret; 481 + 482 + isr = ixp4xx_readl(p, IXP4XX_PCI_ISR); 483 + ret = ixp4xx_crp_read_config(p, PCI_STATUS, 2, &status); 484 + if (ret) { 485 + dev_err(p->dev, "unable to read abort status\n"); 486 + return -EINVAL; 487 + } 488 + 489 + dev_err(p->dev, 490 + "PCI: abort_handler addr = %#lx, isr = %#x, status = %#x\n", 491 + addr, isr, status); 492 + 493 + /* Make sure the Master Abort bit is reset */ 494 + ixp4xx_writel(p, IXP4XX_PCI_ISR, IXP4XX_PCI_ISR_PFE); 495 + status |= PCI_STATUS_REC_MASTER_ABORT; 496 + ret = ixp4xx_crp_write_config(p, PCI_STATUS, 2, status); 497 + if (ret) 498 + dev_err(p->dev, "unable to clear abort status bit\n"); 499 + 500 + /* 501 + * If it was an imprecise abort, then we need to correct the 502 + * return address to be _after_ the instruction. 503 + */ 504 + if (fsr & (1 << 10)) { 505 + dev_err(p->dev, "imprecise abort\n"); 506 + regs->ARM_pc += 4; 507 + } 508 + 509 + return 0; 510 + } 511 + 512 + static int __init ixp4xx_pci_probe(struct platform_device *pdev) 513 + { 514 + struct device *dev = &pdev->dev; 515 + struct device_node *np = dev->of_node; 516 + struct ixp4xx_pci *p; 517 + struct pci_host_bridge *host; 518 + int ret; 519 + u32 val; 520 + phys_addr_t addr; 521 + u32 basereg[4] = { 522 + PCI_BASE_ADDRESS_0, 523 + PCI_BASE_ADDRESS_1, 524 + PCI_BASE_ADDRESS_2, 525 + PCI_BASE_ADDRESS_3, 526 + }; 527 + int i; 528 + 529 + host = devm_pci_alloc_host_bridge(dev, sizeof(*p)); 530 + if (!host) 531 + return -ENOMEM; 532 + 533 + host->ops = &ixp4xx_pci_ops; 534 + p = pci_host_bridge_priv(host); 535 + host->sysdata = p; 536 + p->dev = dev; 537 + dev_set_drvdata(dev, p); 538 + 539 + /* 540 + * Set up quirk for erratic behaviour in the 42x variant 541 + * when accessing config space. 542 + */ 543 + if (of_device_is_compatible(np, "intel,ixp42x-pci")) { 544 + p->errata_hammer = true; 545 + dev_info(dev, "activate hammering errata\n"); 546 + } 547 + 548 + p->base = devm_platform_ioremap_resource(pdev, 0); 549 + if (IS_ERR(p->base)) 550 + return PTR_ERR(p->base); 551 + 552 + val = ixp4xx_readl(p, IXP4XX_PCI_CSR); 553 + p->host_mode = !!(val & IXP4XX_PCI_CSR_HOST); 554 + dev_info(dev, "controller is in %s mode\n", 555 + p->host_mode ? "host" : "option"); 556 + 557 + /* Hook in our fault handler for PCI errors */ 558 + ixp4xx_pci_abort_singleton = p; 559 + hook_fault_code(16+6, ixp4xx_pci_abort_handler, SIGBUS, 0, 560 + "imprecise external abort"); 561 + 562 + ret = ixp4xx_pci_parse_map_ranges(p); 563 + if (ret) 564 + return ret; 565 + 566 + ret = ixp4xx_pci_parse_map_dma_ranges(p); 567 + if (ret) 568 + return ret; 569 + 570 + /* This is only configured in host mode */ 571 + if (p->host_mode) { 572 + addr = __pa(PAGE_OFFSET); 573 + /* This is a noop (0x00) but explains what is going on */ 574 + addr |= PCI_BASE_ADDRESS_SPACE_MEMORY; 575 + 576 + for (i = 0; i < 4; i++) { 577 + /* Write this directly into the config space */ 578 + ret = ixp4xx_crp_write_config(p, basereg[i], 4, addr); 579 + if (ret) 580 + dev_err(dev, "failed to set up PCI_BASE_ADDRESS_%d\n", i); 581 + else 582 + dev_info(dev, "set PCI_BASE_ADDR_%d to %pa\n", i, &addr); 583 + addr += SZ_16M; 584 + } 585 + 586 + /* 587 + * Enable CSR window at 64 MiB to allow PCI masters to continue 588 + * prefetching past the 64 MiB boundary, if all AHB to PCI 589 + * windows are consecutive. 590 + */ 591 + ret = ixp4xx_crp_write_config(p, PCI_BASE_ADDRESS_4, 4, addr); 592 + if (ret) 593 + dev_err(dev, "failed to set up PCI_BASE_ADDRESS_4\n"); 594 + else 595 + dev_info(dev, "set PCI_BASE_ADDR_4 to %pa\n", &addr); 596 + 597 + /* 598 + * Put the IO memory window at the very end of physical memory 599 + * at 0xfffffc00. This is when the system is trying to access IO 600 + * memory over AHB. 601 + */ 602 + addr = 0xfffffc00; 603 + addr |= PCI_BASE_ADDRESS_SPACE_IO; 604 + ret = ixp4xx_crp_write_config(p, PCI_BASE_ADDRESS_5, 4, addr); 605 + if (ret) 606 + dev_err(dev, "failed to set up PCI_BASE_ADDRESS_5\n"); 607 + else 608 + dev_info(dev, "set PCI_BASE_ADDR_5 to %pa\n", &addr); 609 + 610 + /* 611 + * Retry timeout to 0x80 612 + * Transfer ready timeout to 0xff 613 + */ 614 + ret = ixp4xx_crp_write_config(p, IXP4XX_PCI_RTOTTO, 4, 615 + 0x000080ff); 616 + if (ret) 617 + dev_err(dev, "failed to set up TRDY limit\n"); 618 + else 619 + dev_info(dev, "set TRDY limit to 0x80ff\n"); 620 + } 621 + 622 + /* Clear interrupts */ 623 + val = IXP4XX_PCI_ISR_PSE | IXP4XX_PCI_ISR_PFE | IXP4XX_PCI_ISR_PPE | IXP4XX_PCI_ISR_AHBE; 624 + ixp4xx_writel(p, IXP4XX_PCI_ISR, val); 625 + 626 + /* 627 + * Set Initialize Complete in PCI Control Register: allow IXP4XX to 628 + * generate PCI configuration cycles. Specify that the AHB bus is 629 + * operating in big-endian mode. Set up byte lane swapping between 630 + * little-endian PCI and the big-endian AHB bus. 631 + */ 632 + val = IXP4XX_PCI_CSR_IC | IXP4XX_PCI_CSR_ABE; 633 + if (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) 634 + val |= (IXP4XX_PCI_CSR_PDS | IXP4XX_PCI_CSR_ADS); 635 + ixp4xx_writel(p, IXP4XX_PCI_CSR, val); 636 + 637 + ret = ixp4xx_crp_write_config(p, PCI_COMMAND, 2, PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY); 638 + if (ret) 639 + dev_err(dev, "unable to initialize master and command memory\n"); 640 + else 641 + dev_info(dev, "initialized as master\n"); 642 + 643 + pci_host_probe(host); 644 + 645 + return 0; 646 + } 647 + 648 + static const struct of_device_id ixp4xx_pci_of_match[] = { 649 + { 650 + .compatible = "intel,ixp42x-pci", 651 + }, 652 + { 653 + .compatible = "intel,ixp43x-pci", 654 + }, 655 + {}, 656 + }; 657 + 658 + /* 659 + * This driver needs to be a builtin module with suppressed bind 660 + * attributes since the probe() is initializing a hard exception 661 + * handler and this can only be done from __init-tagged code 662 + * sections. This module cannot be removed and inserted at all. 663 + */ 664 + static struct platform_driver ixp4xx_pci_driver = { 665 + .driver = { 666 + .name = "ixp4xx-pci", 667 + .suppress_bind_attrs = true, 668 + .of_match_table = ixp4xx_pci_of_match, 669 + }, 670 + }; 671 + builtin_platform_driver_probe(ixp4xx_pci_driver, ixp4xx_pci_probe);
+3
drivers/soc/imx/soc-imx.c
··· 70 70 case MXC_CPU_MX35: 71 71 soc_id = "i.MX35"; 72 72 break; 73 + case MXC_CPU_MX50: 74 + soc_id = "i.MX50"; 75 + break; 73 76 case MXC_CPU_MX51: 74 77 ocotp_compat = "fsl,imx51-iim"; 75 78 soc_id = "i.MX51";
+2
drivers/soc/ixp4xx/ixp4xx-npe.c
··· 21 21 #include <linux/of_platform.h> 22 22 #include <linux/platform_device.h> 23 23 #include <linux/soc/ixp4xx/npe.h> 24 + #include <mach/hardware.h> 25 + #include <linux/soc/ixp4xx/cpu.h> 24 26 25 27 #define DEBUG_MSG 0 26 28 #define DEBUG_FW 0
+2
drivers/soc/ixp4xx/ixp4xx-qmgr.c
··· 12 12 #include <linux/of.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/soc/ixp4xx/qmgr.h> 15 + #include <mach/hardware.h> 16 + #include <linux/soc/ixp4xx/cpu.h> 15 17 16 18 static struct qmgr_regs __iomem *qmgr_regs; 17 19 static int qmgr_irq_1;
+2
drivers/soc/tegra/Kconfig
··· 144 144 config SOC_TEGRA_PMC 145 145 bool 146 146 select GENERIC_PINCONF 147 + select PM_OPP 148 + select PM_GENERIC_DOMAINS 147 149 148 150 config SOC_TEGRA_POWERGATE_BPMP 149 151 def_bool y
+97
drivers/soc/tegra/common.c
··· 3 3 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved. 4 4 */ 5 5 6 + #define dev_fmt(fmt) "tegra-soc: " fmt 7 + 8 + #include <linux/clk.h> 9 + #include <linux/device.h> 10 + #include <linux/export.h> 6 11 #include <linux/of.h> 12 + #include <linux/pm_opp.h> 7 13 8 14 #include <soc/tegra/common.h> 15 + #include <soc/tegra/fuse.h> 9 16 10 17 static const struct of_device_id tegra_machine_match[] = { 11 18 { .compatible = "nvidia,tegra20", }, ··· 38 31 39 32 return match != NULL; 40 33 } 34 + 35 + static int tegra_core_dev_init_opp_state(struct device *dev) 36 + { 37 + unsigned long rate; 38 + struct clk *clk; 39 + int err; 40 + 41 + clk = devm_clk_get(dev, NULL); 42 + if (IS_ERR(clk)) { 43 + dev_err(dev, "failed to get clk: %pe\n", clk); 44 + return PTR_ERR(clk); 45 + } 46 + 47 + rate = clk_get_rate(clk); 48 + if (!rate) { 49 + dev_err(dev, "failed to get clk rate\n"); 50 + return -EINVAL; 51 + } 52 + 53 + /* first dummy rate-setting initializes voltage vote */ 54 + err = dev_pm_opp_set_rate(dev, rate); 55 + if (err) { 56 + dev_err(dev, "failed to initialize OPP clock: %d\n", err); 57 + return err; 58 + } 59 + 60 + return 0; 61 + } 62 + 63 + /** 64 + * devm_tegra_core_dev_init_opp_table() - initialize OPP table 65 + * @dev: device for which OPP table is initialized 66 + * @params: pointer to the OPP table configuration 67 + * 68 + * This function will initialize OPP table and sync OPP state of a Tegra SoC 69 + * core device. 70 + * 71 + * Return: 0 on success or errorno. 72 + */ 73 + int devm_tegra_core_dev_init_opp_table(struct device *dev, 74 + struct tegra_core_opp_params *params) 75 + { 76 + u32 hw_version; 77 + int err; 78 + 79 + err = devm_pm_opp_set_clkname(dev, NULL); 80 + if (err) { 81 + dev_err(dev, "failed to set OPP clk: %d\n", err); 82 + return err; 83 + } 84 + 85 + /* Tegra114+ doesn't support OPP yet */ 86 + if (!of_machine_is_compatible("nvidia,tegra20") && 87 + !of_machine_is_compatible("nvidia,tegra30")) 88 + return -ENODEV; 89 + 90 + if (of_machine_is_compatible("nvidia,tegra20")) 91 + hw_version = BIT(tegra_sku_info.soc_process_id); 92 + else 93 + hw_version = BIT(tegra_sku_info.soc_speedo_id); 94 + 95 + err = devm_pm_opp_set_supported_hw(dev, &hw_version, 1); 96 + if (err) { 97 + dev_err(dev, "failed to set OPP supported HW: %d\n", err); 98 + return err; 99 + } 100 + 101 + /* 102 + * Older device-trees have an empty OPP table, we will get 103 + * -ENODEV from devm_pm_opp_of_add_table() in this case. 104 + */ 105 + err = devm_pm_opp_of_add_table(dev); 106 + if (err) { 107 + if (err == -ENODEV) 108 + dev_err_once(dev, "OPP table not found, please update device-tree\n"); 109 + else 110 + dev_err(dev, "failed to add OPP table: %d\n", err); 111 + 112 + return err; 113 + } 114 + 115 + if (params->init_state) { 116 + err = tegra_core_dev_init_opp_state(dev); 117 + if (err) 118 + return err; 119 + } 120 + 121 + return 0; 122 + } 123 + EXPORT_SYMBOL_GPL(devm_tegra_core_dev_init_opp_table);
+2 -4
drivers/soc/tegra/fuse/fuse-tegra.c
··· 489 489 size_t size = sizeof(*fuse->lookups) * fuse->soc->num_lookups; 490 490 491 491 fuse->lookups = kmemdup(fuse->soc->lookups, size, GFP_KERNEL); 492 - if (!fuse->lookups) 493 - return -ENOMEM; 494 - 495 - nvmem_add_cell_lookups(fuse->lookups, fuse->soc->num_lookups); 492 + if (fuse->lookups) 493 + nvmem_add_cell_lookups(fuse->lookups, fuse->soc->num_lookups); 496 494 } 497 495 498 496 return 0;
+2 -1
drivers/soc/tegra/fuse/fuse-tegra30.c
··· 37 37 defined(CONFIG_ARCH_TEGRA_132_SOC) || \ 38 38 defined(CONFIG_ARCH_TEGRA_210_SOC) || \ 39 39 defined(CONFIG_ARCH_TEGRA_186_SOC) || \ 40 - defined(CONFIG_ARCH_TEGRA_194_SOC) 40 + defined(CONFIG_ARCH_TEGRA_194_SOC) || \ 41 + defined(CONFIG_ARCH_TEGRA_234_SOC) 41 42 static u32 tegra30_fuse_read_early(struct tegra_fuse *fuse, unsigned int offset) 42 43 { 43 44 if (WARN_ON(!fuse->base))
+144
drivers/soc/tegra/pmc.c
··· 38 38 #include <linux/pinctrl/pinctrl.h> 39 39 #include <linux/platform_device.h> 40 40 #include <linux/pm_domain.h> 41 + #include <linux/pm_opp.h> 41 42 #include <linux/reboot.h> 42 43 #include <linux/regmap.h> 43 44 #include <linux/reset.h> ··· 429 428 struct irq_chip irq; 430 429 431 430 struct notifier_block clk_nb; 431 + 432 + bool core_domain_state_synced; 433 + bool core_domain_registered; 432 434 }; 433 435 434 436 static struct tegra_pmc *pmc = &(struct tegra_pmc) { ··· 1301 1297 return err; 1302 1298 } 1303 1299 1300 + bool tegra_pmc_core_domain_state_synced(void) 1301 + { 1302 + return pmc->core_domain_state_synced; 1303 + } 1304 + 1305 + static int 1306 + tegra_pmc_core_pd_set_performance_state(struct generic_pm_domain *genpd, 1307 + unsigned int level) 1308 + { 1309 + struct dev_pm_opp *opp; 1310 + int err; 1311 + 1312 + opp = dev_pm_opp_find_level_ceil(&genpd->dev, &level); 1313 + if (IS_ERR(opp)) { 1314 + dev_err(&genpd->dev, "failed to find OPP for level %u: %pe\n", 1315 + level, opp); 1316 + return PTR_ERR(opp); 1317 + } 1318 + 1319 + mutex_lock(&pmc->powergates_lock); 1320 + err = dev_pm_opp_set_opp(pmc->dev, opp); 1321 + mutex_unlock(&pmc->powergates_lock); 1322 + 1323 + dev_pm_opp_put(opp); 1324 + 1325 + if (err) { 1326 + dev_err(&genpd->dev, "failed to set voltage to %duV: %d\n", 1327 + level, err); 1328 + return err; 1329 + } 1330 + 1331 + return 0; 1332 + } 1333 + 1334 + static unsigned int 1335 + tegra_pmc_core_pd_opp_to_performance_state(struct generic_pm_domain *genpd, 1336 + struct dev_pm_opp *opp) 1337 + { 1338 + return dev_pm_opp_get_level(opp); 1339 + } 1340 + 1341 + static int tegra_pmc_core_pd_add(struct tegra_pmc *pmc, struct device_node *np) 1342 + { 1343 + struct generic_pm_domain *genpd; 1344 + const char *rname = "core"; 1345 + int err; 1346 + 1347 + genpd = devm_kzalloc(pmc->dev, sizeof(*genpd), GFP_KERNEL); 1348 + if (!genpd) 1349 + return -ENOMEM; 1350 + 1351 + genpd->name = np->name; 1352 + genpd->set_performance_state = tegra_pmc_core_pd_set_performance_state; 1353 + genpd->opp_to_performance_state = tegra_pmc_core_pd_opp_to_performance_state; 1354 + 1355 + err = devm_pm_opp_set_regulators(pmc->dev, &rname, 1); 1356 + if (err) 1357 + return dev_err_probe(pmc->dev, err, 1358 + "failed to set core OPP regulator\n"); 1359 + 1360 + err = pm_genpd_init(genpd, NULL, false); 1361 + if (err) { 1362 + dev_err(pmc->dev, "failed to init core genpd: %d\n", err); 1363 + return err; 1364 + } 1365 + 1366 + err = of_genpd_add_provider_simple(np, genpd); 1367 + if (err) { 1368 + dev_err(pmc->dev, "failed to add core genpd: %d\n", err); 1369 + goto remove_genpd; 1370 + } 1371 + 1372 + pmc->core_domain_registered = true; 1373 + 1374 + return 0; 1375 + 1376 + remove_genpd: 1377 + pm_genpd_remove(genpd); 1378 + 1379 + return err; 1380 + } 1381 + 1304 1382 static int tegra_powergate_init(struct tegra_pmc *pmc, 1305 1383 struct device_node *parent) 1306 1384 { 1385 + struct of_phandle_args child_args, parent_args; 1307 1386 struct device_node *np, *child; 1308 1387 int err = 0; 1388 + 1389 + /* 1390 + * Core power domain is the parent of powergate domains, hence it 1391 + * should be registered first. 1392 + */ 1393 + np = of_get_child_by_name(parent, "core-domain"); 1394 + if (np) { 1395 + err = tegra_pmc_core_pd_add(pmc, np); 1396 + of_node_put(np); 1397 + if (err) 1398 + return err; 1399 + } 1309 1400 1310 1401 np = of_get_child_by_name(parent, "powergates"); 1311 1402 if (!np) ··· 1409 1310 for_each_child_of_node(np, child) { 1410 1311 err = tegra_powergate_add(pmc, child); 1411 1312 if (err < 0) { 1313 + of_node_put(child); 1314 + break; 1315 + } 1316 + 1317 + if (of_parse_phandle_with_args(child, "power-domains", 1318 + "#power-domain-cells", 1319 + 0, &parent_args)) 1320 + continue; 1321 + 1322 + child_args.np = child; 1323 + child_args.args_count = 0; 1324 + 1325 + err = of_genpd_add_subdomain(&parent_args, &child_args); 1326 + of_node_put(parent_args.np); 1327 + if (err) { 1412 1328 of_node_put(child); 1413 1329 break; 1414 1330 } ··· 1470 1356 } 1471 1357 1472 1358 of_node_put(np); 1359 + 1360 + np = of_get_child_by_name(parent, "core-domain"); 1361 + if (np) { 1362 + of_genpd_del_provider(np); 1363 + of_genpd_remove_last(np); 1364 + } 1473 1365 } 1474 1366 1475 1367 static const struct tegra_io_pad_soc * ··· 3787 3667 { } 3788 3668 }; 3789 3669 3670 + static void tegra_pmc_sync_state(struct device *dev) 3671 + { 3672 + int err; 3673 + 3674 + /* 3675 + * Older device-trees don't have core PD, and thus, there are 3676 + * no dependencies that will block the state syncing. We shouldn't 3677 + * mark the domain as synced in this case. 3678 + */ 3679 + if (!pmc->core_domain_registered) 3680 + return; 3681 + 3682 + pmc->core_domain_state_synced = true; 3683 + 3684 + /* this is a no-op if core regulator isn't used */ 3685 + mutex_lock(&pmc->powergates_lock); 3686 + err = dev_pm_opp_sync_regulators(dev); 3687 + mutex_unlock(&pmc->powergates_lock); 3688 + 3689 + if (err) 3690 + dev_err(dev, "failed to sync regulators: %d\n", err); 3691 + } 3692 + 3790 3693 static struct platform_driver tegra_pmc_driver = { 3791 3694 .driver = { 3792 3695 .name = "tegra-pmc", ··· 3818 3675 #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM) 3819 3676 .pm = &tegra_pmc_pm_ops, 3820 3677 #endif 3678 + .sync_state = tegra_pmc_sync_state, 3821 3679 }, 3822 3680 .probe = tegra_pmc_probe, 3823 3681 };
+92 -2
drivers/soc/tegra/regulators-tegra20.c
··· 12 12 #include <linux/init.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/of.h> 15 + #include <linux/reboot.h> 15 16 #include <linux/regulator/coupler.h> 16 17 #include <linux/regulator/driver.h> 17 18 #include <linux/regulator/machine.h> 19 + 20 + #include <soc/tegra/pmc.h> 18 21 19 22 struct tegra_regulator_coupler { 20 23 struct regulator_coupler coupler; 21 24 struct regulator_dev *core_rdev; 22 25 struct regulator_dev *cpu_rdev; 23 26 struct regulator_dev *rtc_rdev; 24 - int core_min_uV; 27 + struct notifier_block reboot_notifier; 28 + int core_min_uV, cpu_min_uV; 29 + bool sys_reboot_mode_req; 30 + bool sys_reboot_mode; 25 31 }; 26 32 27 33 static inline struct tegra_regulator_coupler * ··· 43 37 int core_max_uV; 44 38 int core_cur_uV; 45 39 int err; 40 + 41 + /* 42 + * Tegra20 SoC has critical DVFS-capable devices that are 43 + * permanently-active or active at a boot time, like EMC 44 + * (DRAM controller) or Display controller for example. 45 + * 46 + * The voltage of a CORE SoC power domain shall not be dropped below 47 + * a minimum level, which is determined by device's clock rate. 48 + * This means that we can't fully allow CORE voltage scaling until 49 + * the state of all DVFS-critical CORE devices is synced. 50 + */ 51 + if (tegra_pmc_core_domain_state_synced() && !tegra->sys_reboot_mode) { 52 + pr_info_once("voltage state synced\n"); 53 + return 0; 54 + } 46 55 47 56 if (tegra->core_min_uV > 0) 48 57 return tegra->core_min_uV; ··· 79 58 */ 80 59 tegra->core_min_uV = core_max_uV; 81 60 82 - pr_info("core minimum voltage limited to %duV\n", tegra->core_min_uV); 61 + pr_info("core voltage initialized to %duV\n", tegra->core_min_uV); 83 62 84 63 return tegra->core_min_uV; 85 64 } ··· 263 242 if (cpu_uV < 0) 264 243 return cpu_uV; 265 244 245 + /* store boot voltage level */ 246 + if (!tegra->cpu_min_uV) 247 + tegra->cpu_min_uV = cpu_uV; 248 + 266 249 /* 267 250 * CPU's regulator may not have any consumers, hence the voltage 268 251 * must not be changed in that case because CPU simply won't ··· 274 249 */ 275 250 if (!cpu_min_uV_consumers) 276 251 cpu_min_uV = cpu_uV; 252 + 253 + /* restore boot voltage level */ 254 + if (tegra->sys_reboot_mode) 255 + cpu_min_uV = max(cpu_min_uV, tegra->cpu_min_uV); 277 256 278 257 if (cpu_min_uV > cpu_uV) { 279 258 err = tegra20_core_rtc_update(tegra, core_rdev, rtc_rdev, ··· 319 290 return -EINVAL; 320 291 } 321 292 293 + tegra->sys_reboot_mode = READ_ONCE(tegra->sys_reboot_mode_req); 294 + 322 295 if (rdev == cpu_rdev) 323 296 return tegra20_cpu_voltage_update(tegra, cpu_rdev, 324 297 core_rdev, rtc_rdev); ··· 332 301 pr_err("changing %s voltage not permitted\n", rdev_get_name(rtc_rdev)); 333 302 334 303 return -EPERM; 304 + } 305 + 306 + static int tegra20_regulator_prepare_reboot(struct tegra_regulator_coupler *tegra, 307 + bool sys_reboot_mode) 308 + { 309 + int err; 310 + 311 + if (!tegra->core_rdev || !tegra->rtc_rdev || !tegra->cpu_rdev) 312 + return 0; 313 + 314 + WRITE_ONCE(tegra->sys_reboot_mode_req, true); 315 + 316 + /* 317 + * Some devices use CPU soft-reboot method and in this case we 318 + * should ensure that voltages are sane for the reboot by restoring 319 + * the minimum boot levels. 320 + */ 321 + err = regulator_sync_voltage_rdev(tegra->cpu_rdev); 322 + if (err) 323 + return err; 324 + 325 + err = regulator_sync_voltage_rdev(tegra->core_rdev); 326 + if (err) 327 + return err; 328 + 329 + WRITE_ONCE(tegra->sys_reboot_mode_req, sys_reboot_mode); 330 + 331 + return 0; 332 + } 333 + 334 + static int tegra20_regulator_reboot(struct notifier_block *notifier, 335 + unsigned long event, void *cmd) 336 + { 337 + struct tegra_regulator_coupler *tegra; 338 + int ret; 339 + 340 + if (event != SYS_RESTART) 341 + return NOTIFY_DONE; 342 + 343 + tegra = container_of(notifier, struct tegra_regulator_coupler, 344 + reboot_notifier); 345 + 346 + ret = tegra20_regulator_prepare_reboot(tegra, true); 347 + 348 + return notifier_from_errno(ret); 335 349 } 336 350 337 351 static int tegra20_regulator_attach(struct regulator_coupler *coupler, ··· 411 335 { 412 336 struct tegra_regulator_coupler *tegra = to_tegra_coupler(coupler); 413 337 338 + /* 339 + * We don't expect regulators to be decoupled during reboot, 340 + * this may race with the reboot handler and shouldn't ever 341 + * happen in practice. 342 + */ 343 + if (WARN_ON_ONCE(system_state > SYSTEM_RUNNING)) 344 + return -EPERM; 345 + 414 346 if (tegra->core_rdev == rdev) { 415 347 tegra->core_rdev = NULL; 416 348 return 0; ··· 443 359 .detach_regulator = tegra20_regulator_detach, 444 360 .balance_voltage = tegra20_regulator_balance_voltage, 445 361 }, 362 + .reboot_notifier.notifier_call = tegra20_regulator_reboot, 446 363 }; 447 364 448 365 static int __init tegra_regulator_coupler_init(void) 449 366 { 367 + int err; 368 + 450 369 if (!of_machine_is_compatible("nvidia,tegra20")) 451 370 return 0; 371 + 372 + err = register_reboot_notifier(&tegra20_coupler.reboot_notifier); 373 + WARN_ON(err); 452 374 453 375 return regulator_coupler_register(&tegra20_coupler.coupler); 454 376 }
+91 -2
drivers/soc/tegra/regulators-tegra30.c
··· 12 12 #include <linux/init.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/of.h> 15 + #include <linux/reboot.h> 15 16 #include <linux/regulator/coupler.h> 16 17 #include <linux/regulator/driver.h> 17 18 #include <linux/regulator/machine.h> 18 19 19 20 #include <soc/tegra/fuse.h> 21 + #include <soc/tegra/pmc.h> 20 22 21 23 struct tegra_regulator_coupler { 22 24 struct regulator_coupler coupler; 23 25 struct regulator_dev *core_rdev; 24 26 struct regulator_dev *cpu_rdev; 25 - int core_min_uV; 27 + struct notifier_block reboot_notifier; 28 + int core_min_uV, cpu_min_uV; 29 + bool sys_reboot_mode_req; 30 + bool sys_reboot_mode; 26 31 }; 27 32 28 33 static inline struct tegra_regulator_coupler * ··· 43 38 int core_max_uV; 44 39 int core_cur_uV; 45 40 int err; 41 + 42 + /* 43 + * Tegra30 SoC has critical DVFS-capable devices that are 44 + * permanently-active or active at a boot time, like EMC 45 + * (DRAM controller) or Display controller for example. 46 + * 47 + * The voltage of a CORE SoC power domain shall not be dropped below 48 + * a minimum level, which is determined by device's clock rate. 49 + * This means that we can't fully allow CORE voltage scaling until 50 + * the state of all DVFS-critical CORE devices is synced. 51 + */ 52 + if (tegra_pmc_core_domain_state_synced() && !tegra->sys_reboot_mode) { 53 + pr_info_once("voltage state synced\n"); 54 + return 0; 55 + } 46 56 47 57 if (tegra->core_min_uV > 0) 48 58 return tegra->core_min_uV; ··· 79 59 */ 80 60 tegra->core_min_uV = core_max_uV; 81 61 82 - pr_info("core minimum voltage limited to %duV\n", tegra->core_min_uV); 62 + pr_info("core voltage initialized to %duV\n", tegra->core_min_uV); 83 63 84 64 return tegra->core_min_uV; 85 65 } ··· 192 172 if (cpu_uV < 0) 193 173 return cpu_uV; 194 174 175 + /* store boot voltage level */ 176 + if (!tegra->cpu_min_uV) 177 + tegra->cpu_min_uV = cpu_uV; 178 + 195 179 /* 196 180 * CPU's regulator may not have any consumers, hence the voltage 197 181 * must not be changed in that case because CPU simply won't ··· 218 194 err = regulator_check_voltage(core_rdev, &core_min_uV, &core_max_uV); 219 195 if (err) 220 196 return err; 197 + 198 + /* restore boot voltage level */ 199 + if (tegra->sys_reboot_mode) 200 + cpu_min_uV = max(cpu_min_uV, tegra->cpu_min_uV); 221 201 222 202 if (core_min_limited_uV > core_uV) { 223 203 pr_err("core voltage constraint violated: %d %d %d\n", ··· 291 263 return -EINVAL; 292 264 } 293 265 266 + tegra->sys_reboot_mode = READ_ONCE(tegra->sys_reboot_mode_req); 267 + 294 268 return tegra30_voltage_update(tegra, cpu_rdev, core_rdev); 269 + } 270 + 271 + static int tegra30_regulator_prepare_reboot(struct tegra_regulator_coupler *tegra, 272 + bool sys_reboot_mode) 273 + { 274 + int err; 275 + 276 + if (!tegra->core_rdev || !tegra->cpu_rdev) 277 + return 0; 278 + 279 + WRITE_ONCE(tegra->sys_reboot_mode_req, true); 280 + 281 + /* 282 + * Some devices use CPU soft-reboot method and in this case we 283 + * should ensure that voltages are sane for the reboot by restoring 284 + * the minimum boot levels. 285 + */ 286 + err = regulator_sync_voltage_rdev(tegra->cpu_rdev); 287 + if (err) 288 + return err; 289 + 290 + err = regulator_sync_voltage_rdev(tegra->core_rdev); 291 + if (err) 292 + return err; 293 + 294 + WRITE_ONCE(tegra->sys_reboot_mode_req, sys_reboot_mode); 295 + 296 + return 0; 297 + } 298 + 299 + static int tegra30_regulator_reboot(struct notifier_block *notifier, 300 + unsigned long event, void *cmd) 301 + { 302 + struct tegra_regulator_coupler *tegra; 303 + int ret; 304 + 305 + if (event != SYS_RESTART) 306 + return NOTIFY_DONE; 307 + 308 + tegra = container_of(notifier, struct tegra_regulator_coupler, 309 + reboot_notifier); 310 + 311 + ret = tegra30_regulator_prepare_reboot(tegra, true); 312 + 313 + return notifier_from_errno(ret); 295 314 } 296 315 297 316 static int tegra30_regulator_attach(struct regulator_coupler *coupler, ··· 367 292 { 368 293 struct tegra_regulator_coupler *tegra = to_tegra_coupler(coupler); 369 294 295 + /* 296 + * We don't expect regulators to be decoupled during reboot, 297 + * this may race with the reboot handler and shouldn't ever 298 + * happen in practice. 299 + */ 300 + if (WARN_ON_ONCE(system_state > SYSTEM_RUNNING)) 301 + return -EPERM; 302 + 370 303 if (tegra->core_rdev == rdev) { 371 304 tegra->core_rdev = NULL; 372 305 return 0; ··· 394 311 .detach_regulator = tegra30_regulator_detach, 395 312 .balance_voltage = tegra30_regulator_balance_voltage, 396 313 }, 314 + .reboot_notifier.notifier_call = tegra30_regulator_reboot, 397 315 }; 398 316 399 317 static int __init tegra_regulator_coupler_init(void) 400 318 { 319 + int err; 320 + 401 321 if (!of_machine_is_compatible("nvidia,tegra30")) 402 322 return 0; 323 + 324 + err = register_reboot_notifier(&tegra30_coupler.reboot_notifier); 325 + WARN_ON(err); 403 326 404 327 return regulator_coupler_register(&tegra30_coupler.coupler); 405 328 }
+21
include/linux/platform_data/pata_ixp4xx_cf.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __PLATFORM_DATA_PATA_IXP4XX_H 3 + #define __PLATFORM_DATA_PATA_IXP4XX_H 4 + 5 + #include <linux/types.h> 6 + 7 + /* 8 + * This structure provide a means for the board setup code 9 + * to give information to th pata_ixp4xx driver. It is 10 + * passed as platform_data. 11 + */ 12 + struct ixp4xx_pata_data { 13 + volatile u32 *cs0_cfg; 14 + volatile u32 *cs1_cfg; 15 + unsigned long cs0_bits; 16 + unsigned long cs1_bits; 17 + void __iomem *cs0; 18 + void __iomem *cs1; 19 + }; 20 + 21 + #endif
+106
include/linux/soc/ixp4xx/cpu.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * IXP4XX cpu type detection 4 + * 5 + * Copyright (C) 2007 MontaVista Software, Inc. 6 + */ 7 + 8 + #ifndef __SOC_IXP4XX_CPU_H__ 9 + #define __SOC_IXP4XX_CPU_H__ 10 + 11 + #include <linux/io.h> 12 + #ifdef CONFIG_ARM 13 + #include <asm/cputype.h> 14 + #endif 15 + 16 + /* Processor id value in CP15 Register 0 */ 17 + #define IXP42X_PROCESSOR_ID_VALUE 0x690541c0 /* including unused 0x690541Ex */ 18 + #define IXP42X_PROCESSOR_ID_MASK 0xffffffc0 19 + 20 + #define IXP43X_PROCESSOR_ID_VALUE 0x69054040 21 + #define IXP43X_PROCESSOR_ID_MASK 0xfffffff0 22 + 23 + #define IXP46X_PROCESSOR_ID_VALUE 0x69054200 /* including IXP455 */ 24 + #define IXP46X_PROCESSOR_ID_MASK 0xfffffff0 25 + 26 + /* "fuse" bits of IXP_EXP_CFG2 */ 27 + /* All IXP4xx CPUs */ 28 + #define IXP4XX_FEATURE_RCOMP (1 << 0) 29 + #define IXP4XX_FEATURE_USB_DEVICE (1 << 1) 30 + #define IXP4XX_FEATURE_HASH (1 << 2) 31 + #define IXP4XX_FEATURE_AES (1 << 3) 32 + #define IXP4XX_FEATURE_DES (1 << 4) 33 + #define IXP4XX_FEATURE_HDLC (1 << 5) 34 + #define IXP4XX_FEATURE_AAL (1 << 6) 35 + #define IXP4XX_FEATURE_HSS (1 << 7) 36 + #define IXP4XX_FEATURE_UTOPIA (1 << 8) 37 + #define IXP4XX_FEATURE_NPEB_ETH0 (1 << 9) 38 + #define IXP4XX_FEATURE_NPEC_ETH (1 << 10) 39 + #define IXP4XX_FEATURE_RESET_NPEA (1 << 11) 40 + #define IXP4XX_FEATURE_RESET_NPEB (1 << 12) 41 + #define IXP4XX_FEATURE_RESET_NPEC (1 << 13) 42 + #define IXP4XX_FEATURE_PCI (1 << 14) 43 + #define IXP4XX_FEATURE_UTOPIA_PHY_LIMIT (3 << 16) 44 + #define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22) 45 + #define IXP42X_FEATURE_MASK (IXP4XX_FEATURE_RCOMP | \ 46 + IXP4XX_FEATURE_USB_DEVICE | \ 47 + IXP4XX_FEATURE_HASH | \ 48 + IXP4XX_FEATURE_AES | \ 49 + IXP4XX_FEATURE_DES | \ 50 + IXP4XX_FEATURE_HDLC | \ 51 + IXP4XX_FEATURE_AAL | \ 52 + IXP4XX_FEATURE_HSS | \ 53 + IXP4XX_FEATURE_UTOPIA | \ 54 + IXP4XX_FEATURE_NPEB_ETH0 | \ 55 + IXP4XX_FEATURE_NPEC_ETH | \ 56 + IXP4XX_FEATURE_RESET_NPEA | \ 57 + IXP4XX_FEATURE_RESET_NPEB | \ 58 + IXP4XX_FEATURE_RESET_NPEC | \ 59 + IXP4XX_FEATURE_PCI | \ 60 + IXP4XX_FEATURE_UTOPIA_PHY_LIMIT | \ 61 + IXP4XX_FEATURE_XSCALE_MAX_FREQ) 62 + 63 + 64 + /* IXP43x/46x CPUs */ 65 + #define IXP4XX_FEATURE_ECC_TIMESYNC (1 << 15) 66 + #define IXP4XX_FEATURE_USB_HOST (1 << 18) 67 + #define IXP4XX_FEATURE_NPEA_ETH (1 << 19) 68 + #define IXP43X_FEATURE_MASK (IXP42X_FEATURE_MASK | \ 69 + IXP4XX_FEATURE_ECC_TIMESYNC | \ 70 + IXP4XX_FEATURE_USB_HOST | \ 71 + IXP4XX_FEATURE_NPEA_ETH) 72 + 73 + /* IXP46x CPU (including IXP455) only */ 74 + #define IXP4XX_FEATURE_NPEB_ETH_1_TO_3 (1 << 20) 75 + #define IXP4XX_FEATURE_RSA (1 << 21) 76 + #define IXP46X_FEATURE_MASK (IXP43X_FEATURE_MASK | \ 77 + IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \ 78 + IXP4XX_FEATURE_RSA) 79 + 80 + #ifdef CONFIG_ARCH_IXP4XX 81 + #define cpu_is_ixp42x_rev_a0() ((read_cpuid_id() & (IXP42X_PROCESSOR_ID_MASK | 0xF)) == \ 82 + IXP42X_PROCESSOR_ID_VALUE) 83 + #define cpu_is_ixp42x() ((read_cpuid_id() & IXP42X_PROCESSOR_ID_MASK) == \ 84 + IXP42X_PROCESSOR_ID_VALUE) 85 + #define cpu_is_ixp43x() ((read_cpuid_id() & IXP43X_PROCESSOR_ID_MASK) == \ 86 + IXP43X_PROCESSOR_ID_VALUE) 87 + #define cpu_is_ixp46x() ((read_cpuid_id() & IXP46X_PROCESSOR_ID_MASK) == \ 88 + IXP46X_PROCESSOR_ID_VALUE) 89 + 90 + u32 ixp4xx_read_feature_bits(void); 91 + void ixp4xx_write_feature_bits(u32 value); 92 + #else 93 + #define cpu_is_ixp42x_rev_a0() 0 94 + #define cpu_is_ixp42x() 0 95 + #define cpu_is_ixp43x() 0 96 + #define cpu_is_ixp46x() 0 97 + static inline u32 ixp4xx_read_feature_bits(void) 98 + { 99 + return 0; 100 + } 101 + static inline void ixp4xx_write_feature_bits(u32 value) 102 + { 103 + } 104 + #endif 105 + 106 + #endif /* _ASM_ARCH_CPU_H */
-6
include/linux/soc/samsung/exynos-regs-pmu.h
··· 611 611 #define EXYNOS5420_FSYS2_OPTION 0x4168 612 612 #define EXYNOS5420_PSGEN_OPTION 0x4188 613 613 614 - /* For EXYNOS_CENTRAL_SEQ_OPTION */ 615 - #define EXYNOS5_USE_STANDBYWFI_ARM_CORE0 BIT(16) 616 - #define EXYNOS5_USE_STANDBYWFI_ARM_CORE1 BUT(17) 617 - #define EXYNOS5_USE_STANDBYWFE_ARM_CORE0 BIT(24) 618 - #define EXYNOS5_USE_STANDBYWFE_ARM_CORE1 BIT(25) 619 - 620 614 #define EXYNOS5420_ARM_USE_STANDBY_WFI0 BIT(4) 621 615 #define EXYNOS5420_ARM_USE_STANDBY_WFI1 BIT(5) 622 616 #define EXYNOS5420_ARM_USE_STANDBY_WFI2 BIT(6)
+1
include/soc/imx/cpu.h
··· 9 9 #define MXC_CPU_MX27 27 10 10 #define MXC_CPU_MX31 31 11 11 #define MXC_CPU_MX35 35 12 + #define MXC_CPU_MX50 50 12 13 #define MXC_CPU_MX51 51 13 14 #define MXC_CPU_MX53 53 14 15 #define MXC_CPU_IMX6SL 0x60
+31
include/soc/tegra/common.h
··· 6 6 #ifndef __SOC_TEGRA_COMMON_H__ 7 7 #define __SOC_TEGRA_COMMON_H__ 8 8 9 + #include <linux/errno.h> 10 + #include <linux/types.h> 11 + 12 + struct device; 13 + 14 + /** 15 + * Tegra SoC core device OPP table configuration 16 + * 17 + * @init_state: pre-initialize OPP state of a device 18 + */ 19 + struct tegra_core_opp_params { 20 + bool init_state; 21 + }; 22 + 23 + #ifdef CONFIG_ARCH_TEGRA 9 24 bool soc_is_tegra(void); 25 + 26 + int devm_tegra_core_dev_init_opp_table(struct device *dev, 27 + struct tegra_core_opp_params *params); 28 + #else 29 + static inline bool soc_is_tegra(void) 30 + { 31 + return false; 32 + } 33 + 34 + static inline int 35 + devm_tegra_core_dev_init_opp_table(struct device *dev, 36 + struct tegra_core_opp_params *params) 37 + { 38 + return -ENODEV; 39 + } 40 + #endif 10 41 11 42 #endif /* __SOC_TEGRA_COMMON_H__ */
+17 -3
include/soc/tegra/fuse.h
··· 52 52 enum tegra_revision revision; 53 53 }; 54 54 55 + #ifdef CONFIG_ARCH_TEGRA 56 + extern struct tegra_sku_info tegra_sku_info; 55 57 u32 tegra_read_straps(void); 56 58 u32 tegra_read_ram_code(void); 57 59 int tegra_fuse_readl(unsigned long offset, u32 *value); 58 - 59 - #ifdef CONFIG_ARCH_TEGRA 60 - extern struct tegra_sku_info tegra_sku_info; 61 60 #else 62 61 static struct tegra_sku_info tegra_sku_info __maybe_unused; 62 + 63 + static inline u32 tegra_read_straps(void) 64 + { 65 + return 0; 66 + } 67 + 68 + static inline u32 tegra_read_ram_code(void) 69 + { 70 + return 0; 71 + } 72 + 73 + static inline int tegra_fuse_readl(unsigned long offset, u32 *value) 74 + { 75 + return -ENODEV; 76 + } 63 77 #endif 64 78 65 79 struct device *tegra_soc_device_register(void);
+7
include/soc/tegra/pmc.h
··· 171 171 void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode); 172 172 void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode); 173 173 174 + bool tegra_pmc_core_domain_state_synced(void); 175 + 174 176 #else 175 177 static inline int tegra_powergate_power_on(unsigned int id) 176 178 { ··· 227 225 228 226 static inline void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode) 229 227 { 228 + } 229 + 230 + static inline bool tegra_pmc_core_domain_state_synced(void) 231 + { 232 + return false; 230 233 } 231 234 232 235 #endif /* CONFIG_SOC_TEGRA_PMC */