History

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 ...

Linus Torvalds committed 5 years ago

Commit 6e207b82 parents b6fd9e2 42accad76 files · +1841 −460Browse files

Unified · Split

76 files
  1. Documentation/devicetree/bindings/pci/intel,ixp4xx-pci.yaml +100 −0
  2. Documentation/devicetree/bindings/rng/intel,ixp46x-rng.yaml +36 −0
  3. MAINTAINERS +12 −6
  4. arch/arm/Kconfig +2 −1
  5. arch/arm/Kconfig.debug +13 −2
  6. arch/arm/boot/dts/am5718.dtsi +1 −5
  7. arch/arm/boot/dts/dra7-l4.dtsi +0 −22
  8. arch/arm/boot/dts/dra71x.dtsi +0 −4
  9. arch/arm/boot/dts/dra72x.dtsi +0 −4
  10. arch/arm/boot/dts/dra74x.dtsi +49 −43
  11. arch/arm/boot/dts/qcom-sdx55-t55.dts +1 −1
  12. arch/arm/boot/dts/qcom-sdx55-telit-fn980-tlb.dts +2 −2
  13. arch/arm/boot/dts/ste-href.dtsi +7 −0
  14. arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts +1 −1
  15. arch/arm/mach-exynos/exynos.c +2 −0
  16. arch/arm/mach-imx/Makefile +1 −1
  17. arch/arm/mach-imx/common.h +3 −0
  18. arch/arm/mach-imx/headsmp.S +9 −0
  19. arch/arm/mach-imx/hotplug.c +3 −0
  20. arch/arm/mach-imx/mach-imx50.c +7 −0
  21. arch/arm/mach-imx/mach-imx6q.c +0 −88
  22. arch/arm/mach-imx/mach-imx6sx.c +0 −26
  23. arch/arm/mach-imx/mach-imx7d.c +2 −23
  24. arch/arm/mach-imx/platsmp.c +26 −0
  25. arch/arm/mach-imx/src.c +92 −9
  26. arch/arm/mach-imx/suspend-imx53.S +2 −2
  27. arch/arm/mach-ixp4xx/Kconfig +22 −13
  28. arch/arm/mach-ixp4xx/avila-setup.c +1 −0
  29. arch/arm/mach-ixp4xx/common.c +45 −2
  30. arch/arm/mach-ixp4xx/fsg-setup.c +1 −0
  31. arch/arm/mach-ixp4xx/include/mach/cpu.h +0 −54
  32. arch/arm/mach-ixp4xx/include/mach/hardware.h +1 −1
  33. arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h +4 −57
  34. arch/arm/mach-ixp4xx/include/mach/platform.h +0 −14
  35. arch/arm/mach-ixp4xx/ixp4xx-of.c +6 −2
  36. arch/arm/mach-ixp4xx/nas100d-setup.c +1 −0
  37. arch/arm/mach-ixp4xx/nslu2-setup.c +1 −0
  38. arch/arm/mach-omap1/Kconfig +6 −6
  39. arch/arm/mach-omap2/cm.h +0 −1
  40. arch/arm/mach-omap2/cm_common.c +0 −13
  41. arch/arm/mach-omap2/common.h +0 −1
  42. arch/arm/mach-omap2/control.c +0 −5
  43. arch/arm/mach-omap2/control.h +0 −1
  44. arch/arm/mach-omap2/pm33xx-core.c +40 −0
  45. arch/arm/mach-s3c/mach-rx1950.c +0 −1
  46. arch/arm64/Kconfig.platforms +1 −0
  47. arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +1 −1
  48. arch/arm64/boot/dts/rockchip/rk3399.dtsi +1 −1
  49. drivers/ata/Kconfig +1 −1
  50. drivers/ata/pata_ixp4xx_cf.c +1 −0
  51. drivers/char/hw_random/Kconfig +1 −1
  52. drivers/char/hw_random/ixp4xx-rng.c +28 −25
  53. drivers/crypto/ixp4xx_crypto.c +4 −0
  54. drivers/net/ethernet/xscale/ixp4xx_eth.c +2 −0
  55. drivers/net/ethernet/xscale/ptp_ixp46x.c +1 −2
  56. drivers/net/wan/ixp4xx_hss.c +1 −0
  57. drivers/pci/controller/Kconfig +8 −0
  58. drivers/pci/controller/Makefile +1 −0
  59. drivers/pci/controller/pci-ixp4xx.c +671 −0
  60. drivers/soc/imx/soc-imx.c +3 −0
  61. drivers/soc/ixp4xx/ixp4xx-npe.c +2 −0
  62. drivers/soc/ixp4xx/ixp4xx-qmgr.c +2 −0
  63. drivers/soc/tegra/Kconfig +2 −0
  64. drivers/soc/tegra/common.c +97 −0
  65. drivers/soc/tegra/fuse/fuse-tegra.c +2 −4
  66. drivers/soc/tegra/fuse/fuse-tegra30.c +2 −1
  67. drivers/soc/tegra/pmc.c +144 −0
  68. drivers/soc/tegra/regulators-tegra20.c +92 −2
  69. drivers/soc/tegra/regulators-tegra30.c +91 −2
  70. include/linux/platform_data/pata_ixp4xx_cf.h +21 −0
  71. include/linux/soc/ixp4xx/cpu.h +106 −0
  72. include/linux/soc/samsung/exynos-regs-pmu.h +0 −6
  73. include/soc/imx/cpu.h +1 −0
  74. include/soc/tegra/common.h +31 −0
  75. include/soc/tegra/fuse.h +17 −3
  76. include/soc/tegra/pmc.h +7 −0
Documentation/devicetree/bindings/pci/intel,ixp4xx-pci.yaml+100−0
@@ -0,0 +1,100 @@
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+ };
Documentation/devicetree/bindings/rng/intel,ixp46x-rng.yaml+36−0
@@ -0,0 +1,36 @@
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+
MAINTAINERS+12−6
@@ -2210,6 +2210,7 @@ M: Daniel Palmer <daniel@thingy.jp> · 2209 unmodified lines
22102210 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
22112211 S: Maintained
22122212 W: http://linux-chenxing.org/
2213+T: git git://github.com/linux-chenxing/linux.git
22132214 F: Documentation/devicetree/bindings/arm/mstar/*
22142215 F: Documentation/devicetree/bindings/clock/mstar,msc313-mpll.yaml
22152216 F: Documentation/devicetree/bindings/gpio/mstar,msc313-gpio.yaml
@@ -2479,9 +2480,12 @@ F: drivers/*/*/*s3c24* · 263 unmodified lines
24792480 F: drivers/*/*s3c24*
24802481 F: drivers/*/*s3c64xx*
24812482 F: drivers/*/*s5pv210*
2483+F: drivers/clocksource/samsung_pwm_timer.c
24822484 F: drivers/memory/samsung/
2485+F: drivers/pwm/pwm-samsung.c
24832486 F: drivers/soc/samsung/
24842487 F: drivers/tty/serial/samsung*
2488+F: include/clocksource/samsung_pwm.h
24852489 F: include/linux/platform_data/*s3c*
24862490 F: include/linux/serial_s3c.h
24872491 F: include/linux/soc/samsung/
@@ -9381,6 +9385,7 @@ F: include/linux/soc/ixp4xx/qmgr.h · 6893 unmodified lines
93819385 INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
93829386 M: Deepak Saxena <dsaxena@plexity.net>
93839387 S: Maintained
9388+F: Documentation/devicetree/bindings/display/intel,ixp46x-rng.yaml
93849389 F: drivers/char/hw_random/ixp4xx-rng.c
93859390
93869391 INTEL KEEM BAY DRM DRIVER
@@ -13510,12 +13515,6 @@ L: linux-omap@vger.kernel.org · 4123 unmodified lines
1351013515 S: Maintained
1351113516 F: arch/arm/mach-omap2/omap_hwmod*data*
1351213517
13513−OMAP HWMOD DATA FOR OMAP4-BASED DEVICES
13514−M: Benoît Cousson <bcousson@baylibre.com>
13515−L: linux-omap@vger.kernel.org
13516−S: Maintained
13517−F: arch/arm/mach-omap2/omap_hwmod_44xx_data.c
13518−
1351913518 OMAP HWMOD SUPPORT
1352013519 M: Benoît Cousson <bcousson@baylibre.com>
1352113520 M: Paul Walmsley <paul@pwsan.com>
@@ -14179,6 +14178,12 @@ S: Maintained · 657 unmodified lines
1417914178 F: Documentation/devicetree/bindings/pci/sifive,fu740-pcie.yaml
1418014179 F: drivers/pci/controller/dwc/pcie-fu740.c
1418114180
14181+PCI DRIVER FOR INTEL IXP4XX
14182+M: Linus Walleij <linus.walleij@linaro.org>
14183+S: Maintained
14184+F: Documentation/devicetree/bindings/pci/intel,ixp4xx-pci.yaml
14185+F: drivers/pci/controller/pci-ixp4xx.c
14186+
1418214187 PCI DRIVER FOR INTEL VOLUME MANAGEMENT DEVICE (VMD)
1418314188 M: Jonathan Derrick <jonathan.derrick@intel.com>
1418414189 L: linux-pci@vger.kernel.org
@@ -18126,6 +18131,7 @@ F: include/media/i2c/tw9910.h · 3941 unmodified lines
1812618131
1812718132 TEE SUBSYSTEM
1812818133 M: Jens Wiklander <jens.wiklander@linaro.org>
18134+R: Sumit Garg <sumit.garg@linaro.org>
1812918135 L: op-tee@lists.trustedfirmware.org
1813018136 S: Maintained
1813118137 F: Documentation/staging/tee.rst
arch/arm/Kconfig+2−1
@@ -394,7 +394,8 @@ config ARCH_IXP4XX · 393 unmodified lines
394394 select HAVE_PCI
395395 select IXP4XX_IRQ
396396 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
398399 select USB_EHCI_BIG_ENDIAN_DESC
399400 select USB_EHCI_BIG_ENDIAN_MMIO
400401 help
arch/arm/Kconfig.debug+13−2
@@ -609,6 +609,14 @@ choice · 608 unmodified lines
609609 when u-boot hands over to the kernel, the system
610610 silently crashes, with no serial output at all.
611611
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+
612620 config DEBUG_MT6589_UART0
613621 bool "Mediatek mt6589 UART0"
614622 depends on ARCH_MEDIATEK
@@ -1607,6 +1615,7 @@ config DEBUG_UART_PHYS · 992 unmodified lines
16071615 default 0x18000400 if DEBUG_BCM_HR2
16081616 default 0x18023000 if DEBUG_BCM_IPROC_UART3
16091617 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1
1618+ default 0x1f221000 if DEBUG_MSTARV7_PMUART
16101619 default 0x20001000 if DEBUG_HIP01_UART
16111620 default 0x20060000 if DEBUG_RK29_UART0
16121621 default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2
@@ -1724,6 +1733,7 @@ config DEBUG_UART_VIRT · 111 unmodified lines
17241733 default 0xf0100000 if DEBUG_DIGICOLOR_UA0
17251734 default 0xf01fb000 if DEBUG_NOMADIK_UART
17261735 default 0xf0201000 if DEBUG_BCM2835 || DEBUG_BCM2836
1736+ default 0xf0221000 if DEBUG_MSTARV7_PMUART
17271737 default 0xf1000300 if DEBUG_BCM_5301X
17281738 default 0xf1000400 if DEBUG_BCM_HR2
17291739 default 0xf1002000 if DEBUG_MT8127_UART0
@@ -1805,8 +1815,8 @@ config DEBUG_UART_VIRT · 75 unmodified lines
18051815 default 0xfedc0000 if DEBUG_EP93XX
18061816 default 0xfee003f8 if DEBUG_FOOTBRIDGE_COM1
18071817 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART
1808− default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
1809− default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
1818+ default 0xfec00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
1819+ default 0xfec00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
18101820 default 0xfef36000 if DEBUG_HIGHBANK_UART
18111821 default 0xfefb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1
18121822 default 0xfefb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2
@@ -1829,6 +1839,7 @@ config DEBUG_UART_8250_SHIFT · 16 unmodified lines
18291839 default 0 if DEBUG_FOOTBRIDGE_COM1 || ARCH_IOP32X || DEBUG_BCM_5301X || \
18301840 DEBUG_BCM_HR2 || DEBUG_OMAP7XXUART1 || DEBUG_OMAP7XXUART2 || \
18311841 DEBUG_OMAP7XXUART3
1842+ default 3 if DEBUG_MSTARV7_PMUART
18321843 default 2
18331844
18341845 config DEBUG_UART_8250_WORD
arch/arm/boot/dts/am5718.dtsi+1−5
@@ -17,17 +17,13 @@ · 16 unmodified lines
1717 * VCP1, VCP2
1818 * MLB
1919 * ISS
20− * USB3, USB4
20+ * USB3
2121 */
2222
2323 &usb3_tm {
2424 status = "disabled";
2525 };
2626
27−&usb4_tm {
28− status = "disabled";
29−};
30−
3127 &atl_tm {
3228 status = "disabled";
3329 };
arch/arm/boot/dts/dra7-l4.dtsi+0−22
@@ -4129,28 +4129,6 @@ · 4128 unmodified lines
41294129 };
41304130 };
41314131
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−
41544132 target-module@170000 { /* 0x48970000, ap 21 0a.0 */
41554133 compatible = "ti,sysc-omap4", "ti,sysc";
41564134 reg = <0x170010 0x4>;
arch/arm/boot/dts/dra71x.dtsi+0−4
@@ -11,7 +11,3 @@ · 10 unmodified lines
1111 &rtctarget {
1212 status = "disabled";
1313 };
14−
15−&usb4_tm {
16− status = "disabled";
17−};
arch/arm/boot/dts/dra72x.dtsi+0−4
@@ -108,7 +108,3 @@ · 107 unmodified lines
108108 &pcie2_rc {
109109 compatible = "ti,dra726-pcie-rc", "ti,dra7-pcie";
110110 };
111−
112−&usb4_tm {
113− status = "disabled";
114−};
arch/arm/boot/dts/dra74x.dtsi+49−43
@@ -49,49 +49,6 @@ · 48 unmodified lines
4949 reg = <0x41500000 0x100>;
5050 };
5151
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− };
9552
9653 target-module@41501000 {
9754 compatible = "ti,sysc-omap2", "ti,sysc";
@@ -224,3 +181,52 @@ · 126 unmodified lines
224181 &pcie2_rc {
225182 compatible = "ti,dra746-pcie-rc", "ti,dra7-pcie";
226183 };
184+
185+&l4_per3 {
186+ segment@0 {
187+ usb4_tm: target-module@140000 { /* 0x48940000, ap 75 3c.0 */
188+ compatible = "ti,sysc-omap4", "ti,sysc";
189+ reg = <0x140000 0x4>,
190+ <0x140010 0x4>;
191+ reg-names = "rev", "sysc";
192+ ti,sysc-mask = <SYSC_OMAP4_DMADISABLE>;
193+ ti,sysc-midle = <SYSC_IDLE_FORCE>,
194+ <SYSC_IDLE_NO>,
195+ <SYSC_IDLE_SMART>,
196+ <SYSC_IDLE_SMART_WKUP>;
197+ ti,sysc-sidle = <SYSC_IDLE_FORCE>,
198+ <SYSC_IDLE_NO>,
199+ <SYSC_IDLE_SMART>,
200+ <SYSC_IDLE_SMART_WKUP>;
201+ /* Domains (P, C): l3init_pwrdm, l3init_clkdm */
202+ clocks = <&l3init_clkctrl DRA7_L3INIT_USB_OTG_SS4_CLKCTRL 0>;
203+ clock-names = "fck";
204+ #address-cells = <1>;
205+ #size-cells = <1>;
206+ ranges = <0x0 0x140000 0x20000>;
207+
208+ omap_dwc3_4: omap_dwc3_4@0 {
209+ compatible = "ti,dwc3";
210+ reg = <0 0x10000>;
211+ interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>;
212+ #address-cells = <1>;
213+ #size-cells = <1>;
214+ utmi-mode = <2>;
215+ ranges;
216+ status = "disabled";
217+ usb4: usb@10000 {
218+ compatible = "snps,dwc3";
219+ reg = <0x10000 0x17000>;
220+ interrupts = <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>,
221+ <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>,
222+ <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>;
223+ interrupt-names = "peripheral",
224+ "host",
225+ "otg";
226+ maximum-speed = "high-speed";
227+ dr_mode = "otg";
228+ };
229+ };
230+ };
231+ };
232+};
arch/arm/boot/dts/qcom-sdx55-t55.dts+1−1
@@ -250,7 +250,7 @@ · 249 unmodified lines
250250 nand-ecc-step-size = <512>;
251251 nand-bus-width = <8>;
252252 /* efs2 partition is secured */
253− secure-regions = <0x500000 0xb00000>;
253+ secure-regions = /bits/ 64 <0x500000 0xb00000>;
254254 };
255255 };
256256
arch/arm/boot/dts/qcom-sdx55-telit-fn980-tlb.dts+2−2
@@ -250,8 +250,8 @@ · 249 unmodified lines
250250 nand-ecc-step-size = <512>;
251251 nand-bus-width = <8>;
252252 /* ico and efs2 partitions are secured */
253− secure-regions = <0x500000 0x500000
254− 0xa00000 0xb00000>;
253+ secure-regions = /bits/ 64 <0x500000 0x500000
254+ 0xa00000 0xb00000>;
255255 };
256256 };
257257
arch/arm/boot/dts/ste-href.dtsi+7−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 */
55
66 #include <dt-bindings/interrupt-controller/irq.h>
7+#include <dt-bindings/leds/common.h>
78 #include "ste-href-family-pinctrl.dtsi"
89
910 / {
@@ -64,17 +65,20 @@ · 54 unmodified lines
6465 reg = <0>;
6566 led-cur = /bits/ 8 <0x2f>;
6667 max-cur = /bits/ 8 <0x5f>;
68+ color = <LED_COLOR_ID_BLUE>;
6769 linux,default-trigger = "heartbeat";
6870 };
6971 chan@1 {
7072 reg = <1>;
7173 led-cur = /bits/ 8 <0x2f>;
7274 max-cur = /bits/ 8 <0x5f>;
75+ color = <LED_COLOR_ID_BLUE>;
7376 };
7477 chan@2 {
7578 reg = <2>;
7679 led-cur = /bits/ 8 <0x2f>;
7780 max-cur = /bits/ 8 <0x5f>;
81+ color = <LED_COLOR_ID_BLUE>;
7882 };
7983 };
8084 lp5521@34 {
@@ -88,16 +92,19 @@ · 7 unmodified lines
8892 reg = <0>;
8993 led-cur = /bits/ 8 <0x2f>;
9094 max-cur = /bits/ 8 <0x5f>;
95+ color = <LED_COLOR_ID_BLUE>;
9196 };
9297 chan@1 {
9398 reg = <1>;
9499 led-cur = /bits/ 8 <0x2f>;
95100 max-cur = /bits/ 8 <0x5f>;
101+ color = <LED_COLOR_ID_BLUE>;
96102 };
97103 chan@2 {
98104 reg = <2>;
99105 led-cur = /bits/ 8 <0x2f>;
100106 max-cur = /bits/ 8 <0x5f>;
107+ color = <LED_COLOR_ID_BLUE>;
101108 };
102109 };
103110 bh1780@29 {
arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts+1−1
@@ -85,7 +85,7 @@ · 84 unmodified lines
8585 pinctrl-0 = <&emac_rgmii_pins>;
8686 phy-supply = <&reg_gmac_3v3>;
8787 phy-handle = <&ext_rgmii_phy>;
88− phy-mode = "rgmii";
88+ phy-mode = "rgmii-id";
8989
9090 status = "okay";
9191 };
arch/arm/mach-exynos/exynos.c+2−0
@@ -55,6 +55,7 @@ void __init exynos_sysram_init(void) · 54 unmodified lines
5555 sysram_base_addr = of_iomap(node, 0);
5656 sysram_base_phys = of_translate_address(node,
5757 of_get_address(node, 0, NULL, NULL));
58+ of_node_put(node);
5859 break;
5960 }
6061
@@ -62,6 +63,7 @@ void __init exynos_sysram_init(void) · 1 unmodified line
6263 if (!of_device_is_available(node))
6364 continue;
6465 sysram_ns_base_addr = of_iomap(node, 0);
66+ of_node_put(node);
6567 break;
6668 }
6769 }
arch/arm/mach-imx/Makefile+1−1
@@ -35,7 +35,7 @@ obj-$(CONFIG_HAVE_IMX_ANATOP) += anatop.o · 34 unmodified lines
3535 obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o
3636 obj-$(CONFIG_HAVE_IMX_MMDC) += mmdc.o
3737 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),)
3939 AFLAGS_headsmp.o :=-Wa,-march=armv7-a
4040 obj-$(CONFIG_SMP) += headsmp.o platsmp.o
4141 obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
arch/arm/mach-imx/common.h+3−0
@@ -68,11 +68,13 @@ void imx_set_cpu_arg(int cpu, u32 arg); · 67 unmodified lines
6868 void v7_secondary_startup(void);
6969 void imx_scu_map_io(void);
7070 void imx_smp_prepare(void);
71+void imx_gpcv2_set_core1_pdn_pup_by_software(bool pdn);
7172 #else
7273 static inline void imx_scu_map_io(void) {}
7374 static inline void imx_smp_prepare(void) {}
7475 #endif
7576 void imx_src_init(void);
77+void imx7_src_init(void);
7678 void imx_gpc_pre_suspend(bool arm_power_off);
7779 void imx_gpc_post_resume(void);
7880 void imx_gpc_mask_all(void);
@@ -131,6 +133,7 @@ static inline void imx_init_l2cache(void) {} · 52 unmodified lines
131133 #endif
132134
133135 extern const struct smp_operations imx_smp_ops;
136+extern const struct smp_operations imx7_smp_ops;
134137 extern const struct smp_operations ls1021a_smp_ops;
135138
136139 #endif
arch/arm/mach-imx/headsmp.S+9−0
@@ -21,6 +21,15 @@ diag_reg_offset: · 20 unmodified lines
2121
2222 ENTRY(v7_secondary_startup)
2323 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+
2433 set_diag_reg
2534 b secondary_startup
2635 ENDPROC(v7_secondary_startup)
arch/arm/mach-imx/hotplug.c+3−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <asm/proc-fns.h>
1212
1313 #include "common.h"
14+#include "hardware.h"
1415
1516 /*
1617 * platform-specific code to shutdown a CPU
@@ -40,5 +41,7 @@ int imx_cpu_kill(unsigned int cpu) · 23 unmodified lines
4041 return 0;
4142 imx_enable_cpu(cpu, false);
4243 imx_set_cpu_arg(cpu, 0);
44+ if (cpu_is_imx7d())
45+ imx_gpcv2_set_core1_pdn_pup_by_software(true);
4346 return 1;
4447 }
arch/arm/mach-imx/mach-imx50.c+7−0
@@ -9,6 +9,12 @@ · 8 unmodified lines
99 #include <asm/mach/arch.h>
1010
1111 #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+}
1218
1319 static const char * const imx50_dt_board_compat[] __initconst = {
1420 "fsl,imx50",
@@ -16,5 +22,6 @@ static const char * const imx50_dt_board_compat[] __initconst = { · 1 unmodified line
1622 };
1723
1824 DT_MACHINE_START(IMX50_DT, "Freescale i.MX50 (Device Tree Support)")
25+ .init_early = imx50_init_early,
1926 .dt_compat = imx50_dt_board_compat,
2027 MACHINE_END
arch/arm/mach-imx/mach-imx6q.c+0−88
@@ -40,27 +40,6 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev) · 39 unmodified lines
4040 return 0;
4141 }
4242
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−
6443 /*
6544 * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High
6645 * as they are used for slots1-7 PERST#
@@ -89,75 +68,11 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, ventana_pciesw_early_fixup); · 22 unmodified lines
8968 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, ventana_pciesw_early_fixup);
9069 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, ventana_pciesw_early_fixup);
9170
92−static int ar8031_phy_fixup(struct phy_device *dev)
93−{
94− u16 val;
95−
96− /* To enable AR8031 output a 125MHz clk from CLK_25M */
97− phy_write(dev, 0xd, 0x7);
98− phy_write(dev, 0xe, 0x8016);
99− phy_write(dev, 0xd, 0x4007);
100−
101− val = phy_read(dev, 0xe);
102− val &= 0xffe3;
103− val |= 0x18;
104− phy_write(dev, 0xe, val);
105−
106− /* introduce tx clock delay */
107− phy_write(dev, 0x1d, 0x5);
108− val = phy_read(dev, 0x1e);
109− val |= 0x0100;
110− phy_write(dev, 0x1e, val);
111−
112− return 0;
113−}
114−
115−#define PHY_ID_AR8031 0x004dd074
116−
117−static int ar8035_phy_fixup(struct phy_device *dev)
118−{
119− u16 val;
120−
121− /* Ar803x phy SmartEEE feature cause link status generates glitch,
122− * which cause ethernet link down/up issue, so disable SmartEEE
123− */
124− phy_write(dev, 0xd, 0x3);
125− phy_write(dev, 0xe, 0x805d);
126− phy_write(dev, 0xd, 0x4003);
127−
128− val = phy_read(dev, 0xe);
129− phy_write(dev, 0xe, val & ~(1 << 8));
130−
131− /*
132− * Enable 125MHz clock from CLK_25M on the AR8031. This
133− * is fed in to the IMX6 on the ENET_REF_CLK (V22) pad.
134− * Also, introduce a tx clock delay.
135− *
136− * This is the same as is the AR8031 fixup.
137− */
138− ar8031_phy_fixup(dev);
139−
140− /*check phy power*/
141− val = phy_read(dev, 0x0);
142− if (val & BMCR_PDOWN)
143− phy_write(dev, 0x0, val & ~BMCR_PDOWN);
144−
145− return 0;
146−}
147−
148−#define PHY_ID_AR8035 0x004dd072
149−
15071 static void __init imx6q_enet_phy_init(void)
15172 {
15273 if (IS_BUILTIN(CONFIG_PHYLIB)) {
15374 phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
15475 ksz9021rn_phy_fixup);
155− phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK,
156− ksz9031rn_phy_fixup);
157− phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef,
158− ar8031_phy_fixup);
159− phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,
160− ar8035_phy_fixup);
16176 }
16277 }
16378
@@ -257,9 +172,6 @@ static void __init imx6q_init_machine(void) · 93 unmodified lines
257172 imx_get_soc_revision());
258173
259174 imx6q_enet_phy_init();
260−
261− of_platform_default_populate(NULL, NULL, NULL);
262−
263175 imx_anatop_init();
264176 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init();
265177 imx6q_1588_init();
arch/arm/mach-imx/mach-imx6sx.c+0−26
@@ -15,31 +15,6 @@ · 14 unmodified lines
1515 #include "common.h"
1616 #include "cpuidle.h"
1717
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−
4318 static void __init imx6sx_enet_clk_sel(void)
4419 {
4520 struct regmap *gpr;
@@ -57,7 +32,6 @@ static void __init imx6sx_enet_clk_sel(void) · 11 unmodified lines
5732
5833 static inline void imx6sx_enet_init(void)
5934 {
60− imx6sx_enet_phy_init();
6135 imx6sx_enet_clk_sel();
6236 }
6337
arch/arm/mach-imx/mach-imx7d.c+2−23
@@ -14,25 +14,6 @@ · 13 unmodified lines
1414
1515 #include "common.h"
1616
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−
3617 static int bcm54220_phy_fixup(struct phy_device *dev)
3718 {
3819 /* enable RXC skew select RGMII copper mode */
@@ -44,14 +25,11 @@ static int bcm54220_phy_fixup(struct phy_device *dev) · 5 unmodified lines
4425 return 0;
4526 }
4627
47−#define PHY_ID_AR8031 0x004dd074
4828 #define PHY_ID_BCM54220 0x600d8589
4929
5030 static void __init imx7d_enet_phy_init(void)
5131 {
5232 if (IS_BUILTIN(CONFIG_PHYLIB)) {
53− phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff,
54− ar8031_phy_fixup);
5533 phy_register_fixup_for_uid(PHY_ID_BCM54220, 0xffffffff,
5634 bcm54220_phy_fixup);
5735 }
@@ -91,7 +69,7 @@ static void __init imx7d_init_late(void) · 33 unmodified lines
9169 static void __init imx7d_init_irq(void)
9270 {
9371 imx_init_revision_from_anatop();
94− imx_src_init();
72+ imx7_src_init();
9573 irqchip_init();
9674 }
9775
@@ -102,6 +80,7 @@ static const char *const imx7d_dt_compat[] __initconst = { · 4 unmodified lines
10280 };
10381
10482 DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual (Device Tree)")
83+ .smp = smp_ops(imx7_smp_ops),
10584 .init_irq = imx7d_init_irq,
10685 .init_machine = imx7d_init_machine,
10786 .init_late = imx7d_init_late,
arch/arm/mach-imx/platsmp.c+26−0
@@ -92,6 +92,32 @@ const struct smp_operations imx_smp_ops __initconst = { · 91 unmodified lines
9292 #endif
9393 };
9494
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+
95121 #define DCFG_CCSR_SCRATCHRW1 0x200
96122
97123 static int ls1021a_boot_secondary(unsigned int cpu, struct task_struct *idle)
arch/arm/mach-imx/src.c+92−9
@@ -6,15 +6,19 @@ · 5 unmodified lines
66
77 #include <linux/init.h>
88 #include <linux/io.h>
9+#include <linux/iopoll.h>
910 #include <linux/of.h>
1011 #include <linux/of_address.h>
1112 #include <linux/reset-controller.h>
1213 #include <linux/smp.h>
1314 #include <asm/smp_plat.h>
1415 #include "common.h"
16+#include "hardware.h"
1517
1618 #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)
1822 #define BP_SRC_SCR_WARM_RESET_ENABLE 0
1923 #define BP_SRC_SCR_SW_GPU_RST 1
2024 #define BP_SRC_SCR_SW_VPU_RST 2
@@ -23,9 +27,18 @@ · 2 unmodified lines
2327 #define BP_SRC_SCR_SW_IPU2_RST 12
2428 #define BP_SRC_SCR_CORE1_RST 14
2529 #define BP_SRC_SCR_CORE1_ENABLE 22
30+/* below is for i.MX7D */
31+#define SRC_A7RCR1 0x008
32+#define BP_SRC_A7RCR1_A7_CORE1_ENABLE 1
33+#define GPC_CPU_PGC_SW_PUP_REQ 0xf0
34+#define GPC_CPU_PGC_SW_PDN_REQ 0xfc
35+#define GPC_PGC_C1 0x840
36+#define BM_CPU_PGC_SW_PDN_PUP_REQ_CORE1_A7 0x2
2637
2738 static void __iomem *src_base;
2839 static DEFINE_SPINLOCK(scr_lock);
40+static bool gpr_v2;
41+static void __iomem *gpc_base;
2942
3043 static const int sw_reset_bits[5] = {
3144 BP_SRC_SCR_SW_GPU_RST,
@@ -73,17 +86,64 @@ static struct reset_controller_dev imx_reset_controller = { · 41 unmodified lines
7386 .nr_resets = ARRAY_SIZE(sw_reset_bits),
7487 };
7588
89+static void imx_gpcv2_set_m_core_pgc(bool enable, u32 offset)
90+{
91+ writel_relaxed(enable, gpc_base + offset);
92+}
93+
94+/*
95+ * The motivation for bringing up the second i.MX7D core inside the kernel
96+ * is that legacy vendor bootloaders usually do not implement PSCI support.
97+ * This is a significant blocker for systems in the field that are running old
98+ * bootloader versions to upgrade to a modern mainline kernel version, as only
99+ * one CPU of the i.MX7D would be brought up.
100+ * Bring up the second i.MX7D core inside the kernel to make the migration
101+ * path to mainline kernel easier for the existing iMX7D users.
102+ */
103+void imx_gpcv2_set_core1_pdn_pup_by_software(bool pdn)
104+{
105+ u32 reg = pdn ? GPC_CPU_PGC_SW_PDN_REQ : GPC_CPU_PGC_SW_PUP_REQ;
106+ u32 val, pup;
107+ int ret;
108+
109+ imx_gpcv2_set_m_core_pgc(true, GPC_PGC_C1);
110+ val = readl_relaxed(gpc_base + reg);
111+ val |= BM_CPU_PGC_SW_PDN_PUP_REQ_CORE1_A7;
112+ writel_relaxed(val, gpc_base + reg);
113+
114+ ret = readl_relaxed_poll_timeout_atomic(gpc_base + reg, pup,
115+ !(pup & BM_CPU_PGC_SW_PDN_PUP_REQ_CORE1_A7),
116+ 5, 1000000);
117+ if (ret < 0) {
118+ pr_err("i.MX7D: CORE1_A7 power up timeout\n");
119+ val &= ~BM_CPU_PGC_SW_PDN_PUP_REQ_CORE1_A7;
120+ writel_relaxed(val, gpc_base + reg);
121+ }
122+
123+ imx_gpcv2_set_m_core_pgc(false, GPC_PGC_C1);
124+}
125+
76126 void imx_enable_cpu(int cpu, bool enable)
77127 {
78128 u32 mask, val;
79129
80130 cpu = cpu_logical_map(cpu);
81− mask = 1 << (BP_SRC_SCR_CORE1_ENABLE + cpu - 1);
82131 spin_lock(&scr_lock);
83− val = readl_relaxed(src_base + SRC_SCR);
84− val = enable ? val | mask : val & ~mask;
85− val |= 1 << (BP_SRC_SCR_CORE1_RST + cpu - 1);
86− writel_relaxed(val, src_base + SRC_SCR);
132+ if (gpr_v2) {
133+ if (enable)
134+ imx_gpcv2_set_core1_pdn_pup_by_software(false);
135+
136+ mask = 1 << (BP_SRC_A7RCR1_A7_CORE1_ENABLE + cpu - 1);
137+ val = readl_relaxed(src_base + SRC_A7RCR1);
138+ val = enable ? val | mask : val & ~mask;
139+ writel_relaxed(val, src_base + SRC_A7RCR1);
140+ } else {
141+ mask = 1 << (BP_SRC_SCR_CORE1_ENABLE + cpu - 1);
142+ val = readl_relaxed(src_base + SRC_SCR);
143+ val = enable ? val | mask : val & ~mask;
144+ val |= 1 << (BP_SRC_SCR_CORE1_RST + cpu - 1);
145+ writel_relaxed(val, src_base + SRC_SCR);
146+ }
87147 spin_unlock(&scr_lock);
88148 }
89149
@@ -91,19 +151,19 @@ void imx_set_cpu_jump(int cpu, void *jump_addr) · 1 unmodified line
91151 {
92152 cpu = cpu_logical_map(cpu);
93153 writel_relaxed(__pa_symbol(jump_addr),
94− src_base + SRC_GPR1 + cpu * 8);
154+ src_base + SRC_GPR1(gpr_v2) + cpu * 8);
95155 }
96156
97157 u32 imx_get_cpu_arg(int cpu)
98158 {
99159 cpu = cpu_logical_map(cpu);
100− return readl_relaxed(src_base + SRC_GPR1 + cpu * 8 + 4);
160+ return readl_relaxed(src_base + SRC_GPR1(gpr_v2) + cpu * 8 + 4);
101161 }
102162
103163 void imx_set_cpu_arg(int cpu, u32 arg)
104164 {
105165 cpu = cpu_logical_map(cpu);
106− writel_relaxed(arg, src_base + SRC_GPR1 + cpu * 8 + 4);
166+ writel_relaxed(arg, src_base + SRC_GPR1(gpr_v2) + cpu * 8 + 4);
107167 }
108168
109169 void __init imx_src_init(void)
@@ -131,3 +191,26 @@ void __init imx_src_init(void) · 21 unmodified lines
131191 writel_relaxed(val, src_base + SRC_SCR);
132192 spin_unlock(&scr_lock);
133193 }
194+
195+void __init imx7_src_init(void)
196+{
197+ struct device_node *np;
198+
199+ gpr_v2 = true;
200+
201+ np = of_find_compatible_node(NULL, NULL, "fsl,imx7d-src");
202+ if (!np)
203+ return;
204+
205+ src_base = of_iomap(np, 0);
206+ if (!src_base)
207+ return;
208+
209+ np = of_find_compatible_node(NULL, NULL, "fsl,imx7d-gpc");
210+ if (!np)
211+ return;
212+
213+ gpc_base = of_iomap(np, 0);
214+ if (!gpc_base)
215+ return;
216+}
arch/arm/mach-imx/suspend-imx53.S+2−2
@@ -28,11 +28,11 @@ · 27 unmodified lines
2828 * ^
2929 * ^
3030 * imx53_suspend code
31− * PM_INFO structure(imx53_suspend_info)
31+ * PM_INFO structure(imx5_cpu_suspend_info)
3232 * ======================== low address =======================
3333 */
3434
35−/* Offsets of members of struct imx53_suspend_info */
35+/* Offsets of members of struct imx5_cpu_suspend_info */
3636 #define SUSPEND_INFO_MX53_M4IF_V_OFFSET 0x0
3737 #define SUSPEND_INFO_MX53_IOMUXC_V_OFFSET 0x4
3838 #define SUSPEND_INFO_MX53_IO_COUNT_OFFSET 0x8
arch/arm/mach-ixp4xx/Kconfig+22−13
@@ -7,7 +7,7 @@ comment "IXP4xx Platforms" · 6 unmodified lines
77
88 config MACH_IXP4XX_OF
99 bool
10− prompt "Devce Tree IXP4xx boards"
10+ prompt "Device Tree IXP4xx boards"
1111 default y
1212 select ARM_APPENDED_DTB # Old Redboot bootloaders deployed
1313 select I2C
@@ -20,7 +20,7 @@ config MACH_IXP4XX_OF · 6 unmodified lines
2020 config MACH_NSLU2
2121 bool
2222 prompt "Linksys NSLU2"
23− select FORCE_PCI
23+ depends on IXP4XX_PCI_LEGACY
2424 help
2525 Say 'Y' here if you want your kernel to support Linksys's
2626 NSLU2 NAS device. For more information on this platform,
@@ -28,7 +28,7 @@ config MACH_NSLU2 · 1 unmodified line
2828
2929 config MACH_AVILA
3030 bool "Avila"
31− select FORCE_PCI
31+ depends on IXP4XX_PCI_LEGACY
3232 help
3333 Say 'Y' here if you want your kernel to support the Gateworks
3434 Avila Network Platform. For more information on this platform,
@@ -44,7 +44,7 @@ config MACH_LOFT · 9 unmodified lines
4444
4545 config ARCH_ADI_COYOTE
4646 bool "Coyote"
47− select FORCE_PCI
47+ depends on IXP4XX_PCI_LEGACY
4848 help
4949 Say 'Y' here if you want your kernel to support the ADI
5050 Engineering Coyote Gateway Reference Platform. For more
@@ -52,7 +52,7 @@ config ARCH_ADI_COYOTE · 1 unmodified line
5252
5353 config MACH_GATEWAY7001
5454 bool "Gateway 7001"
55− select FORCE_PCI
55+ depends on IXP4XX_PCI_LEGACY
5656 help
5757 Say 'Y' here if you want your kernel to support Gateway's
5858 7001 Access Point. For more information on this platform,
@@ -60,7 +60,7 @@ config MACH_GATEWAY7001 · 1 unmodified line
6060
6161 config MACH_WG302V2
6262 bool "Netgear WG302 v2 / WAG302 v2"
63− select FORCE_PCI
63+ depends on IXP4XX_PCI_LEGACY
6464 help
6565 Say 'Y' here if you want your kernel to support Netgear's
6666 WG302 v2 or WAG302 v2 Access Points. For more information
@@ -68,6 +68,7 @@ config MACH_WG302V2 · 1 unmodified line
6868
6969 config ARCH_IXDP425
7070 bool "IXDP425"
71+ depends on IXP4XX_PCI_LEGACY
7172 help
7273 Say 'Y' here if you want your kernel to support Intel's
7374 IXDP425 Development Platform (Also known as Richfield).
@@ -75,6 +76,7 @@ config ARCH_IXDP425 · 1 unmodified line
7576
7677 config MACH_IXDPG425
7778 bool "IXDPG425"
79+ depends on IXP4XX_PCI_LEGACY
7880 help
7981 Say 'Y' here if you want your kernel to support Intel's
8082 IXDPG425 Development Platform (Also known as Montajade).
@@ -120,7 +122,7 @@ config ARCH_PRPMC1100 · 39 unmodified lines
120122 config MACH_NAS100D
121123 bool
122124 prompt "NAS100D"
123− select FORCE_PCI
125+ depends on IXP4XX_PCI_LEGACY
124126 help
125127 Say 'Y' here if you want your kernel to support Iomega's
126128 NAS 100d device. For more information on this platform,
@@ -129,7 +131,7 @@ config MACH_NAS100D · 2 unmodified lines
129131 config MACH_DSMG600
130132 bool
131133 prompt "D-Link DSM-G600 RevA"
132− select FORCE_PCI
134+ depends on IXP4XX_PCI_LEGACY
133135 help
134136 Say 'Y' here if you want your kernel to support D-Link's
135137 DSM-G600 RevA device. For more information on this platform,
@@ -143,7 +145,7 @@ config ARCH_IXDP4XX · 7 unmodified lines
143145 config MACH_FSG
144146 bool
145147 prompt "Freecom FSG-3"
146− select FORCE_PCI
148+ depends on IXP4XX_PCI_LEGACY
147149 help
148150 Say 'Y' here if you want your kernel to support Freecom's
149151 FSG-3 device. For more information on this platform,
@@ -152,7 +154,7 @@ config MACH_FSG · 2 unmodified lines
152154 config MACH_ARCOM_VULCAN
153155 bool
154156 prompt "Arcom/Eurotech Vulcan"
155− select FORCE_PCI
157+ depends on IXP4XX_PCI_LEGACY
156158 help
157159 Say 'Y' here if you want your kernel to support Arcom's
158160 Vulcan board.
@@ -173,7 +175,7 @@ config CPU_IXP43X · 14 unmodified lines
173175 config MACH_GTWX5715
174176 bool "Gemtek WX5715 (Linksys WRV54G)"
175177 depends on ARCH_IXP4XX
176− select FORCE_PCI
178+ depends on IXP4XX_PCI_LEGACY
177179 help
178180 This board is currently inside the Linksys WRV54G Gateways.
179181
@@ -196,7 +198,7 @@ config MACH_DEVIXP · 16 unmodified lines
196198
197199 config MACH_MICCPT
198200 bool "Omicron MICCPT"
199− select FORCE_PCI
201+ depends on IXP4XX_PCI_LEGACY
200202 help
201203 Say 'Y' here if you want your kernel to support the MICCPT
202204 board from OMICRON electronics GmbH.
@@ -209,9 +211,16 @@ config MACH_MIC256 · 6 unmodified lines
209211
210212 comment "IXP4xx Options"
211213
214+config IXP4XX_PCI_LEGACY
215+ bool "IXP4xx legacy PCI driver support"
216+ depends on PCI
217+ help
218+ Selects legacy PCI driver.
219+ Not recommended for new development.
220+
212221 config IXP4XX_INDIRECT_PCI
213222 bool "Use indirect PCI memory access"
214− depends on PCI
223+ depends on IXP4XX_PCI_LEGACY
215224 help
216225 IXP4xx provides two methods of accessing PCI memory space:
217226
arch/arm/mach-ixp4xx/avila-setup.c+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/tty.h>
2020 #include <linux/serial_8250.h>
2121 #include <linux/gpio/machine.h>
22+#include <linux/platform_data/pata_ixp4xx_cf.h>
2223 #include <asm/types.h>
2324 #include <asm/setup.h>
2425 #include <asm/memory.h>
arch/arm/mach-ixp4xx/common.c+45−2
@@ -27,12 +27,12 @@ · 26 unmodified lines
2727 #include <linux/cpu.h>
2828 #include <linux/pci.h>
2929 #include <linux/sched_clock.h>
30+#include <linux/soc/ixp4xx/cpu.h>
3031 #include <linux/irqchip/irq-ixp4xx.h>
3132 #include <linux/platform_data/timer-ixp4xx.h>
3233 #include <linux/dma-map-ops.h>
3334 #include <mach/udc.h>
3435 #include <mach/hardware.h>
35−#include <mach/io.h>
3636 #include <linux/uaccess.h>
3737 #include <asm/page.h>
3838 #include <asm/exception.h>
@@ -44,6 +44,27 @@ · 5 unmodified lines
4444
4545 #include "irqs.h"
4646
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);
67+
4768 #define IXP4XX_TIMER_FREQ 66666000
4869
4970 /*************************************************************************
@@ -215,6 +236,27 @@ static struct resource ixp46x_i2c_resources[] = { · 165 unmodified lines
215236 }
216237 };
217238
239+/* A single 32-bit register on IXP46x */
240+#define IXP4XX_HWRANDOM_BASE_PHYS 0x70002100
241+
242+static struct resource ixp46x_hwrandom_resource[] = {
243+ {
244+ .start = IXP4XX_HWRANDOM_BASE_PHYS,
245+ .end = IXP4XX_HWRANDOM_BASE_PHYS + 0x3,
246+ .flags = IORESOURCE_MEM,
247+ },
248+};
249+
250+static struct platform_device ixp46x_hwrandom_device = {
251+ .name = "ixp4xx-hwrandom",
252+ .id = -1,
253+ .dev = {
254+ .coherent_dma_mask = DMA_BIT_MASK(32),
255+ },
256+ .resource = ixp46x_hwrandom_resource,
257+ .num_resources = ARRAY_SIZE(ixp46x_hwrandom_resource),
258+};
259+
218260 /*
219261 * I2C controller. The IXP46x uses the same block as the IOP3xx, so
220262 * we just use the same device name.
@@ -227,7 +269,8 @@ static struct platform_device ixp46x_i2c_controller = { · 6 unmodified lines
227269 };
228270
229271 static struct platform_device *ixp46x_devices[] __initdata = {
230− &ixp46x_i2c_controller
272+ &ixp46x_hwrandom_device,
273+ &ixp46x_i2c_controller,
231274 };
232275
233276 unsigned long ixp4xx_exp_bus_size;
arch/arm/mach-ixp4xx/fsg-setup.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <asm/mach-types.h>
2929 #include <asm/mach/arch.h>
3030 #include <asm/mach/flash.h>
31+#include <mach/hardware.h>
3132
3233 #include "irqs.h"
3334
arch/arm/mach-ixp4xx/include/mach/cpu.h+0−54
@@ -1,54 +0,0 @@
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 */
arch/arm/mach-ixp4xx/include/mach/hardware.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #include "ixp4xx-regs.h"
2424
2525 #ifndef __ASSEMBLER__
26−#include <mach/cpu.h>
26+#include <linux/soc/ixp4xx/cpu.h>
2727 #endif
2828
2929 /* Platform helper functions and definitions */
arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h+4−57
@@ -45,21 +45,21 @@ · 44 unmodified lines
4545 * it can be used with the low-level debug code.
4646 */
4747 #define IXP4XX_PERIPHERAL_BASE_PHYS 0xC8000000
48−#define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFEF00000)
48+#define IXP4XX_PERIPHERAL_BASE_VIRT IOMEM(0xFEC00000)
4949 #define IXP4XX_PERIPHERAL_REGION_SIZE 0x00013000
5050
5151 /*
5252 * PCI Config registers
5353 */
5454 #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)
5656 #define IXP4XX_PCI_CFG_REGION_SIZE 0x00001000
5757
5858 /*
5959 * Expansion BUS Configuration registers
6060 */
6161 #define IXP4XX_EXP_CFG_BASE_PHYS 0xC4000000
62−#define IXP4XX_EXP_CFG_BASE_VIRT 0xFEF14000
62+#define IXP4XX_EXP_CFG_BASE_VIRT 0xFEC14000
6363 #define IXP4XX_EXP_CFG_REGION_SIZE 0x00001000
6464
6565 #define IXP4XX_EXP_CS0_OFFSET 0x00
@@ -120,6 +120,7 @@ · 54 unmodified lines
120120 #define IXP4XX_SSP_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x12000)
121121
122122
123+/* The UART is explicitly put in the beginning of fixmap */
123124 #define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000)
124125 #define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000)
125126 #define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000)
@@ -299,58 +300,4 @@ · 173 unmodified lines
299300
300301 #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */
301302
302−/* "fuse" bits of IXP_EXP_CFG2 */
303−/* All IXP4xx CPUs */
304−#define IXP4XX_FEATURE_RCOMP (1 << 0)
305−#define IXP4XX_FEATURE_USB_DEVICE (1 << 1)
306−#define IXP4XX_FEATURE_HASH (1 << 2)
307−#define IXP4XX_FEATURE_AES (1 << 3)
308−#define IXP4XX_FEATURE_DES (1 << 4)
309−#define IXP4XX_FEATURE_HDLC (1 << 5)
310−#define IXP4XX_FEATURE_AAL (1 << 6)
311−#define IXP4XX_FEATURE_HSS (1 << 7)
312−#define IXP4XX_FEATURE_UTOPIA (1 << 8)
313−#define IXP4XX_FEATURE_NPEB_ETH0 (1 << 9)
314−#define IXP4XX_FEATURE_NPEC_ETH (1 << 10)
315−#define IXP4XX_FEATURE_RESET_NPEA (1 << 11)
316−#define IXP4XX_FEATURE_RESET_NPEB (1 << 12)
317−#define IXP4XX_FEATURE_RESET_NPEC (1 << 13)
318−#define IXP4XX_FEATURE_PCI (1 << 14)
319−#define IXP4XX_FEATURE_UTOPIA_PHY_LIMIT (3 << 16)
320−#define IXP4XX_FEATURE_XSCALE_MAX_FREQ (3 << 22)
321−#define IXP42X_FEATURE_MASK (IXP4XX_FEATURE_RCOMP | \
322− IXP4XX_FEATURE_USB_DEVICE | \
323− IXP4XX_FEATURE_HASH | \
324− IXP4XX_FEATURE_AES | \
325− IXP4XX_FEATURE_DES | \
326− IXP4XX_FEATURE_HDLC | \
327− IXP4XX_FEATURE_AAL | \
328− IXP4XX_FEATURE_HSS | \
329− IXP4XX_FEATURE_UTOPIA | \
330− IXP4XX_FEATURE_NPEB_ETH0 | \
331− IXP4XX_FEATURE_NPEC_ETH | \
332− IXP4XX_FEATURE_RESET_NPEA | \
333− IXP4XX_FEATURE_RESET_NPEB | \
334− IXP4XX_FEATURE_RESET_NPEC | \
335− IXP4XX_FEATURE_PCI | \
336− IXP4XX_FEATURE_UTOPIA_PHY_LIMIT | \
337− IXP4XX_FEATURE_XSCALE_MAX_FREQ)
338−
339−
340−/* IXP43x/46x CPUs */
341−#define IXP4XX_FEATURE_ECC_TIMESYNC (1 << 15)
342−#define IXP4XX_FEATURE_USB_HOST (1 << 18)
343−#define IXP4XX_FEATURE_NPEA_ETH (1 << 19)
344−#define IXP43X_FEATURE_MASK (IXP42X_FEATURE_MASK | \
345− IXP4XX_FEATURE_ECC_TIMESYNC | \
346− IXP4XX_FEATURE_USB_HOST | \
347− IXP4XX_FEATURE_NPEA_ETH)
348−
349−/* IXP46x CPU (including IXP455) only */
350−#define IXP4XX_FEATURE_NPEB_ETH_1_TO_3 (1 << 20)
351−#define IXP4XX_FEATURE_RSA (1 << 21)
352−#define IXP46X_FEATURE_MASK (IXP43X_FEATURE_MASK | \
353− IXP4XX_FEATURE_NPEB_ETH_1_TO_3 | \
354− IXP4XX_FEATURE_RSA)
355−
356303 #endif
arch/arm/mach-ixp4xx/include/mach/platform.h+0−14
@@ -79,20 +79,6 @@ extern unsigned long ixp4xx_exp_bus_size; · 78 unmodified lines
7979 #define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66MHzi APB BUS */
8080 #define IXP4XX_UART_XTAL 14745600
8181
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−
9682 /*
9783 * Frequency of clock used for primary clocksource
9884 */
arch/arm/mach-ixp4xx/ixp4xx-of.c+6−2
@@ -9,8 +9,12 @@ · 8 unmodified lines
99 #include <asm/mach/arch.h>
1010 #include <asm/mach/map.h>
1111
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
1418
1519 static struct map_desc ixp4xx_of_io_desc[] __initdata = {
1620 /*
arch/arm/mach-ixp4xx/nas100d-setup.c+1−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include <asm/mach-types.h>
3434 #include <asm/mach/arch.h>
3535 #include <asm/mach/flash.h>
36+#include <mach/hardware.h>
3637
3738 #include "irqs.h"
3839
arch/arm/mach-ixp4xx/nslu2-setup.c+1−0
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 #include <asm/mach/arch.h>
3232 #include <asm/mach/flash.h>
3333 #include <asm/mach/time.h>
34+#include <mach/hardware.h>
3435
3536 #include "irqs.h"
3637
arch/arm/mach-omap1/Kconfig+6−6
@@ -65,14 +65,14 @@ config MACH_OMAP_INNOVATOR · 64 unmodified lines
6565 config MACH_OMAP_H2
6666 bool "TI H2 Support"
6767 depends on ARCH_OMAP16XX
68− help
68+ help
6969 TI OMAP 1610/1611B H2 board support. Say Y here if you have such
7070 a board.
7171
7272 config MACH_OMAP_H3
7373 bool "TI H3 Support"
7474 depends on ARCH_OMAP16XX
75− help
75+ help
7676 TI OMAP 1710 H3 board support. Say Y here if you have such
7777 a board.
7878
@@ -85,14 +85,14 @@ config MACH_HERALD · 6 unmodified lines
8585 config MACH_OMAP_OSK
8686 bool "TI OSK Support"
8787 depends on ARCH_OMAP16XX
88− help
88+ help
8989 TI OMAP 5912 OSK (OMAP Starter Kit) board support. Say Y here
9090 if you have such a board.
9191
9292 config OMAP_OSK_MISTRAL
9393 bool "Mistral QVGA board Support"
9494 depends on MACH_OMAP_OSK
95− help
95+ help
9696 The OSK supports an optional add-on board with a Quarter-VGA
9797 touchscreen, PDA-ish buttons, a resume button, bicolor LED,
9898 and camera connector. Say Y here if you have this board.
@@ -100,14 +100,14 @@ config OMAP_OSK_MISTRAL · 1 unmodified line
100100 config MACH_OMAP_PERSEUS2
101101 bool "TI Perseus2"
102102 depends on ARCH_OMAP730
103− help
103+ help
104104 Support for TI OMAP 730 Perseus2 board. Say Y here if you have such
105105 a board.
106106
107107 config MACH_OMAP_FSAMPLE
108108 bool "TI F-Sample"
109109 depends on ARCH_OMAP730
110− help
110+ help
111111 Support for TI OMAP 850 F-Sample board. Say Y here if you have such
112112 a board.
113113
arch/arm/mach-omap2/cm.h+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626
2727 extern struct omap_domain_base cm_base;
2828 extern struct omap_domain_base cm2_base;
29−extern void omap2_set_globals_cm(void __iomem *cm, void __iomem *cm2);
3029 # endif
3130
3231 /*
arch/arm/mach-omap2/cm_common.c+0−13
@@ -37,19 +37,6 @@ struct omap_domain_base cm2_base; · 36 unmodified lines
3737 #define CM_NO_CLOCKS 0x1
3838 #define CM_SINGLE_INSTANCE 0x2
3939
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−
5340 /**
5441 * cm_split_idlest_reg - split CM_IDLEST reg addr into its components
5542 * @idlest_reg: CM_IDLEST* virtual address
arch/arm/mach-omap2/common.h+0−1
@@ -130,7 +130,6 @@ void am33xx_init_early(void); · 129 unmodified lines
130130 void am35xx_init_early(void);
131131 void ti814x_init_early(void);
132132 void ti816x_init_early(void);
133−void am33xx_init_early(void);
134133 void am43xx_init_early(void);
135134 void am43xx_init_late(void);
136135 void omap4430_init_early(void);
arch/arm/mach-omap2/control.c+0−5
@@ -136,11 +136,6 @@ struct omap3_control_regs { · 135 unmodified lines
136136 static struct omap3_control_regs control_context;
137137 #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
138138
139−void __init omap2_set_globals_control(void __iomem *ctrl)
140−{
141− omap2_ctrl_base = ctrl;
142−}
143−
144139 u8 omap_ctrl_readb(u16 offset)
145140 {
146141 u32 val;
arch/arm/mach-omap2/control.h+0−1
@@ -528,7 +528,6 @@ extern int omap3_ctrl_save_padconf(void); · 527 unmodified lines
528528 void omap3_ctrl_init(void);
529529 int omap2_control_base_init(void);
530530 int omap_control_init(void);
531−void omap2_set_globals_control(void __iomem *ctrl);
532531 void __init omap3_control_legacy_iomap_init(void);
533532 #else
534533 #define omap_ctrl_readb(x) 0
arch/arm/mach-omap2/pm33xx-core.c+40−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88
99 #include <linux/cpuidle.h>
1010 #include <linux/platform_data/pm33xx.h>
11+#include <linux/suspend.h>
1112 #include <asm/cpuidle.h>
1213 #include <asm/smp_scu.h>
1314 #include <asm/suspend.h>
@@ -324,6 +325,44 @@ static struct am33xx_pm_platform_data *am33xx_pm_get_pdata(void) · 310 unmodified lines
324325 return NULL;
325326 }
326327
328+#ifdef CONFIG_SUSPEND
329+/*
330+ * Block system suspend initially. Later on pm33xx sets up it's own
331+ * platform_suspend_ops after probe. That depends also on loaded
332+ * wkup_m3_ipc and booted am335x-pm-firmware.elf.
333+ */
334+static int amx3_suspend_block(suspend_state_t state)
335+{
336+ pr_warn("PM not initialized for pm33xx, wkup_m3_ipc, or am335x-pm-firmware.elf\n");
337+
338+ return -EINVAL;
339+}
340+
341+static int amx3_pm_valid(suspend_state_t state)
342+{
343+ switch (state) {
344+ case PM_SUSPEND_STANDBY:
345+ return 1;
346+ default:
347+ return 0;
348+ }
349+}
350+
351+static const struct platform_suspend_ops amx3_blocked_pm_ops = {
352+ .begin = amx3_suspend_block,
353+ .valid = amx3_pm_valid,
354+};
355+
356+static void __init amx3_block_suspend(void)
357+{
358+ suspend_set_ops(&amx3_blocked_pm_ops);
359+}
360+#else
361+static inline void amx3_block_suspend(void)
362+{
363+}
364+#endif /* CONFIG_SUSPEND */
365+
327366 int __init amx3_common_pm_init(void)
328367 {
329368 struct am33xx_pm_platform_data *pdata;
@@ -337,6 +376,7 @@ int __init amx3_common_pm_init(void) · 7 unmodified lines
337376 devinfo.size_data = sizeof(*pdata);
338377 devinfo.id = -1;
339378 platform_device_register_full(&devinfo);
379+ amx3_block_suspend();
340380
341381 return 0;
342382 }
arch/arm/mach-s3c/mach-rx1950.c+0−1
@@ -271,7 +271,6 @@ static int rx1950_led_blink_set(struct gpio_desc *desc, int state, · 270 unmodified lines
271271 break;
272272 default:
273273 return -EINVAL;
274− break;
275274 }
276275
277276 if (delay_on && delay_off && !*delay_on && !*delay_off)
arch/arm64/Kconfig.platforms+1−0
@@ -16,6 +16,7 @@ config ARCH_SUNXI · 15 unmodified lines
1616 select IRQ_FASTEOI_HIERARCHY_HANDLERS
1717 select PINCTRL
1818 select RESET_CONTROLLER
19+ select SUN4I_TIMER
1920 help
2021 This enables support for Allwinner sunxi based SoCs like the A64.
2122
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
7979 &emac {
8080 pinctrl-names = "default";
8181 pinctrl-0 = <&rgmii_pins>;
82− phy-mode = "rgmii-id";
82+ phy-mode = "rgmii-txid";
8383 phy-handle = <&ext_rgmii_phy>;
8484 phy-supply = <&reg_dc1sw>;
8585 status = "okay";
arch/arm64/boot/dts/rockchip/rk3399.dtsi+1−1
@@ -227,7 +227,7 @@ · 226 unmodified lines
227227 <&pcie_phy 2>, <&pcie_phy 3>;
228228 phy-names = "pcie-phy-0", "pcie-phy-1",
229229 "pcie-phy-2", "pcie-phy-3";
230− ranges = <0x83000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000>,
230+ ranges = <0x82000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000>,
231231 <0x81000000 0x0 0xfbe00000 0x0 0xfbe00000 0x0 0x100000>;
232232 resets = <&cru SRST_PCIE_CORE>, <&cru SRST_PCIE_MGMT>,
233233 <&cru SRST_PCIE_MGMT_STICKY>, <&cru SRST_PCIE_PIPE>,
drivers/ata/Kconfig+1−1
@@ -1058,7 +1058,7 @@ config PATA_ISAPNP · 1057 unmodified lines
10581058
10591059 config PATA_IXP4XX_CF
10601060 tristate "IXP4XX Compact Flash support"
1061− depends on ARCH_IXP4XX
1061+ depends on ARCH_IXP4XX || COMPILE_TEST
10621062 help
10631063 This option enables support for a Compact Flash connected on
10641064 the ixp4xx expansion bus. This driver had been written for
drivers/ata/pata_ixp4xx_cf.c+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/libata.h>
1818 #include <linux/irq.h>
1919 #include <linux/platform_device.h>
20+#include <linux/platform_data/pata_ixp4xx_cf.h>
2021 #include <scsi/scsi_host.h>
2122
2223 #define DRV_NAME "pata_ixp4xx_cf"
drivers/char/hw_random/Kconfig+1−1
@@ -152,7 +152,7 @@ config HW_RANDOM_VIA · 151 unmodified lines
152152
153153 config HW_RANDOM_IXP4XX
154154 tristate "Intel IXP4xx NPU HW Pseudo-Random Number Generator support"
155− depends on ARCH_IXP4XX
155+ depends on ARCH_IXP4XX || COMPILE_TEST
156156 default HW_RANDOM
157157 help
158158 This driver provides kernel-side support for the Pseudo-Random
drivers/char/hw_random/ixp4xx-rng.c+28−25
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * drivers/char/hw_random/ixp4xx-rng.c
34 *
@@ -8,23 +9,20 @@ · 4 unmodified lines
89 * Copyright 2005 (c) MontaVista Software, Inc.
910 *
1011 * Fixes by Michael Buesch
11− *
12− * This file is licensed under the terms of the GNU General Public
13− * License version 2. This program is licensed "as is" without any
14− * warranty of any kind, whether express or implied.
1512 */
1613
1714 #include <linux/kernel.h>
1815 #include <linux/types.h>
1916 #include <linux/module.h>
2017 #include <linux/moduleparam.h>
18+#include <linux/platform_device.h>
2119 #include <linux/init.h>
2220 #include <linux/bitops.h>
2321 #include <linux/hw_random.h>
22+#include <linux/of.h>
23+#include <linux/soc/ixp4xx/cpu.h>
2424
2525 #include <asm/io.h>
26−#include <mach/hardware.h>
27−
2826
2927 static int ixp4xx_rng_data_read(struct hwrng *rng, u32 *buffer)
3028 {
@@ -40,35 +38,40 @@ static struct hwrng ixp4xx_rng_ops = { · 9 unmodified lines
4038 .data_read = ixp4xx_rng_data_read,
4139 };
4240
43−static int __init ixp4xx_rng_init(void)
41+static int ixp4xx_rng_probe(struct platform_device *pdev)
4442 {
4543 void __iomem * rng_base;
46− int err;
44+ struct device *dev = &pdev->dev;
45+ struct resource *res;
4746
4847 if (!cpu_is_ixp46x()) /* includes IXP455 */
4948 return -ENOSYS;
5049
51− rng_base = ioremap(0x70002100, 4);
52− if (!rng_base)
53− return -ENOMEM;
54− ixp4xx_rng_ops.priv = (unsigned long)rng_base;
55− err = hwrng_register(&ixp4xx_rng_ops);
56− if (err)
57− iounmap(rng_base);
50+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
51+ rng_base = devm_ioremap_resource(dev, res);
52+ if (IS_ERR(rng_base))
53+ return PTR_ERR(rng_base);
5854
59− return err;
55+ ixp4xx_rng_ops.priv = (unsigned long)rng_base;
56+ return devm_hwrng_register(dev, &ixp4xx_rng_ops);
6057 }
6158
62−static void __exit ixp4xx_rng_exit(void)
63−{
64− void __iomem * rng_base = (void __iomem *)ixp4xx_rng_ops.priv;
65−
66− hwrng_unregister(&ixp4xx_rng_ops);
67− iounmap(rng_base);
68−}
59+static const struct of_device_id ixp4xx_rng_of_match[] = {
60+ {
61+ .compatible = "intel,ixp46x-rng",
62+ },
63+ {},
64+};
65+MODULE_DEVICE_TABLE(of, ixp4xx_rng_of_match);
6966
70−module_init(ixp4xx_rng_init);
71−module_exit(ixp4xx_rng_exit);
67+static struct platform_driver ixp4xx_rng_driver = {
68+ .driver = {
69+ .name = "ixp4xx-hwrandom",
70+ .of_match_table = ixp4xx_rng_of_match,
71+ },
72+ .probe = ixp4xx_rng_probe,
73+};
74+module_platform_driver(ixp4xx_rng_driver);
7275
7376 MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
7477 MODULE_DESCRIPTION("H/W Pseudo-Random Number Generator (RNG) driver for IXP45x/46x");
drivers/crypto/ixp4xx_crypto.c+4−0
@@ -31,6 +31,10 @@ · 30 unmodified lines
3131 #include <linux/soc/ixp4xx/npe.h>
3232 #include <linux/soc/ixp4xx/qmgr.h>
3333
34+/* Intermittent includes, delete this after v5.14-rc1 */
35+#include <linux/soc/ixp4xx/cpu.h>
36+#include <mach/ixp4xx-regs.h>
37+
3438 #define MAX_KEYLEN 32
3539
3640 /* hash: cfgword + 2 * digestlen; crypt: keylen + cfgword */
drivers/net/ethernet/xscale/ixp4xx_eth.c+2−0
@@ -37,6 +37,8 @@ · 36 unmodified lines
3737 #include <linux/module.h>
3838 #include <linux/soc/ixp4xx/npe.h>
3939 #include <linux/soc/ixp4xx/qmgr.h>
40+#include <mach/hardware.h>
41+#include <linux/soc/ixp4xx/cpu.h>
4042
4143 #include "ixp46x_ts.h"
4244
drivers/net/ethernet/xscale/ptp_ixp46x.c+1−2
@@ -12,9 +12,8 @@ · 11 unmodified lines
1212 #include <linux/io.h>
1313 #include <linux/irq.h>
1414 #include <linux/kernel.h>
15−#include <linux/module.h>
16−
1715 #include <linux/ptp_clock_kernel.h>
16+#include <linux/soc/ixp4xx/cpu.h>
1817
1918 #include "ixp46x_ts.h"
2019
drivers/net/wan/ixp4xx_hss.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/slab.h>
2323 #include <linux/soc/ixp4xx/npe.h>
2424 #include <linux/soc/ixp4xx/qmgr.h>
25+#include <linux/soc/ixp4xx/cpu.h>
2526
2627 #define DEBUG_DESC 0
2728 #define DEBUG_RX 0
drivers/pci/controller/Kconfig+8−0
@@ -37,6 +37,14 @@ config PCI_FTPCI100 · 36 unmodified lines
3737 depends on OF
3838 default ARCH_GEMINI
3939
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+
4048 config PCI_TEGRA
4149 bool "NVIDIA Tegra PCIe controller"
4250 depends on ARCH_TEGRA || COMPILE_TEST
drivers/pci/controller/Makefile+1−0
@@ -1,6 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
22 obj-$(CONFIG_PCIE_CADENCE) += cadence/
33 obj-$(CONFIG_PCI_FTPCI100) += pci-ftpci100.o
4+obj-$(CONFIG_PCI_IXP4XX) += pci-ixp4xx.o
45 obj-$(CONFIG_PCI_HYPERV) += pci-hyperv.o
56 obj-$(CONFIG_PCI_HYPERV_INTERFACE) += pci-hyperv-intf.o
67 obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
drivers/pci/controller/pci-ixp4xx.c+671−0
@@ -0,0 +1,671 @@
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);
drivers/soc/imx/soc-imx.c+3−0
@@ -70,6 +70,9 @@ static int __init imx_soc_device_init(void) · 69 unmodified lines
7070 case MXC_CPU_MX35:
7171 soc_id = "i.MX35";
7272 break;
73+ case MXC_CPU_MX50:
74+ soc_id = "i.MX50";
75+ break;
7376 case MXC_CPU_MX51:
7477 ocotp_compat = "fsl,imx51-iim";
7578 soc_id = "i.MX51";
drivers/soc/ixp4xx/ixp4xx-npe.c+2−0
@@ -21,6 +21,8 @@ · 20 unmodified lines
2121 #include <linux/of_platform.h>
2222 #include <linux/platform_device.h>
2323 #include <linux/soc/ixp4xx/npe.h>
24+#include <mach/hardware.h>
25+#include <linux/soc/ixp4xx/cpu.h>
2426
2527 #define DEBUG_MSG 0
2628 #define DEBUG_FW 0
drivers/soc/ixp4xx/ixp4xx-qmgr.c+2−0
@@ -12,6 +12,8 @@ · 11 unmodified lines
1212 #include <linux/of.h>
1313 #include <linux/platform_device.h>
1414 #include <linux/soc/ixp4xx/qmgr.h>
15+#include <mach/hardware.h>
16+#include <linux/soc/ixp4xx/cpu.h>
1517
1618 static struct qmgr_regs __iomem *qmgr_regs;
1719 static int qmgr_irq_1;
drivers/soc/tegra/Kconfig+2−0
@@ -144,6 +144,8 @@ config SOC_TEGRA_FLOWCTRL · 143 unmodified lines
144144 config SOC_TEGRA_PMC
145145 bool
146146 select GENERIC_PINCONF
147+ select PM_OPP
148+ select PM_GENERIC_DOMAINS
147149
148150 config SOC_TEGRA_POWERGATE_BPMP
149151 def_bool y
drivers/soc/tegra/common.c+97−0
@@ -3,9 +3,16 @@ · 2 unmodified lines
33 * Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
44 */
55
6+#define dev_fmt(fmt) "tegra-soc: " fmt
7+
8+#include <linux/clk.h>
9+#include <linux/device.h>
10+#include <linux/export.h>
611 #include <linux/of.h>
12+#include <linux/pm_opp.h>
713
814 #include <soc/tegra/common.h>
15+#include <soc/tegra/fuse.h>
916
1017 static const struct of_device_id tegra_machine_match[] = {
1118 { .compatible = "nvidia,tegra20", },
@@ -31,3 +38,93 @@ bool soc_is_tegra(void) · 19 unmodified lines
3138
3239 return match != NULL;
3340 }
41+
42+static int tegra_core_dev_init_opp_state(struct device *dev)
43+{
44+ unsigned long rate;
45+ struct clk *clk;
46+ int err;
47+
48+ clk = devm_clk_get(dev, NULL);
49+ if (IS_ERR(clk)) {
50+ dev_err(dev, "failed to get clk: %pe\n", clk);
51+ return PTR_ERR(clk);
52+ }
53+
54+ rate = clk_get_rate(clk);
55+ if (!rate) {
56+ dev_err(dev, "failed to get clk rate\n");
57+ return -EINVAL;
58+ }
59+
60+ /* first dummy rate-setting initializes voltage vote */
61+ err = dev_pm_opp_set_rate(dev, rate);
62+ if (err) {
63+ dev_err(dev, "failed to initialize OPP clock: %d\n", err);
64+ return err;
65+ }
66+
67+ return 0;
68+}
69+
70+/**
71+ * devm_tegra_core_dev_init_opp_table() - initialize OPP table
72+ * @dev: device for which OPP table is initialized
73+ * @params: pointer to the OPP table configuration
74+ *
75+ * This function will initialize OPP table and sync OPP state of a Tegra SoC
76+ * core device.
77+ *
78+ * Return: 0 on success or errorno.
79+ */
80+int devm_tegra_core_dev_init_opp_table(struct device *dev,
81+ struct tegra_core_opp_params *params)
82+{
83+ u32 hw_version;
84+ int err;
85+
86+ err = devm_pm_opp_set_clkname(dev, NULL);
87+ if (err) {
88+ dev_err(dev, "failed to set OPP clk: %d\n", err);
89+ return err;
90+ }
91+
92+ /* Tegra114+ doesn't support OPP yet */
93+ if (!of_machine_is_compatible("nvidia,tegra20") &&
94+ !of_machine_is_compatible("nvidia,tegra30"))
95+ return -ENODEV;
96+
97+ if (of_machine_is_compatible("nvidia,tegra20"))
98+ hw_version = BIT(tegra_sku_info.soc_process_id);
99+ else
100+ hw_version = BIT(tegra_sku_info.soc_speedo_id);
101+
102+ err = devm_pm_opp_set_supported_hw(dev, &hw_version, 1);
103+ if (err) {
104+ dev_err(dev, "failed to set OPP supported HW: %d\n", err);
105+ return err;
106+ }
107+
108+ /*
109+ * Older device-trees have an empty OPP table, we will get
110+ * -ENODEV from devm_pm_opp_of_add_table() in this case.
111+ */
112+ err = devm_pm_opp_of_add_table(dev);
113+ if (err) {
114+ if (err == -ENODEV)
115+ dev_err_once(dev, "OPP table not found, please update device-tree\n");
116+ else
117+ dev_err(dev, "failed to add OPP table: %d\n", err);
118+
119+ return err;
120+ }
121+
122+ if (params->init_state) {
123+ err = tegra_core_dev_init_opp_state(dev);
124+ if (err)
125+ return err;
126+ }
127+
128+ return 0;
129+}
130+EXPORT_SYMBOL_GPL(devm_tegra_core_dev_init_opp_table);
drivers/soc/tegra/fuse/fuse-tegra.c+2−4
@@ -489,10 +489,8 @@ static int __init tegra_init_fuse(void) · 488 unmodified lines
489489 size_t size = sizeof(*fuse->lookups) * fuse->soc->num_lookups;
490490
491491 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);
496494 }
497495
498496 return 0;
drivers/soc/tegra/fuse/fuse-tegra30.c+2−1
@@ -37,7 +37,8 @@ · 36 unmodified lines
3737 defined(CONFIG_ARCH_TEGRA_132_SOC) || \
3838 defined(CONFIG_ARCH_TEGRA_210_SOC) || \
3939 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)
4142 static u32 tegra30_fuse_read_early(struct tegra_fuse *fuse, unsigned int offset)
4243 {
4344 if (WARN_ON(!fuse->base))
drivers/soc/tegra/pmc.c+144−0
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 #include <linux/pinctrl/pinctrl.h>
3939 #include <linux/platform_device.h>
4040 #include <linux/pm_domain.h>
41+#include <linux/pm_opp.h>
4142 #include <linux/reboot.h>
4243 #include <linux/regmap.h>
4344 #include <linux/reset.h>
@@ -428,6 +429,9 @@ struct tegra_pmc { · 384 unmodified lines
428429 struct irq_chip irq;
429430
430431 struct notifier_block clk_nb;
432+
433+ bool core_domain_state_synced;
434+ bool core_domain_registered;
431435 };
432436
433437 static struct tegra_pmc *pmc = &(struct tegra_pmc) {
@@ -1297,12 +1301,107 @@ free_mem: · 863 unmodified lines
12971301 return err;
12981302 }
12991303
1304+bool tegra_pmc_core_domain_state_synced(void)
1305+{
1306+ return pmc->core_domain_state_synced;
1307+}
1308+
1309+static int
1310+tegra_pmc_core_pd_set_performance_state(struct generic_pm_domain *genpd,
1311+ unsigned int level)
1312+{
1313+ struct dev_pm_opp *opp;
1314+ int err;
1315+
1316+ opp = dev_pm_opp_find_level_ceil(&genpd->dev, &level);
1317+ if (IS_ERR(opp)) {
1318+ dev_err(&genpd->dev, "failed to find OPP for level %u: %pe\n",
1319+ level, opp);
1320+ return PTR_ERR(opp);
1321+ }
1322+
1323+ mutex_lock(&pmc->powergates_lock);
1324+ err = dev_pm_opp_set_opp(pmc->dev, opp);
1325+ mutex_unlock(&pmc->powergates_lock);
1326+
1327+ dev_pm_opp_put(opp);
1328+
1329+ if (err) {
1330+ dev_err(&genpd->dev, "failed to set voltage to %duV: %d\n",
1331+ level, err);
1332+ return err;
1333+ }
1334+
1335+ return 0;
1336+}
1337+
1338+static unsigned int
1339+tegra_pmc_core_pd_opp_to_performance_state(struct generic_pm_domain *genpd,
1340+ struct dev_pm_opp *opp)
1341+{
1342+ return dev_pm_opp_get_level(opp);
1343+}
1344+
1345+static int tegra_pmc_core_pd_add(struct tegra_pmc *pmc, struct device_node *np)
1346+{
1347+ struct generic_pm_domain *genpd;
1348+ const char *rname = "core";
1349+ int err;
1350+
1351+ genpd = devm_kzalloc(pmc->dev, sizeof(*genpd), GFP_KERNEL);
1352+ if (!genpd)
1353+ return -ENOMEM;
1354+
1355+ genpd->name = np->name;
1356+ genpd->set_performance_state = tegra_pmc_core_pd_set_performance_state;
1357+ genpd->opp_to_performance_state = tegra_pmc_core_pd_opp_to_performance_state;
1358+
1359+ err = devm_pm_opp_set_regulators(pmc->dev, &rname, 1);
1360+ if (err)
1361+ return dev_err_probe(pmc->dev, err,
1362+ "failed to set core OPP regulator\n");
1363+
1364+ err = pm_genpd_init(genpd, NULL, false);
1365+ if (err) {
1366+ dev_err(pmc->dev, "failed to init core genpd: %d\n", err);
1367+ return err;
1368+ }
1369+
1370+ err = of_genpd_add_provider_simple(np, genpd);
1371+ if (err) {
1372+ dev_err(pmc->dev, "failed to add core genpd: %d\n", err);
1373+ goto remove_genpd;
1374+ }
1375+
1376+ pmc->core_domain_registered = true;
1377+
1378+ return 0;
1379+
1380+remove_genpd:
1381+ pm_genpd_remove(genpd);
1382+
1383+ return err;
1384+}
1385+
13001386 static int tegra_powergate_init(struct tegra_pmc *pmc,
13011387 struct device_node *parent)
13021388 {
1389+ struct of_phandle_args child_args, parent_args;
13031390 struct device_node *np, *child;
13041391 int err = 0;
13051392
1393+ /*
1394+ * Core power domain is the parent of powergate domains, hence it
1395+ * should be registered first.
1396+ */
1397+ np = of_get_child_by_name(parent, "core-domain");
1398+ if (np) {
1399+ err = tegra_pmc_core_pd_add(pmc, np);
1400+ of_node_put(np);
1401+ if (err)
1402+ return err;
1403+ }
1404+
13061405 np = of_get_child_by_name(parent, "powergates");
13071406 if (!np)
13081407 return 0;
@@ -1313,6 +1412,21 @@ static int tegra_powergate_init(struct tegra_pmc *pmc, · 4 unmodified lines
13131412 of_node_put(child);
13141413 break;
13151414 }
1415+
1416+ if (of_parse_phandle_with_args(child, "power-domains",
1417+ "#power-domain-cells",
1418+ 0, &parent_args))
1419+ continue;
1420+
1421+ child_args.np = child;
1422+ child_args.args_count = 0;
1423+
1424+ err = of_genpd_add_subdomain(&parent_args, &child_args);
1425+ of_node_put(parent_args.np);
1426+ if (err) {
1427+ of_node_put(child);
1428+ break;
1429+ }
13161430 }
13171431
13181432 of_node_put(np);
@@ -1356,6 +1470,12 @@ static void tegra_powergate_remove_all(struct device_node *parent) · 37 unmodified lines
13561470 }
13571471
13581472 of_node_put(np);
1473+
1474+ np = of_get_child_by_name(parent, "core-domain");
1475+ if (np) {
1476+ of_genpd_del_provider(np);
1477+ of_genpd_remove_last(np);
1478+ }
13591479 }
13601480
13611481 static const struct tegra_io_pad_soc *
@@ -3667,6 +3787,29 @@ static const struct of_device_id tegra_pmc_match[] = { · 2305 unmodified lines
36673787 { }
36683788 };
36693789
3790+static void tegra_pmc_sync_state(struct device *dev)
3791+{
3792+ int err;
3793+
3794+ /*
3795+ * Older device-trees don't have core PD, and thus, there are
3796+ * no dependencies that will block the state syncing. We shouldn't
3797+ * mark the domain as synced in this case.
3798+ */
3799+ if (!pmc->core_domain_registered)
3800+ return;
3801+
3802+ pmc->core_domain_state_synced = true;
3803+
3804+ /* this is a no-op if core regulator isn't used */
3805+ mutex_lock(&pmc->powergates_lock);
3806+ err = dev_pm_opp_sync_regulators(dev);
3807+ mutex_unlock(&pmc->powergates_lock);
3808+
3809+ if (err)
3810+ dev_err(dev, "failed to sync regulators: %d\n", err);
3811+}
3812+
36703813 static struct platform_driver tegra_pmc_driver = {
36713814 .driver = {
36723815 .name = "tegra-pmc",
@@ -3675,6 +3818,7 @@ static struct platform_driver tegra_pmc_driver = { · 2 unmodified lines
36753818 #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM)
36763819 .pm = &tegra_pmc_pm_ops,
36773820 #endif
3821+ .sync_state = tegra_pmc_sync_state,
36783822 },
36793823 .probe = tegra_pmc_probe,
36803824 };
drivers/soc/tegra/regulators-tegra20.c+92−2
@@ -12,16 +12,22 @@ · 11 unmodified lines
1212 #include <linux/init.h>
1313 #include <linux/kernel.h>
1414 #include <linux/of.h>
15+#include <linux/reboot.h>
1516 #include <linux/regulator/coupler.h>
1617 #include <linux/regulator/driver.h>
1718 #include <linux/regulator/machine.h>
1819
20+#include <soc/tegra/pmc.h>
21+
1922 struct tegra_regulator_coupler {
2023 struct regulator_coupler coupler;
2124 struct regulator_dev *core_rdev;
2225 struct regulator_dev *cpu_rdev;
2326 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;
2531 };
2632
2733 static inline struct tegra_regulator_coupler *
@@ -38,6 +44,21 @@ static int tegra20_core_limit(struct tegra_regulator_coupler *tegra, · 10 unmodified lines
3844 int core_cur_uV;
3945 int err;
4046
47+ /*
48+ * Tegra20 SoC has critical DVFS-capable devices that are
49+ * permanently-active or active at a boot time, like EMC
50+ * (DRAM controller) or Display controller for example.
51+ *
52+ * The voltage of a CORE SoC power domain shall not be dropped below
53+ * a minimum level, which is determined by device's clock rate.
54+ * This means that we can't fully allow CORE voltage scaling until
55+ * the state of all DVFS-critical CORE devices is synced.
56+ */
57+ if (tegra_pmc_core_domain_state_synced() && !tegra->sys_reboot_mode) {
58+ pr_info_once("voltage state synced\n");
59+ return 0;
60+ }
61+
4162 if (tegra->core_min_uV > 0)
4263 return tegra->core_min_uV;
4364
@@ -58,7 +79,7 @@ static int tegra20_core_limit(struct tegra_regulator_coupler *tegra, · 14 unmodified lines
5879 */
5980 tegra->core_min_uV = core_max_uV;
6081
61− pr_info("core minimum voltage limited to %duV\n", tegra->core_min_uV);
82+ pr_info("core voltage initialized to %duV\n", tegra->core_min_uV);
6283
6384 return tegra->core_min_uV;
6485 }
@@ -242,6 +263,10 @@ static int tegra20_cpu_voltage_update(struct tegra_regulator_coupler *tegra, · 177 unmodified lines
242263 if (cpu_uV < 0)
243264 return cpu_uV;
244265
266+ /* store boot voltage level */
267+ if (!tegra->cpu_min_uV)
268+ tegra->cpu_min_uV = cpu_uV;
269+
245270 /*
246271 * CPU's regulator may not have any consumers, hence the voltage
247272 * must not be changed in that case because CPU simply won't
@@ -250,6 +275,10 @@ static int tegra20_cpu_voltage_update(struct tegra_regulator_coupler *tegra, · 2 unmodified lines
250275 if (!cpu_min_uV_consumers)
251276 cpu_min_uV = cpu_uV;
252277
278+ /* restore boot voltage level */
279+ if (tegra->sys_reboot_mode)
280+ cpu_min_uV = max(cpu_min_uV, tegra->cpu_min_uV);
281+
253282 if (cpu_min_uV > cpu_uV) {
254283 err = tegra20_core_rtc_update(tegra, core_rdev, rtc_rdev,
255284 cpu_uV, cpu_min_uV);
@@ -290,6 +319,8 @@ static int tegra20_regulator_balance_voltage(struct regulator_coupler *coupler, · 34 unmodified lines
290319 return -EINVAL;
291320 }
292321
322+ tegra->sys_reboot_mode = READ_ONCE(tegra->sys_reboot_mode_req);
323+
293324 if (rdev == cpu_rdev)
294325 return tegra20_cpu_voltage_update(tegra, cpu_rdev,
295326 core_rdev, rtc_rdev);
@@ -303,6 +334,51 @@ static int tegra20_regulator_balance_voltage(struct regulator_coupler *coupler, · 7 unmodified lines
303334 return -EPERM;
304335 }
305336
337+static int tegra20_regulator_prepare_reboot(struct tegra_regulator_coupler *tegra,
338+ bool sys_reboot_mode)
339+{
340+ int err;
341+
342+ if (!tegra->core_rdev || !tegra->rtc_rdev || !tegra->cpu_rdev)
343+ return 0;
344+
345+ WRITE_ONCE(tegra->sys_reboot_mode_req, true);
346+
347+ /*
348+ * Some devices use CPU soft-reboot method and in this case we
349+ * should ensure that voltages are sane for the reboot by restoring
350+ * the minimum boot levels.
351+ */
352+ err = regulator_sync_voltage_rdev(tegra->cpu_rdev);
353+ if (err)
354+ return err;
355+
356+ err = regulator_sync_voltage_rdev(tegra->core_rdev);
357+ if (err)
358+ return err;
359+
360+ WRITE_ONCE(tegra->sys_reboot_mode_req, sys_reboot_mode);
361+
362+ return 0;
363+}
364+
365+static int tegra20_regulator_reboot(struct notifier_block *notifier,
366+ unsigned long event, void *cmd)
367+{
368+ struct tegra_regulator_coupler *tegra;
369+ int ret;
370+
371+ if (event != SYS_RESTART)
372+ return NOTIFY_DONE;
373+
374+ tegra = container_of(notifier, struct tegra_regulator_coupler,
375+ reboot_notifier);
376+
377+ ret = tegra20_regulator_prepare_reboot(tegra, true);
378+
379+ return notifier_from_errno(ret);
380+}
381+
306382 static int tegra20_regulator_attach(struct regulator_coupler *coupler,
307383 struct regulator_dev *rdev)
308384 {
@@ -335,6 +411,14 @@ static int tegra20_regulator_detach(struct regulator_coupler *coupler, · 26 unmodified lines
335411 {
336412 struct tegra_regulator_coupler *tegra = to_tegra_coupler(coupler);
337413
414+ /*
415+ * We don't expect regulators to be decoupled during reboot,
416+ * this may race with the reboot handler and shouldn't ever
417+ * happen in practice.
418+ */
419+ if (WARN_ON_ONCE(system_state > SYSTEM_RUNNING))
420+ return -EPERM;
421+
338422 if (tegra->core_rdev == rdev) {
339423 tegra->core_rdev = NULL;
340424 return 0;
@@ -359,13 +443,19 @@ static struct tegra_regulator_coupler tegra20_coupler = { · 18 unmodified lines
359443 .detach_regulator = tegra20_regulator_detach,
360444 .balance_voltage = tegra20_regulator_balance_voltage,
361445 },
446+ .reboot_notifier.notifier_call = tegra20_regulator_reboot,
362447 };
363448
364449 static int __init tegra_regulator_coupler_init(void)
365450 {
451+ int err;
452+
366453 if (!of_machine_is_compatible("nvidia,tegra20"))
367454 return 0;
368455
456+ err = register_reboot_notifier(&tegra20_coupler.reboot_notifier);
457+ WARN_ON(err);
458+
369459 return regulator_coupler_register(&tegra20_coupler.coupler);
370460 }
371461 arch_initcall(tegra_regulator_coupler_init);
drivers/soc/tegra/regulators-tegra30.c+91−2
@@ -12,17 +12,22 @@ · 11 unmodified lines
1212 #include <linux/init.h>
1313 #include <linux/kernel.h>
1414 #include <linux/of.h>
15+#include <linux/reboot.h>
1516 #include <linux/regulator/coupler.h>
1617 #include <linux/regulator/driver.h>
1718 #include <linux/regulator/machine.h>
1819
1920 #include <soc/tegra/fuse.h>
21+#include <soc/tegra/pmc.h>
2022
2123 struct tegra_regulator_coupler {
2224 struct regulator_coupler coupler;
2325 struct regulator_dev *core_rdev;
2426 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;
2631 };
2732
2833 static inline struct tegra_regulator_coupler *
@@ -39,6 +44,21 @@ static int tegra30_core_limit(struct tegra_regulator_coupler *tegra, · 10 unmodified lines
3944 int core_cur_uV;
4045 int err;
4146
47+ /*
48+ * Tegra30 SoC has critical DVFS-capable devices that are
49+ * permanently-active or active at a boot time, like EMC
50+ * (DRAM controller) or Display controller for example.
51+ *
52+ * The voltage of a CORE SoC power domain shall not be dropped below
53+ * a minimum level, which is determined by device's clock rate.
54+ * This means that we can't fully allow CORE voltage scaling until
55+ * the state of all DVFS-critical CORE devices is synced.
56+ */
57+ if (tegra_pmc_core_domain_state_synced() && !tegra->sys_reboot_mode) {
58+ pr_info_once("voltage state synced\n");
59+ return 0;
60+ }
61+
4262 if (tegra->core_min_uV > 0)
4363 return tegra->core_min_uV;
4464
@@ -59,7 +79,7 @@ static int tegra30_core_limit(struct tegra_regulator_coupler *tegra, · 14 unmodified lines
5979 */
6080 tegra->core_min_uV = core_max_uV;
6181
62− pr_info("core minimum voltage limited to %duV\n", tegra->core_min_uV);
82+ pr_info("core voltage initialized to %duV\n", tegra->core_min_uV);
6383
6484 return tegra->core_min_uV;
6585 }
@@ -172,6 +192,10 @@ static int tegra30_voltage_update(struct tegra_regulator_coupler *tegra, · 106 unmodified lines
172192 if (cpu_uV < 0)
173193 return cpu_uV;
174194
195+ /* store boot voltage level */
196+ if (!tegra->cpu_min_uV)
197+ tegra->cpu_min_uV = cpu_uV;
198+
175199 /*
176200 * CPU's regulator may not have any consumers, hence the voltage
177201 * must not be changed in that case because CPU simply won't
@@ -195,6 +219,10 @@ static int tegra30_voltage_update(struct tegra_regulator_coupler *tegra, · 17 unmodified lines
195219 if (err)
196220 return err;
197221
222+ /* restore boot voltage level */
223+ if (tegra->sys_reboot_mode)
224+ cpu_min_uV = max(cpu_min_uV, tegra->cpu_min_uV);
225+
198226 if (core_min_limited_uV > core_uV) {
199227 pr_err("core voltage constraint violated: %d %d %d\n",
200228 core_uV, core_min_limited_uV, cpu_uV);
@@ -263,9 +291,56 @@ static int tegra30_regulator_balance_voltage(struct regulator_coupler *coupler, · 62 unmodified lines
263291 return -EINVAL;
264292 }
265293
294+ tegra->sys_reboot_mode = READ_ONCE(tegra->sys_reboot_mode_req);
295+
266296 return tegra30_voltage_update(tegra, cpu_rdev, core_rdev);
267297 }
268298
299+static int tegra30_regulator_prepare_reboot(struct tegra_regulator_coupler *tegra,
300+ bool sys_reboot_mode)
301+{
302+ int err;
303+
304+ if (!tegra->core_rdev || !tegra->cpu_rdev)
305+ return 0;
306+
307+ WRITE_ONCE(tegra->sys_reboot_mode_req, true);
308+
309+ /*
310+ * Some devices use CPU soft-reboot method and in this case we
311+ * should ensure that voltages are sane for the reboot by restoring
312+ * the minimum boot levels.
313+ */
314+ err = regulator_sync_voltage_rdev(tegra->cpu_rdev);
315+ if (err)
316+ return err;
317+
318+ err = regulator_sync_voltage_rdev(tegra->core_rdev);
319+ if (err)
320+ return err;
321+
322+ WRITE_ONCE(tegra->sys_reboot_mode_req, sys_reboot_mode);
323+
324+ return 0;
325+}
326+
327+static int tegra30_regulator_reboot(struct notifier_block *notifier,
328+ unsigned long event, void *cmd)
329+{
330+ struct tegra_regulator_coupler *tegra;
331+ int ret;
332+
333+ if (event != SYS_RESTART)
334+ return NOTIFY_DONE;
335+
336+ tegra = container_of(notifier, struct tegra_regulator_coupler,
337+ reboot_notifier);
338+
339+ ret = tegra30_regulator_prepare_reboot(tegra, true);
340+
341+ return notifier_from_errno(ret);
342+}
343+
269344 static int tegra30_regulator_attach(struct regulator_coupler *coupler,
270345 struct regulator_dev *rdev)
271346 {
@@ -292,6 +367,14 @@ static int tegra30_regulator_detach(struct regulator_coupler *coupler, · 20 unmodified lines
292367 {
293368 struct tegra_regulator_coupler *tegra = to_tegra_coupler(coupler);
294369
370+ /*
371+ * We don't expect regulators to be decoupled during reboot,
372+ * this may race with the reboot handler and shouldn't ever
373+ * happen in practice.
374+ */
375+ if (WARN_ON_ONCE(system_state > SYSTEM_RUNNING))
376+ return -EPERM;
377+
295378 if (tegra->core_rdev == rdev) {
296379 tegra->core_rdev = NULL;
297380 return 0;
@@ -311,13 +394,19 @@ static struct tegra_regulator_coupler tegra30_coupler = { · 13 unmodified lines
311394 .detach_regulator = tegra30_regulator_detach,
312395 .balance_voltage = tegra30_regulator_balance_voltage,
313396 },
397+ .reboot_notifier.notifier_call = tegra30_regulator_reboot,
314398 };
315399
316400 static int __init tegra_regulator_coupler_init(void)
317401 {
402+ int err;
403+
318404 if (!of_machine_is_compatible("nvidia,tegra30"))
319405 return 0;
320406
407+ err = register_reboot_notifier(&tegra30_coupler.reboot_notifier);
408+ WARN_ON(err);
409+
321410 return regulator_coupler_register(&tegra30_coupler.coupler);
322411 }
323412 arch_initcall(tegra_regulator_coupler_init);
include/linux/platform_data/pata_ixp4xx_cf.h+21−0
@@ -0,0 +1,21 @@
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
include/linux/soc/ixp4xx/cpu.h+106−0
@@ -0,0 +1,106 @@
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 */
include/linux/soc/samsung/exynos-regs-pmu.h+0−6
@@ -611,12 +611,6 @@ · 610 unmodified lines
611611 #define EXYNOS5420_FSYS2_OPTION 0x4168
612612 #define EXYNOS5420_PSGEN_OPTION 0x4188
613613
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−
620614 #define EXYNOS5420_ARM_USE_STANDBY_WFI0 BIT(4)
621615 #define EXYNOS5420_ARM_USE_STANDBY_WFI1 BIT(5)
622616 #define EXYNOS5420_ARM_USE_STANDBY_WFI2 BIT(6)
include/soc/imx/cpu.h+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #define MXC_CPU_MX27 27
1010 #define MXC_CPU_MX31 31
1111 #define MXC_CPU_MX35 35
12+#define MXC_CPU_MX50 50
1213 #define MXC_CPU_MX51 51
1314 #define MXC_CPU_MX53 53
1415 #define MXC_CPU_IMX6SL 0x60
include/soc/tegra/common.h+31−0
@@ -6,6 +6,37 @@ · 5 unmodified lines
66 #ifndef __SOC_TEGRA_COMMON_H__
77 #define __SOC_TEGRA_COMMON_H__
88
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
924 bool soc_is_tegra(void);
1025
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
41+
1142 #endif /* __SOC_TEGRA_COMMON_H__ */
include/soc/tegra/fuse.h+17−3
@@ -52,14 +52,28 @@ struct tegra_sku_info { · 51 unmodified lines
5252 enum tegra_revision revision;
5353 };
5454
55+#ifdef CONFIG_ARCH_TEGRA
56+extern struct tegra_sku_info tegra_sku_info;
5557 u32 tegra_read_straps(void);
5658 u32 tegra_read_ram_code(void);
5759 int tegra_fuse_readl(unsigned long offset, u32 *value);
58−
59−#ifdef CONFIG_ARCH_TEGRA
60−extern struct tegra_sku_info tegra_sku_info;
6160 #else
6261 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+}
6377 #endif
6478
6579 struct device *tegra_soc_device_register(void);
include/soc/tegra/pmc.h+7−0
@@ -171,6 +171,8 @@ int tegra_io_rail_power_off(unsigned int id); · 170 unmodified lines
171171 void tegra_pmc_set_suspend_mode(enum tegra_suspend_mode mode);
172172 void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode);
173173
174+bool tegra_pmc_core_domain_state_synced(void);
175+
174176 #else
175177 static inline int tegra_powergate_power_on(unsigned int id)
176178 {
@@ -227,6 +229,11 @@ static inline void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode) · 50 unmodified lines
227229 {
228230 }
229231
232+static inline bool tegra_pmc_core_domain_state_synced(void)
233+{
234+ return false;
235+}
236+
230237 #endif /* CONFIG_SOC_TEGRA_PMC */
231238
232239 #if defined(CONFIG_SOC_TEGRA_PMC) && defined(CONFIG_PM_SLEEP)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t