summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml22
-rw-r--r--Documentation/devicetree/bindings/bus/ti-sysc.txt6
-rw-r--r--Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml44
-rw-r--r--Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml54
-rw-r--r--Documentation/devicetree/bindings/misc/intel,ixp4xx-queue-manager.yaml49
-rw-r--r--Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml42
-rw-r--r--MAINTAINERS21
-rw-r--r--arch/arm/Kconfig7
-rw-r--r--arch/arm/Kconfig.debug2
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/boot/dts/Makefile3
-rw-r--r--arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi4
-rw-r--r--arch/arm/boot/dts/imx6dl-riotboard.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-ba16.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6q-marsboard.dts2
-rw-r--r--arch/arm/boot/dts/imx6q-tbs2910.dts2
-rw-r--r--arch/arm/boot/dts/imx6qdl-apf6.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-sabreauto.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-sabresd.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-sr-som.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6qdl-wandboard.dtsi2
-rw-r--r--arch/arm/boot/dts/imx6sx-sabreauto.dts2
-rw-r--r--arch/arm/boot/dts/imx6sx-sdb.dtsi2
-rw-r--r--arch/arm/boot/dts/imx7d-pico.dtsi2
-rw-r--r--arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts109
-rw-r--r--arch/arm/boot/dts/intel-ixp42x.dtsi25
-rw-r--r--arch/arm/boot/dts/intel-ixp43x-gateworks-gw2358.dts94
-rw-r--r--arch/arm/boot/dts/intel-ixp43x.dtsi15
-rw-r--r--arch/arm/boot/dts/intel-ixp45x-ixp46x.dtsi34
-rw-r--r--arch/arm/boot/dts/intel-ixp4xx.dtsi69
-rw-r--r--arch/arm/boot/dts/ls1021a-twr.dts9
-rw-r--r--arch/arm/boot/dts/ls1021a.dtsi11
-rw-r--r--arch/arm/boot/dts/sun8i-a23-a33.dtsi2
-rw-r--r--arch/arm/configs/exynos_defconfig1
-rw-r--r--arch/arm/configs/multi_v7_defconfig1
-rw-r--r--arch/arm/firmware/Kconfig29
-rw-r--r--arch/arm/firmware/Makefile4
-rw-r--r--arch/arm/include/asm/firmware.h2
-rw-r--r--arch/arm/mach-davinci/board-da830-evm.c51
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-omapl138-hawk.c50
-rw-r--r--arch/arm/mach-ep93xx/adssphere.c2
-rw-r--r--arch/arm/mach-ep93xx/clock.c3
-rw-r--r--arch/arm/mach-ep93xx/core.c8
-rw-r--r--arch/arm/mach-ep93xx/dma.c2
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c4
-rw-r--r--arch/arm/mach-ep93xx/gesbc9312.c2
-rw-r--r--arch/arm/mach-ep93xx/gpio-ep93xx.h (renamed from arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h)0
-rw-r--r--arch/arm/mach-ep93xx/hardware.h (renamed from arch/arm/mach-ep93xx/include/mach/hardware.h)2
-rw-r--r--arch/arm/mach-ep93xx/micro9.c2
-rw-r--r--arch/arm/mach-ep93xx/platform.h (renamed from arch/arm/mach-ep93xx/include/mach/platform.h)23
-rw-r--r--arch/arm/mach-ep93xx/simone.c4
-rw-r--r--arch/arm/mach-ep93xx/snappercl15.c4
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c4
-rw-r--r--arch/arm/mach-ep93xx/vision_ep9307.c4
-rw-r--r--arch/arm/mach-exynos/Kconfig12
-rw-r--r--arch/arm/mach-exynos/Makefile2
-rw-r--r--arch/arm/mach-exynos/common.h1
-rw-r--r--arch/arm/mach-exynos/exynos.c3
-rw-r--r--arch/arm/mach-exynos/firmware.c1
-rw-r--r--arch/arm/mach-exynos/mcpm-exynos.c13
-rw-r--r--arch/arm/mach-exynos/platsmp.c9
-rw-r--r--arch/arm/mach-exynos/smc.h7
-rw-r--r--arch/arm/mach-exynos/suspend.c49
-rw-r--r--arch/arm/mach-imx/pm-imx6.c6
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig27
-rw-r--r--arch/arm/mach-ixp4xx/Makefile5
-rw-r--r--arch/arm/mach-ixp4xx/avila-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/avila-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/common.c484
-rw-r--r--arch/arm/mach-ixp4xx/coyote-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-setup.c5
-rw-r--r--arch/arm/mach-ixp4xx/fsg-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/fsg-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/gateway7001-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/gateway7001-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/entry-macro.S41
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/irqs.h75
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h94
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/qmgr.h204
-rw-r--r--arch/arm/mach-ixp4xx/irqs.h68
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c2
-rw-r--r--arch/arm/mach-ixp4xx/ixdpg425-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/ixp4xx-of.c60
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c5
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-setup.c12
-rw-r--r--arch/arm/mach-ixp4xx/wg302v2-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/wg302v2-setup.c2
-rw-r--r--arch/arm/mach-lpc32xx/phy3250.c42
-rw-r--r--arch/arm/mach-omap2/common.h9
-rw-r--r--arch/arm/mach-omap2/i2c.c11
-rw-r--r--arch/arm/mach-omap2/io.c7
-rw-r--r--arch/arm/mach-omap2/mmc.h8
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.c4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c210
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h8
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h29
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c103
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c255
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c64
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_43xx_data.c113
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c740
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_54xx_data.c748
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_7xx_data.c848
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_81xx_data.c1
-rw-r--r--arch/arm/mach-omap2/pm33xx-core.c8
-rw-r--r--arch/arm/mach-omap2/sr_device.c5
-rw-r--r--arch/arm/mach-rockchip/platsmp.c1
-rw-r--r--arch/arm/mach-rockchip/pm.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410-module.c14
-rw-r--r--arch/arm/mach-shmobile/pm-rcar-gen2.c1
-rw-r--r--arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c6
-rw-r--r--arch/arm/mach-stm32/Kconfig5
-rw-r--r--arch/arm/mach-sunxi/mc_smp.c5
-rw-r--r--arch/arm/mach-sunxi/platsmp.c4
-rw-r--r--arch/arm/mach-tegra/Kconfig3
-rw-r--r--arch/arm/mach-tegra/cpuidle-tegra114.c4
-rw-r--r--arch/arm/mach-tegra/pm.c50
-rw-r--r--arch/arm/mach-tegra/reset-handler.S50
-rw-r--r--arch/arm/mach-tegra/reset.c4
-rw-r--r--arch/arm/mach-tegra/reset.h9
-rw-r--r--arch/arm/mach-tegra/sleep-tegra20.S4
-rw-r--r--arch/arm/mach-tegra/sleep.S14
-rw-r--r--arch/arm/mach-tegra/tegra.c5
-rw-r--r--arch/arm/mach-u300/regulator.c2
-rw-r--r--arch/arm/plat-pxa/ssp.c6
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts2
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts2
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts2
-rw-r--r--arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi2
-rw-r--r--drivers/ata/pata_ep93xx.c2
-rw-r--r--drivers/bus/ti-sysc.c661
-rw-r--r--drivers/clocksource/Kconfig7
-rw-r--r--drivers/clocksource/Makefile1
-rw-r--r--drivers/clocksource/timer-ixp4xx.c282
-rw-r--r--drivers/crypto/ixp4xx_crypto.c4
-rw-r--r--drivers/firmware/Kconfig16
-rw-r--r--drivers/firmware/Makefile1
-rw-r--r--drivers/firmware/trusted_foundations.c (renamed from arch/arm/firmware/trusted_foundations.c)79
-rw-r--r--drivers/gpio/Kconfig13
-rw-r--r--drivers/gpio/Makefile1
-rw-r--r--drivers/gpio/gpio-ixp4xx.c474
-rw-r--r--drivers/input/keyboard/Kconfig2
-rw-r--r--drivers/input/keyboard/ep93xx_keypad.c8
-rw-r--r--drivers/input/misc/ixp4xx-beeper.c20
-rw-r--r--drivers/irqchip/Kconfig6
-rw-r--r--drivers/irqchip/Makefile1
-rw-r--r--drivers/irqchip/irq-ixp4xx.c403
-rw-r--r--drivers/net/ethernet/cirrus/Kconfig2
-rw-r--r--drivers/net/ethernet/cirrus/ep93xx_eth.c2
-rw-r--r--drivers/net/ethernet/xscale/ixp4xx_eth.c14
-rw-r--r--drivers/net/wan/ixp4xx_hss.c4
-rw-r--r--drivers/pwm/pwm-ep93xx.c2
-rw-r--r--drivers/soc/Kconfig1
-rw-r--r--drivers/soc/Makefile1
-rw-r--r--drivers/soc/ixp4xx/Kconfig16
-rw-r--r--drivers/soc/ixp4xx/Makefile2
-rw-r--r--drivers/soc/ixp4xx/ixp4xx-npe.c (renamed from arch/arm/mach-ixp4xx/ixp4xx_npe.c)66
-rw-r--r--drivers/soc/ixp4xx/ixp4xx-qmgr.c (renamed from arch/arm/mach-ixp4xx/ixp4xx_qmgr.c)186
-rw-r--r--drivers/usb/host/ohci-da8xx.c42
-rw-r--r--drivers/watchdog/ixp4xx_wdt.c9
-rw-r--r--include/linux/firmware/trusted_foundations.h (renamed from arch/arm/include/asm/trusted_foundations.h)27
-rw-r--r--include/linux/irqchip/irq-ixp4xx.h12
-rw-r--r--include/linux/platform_data/eth-ep93xx.h10
-rw-r--r--include/linux/platform_data/keypad-ep93xx.h4
-rw-r--r--include/linux/platform_data/ti-sysc.h9
-rw-r--r--include/linux/platform_data/timer-ixp4xx.h11
-rw-r--r--include/linux/soc/cirrus/ep93xx.h37
-rw-r--r--include/linux/soc/ixp4xx/npe.h (renamed from arch/arm/mach-ixp4xx/include/mach/npe.h)2
-rw-r--r--include/linux/soc/ixp4xx/qmgr.h91
-rw-r--r--sound/soc/cirrus/edb93xx.c2
-rw-r--r--sound/soc/cirrus/ep93xx-ac97.c1
-rw-r--r--sound/soc/cirrus/ep93xx-i2s.c3
-rw-r--r--sound/soc/cirrus/simone.c2
-rw-r--r--sound/soc/cirrus/snappercl15.c2
188 files changed, 3789 insertions, 4242 deletions
diff --git a/Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml b/Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml
new file mode 100644
index 000000000000..f4f7451e5e8a
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml
@@ -0,0 +1,22 @@
1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/arm/intel-ixp4xx.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Intel IXP4xx Device Tree Bindings
8
9maintainers:
10 - Linus Walleij <linus.walleij@linaro.org>
11
12properties:
13 compatible:
14 oneOf:
15 - items:
16 - enum:
17 - linksys,nslu2
18 - const: intel,ixp42x
19 - items:
20 - enum:
21 - gateworks,gw2358
22 - const: intel,ixp43x
diff --git a/Documentation/devicetree/bindings/bus/ti-sysc.txt b/Documentation/devicetree/bindings/bus/ti-sysc.txt
index 85a23f551f02..233eb8294204 100644
--- a/Documentation/devicetree/bindings/bus/ti-sysc.txt
+++ b/Documentation/devicetree/bindings/bus/ti-sysc.txt
@@ -94,6 +94,8 @@ Optional properties:
94 94
95- ti,no-idle-on-init interconnect target module should not be idled at init 95- ti,no-idle-on-init interconnect target module should not be idled at init
96 96
97- ti,no-idle interconnect target module should not be idled
98
97Example: Single instance of MUSB controller on omap4 using interconnect ranges 99Example: Single instance of MUSB controller on omap4 using interconnect ranges
98using offsets from l4_cfg second segment (0x4a000000 + 0x80000 = 0x4a0ab000): 100using offsets from l4_cfg second segment (0x4a000000 + 0x80000 = 0x4a0ab000):
99 101
@@ -131,6 +133,6 @@ using offsets from l4_cfg second segment (0x4a000000 + 0x80000 = 0x4a0ab000):
131 }; 133 };
132 }; 134 };
133 135
134Note that other SoCs, such as am335x can have multipe child devices. On am335x 136Note that other SoCs, such as am335x can have multiple child devices. On am335x
135there are two MUSB instances, two USB PHY instances, and a single CPPI41 DMA 137there are two MUSB instances, two USB PHY instances, and a single CPPI41 DMA
136instance as children of a single interconnet target module. 138instance as children of a single interconnect target module.
diff --git a/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml b/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml
new file mode 100644
index 000000000000..8cb136c376fb
--- /dev/null
+++ b/Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml
@@ -0,0 +1,44 @@
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2# Copyright 2019 Linaro Ltd.
3%YAML 1.2
4---
5$id: "http://devicetree.org/schemas/firmware/intel-ixp4xx-network-processing-engine.yaml#"
6$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7
8title: Intel IXP4xx Network Processing Engine
9
10maintainers:
11 - Linus Walleij <linus.walleij@linaro.org>
12
13description: |
14 On the IXP4xx SoCs, the Network Processing Engine (NPE) is a small
15 processor that can load a firmware to perform offloading of networking
16 and crypto tasks. It also manages the MDIO bus to the ethernet PHYs
17 on the IXP4xx platform. All IXP4xx platforms have three NPEs at
18 consecutive memory locations. They are all included in the same
19 device node since they are not independent of each other.
20
21properties:
22 compatible:
23 oneOf:
24 - items:
25 - const: intel,ixp4xx-network-processing-engine
26
27 reg:
28 minItems: 3
29 maxItems: 3
30 items:
31 - description: NPE0 register range
32 - description: NPE1 register range
33 - description: NPE2 register range
34
35required:
36 - compatible
37 - reg
38
39examples:
40 - |
41 npe@c8006000 {
42 compatible = "intel,ixp4xx-network-processing-engine";
43 reg = <0xc8006000 0x1000>, <0xc8007000 0x1000>, <0xc8008000 0x1000>;
44 };
diff --git a/Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml b/Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml
new file mode 100644
index 000000000000..bae10e261fa9
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml
@@ -0,0 +1,54 @@
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2# Copyright 2018 Linaro Ltd.
3%YAML 1.2
4---
5$id: "http://devicetree.org/schemas/interrupt/intel-ixp4xx-interrupt.yaml#"
6$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7
8title: Intel IXP4xx XScale Networking Processors Interrupt Controller
9
10maintainers:
11 - Linus Walleij <linus.walleij@linaro.org>
12
13description: |
14 This interrupt controller is found in the Intel IXP4xx processors.
15 Some processors have 32 interrupts, some have up to 64 interrupts.
16 The exact number of interrupts is determined from the compatible
17 string.
18
19 The distinct IXP4xx families with different interrupt controller
20 variations are IXP42x, IXP43x, IXP45x and IXP46x. Those four
21 families were the only ones to reach the developer and consumer
22 market.
23
24properties:
25 compatible:
26 items:
27 - enum:
28 - intel,ixp42x-interrupt
29 - intel,ixp43x-interrupt
30 - intel,ixp45x-interrupt
31 - intel,ixp46x-interrupt
32
33 reg:
34 maxItems: 1
35
36 interrupt-controller: true
37
38 '#interrupt-cells':
39 const: 2
40
41required:
42 - compatible
43 - reg
44 - interrupt-controller
45 - '#interrupt-cells'
46
47examples:
48 - |
49 intcon: interrupt-controller@c8003000 {
50 compatible = "intel,ixp43x-interrupt";
51 reg = <0xc8003000 0x100>;
52 interrupt-controller;
53 #interrupt-cells = <2>;
54 };
diff --git a/Documentation/devicetree/bindings/misc/intel,ixp4xx-queue-manager.yaml b/Documentation/devicetree/bindings/misc/intel,ixp4xx-queue-manager.yaml
new file mode 100644
index 000000000000..d2313b1d9405
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/intel,ixp4xx-queue-manager.yaml
@@ -0,0 +1,49 @@
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2# Copyright 2019 Linaro Ltd.
3%YAML 1.2
4---
5$id: "http://devicetree.org/schemas/misc/intel-ixp4xx-ahb-queue-manager.yaml#"
6$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7
8title: Intel IXP4xx AHB Queue Manager
9
10maintainers:
11 - Linus Walleij <linus.walleij@linaro.org>
12
13description: |
14 The IXP4xx AHB Queue Manager maintains queues as circular buffers in
15 an 8KB embedded SRAM along with hardware pointers. It is used by both
16 the XScale processor and the NPEs (Network Processing Units) in the
17 IXP4xx for accelerating queues, especially for networking. Clients pick
18 queues from the queue manager with foo-queue = <&qmgr N> where the
19 &qmgr is a phandle to the queue manager and N is the queue resource
20 number. The queue resources available and their specific purpose
21 on a certain IXP4xx system will vary.
22
23properties:
24 compatible:
25 items:
26 - const: intel,ixp4xx-ahb-queue-manager
27
28 reg:
29 maxItems: 1
30
31 interrupts:
32 items:
33 - description: Interrupt for queues 0-31
34 - description: Interrupt for queues 32-63
35
36required:
37 - compatible
38 - reg
39 - interrupts
40
41examples:
42 - |
43 #include <dt-bindings/interrupt-controller/irq.h>
44
45 qmgr: queue-manager@60000000 {
46 compatible = "intel,ixp4xx-ahb-queue-manager";
47 reg = <0x60000000 0x4000>;
48 interrupts = <3 IRQ_TYPE_LEVEL_HIGH>, <4 IRQ_TYPE_LEVEL_HIGH>;
49 };
diff --git a/Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml b/Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml
new file mode 100644
index 000000000000..a36a0746c056
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml
@@ -0,0 +1,42 @@
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2# Copyright 2018 Linaro Ltd.
3%YAML 1.2
4---
5$id: "http://devicetree.org/schemas/timer/intel-ixp4xx-timer.yaml#"
6$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7
8title: Intel IXP4xx XScale Networking Processors Timers
9
10maintainers:
11 - Linus Walleij <linus.walleij@linaro.org>
12
13description: This timer is found in the Intel IXP4xx processors.
14
15properties:
16 compatible:
17 items:
18 - const: intel,ixp4xx-timer
19
20 reg:
21 description: Should contain registers location and length
22
23 interrupts:
24 minItems: 1
25 maxItems: 2
26 items:
27 - description: Timer 1 interrupt
28 - description: Timer 2 interrupt
29
30required:
31 - compatible
32 - reg
33 - interrupts
34
35examples:
36 - |
37 #include <dt-bindings/interrupt-controller/irq.h>
38 timer@c8005000 {
39 compatible = "intel,ixp4xx-timer";
40 reg = <0xc8005000 0x100>;
41 interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
42 };
diff --git a/MAINTAINERS b/MAINTAINERS
index 59efb8bd33e0..5254b352623b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1733,11 +1733,21 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1733S: Maintained 1733S: Maintained
1734 1734
1735ARM/INTEL IXP4XX ARM ARCHITECTURE 1735ARM/INTEL IXP4XX ARM ARCHITECTURE
1736M: Linus Walleij <linusw@kernel.org>
1736M: Imre Kaloz <kaloz@openwrt.org> 1737M: Imre Kaloz <kaloz@openwrt.org>
1737M: Krzysztof Halasa <khalasa@piap.pl> 1738M: Krzysztof Halasa <khalasa@piap.pl>
1738L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1739L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1739S: Maintained 1740S: Maintained
1741F: Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml
1742F: Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt
1743F: Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml
1744F: Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml
1740F: arch/arm/mach-ixp4xx/ 1745F: arch/arm/mach-ixp4xx/
1746F: drivers/clocksource/timer-ixp4xx.c
1747F: drivers/gpio/gpio-ixp4xx.c
1748F: drivers/irqchip/irq-ixp4xx.c
1749F: include/linux/irqchip/irq-ixp4xx.h
1750F: include/linux/platform_data/timer-ixp4xx.h
1741 1751
1742ARM/INTEL RESEARCH IMOTE/STARGATE 2 MACHINE SUPPORT 1752ARM/INTEL RESEARCH IMOTE/STARGATE 2 MACHINE SUPPORT
1743M: Jonathan Cameron <jic23@cam.ac.uk> 1753M: Jonathan Cameron <jic23@cam.ac.uk>
@@ -2238,6 +2248,7 @@ F: arch/arm/mach-socfpga/
2238F: arch/arm/boot/dts/socfpga* 2248F: arch/arm/boot/dts/socfpga*
2239F: arch/arm/configs/socfpga_defconfig 2249F: arch/arm/configs/socfpga_defconfig
2240F: arch/arm64/boot/dts/altera/ 2250F: arch/arm64/boot/dts/altera/
2251F: arch/arm64/boot/dts/intel/
2241W: http://www.rocketboards.org 2252W: http://www.rocketboards.org
2242T: git git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git 2253T: git git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux.git
2243 2254
@@ -7990,10 +8001,10 @@ F: Documentation/media/v4l-drivers/ipu3.rst
7990INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT 8001INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT
7991M: Krzysztof Halasa <khalasa@piap.pl> 8002M: Krzysztof Halasa <khalasa@piap.pl>
7992S: Maintained 8003S: Maintained
7993F: arch/arm/mach-ixp4xx/include/mach/qmgr.h 8004F: include/linux/soc/ixp4xx/qmgr.h
7994F: arch/arm/mach-ixp4xx/include/mach/npe.h 8005F: include/linux/soc/ixp4xx/npe.h
7995F: arch/arm/mach-ixp4xx/ixp4xx_qmgr.c 8006F: drivers/soc/ixp4xx/ixp4xx-qmgr.c
7996F: arch/arm/mach-ixp4xx/ixp4xx_npe.c 8007F: drivers/soc/ixp4xx/ixp4xx-npe.c
7997F: drivers/net/ethernet/xscale/ixp4xx_eth.c 8008F: drivers/net/ethernet/xscale/ixp4xx_eth.c
7998F: drivers/net/wan/ixp4xx_hss.c 8009F: drivers/net/wan/ixp4xx_hss.c
7999 8010
@@ -15654,7 +15665,7 @@ F: include/linux/clk/ti.h
15654 15665
15655TI DAVINCI MACHINE SUPPORT 15666TI DAVINCI MACHINE SUPPORT
15656M: Sekhar Nori <nsekhar@ti.com> 15667M: Sekhar Nori <nsekhar@ti.com>
15657M: Kevin Hilman <khilman@kernel.org> 15668R: Bartosz Golaszewski <bgolaszewski@baylibre.com>
15658L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 15669L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
15659T: git git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git 15670T: git git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git
15660S: Supported 15671S: Supported
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5fd344bd06b9..8869742a85df 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -426,12 +426,15 @@ config ARCH_IXP4XX
426 depends on MMU 426 depends on MMU
427 select ARCH_HAS_DMA_SET_COHERENT_MASK 427 select ARCH_HAS_DMA_SET_COHERENT_MASK
428 select ARCH_SUPPORTS_BIG_ENDIAN 428 select ARCH_SUPPORTS_BIG_ENDIAN
429 select CLKSRC_MMIO
430 select CPU_XSCALE 429 select CPU_XSCALE
431 select DMABOUNCE if PCI 430 select DMABOUNCE if PCI
432 select GENERIC_CLOCKEVENTS 431 select GENERIC_CLOCKEVENTS
432 select GENERIC_IRQ_MULTI_HANDLER
433 select GPIO_IXP4XX
433 select GPIOLIB 434 select GPIOLIB
434 select HAVE_PCI 435 select HAVE_PCI
436 select IXP4XX_IRQ
437 select IXP4XX_TIMER
435 select NEED_MACH_IO_H 438 select NEED_MACH_IO_H
436 select USB_EHCI_BIG_ENDIAN_DESC 439 select USB_EHCI_BIG_ENDIAN_DESC
437 select USB_EHCI_BIG_ENDIAN_MMIO 440 select USB_EHCI_BIG_ENDIAN_MMIO
@@ -897,8 +900,6 @@ config PLAT_PXA
897config PLAT_VERSATILE 900config PLAT_VERSATILE
898 bool 901 bool
899 902
900source "arch/arm/firmware/Kconfig"
901
902source "arch/arm/mm/Kconfig" 903source "arch/arm/mm/Kconfig"
903 904
904config IWMMXT 905config IWMMXT
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index e388af4594a6..9a8862fee738 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -1676,6 +1676,7 @@ config DEBUG_UART_PHYS
1676 default 0xe6e68000 if DEBUG_RCAR_GEN2_SCIF1 1676 default 0xe6e68000 if DEBUG_RCAR_GEN2_SCIF1
1677 default 0xe6ee0000 if DEBUG_RCAR_GEN2_SCIF4 1677 default 0xe6ee0000 if DEBUG_RCAR_GEN2_SCIF4
1678 default 0xe8008000 if DEBUG_R7S72100_SCIF2 1678 default 0xe8008000 if DEBUG_R7S72100_SCIF2
1679 default 0xf0000000 if DEBUG_DIGICOLOR_UA0
1679 default 0xf0000be0 if ARCH_EBSA110 1680 default 0xf0000be0 if ARCH_EBSA110
1680 default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE 1681 default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE
1681 default 0xf1012100 if DEBUG_MVEBU_UART1_ALTERNATE 1682 default 0xf1012100 if DEBUG_MVEBU_UART1_ALTERNATE
@@ -1727,6 +1728,7 @@ config DEBUG_UART_VIRT
1727 default 0xe0010fe0 if ARCH_RPC 1728 default 0xe0010fe0 if ARCH_RPC
1728 default 0xf0000be0 if ARCH_EBSA110 1729 default 0xf0000be0 if ARCH_EBSA110
1729 default 0xf0010000 if DEBUG_ASM9260_UART 1730 default 0xf0010000 if DEBUG_ASM9260_UART
1731 default 0xf0100000 if DEBUG_DIGICOLOR_UA0
1730 default 0xf01fb000 if DEBUG_NOMADIK_UART 1732 default 0xf01fb000 if DEBUG_NOMADIK_UART
1731 default 0xf0201000 if DEBUG_BCM2835 || DEBUG_BCM2836 1733 default 0xf0201000 if DEBUG_BCM2835 || DEBUG_BCM2836
1732 default 0xf1000300 if DEBUG_BCM_5301X 1734 default 0xf1000300 if DEBUG_BCM_5301X
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 807a7d06c2a0..05ecc004de86 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -290,7 +290,6 @@ core-y += arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
290core-y += arch/arm/probes/ 290core-y += arch/arm/probes/
291core-y += arch/arm/net/ 291core-y += arch/arm/net/
292core-y += arch/arm/crypto/ 292core-y += arch/arm/crypto/
293core-y += arch/arm/firmware/
294core-y += $(machdirs) $(platdirs) 293core-y += $(machdirs) $(platdirs)
295 294
296drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ 295drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index f4f5aeaf3298..7af4e3289a89 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -229,6 +229,9 @@ dtb-$(CONFIG_ARCH_HIX5HD2) += \
229dtb-$(CONFIG_ARCH_INTEGRATOR) += \ 229dtb-$(CONFIG_ARCH_INTEGRATOR) += \
230 integratorap.dtb \ 230 integratorap.dtb \
231 integratorcp.dtb 231 integratorcp.dtb
232dtb-$(CONFIG_ARCH_IXP4XX) += \
233 intel-ixp42x-linksys-nslu2.dtb \
234 intel-ixp43x-gateworks-gw2358.dtb
232dtb-$(CONFIG_ARCH_KEYSTONE) += \ 235dtb-$(CONFIG_ARCH_KEYSTONE) += \
233 keystone-k2hk-evm.dtb \ 236 keystone-k2hk-evm.dtb \
234 keystone-k2l-evm.dtb \ 237 keystone-k2l-evm.dtb \
diff --git a/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi b/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi
index fb01fa6e4224..c40a7af6ebee 100644
--- a/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi
+++ b/arch/arm/boot/dts/imx6-logicpd-baseboard.dtsi
@@ -88,6 +88,7 @@
88 regulator-min-microvolt = <5000000>; 88 regulator-min-microvolt = <5000000>;
89 regulator-max-microvolt = <5000000>; 89 regulator-max-microvolt = <5000000>;
90 gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>; 90 gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>;
91 startup-delay-us = <70000>;
91 enable-active-high; 92 enable-active-high;
92 }; 93 };
93 94
@@ -99,6 +100,7 @@
99 regulator-min-microvolt = <3300000>; 100 regulator-min-microvolt = <3300000>;
100 regulator-max-microvolt = <3300000>; 101 regulator-max-microvolt = <3300000>;
101 gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>; 102 gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>;
103 startup-delay-us = <70000>;
102 enable-active-high; 104 enable-active-high;
103 regulator-always-on; 105 regulator-always-on;
104 }; 106 };
@@ -216,7 +218,7 @@
216&fec { 218&fec {
217 pinctrl-names = "default"; 219 pinctrl-names = "default";
218 pinctrl-0 = <&pinctrl_enet>; 220 pinctrl-0 = <&pinctrl_enet>;
219 phy-mode = "rgmii"; 221 phy-mode = "rgmii-id";
220 phy-reset-duration = <10>; 222 phy-reset-duration = <10>;
221 phy-reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>; 223 phy-reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
222 phy-supply = <&reg_enet>; 224 phy-supply = <&reg_enet>;
diff --git a/arch/arm/boot/dts/imx6dl-riotboard.dts b/arch/arm/boot/dts/imx6dl-riotboard.dts
index 65c184bb8fb0..d9de49efa802 100644
--- a/arch/arm/boot/dts/imx6dl-riotboard.dts
+++ b/arch/arm/boot/dts/imx6dl-riotboard.dts
@@ -92,7 +92,7 @@
92&fec { 92&fec {
93 pinctrl-names = "default"; 93 pinctrl-names = "default";
94 pinctrl-0 = <&pinctrl_enet>; 94 pinctrl-0 = <&pinctrl_enet>;
95 phy-mode = "rgmii"; 95 phy-mode = "rgmii-id";
96 phy-reset-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; 96 phy-reset-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;
97 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>, 97 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
98 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>; 98 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm/boot/dts/imx6q-ba16.dtsi b/arch/arm/boot/dts/imx6q-ba16.dtsi
index adc9455e42c7..37c63402157b 100644
--- a/arch/arm/boot/dts/imx6q-ba16.dtsi
+++ b/arch/arm/boot/dts/imx6q-ba16.dtsi
@@ -171,7 +171,7 @@
171&fec { 171&fec {
172 pinctrl-names = "default"; 172 pinctrl-names = "default";
173 pinctrl-0 = <&pinctrl_enet>; 173 pinctrl-0 = <&pinctrl_enet>;
174 phy-mode = "rgmii"; 174 phy-mode = "rgmii-id";
175 status = "okay"; 175 status = "okay";
176}; 176};
177 177
diff --git a/arch/arm/boot/dts/imx6q-marsboard.dts b/arch/arm/boot/dts/imx6q-marsboard.dts
index d8ccb533b6b7..84b30bd6908f 100644
--- a/arch/arm/boot/dts/imx6q-marsboard.dts
+++ b/arch/arm/boot/dts/imx6q-marsboard.dts
@@ -110,7 +110,7 @@
110&fec { 110&fec {
111 pinctrl-names = "default"; 111 pinctrl-names = "default";
112 pinctrl-0 = <&pinctrl_enet>; 112 pinctrl-0 = <&pinctrl_enet>;
113 phy-mode = "rgmii"; 113 phy-mode = "rgmii-id";
114 phy-reset-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; 114 phy-reset-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;
115 status = "okay"; 115 status = "okay";
116}; 116};
diff --git a/arch/arm/boot/dts/imx6q-tbs2910.dts b/arch/arm/boot/dts/imx6q-tbs2910.dts
index 2ce8399a10ba..bfff87ce2e1f 100644
--- a/arch/arm/boot/dts/imx6q-tbs2910.dts
+++ b/arch/arm/boot/dts/imx6q-tbs2910.dts
@@ -98,7 +98,7 @@
98&fec { 98&fec {
99 pinctrl-names = "default"; 99 pinctrl-names = "default";
100 pinctrl-0 = <&pinctrl_enet>; 100 pinctrl-0 = <&pinctrl_enet>;
101 phy-mode = "rgmii"; 101 phy-mode = "rgmii-id";
102 phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; 102 phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
103 status = "okay"; 103 status = "okay";
104}; 104};
diff --git a/arch/arm/boot/dts/imx6qdl-apf6.dtsi b/arch/arm/boot/dts/imx6qdl-apf6.dtsi
index 1ebf29f43a24..4738c3c1ab50 100644
--- a/arch/arm/boot/dts/imx6qdl-apf6.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-apf6.dtsi
@@ -51,7 +51,7 @@
51&fec { 51&fec {
52 pinctrl-names = "default"; 52 pinctrl-names = "default";
53 pinctrl-0 = <&pinctrl_enet>; 53 pinctrl-0 = <&pinctrl_enet>;
54 phy-mode = "rgmii"; 54 phy-mode = "rgmii-id";
55 phy-reset-duration = <10>; 55 phy-reset-duration = <10>;
56 phy-reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>; 56 phy-reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
57 status = "okay"; 57 status = "okay";
diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index 1280de50a984..f3404dd10537 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -292,7 +292,7 @@
292&fec { 292&fec {
293 pinctrl-names = "default"; 293 pinctrl-names = "default";
294 pinctrl-0 = <&pinctrl_enet>; 294 pinctrl-0 = <&pinctrl_enet>;
295 phy-mode = "rgmii"; 295 phy-mode = "rgmii-id";
296 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>, 296 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
297 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>; 297 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
298 fsl,err006687-workaround-present; 298 fsl,err006687-workaround-present;
diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
index a0705066ccba..185fb17a3500 100644
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
@@ -202,7 +202,7 @@
202&fec { 202&fec {
203 pinctrl-names = "default"; 203 pinctrl-names = "default";
204 pinctrl-0 = <&pinctrl_enet>; 204 pinctrl-0 = <&pinctrl_enet>;
205 phy-mode = "rgmii"; 205 phy-mode = "rgmii-id";
206 phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; 206 phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
207 status = "okay"; 207 status = "okay";
208}; 208};
diff --git a/arch/arm/boot/dts/imx6qdl-sr-som.dtsi b/arch/arm/boot/dts/imx6qdl-sr-som.dtsi
index 4ccb7afc4b35..6d7f6b9035bc 100644
--- a/arch/arm/boot/dts/imx6qdl-sr-som.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sr-som.dtsi
@@ -53,7 +53,7 @@
53&fec { 53&fec {
54 pinctrl-names = "default"; 54 pinctrl-names = "default";
55 pinctrl-0 = <&pinctrl_microsom_enet_ar8035>; 55 pinctrl-0 = <&pinctrl_microsom_enet_ar8035>;
56 phy-mode = "rgmii"; 56 phy-mode = "rgmii-id";
57 phy-reset-duration = <2>; 57 phy-reset-duration = <2>;
58 phy-reset-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>; 58 phy-reset-gpios = <&gpio4 15 GPIO_ACTIVE_LOW>;
59 status = "okay"; 59 status = "okay";
diff --git a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi
index b7d5fb421404..50d9a989e06a 100644
--- a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi
@@ -224,7 +224,7 @@
224&fec { 224&fec {
225 pinctrl-names = "default"; 225 pinctrl-names = "default";
226 pinctrl-0 = <&pinctrl_enet>; 226 pinctrl-0 = <&pinctrl_enet>;
227 phy-mode = "rgmii"; 227 phy-mode = "rgmii-id";
228 phy-reset-gpios = <&gpio3 29 GPIO_ACTIVE_LOW>; 228 phy-reset-gpios = <&gpio3 29 GPIO_ACTIVE_LOW>;
229 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>, 229 interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_HIGH>,
230 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>; 230 <&intc 0 119 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm/boot/dts/imx6sx-sabreauto.dts b/arch/arm/boot/dts/imx6sx-sabreauto.dts
index b0ee324afe58..315044ccd65f 100644
--- a/arch/arm/boot/dts/imx6sx-sabreauto.dts
+++ b/arch/arm/boot/dts/imx6sx-sabreauto.dts
@@ -75,7 +75,7 @@
75&fec1 { 75&fec1 {
76 pinctrl-names = "default"; 76 pinctrl-names = "default";
77 pinctrl-0 = <&pinctrl_enet1>; 77 pinctrl-0 = <&pinctrl_enet1>;
78 phy-mode = "rgmii"; 78 phy-mode = "rgmii-id";
79 phy-handle = <&ethphy1>; 79 phy-handle = <&ethphy1>;
80 fsl,magic-packet; 80 fsl,magic-packet;
81 status = "okay"; 81 status = "okay";
diff --git a/arch/arm/boot/dts/imx6sx-sdb.dtsi b/arch/arm/boot/dts/imx6sx-sdb.dtsi
index 08ede56c3f10..f6972deb5e39 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dtsi
+++ b/arch/arm/boot/dts/imx6sx-sdb.dtsi
@@ -191,7 +191,7 @@
191 pinctrl-names = "default"; 191 pinctrl-names = "default";
192 pinctrl-0 = <&pinctrl_enet1>; 192 pinctrl-0 = <&pinctrl_enet1>;
193 phy-supply = <&reg_enet_3v3>; 193 phy-supply = <&reg_enet_3v3>;
194 phy-mode = "rgmii"; 194 phy-mode = "rgmii-id";
195 phy-handle = <&ethphy1>; 195 phy-handle = <&ethphy1>;
196 phy-reset-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; 196 phy-reset-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
197 status = "okay"; 197 status = "okay";
diff --git a/arch/arm/boot/dts/imx7d-pico.dtsi b/arch/arm/boot/dts/imx7d-pico.dtsi
index 3fd595a71202..6f50ebf31a0a 100644
--- a/arch/arm/boot/dts/imx7d-pico.dtsi
+++ b/arch/arm/boot/dts/imx7d-pico.dtsi
@@ -92,7 +92,7 @@
92 <&clks IMX7D_ENET1_TIME_ROOT_CLK>; 92 <&clks IMX7D_ENET1_TIME_ROOT_CLK>;
93 assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>; 93 assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
94 assigned-clock-rates = <0>, <100000000>; 94 assigned-clock-rates = <0>, <100000000>;
95 phy-mode = "rgmii"; 95 phy-mode = "rgmii-id";
96 phy-handle = <&ethphy0>; 96 phy-handle = <&ethphy0>;
97 fsl,magic-packet; 97 fsl,magic-packet;
98 phy-reset-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>; 98 phy-reset-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;
diff --git a/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts b/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts
new file mode 100644
index 000000000000..8fcd95805ff4
--- /dev/null
+++ b/arch/arm/boot/dts/intel-ixp42x-linksys-nslu2.dts
@@ -0,0 +1,109 @@
1// SPDX-License-Identifier: ISC
2/*
3 * Device Tree file for Linksys NSLU2
4 */
5
6/dts-v1/;
7
8#include "intel-ixp42x.dtsi"
9#include <dt-bindings/input/input.h>
10
11/ {
12 model = "Linksys NSLU2 (Network Storage Link for USB 2.0 Disk Drives)";
13 compatible = "linksys,nslu2", "intel,ixp42x";
14 #address-cells = <1>;
15 #size-cells = <1>;
16
17 memory@0 {
18 /* 32 MB SDRAM */
19 device_type = "memory";
20 reg = <0x00000000 0x2000000>;
21 };
22
23 chosen {
24 bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait";
25 stdout-path = "uart0:115200n8";
26 };
27
28 aliases {
29 serial0 = &uart0;
30 };
31
32 leds {
33 compatible = "gpio-leds";
34 led-status {
35 label = "nslu2:red:status";
36 gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
37 default-state = "on";
38 linux,default-trigger = "heartbeat";
39 };
40 led-ready {
41 label = "nslu2:green:ready";
42 gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
43 default-state = "on";
44 };
45 led-disk-1 {
46 label = "nslu2:green:disk-1";
47 gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
48 default-state = "off";
49 };
50 led-disk-2 {
51 label = "nslu2:green:disk-2";
52 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
53 default-state = "off";
54 };
55 };
56
57 gpio_keys {
58 compatible = "gpio-keys";
59
60 button-power {
61 wakeup-source;
62 linux,code = <KEY_POWER>;
63 label = "power";
64 gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
65 };
66 button-reset {
67 wakeup-source;
68 linux,code = <KEY_ESC>;
69 label = "reset";
70 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
71 };
72 };
73
74 i2c {
75 compatible = "i2c-gpio";
76 sda-gpios = <&gpio0 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
77 scl-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
78 #address-cells = <1>;
79 #size-cells = <0>;
80
81 rtc@6f {
82 compatible = "xicor,x1205";
83 reg = <0x6f>;
84 };
85 };
86
87 gpio-poweroff {
88 compatible = "gpio-poweroff";
89 gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
90 timeout-ms = <5000>;
91 };
92
93 /* The first 16MB region on the expansion bus */
94 flash@50000000 {
95 compatible = "intel,ixp4xx-flash", "cfi-flash";
96 bank-width = <2>;
97 /*
98 * 8 MB of Flash in 0x20000 byte blocks
99 * mapped in at 0x50000000
100 */
101 reg = <0x50000000 0x800000>;
102
103 partitions {
104 compatible = "redboot-fis";
105 /* Eraseblock at 0x7e0000 */
106 fis-index-block = <0x3f>;
107 };
108 };
109};
diff --git a/arch/arm/boot/dts/intel-ixp42x.dtsi b/arch/arm/boot/dts/intel-ixp42x.dtsi
new file mode 100644
index 000000000000..a9622ca850cc
--- /dev/null
+++ b/arch/arm/boot/dts/intel-ixp42x.dtsi
@@ -0,0 +1,25 @@
1// SPDX-License-Identifier: ISC
2/*
3 * Device Tree file for Intel XScale Network Processors
4 * in the IXP 42x series. This series has 32 interrupts.
5 */
6#include "intel-ixp4xx.dtsi"
7
8/ {
9 soc {
10 interrupt-controller@c8003000 {
11 compatible = "intel,ixp42x-interrupt";
12 };
13
14 /*
15 * This is the USB Device Mode (UDC) controller, which is used
16 * to present the IXP4xx as a device on a USB bus.
17 */
18 usb@c800b000 {
19 compatible = "intel,ixp4xx-udc";
20 reg = <0xc800b000 0x1000>;
21 interrupts = <12 IRQ_TYPE_LEVEL_HIGH>;
22 status = "disabled";
23 };
24 };
25};
diff --git a/arch/arm/boot/dts/intel-ixp43x-gateworks-gw2358.dts b/arch/arm/boot/dts/intel-ixp43x-gateworks-gw2358.dts
new file mode 100644
index 000000000000..ba1163a1e1e7
--- /dev/null
+++ b/arch/arm/boot/dts/intel-ixp43x-gateworks-gw2358.dts
@@ -0,0 +1,94 @@
1// SPDX-License-Identifier: ISC
2/*
3 * Device Tree file for Gateworks IXP43x-based Cambria GW2358
4 */
5
6/dts-v1/;
7
8#include "intel-ixp43x.dtsi"
9
10/ {
11 model = "Gateworks Cambria GW2358";
12 compatible = "gateworks,gw2358", "intel,ixp43x";
13 #address-cells = <1>;
14 #size-cells = <1>;
15
16 memory@0 {
17 /* 128 MB SDRAM */
18 device_type = "memory";
19 reg = <0x00000000 0x8000000>;
20 };
21
22 chosen {
23 bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rw rootfstype=squashfs,jffs2 rootwait";
24 stdout-path = "uart0:115200n8";
25 };
26
27 aliases {
28 serial0 = &uart0;
29 };
30
31 leds {
32 compatible = "gpio-leds";
33 led-user {
34 label = "gw2358:green:LED";
35 gpios = <&pld1 0 GPIO_ACTIVE_LOW>;
36 default-state = "on";
37 linux,default-trigger = "heartbeat";
38 };
39 };
40
41
42 i2c {
43 compatible = "i2c-gpio";
44 sda-gpios = <&gpio0 7 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
45 scl-gpios = <&gpio0 6 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
46 #address-cells = <1>;
47 #size-cells = <0>;
48
49 hwmon@28 {
50 compatible = "adi,ad7418";
51 reg = <0x28>;
52 };
53 rtc: ds1672@68 {
54 compatible = "dallas,ds1672";
55 reg = <0x68>;
56 };
57 eeprom@51 {
58 compatible = "atmel,24c08";
59 reg = <0x51>;
60 pagesize = <16>;
61 size = <1024>;
62 read-only;
63 };
64 pld0: pld@56 {
65 compatible = "gateworks,pld-gpio";
66 reg = <0x56>;
67 gpio-controller;
68 #gpio-cells = <2>;
69 };
70 /* This PLD just handles the LED and user button */
71 pld1: pld@57 {
72 compatible = "gateworks,pld-gpio";
73 reg = <0x57>;
74 gpio-controller;
75 #gpio-cells = <2>;
76 };
77 };
78
79 flash@50000000 {
80 compatible = "intel,ixp4xx-flash", "cfi-flash";
81 bank-width = <2>;
82 /*
83 * 32 MB of Flash in 0x20000 byte blocks
84 * mapped in at 0x50000000
85 */
86 reg = <0x50000000 0x2000000>;
87
88 partitions {
89 compatible = "redboot-fis";
90 /* Eraseblock at 0x1fe0000 */
91 fis-index-block = <0xff>;
92 };
93 };
94};
diff --git a/arch/arm/boot/dts/intel-ixp43x.dtsi b/arch/arm/boot/dts/intel-ixp43x.dtsi
new file mode 100644
index 000000000000..494fb2ff57a0
--- /dev/null
+++ b/arch/arm/boot/dts/intel-ixp43x.dtsi
@@ -0,0 +1,15 @@
1// SPDX-License-Identifier: ISC
2/*
3 * Device Tree file for Intel XScale Network Processors
4 * in the IXP 43x series. This series has 64 interrupts and adds a few more
5 * peripherals over the 42x series.
6 */
7#include "intel-ixp4xx.dtsi"
8
9/ {
10 soc {
11 interrupt-controller@c8003000 {
12 compatible = "intel,ixp43x-interrupt";
13 };
14 };
15};
diff --git a/arch/arm/boot/dts/intel-ixp45x-ixp46x.dtsi b/arch/arm/boot/dts/intel-ixp45x-ixp46x.dtsi
new file mode 100644
index 000000000000..f8cd506659dc
--- /dev/null
+++ b/arch/arm/boot/dts/intel-ixp45x-ixp46x.dtsi
@@ -0,0 +1,34 @@
1// SPDX-License-Identifier: ISC
2/*
3 * Device Tree file for Intel XScale Network Processors
4 * in the IXP45x and IXP46x series. This series has 64 interrupts and adds a
5 * few more peripherals over the 42x and 43x series so this extends the
6 * basic IXP4xx DTSI.
7 */
8#include "intel-ixp4xx.dtsi"
9
10/ {
11 soc {
12 interrupt-controller@c8003000 {
13 compatible = "intel,ixp43x-interrupt";
14 };
15
16 /*
17 * This is the USB Device Mode (UDC) controller, which is used
18 * to present the IXP4xx as a device on a USB bus.
19 */
20 usb@c800b000 {
21 compatible = "intel,ixp4xx-udc";
22 reg = <0xc800b000 0x1000>;
23 interrupts = <12 IRQ_TYPE_LEVEL_HIGH>;
24 status = "disabled";
25 };
26
27 i2c@c8011000 {
28 compatible = "intel,ixp4xx-i2c";
29 reg = <0xc8011000 0x18>;
30 interrupts = <33 IRQ_TYPE_LEVEL_HIGH>;
31 status = "disabled";
32 };
33 };
34};
diff --git a/arch/arm/boot/dts/intel-ixp4xx.dtsi b/arch/arm/boot/dts/intel-ixp4xx.dtsi
new file mode 100644
index 000000000000..d4a09584f417
--- /dev/null
+++ b/arch/arm/boot/dts/intel-ixp4xx.dtsi
@@ -0,0 +1,69 @@
1// SPDX-License-Identifier: ISC
2/*
3 * Device Tree file for Intel XScale Network Processors
4 * in the IXP 4xx series.
5 */
6#include <dt-bindings/interrupt-controller/irq.h>
7#include <dt-bindings/gpio/gpio.h>
8
9/ {
10 soc {
11 #address-cells = <1>;
12 #size-cells = <1>;
13 ranges;
14 compatible = "simple-bus";
15 interrupt-parent = <&intcon>;
16
17 qmgr: queue-manager@60000000 {
18 compatible = "intel,ixp4xx-ahb-queue-manager";
19 reg = <0x60000000 0x4000>;
20 interrupts = <3 IRQ_TYPE_LEVEL_HIGH>, <4 IRQ_TYPE_LEVEL_HIGH>;
21 };
22
23 uart0: serial@c8000000 {
24 compatible = "intel,xscale-uart";
25 reg = <0xc8000000 0x1000>;
26 /*
27 * The reg-offset and reg-shift is a side effect
28 * of running the platform in big endian mode.
29 */
30 reg-offset = <3>;
31 reg-shift = <2>;
32 interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
33 clock-frequency = <14745600>;
34 no-loopback-test;
35 };
36
37 gpio0: gpio@c8004000 {
38 compatible = "intel,ixp4xx-gpio";
39 reg = <0xc8004000 0x1000>;
40 gpio-controller;
41 #gpio-cells = <2>;
42 interrupt-controller;
43 #interrupt-cells = <2>;
44 };
45
46 intcon: interrupt-controller@c8003000 {
47 /*
48 * Note: no compatible string. The subvariant of the
49 * chip needs to define what version it is. The
50 * location of the interrupt controller is fixed in
51 * memory across all variants.
52 */
53 reg = <0xc8003000 0x100>;
54 interrupt-controller;
55 #interrupt-cells = <2>;
56 };
57
58 timer@c8005000 {
59 compatible = "intel,ixp4xx-timer";
60 reg = <0xc8005000 0x100>;
61 interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
62 };
63
64 npe@c8006000 {
65 compatible = "intel,ixp4xx-network-processing-engine";
66 reg = <0xc8006000 0x1000>, <0xc8007000 0x1000>, <0xc8008000 0x1000>;
67 };
68 };
69};
diff --git a/arch/arm/boot/dts/ls1021a-twr.dts b/arch/arm/boot/dts/ls1021a-twr.dts
index 97e1fb7ea932..9b1fe99d55b1 100644
--- a/arch/arm/boot/dts/ls1021a-twr.dts
+++ b/arch/arm/boot/dts/ls1021a-twr.dts
@@ -145,7 +145,7 @@
145}; 145};
146 146
147&enet0 { 147&enet0 {
148 tbi-handle = <&tbi1>; 148 tbi-handle = <&tbi0>;
149 phy-handle = <&sgmii_phy2>; 149 phy-handle = <&sgmii_phy2>;
150 phy-connection-type = "sgmii"; 150 phy-connection-type = "sgmii";
151 status = "okay"; 151 status = "okay";
@@ -225,6 +225,13 @@
225 sgmii_phy2: ethernet-phy@2 { 225 sgmii_phy2: ethernet-phy@2 {
226 reg = <0x2>; 226 reg = <0x2>;
227 }; 227 };
228 tbi0: tbi-phy@1f {
229 reg = <0x1f>;
230 device_type = "tbi-phy";
231 };
232};
233
234&mdio1 {
228 tbi1: tbi-phy@1f { 235 tbi1: tbi-phy@1f {
229 reg = <0x1f>; 236 reg = <0x1f>;
230 device_type = "tbi-phy"; 237 device_type = "tbi-phy";
diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
index b10ff5877b4c..fe6eecf01da1 100644
--- a/arch/arm/boot/dts/ls1021a.dtsi
+++ b/arch/arm/boot/dts/ls1021a.dtsi
@@ -729,7 +729,7 @@
729 }; 729 };
730 730
731 mdio0: mdio@2d24000 { 731 mdio0: mdio@2d24000 {
732 compatible = "gianfar"; 732 compatible = "fsl,etsec2-mdio";
733 device_type = "mdio"; 733 device_type = "mdio";
734 #address-cells = <1>; 734 #address-cells = <1>;
735 #size-cells = <0>; 735 #size-cells = <0>;
@@ -737,6 +737,15 @@
737 <0x0 0x2d10030 0x0 0x4>; 737 <0x0 0x2d10030 0x0 0x4>;
738 }; 738 };
739 739
740 mdio1: mdio@2d64000 {
741 compatible = "fsl,etsec2-mdio";
742 device_type = "mdio";
743 #address-cells = <1>;
744 #size-cells = <0>;
745 reg = <0x0 0x2d64000 0x0 0x4000>,
746 <0x0 0x2d50030 0x0 0x4>;
747 };
748
740 ptp_clock@2d10e00 { 749 ptp_clock@2d10e00 {
741 compatible = "fsl,etsec-ptp"; 750 compatible = "fsl,etsec-ptp";
742 reg = <0x0 0x2d10e00 0x0 0xb0>; 751 reg = <0x0 0x2d10e00 0x0 0xb0>;
diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
index 43fe215e83ea..14a7d0288b45 100644
--- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
+++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
@@ -169,6 +169,8 @@
169 clock-names = "ahb", "mod"; 169 clock-names = "ahb", "mod";
170 resets = <&ccu RST_BUS_NAND>; 170 resets = <&ccu RST_BUS_NAND>;
171 reset-names = "ahb"; 171 reset-names = "ahb";
172 pinctrl-names = "default";
173 pinctrl-0 = <&nand_pins &nand_pins_cs0 &nand_pins_rb0>;
172 status = "disabled"; 174 status = "disabled";
173 #address-cells = <1>; 175 #address-cells = <1>;
174 #size-cells = <0>; 176 #size-cells = <0>;
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
index d635edfb6ff2..c95c54284da2 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -9,7 +9,6 @@ CONFIG_MODULE_UNLOAD=y
9CONFIG_PARTITION_ADVANCED=y 9CONFIG_PARTITION_ADVANCED=y
10CONFIG_ARCH_EXYNOS=y 10CONFIG_ARCH_EXYNOS=y
11CONFIG_ARCH_EXYNOS3=y 11CONFIG_ARCH_EXYNOS3=y
12CONFIG_EXYNOS5420_MCPM=y
13CONFIG_SMP=y 12CONFIG_SMP=y
14CONFIG_BIG_LITTLE=y 13CONFIG_BIG_LITTLE=y
15CONFIG_NR_CPUS=8 14CONFIG_NR_CPUS=8
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index b7b1cd00a294..9a78c8940105 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -33,7 +33,6 @@ CONFIG_MACH_BERLIN_BG2CD=y
33CONFIG_MACH_BERLIN_BG2Q=y 33CONFIG_MACH_BERLIN_BG2Q=y
34CONFIG_ARCH_DIGICOLOR=y 34CONFIG_ARCH_DIGICOLOR=y
35CONFIG_ARCH_EXYNOS=y 35CONFIG_ARCH_EXYNOS=y
36CONFIG_EXYNOS5420_MCPM=y
37CONFIG_ARCH_HIGHBANK=y 36CONFIG_ARCH_HIGHBANK=y
38CONFIG_ARCH_HISI=y 37CONFIG_ARCH_HISI=y
39CONFIG_ARCH_HI3xxx=y 38CONFIG_ARCH_HI3xxx=y
diff --git a/arch/arm/firmware/Kconfig b/arch/arm/firmware/Kconfig
deleted file mode 100644
index ad396af68e47..000000000000
--- a/arch/arm/firmware/Kconfig
+++ /dev/null
@@ -1,29 +0,0 @@
1config ARCH_SUPPORTS_FIRMWARE
2 bool
3
4config ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
5 bool
6 select ARCH_SUPPORTS_FIRMWARE
7
8menu "Firmware options"
9 depends on ARCH_SUPPORTS_FIRMWARE
10
11config TRUSTED_FOUNDATIONS
12 bool "Trusted Foundations secure monitor support"
13 depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
14 default y
15 help
16 Some devices (including most Tegra-based consumer devices on the
17 market) are booted with the Trusted Foundations secure monitor
18 active, requiring some core operations to be performed by the secure
19 monitor instead of the kernel.
20
21 This option allows the kernel to invoke the secure monitor whenever
22 required on devices using Trusted Foundations. See
23 arch/arm/include/asm/trusted_foundations.h or the
24 tlm,trusted-foundations device tree binding documentation for details
25 on how to use it.
26
27 Say n if you don't know what this is about.
28
29endmenu
diff --git a/arch/arm/firmware/Makefile b/arch/arm/firmware/Makefile
deleted file mode 100644
index 6e41336b0bc4..000000000000
--- a/arch/arm/firmware/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
1obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o
2
3# tf_generic_smc() fails to build with -fsanitize-coverage=trace-pc
4KCOV_INSTRUMENT := n
diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h
index 34c1d96ef46d..6698272bbcbf 100644
--- a/arch/arm/include/asm/firmware.h
+++ b/arch/arm/include/asm/firmware.h
@@ -24,7 +24,7 @@ struct firmware_ops {
24 /* 24 /*
25 * Inform the firmware we intend to enter CPU idle mode 25 * Inform the firmware we intend to enter CPU idle mode
26 */ 26 */
27 int (*prepare_idle)(void); 27 int (*prepare_idle)(unsigned long mode);
28 /* 28 /*
29 * Enters CPU idle mode 29 * Enters CPU idle mode
30 */ 30 */
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index ff097ecfa451..51a892702e27 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -29,6 +29,7 @@
29#include <linux/platform_data/spi-davinci.h> 29#include <linux/platform_data/spi-davinci.h>
30#include <linux/platform_data/usb-davinci.h> 30#include <linux/platform_data/usb-davinci.h>
31#include <linux/platform_data/ti-aemif.h> 31#include <linux/platform_data/ti-aemif.h>
32#include <linux/regulator/fixed.h>
32#include <linux/regulator/machine.h> 33#include <linux/regulator/machine.h>
33#include <linux/nvmem-provider.h> 34#include <linux/nvmem-provider.h>
34 35
@@ -53,14 +54,50 @@ static const short da830_evm_usb11_pins[] = {
53 -1 54 -1
54}; 55};
55 56
56static struct gpiod_lookup_table da830_evm_usb_gpio_lookup = { 57static struct regulator_consumer_supply da830_evm_usb_supplies[] = {
58 REGULATOR_SUPPLY("vbus", NULL),
59};
60
61static struct regulator_init_data da830_evm_usb_vbus_data = {
62 .consumer_supplies = da830_evm_usb_supplies,
63 .num_consumer_supplies = ARRAY_SIZE(da830_evm_usb_supplies),
64};
65
66static struct fixed_voltage_config da830_evm_usb_vbus = {
67 .supply_name = "vbus",
68 .microvolts = 33000000,
69 .init_data = &da830_evm_usb_vbus_data,
70};
71
72static struct platform_device da830_evm_usb_vbus_device = {
73 .name = "reg-fixed-voltage",
74 .id = 0,
75 .dev = {
76 .platform_data = &da830_evm_usb_vbus,
77 },
78};
79
80static struct gpiod_lookup_table da830_evm_usb_oc_gpio_lookup = {
57 .dev_id = "ohci-da8xx", 81 .dev_id = "ohci-da8xx",
58 .table = { 82 .table = {
59 GPIO_LOOKUP("davinci_gpio", ON_BD_USB_DRV, "vbus", 0),
60 GPIO_LOOKUP("davinci_gpio", ON_BD_USB_OVC, "oc", 0), 83 GPIO_LOOKUP("davinci_gpio", ON_BD_USB_OVC, "oc", 0),
84 { }
61 }, 85 },
62}; 86};
63 87
88static struct gpiod_lookup_table da830_evm_usb_vbus_gpio_lookup = {
89 .dev_id = "reg-fixed-voltage.0",
90 .table = {
91 GPIO_LOOKUP("davinci_gpio", ON_BD_USB_DRV, "vbus", 0),
92 { }
93 },
94};
95
96static struct gpiod_lookup_table *da830_evm_usb_gpio_lookups[] = {
97 &da830_evm_usb_oc_gpio_lookup,
98 &da830_evm_usb_vbus_gpio_lookup,
99};
100
64static struct da8xx_ohci_root_hub da830_evm_usb11_pdata = { 101static struct da8xx_ohci_root_hub da830_evm_usb11_pdata = {
65 /* TPS2065 switch @ 5V */ 102 /* TPS2065 switch @ 5V */
66 .potpgt = (3 + 1) / 2, /* 3 ms max */ 103 .potpgt = (3 + 1) / 2, /* 3 ms max */
@@ -75,6 +112,9 @@ static __init void da830_evm_usb_init(void)
75 pr_warn("%s: USB PHY CLK registration failed: %d\n", 112 pr_warn("%s: USB PHY CLK registration failed: %d\n",
76 __func__, ret); 113 __func__, ret);
77 114
115 gpiod_add_lookup_tables(da830_evm_usb_gpio_lookups,
116 ARRAY_SIZE(da830_evm_usb_gpio_lookups));
117
78 ret = da8xx_register_usb_phy(); 118 ret = da8xx_register_usb_phy();
79 if (ret) 119 if (ret)
80 pr_warn("%s: USB PHY registration failed: %d\n", 120 pr_warn("%s: USB PHY registration failed: %d\n",
@@ -100,7 +140,11 @@ static __init void da830_evm_usb_init(void)
100 return; 140 return;
101 } 141 }
102 142
103 gpiod_add_lookup_table(&da830_evm_usb_gpio_lookup); 143 ret = platform_device_register(&da830_evm_usb_vbus_device);
144 if (ret) {
145 pr_warn("%s: Unable to register the vbus supply\n", __func__);
146 return;
147 }
104 148
105 ret = da8xx_register_usb11(&da830_evm_usb11_pdata); 149 ret = da8xx_register_usb11(&da830_evm_usb11_pdata);
106 if (ret) 150 if (ret)
@@ -156,6 +200,7 @@ static struct gpiod_lookup_table mmc_gpios_table = {
156 GPIO_ACTIVE_LOW), 200 GPIO_ACTIVE_LOW),
157 GPIO_LOOKUP("davinci_gpio", DA830_MMCSD_WP_PIN, "wp", 201 GPIO_LOOKUP("davinci_gpio", DA830_MMCSD_WP_PIN, "wp",
158 GPIO_ACTIVE_LOW), 202 GPIO_ACTIVE_LOW),
203 { }
159 }, 204 },
160}; 205};
161 206
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 1fdc9283a8c5..4ee65a8a3b80 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -784,6 +784,7 @@ static struct gpiod_lookup_table mmc_gpios_table = {
784 GPIO_ACTIVE_LOW), 784 GPIO_ACTIVE_LOW),
785 GPIO_LOOKUP("davinci_gpio", DA850_MMCSD_WP_PIN, "wp", 785 GPIO_LOOKUP("davinci_gpio", DA850_MMCSD_WP_PIN, "wp",
786 GPIO_ACTIVE_HIGH), 786 GPIO_ACTIVE_HIGH),
787 { }
787 }, 788 },
788}; 789};
789 790
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 64d81fc86f14..5113273fda69 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -121,6 +121,7 @@ static struct gpiod_lookup_table i2c_recovery_gpiod_table = {
121 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), 121 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
122 GPIO_LOOKUP("davinci_gpio", DM355_I2C_SCL_PIN, "scl", 122 GPIO_LOOKUP("davinci_gpio", DM355_I2C_SCL_PIN, "scl",
123 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), 123 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
124 { }
124 }, 125 },
125}; 126};
126 127
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index de15f782816e..9d87d4e440ea 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -663,6 +663,7 @@ static struct gpiod_lookup_table i2c_recovery_gpiod_table = {
663 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), 663 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
664 GPIO_LOOKUP("davinci_gpio", DM644X_I2C_SCL_PIN, "scl", 664 GPIO_LOOKUP("davinci_gpio", DM644X_I2C_SCL_PIN, "scl",
665 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN), 665 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
666 { }
666 }, 667 },
667}; 668};
668 669
diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c
index 0896af2bed24..db177a6a7e48 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -21,6 +21,7 @@
21#include <linux/platform_data/mtd-davinci.h> 21#include <linux/platform_data/mtd-davinci.h>
22#include <linux/platform_data/mtd-davinci-aemif.h> 22#include <linux/platform_data/mtd-davinci-aemif.h>
23#include <linux/platform_data/ti-aemif.h> 23#include <linux/platform_data/ti-aemif.h>
24#include <linux/regulator/fixed.h>
24#include <linux/regulator/machine.h> 25#include <linux/regulator/machine.h>
25 26
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
@@ -298,14 +299,50 @@ static const short da850_hawk_usb11_pins[] = {
298 -1 299 -1
299}; 300};
300 301
301static struct gpiod_lookup_table hawk_usb_gpio_lookup = { 302static struct regulator_consumer_supply hawk_usb_supplies[] = {
303 REGULATOR_SUPPLY("vbus", NULL),
304};
305
306static struct regulator_init_data hawk_usb_vbus_data = {
307 .consumer_supplies = hawk_usb_supplies,
308 .num_consumer_supplies = ARRAY_SIZE(hawk_usb_supplies),
309};
310
311static struct fixed_voltage_config hawk_usb_vbus = {
312 .supply_name = "vbus",
313 .microvolts = 3300000,
314 .init_data = &hawk_usb_vbus_data,
315};
316
317static struct platform_device hawk_usb_vbus_device = {
318 .name = "reg-fixed-voltage",
319 .id = 0,
320 .dev = {
321 .platform_data = &hawk_usb_vbus,
322 },
323};
324
325static struct gpiod_lookup_table hawk_usb_oc_gpio_lookup = {
302 .dev_id = "ohci-da8xx", 326 .dev_id = "ohci-da8xx",
303 .table = { 327 .table = {
304 GPIO_LOOKUP("davinci_gpio", DA850_USB1_VBUS_PIN, "vbus", 0),
305 GPIO_LOOKUP("davinci_gpio", DA850_USB1_OC_PIN, "oc", 0), 328 GPIO_LOOKUP("davinci_gpio", DA850_USB1_OC_PIN, "oc", 0),
329 { }
306 }, 330 },
307}; 331};
308 332
333static struct gpiod_lookup_table hawk_usb_vbus_gpio_lookup = {
334 .dev_id = "reg-fixed-voltage.0",
335 .table = {
336 GPIO_LOOKUP("davinci_gpio", DA850_USB1_VBUS_PIN, NULL, 0),
337 { }
338 },
339};
340
341static struct gpiod_lookup_table *hawk_usb_gpio_lookups[] = {
342 &hawk_usb_oc_gpio_lookup,
343 &hawk_usb_vbus_gpio_lookup,
344};
345
309static struct da8xx_ohci_root_hub omapl138_hawk_usb11_pdata = { 346static struct da8xx_ohci_root_hub omapl138_hawk_usb11_pdata = {
310 /* TPS2087 switch @ 5V */ 347 /* TPS2087 switch @ 5V */
311 .potpgt = (3 + 1) / 2, /* 3 ms max */ 348 .potpgt = (3 + 1) / 2, /* 3 ms max */
@@ -326,12 +363,19 @@ static __init void omapl138_hawk_usb_init(void)
326 pr_warn("%s: USB PHY CLK registration failed: %d\n", 363 pr_warn("%s: USB PHY CLK registration failed: %d\n",
327 __func__, ret); 364 __func__, ret);
328 365
366 gpiod_add_lookup_tables(hawk_usb_gpio_lookups,
367 ARRAY_SIZE(hawk_usb_gpio_lookups));
368
329 ret = da8xx_register_usb_phy(); 369 ret = da8xx_register_usb_phy();
330 if (ret) 370 if (ret)
331 pr_warn("%s: USB PHY registration failed: %d\n", 371 pr_warn("%s: USB PHY registration failed: %d\n",
332 __func__, ret); 372 __func__, ret);
333 373
334 gpiod_add_lookup_table(&hawk_usb_gpio_lookup); 374 ret = platform_device_register(&hawk_usb_vbus_device);
375 if (ret) {
376 pr_warn("%s: Unable to register the vbus supply\n", __func__);
377 return;
378 }
335 379
336 ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata); 380 ret = da8xx_register_usb11(&omapl138_hawk_usb11_pdata);
337 if (ret) 381 if (ret)
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c
index bda6c3a5c923..5d3a3e302012 100644
--- a/arch/arm/mach-ep93xx/adssphere.c
+++ b/arch/arm/mach-ep93xx/adssphere.c
@@ -15,7 +15,7 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/sizes.h> 16#include <linux/sizes.h>
17 17
18#include <mach/hardware.h> 18#include "hardware.h"
19 19
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
index d2eee707d27f..b9f523d9dc8c 100644
--- a/arch/arm/mach-ep93xx/clock.c
+++ b/arch/arm/mach-ep93xx/clock.c
@@ -20,8 +20,9 @@
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/spinlock.h> 21#include <linux/spinlock.h>
22#include <linux/clkdev.h> 22#include <linux/clkdev.h>
23#include <linux/soc/cirrus/ep93xx.h>
23 24
24#include <mach/hardware.h> 25#include "hardware.h"
25 26
26#include <asm/div64.h> 27#include <asm/div64.h>
27 28
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 706515faee06..cc1382f879af 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -39,11 +39,13 @@
39#include <linux/usb/ohci_pdriver.h> 39#include <linux/usb/ohci_pdriver.h>
40#include <linux/random.h> 40#include <linux/random.h>
41 41
42#include <mach/hardware.h> 42#include "hardware.h"
43#include <linux/platform_data/video-ep93xx.h> 43#include <linux/platform_data/video-ep93xx.h>
44#include <linux/platform_data/keypad-ep93xx.h> 44#include <linux/platform_data/keypad-ep93xx.h>
45#include <linux/platform_data/spi-ep93xx.h> 45#include <linux/platform_data/spi-ep93xx.h>
46#include <mach/gpio-ep93xx.h> 46#include <linux/soc/cirrus/ep93xx.h>
47
48#include "gpio-ep93xx.h"
47 49
48#include <asm/mach/arch.h> 50#include <asm/mach/arch.h>
49#include <asm/mach/map.h> 51#include <asm/mach/map.h>
@@ -123,7 +125,7 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits)
123/** 125/**
124 * ep93xx_chip_revision() - returns the EP93xx chip revision 126 * ep93xx_chip_revision() - returns the EP93xx chip revision
125 * 127 *
126 * See <mach/platform.h> for more information. 128 * See "platform.h" for more information.
127 */ 129 */
128unsigned int ep93xx_chip_revision(void) 130unsigned int ep93xx_chip_revision(void)
129{ 131{
diff --git a/arch/arm/mach-ep93xx/dma.c b/arch/arm/mach-ep93xx/dma.c
index 88a4c9b089a5..821427107b11 100644
--- a/arch/arm/mach-ep93xx/dma.c
+++ b/arch/arm/mach-ep93xx/dma.c
@@ -26,7 +26,7 @@
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27 27
28#include <linux/platform_data/dma-ep93xx.h> 28#include <linux/platform_data/dma-ep93xx.h>
29#include <mach/hardware.h> 29#include "hardware.h"
30 30
31#include "soc.h" 31#include "soc.h"
32 32
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 34e18e9556d9..c8c47122cf1d 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -33,10 +33,10 @@
33 33
34#include <sound/cs4271.h> 34#include <sound/cs4271.h>
35 35
36#include <mach/hardware.h> 36#include "hardware.h"
37#include <linux/platform_data/video-ep93xx.h> 37#include <linux/platform_data/video-ep93xx.h>
38#include <linux/platform_data/spi-ep93xx.h> 38#include <linux/platform_data/spi-ep93xx.h>
39#include <mach/gpio-ep93xx.h> 39#include "gpio-ep93xx.h"
40 40
41#include <asm/mach-types.h> 41#include <asm/mach-types.h>
42#include <asm/mach/arch.h> 42#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c
index 0cca5b183309..ac48e3476587 100644
--- a/arch/arm/mach-ep93xx/gesbc9312.c
+++ b/arch/arm/mach-ep93xx/gesbc9312.c
@@ -15,7 +15,7 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/sizes.h> 16#include <linux/sizes.h>
17 17
18#include <mach/hardware.h> 18#include "hardware.h"
19 19
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h b/arch/arm/mach-ep93xx/gpio-ep93xx.h
index 242af4a401ea..242af4a401ea 100644
--- a/arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h
+++ b/arch/arm/mach-ep93xx/gpio-ep93xx.h
diff --git a/arch/arm/mach-ep93xx/include/mach/hardware.h b/arch/arm/mach-ep93xx/hardware.h
index 8938906e780a..e7d850e04782 100644
--- a/arch/arm/mach-ep93xx/include/mach/hardware.h
+++ b/arch/arm/mach-ep93xx/hardware.h
@@ -6,7 +6,7 @@
6#ifndef __ASM_ARCH_HARDWARE_H 6#ifndef __ASM_ARCH_HARDWARE_H
7#define __ASM_ARCH_HARDWARE_H 7#define __ASM_ARCH_HARDWARE_H
8 8
9#include <mach/platform.h> 9#include "platform.h"
10 10
11/* 11/*
12 * The EP93xx has two external crystal oscillators. To generate the 12 * The EP93xx has two external crystal oscillators. To generate the
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c
index 373583c29825..c7f64e4ff6c7 100644
--- a/arch/arm/mach-ep93xx/micro9.c
+++ b/arch/arm/mach-ep93xx/micro9.c
@@ -16,7 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <mach/hardware.h> 19#include "hardware.h"
20 20
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/platform.h
index 6c41c794bed5..b4045a186239 100644
--- a/arch/arm/mach-ep93xx/include/mach/platform.h
+++ b/arch/arm/mach-ep93xx/platform.h
@@ -5,6 +5,7 @@
5 5
6#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
7 7
8#include <linux/platform_data/eth-ep93xx.h>
8#include <linux/reboot.h> 9#include <linux/reboot.h>
9 10
10struct device; 11struct device;
@@ -15,23 +16,9 @@ struct ep93xxfb_mach_info;
15struct ep93xx_keypad_platform_data; 16struct ep93xx_keypad_platform_data;
16struct ep93xx_spi_info; 17struct ep93xx_spi_info;
17 18
18struct ep93xx_eth_data
19{
20 unsigned char dev_addr[6];
21 unsigned char phy_id;
22};
23
24void ep93xx_map_io(void); 19void ep93xx_map_io(void);
25void ep93xx_init_irq(void); 20void ep93xx_init_irq(void);
26 21
27#define EP93XX_CHIP_REV_D0 3
28#define EP93XX_CHIP_REV_D1 4
29#define EP93XX_CHIP_REV_E0 5
30#define EP93XX_CHIP_REV_E1 6
31#define EP93XX_CHIP_REV_E2 7
32
33unsigned int ep93xx_chip_revision(void);
34
35void ep93xx_register_flash(unsigned int width, 22void ep93xx_register_flash(unsigned int width,
36 resource_size_t start, resource_size_t size); 23 resource_size_t start, resource_size_t size);
37 24
@@ -41,19 +28,11 @@ void ep93xx_register_spi(struct ep93xx_spi_info *info,
41 struct spi_board_info *devices, int num); 28 struct spi_board_info *devices, int num);
42void ep93xx_register_fb(struct ep93xxfb_mach_info *data); 29void ep93xx_register_fb(struct ep93xxfb_mach_info *data);
43void ep93xx_register_pwm(int pwm0, int pwm1); 30void ep93xx_register_pwm(int pwm0, int pwm1);
44int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
45void ep93xx_pwm_release_gpio(struct platform_device *pdev);
46void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data); 31void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data);
47int ep93xx_keypad_acquire_gpio(struct platform_device *pdev);
48void ep93xx_keypad_release_gpio(struct platform_device *pdev);
49void ep93xx_register_i2s(void); 32void ep93xx_register_i2s(void);
50int ep93xx_i2s_acquire(void);
51void ep93xx_i2s_release(void);
52void ep93xx_register_ac97(void); 33void ep93xx_register_ac97(void);
53void ep93xx_register_ide(void); 34void ep93xx_register_ide(void);
54void ep93xx_register_adc(void); 35void ep93xx_register_adc(void);
55int ep93xx_ide_acquire_gpio(struct platform_device *pdev);
56void ep93xx_ide_release_gpio(struct platform_device *pdev);
57 36
58struct device *ep93xx_init_devices(void); 37struct device *ep93xx_init_devices(void);
59extern void ep93xx_timer_init(void); 38extern void ep93xx_timer_init(void);
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index f0f38c0dba52..5a3c32fa7ace 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -27,8 +27,8 @@
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/gpio/machine.h> 28#include <linux/gpio/machine.h>
29 29
30#include <mach/hardware.h> 30#include "hardware.h"
31#include <mach/gpio-ep93xx.h> 31#include "gpio-ep93xx.h"
32 32
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c
index cf0cb58b3454..f8f89551dbed 100644
--- a/arch/arm/mach-ep93xx/snappercl15.c
+++ b/arch/arm/mach-ep93xx/snappercl15.c
@@ -25,9 +25,9 @@
25 25
26#include <linux/mtd/platnand.h> 26#include <linux/mtd/platnand.h>
27 27
28#include <mach/hardware.h> 28#include "hardware.h"
29#include <linux/platform_data/video-ep93xx.h> 29#include <linux/platform_data/video-ep93xx.h>
30#include <mach/gpio-ep93xx.h> 30#include "gpio-ep93xx.h"
31 31
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index a3a20c83c6b8..e9f369067293 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -24,8 +24,8 @@
24#include <linux/platform_data/spi-ep93xx.h> 24#include <linux/platform_data/spi-ep93xx.h>
25#include <linux/gpio/machine.h> 25#include <linux/gpio/machine.h>
26 26
27#include <mach/gpio-ep93xx.h> 27#include "gpio-ep93xx.h"
28#include <mach/hardware.h> 28#include "hardware.h"
29#include <mach/irqs.h> 29#include <mach/irqs.h>
30 30
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c
index f95a644769e4..d44db6d67f35 100644
--- a/arch/arm/mach-ep93xx/vision_ep9307.c
+++ b/arch/arm/mach-ep93xx/vision_ep9307.c
@@ -31,10 +31,10 @@
31 31
32#include <sound/cs4271.h> 32#include <sound/cs4271.h>
33 33
34#include <mach/hardware.h> 34#include "hardware.h"
35#include <linux/platform_data/video-ep93xx.h> 35#include <linux/platform_data/video-ep93xx.h>
36#include <linux/platform_data/spi-ep93xx.h> 36#include <linux/platform_data/spi-ep93xx.h>
37#include <mach/gpio-ep93xx.h> 37#include "gpio-ep93xx.h"
38 38
39#include <asm/mach-types.h> 39#include <asm/mach-types.h>
40#include <asm/mach/map.h> 40#include <asm/mach/map.h>
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index b40963cf91c7..1c518b8ee520 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -106,21 +106,15 @@ config SOC_EXYNOS5420
106 bool "SAMSUNG EXYNOS5420" 106 bool "SAMSUNG EXYNOS5420"
107 default y 107 default y
108 depends on ARCH_EXYNOS5 108 depends on ARCH_EXYNOS5
109 select MCPM if SMP
110 select ARM_CCI400_PORT_CTRL
111 select ARM_CPU_SUSPEND
109 112
110config SOC_EXYNOS5800 113config SOC_EXYNOS5800
111 bool "SAMSUNG EXYNOS5800" 114 bool "SAMSUNG EXYNOS5800"
112 default y 115 default y
113 depends on SOC_EXYNOS5420 116 depends on SOC_EXYNOS5420
114 117
115config EXYNOS5420_MCPM
116 bool "Exynos5420 Multi-Cluster PM support"
117 depends on MCPM && SOC_EXYNOS5420
118 select ARM_CCI400_PORT_CTRL
119 select ARM_CPU_SUSPEND
120 help
121 This is needed to provide CPU and cluster power management
122 on Exynos5420 implementing big.LITTLE.
123
124config EXYNOS_CPU_SUSPEND 118config EXYNOS_CPU_SUSPEND
125 bool 119 bool
126 select ARM_CPU_SUSPEND 120 select ARM_CPU_SUSPEND
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index cd00c82a1add..264dbaa89c3d 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -18,5 +18,5 @@ plus_sec := $(call as-instr,.arch_extension sec,+sec)
18AFLAGS_exynos-smc.o :=-Wa,-march=armv7-a$(plus_sec) 18AFLAGS_exynos-smc.o :=-Wa,-march=armv7-a$(plus_sec)
19AFLAGS_sleep.o :=-Wa,-march=armv7-a$(plus_sec) 19AFLAGS_sleep.o :=-Wa,-march=armv7-a$(plus_sec)
20 20
21obj-$(CONFIG_EXYNOS5420_MCPM) += mcpm-exynos.o 21obj-$(CONFIG_MCPM) += mcpm-exynos.o
22CFLAGS_mcpm-exynos.o += -march=armv7-a 22CFLAGS_mcpm-exynos.o += -march=armv7-a
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 1b8699e94098..c93356a8d662 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -91,6 +91,7 @@ extern u32 cp15_save_power;
91 91
92extern void __iomem *sysram_ns_base_addr; 92extern void __iomem *sysram_ns_base_addr;
93extern void __iomem *sysram_base_addr; 93extern void __iomem *sysram_base_addr;
94extern phys_addr_t sysram_base_phys;
94extern void __iomem *pmu_base_addr; 95extern void __iomem *pmu_base_addr;
95void exynos_sysram_init(void); 96void exynos_sysram_init(void);
96 97
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 865dcc4c3181..9aa483366ebc 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -33,6 +33,7 @@ static struct platform_device exynos_cpuidle = {
33}; 33};
34 34
35void __iomem *sysram_base_addr __ro_after_init; 35void __iomem *sysram_base_addr __ro_after_init;
36phys_addr_t sysram_base_phys __ro_after_init;
36void __iomem *sysram_ns_base_addr __ro_after_init; 37void __iomem *sysram_ns_base_addr __ro_after_init;
37 38
38void __init exynos_sysram_init(void) 39void __init exynos_sysram_init(void)
@@ -43,6 +44,8 @@ void __init exynos_sysram_init(void)
43 if (!of_device_is_available(node)) 44 if (!of_device_is_available(node))
44 continue; 45 continue;
45 sysram_base_addr = of_iomap(node, 0); 46 sysram_base_addr = of_iomap(node, 0);
47 sysram_base_phys = of_translate_address(node,
48 of_get_address(node, 0, NULL, NULL));
46 break; 49 break;
47 } 50 }
48 51
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
index d602e3bf3f96..2eaf2dbb8e81 100644
--- a/arch/arm/mach-exynos/firmware.c
+++ b/arch/arm/mach-exynos/firmware.c
@@ -196,6 +196,7 @@ bool __init exynos_secure_firmware_available(void)
196 return false; 196 return false;
197 197
198 addr = of_get_address(nd, 0, NULL, NULL); 198 addr = of_get_address(nd, 0, NULL, NULL);
199 of_node_put(nd);
199 if (!addr) { 200 if (!addr) {
200 pr_err("%s: No address specified.\n", __func__); 201 pr_err("%s: No address specified.\n", __func__);
201 return false; 202 return false;
diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c
index 72bc035bedbe..9a681b421ae1 100644
--- a/arch/arm/mach-exynos/mcpm-exynos.c
+++ b/arch/arm/mach-exynos/mcpm-exynos.c
@@ -75,14 +75,25 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
75 */ 75 */
76 if (cluster && 76 if (cluster &&
77 cluster == MPIDR_AFFINITY_LEVEL(cpu_logical_map(0), 1)) { 77 cluster == MPIDR_AFFINITY_LEVEL(cpu_logical_map(0), 1)) {
78 unsigned int timeout = 16;
79
78 /* 80 /*
79 * Before we reset the Little cores, we should wait 81 * Before we reset the Little cores, we should wait
80 * the SPARE2 register is set to 1 because the init 82 * the SPARE2 register is set to 1 because the init
81 * codes of the iROM will set the register after 83 * codes of the iROM will set the register after
82 * initialization. 84 * initialization.
83 */ 85 */
84 while (!pmu_raw_readl(S5P_PMU_SPARE2)) 86 while (timeout && !pmu_raw_readl(S5P_PMU_SPARE2)) {
87 timeout--;
85 udelay(10); 88 udelay(10);
89 }
90
91 if (timeout == 0) {
92 pr_err("cpu %u cluster %u powerup failed\n",
93 cpu, cluster);
94 exynos_cpu_power_down(cpunr);
95 return -ETIMEDOUT;
96 }
86 97
87 pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu), 98 pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu),
88 EXYNOS_SWRESET); 99 EXYNOS_SWRESET);
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index abcac6164233..0cbbae8bf1f8 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -214,13 +214,20 @@ static inline void __iomem *cpu_boot_reg(int cpu)
214 */ 214 */
215void exynos_core_restart(u32 core_id) 215void exynos_core_restart(u32 core_id)
216{ 216{
217 unsigned int timeout = 16;
217 u32 val; 218 u32 val;
218 219
219 if (!of_machine_is_compatible("samsung,exynos3250")) 220 if (!of_machine_is_compatible("samsung,exynos3250"))
220 return; 221 return;
221 222
222 while (!pmu_raw_readl(S5P_PMU_SPARE2)) 223 while (timeout && !pmu_raw_readl(S5P_PMU_SPARE2)) {
224 timeout--;
223 udelay(10); 225 udelay(10);
226 }
227 if (timeout == 0) {
228 pr_err("cpu core %u restart failed\n", core_id);
229 return;
230 }
224 udelay(10); 231 udelay(10);
225 232
226 val = pmu_raw_readl(EXYNOS_ARM_CORE_STATUS(core_id)); 233 val = pmu_raw_readl(EXYNOS_ARM_CORE_STATUS(core_id));
diff --git a/arch/arm/mach-exynos/smc.h b/arch/arm/mach-exynos/smc.h
index f355185d4239..98832e50852d 100644
--- a/arch/arm/mach-exynos/smc.h
+++ b/arch/arm/mach-exynos/smc.h
@@ -25,6 +25,13 @@
25#define SMC_CMD_L2X0INVALL (-24) 25#define SMC_CMD_L2X0INVALL (-24)
26#define SMC_CMD_L2X0DEBUG (-25) 26#define SMC_CMD_L2X0DEBUG (-25)
27 27
28/* For Accessing CP15/SFR (General) */
29#define SMC_CMD_REG (-101)
30
31/* defines for SMC_CMD_REG */
32#define SMC_REG_CLASS_SFR_W (0x1 << 30)
33#define SMC_REG_ID_SFR_W(addr) (SMC_REG_CLASS_SFR_W | ((addr) >> 2))
34
28#ifndef __ASSEMBLY__ 35#ifndef __ASSEMBLY__
29 36
30extern void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3); 37extern void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3);
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index 0850505ac78b..be122af0de8f 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -31,6 +31,7 @@
31#include <asm/suspend.h> 31#include <asm/suspend.h>
32 32
33#include "common.h" 33#include "common.h"
34#include "smc.h"
34 35
35#define REG_TABLE_END (-1U) 36#define REG_TABLE_END (-1U)
36 37
@@ -62,6 +63,8 @@ struct exynos_pm_state {
62 int cpu_state; 63 int cpu_state;
63 unsigned int pmu_spare3; 64 unsigned int pmu_spare3;
64 void __iomem *sysram_base; 65 void __iomem *sysram_base;
66 phys_addr_t sysram_phys;
67 bool secure_firmware;
65}; 68};
66 69
67static const struct exynos_pm_data *pm_data __ro_after_init; 70static const struct exynos_pm_data *pm_data __ro_after_init;
@@ -265,9 +268,7 @@ static int exynos5420_cpu_suspend(unsigned long arg)
265 unsigned int cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 268 unsigned int cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
266 unsigned int cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); 269 unsigned int cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
267 270
268 writel_relaxed(0x0, pm_state.sysram_base + EXYNOS5420_CPU_STATE); 271 if (IS_ENABLED(CONFIG_MCPM)) {
269
270 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) {
271 mcpm_set_entry_vector(cpu, cluster, exynos_cpu_resume); 272 mcpm_set_entry_vector(cpu, cluster, exynos_cpu_resume);
272 mcpm_cpu_suspend(); 273 mcpm_cpu_suspend();
273 } 274 }
@@ -341,11 +342,16 @@ static void exynos5420_pm_prepare(void)
341 */ 342 */
342 pm_state.cpu_state = readl_relaxed(pm_state.sysram_base + 343 pm_state.cpu_state = readl_relaxed(pm_state.sysram_base +
343 EXYNOS5420_CPU_STATE); 344 EXYNOS5420_CPU_STATE);
345 writel_relaxed(0x0, pm_state.sysram_base + EXYNOS5420_CPU_STATE);
346 if (pm_state.secure_firmware)
347 exynos_smc(SMC_CMD_REG, SMC_REG_ID_SFR_W(pm_state.sysram_phys +
348 EXYNOS5420_CPU_STATE),
349 0, 0);
344 350
345 exynos_pm_enter_sleep_mode(); 351 exynos_pm_enter_sleep_mode();
346 352
347 /* ensure at least INFORM0 has the resume address */ 353 /* ensure at least INFORM0 has the resume address */
348 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) 354 if (IS_ENABLED(CONFIG_MCPM))
349 pmu_raw_writel(__pa_symbol(mcpm_entry_point), S5P_INFORM0); 355 pmu_raw_writel(__pa_symbol(mcpm_entry_point), S5P_INFORM0);
350 356
351 tmp = pmu_raw_readl(EXYNOS_L2_OPTION(0)); 357 tmp = pmu_raw_readl(EXYNOS_L2_OPTION(0));
@@ -444,8 +450,27 @@ early_wakeup:
444 450
445static void exynos5420_prepare_pm_resume(void) 451static void exynos5420_prepare_pm_resume(void)
446{ 452{
447 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) 453 unsigned int mpidr, cluster;
454
455 mpidr = read_cpuid_mpidr();
456 cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
457
458 if (IS_ENABLED(CONFIG_MCPM))
448 WARN_ON(mcpm_cpu_powered_up()); 459 WARN_ON(mcpm_cpu_powered_up());
460
461 if (IS_ENABLED(CONFIG_HW_PERF_EVENTS) && cluster != 0) {
462 /*
463 * When system is resumed on the LITTLE/KFC core (cluster 1),
464 * the DSCR is not properly updated until the power is turned
465 * on also for the cluster 0. Enable it for a while to
466 * propagate the SPNIDEN and SPIDEN signals from Secure JTAG
467 * block and avoid undefined instruction issue on CP14 reset.
468 */
469 pmu_raw_writel(S5P_CORE_LOCAL_PWR_EN,
470 EXYNOS_COMMON_CONFIGURATION(0));
471 pmu_raw_writel(0,
472 EXYNOS_COMMON_CONFIGURATION(0));
473 }
449} 474}
450 475
451static void exynos5420_pm_resume(void) 476static void exynos5420_pm_resume(void)
@@ -460,6 +485,11 @@ static void exynos5420_pm_resume(void)
460 /* Restore the sysram cpu state register */ 485 /* Restore the sysram cpu state register */
461 writel_relaxed(pm_state.cpu_state, 486 writel_relaxed(pm_state.cpu_state,
462 pm_state.sysram_base + EXYNOS5420_CPU_STATE); 487 pm_state.sysram_base + EXYNOS5420_CPU_STATE);
488 if (pm_state.secure_firmware)
489 exynos_smc(SMC_CMD_REG,
490 SMC_REG_ID_SFR_W(pm_state.sysram_phys +
491 EXYNOS5420_CPU_STATE),
492 EXYNOS_AFTR_MAGIC, 0);
463 493
464 pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL, 494 pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL,
465 S5P_CENTRAL_SEQ_OPTION); 495 S5P_CENTRAL_SEQ_OPTION);
@@ -639,8 +669,10 @@ void __init exynos_pm_init(void)
639 669
640 if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) { 670 if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) {
641 pr_warn("Outdated DT detected, suspend/resume will NOT work\n"); 671 pr_warn("Outdated DT detected, suspend/resume will NOT work\n");
672 of_node_put(np);
642 return; 673 return;
643 } 674 }
675 of_node_put(np);
644 676
645 pm_data = (const struct exynos_pm_data *) match->data; 677 pm_data = (const struct exynos_pm_data *) match->data;
646 678
@@ -659,8 +691,11 @@ void __init exynos_pm_init(void)
659 * Applicable as of now only to Exynos542x. If booted under secure 691 * Applicable as of now only to Exynos542x. If booted under secure
660 * firmware, the non-secure region of sysram should be used. 692 * firmware, the non-secure region of sysram should be used.
661 */ 693 */
662 if (exynos_secure_firmware_available()) 694 if (exynos_secure_firmware_available()) {
695 pm_state.sysram_phys = sysram_base_phys;
663 pm_state.sysram_base = sysram_ns_base_addr; 696 pm_state.sysram_base = sysram_ns_base_addr;
664 else 697 pm_state.secure_firmware = true;
698 } else {
665 pm_state.sysram_base = sysram_base_addr; 699 pm_state.sysram_base = sysram_base_addr;
700 }
666} 701}
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index e67e0b2d4ce0..e527532f6931 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -354,9 +354,11 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode)
354 * 354 *
355 * Note that IRQ #32 is GIC SPI #0. 355 * Note that IRQ #32 is GIC SPI #0.
356 */ 356 */
357 imx_gpc_hwirq_unmask(0); 357 if (mode != WAIT_CLOCKED)
358 imx_gpc_hwirq_unmask(0);
358 writel_relaxed(val, ccm_base + CLPCR); 359 writel_relaxed(val, ccm_base + CLPCR);
359 imx_gpc_hwirq_mask(0); 360 if (mode != WAIT_CLOCKED)
361 imx_gpc_hwirq_mask(0);
360 362
361 return 0; 363 return 0;
362} 364}
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index fea008123eb1..83afb80d38a8 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -4,6 +4,20 @@ menu "Intel IXP4xx Implementation Options"
4 4
5comment "IXP4xx Platforms" 5comment "IXP4xx Platforms"
6 6
7config MACH_IXP4XX_OF
8 bool
9 prompt "Devce Tree IXP4xx boards"
10 default y
11 select ARM_APPENDED_DTB # Old Redboot bootloaders deployed
12 select I2C
13 select I2C_IOP3XX
14 select PCI
15 select SERIAL_OF_PLATFORM
16 select TIMER_OF
17 select USE_OF
18 help
19 Say 'Y' here to support Device Tree-based IXP4xx platforms.
20
7config MACH_NSLU2 21config MACH_NSLU2
8 bool 22 bool
9 prompt "Linksys NSLU2" 23 prompt "Linksys NSLU2"
@@ -222,19 +236,6 @@ config IXP4XX_INDIRECT_PCI
222 need to use the indirect method instead. If you don't know 236 need to use the indirect method instead. If you don't know
223 what you need, leave this option unselected. 237 what you need, leave this option unselected.
224 238
225config IXP4XX_QMGR
226 tristate "IXP4xx Queue Manager support"
227 help
228 This driver supports IXP4xx built-in hardware queue manager
229 and is automatically selected by Ethernet and HSS drivers.
230
231config IXP4XX_NPE
232 tristate "IXP4xx Network Processor Engine support"
233 select FW_LOADER
234 help
235 This driver supports IXP4xx built-in network coprocessors
236 and is automatically selected by Ethernet and HSS drivers.
237
238endmenu 239endmenu
239 240
240endif 241endif
diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile
index f09994500a34..1fa4e6605782 100644
--- a/arch/arm/mach-ixp4xx/Makefile
+++ b/arch/arm/mach-ixp4xx/Makefile
@@ -6,6 +6,9 @@
6obj-pci-y := 6obj-pci-y :=
7obj-pci-n := 7obj-pci-n :=
8 8
9# Device tree platform
10obj-pci-$(CONFIG_MACH_IXP4XX_OF) += ixp4xx-of.o
11
9obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o 12obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o
10obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o 13obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o
11obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o 14obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o
@@ -40,5 +43,3 @@ obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o
40obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o 43obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o
41 44
42obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o 45obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
43obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o
44obj-$(CONFIG_IXP4XX_NPE) += ixp4xx_npe.o
diff --git a/arch/arm/mach-ixp4xx/avila-pci.c b/arch/arm/mach-ixp4xx/avila-pci.c
index 548c7d43ade6..9c834f0f4231 100644
--- a/arch/arm/mach-ixp4xx/avila-pci.c
+++ b/arch/arm/mach-ixp4xx/avila-pci.c
@@ -27,6 +27,8 @@
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <asm/mach-types.h> 28#include <asm/mach-types.h>
29 29
30#include "irqs.h"
31
30#define AVILA_MAX_DEV 4 32#define AVILA_MAX_DEV 4
31#define LOFT_MAX_DEV 6 33#define LOFT_MAX_DEV 6
32#define IRQ_LINES 4 34#define IRQ_LINES 4
diff --git a/arch/arm/mach-ixp4xx/avila-setup.c b/arch/arm/mach-ixp4xx/avila-setup.c
index 44cbbce6bda6..1981b33109cb 100644
--- a/arch/arm/mach-ixp4xx/avila-setup.c
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
@@ -28,6 +28,8 @@
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29#include <asm/mach/flash.h> 29#include <asm/mach/flash.h>
30 30
31#include "irqs.h"
32
31#define AVILA_SDA_PIN 7 33#define AVILA_SDA_PIN 7
32#define AVILA_SCL_PIN 6 34#define AVILA_SCL_PIN 6
33 35
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 846e033c56fa..cc5f15679d29 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -22,41 +22,30 @@
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <linux/time.h>
26#include <linux/clocksource.h>
27#include <linux/clockchips.h>
28#include <linux/io.h> 25#include <linux/io.h>
29#include <linux/export.h> 26#include <linux/export.h>
30#include <linux/gpio/driver.h>
31#include <linux/cpu.h> 27#include <linux/cpu.h>
32#include <linux/pci.h> 28#include <linux/pci.h>
33#include <linux/sched_clock.h> 29#include <linux/sched_clock.h>
30#include <linux/bitops.h>
31#include <linux/irqchip/irq-ixp4xx.h>
32#include <linux/platform_data/timer-ixp4xx.h>
34#include <mach/udc.h> 33#include <mach/udc.h>
35#include <mach/hardware.h> 34#include <mach/hardware.h>
36#include <mach/io.h> 35#include <mach/io.h>
37#include <linux/uaccess.h> 36#include <linux/uaccess.h>
38#include <asm/pgtable.h> 37#include <asm/pgtable.h>
39#include <asm/page.h> 38#include <asm/page.h>
39#include <asm/exception.h>
40#include <asm/irq.h> 40#include <asm/irq.h>
41#include <asm/system_misc.h> 41#include <asm/system_misc.h>
42#include <asm/mach/map.h> 42#include <asm/mach/map.h>
43#include <asm/mach/irq.h> 43#include <asm/mach/irq.h>
44#include <asm/mach/time.h> 44#include <asm/mach/time.h>
45 45
46#define IXP4XX_TIMER_FREQ 66666000 46#include "irqs.h"
47
48/*
49 * The timer register doesn't allow to specify the two least significant bits of
50 * the timeout value and assumes them being zero. So make sure IXP4XX_LATCH is
51 * the best value with the two least significant bits unset.
52 */
53#define IXP4XX_LATCH DIV_ROUND_CLOSEST(IXP4XX_TIMER_FREQ, \
54 (IXP4XX_OST_RELOAD_MASK + 1) * HZ) * \
55 (IXP4XX_OST_RELOAD_MASK + 1)
56 47
57static void __init ixp4xx_clocksource_init(void); 48#define IXP4XX_TIMER_FREQ 66666000
58static void __init ixp4xx_clockevent_init(void);
59static struct clock_event_device clockevent_ixp4xx;
60 49
61/************************************************************************* 50/*************************************************************************
62 * IXP4xx chipset I/O mapping 51 * IXP4xx chipset I/O mapping
@@ -77,11 +66,6 @@ static struct map_desc ixp4xx_io_desc[] __initdata = {
77 .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS), 66 .pfn = __phys_to_pfn(IXP4XX_PCI_CFG_BASE_PHYS),
78 .length = IXP4XX_PCI_CFG_REGION_SIZE, 67 .length = IXP4XX_PCI_CFG_REGION_SIZE,
79 .type = MT_DEVICE 68 .type = MT_DEVICE
80 }, { /* Queue Manager */
81 .virtual = (unsigned long)IXP4XX_QMGR_BASE_VIRT,
82 .pfn = __phys_to_pfn(IXP4XX_QMGR_BASE_PHYS),
83 .length = IXP4XX_QMGR_REGION_SIZE,
84 .type = MT_DEVICE
85 }, 69 },
86}; 70};
87 71
@@ -90,258 +74,23 @@ void __init ixp4xx_map_io(void)
90 iotable_init(ixp4xx_io_desc, ARRAY_SIZE(ixp4xx_io_desc)); 74 iotable_init(ixp4xx_io_desc, ARRAY_SIZE(ixp4xx_io_desc));
91} 75}
92 76
93/*
94 * GPIO-functions
95 */
96/*
97 * The following converted to the real HW bits the gpio_line_config
98 */
99/* GPIO pin types */
100#define IXP4XX_GPIO_OUT 0x1
101#define IXP4XX_GPIO_IN 0x2
102
103/* GPIO signal types */
104#define IXP4XX_GPIO_LOW 0
105#define IXP4XX_GPIO_HIGH 1
106
107/* GPIO Clocks */
108#define IXP4XX_GPIO_CLK_0 14
109#define IXP4XX_GPIO_CLK_1 15
110
111static void gpio_line_config(u8 line, u32 direction)
112{
113 if (direction == IXP4XX_GPIO_IN)
114 *IXP4XX_GPIO_GPOER |= (1 << line);
115 else
116 *IXP4XX_GPIO_GPOER &= ~(1 << line);
117}
118
119static void gpio_line_get(u8 line, int *value)
120{
121 *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1;
122}
123
124static void gpio_line_set(u8 line, int value)
125{
126 if (value == IXP4XX_GPIO_HIGH)
127 *IXP4XX_GPIO_GPOUTR |= (1 << line);
128 else if (value == IXP4XX_GPIO_LOW)
129 *IXP4XX_GPIO_GPOUTR &= ~(1 << line);
130}
131
132/*************************************************************************
133 * IXP4xx chipset IRQ handling
134 *
135 * TODO: GPIO IRQs should be marked invalid until the user of the IRQ
136 * (be it PCI or something else) configures that GPIO line
137 * as an IRQ.
138 **************************************************************************/
139enum ixp4xx_irq_type {
140 IXP4XX_IRQ_LEVEL, IXP4XX_IRQ_EDGE
141};
142
143/* Each bit represents an IRQ: 1: edge-triggered, 0: level triggered */
144static unsigned long long ixp4xx_irq_edge = 0;
145
146/*
147 * IRQ -> GPIO mapping table
148 */
149static signed char irq2gpio[32] = {
150 -1, -1, -1, -1, -1, -1, 0, 1,
151 -1, -1, -1, -1, -1, -1, -1, -1,
152 -1, -1, -1, 2, 3, 4, 5, 6,
153 7, 8, 9, 10, 11, 12, -1, -1,
154};
155
156static int ixp4xx_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
157{
158 int irq;
159
160 for (irq = 0; irq < 32; irq++) {
161 if (irq2gpio[irq] == gpio)
162 return irq;
163 }
164 return -EINVAL;
165}
166
167static int ixp4xx_set_irq_type(struct irq_data *d, unsigned int type)
168{
169 int line = irq2gpio[d->irq];
170 u32 int_style;
171 enum ixp4xx_irq_type irq_type;
172 volatile u32 *int_reg;
173
174 /*
175 * Only for GPIO IRQs
176 */
177 if (line < 0)
178 return -EINVAL;
179
180 switch (type){
181 case IRQ_TYPE_EDGE_BOTH:
182 int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL;
183 irq_type = IXP4XX_IRQ_EDGE;
184 break;
185 case IRQ_TYPE_EDGE_RISING:
186 int_style = IXP4XX_GPIO_STYLE_RISING_EDGE;
187 irq_type = IXP4XX_IRQ_EDGE;
188 break;
189 case IRQ_TYPE_EDGE_FALLING:
190 int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE;
191 irq_type = IXP4XX_IRQ_EDGE;
192 break;
193 case IRQ_TYPE_LEVEL_HIGH:
194 int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
195 irq_type = IXP4XX_IRQ_LEVEL;
196 break;
197 case IRQ_TYPE_LEVEL_LOW:
198 int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW;
199 irq_type = IXP4XX_IRQ_LEVEL;
200 break;
201 default:
202 return -EINVAL;
203 }
204
205 if (irq_type == IXP4XX_IRQ_EDGE)
206 ixp4xx_irq_edge |= (1 << d->irq);
207 else
208 ixp4xx_irq_edge &= ~(1 << d->irq);
209
210 if (line >= 8) { /* pins 8-15 */
211 line -= 8;
212 int_reg = IXP4XX_GPIO_GPIT2R;
213 } else { /* pins 0-7 */
214 int_reg = IXP4XX_GPIO_GPIT1R;
215 }
216
217 /* Clear the style for the appropriate pin */
218 *int_reg &= ~(IXP4XX_GPIO_STYLE_CLEAR <<
219 (line * IXP4XX_GPIO_STYLE_SIZE));
220
221 *IXP4XX_GPIO_GPISR = (1 << line);
222
223 /* Set the new style */
224 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE));
225
226 /* Configure the line as an input */
227 gpio_line_config(irq2gpio[d->irq], IXP4XX_GPIO_IN);
228
229 return 0;
230}
231
232static void ixp4xx_irq_mask(struct irq_data *d)
233{
234 if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && d->irq >= 32)
235 *IXP4XX_ICMR2 &= ~(1 << (d->irq - 32));
236 else
237 *IXP4XX_ICMR &= ~(1 << d->irq);
238}
239
240static void ixp4xx_irq_ack(struct irq_data *d)
241{
242 int line = (d->irq < 32) ? irq2gpio[d->irq] : -1;
243
244 if (line >= 0)
245 *IXP4XX_GPIO_GPISR = (1 << line);
246}
247
248/*
249 * Level triggered interrupts on GPIO lines can only be cleared when the
250 * interrupt condition disappears.
251 */
252static void ixp4xx_irq_unmask(struct irq_data *d)
253{
254 if (!(ixp4xx_irq_edge & (1 << d->irq)))
255 ixp4xx_irq_ack(d);
256
257 if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && d->irq >= 32)
258 *IXP4XX_ICMR2 |= (1 << (d->irq - 32));
259 else
260 *IXP4XX_ICMR |= (1 << d->irq);
261}
262
263static struct irq_chip ixp4xx_irq_chip = {
264 .name = "IXP4xx",
265 .irq_ack = ixp4xx_irq_ack,
266 .irq_mask = ixp4xx_irq_mask,
267 .irq_unmask = ixp4xx_irq_unmask,
268 .irq_set_type = ixp4xx_set_irq_type,
269};
270
271void __init ixp4xx_init_irq(void) 77void __init ixp4xx_init_irq(void)
272{ 78{
273 int i = 0;
274
275 /* 79 /*
276 * ixp4xx does not implement the XScale PWRMODE register 80 * ixp4xx does not implement the XScale PWRMODE register
277 * so it must not call cpu_do_idle(). 81 * so it must not call cpu_do_idle().
278 */ 82 */
279 cpu_idle_poll_ctrl(true); 83 cpu_idle_poll_ctrl(true);
280 84
281 /* Route all sources to IRQ instead of FIQ */ 85 ixp4xx_irq_init(IXP4XX_INTC_BASE_PHYS,
282 *IXP4XX_ICLR = 0x0; 86 (cpu_is_ixp46x() || cpu_is_ixp43x()));
283
284 /* Disable all interrupt */
285 *IXP4XX_ICMR = 0x0;
286
287 if (cpu_is_ixp46x() || cpu_is_ixp43x()) {
288 /* Route upper 32 sources to IRQ instead of FIQ */
289 *IXP4XX_ICLR2 = 0x00;
290
291 /* Disable upper 32 interrupts */
292 *IXP4XX_ICMR2 = 0x00;
293 }
294
295 /* Default to all level triggered */
296 for(i = 0; i < NR_IRQS; i++) {
297 irq_set_chip_and_handler(i, &ixp4xx_irq_chip,
298 handle_level_irq);
299 irq_clear_status_flags(i, IRQ_NOREQUEST);
300 }
301} 87}
302 88
303
304/*************************************************************************
305 * IXP4xx timer tick
306 * We use OS timer1 on the CPU for the timer tick and the timestamp
307 * counter as a source of real clock ticks to account for missed jiffies.
308 *************************************************************************/
309
310static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id)
311{
312 struct clock_event_device *evt = dev_id;
313
314 /* Clear Pending Interrupt by writing '1' to it */
315 *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
316
317 evt->event_handler(evt);
318
319 return IRQ_HANDLED;
320}
321
322static struct irqaction ixp4xx_timer_irq = {
323 .name = "timer1",
324 .flags = IRQF_TIMER | IRQF_IRQPOLL,
325 .handler = ixp4xx_timer_interrupt,
326 .dev_id = &clockevent_ixp4xx,
327};
328
329void __init ixp4xx_timer_init(void) 89void __init ixp4xx_timer_init(void)
330{ 90{
331 /* Reset/disable counter */ 91 return ixp4xx_timer_setup(IXP4XX_TIMER_BASE_PHYS,
332 *IXP4XX_OSRT1 = 0; 92 IRQ_IXP4XX_TIMER1,
333 93 IXP4XX_TIMER_FREQ);
334 /* Clear Pending Interrupt by writing '1' to it */
335 *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
336
337 /* Reset time-stamp counter */
338 *IXP4XX_OSTS = 0;
339
340 /* Connect the interrupt handler and enable the interrupt */
341 setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq);
342
343 ixp4xx_clocksource_init();
344 ixp4xx_clockevent_init();
345} 94}
346 95
347static struct pxa2xx_udc_mach_info ixp4xx_udc_info; 96static struct pxa2xx_udc_mach_info ixp4xx_udc_info;
@@ -364,6 +113,24 @@ static struct resource ixp4xx_udc_resources[] = {
364 }, 113 },
365}; 114};
366 115
116static struct resource ixp4xx_gpio_resource[] = {
117 {
118 .start = IXP4XX_GPIO_BASE_PHYS,
119 .end = IXP4XX_GPIO_BASE_PHYS + 0xfff,
120 .flags = IORESOURCE_MEM,
121 },
122};
123
124static struct platform_device ixp4xx_gpio_device = {
125 .name = "ixp4xx-gpio",
126 .id = -1,
127 .dev = {
128 .coherent_dma_mask = DMA_BIT_MASK(32),
129 },
130 .resource = ixp4xx_gpio_resource,
131 .num_resources = ARRAY_SIZE(ixp4xx_gpio_resource),
132};
133
367/* 134/*
368 * USB device controller. The IXP4xx uses the same controller as PXA25X, 135 * USB device controller. The IXP4xx uses the same controller as PXA25X,
369 * so we just use the same device. 136 * so we just use the same device.
@@ -378,7 +145,61 @@ static struct platform_device ixp4xx_udc_device = {
378 }, 145 },
379}; 146};
380 147
148static struct resource ixp4xx_npe_resources[] = {
149 {
150 .start = IXP4XX_NPEA_BASE_PHYS,
151 .end = IXP4XX_NPEA_BASE_PHYS + 0xfff,
152 .flags = IORESOURCE_MEM,
153 },
154 {
155 .start = IXP4XX_NPEB_BASE_PHYS,
156 .end = IXP4XX_NPEB_BASE_PHYS + 0xfff,
157 .flags = IORESOURCE_MEM,
158 },
159 {
160 .start = IXP4XX_NPEC_BASE_PHYS,
161 .end = IXP4XX_NPEC_BASE_PHYS + 0xfff,
162 .flags = IORESOURCE_MEM,
163 },
164
165};
166
167static struct platform_device ixp4xx_npe_device = {
168 .name = "ixp4xx-npe",
169 .id = -1,
170 .num_resources = ARRAY_SIZE(ixp4xx_npe_resources),
171 .resource = ixp4xx_npe_resources,
172};
173
174static struct resource ixp4xx_qmgr_resources[] = {
175 {
176 .start = IXP4XX_QMGR_BASE_PHYS,
177 .end = IXP4XX_QMGR_BASE_PHYS + 0x3fff,
178 .flags = IORESOURCE_MEM,
179 },
180 {
181 .start = IRQ_IXP4XX_QM1,
182 .end = IRQ_IXP4XX_QM1,
183 .flags = IORESOURCE_IRQ,
184 },
185 {
186 .start = IRQ_IXP4XX_QM2,
187 .end = IRQ_IXP4XX_QM2,
188 .flags = IORESOURCE_IRQ,
189 },
190};
191
192static struct platform_device ixp4xx_qmgr_device = {
193 .name = "ixp4xx-qmgr",
194 .id = -1,
195 .num_resources = ARRAY_SIZE(ixp4xx_qmgr_resources),
196 .resource = ixp4xx_qmgr_resources,
197};
198
381static struct platform_device *ixp4xx_devices[] __initdata = { 199static struct platform_device *ixp4xx_devices[] __initdata = {
200 &ixp4xx_npe_device,
201 &ixp4xx_qmgr_device,
202 &ixp4xx_gpio_device,
382 &ixp4xx_udc_device, 203 &ixp4xx_udc_device,
383}; 204};
384 205
@@ -413,56 +234,12 @@ static struct platform_device *ixp46x_devices[] __initdata = {
413unsigned long ixp4xx_exp_bus_size; 234unsigned long ixp4xx_exp_bus_size;
414EXPORT_SYMBOL(ixp4xx_exp_bus_size); 235EXPORT_SYMBOL(ixp4xx_exp_bus_size);
415 236
416static int ixp4xx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
417{
418 gpio_line_config(gpio, IXP4XX_GPIO_IN);
419
420 return 0;
421}
422
423static int ixp4xx_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
424 int level)
425{
426 gpio_line_set(gpio, level);
427 gpio_line_config(gpio, IXP4XX_GPIO_OUT);
428
429 return 0;
430}
431
432static int ixp4xx_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
433{
434 int value;
435
436 gpio_line_get(gpio, &value);
437
438 return value;
439}
440
441static void ixp4xx_gpio_set_value(struct gpio_chip *chip, unsigned gpio,
442 int value)
443{
444 gpio_line_set(gpio, value);
445}
446
447static struct gpio_chip ixp4xx_gpio_chip = {
448 .label = "IXP4XX_GPIO_CHIP",
449 .direction_input = ixp4xx_gpio_direction_input,
450 .direction_output = ixp4xx_gpio_direction_output,
451 .get = ixp4xx_gpio_get_value,
452 .set = ixp4xx_gpio_set_value,
453 .to_irq = ixp4xx_gpio_to_irq,
454 .base = 0,
455 .ngpio = 16,
456};
457
458void __init ixp4xx_sys_init(void) 237void __init ixp4xx_sys_init(void)
459{ 238{
460 ixp4xx_exp_bus_size = SZ_16M; 239 ixp4xx_exp_bus_size = SZ_16M;
461 240
462 platform_add_devices(ixp4xx_devices, ARRAY_SIZE(ixp4xx_devices)); 241 platform_add_devices(ixp4xx_devices, ARRAY_SIZE(ixp4xx_devices));
463 242
464 gpiochip_add_data(&ixp4xx_gpio_chip, NULL);
465
466 if (cpu_is_ixp46x()) { 243 if (cpu_is_ixp46x()) {
467 int region; 244 int region;
468 245
@@ -481,103 +258,8 @@ void __init ixp4xx_sys_init(void)
481 ixp4xx_exp_bus_size >> 20); 258 ixp4xx_exp_bus_size >> 20);
482} 259}
483 260
484/*
485 * sched_clock()
486 */
487static u64 notrace ixp4xx_read_sched_clock(void)
488{
489 return *IXP4XX_OSTS;
490}
491
492/*
493 * clocksource
494 */
495
496static u64 ixp4xx_clocksource_read(struct clocksource *c)
497{
498 return *IXP4XX_OSTS;
499}
500
501unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ; 261unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ;
502EXPORT_SYMBOL(ixp4xx_timer_freq); 262EXPORT_SYMBOL(ixp4xx_timer_freq);
503static void __init ixp4xx_clocksource_init(void)
504{
505 sched_clock_register(ixp4xx_read_sched_clock, 32, ixp4xx_timer_freq);
506
507 clocksource_mmio_init(NULL, "OSTS", ixp4xx_timer_freq, 200, 32,
508 ixp4xx_clocksource_read);
509}
510
511/*
512 * clockevents
513 */
514static int ixp4xx_set_next_event(unsigned long evt,
515 struct clock_event_device *unused)
516{
517 unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK;
518
519 *IXP4XX_OSRT1 = (evt & ~IXP4XX_OST_RELOAD_MASK) | opts;
520
521 return 0;
522}
523
524static int ixp4xx_shutdown(struct clock_event_device *evt)
525{
526 unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK;
527 unsigned long osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK;
528
529 opts &= ~IXP4XX_OST_ENABLE;
530 *IXP4XX_OSRT1 = osrt | opts;
531 return 0;
532}
533
534static int ixp4xx_set_oneshot(struct clock_event_device *evt)
535{
536 unsigned long opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT;
537 unsigned long osrt = 0;
538
539 /* period set by 'set next_event' */
540 *IXP4XX_OSRT1 = osrt | opts;
541 return 0;
542}
543
544static int ixp4xx_set_periodic(struct clock_event_device *evt)
545{
546 unsigned long opts = IXP4XX_OST_ENABLE;
547 unsigned long osrt = IXP4XX_LATCH & ~IXP4XX_OST_RELOAD_MASK;
548
549 *IXP4XX_OSRT1 = osrt | opts;
550 return 0;
551}
552
553static int ixp4xx_resume(struct clock_event_device *evt)
554{
555 unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK;
556 unsigned long osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK;
557
558 opts |= IXP4XX_OST_ENABLE;
559 *IXP4XX_OSRT1 = osrt | opts;
560 return 0;
561}
562
563static struct clock_event_device clockevent_ixp4xx = {
564 .name = "ixp4xx timer1",
565 .features = CLOCK_EVT_FEAT_PERIODIC |
566 CLOCK_EVT_FEAT_ONESHOT,
567 .rating = 200,
568 .set_state_shutdown = ixp4xx_shutdown,
569 .set_state_periodic = ixp4xx_set_periodic,
570 .set_state_oneshot = ixp4xx_set_oneshot,
571 .tick_resume = ixp4xx_resume,
572 .set_next_event = ixp4xx_set_next_event,
573};
574
575static void __init ixp4xx_clockevent_init(void)
576{
577 clockevent_ixp4xx.cpumask = cpumask_of(0);
578 clockevents_config_and_register(&clockevent_ixp4xx, IXP4XX_TIMER_FREQ,
579 0xf, 0xfffffffe);
580}
581 263
582void ixp4xx_restart(enum reboot_mode mode, const char *cmd) 264void ixp4xx_restart(enum reboot_mode mode, const char *cmd)
583{ 265{
diff --git a/arch/arm/mach-ixp4xx/coyote-pci.c b/arch/arm/mach-ixp4xx/coyote-pci.c
index 5d14ce2aee6d..a16c35d2bb96 100644
--- a/arch/arm/mach-ixp4xx/coyote-pci.c
+++ b/arch/arm/mach-ixp4xx/coyote-pci.c
@@ -23,6 +23,8 @@
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <asm/mach/pci.h> 24#include <asm/mach/pci.h>
25 25
26#include "irqs.h"
27
26#define SLOT0_DEVID 14 28#define SLOT0_DEVID 14
27#define SLOT1_DEVID 15 29#define SLOT1_DEVID 15
28 30
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 7e40fe70933b..7ca43ca2816d 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -25,6 +25,8 @@
25#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include <asm/mach/flash.h> 26#include <asm/mach/flash.h>
27 27
28#include "irqs.h"
29
28#define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3) 30#define COYOTE_IDE_BASE_PHYS IXP4XX_EXP_BUS_BASE(3)
29#define COYOTE_IDE_BASE_VIRT 0xFFFE1000 31#define COYOTE_IDE_BASE_VIRT 0xFFFE1000
30#define COYOTE_IDE_REGION_SIZE 0x1000 32#define COYOTE_IDE_REGION_SIZE 0x1000
diff --git a/arch/arm/mach-ixp4xx/dsmg600-pci.c b/arch/arm/mach-ixp4xx/dsmg600-pci.c
index 8dca76937723..6899023bd1b7 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-pci.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-pci.c
@@ -22,6 +22,8 @@
22#include <asm/mach/pci.h> 22#include <asm/mach/pci.h>
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include "irqs.h"
26
25#define MAX_DEV 4 27#define MAX_DEV 4
26#define IRQ_LINES 3 28#define IRQ_LINES 3
27 29
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
index 397190f3a8da..4d4c62fced71 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -35,6 +35,8 @@
35#include <asm/mach/flash.h> 35#include <asm/mach/flash.h>
36#include <asm/mach/time.h> 36#include <asm/mach/time.h>
37 37
38#include "irqs.h"
39
38#define DSMG600_SDA_PIN 5 40#define DSMG600_SDA_PIN 5
39#define DSMG600_SCL_PIN 4 41#define DSMG600_SCL_PIN 4
40 42
@@ -268,9 +270,6 @@ static void __init dsmg600_init(void)
268{ 270{
269 ixp4xx_sys_init(); 271 ixp4xx_sys_init();
270 272
271 /* Make sure that GPIO14 and GPIO15 are not used as clocks */
272 *IXP4XX_GPIO_GPCLKR = 0;
273
274 dsmg600_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); 273 dsmg600_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
275 dsmg600_flash_resource.end = 274 dsmg600_flash_resource.end =
276 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; 275 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
diff --git a/arch/arm/mach-ixp4xx/fsg-pci.c b/arch/arm/mach-ixp4xx/fsg-pci.c
index fd4a8625b4ae..6c08bb9d9807 100644
--- a/arch/arm/mach-ixp4xx/fsg-pci.c
+++ b/arch/arm/mach-ixp4xx/fsg-pci.c
@@ -22,6 +22,8 @@
22#include <asm/mach/pci.h> 22#include <asm/mach/pci.h>
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include "irqs.h"
26
25#define MAX_DEV 3 27#define MAX_DEV 3
26#define IRQ_LINES 3 28#define IRQ_LINES 3
27 29
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c
index f0a152e365b1..648932d8d7a8 100644
--- a/arch/arm/mach-ixp4xx/fsg-setup.c
+++ b/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -29,6 +29,8 @@
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/mach/flash.h> 30#include <asm/mach/flash.h>
31 31
32#include "irqs.h"
33
32#define FSG_SDA_PIN 12 34#define FSG_SDA_PIN 12
33#define FSG_SCL_PIN 13 35#define FSG_SCL_PIN 13
34 36
diff --git a/arch/arm/mach-ixp4xx/gateway7001-pci.c b/arch/arm/mach-ixp4xx/gateway7001-pci.c
index d9d6cc089707..903c75330b76 100644
--- a/arch/arm/mach-ixp4xx/gateway7001-pci.c
+++ b/arch/arm/mach-ixp4xx/gateway7001-pci.c
@@ -27,6 +27,8 @@
27 27
28#include <asm/mach/pci.h> 28#include <asm/mach/pci.h>
29 29
30#include "irqs.h"
31
30void __init gateway7001_pci_preinit(void) 32void __init gateway7001_pci_preinit(void)
31{ 33{
32 irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); 34 irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/arm/mach-ixp4xx/gateway7001-setup.c b/arch/arm/mach-ixp4xx/gateway7001-setup.c
index 1be6faf6da9a..678e7dfff0e5 100644
--- a/arch/arm/mach-ixp4xx/gateway7001-setup.c
+++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c
@@ -28,6 +28,8 @@
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29#include <asm/mach/flash.h> 29#include <asm/mach/flash.h>
30 30
31#include "irqs.h"
32
31static struct flash_platform_data gateway7001_flash_data = { 33static struct flash_platform_data gateway7001_flash_data = {
32 .map_name = "cfi_probe", 34 .map_name = "cfi_probe",
33 .width = 2, 35 .width = 2,
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-pci.c b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
index 551d114c9e14..1223d160448f 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-pci.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-pci.c
@@ -30,6 +30,8 @@
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31#include <asm/mach/pci.h> 31#include <asm/mach/pci.h>
32 32
33#include "irqs.h"
34
33#define SLOT0_DEVID 0 35#define SLOT0_DEVID 0
34#define SLOT1_DEVID 1 36#define SLOT1_DEVID 1
35#define INTA 10 /* slot 1 has INTA and INTB crossed */ 37#define INTA 10 /* slot 1 has INTA and INTB crossed */
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index 16a12994fb53..5dbdde8e2338 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -36,6 +36,8 @@
36#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
37#include <asm/mach/flash.h> 37#include <asm/mach/flash.h>
38 38
39#include "irqs.h"
40
39/* GPIO 5,6,7 and 12 are hard wired to the Kendin KS8995M Switch 41/* GPIO 5,6,7 and 12 are hard wired to the Kendin KS8995M Switch
40 and operate as an SPI type interface. The details of the interface 42 and operate as an SPI type interface. The details of the interface
41 are available on Kendin/Micrel's web site. */ 43 are available on Kendin/Micrel's web site. */
diff --git a/arch/arm/mach-ixp4xx/include/mach/entry-macro.S b/arch/arm/mach-ixp4xx/include/mach/entry-macro.S
deleted file mode 100644
index 79adf83e2c3d..000000000000
--- a/arch/arm/mach-ixp4xx/include/mach/entry-macro.S
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * arch/arm/mach-ixp4xx/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for IXP4xx-based platforms
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#include <mach/hardware.h>
11
12 .macro get_irqnr_preamble, base, tmp
13 .endm
14
15 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
16 ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET)
17 ldr \irqstat, [\irqstat] @ get interrupts
18 cmp \irqstat, #0
19 beq 1001f @ upper IRQ?
20 clz \irqnr, \irqstat
21 mov \base, #31
22 sub \irqnr, \base, \irqnr
23 b 1002f @ lower IRQ being
24 @ handled
25
261001:
27 /*
28 * IXP465/IXP435 has an upper IRQ status register
29 */
30#if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X)
31 ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET)
32 ldr \irqstat, [\irqstat] @ get upper interrupts
33 mov \irqnr, #63
34 clz \irqstat, \irqstat
35 cmp \irqstat, #32
36 subne \irqnr, \irqnr, \irqstat
37#endif
381002:
39 .endm
40
41
diff --git a/arch/arm/mach-ixp4xx/include/mach/irqs.h b/arch/arm/mach-ixp4xx/include/mach/irqs.h
deleted file mode 100644
index 7e6d4cce7c27..000000000000
--- a/arch/arm/mach-ixp4xx/include/mach/irqs.h
+++ /dev/null
@@ -1,75 +0,0 @@
1/*
2 * arch/arm/mach-ixp4xx/include/mach/irqs.h
3 *
4 * IRQ definitions for IXP4XX based systems
5 *
6 * Copyright (C) 2002 Intel Corporation.
7 * Copyright (C) 2003 MontaVista Software, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15#ifndef _ARCH_IXP4XX_IRQS_H_
16#define _ARCH_IXP4XX_IRQS_H_
17
18#define IRQ_IXP4XX_NPEA 0
19#define IRQ_IXP4XX_NPEB 1
20#define IRQ_IXP4XX_NPEC 2
21#define IRQ_IXP4XX_QM1 3
22#define IRQ_IXP4XX_QM2 4
23#define IRQ_IXP4XX_TIMER1 5
24#define IRQ_IXP4XX_GPIO0 6
25#define IRQ_IXP4XX_GPIO1 7
26#define IRQ_IXP4XX_PCI_INT 8
27#define IRQ_IXP4XX_PCI_DMA1 9
28#define IRQ_IXP4XX_PCI_DMA2 10
29#define IRQ_IXP4XX_TIMER2 11
30#define IRQ_IXP4XX_USB 12
31#define IRQ_IXP4XX_UART2 13
32#define IRQ_IXP4XX_TIMESTAMP 14
33#define IRQ_IXP4XX_UART1 15
34#define IRQ_IXP4XX_WDOG 16
35#define IRQ_IXP4XX_AHB_PMU 17
36#define IRQ_IXP4XX_XSCALE_PMU 18
37#define IRQ_IXP4XX_GPIO2 19
38#define IRQ_IXP4XX_GPIO3 20
39#define IRQ_IXP4XX_GPIO4 21
40#define IRQ_IXP4XX_GPIO5 22
41#define IRQ_IXP4XX_GPIO6 23
42#define IRQ_IXP4XX_GPIO7 24
43#define IRQ_IXP4XX_GPIO8 25
44#define IRQ_IXP4XX_GPIO9 26
45#define IRQ_IXP4XX_GPIO10 27
46#define IRQ_IXP4XX_GPIO11 28
47#define IRQ_IXP4XX_GPIO12 29
48#define IRQ_IXP4XX_SW_INT1 30
49#define IRQ_IXP4XX_SW_INT2 31
50#define IRQ_IXP4XX_USB_HOST 32
51#define IRQ_IXP4XX_I2C 33
52#define IRQ_IXP4XX_SSP 34
53#define IRQ_IXP4XX_TSYNC 35
54#define IRQ_IXP4XX_EAU_DONE 36
55#define IRQ_IXP4XX_SHA_DONE 37
56#define IRQ_IXP4XX_SWCP_PE 58
57#define IRQ_IXP4XX_QM_PE 60
58#define IRQ_IXP4XX_MCU_ECC 61
59#define IRQ_IXP4XX_EXP_PE 62
60
61#define _IXP4XX_GPIO_IRQ(n) (IRQ_IXP4XX_GPIO ## n)
62#define IXP4XX_GPIO_IRQ(n) _IXP4XX_GPIO_IRQ(n)
63
64/*
65 * Only first 32 sources are valid if running on IXP42x systems
66 */
67#if defined(CONFIG_CPU_IXP46X) || defined(CONFIG_CPU_IXP43X)
68#define NR_IRQS 64
69#else
70#define NR_IRQS 32
71#endif
72
73#define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU)
74
75#endif
diff --git a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
index b7ddd27419c2..588b76651085 100644
--- a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
+++ b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
@@ -43,8 +43,6 @@
43 * Queue Manager 43 * Queue Manager
44 */ 44 */
45#define IXP4XX_QMGR_BASE_PHYS 0x60000000 45#define IXP4XX_QMGR_BASE_PHYS 0x60000000
46#define IXP4XX_QMGR_BASE_VIRT IOMEM(0xFEF15000)
47#define IXP4XX_QMGR_REGION_SIZE 0x00004000
48 46
49/* 47/*
50 * Peripheral space, including debug UART. Must be section-aligned so that 48 * Peripheral space, including debug UART. Must be section-aligned so that
@@ -132,9 +130,6 @@
132#define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) 130#define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000)
133#define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) 131#define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000)
134#define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) 132#define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000)
135#define IXP4XX_NPEA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x6000)
136#define IXP4XX_NPEB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x7000)
137#define IXP4XX_NPEC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x8000)
138#define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) 133#define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000)
139#define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) 134#define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000)
140#define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) 135#define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000)
@@ -148,95 +143,6 @@
148#define IXP4XX_SSP_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x12000) 143#define IXP4XX_SSP_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x12000)
149 144
150/* 145/*
151 * Constants to make it easy to access Interrupt Controller registers
152 */
153#define IXP4XX_ICPR_OFFSET 0x00 /* Interrupt Status */
154#define IXP4XX_ICMR_OFFSET 0x04 /* Interrupt Enable */
155#define IXP4XX_ICLR_OFFSET 0x08 /* Interrupt IRQ/FIQ Select */
156#define IXP4XX_ICIP_OFFSET 0x0C /* IRQ Status */
157#define IXP4XX_ICFP_OFFSET 0x10 /* FIQ Status */
158#define IXP4XX_ICHR_OFFSET 0x14 /* Interrupt Priority */
159#define IXP4XX_ICIH_OFFSET 0x18 /* IRQ Highest Pri Int */
160#define IXP4XX_ICFH_OFFSET 0x1C /* FIQ Highest Pri Int */
161
162/*
163 * IXP465-only
164 */
165#define IXP4XX_ICPR2_OFFSET 0x20 /* Interrupt Status 2 */
166#define IXP4XX_ICMR2_OFFSET 0x24 /* Interrupt Enable 2 */
167#define IXP4XX_ICLR2_OFFSET 0x28 /* Interrupt IRQ/FIQ Select 2 */
168#define IXP4XX_ICIP2_OFFSET 0x2C /* IRQ Status */
169#define IXP4XX_ICFP2_OFFSET 0x30 /* FIQ Status */
170#define IXP4XX_ICEEN_OFFSET 0x34 /* Error High Pri Enable */
171
172
173/*
174 * Interrupt Controller Register Definitions.
175 */
176
177#define IXP4XX_INTC_REG(x) ((volatile u32 *)(IXP4XX_INTC_BASE_VIRT+(x)))
178
179#define IXP4XX_ICPR IXP4XX_INTC_REG(IXP4XX_ICPR_OFFSET)
180#define IXP4XX_ICMR IXP4XX_INTC_REG(IXP4XX_ICMR_OFFSET)
181#define IXP4XX_ICLR IXP4XX_INTC_REG(IXP4XX_ICLR_OFFSET)
182#define IXP4XX_ICIP IXP4XX_INTC_REG(IXP4XX_ICIP_OFFSET)
183#define IXP4XX_ICFP IXP4XX_INTC_REG(IXP4XX_ICFP_OFFSET)
184#define IXP4XX_ICHR IXP4XX_INTC_REG(IXP4XX_ICHR_OFFSET)
185#define IXP4XX_ICIH IXP4XX_INTC_REG(IXP4XX_ICIH_OFFSET)
186#define IXP4XX_ICFH IXP4XX_INTC_REG(IXP4XX_ICFH_OFFSET)
187#define IXP4XX_ICPR2 IXP4XX_INTC_REG(IXP4XX_ICPR2_OFFSET)
188#define IXP4XX_ICMR2 IXP4XX_INTC_REG(IXP4XX_ICMR2_OFFSET)
189#define IXP4XX_ICLR2 IXP4XX_INTC_REG(IXP4XX_ICLR2_OFFSET)
190#define IXP4XX_ICIP2 IXP4XX_INTC_REG(IXP4XX_ICIP2_OFFSET)
191#define IXP4XX_ICFP2 IXP4XX_INTC_REG(IXP4XX_ICFP2_OFFSET)
192#define IXP4XX_ICEEN IXP4XX_INTC_REG(IXP4XX_ICEEN_OFFSET)
193
194/*
195 * Constants to make it easy to access GPIO registers
196 */
197#define IXP4XX_GPIO_GPOUTR_OFFSET 0x00
198#define IXP4XX_GPIO_GPOER_OFFSET 0x04
199#define IXP4XX_GPIO_GPINR_OFFSET 0x08
200#define IXP4XX_GPIO_GPISR_OFFSET 0x0C
201#define IXP4XX_GPIO_GPIT1R_OFFSET 0x10
202#define IXP4XX_GPIO_GPIT2R_OFFSET 0x14
203#define IXP4XX_GPIO_GPCLKR_OFFSET 0x18
204#define IXP4XX_GPIO_GPDBSELR_OFFSET 0x1C
205
206/*
207 * GPIO Register Definitions.
208 * [Only perform 32bit reads/writes]
209 */
210#define IXP4XX_GPIO_REG(x) ((volatile u32 *)(IXP4XX_GPIO_BASE_VIRT+(x)))
211
212#define IXP4XX_GPIO_GPOUTR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPOUTR_OFFSET)
213#define IXP4XX_GPIO_GPOER IXP4XX_GPIO_REG(IXP4XX_GPIO_GPOER_OFFSET)
214#define IXP4XX_GPIO_GPINR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPINR_OFFSET)
215#define IXP4XX_GPIO_GPISR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPISR_OFFSET)
216#define IXP4XX_GPIO_GPIT1R IXP4XX_GPIO_REG(IXP4XX_GPIO_GPIT1R_OFFSET)
217#define IXP4XX_GPIO_GPIT2R IXP4XX_GPIO_REG(IXP4XX_GPIO_GPIT2R_OFFSET)
218#define IXP4XX_GPIO_GPCLKR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPCLKR_OFFSET)
219#define IXP4XX_GPIO_GPDBSELR IXP4XX_GPIO_REG(IXP4XX_GPIO_GPDBSELR_OFFSET)
220
221/*
222 * GPIO register bit definitions
223 */
224
225/* Interrupt styles
226 */
227#define IXP4XX_GPIO_STYLE_ACTIVE_HIGH 0x0
228#define IXP4XX_GPIO_STYLE_ACTIVE_LOW 0x1
229#define IXP4XX_GPIO_STYLE_RISING_EDGE 0x2
230#define IXP4XX_GPIO_STYLE_FALLING_EDGE 0x3
231#define IXP4XX_GPIO_STYLE_TRANSITIONAL 0x4
232
233/*
234 * Mask used to clear interrupt styles
235 */
236#define IXP4XX_GPIO_STYLE_CLEAR 0x7
237#define IXP4XX_GPIO_STYLE_SIZE 3
238
239/*
240 * Constants to make it easy to access Timer Control/Status registers 146 * Constants to make it easy to access Timer Control/Status registers
241 */ 147 */
242#define IXP4XX_OSTS_OFFSET 0x00 /* Continious TimeStamp */ 148#define IXP4XX_OSTS_OFFSET 0x00 /* Continious TimeStamp */
diff --git a/arch/arm/mach-ixp4xx/include/mach/qmgr.h b/arch/arm/mach-ixp4xx/include/mach/qmgr.h
deleted file mode 100644
index 4de8da536dbb..000000000000
--- a/arch/arm/mach-ixp4xx/include/mach/qmgr.h
+++ /dev/null
@@ -1,204 +0,0 @@
1/*
2 * Copyright (C) 2007 Krzysztof Halasa <khc@pm.waw.pl>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License
6 * as published by the Free Software Foundation.
7 */
8
9#ifndef IXP4XX_QMGR_H
10#define IXP4XX_QMGR_H
11
12#include <linux/io.h>
13#include <linux/kernel.h>
14
15#define DEBUG_QMGR 0
16
17#define HALF_QUEUES 32
18#define QUEUES 64
19#define MAX_QUEUE_LENGTH 4 /* in dwords */
20
21#define QUEUE_STAT1_EMPTY 1 /* queue status bits */
22#define QUEUE_STAT1_NEARLY_EMPTY 2
23#define QUEUE_STAT1_NEARLY_FULL 4
24#define QUEUE_STAT1_FULL 8
25#define QUEUE_STAT2_UNDERFLOW 1
26#define QUEUE_STAT2_OVERFLOW 2
27
28#define QUEUE_WATERMARK_0_ENTRIES 0
29#define QUEUE_WATERMARK_1_ENTRY 1
30#define QUEUE_WATERMARK_2_ENTRIES 2
31#define QUEUE_WATERMARK_4_ENTRIES 3
32#define QUEUE_WATERMARK_8_ENTRIES 4
33#define QUEUE_WATERMARK_16_ENTRIES 5
34#define QUEUE_WATERMARK_32_ENTRIES 6
35#define QUEUE_WATERMARK_64_ENTRIES 7
36
37/* queue interrupt request conditions */
38#define QUEUE_IRQ_SRC_EMPTY 0
39#define QUEUE_IRQ_SRC_NEARLY_EMPTY 1
40#define QUEUE_IRQ_SRC_NEARLY_FULL 2
41#define QUEUE_IRQ_SRC_FULL 3
42#define QUEUE_IRQ_SRC_NOT_EMPTY 4
43#define QUEUE_IRQ_SRC_NOT_NEARLY_EMPTY 5
44#define QUEUE_IRQ_SRC_NOT_NEARLY_FULL 6
45#define QUEUE_IRQ_SRC_NOT_FULL 7
46
47struct qmgr_regs {
48 u32 acc[QUEUES][MAX_QUEUE_LENGTH]; /* 0x000 - 0x3FF */
49 u32 stat1[4]; /* 0x400 - 0x40F */
50 u32 stat2[2]; /* 0x410 - 0x417 */
51 u32 statne_h; /* 0x418 - queue nearly empty */
52 u32 statf_h; /* 0x41C - queue full */
53 u32 irqsrc[4]; /* 0x420 - 0x42F IRC source */
54 u32 irqen[2]; /* 0x430 - 0x437 IRQ enabled */
55 u32 irqstat[2]; /* 0x438 - 0x43F - IRQ access only */
56 u32 reserved[1776];
57 u32 sram[2048]; /* 0x2000 - 0x3FFF - config and buffer */
58};
59
60void qmgr_set_irq(unsigned int queue, int src,
61 void (*handler)(void *pdev), void *pdev);
62void qmgr_enable_irq(unsigned int queue);
63void qmgr_disable_irq(unsigned int queue);
64
65/* request_ and release_queue() must be called from non-IRQ context */
66
67#if DEBUG_QMGR
68extern char qmgr_queue_descs[QUEUES][32];
69
70int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
71 unsigned int nearly_empty_watermark,
72 unsigned int nearly_full_watermark,
73 const char *desc_format, const char* name);
74#else
75int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
76 unsigned int nearly_empty_watermark,
77 unsigned int nearly_full_watermark);
78#define qmgr_request_queue(queue, len, nearly_empty_watermark, \
79 nearly_full_watermark, desc_format, name) \
80 __qmgr_request_queue(queue, len, nearly_empty_watermark, \
81 nearly_full_watermark)
82#endif
83
84void qmgr_release_queue(unsigned int queue);
85
86
87static inline void qmgr_put_entry(unsigned int queue, u32 val)
88{
89 struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
90#if DEBUG_QMGR
91 BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
92
93 printk(KERN_DEBUG "Queue %s(%i) put %X\n",
94 qmgr_queue_descs[queue], queue, val);
95#endif
96 __raw_writel(val, &qmgr_regs->acc[queue][0]);
97}
98
99static inline u32 qmgr_get_entry(unsigned int queue)
100{
101 u32 val;
102 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
103 val = __raw_readl(&qmgr_regs->acc[queue][0]);
104#if DEBUG_QMGR
105 BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
106
107 printk(KERN_DEBUG "Queue %s(%i) get %X\n",
108 qmgr_queue_descs[queue], queue, val);
109#endif
110 return val;
111}
112
113static inline int __qmgr_get_stat1(unsigned int queue)
114{
115 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
116 return (__raw_readl(&qmgr_regs->stat1[queue >> 3])
117 >> ((queue & 7) << 2)) & 0xF;
118}
119
120static inline int __qmgr_get_stat2(unsigned int queue)
121{
122 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
123 BUG_ON(queue >= HALF_QUEUES);
124 return (__raw_readl(&qmgr_regs->stat2[queue >> 4])
125 >> ((queue & 0xF) << 1)) & 0x3;
126}
127
128/**
129 * qmgr_stat_empty() - checks if a hardware queue is empty
130 * @queue: queue number
131 *
132 * Returns non-zero value if the queue is empty.
133 */
134static inline int qmgr_stat_empty(unsigned int queue)
135{
136 BUG_ON(queue >= HALF_QUEUES);
137 return __qmgr_get_stat1(queue) & QUEUE_STAT1_EMPTY;
138}
139
140/**
141 * qmgr_stat_below_low_watermark() - checks if a queue is below low watermark
142 * @queue: queue number
143 *
144 * Returns non-zero value if the queue is below low watermark.
145 */
146static inline int qmgr_stat_below_low_watermark(unsigned int queue)
147{
148 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
149 if (queue >= HALF_QUEUES)
150 return (__raw_readl(&qmgr_regs->statne_h) >>
151 (queue - HALF_QUEUES)) & 0x01;
152 return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_EMPTY;
153}
154
155/**
156 * qmgr_stat_above_high_watermark() - checks if a queue is above high watermark
157 * @queue: queue number
158 *
159 * Returns non-zero value if the queue is above high watermark
160 */
161static inline int qmgr_stat_above_high_watermark(unsigned int queue)
162{
163 BUG_ON(queue >= HALF_QUEUES);
164 return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_FULL;
165}
166
167/**
168 * qmgr_stat_full() - checks if a hardware queue is full
169 * @queue: queue number
170 *
171 * Returns non-zero value if the queue is full.
172 */
173static inline int qmgr_stat_full(unsigned int queue)
174{
175 const struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT;
176 if (queue >= HALF_QUEUES)
177 return (__raw_readl(&qmgr_regs->statf_h) >>
178 (queue - HALF_QUEUES)) & 0x01;
179 return __qmgr_get_stat1(queue) & QUEUE_STAT1_FULL;
180}
181
182/**
183 * qmgr_stat_underflow() - checks if a hardware queue experienced underflow
184 * @queue: queue number
185 *
186 * Returns non-zero value if the queue experienced underflow.
187 */
188static inline int qmgr_stat_underflow(unsigned int queue)
189{
190 return __qmgr_get_stat2(queue) & QUEUE_STAT2_UNDERFLOW;
191}
192
193/**
194 * qmgr_stat_overflow() - checks if a hardware queue experienced overflow
195 * @queue: queue number
196 *
197 * Returns non-zero value if the queue experienced overflow.
198 */
199static inline int qmgr_stat_overflow(unsigned int queue)
200{
201 return __qmgr_get_stat2(queue) & QUEUE_STAT2_OVERFLOW;
202}
203
204#endif
diff --git a/arch/arm/mach-ixp4xx/irqs.h b/arch/arm/mach-ixp4xx/irqs.h
new file mode 100644
index 000000000000..6b7f220cf9e0
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/irqs.h
@@ -0,0 +1,68 @@
1/*
2 * arch/arm/mach-ixp4xx/include/mach/irqs.h
3 *
4 * IRQ definitions for IXP4XX based systems
5 *
6 * Copyright (C) 2002 Intel Corporation.
7 * Copyright (C) 2003 MontaVista Software, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 */
14
15#ifndef _ARCH_IXP4XX_IRQS_H_
16#define _ARCH_IXP4XX_IRQS_H_
17
18#define IRQ_IXP4XX_BASE 16
19
20#define IRQ_IXP4XX_NPEA (IRQ_IXP4XX_BASE + 0)
21#define IRQ_IXP4XX_NPEB (IRQ_IXP4XX_BASE + 1)
22#define IRQ_IXP4XX_NPEC (IRQ_IXP4XX_BASE + 2)
23#define IRQ_IXP4XX_QM1 (IRQ_IXP4XX_BASE + 3)
24#define IRQ_IXP4XX_QM2 (IRQ_IXP4XX_BASE + 4)
25#define IRQ_IXP4XX_TIMER1 (IRQ_IXP4XX_BASE + 5)
26#define IRQ_IXP4XX_GPIO0 (IRQ_IXP4XX_BASE + 6)
27#define IRQ_IXP4XX_GPIO1 (IRQ_IXP4XX_BASE + 7)
28#define IRQ_IXP4XX_PCI_INT (IRQ_IXP4XX_BASE + 8)
29#define IRQ_IXP4XX_PCI_DMA1 (IRQ_IXP4XX_BASE + 9)
30#define IRQ_IXP4XX_PCI_DMA2 (IRQ_IXP4XX_BASE + 10)
31#define IRQ_IXP4XX_TIMER2 (IRQ_IXP4XX_BASE + 11)
32#define IRQ_IXP4XX_USB (IRQ_IXP4XX_BASE + 12)
33#define IRQ_IXP4XX_UART2 (IRQ_IXP4XX_BASE + 13)
34#define IRQ_IXP4XX_TIMESTAMP (IRQ_IXP4XX_BASE + 14)
35#define IRQ_IXP4XX_UART1 (IRQ_IXP4XX_BASE + 15)
36#define IRQ_IXP4XX_WDOG (IRQ_IXP4XX_BASE + 16)
37#define IRQ_IXP4XX_AHB_PMU (IRQ_IXP4XX_BASE + 17)
38#define IRQ_IXP4XX_XSCALE_PMU (IRQ_IXP4XX_BASE + 18)
39#define IRQ_IXP4XX_GPIO2 (IRQ_IXP4XX_BASE + 19)
40#define IRQ_IXP4XX_GPIO3 (IRQ_IXP4XX_BASE + 20)
41#define IRQ_IXP4XX_GPIO4 (IRQ_IXP4XX_BASE + 21)
42#define IRQ_IXP4XX_GPIO5 (IRQ_IXP4XX_BASE + 22)
43#define IRQ_IXP4XX_GPIO6 (IRQ_IXP4XX_BASE + 23)
44#define IRQ_IXP4XX_GPIO7 (IRQ_IXP4XX_BASE + 24)
45#define IRQ_IXP4XX_GPIO8 (IRQ_IXP4XX_BASE + 25)
46#define IRQ_IXP4XX_GPIO9 (IRQ_IXP4XX_BASE + 26)
47#define IRQ_IXP4XX_GPIO10 (IRQ_IXP4XX_BASE + 27)
48#define IRQ_IXP4XX_GPIO11 (IRQ_IXP4XX_BASE + 28)
49#define IRQ_IXP4XX_GPIO12 (IRQ_IXP4XX_BASE + 29)
50#define IRQ_IXP4XX_SW_INT1 (IRQ_IXP4XX_BASE + 30)
51#define IRQ_IXP4XX_SW_INT2 (IRQ_IXP4XX_BASE + 31)
52#define IRQ_IXP4XX_USB_HOST (IRQ_IXP4XX_BASE + 32)
53#define IRQ_IXP4XX_I2C (IRQ_IXP4XX_BASE + 33)
54#define IRQ_IXP4XX_SSP (IRQ_IXP4XX_BASE + 34)
55#define IRQ_IXP4XX_TSYNC (IRQ_IXP4XX_BASE + 35)
56#define IRQ_IXP4XX_EAU_DONE (IRQ_IXP4XX_BASE + 36)
57#define IRQ_IXP4XX_SHA_DONE (IRQ_IXP4XX_BASE + 37)
58#define IRQ_IXP4XX_SWCP_PE (IRQ_IXP4XX_BASE + 58)
59#define IRQ_IXP4XX_QM_PE (IRQ_IXP4XX_BASE + 60)
60#define IRQ_IXP4XX_MCU_ECC (IRQ_IXP4XX_BASE + 61)
61#define IRQ_IXP4XX_EXP_PE (IRQ_IXP4XX_BASE + 62)
62
63#define _IXP4XX_GPIO_IRQ(n) (IRQ_IXP4XX_GPIO ## n)
64#define IXP4XX_GPIO_IRQ(n) _IXP4XX_GPIO_IRQ(n)
65
66#define XSCALE_PMU_IRQ (IRQ_IXP4XX_XSCALE_PMU)
67
68#endif
diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c
index 318424dd3c50..c1340465b2ea 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
@@ -24,6 +24,8 @@
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <asm/mach-types.h> 25#include <asm/mach-types.h>
26 26
27#include "irqs.h"
28
27#define MAX_DEV 4 29#define MAX_DEV 4
28#define IRQ_LINES 4 30#define IRQ_LINES 4
29 31
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 57d7df79d838..6f0f7ed18ea8 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -32,6 +32,8 @@
32#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
33#include <asm/mach/flash.h> 33#include <asm/mach/flash.h>
34 34
35#include "irqs.h"
36
35#define IXDP425_SDA_PIN 7 37#define IXDP425_SDA_PIN 7
36#define IXDP425_SCL_PIN 6 38#define IXDP425_SCL_PIN 6
37 39
diff --git a/arch/arm/mach-ixp4xx/ixdpg425-pci.c b/arch/arm/mach-ixp4xx/ixdpg425-pci.c
index 1f8717ba13dc..ac0e9bc6eb4d 100644
--- a/arch/arm/mach-ixp4xx/ixdpg425-pci.c
+++ b/arch/arm/mach-ixp4xx/ixdpg425-pci.c
@@ -23,6 +23,8 @@
23 23
24#include <asm/mach/pci.h> 24#include <asm/mach/pci.h>
25 25
26#include "irqs.h"
27
26void __init ixdpg425_pci_preinit(void) 28void __init ixdpg425_pci_preinit(void)
27{ 29{
28 irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); 30 irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/arm/mach-ixp4xx/ixp4xx-of.c b/arch/arm/mach-ixp4xx/ixp4xx-of.c
new file mode 100644
index 000000000000..7449b8319c8a
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/ixp4xx-of.c
@@ -0,0 +1,60 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * IXP4xx Device Tree boot support
4 */
5#include <linux/kernel.h>
6#include <linux/init.h>
7#include <linux/io.h>
8
9#include <asm/mach/arch.h>
10#include <asm/mach/map.h>
11
12#include <mach/hardware.h>
13#include <mach/ixp4xx-regs.h>
14
15static struct map_desc ixp4xx_of_io_desc[] __initdata = {
16 /*
17 * This is needed for runtime system configuration checks,
18 * such as reading if hardware so-and-so is present. This
19 * could eventually be converted into a syscon once all boards
20 * are converted to device tree.
21 */
22 {
23 .virtual = IXP4XX_EXP_CFG_BASE_VIRT,
24 .pfn = __phys_to_pfn(IXP4XX_EXP_CFG_BASE_PHYS),
25 .length = SZ_4K,
26 .type = MT_DEVICE,
27 },
28#ifdef CONFIG_DEBUG_UART_8250
29 /* This is needed for LL-debug/earlyprintk/debug-macro.S */
30 {
31 .virtual = CONFIG_DEBUG_UART_VIRT,
32 .pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS),
33 .length = SZ_4K,
34 .type = MT_DEVICE,
35 },
36#endif
37};
38
39static void __init ixp4xx_of_map_io(void)
40{
41 iotable_init(ixp4xx_of_io_desc, ARRAY_SIZE(ixp4xx_of_io_desc));
42}
43
44/*
45 * We handle 4 differen SoC families. These compatible strings are enough
46 * to provide the core so that different boards can add their more detailed
47 * specifics.
48 */
49static const char *ixp4xx_of_board_compat[] = {
50 "intel,ixp42x",
51 "intel,ixp43x",
52 "intel,ixp45x",
53 "intel,ixp46x",
54 NULL,
55};
56
57DT_MACHINE_START(IXP4XX_DT, "IXP4xx (Device Tree)")
58 .map_io = ixp4xx_of_map_io,
59 .dt_compat = ixp4xx_of_board_compat,
60MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/nas100d-pci.c b/arch/arm/mach-ixp4xx/nas100d-pci.c
index 8f0eba0a6800..925ef805f966 100644
--- a/arch/arm/mach-ixp4xx/nas100d-pci.c
+++ b/arch/arm/mach-ixp4xx/nas100d-pci.c
@@ -21,6 +21,8 @@
21#include <asm/mach/pci.h> 21#include <asm/mach/pci.h>
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23 23
24#include "irqs.h"
25
24#define MAX_DEV 3 26#define MAX_DEV 3
25#define IRQ_LINES 3 27#define IRQ_LINES 3
26 28
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 4138d6aa4c52..c142cfa8c5d6 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -34,6 +34,8 @@
34#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
35#include <asm/mach/flash.h> 35#include <asm/mach/flash.h>
36 36
37#include "irqs.h"
38
37#define NAS100D_SDA_PIN 5 39#define NAS100D_SDA_PIN 5
38#define NAS100D_SCL_PIN 6 40#define NAS100D_SCL_PIN 6
39 41
@@ -279,9 +281,6 @@ static void __init nas100d_init(void)
279 281
280 ixp4xx_sys_init(); 282 ixp4xx_sys_init();
281 283
282 /* gpio 14 and 15 are _not_ clocks */
283 *IXP4XX_GPIO_GPCLKR = 0;
284
285 nas100d_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); 284 nas100d_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
286 nas100d_flash_resource.end = 285 nas100d_flash_resource.end =
287 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; 286 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
diff --git a/arch/arm/mach-ixp4xx/nslu2-pci.c b/arch/arm/mach-ixp4xx/nslu2-pci.c
index 032defe111aa..d69ee4066d20 100644
--- a/arch/arm/mach-ixp4xx/nslu2-pci.c
+++ b/arch/arm/mach-ixp4xx/nslu2-pci.c
@@ -21,6 +21,8 @@
21#include <asm/mach/pci.h> 21#include <asm/mach/pci.h>
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23 23
24#include "irqs.h"
25
24#define MAX_DEV 3 26#define MAX_DEV 3
25#define IRQ_LINES 3 27#define IRQ_LINES 3
26 28
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index 341b263482ef..ee1877fcfafe 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -32,6 +32,8 @@
32#include <asm/mach/flash.h> 32#include <asm/mach/flash.h>
33#include <asm/mach/time.h> 33#include <asm/mach/time.h>
34 34
35#include "irqs.h"
36
35#define NSLU2_SDA_PIN 7 37#define NSLU2_SDA_PIN 7
36#define NSLU2_SCL_PIN 6 38#define NSLU2_SCL_PIN 6
37 39
@@ -125,10 +127,18 @@ static struct platform_device nslu2_i2c_gpio = {
125 }, 127 },
126}; 128};
127 129
130static struct resource nslu2_beeper_resources[] = {
131 {
132 .start = IRQ_IXP4XX_TIMER2,
133 .flags = IORESOURCE_IRQ,
134 },
135};
136
128static struct platform_device nslu2_beeper = { 137static struct platform_device nslu2_beeper = {
129 .name = "ixp4xx-beeper", 138 .name = "ixp4xx-beeper",
130 .id = NSLU2_GPIO_BUZZ, 139 .id = NSLU2_GPIO_BUZZ,
131 .num_resources = 0, 140 .resource = nslu2_beeper_resources,
141 .num_resources = ARRAY_SIZE(nslu2_beeper_resources),
132}; 142};
133 143
134static struct resource nslu2_uart_resources[] = { 144static struct resource nslu2_uart_resources[] = {
diff --git a/arch/arm/mach-ixp4xx/wg302v2-pci.c b/arch/arm/mach-ixp4xx/wg302v2-pci.c
index c92e5b82af36..cf83f7e24179 100644
--- a/arch/arm/mach-ixp4xx/wg302v2-pci.c
+++ b/arch/arm/mach-ixp4xx/wg302v2-pci.c
@@ -27,6 +27,8 @@
27 27
28#include <asm/mach/pci.h> 28#include <asm/mach/pci.h>
29 29
30#include "irqs.h"
31
30void __init wg302v2_pci_preinit(void) 32void __init wg302v2_pci_preinit(void)
31{ 33{
32 irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); 34 irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/arm/mach-ixp4xx/wg302v2-setup.c b/arch/arm/mach-ixp4xx/wg302v2-setup.c
index 90b3c604e8b6..8711e299229b 100644
--- a/arch/arm/mach-ixp4xx/wg302v2-setup.c
+++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c
@@ -29,6 +29,8 @@
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/mach/flash.h> 30#include <asm/mach/flash.h>
31 31
32#include "irqs.h"
33
32static struct flash_platform_data wg302v2_flash_data = { 34static struct flash_platform_data wg302v2_flash_data = {
33 .map_name = "cfi_probe", 35 .map_name = "cfi_probe",
34 .width = 2, 36 .width = 2,
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index b3be60a8e467..66701bf43248 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0+
1/* 2/*
2 * Platform support for LPC32xx SoC 3 * Platform support for LPC32xx SoC
3 * 4 *
@@ -5,44 +6,14 @@
5 * 6 *
6 * Copyright (C) 2012 Roland Stigge <stigge@antcom.de> 7 * Copyright (C) 2012 Roland Stigge <stigge@antcom.de>
7 * Copyright (C) 2010 NXP Semiconductors 8 * Copyright (C) 2010 NXP Semiconductors
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */ 9 */
19 10
20#include <linux/init.h>
21#include <linux/platform_device.h>
22#include <linux/device.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/dma-mapping.h>
26#include <linux/gpio.h>
27#include <linux/amba/bus.h>
28#include <linux/amba/clcd.h>
29#include <linux/amba/pl08x.h> 11#include <linux/amba/pl08x.h>
30#include <linux/amba/mmci.h>
31#include <linux/of.h>
32#include <linux/of_address.h>
33#include <linux/of_irq.h>
34#include <linux/of_platform.h>
35#include <linux/clk.h>
36#include <linux/mtd/lpc32xx_slc.h>
37#include <linux/mtd/lpc32xx_mlc.h> 12#include <linux/mtd/lpc32xx_mlc.h>
13#include <linux/mtd/lpc32xx_slc.h>
14#include <linux/of_platform.h>
38 15
39#include <asm/setup.h>
40#include <asm/mach-types.h>
41#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
42
43#include <mach/hardware.h>
44#include <mach/platform.h>
45#include <mach/board.h>
46#include "common.h" 17#include "common.h"
47 18
48static struct pl08x_channel_data pl08x_slave_channels[] = { 19static struct pl08x_channel_data pl08x_slave_channels[] = {
@@ -90,8 +61,6 @@ static struct lpc32xx_mlc_platform_data lpc32xx_mlc_data = {
90}; 61};
91 62
92static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = { 63static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = {
93 OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", NULL),
94 OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", NULL),
95 OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd), 64 OF_DEV_AUXDATA("arm,pl080", 0x31000000, "pl08xdmac", &pl08x_pd),
96 OF_DEV_AUXDATA("nxp,lpc3220-slc", 0x20020000, "20020000.flash", 65 OF_DEV_AUXDATA("nxp,lpc3220-slc", 0x20020000, "20020000.flash",
97 &lpc32xx_slc_data), 66 &lpc32xx_slc_data),
@@ -104,11 +73,6 @@ static void __init lpc3250_machine_init(void)
104{ 73{
105 lpc32xx_serial_init(); 74 lpc32xx_serial_init();
106 75
107 /* Test clock needed for UDA1380 initial init */
108 __raw_writel(LPC32XX_CLKPWR_TESTCLK2_SEL_MOSC |
109 LPC32XX_CLKPWR_TESTCLK_TESTCLK2_EN,
110 LPC32XX_CLKPWR_TEST_CLK_SEL);
111
112 of_platform_default_populate(NULL, lpc32xx_auxdata_lookup, NULL); 76 of_platform_default_populate(NULL, lpc32xx_auxdata_lookup, NULL);
113} 77}
114 78
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 129455e822e4..6316da3623b3 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -336,6 +336,15 @@ static inline void omap5_secondary_hyp_startup(void)
336} 336}
337#endif 337#endif
338 338
339#ifdef CONFIG_SOC_DRA7XX
340extern int dra7xx_pciess_reset(struct omap_hwmod *oh);
341#else
342static inline int dra7xx_pciess_reset(struct omap_hwmod *oh)
343{
344 return 0;
345}
346#endif
347
339void pdata_quirks_init(const struct of_device_id *); 348void pdata_quirks_init(const struct of_device_id *);
340void omap_auxdata_legacy_init(struct device *dev); 349void omap_auxdata_legacy_init(struct device *dev);
341void omap_pcs_legacy_init(int irq, void (*rearm)(void)); 350void omap_pcs_legacy_init(int irq, void (*rearm)(void));
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c
index 37ff25ee3d89..1d8efc303daf 100644
--- a/arch/arm/mach-omap2/i2c.c
+++ b/arch/arm/mach-omap2/i2c.c
@@ -53,15 +53,10 @@ int omap_i2c_reset(struct omap_hwmod *oh)
53 u16 i2c_con; 53 u16 i2c_con;
54 int c = 0; 54 int c = 0;
55 55
56 if (oh->class->rev == OMAP_I2C_IP_VERSION_2) { 56 if (soc_is_omap24xx() || soc_is_omap34xx() || soc_is_am35xx())
57 i2c_con = OMAP4_I2C_CON_OFFSET;
58 } else if (oh->class->rev == OMAP_I2C_IP_VERSION_1) {
59 i2c_con = OMAP2_I2C_CON_OFFSET; 57 i2c_con = OMAP2_I2C_CON_OFFSET;
60 } else { 58 else
61 WARN(1, "Cannot reset I2C block %s: unsupported revision\n", 59 i2c_con = OMAP4_I2C_CON_OFFSET;
62 oh->name);
63 return -EINVAL;
64 }
65 60
66 /* Disable I2C */ 61 /* Disable I2C */
67 v = omap_hwmod_read(oh, i2c_con); 62 v = omap_hwmod_read(oh, i2c_con);
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index bb8e0bb7ef5d..5e69c8caa1db 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -411,14 +411,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
411 411
412static void __init __maybe_unused omap_hwmod_init_postsetup(void) 412static void __init __maybe_unused omap_hwmod_init_postsetup(void)
413{ 413{
414 u8 postsetup_state; 414 u8 postsetup_state = _HWMOD_STATE_DEFAULT;
415 415
416 /* Set the default postsetup state for all hwmods */ 416 /* Set the default postsetup state for all hwmods */
417#ifdef CONFIG_PM
418 postsetup_state = _HWMOD_STATE_IDLE;
419#else
420 postsetup_state = _HWMOD_STATE_ENABLED;
421#endif
422 omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state); 417 omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
423} 418}
424 419
diff --git a/arch/arm/mach-omap2/mmc.h b/arch/arm/mach-omap2/mmc.h
index 9145a6f720fc..7f4e053c3434 100644
--- a/arch/arm/mach-omap2/mmc.h
+++ b/arch/arm/mach-omap2/mmc.h
@@ -7,7 +7,15 @@
7#define OMAP4_MMC_REG_OFFSET 0x100 7#define OMAP4_MMC_REG_OFFSET 0x100
8 8
9struct omap_hwmod; 9struct omap_hwmod;
10
11#ifdef CONFIG_SOC_OMAP2420
10int omap_msdi_reset(struct omap_hwmod *oh); 12int omap_msdi_reset(struct omap_hwmod *oh);
13#else
14static inline int omap_msdi_reset(struct omap_hwmod *oh)
15{
16 return 0;
17}
18#endif
11 19
12/* called from board-specific card detection service routine */ 20/* called from board-specific card detection service routine */
13extern void omap_mmc_notify_cover_event(struct device *dev, int slot, 21extern void omap_mmc_notify_cover_event(struct device *dev, int slot,
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 17558be4bf0a..7dcbe1736f7e 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -436,13 +436,13 @@ static int irq_notifier(struct notifier_block *self, unsigned long cmd, void *v)
436{ 436{
437 switch (cmd) { 437 switch (cmd) {
438 case CPU_CLUSTER_PM_ENTER: 438 case CPU_CLUSTER_PM_ENTER:
439 if (omap_type() == OMAP2_DEVICE_TYPE_GP) 439 if (omap_type() == OMAP2_DEVICE_TYPE_GP || soc_is_am43xx())
440 irq_save_context(); 440 irq_save_context();
441 else 441 else
442 irq_save_secure_context(); 442 irq_save_secure_context();
443 break; 443 break;
444 case CPU_CLUSTER_PM_EXIT: 444 case CPU_CLUSTER_PM_EXIT:
445 if (omap_type() == OMAP2_DEVICE_TYPE_GP) 445 if (omap_type() == OMAP2_DEVICE_TYPE_GP || soc_is_am43xx())
446 irq_restore_context(); 446 irq_restore_context();
447 break; 447 break;
448 } 448 }
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index baadddf9aad4..405ac24def05 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -155,6 +155,8 @@
155#include "soc.h" 155#include "soc.h"
156#include "common.h" 156#include "common.h"
157#include "clockdomain.h" 157#include "clockdomain.h"
158#include "hdq1w.h"
159#include "mmc.h"
158#include "powerdomain.h" 160#include "powerdomain.h"
159#include "cm2xxx.h" 161#include "cm2xxx.h"
160#include "cm3xxx.h" 162#include "cm3xxx.h"
@@ -165,6 +167,7 @@
165#include "prm33xx.h" 167#include "prm33xx.h"
166#include "prminst44xx.h" 168#include "prminst44xx.h"
167#include "pm.h" 169#include "pm.h"
170#include "wd_timer.h"
168 171
169/* Name of the OMAP hwmod for the MPU */ 172/* Name of the OMAP hwmod for the MPU */
170#define MPU_INITIATOR_NAME "mpu" 173#define MPU_INITIATOR_NAME "mpu"
@@ -205,6 +208,20 @@ struct clkctrl_provider {
205static LIST_HEAD(clkctrl_providers); 208static LIST_HEAD(clkctrl_providers);
206 209
207/** 210/**
211 * struct omap_hwmod_reset - IP specific reset functions
212 * @match: string to match against the module name
213 * @len: number of characters to match
214 * @reset: IP specific reset function
215 *
216 * Used only in cases where struct omap_hwmod is dynamically allocated.
217 */
218struct omap_hwmod_reset {
219 const char *match;
220 int len;
221 int (*reset)(struct omap_hwmod *oh);
222};
223
224/**
208 * struct omap_hwmod_soc_ops - fn ptrs for some SoC-specific operations 225 * struct omap_hwmod_soc_ops - fn ptrs for some SoC-specific operations
209 * @enable_module: function to enable a module (via MODULEMODE) 226 * @enable_module: function to enable a module (via MODULEMODE)
210 * @disable_module: function to disable a module (via MODULEMODE) 227 * @disable_module: function to disable a module (via MODULEMODE)
@@ -235,6 +252,7 @@ static struct omap_hwmod_soc_ops soc_ops;
235 252
236/* omap_hwmod_list contains all registered struct omap_hwmods */ 253/* omap_hwmod_list contains all registered struct omap_hwmods */
237static LIST_HEAD(omap_hwmod_list); 254static LIST_HEAD(omap_hwmod_list);
255static DEFINE_MUTEX(list_lock);
238 256
239/* mpu_oh: used to add/remove MPU initiator from sleepdep list */ 257/* mpu_oh: used to add/remove MPU initiator from sleepdep list */
240static struct omap_hwmod *mpu_oh; 258static struct omap_hwmod *mpu_oh;
@@ -2465,7 +2483,7 @@ static void _setup_iclk_autoidle(struct omap_hwmod *oh)
2465 */ 2483 */
2466static int _setup_reset(struct omap_hwmod *oh) 2484static int _setup_reset(struct omap_hwmod *oh)
2467{ 2485{
2468 int r; 2486 int r = 0;
2469 2487
2470 if (oh->_state != _HWMOD_STATE_INITIALIZED) 2488 if (oh->_state != _HWMOD_STATE_INITIALIZED)
2471 return -EINVAL; 2489 return -EINVAL;
@@ -2624,7 +2642,7 @@ static int _setup(struct omap_hwmod *oh, void *data)
2624 * that the copy process would be relatively complex due to the large number 2642 * that the copy process would be relatively complex due to the large number
2625 * of substructures. 2643 * of substructures.
2626 */ 2644 */
2627static int __init _register(struct omap_hwmod *oh) 2645static int _register(struct omap_hwmod *oh)
2628{ 2646{
2629 if (!oh || !oh->name || !oh->class || !oh->class->name || 2647 if (!oh || !oh->name || !oh->class || !oh->class->name ||
2630 (oh->_state != _HWMOD_STATE_UNKNOWN)) 2648 (oh->_state != _HWMOD_STATE_UNKNOWN))
@@ -2663,7 +2681,7 @@ static int __init _register(struct omap_hwmod *oh)
2663 * locking in this code. Changes to this assumption will require 2681 * locking in this code. Changes to this assumption will require
2664 * additional locking. Returns 0. 2682 * additional locking. Returns 0.
2665 */ 2683 */
2666static int __init _add_link(struct omap_hwmod_ocp_if *oi) 2684static int _add_link(struct omap_hwmod_ocp_if *oi)
2667{ 2685{
2668 pr_debug("omap_hwmod: %s -> %s: adding link\n", oi->master->name, 2686 pr_debug("omap_hwmod: %s -> %s: adding link\n", oi->master->name,
2669 oi->slave->name); 2687 oi->slave->name);
@@ -3241,9 +3259,10 @@ static int omap_hwmod_init_regbits(struct device *dev,
3241 * @sysc_offs: sysc register offset 3259 * @sysc_offs: sysc register offset
3242 * @syss_offs: syss register offset 3260 * @syss_offs: syss register offset
3243 */ 3261 */
3244int omap_hwmod_init_reg_offs(struct device *dev, 3262static int omap_hwmod_init_reg_offs(struct device *dev,
3245 const struct ti_sysc_module_data *data, 3263 const struct ti_sysc_module_data *data,
3246 s32 *rev_offs, s32 *sysc_offs, s32 *syss_offs) 3264 s32 *rev_offs, s32 *sysc_offs,
3265 s32 *syss_offs)
3247{ 3266{
3248 *rev_offs = -ENODEV; 3267 *rev_offs = -ENODEV;
3249 *sysc_offs = 0; 3268 *sysc_offs = 0;
@@ -3267,9 +3286,9 @@ int omap_hwmod_init_reg_offs(struct device *dev,
3267 * @data: module data 3286 * @data: module data
3268 * @sysc_flags: module configuration 3287 * @sysc_flags: module configuration
3269 */ 3288 */
3270int omap_hwmod_init_sysc_flags(struct device *dev, 3289static int omap_hwmod_init_sysc_flags(struct device *dev,
3271 const struct ti_sysc_module_data *data, 3290 const struct ti_sysc_module_data *data,
3272 u32 *sysc_flags) 3291 u32 *sysc_flags)
3273{ 3292{
3274 *sysc_flags = 0; 3293 *sysc_flags = 0;
3275 3294
@@ -3341,9 +3360,9 @@ int omap_hwmod_init_sysc_flags(struct device *dev,
3341 * @data: module data 3360 * @data: module data
3342 * @idlemodes: module supported idle modes 3361 * @idlemodes: module supported idle modes
3343 */ 3362 */
3344int omap_hwmod_init_idlemodes(struct device *dev, 3363static int omap_hwmod_init_idlemodes(struct device *dev,
3345 const struct ti_sysc_module_data *data, 3364 const struct ti_sysc_module_data *data,
3346 u32 *idlemodes) 3365 u32 *idlemodes)
3347{ 3366{
3348 *idlemodes = 0; 3367 *idlemodes = 0;
3349 3368
@@ -3434,14 +3453,18 @@ static int omap_hwmod_check_module(struct device *dev,
3434 * 3453 *
3435 * Note that the allocations here cannot use devm as ti-sysc can rebind. 3454 * Note that the allocations here cannot use devm as ti-sysc can rebind.
3436 */ 3455 */
3437int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, 3456static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh,
3438 const struct ti_sysc_module_data *data, 3457 const struct ti_sysc_module_data *data,
3439 struct sysc_regbits *sysc_fields, 3458 struct sysc_regbits *sysc_fields,
3440 s32 rev_offs, s32 sysc_offs, s32 syss_offs, 3459 s32 rev_offs, s32 sysc_offs,
3441 u32 sysc_flags, u32 idlemodes) 3460 s32 syss_offs, u32 sysc_flags,
3461 u32 idlemodes)
3442{ 3462{
3443 struct omap_hwmod_class_sysconfig *sysc; 3463 struct omap_hwmod_class_sysconfig *sysc;
3444 struct omap_hwmod_class *class; 3464 struct omap_hwmod_class *class = NULL;
3465 struct omap_hwmod_ocp_if *oi = NULL;
3466 struct clockdomain *clkdm = NULL;
3467 struct clk *clk = NULL;
3445 void __iomem *regs = NULL; 3468 void __iomem *regs = NULL;
3446 unsigned long flags; 3469 unsigned long flags;
3447 3470
@@ -3465,26 +3488,128 @@ int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh,
3465 } 3488 }
3466 3489
3467 /* 3490 /*
3468 * We need new oh->class as the other devices in the same class 3491 * We may need a new oh->class as the other devices in the same class
3469 * may not yet have ioremapped their registers. 3492 * may not yet have ioremapped their registers.
3470 */ 3493 */
3471 class = kmemdup(oh->class, sizeof(*oh->class), GFP_KERNEL); 3494 if (oh->class->name && strcmp(oh->class->name, data->name)) {
3472 if (!class) 3495 class = kmemdup(oh->class, sizeof(*oh->class), GFP_KERNEL);
3473 return -ENOMEM; 3496 if (!class)
3497 return -ENOMEM;
3498 }
3474 3499
3475 class->sysc = sysc; 3500 if (list_empty(&oh->slave_ports)) {
3501 oi = kcalloc(1, sizeof(*oi), GFP_KERNEL);
3502 if (!oi)
3503 return -ENOMEM;
3504
3505 /*
3506 * Note that we assume interconnect interface clocks will be
3507 * managed by the interconnect driver for OCPIF_SWSUP_IDLE case
3508 * on omap24xx and omap3.
3509 */
3510 oi->slave = oh;
3511 oi->user = OCP_USER_MPU | OCP_USER_SDMA;
3512 }
3513
3514 if (!oh->_clk) {
3515 struct clk_hw_omap *hwclk;
3516
3517 clk = of_clk_get_by_name(dev->of_node, "fck");
3518 if (!IS_ERR(clk))
3519 clk_prepare(clk);
3520 else
3521 clk = NULL;
3522
3523 /*
3524 * Populate clockdomain based on dts clock. It is needed for
3525 * clkdm_deny_idle() and clkdm_allow_idle() until we have have
3526 * interconnect driver and reset driver capable of blocking
3527 * clockdomain idle during reset, enable and idle.
3528 */
3529 if (clk) {
3530 hwclk = to_clk_hw_omap(__clk_get_hw(clk));
3531 if (hwclk && hwclk->clkdm_name)
3532 clkdm = clkdm_lookup(hwclk->clkdm_name);
3533 }
3534
3535 /*
3536 * Note that we assume interconnect driver manages the clocks
3537 * and do not need to populate oh->_clk for dynamically
3538 * allocated modules.
3539 */
3540 clk_unprepare(clk);
3541 clk_put(clk);
3542 }
3476 3543
3477 spin_lock_irqsave(&oh->_lock, flags); 3544 spin_lock_irqsave(&oh->_lock, flags);
3478 if (regs) 3545 if (regs)
3479 oh->_mpu_rt_va = regs; 3546 oh->_mpu_rt_va = regs;
3480 oh->class = class; 3547 if (class)
3548 oh->class = class;
3549 oh->class->sysc = sysc;
3550 if (oi)
3551 _add_link(oi);
3552 if (clkdm)
3553 oh->clkdm = clkdm;
3481 oh->_state = _HWMOD_STATE_INITIALIZED; 3554 oh->_state = _HWMOD_STATE_INITIALIZED;
3555 oh->_postsetup_state = _HWMOD_STATE_DEFAULT;
3482 _setup(oh, NULL); 3556 _setup(oh, NULL);
3483 spin_unlock_irqrestore(&oh->_lock, flags); 3557 spin_unlock_irqrestore(&oh->_lock, flags);
3484 3558
3485 return 0; 3559 return 0;
3486} 3560}
3487 3561
3562static const struct omap_hwmod_reset omap24xx_reset_quirks[] = {
3563 { .match = "msdi", .len = 4, .reset = omap_msdi_reset, },
3564};
3565
3566static const struct omap_hwmod_reset dra7_reset_quirks[] = {
3567 { .match = "pcie", .len = 4, .reset = dra7xx_pciess_reset, },
3568};
3569
3570static const struct omap_hwmod_reset omap_reset_quirks[] = {
3571 { .match = "dss", .len = 3, .reset = omap_dss_reset, },
3572 { .match = "hdq1w", .len = 5, .reset = omap_hdq1w_reset, },
3573 { .match = "i2c", .len = 3, .reset = omap_i2c_reset, },
3574 { .match = "wd_timer", .len = 8, .reset = omap2_wd_timer_reset, },
3575};
3576
3577static void
3578omap_hwmod_init_reset_quirk(struct device *dev, struct omap_hwmod *oh,
3579 const struct ti_sysc_module_data *data,
3580 const struct omap_hwmod_reset *quirks,
3581 int quirks_sz)
3582{
3583 const struct omap_hwmod_reset *quirk;
3584 int i;
3585
3586 for (i = 0; i < quirks_sz; i++) {
3587 quirk = &quirks[i];
3588 if (!strncmp(data->name, quirk->match, quirk->len)) {
3589 oh->class->reset = quirk->reset;
3590
3591 return;
3592 }
3593 }
3594}
3595
3596static void
3597omap_hwmod_init_reset_quirks(struct device *dev, struct omap_hwmod *oh,
3598 const struct ti_sysc_module_data *data)
3599{
3600 if (soc_is_omap24xx())
3601 omap_hwmod_init_reset_quirk(dev, oh, data,
3602 omap24xx_reset_quirks,
3603 ARRAY_SIZE(omap24xx_reset_quirks));
3604
3605 if (soc_is_dra7xx())
3606 omap_hwmod_init_reset_quirk(dev, oh, data, dra7_reset_quirks,
3607 ARRAY_SIZE(dra7_reset_quirks));
3608
3609 omap_hwmod_init_reset_quirk(dev, oh, data, omap_reset_quirks,
3610 ARRAY_SIZE(omap_reset_quirks));
3611}
3612
3488/** 3613/**
3489 * omap_hwmod_init_module - initialize new module 3614 * omap_hwmod_init_module - initialize new module
3490 * @dev: struct device 3615 * @dev: struct device
@@ -3505,8 +3630,31 @@ int omap_hwmod_init_module(struct device *dev,
3505 return -EINVAL; 3630 return -EINVAL;
3506 3631
3507 oh = _lookup(data->name); 3632 oh = _lookup(data->name);
3508 if (!oh) 3633 if (!oh) {
3509 return -ENODEV; 3634 oh = kzalloc(sizeof(*oh), GFP_KERNEL);
3635 if (!oh)
3636 return -ENOMEM;
3637
3638 oh->name = data->name;
3639 oh->_state = _HWMOD_STATE_UNKNOWN;
3640 lockdep_register_key(&oh->hwmod_key);
3641
3642 /* Unused, can be handled by PRM driver handling resets */
3643 oh->prcm.omap4.flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT;
3644
3645 oh->class = kzalloc(sizeof(*oh->class), GFP_KERNEL);
3646 if (!oh->class) {
3647 kfree(oh);
3648 return -ENOMEM;
3649 }
3650
3651 omap_hwmod_init_reset_quirks(dev, oh, data);
3652
3653 oh->class->name = data->name;
3654 mutex_lock(&list_lock);
3655 error = _register(oh);
3656 mutex_unlock(&list_lock);
3657 }
3510 3658
3511 cookie->data = oh; 3659 cookie->data = oh;
3512 3660
@@ -3527,10 +3675,20 @@ int omap_hwmod_init_module(struct device *dev,
3527 if (error) 3675 if (error)
3528 return error; 3676 return error;
3529 3677
3678 if (data->cfg->quirks & SYSC_QUIRK_NO_IDLE)
3679 oh->flags |= HWMOD_NO_IDLE;
3530 if (data->cfg->quirks & SYSC_QUIRK_NO_IDLE_ON_INIT) 3680 if (data->cfg->quirks & SYSC_QUIRK_NO_IDLE_ON_INIT)
3531 oh->flags |= HWMOD_INIT_NO_IDLE; 3681 oh->flags |= HWMOD_INIT_NO_IDLE;
3532 if (data->cfg->quirks & SYSC_QUIRK_NO_RESET_ON_INIT) 3682 if (data->cfg->quirks & SYSC_QUIRK_NO_RESET_ON_INIT)
3533 oh->flags |= HWMOD_INIT_NO_RESET; 3683 oh->flags |= HWMOD_INIT_NO_RESET;
3684 if (data->cfg->quirks & SYSC_QUIRK_USE_CLOCKACT)
3685 oh->flags |= HWMOD_SET_DEFAULT_CLOCKACT;
3686 if (data->cfg->quirks & SYSC_QUIRK_SWSUP_SIDLE)
3687 oh->flags |= HWMOD_SWSUP_SIDLE;
3688 if (data->cfg->quirks & SYSC_QUIRK_SWSUP_SIDLE_ACT)
3689 oh->flags |= HWMOD_SWSUP_SIDLE_ACT;
3690 if (data->cfg->quirks & SYSC_QUIRK_SWSUP_MSTANDBY)
3691 oh->flags |= HWMOD_SWSUP_MSTANDBY;
3534 3692
3535 error = omap_hwmod_check_module(dev, oh, data, sysc_fields, 3693 error = omap_hwmod_check_module(dev, oh, data, sysc_fields,
3536 rev_offs, sysc_offs, syss_offs, 3694 rev_offs, sysc_offs, syss_offs,
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index b70cdc21f8a2..fca9e072154b 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -493,11 +493,16 @@ struct omap_hwmod_omap4_prcm {
493#define _HWMOD_STATE_IDLE 5 493#define _HWMOD_STATE_IDLE 5
494#define _HWMOD_STATE_DISABLED 6 494#define _HWMOD_STATE_DISABLED 6
495 495
496#ifdef CONFIG_PM
497#define _HWMOD_STATE_DEFAULT _HWMOD_STATE_IDLE
498#else
499#define _HWMOD_STATE_DEFAULT _HWMOD_STATE_ENABLED
500#endif
501
496/** 502/**
497 * struct omap_hwmod_class - the type of an IP block 503 * struct omap_hwmod_class - the type of an IP block
498 * @name: name of the hwmod_class 504 * @name: name of the hwmod_class
499 * @sysc: device SYSCONFIG/SYSSTATUS register data 505 * @sysc: device SYSCONFIG/SYSSTATUS register data
500 * @rev: revision of the IP class
501 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown 506 * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown
502 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn 507 * @reset: ptr to fn to be executed in place of the standard hwmod reset fn
503 * @enable_preprogram: ptr to fn to be executed during device enable 508 * @enable_preprogram: ptr to fn to be executed during device enable
@@ -523,7 +528,6 @@ struct omap_hwmod_omap4_prcm {
523struct omap_hwmod_class { 528struct omap_hwmod_class {
524 const char *name; 529 const char *name;
525 struct omap_hwmod_class_sysconfig *sysc; 530 struct omap_hwmod_class_sysconfig *sysc;
526 u32 rev;
527 int (*pre_shutdown)(struct omap_hwmod *oh); 531 int (*pre_shutdown)(struct omap_hwmod *oh);
528 int (*reset)(struct omap_hwmod *oh); 532 int (*reset)(struct omap_hwmod *oh);
529 int (*enable_preprogram)(struct omap_hwmod *oh); 533 int (*enable_preprogram)(struct omap_hwmod *oh);
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index d684fac8f592..8122c8d4b69a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -91,7 +91,6 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
91static struct omap_hwmod_class i2c_class = { 91static struct omap_hwmod_class i2c_class = {
92 .name = "i2c", 92 .name = "i2c",
93 .sysc = &i2c_sysc, 93 .sysc = &i2c_sysc,
94 .rev = OMAP_I2C_IP_VERSION_1,
95 .reset = &omap_i2c_reset, 94 .reset = &omap_i2c_reset,
96}; 95};
97 96
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index abef9f6f9bf5..f27cb60bde77 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -68,7 +68,6 @@ static struct omap_hwmod_class_sysconfig i2c_sysc = {
68static struct omap_hwmod_class i2c_class = { 68static struct omap_hwmod_class i2c_class = {
69 .name = "i2c", 69 .name = "i2c",
70 .sysc = &i2c_sysc, 70 .sysc = &i2c_sysc,
71 .rev = OMAP_I2C_IP_VERSION_1,
72 .reset = &omap_i2c_reset, 71 .reset = &omap_i2c_reset,
73}; 72};
74 73
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
index 5345919a81f8..ed5f39d948de 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
@@ -96,7 +96,6 @@ static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc = {
96struct omap_hwmod_class omap2xxx_gpio_hwmod_class = { 96struct omap_hwmod_class omap2xxx_gpio_hwmod_class = {
97 .name = "gpio", 97 .name = "gpio",
98 .sysc = &omap2xxx_gpio_sysc, 98 .sysc = &omap2xxx_gpio_sysc,
99 .rev = 0,
100}; 99};
101 100
102/* system dma */ 101/* system dma */
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
index 6f81d7a4fec1..aaa6092426ea 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
@@ -30,24 +30,16 @@ extern struct omap_hwmod_ocp_if am33xx_l3_main__gfx;
30extern struct omap_hwmod_ocp_if am33xx_l4_wkup__rtc; 30extern struct omap_hwmod_ocp_if am33xx_l4_wkup__rtc;
31extern struct omap_hwmod_ocp_if am33xx_l4_per__dcan0; 31extern struct omap_hwmod_ocp_if am33xx_l4_per__dcan0;
32extern struct omap_hwmod_ocp_if am33xx_l4_per__dcan1; 32extern struct omap_hwmod_ocp_if am33xx_l4_per__dcan1;
33extern struct omap_hwmod_ocp_if am33xx_l4_per__gpio1;
34extern struct omap_hwmod_ocp_if am33xx_l4_per__gpio2;
35extern struct omap_hwmod_ocp_if am33xx_l4_per__gpio3;
36extern struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio; 33extern struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio;
37extern struct omap_hwmod_ocp_if am33xx_l4_ls__elm; 34extern struct omap_hwmod_ocp_if am33xx_l4_ls__elm;
38extern struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss0; 35extern struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss0;
39extern struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss1; 36extern struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss1;
40extern struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss2; 37extern struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss2;
41extern struct omap_hwmod_ocp_if am33xx_l3_s__gpmc; 38extern struct omap_hwmod_ocp_if am33xx_l3_s__gpmc;
42extern struct omap_hwmod_ocp_if am33xx_l4_per__i2c2;
43extern struct omap_hwmod_ocp_if am33xx_l4_per__i2c3;
44extern struct omap_hwmod_ocp_if am33xx_l4_per__mailbox; 39extern struct omap_hwmod_ocp_if am33xx_l4_per__mailbox;
45extern struct omap_hwmod_ocp_if am33xx_l4_ls__spinlock; 40extern struct omap_hwmod_ocp_if am33xx_l4_ls__spinlock;
46extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp0; 41extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp0;
47extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp1; 42extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp1;
48extern struct omap_hwmod_ocp_if am33xx_l4_ls__mmc0;
49extern struct omap_hwmod_ocp_if am33xx_l4_ls__mmc1;
50extern struct omap_hwmod_ocp_if am33xx_l3_s__mmc2;
51extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi0; 43extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi0;
52extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi1; 44extern struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi1;
53extern struct omap_hwmod_ocp_if am33xx_l4_ls__timer2; 45extern struct omap_hwmod_ocp_if am33xx_l4_ls__timer2;
@@ -60,11 +52,6 @@ extern struct omap_hwmod_ocp_if am33xx_l3_main__tpcc;
60extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc0; 52extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc0;
61extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc1; 53extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc1;
62extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc2; 54extern struct omap_hwmod_ocp_if am33xx_l3_main__tptc2;
63extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart2;
64extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart3;
65extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart4;
66extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart5;
67extern struct omap_hwmod_ocp_if am33xx_l4_ls__uart6;
68extern struct omap_hwmod_ocp_if am33xx_l3_main__ocmc; 55extern struct omap_hwmod_ocp_if am33xx_l3_main__ocmc;
69extern struct omap_hwmod_ocp_if am33xx_l3_main__sha0; 56extern struct omap_hwmod_ocp_if am33xx_l3_main__sha0;
70extern struct omap_hwmod_ocp_if am33xx_l3_main__aes0; 57extern struct omap_hwmod_ocp_if am33xx_l3_main__aes0;
@@ -93,19 +80,10 @@ extern struct omap_hwmod am33xx_elm_hwmod;
93extern struct omap_hwmod am33xx_epwmss0_hwmod; 80extern struct omap_hwmod am33xx_epwmss0_hwmod;
94extern struct omap_hwmod am33xx_epwmss1_hwmod; 81extern struct omap_hwmod am33xx_epwmss1_hwmod;
95extern struct omap_hwmod am33xx_epwmss2_hwmod; 82extern struct omap_hwmod am33xx_epwmss2_hwmod;
96extern struct omap_hwmod am33xx_gpio1_hwmod;
97extern struct omap_hwmod am33xx_gpio2_hwmod;
98extern struct omap_hwmod am33xx_gpio3_hwmod;
99extern struct omap_hwmod am33xx_gpmc_hwmod; 83extern struct omap_hwmod am33xx_gpmc_hwmod;
100extern struct omap_hwmod am33xx_i2c1_hwmod;
101extern struct omap_hwmod am33xx_i2c2_hwmod;
102extern struct omap_hwmod am33xx_i2c3_hwmod;
103extern struct omap_hwmod am33xx_mailbox_hwmod; 84extern struct omap_hwmod am33xx_mailbox_hwmod;
104extern struct omap_hwmod am33xx_mcasp0_hwmod; 85extern struct omap_hwmod am33xx_mcasp0_hwmod;
105extern struct omap_hwmod am33xx_mcasp1_hwmod; 86extern struct omap_hwmod am33xx_mcasp1_hwmod;
106extern struct omap_hwmod am33xx_mmc0_hwmod;
107extern struct omap_hwmod am33xx_mmc1_hwmod;
108extern struct omap_hwmod am33xx_mmc2_hwmod;
109extern struct omap_hwmod am33xx_rtc_hwmod; 87extern struct omap_hwmod am33xx_rtc_hwmod;
110extern struct omap_hwmod am33xx_spi0_hwmod; 88extern struct omap_hwmod am33xx_spi0_hwmod;
111extern struct omap_hwmod am33xx_spi1_hwmod; 89extern struct omap_hwmod am33xx_spi1_hwmod;
@@ -121,19 +99,12 @@ extern struct omap_hwmod am33xx_tpcc_hwmod;
121extern struct omap_hwmod am33xx_tptc0_hwmod; 99extern struct omap_hwmod am33xx_tptc0_hwmod;
122extern struct omap_hwmod am33xx_tptc1_hwmod; 100extern struct omap_hwmod am33xx_tptc1_hwmod;
123extern struct omap_hwmod am33xx_tptc2_hwmod; 101extern struct omap_hwmod am33xx_tptc2_hwmod;
124extern struct omap_hwmod am33xx_uart1_hwmod;
125extern struct omap_hwmod am33xx_uart2_hwmod;
126extern struct omap_hwmod am33xx_uart3_hwmod;
127extern struct omap_hwmod am33xx_uart4_hwmod;
128extern struct omap_hwmod am33xx_uart5_hwmod;
129extern struct omap_hwmod am33xx_uart6_hwmod;
130extern struct omap_hwmod am33xx_wd_timer1_hwmod; 102extern struct omap_hwmod am33xx_wd_timer1_hwmod;
131 103
132extern struct omap_hwmod_class am33xx_emif_hwmod_class; 104extern struct omap_hwmod_class am33xx_emif_hwmod_class;
133extern struct omap_hwmod_class am33xx_l4_hwmod_class; 105extern struct omap_hwmod_class am33xx_l4_hwmod_class;
134extern struct omap_hwmod_class am33xx_wkup_m3_hwmod_class; 106extern struct omap_hwmod_class am33xx_wkup_m3_hwmod_class;
135extern struct omap_hwmod_class am33xx_control_hwmod_class; 107extern struct omap_hwmod_class am33xx_control_hwmod_class;
136extern struct omap_hwmod_class am33xx_gpio_hwmod_class;
137extern struct omap_hwmod_class am33xx_timer_hwmod_class; 108extern struct omap_hwmod_class am33xx_timer_hwmod_class;
138extern struct omap_hwmod_class am33xx_epwmss_hwmod_class; 109extern struct omap_hwmod_class am33xx_epwmss_hwmod_class;
139extern struct omap_hwmod_class am33xx_ehrpwm_hwmod_class; 110extern struct omap_hwmod_class am33xx_ehrpwm_hwmod_class;
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
index e0001232bb4f..47a0e301b193 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c
@@ -122,30 +122,6 @@ struct omap_hwmod_ocp_if am33xx_l4_per__dcan1 = {
122 .user = OCP_USER_MPU | OCP_USER_SDMA, 122 .user = OCP_USER_MPU | OCP_USER_SDMA,
123}; 123};
124 124
125/* l4 per/ls -> GPIO2 */
126struct omap_hwmod_ocp_if am33xx_l4_per__gpio1 = {
127 .master = &am33xx_l4_ls_hwmod,
128 .slave = &am33xx_gpio1_hwmod,
129 .clk = "l4ls_gclk",
130 .user = OCP_USER_MPU | OCP_USER_SDMA,
131};
132
133/* l4 per/ls -> gpio3 */
134struct omap_hwmod_ocp_if am33xx_l4_per__gpio2 = {
135 .master = &am33xx_l4_ls_hwmod,
136 .slave = &am33xx_gpio2_hwmod,
137 .clk = "l4ls_gclk",
138 .user = OCP_USER_MPU | OCP_USER_SDMA,
139};
140
141/* l4 per/ls -> gpio4 */
142struct omap_hwmod_ocp_if am33xx_l4_per__gpio3 = {
143 .master = &am33xx_l4_ls_hwmod,
144 .slave = &am33xx_gpio3_hwmod,
145 .clk = "l4ls_gclk",
146 .user = OCP_USER_MPU | OCP_USER_SDMA,
147};
148
149struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = { 125struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
150 .master = &am33xx_cpgmac0_hwmod, 126 .master = &am33xx_cpgmac0_hwmod,
151 .slave = &am33xx_mdio_hwmod, 127 .slave = &am33xx_mdio_hwmod,
@@ -188,21 +164,6 @@ struct omap_hwmod_ocp_if am33xx_l3_s__gpmc = {
188 .user = OCP_USER_MPU, 164 .user = OCP_USER_MPU,
189}; 165};
190 166
191/* i2c2 */
192struct omap_hwmod_ocp_if am33xx_l4_per__i2c2 = {
193 .master = &am33xx_l4_ls_hwmod,
194 .slave = &am33xx_i2c2_hwmod,
195 .clk = "l4ls_gclk",
196 .user = OCP_USER_MPU,
197};
198
199struct omap_hwmod_ocp_if am33xx_l4_per__i2c3 = {
200 .master = &am33xx_l4_ls_hwmod,
201 .slave = &am33xx_i2c3_hwmod,
202 .clk = "l4ls_gclk",
203 .user = OCP_USER_MPU,
204};
205
206/* l4 ls -> mailbox */ 167/* l4 ls -> mailbox */
207struct omap_hwmod_ocp_if am33xx_l4_per__mailbox = { 168struct omap_hwmod_ocp_if am33xx_l4_per__mailbox = {
208 .master = &am33xx_l4_ls_hwmod, 169 .master = &am33xx_l4_ls_hwmod,
@@ -235,30 +196,6 @@ struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp1 = {
235 .user = OCP_USER_MPU, 196 .user = OCP_USER_MPU,
236}; 197};
237 198
238/* l4 ls -> mmc0 */
239struct omap_hwmod_ocp_if am33xx_l4_ls__mmc0 = {
240 .master = &am33xx_l4_ls_hwmod,
241 .slave = &am33xx_mmc0_hwmod,
242 .clk = "l4ls_gclk",
243 .user = OCP_USER_MPU,
244};
245
246/* l4 ls -> mmc1 */
247struct omap_hwmod_ocp_if am33xx_l4_ls__mmc1 = {
248 .master = &am33xx_l4_ls_hwmod,
249 .slave = &am33xx_mmc1_hwmod,
250 .clk = "l4ls_gclk",
251 .user = OCP_USER_MPU,
252};
253
254/* l3 s -> mmc2 */
255struct omap_hwmod_ocp_if am33xx_l3_s__mmc2 = {
256 .master = &am33xx_l3_s_hwmod,
257 .slave = &am33xx_mmc2_hwmod,
258 .clk = "l3s_gclk",
259 .user = OCP_USER_MPU,
260};
261
262/* l4 ls -> mcspi0 */ 199/* l4 ls -> mcspi0 */
263struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi0 = { 200struct omap_hwmod_ocp_if am33xx_l4_ls__mcspi0 = {
264 .master = &am33xx_l4_ls_hwmod, 201 .master = &am33xx_l4_ls_hwmod,
@@ -355,46 +292,6 @@ struct omap_hwmod_ocp_if am33xx_l3_main__tptc2 = {
355 .user = OCP_USER_MPU, 292 .user = OCP_USER_MPU,
356}; 293};
357 294
358/* l4 ls -> uart2 */
359struct omap_hwmod_ocp_if am33xx_l4_ls__uart2 = {
360 .master = &am33xx_l4_ls_hwmod,
361 .slave = &am33xx_uart2_hwmod,
362 .clk = "l4ls_gclk",
363 .user = OCP_USER_MPU,
364};
365
366/* l4 ls -> uart3 */
367struct omap_hwmod_ocp_if am33xx_l4_ls__uart3 = {
368 .master = &am33xx_l4_ls_hwmod,
369 .slave = &am33xx_uart3_hwmod,
370 .clk = "l4ls_gclk",
371 .user = OCP_USER_MPU,
372};
373
374/* l4 ls -> uart4 */
375struct omap_hwmod_ocp_if am33xx_l4_ls__uart4 = {
376 .master = &am33xx_l4_ls_hwmod,
377 .slave = &am33xx_uart4_hwmod,
378 .clk = "l4ls_gclk",
379 .user = OCP_USER_MPU,
380};
381
382/* l4 ls -> uart5 */
383struct omap_hwmod_ocp_if am33xx_l4_ls__uart5 = {
384 .master = &am33xx_l4_ls_hwmod,
385 .slave = &am33xx_uart5_hwmod,
386 .clk = "l4ls_gclk",
387 .user = OCP_USER_MPU,
388};
389
390/* l4 ls -> uart6 */
391struct omap_hwmod_ocp_if am33xx_l4_ls__uart6 = {
392 .master = &am33xx_l4_ls_hwmod,
393 .slave = &am33xx_uart6_hwmod,
394 .clk = "l4ls_gclk",
395 .user = OCP_USER_MPU,
396};
397
398/* l3 main -> ocmc */ 295/* l3 main -> ocmc */
399struct omap_hwmod_ocp_if am33xx_l3_main__ocmc = { 296struct omap_hwmod_ocp_if am33xx_l3_main__ocmc = {
400 .master = &am33xx_l3_main_hwmod, 297 .master = &am33xx_l3_main_hwmod,
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index 9ded7bf972e7..4c3543bae562 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -16,9 +16,7 @@
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18 18
19#include <linux/platform_data/hsmmc-omap.h>
20#include "omap_hwmod.h" 19#include "omap_hwmod.h"
21#include "i2c.h"
22#include "wd_timer.h" 20#include "wd_timer.h"
23#include "cm33xx.h" 21#include "cm33xx.h"
24#include "prm33xx.h" 22#include "prm33xx.h"
@@ -534,7 +532,6 @@ static struct omap_hwmod_class_sysconfig am33xx_gpio_sysc = {
534struct omap_hwmod_class am33xx_gpio_hwmod_class = { 532struct omap_hwmod_class am33xx_gpio_hwmod_class = {
535 .name = "gpio", 533 .name = "gpio",
536 .sysc = &am33xx_gpio_sysc, 534 .sysc = &am33xx_gpio_sysc,
537 .rev = 2,
538}; 535};
539 536
540/* gpio1 */ 537/* gpio1 */
@@ -627,68 +624,6 @@ struct omap_hwmod am33xx_gpmc_hwmod = {
627 }, 624 },
628}; 625};
629 626
630/* 'i2c' class */
631static struct omap_hwmod_class_sysconfig am33xx_i2c_sysc = {
632 .rev_offs = 0,
633 .sysc_offs = 0x0010,
634 .syss_offs = 0x0090,
635 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
636 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
637 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
638 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
639 SIDLE_SMART_WKUP),
640 .sysc_fields = &omap_hwmod_sysc_type1,
641};
642
643static struct omap_hwmod_class i2c_class = {
644 .name = "i2c",
645 .sysc = &am33xx_i2c_sysc,
646 .rev = OMAP_I2C_IP_VERSION_2,
647 .reset = &omap_i2c_reset,
648};
649
650/* i2c1 */
651struct omap_hwmod am33xx_i2c1_hwmod = {
652 .name = "i2c1",
653 .class = &i2c_class,
654 .clkdm_name = "l4_wkup_clkdm",
655 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
656 .main_clk = "dpll_per_m2_div4_wkupdm_ck",
657 .prcm = {
658 .omap4 = {
659 .modulemode = MODULEMODE_SWCTRL,
660 },
661 },
662};
663
664/* i2c1 */
665struct omap_hwmod am33xx_i2c2_hwmod = {
666 .name = "i2c2",
667 .class = &i2c_class,
668 .clkdm_name = "l4ls_clkdm",
669 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
670 .main_clk = "dpll_per_m2_div4_ck",
671 .prcm = {
672 .omap4 = {
673 .modulemode = MODULEMODE_SWCTRL,
674 },
675 },
676};
677
678/* i2c3 */
679struct omap_hwmod am33xx_i2c3_hwmod = {
680 .name = "i2c3",
681 .class = &i2c_class,
682 .clkdm_name = "l4ls_clkdm",
683 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
684 .main_clk = "dpll_per_m2_div4_ck",
685 .prcm = {
686 .omap4 = {
687 .modulemode = MODULEMODE_SWCTRL,
688 },
689 },
690};
691
692/* 627/*
693 * 'mailbox' class 628 * 'mailbox' class
694 * mailbox module allowing communication between the on-chip processors using a 629 * mailbox module allowing communication between the on-chip processors using a
@@ -762,76 +697,6 @@ struct omap_hwmod am33xx_mcasp1_hwmod = {
762 }, 697 },
763}; 698};
764 699
765/* 'mmc' class */
766static struct omap_hwmod_class_sysconfig am33xx_mmc_sysc = {
767 .rev_offs = 0x2fc,
768 .sysc_offs = 0x110,
769 .syss_offs = 0x114,
770 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
771 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
772 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
773 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
774 .sysc_fields = &omap_hwmod_sysc_type1,
775};
776
777static struct omap_hwmod_class am33xx_mmc_hwmod_class = {
778 .name = "mmc",
779 .sysc = &am33xx_mmc_sysc,
780};
781
782/* mmc0 */
783static struct omap_hsmmc_dev_attr am33xx_mmc0_dev_attr = {
784 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
785};
786
787struct omap_hwmod am33xx_mmc0_hwmod = {
788 .name = "mmc1",
789 .class = &am33xx_mmc_hwmod_class,
790 .clkdm_name = "l4ls_clkdm",
791 .main_clk = "mmc_clk",
792 .prcm = {
793 .omap4 = {
794 .modulemode = MODULEMODE_SWCTRL,
795 },
796 },
797 .dev_attr = &am33xx_mmc0_dev_attr,
798};
799
800/* mmc1 */
801static struct omap_hsmmc_dev_attr am33xx_mmc1_dev_attr = {
802 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
803};
804
805struct omap_hwmod am33xx_mmc1_hwmod = {
806 .name = "mmc2",
807 .class = &am33xx_mmc_hwmod_class,
808 .clkdm_name = "l4ls_clkdm",
809 .main_clk = "mmc_clk",
810 .prcm = {
811 .omap4 = {
812 .modulemode = MODULEMODE_SWCTRL,
813 },
814 },
815 .dev_attr = &am33xx_mmc1_dev_attr,
816};
817
818/* mmc2 */
819static struct omap_hsmmc_dev_attr am33xx_mmc2_dev_attr = {
820 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
821};
822struct omap_hwmod am33xx_mmc2_hwmod = {
823 .name = "mmc3",
824 .class = &am33xx_mmc_hwmod_class,
825 .clkdm_name = "l3s_clkdm",
826 .main_clk = "mmc_clk",
827 .prcm = {
828 .omap4 = {
829 .modulemode = MODULEMODE_SWCTRL,
830 },
831 },
832 .dev_attr = &am33xx_mmc2_dev_attr,
833};
834
835/* 700/*
836 * 'rtc' class 701 * 'rtc' class
837 * rtc subsystem 702 * rtc subsystem
@@ -1132,102 +997,6 @@ struct omap_hwmod am33xx_tptc2_hwmod = {
1132 }, 997 },
1133}; 998};
1134 999
1135/* 'uart' class */
1136static struct omap_hwmod_class_sysconfig uart_sysc = {
1137 .rev_offs = 0x50,
1138 .sysc_offs = 0x54,
1139 .syss_offs = 0x58,
1140 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP |
1141 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1142 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1143 SIDLE_SMART_WKUP),
1144 .sysc_fields = &omap_hwmod_sysc_type1,
1145};
1146
1147static struct omap_hwmod_class uart_class = {
1148 .name = "uart",
1149 .sysc = &uart_sysc,
1150};
1151
1152struct omap_hwmod am33xx_uart1_hwmod = {
1153 .name = "uart1",
1154 .class = &uart_class,
1155 .clkdm_name = "l4_wkup_clkdm",
1156 .flags = DEBUG_AM33XXUART1_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
1157 .main_clk = "dpll_per_m2_div4_wkupdm_ck",
1158 .prcm = {
1159 .omap4 = {
1160 .modulemode = MODULEMODE_SWCTRL,
1161 },
1162 },
1163};
1164
1165struct omap_hwmod am33xx_uart2_hwmod = {
1166 .name = "uart2",
1167 .class = &uart_class,
1168 .clkdm_name = "l4ls_clkdm",
1169 .flags = HWMOD_SWSUP_SIDLE_ACT,
1170 .main_clk = "dpll_per_m2_div4_ck",
1171 .prcm = {
1172 .omap4 = {
1173 .modulemode = MODULEMODE_SWCTRL,
1174 },
1175 },
1176};
1177
1178/* uart3 */
1179struct omap_hwmod am33xx_uart3_hwmod = {
1180 .name = "uart3",
1181 .class = &uart_class,
1182 .clkdm_name = "l4ls_clkdm",
1183 .flags = HWMOD_SWSUP_SIDLE_ACT,
1184 .main_clk = "dpll_per_m2_div4_ck",
1185 .prcm = {
1186 .omap4 = {
1187 .modulemode = MODULEMODE_SWCTRL,
1188 },
1189 },
1190};
1191
1192struct omap_hwmod am33xx_uart4_hwmod = {
1193 .name = "uart4",
1194 .class = &uart_class,
1195 .clkdm_name = "l4ls_clkdm",
1196 .flags = HWMOD_SWSUP_SIDLE_ACT,
1197 .main_clk = "dpll_per_m2_div4_ck",
1198 .prcm = {
1199 .omap4 = {
1200 .modulemode = MODULEMODE_SWCTRL,
1201 },
1202 },
1203};
1204
1205struct omap_hwmod am33xx_uart5_hwmod = {
1206 .name = "uart5",
1207 .class = &uart_class,
1208 .clkdm_name = "l4ls_clkdm",
1209 .flags = HWMOD_SWSUP_SIDLE_ACT,
1210 .main_clk = "dpll_per_m2_div4_ck",
1211 .prcm = {
1212 .omap4 = {
1213 .modulemode = MODULEMODE_SWCTRL,
1214 },
1215 },
1216};
1217
1218struct omap_hwmod am33xx_uart6_hwmod = {
1219 .name = "uart6",
1220 .class = &uart_class,
1221 .clkdm_name = "l4ls_clkdm",
1222 .flags = HWMOD_SWSUP_SIDLE_ACT,
1223 .main_clk = "dpll_per_m2_div4_ck",
1224 .prcm = {
1225 .omap4 = {
1226 .modulemode = MODULEMODE_SWCTRL,
1227 },
1228 },
1229};
1230
1231/* 'wd_timer' class */ 1000/* 'wd_timer' class */
1232static struct omap_hwmod_class_sysconfig wdt_sysc = { 1001static struct omap_hwmod_class_sysconfig wdt_sysc = {
1233 .rev_offs = 0x0, 1002 .rev_offs = 0x0,
@@ -1265,11 +1034,6 @@ struct omap_hwmod am33xx_wd_timer1_hwmod = {
1265 1034
1266static void omap_hwmod_am33xx_clkctrl(void) 1035static void omap_hwmod_am33xx_clkctrl(void)
1267{ 1036{
1268 CLKCTRL(am33xx_uart2_hwmod, AM33XX_CM_PER_UART1_CLKCTRL_OFFSET);
1269 CLKCTRL(am33xx_uart3_hwmod, AM33XX_CM_PER_UART2_CLKCTRL_OFFSET);
1270 CLKCTRL(am33xx_uart4_hwmod, AM33XX_CM_PER_UART3_CLKCTRL_OFFSET);
1271 CLKCTRL(am33xx_uart5_hwmod, AM33XX_CM_PER_UART4_CLKCTRL_OFFSET);
1272 CLKCTRL(am33xx_uart6_hwmod, AM33XX_CM_PER_UART5_CLKCTRL_OFFSET);
1273 CLKCTRL(am33xx_dcan0_hwmod, AM33XX_CM_PER_DCAN0_CLKCTRL_OFFSET); 1037 CLKCTRL(am33xx_dcan0_hwmod, AM33XX_CM_PER_DCAN0_CLKCTRL_OFFSET);
1274 CLKCTRL(am33xx_dcan1_hwmod, AM33XX_CM_PER_DCAN1_CLKCTRL_OFFSET); 1038 CLKCTRL(am33xx_dcan1_hwmod, AM33XX_CM_PER_DCAN1_CLKCTRL_OFFSET);
1275 CLKCTRL(am33xx_elm_hwmod, AM33XX_CM_PER_ELM_CLKCTRL_OFFSET); 1039 CLKCTRL(am33xx_elm_hwmod, AM33XX_CM_PER_ELM_CLKCTRL_OFFSET);
@@ -1279,13 +1043,9 @@ static void omap_hwmod_am33xx_clkctrl(void)
1279 CLKCTRL(am33xx_gpio1_hwmod, AM33XX_CM_PER_GPIO1_CLKCTRL_OFFSET); 1043 CLKCTRL(am33xx_gpio1_hwmod, AM33XX_CM_PER_GPIO1_CLKCTRL_OFFSET);
1280 CLKCTRL(am33xx_gpio2_hwmod, AM33XX_CM_PER_GPIO2_CLKCTRL_OFFSET); 1044 CLKCTRL(am33xx_gpio2_hwmod, AM33XX_CM_PER_GPIO2_CLKCTRL_OFFSET);
1281 CLKCTRL(am33xx_gpio3_hwmod, AM33XX_CM_PER_GPIO3_CLKCTRL_OFFSET); 1045 CLKCTRL(am33xx_gpio3_hwmod, AM33XX_CM_PER_GPIO3_CLKCTRL_OFFSET);
1282 CLKCTRL(am33xx_i2c2_hwmod, AM33XX_CM_PER_I2C1_CLKCTRL_OFFSET);
1283 CLKCTRL(am33xx_i2c3_hwmod, AM33XX_CM_PER_I2C2_CLKCTRL_OFFSET);
1284 CLKCTRL(am33xx_mailbox_hwmod, AM33XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET); 1046 CLKCTRL(am33xx_mailbox_hwmod, AM33XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET);
1285 CLKCTRL(am33xx_mcasp0_hwmod, AM33XX_CM_PER_MCASP0_CLKCTRL_OFFSET); 1047 CLKCTRL(am33xx_mcasp0_hwmod, AM33XX_CM_PER_MCASP0_CLKCTRL_OFFSET);
1286 CLKCTRL(am33xx_mcasp1_hwmod, AM33XX_CM_PER_MCASP1_CLKCTRL_OFFSET); 1048 CLKCTRL(am33xx_mcasp1_hwmod, AM33XX_CM_PER_MCASP1_CLKCTRL_OFFSET);
1287 CLKCTRL(am33xx_mmc0_hwmod, AM33XX_CM_PER_MMC0_CLKCTRL_OFFSET);
1288 CLKCTRL(am33xx_mmc1_hwmod, AM33XX_CM_PER_MMC1_CLKCTRL_OFFSET);
1289 CLKCTRL(am33xx_spi0_hwmod, AM33XX_CM_PER_SPI0_CLKCTRL_OFFSET); 1049 CLKCTRL(am33xx_spi0_hwmod, AM33XX_CM_PER_SPI0_CLKCTRL_OFFSET);
1290 CLKCTRL(am33xx_spi1_hwmod, AM33XX_CM_PER_SPI1_CLKCTRL_OFFSET); 1050 CLKCTRL(am33xx_spi1_hwmod, AM33XX_CM_PER_SPI1_CLKCTRL_OFFSET);
1291 CLKCTRL(am33xx_spinlock_hwmod, AM33XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET); 1051 CLKCTRL(am33xx_spinlock_hwmod, AM33XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET);
@@ -1299,13 +1059,10 @@ static void omap_hwmod_am33xx_clkctrl(void)
1299 AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET); 1059 AM33XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
1300 CLKCTRL(am33xx_smartreflex1_hwmod, 1060 CLKCTRL(am33xx_smartreflex1_hwmod,
1301 AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET); 1061 AM33XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
1302 CLKCTRL(am33xx_uart1_hwmod, AM33XX_CM_WKUP_UART0_CLKCTRL_OFFSET);
1303 CLKCTRL(am33xx_timer1_hwmod, AM33XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET); 1062 CLKCTRL(am33xx_timer1_hwmod, AM33XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET);
1304 CLKCTRL(am33xx_i2c1_hwmod, AM33XX_CM_WKUP_I2C0_CLKCTRL_OFFSET);
1305 CLKCTRL(am33xx_wd_timer1_hwmod, AM33XX_CM_WKUP_WDT1_CLKCTRL_OFFSET); 1063 CLKCTRL(am33xx_wd_timer1_hwmod, AM33XX_CM_WKUP_WDT1_CLKCTRL_OFFSET);
1306 CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET); 1064 CLKCTRL(am33xx_rtc_hwmod, AM33XX_CM_RTC_RTC_CLKCTRL_OFFSET);
1307 PRCM_FLAGS(am33xx_rtc_hwmod, HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET); 1065 PRCM_FLAGS(am33xx_rtc_hwmod, HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET);
1308 CLKCTRL(am33xx_mmc2_hwmod, AM33XX_CM_PER_MMC2_CLKCTRL_OFFSET);
1309 CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET); 1066 CLKCTRL(am33xx_gpmc_hwmod, AM33XX_CM_PER_GPMC_CLKCTRL_OFFSET);
1310 CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET); 1067 CLKCTRL(am33xx_l4_ls_hwmod, AM33XX_CM_PER_L4LS_CLKCTRL_OFFSET);
1311 CLKCTRL(am33xx_l4_wkup_hwmod, AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET); 1068 CLKCTRL(am33xx_l4_wkup_hwmod, AM33XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);
@@ -1340,11 +1097,6 @@ void omap_hwmod_am33xx_reg(void)
1340 1097
1341static void omap_hwmod_am43xx_clkctrl(void) 1098static void omap_hwmod_am43xx_clkctrl(void)
1342{ 1099{
1343 CLKCTRL(am33xx_uart2_hwmod, AM43XX_CM_PER_UART1_CLKCTRL_OFFSET);
1344 CLKCTRL(am33xx_uart3_hwmod, AM43XX_CM_PER_UART2_CLKCTRL_OFFSET);
1345 CLKCTRL(am33xx_uart4_hwmod, AM43XX_CM_PER_UART3_CLKCTRL_OFFSET);
1346 CLKCTRL(am33xx_uart5_hwmod, AM43XX_CM_PER_UART4_CLKCTRL_OFFSET);
1347 CLKCTRL(am33xx_uart6_hwmod, AM43XX_CM_PER_UART5_CLKCTRL_OFFSET);
1348 CLKCTRL(am33xx_dcan0_hwmod, AM43XX_CM_PER_DCAN0_CLKCTRL_OFFSET); 1100 CLKCTRL(am33xx_dcan0_hwmod, AM43XX_CM_PER_DCAN0_CLKCTRL_OFFSET);
1349 CLKCTRL(am33xx_dcan1_hwmod, AM43XX_CM_PER_DCAN1_CLKCTRL_OFFSET); 1101 CLKCTRL(am33xx_dcan1_hwmod, AM43XX_CM_PER_DCAN1_CLKCTRL_OFFSET);
1350 CLKCTRL(am33xx_elm_hwmod, AM43XX_CM_PER_ELM_CLKCTRL_OFFSET); 1102 CLKCTRL(am33xx_elm_hwmod, AM43XX_CM_PER_ELM_CLKCTRL_OFFSET);
@@ -1354,13 +1106,9 @@ static void omap_hwmod_am43xx_clkctrl(void)
1354 CLKCTRL(am33xx_gpio1_hwmod, AM43XX_CM_PER_GPIO1_CLKCTRL_OFFSET); 1106 CLKCTRL(am33xx_gpio1_hwmod, AM43XX_CM_PER_GPIO1_CLKCTRL_OFFSET);
1355 CLKCTRL(am33xx_gpio2_hwmod, AM43XX_CM_PER_GPIO2_CLKCTRL_OFFSET); 1107 CLKCTRL(am33xx_gpio2_hwmod, AM43XX_CM_PER_GPIO2_CLKCTRL_OFFSET);
1356 CLKCTRL(am33xx_gpio3_hwmod, AM43XX_CM_PER_GPIO3_CLKCTRL_OFFSET); 1108 CLKCTRL(am33xx_gpio3_hwmod, AM43XX_CM_PER_GPIO3_CLKCTRL_OFFSET);
1357 CLKCTRL(am33xx_i2c2_hwmod, AM43XX_CM_PER_I2C1_CLKCTRL_OFFSET);
1358 CLKCTRL(am33xx_i2c3_hwmod, AM43XX_CM_PER_I2C2_CLKCTRL_OFFSET);
1359 CLKCTRL(am33xx_mailbox_hwmod, AM43XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET); 1109 CLKCTRL(am33xx_mailbox_hwmod, AM43XX_CM_PER_MAILBOX0_CLKCTRL_OFFSET);
1360 CLKCTRL(am33xx_mcasp0_hwmod, AM43XX_CM_PER_MCASP0_CLKCTRL_OFFSET); 1110 CLKCTRL(am33xx_mcasp0_hwmod, AM43XX_CM_PER_MCASP0_CLKCTRL_OFFSET);
1361 CLKCTRL(am33xx_mcasp1_hwmod, AM43XX_CM_PER_MCASP1_CLKCTRL_OFFSET); 1111 CLKCTRL(am33xx_mcasp1_hwmod, AM43XX_CM_PER_MCASP1_CLKCTRL_OFFSET);
1362 CLKCTRL(am33xx_mmc0_hwmod, AM43XX_CM_PER_MMC0_CLKCTRL_OFFSET);
1363 CLKCTRL(am33xx_mmc1_hwmod, AM43XX_CM_PER_MMC1_CLKCTRL_OFFSET);
1364 CLKCTRL(am33xx_spi0_hwmod, AM43XX_CM_PER_SPI0_CLKCTRL_OFFSET); 1112 CLKCTRL(am33xx_spi0_hwmod, AM43XX_CM_PER_SPI0_CLKCTRL_OFFSET);
1365 CLKCTRL(am33xx_spi1_hwmod, AM43XX_CM_PER_SPI1_CLKCTRL_OFFSET); 1113 CLKCTRL(am33xx_spi1_hwmod, AM43XX_CM_PER_SPI1_CLKCTRL_OFFSET);
1366 CLKCTRL(am33xx_spinlock_hwmod, AM43XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET); 1114 CLKCTRL(am33xx_spinlock_hwmod, AM43XX_CM_PER_SPINLOCK_CLKCTRL_OFFSET);
@@ -1374,12 +1122,9 @@ static void omap_hwmod_am43xx_clkctrl(void)
1374 AM43XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET); 1122 AM43XX_CM_WKUP_SMARTREFLEX0_CLKCTRL_OFFSET);
1375 CLKCTRL(am33xx_smartreflex1_hwmod, 1123 CLKCTRL(am33xx_smartreflex1_hwmod,
1376 AM43XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET); 1124 AM43XX_CM_WKUP_SMARTREFLEX1_CLKCTRL_OFFSET);
1377 CLKCTRL(am33xx_uart1_hwmod, AM43XX_CM_WKUP_UART0_CLKCTRL_OFFSET);
1378 CLKCTRL(am33xx_timer1_hwmod, AM43XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET); 1125 CLKCTRL(am33xx_timer1_hwmod, AM43XX_CM_WKUP_TIMER1_CLKCTRL_OFFSET);
1379 CLKCTRL(am33xx_i2c1_hwmod, AM43XX_CM_WKUP_I2C0_CLKCTRL_OFFSET);
1380 CLKCTRL(am33xx_wd_timer1_hwmod, AM43XX_CM_WKUP_WDT1_CLKCTRL_OFFSET); 1126 CLKCTRL(am33xx_wd_timer1_hwmod, AM43XX_CM_WKUP_WDT1_CLKCTRL_OFFSET);
1381 CLKCTRL(am33xx_rtc_hwmod, AM43XX_CM_RTC_RTC_CLKCTRL_OFFSET); 1127 CLKCTRL(am33xx_rtc_hwmod, AM43XX_CM_RTC_RTC_CLKCTRL_OFFSET);
1382 CLKCTRL(am33xx_mmc2_hwmod, AM43XX_CM_PER_MMC2_CLKCTRL_OFFSET);
1383 CLKCTRL(am33xx_gpmc_hwmod, AM43XX_CM_PER_GPMC_CLKCTRL_OFFSET); 1128 CLKCTRL(am33xx_gpmc_hwmod, AM43XX_CM_PER_GPMC_CLKCTRL_OFFSET);
1384 CLKCTRL(am33xx_l4_ls_hwmod, AM43XX_CM_PER_L4LS_CLKCTRL_OFFSET); 1129 CLKCTRL(am33xx_l4_ls_hwmod, AM43XX_CM_PER_L4LS_CLKCTRL_OFFSET);
1385 CLKCTRL(am33xx_l4_wkup_hwmod, AM43XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET); 1130 CLKCTRL(am33xx_l4_wkup_hwmod, AM43XX_CM_WKUP_L4WKUP_CLKCTRL_OFFSET);
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index c9483bc06228..c965af275e34 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -14,8 +14,6 @@
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 */ 15 */
16 16
17#include <linux/platform_data/i2c-omap.h>
18
19#include "omap_hwmod.h" 17#include "omap_hwmod.h"
20#include "omap_hwmod_common_data.h" 18#include "omap_hwmod_common_data.h"
21 19
@@ -23,7 +21,6 @@
23#include "cm33xx.h" 21#include "cm33xx.h"
24#include "prm33xx.h" 22#include "prm33xx.h"
25#include "prm-regbits-33xx.h" 23#include "prm-regbits-33xx.h"
26#include "i2c.h"
27#include "wd_timer.h" 24#include "wd_timer.h"
28#include "omap_hwmod_33xx_43xx_common_data.h" 25#include "omap_hwmod_33xx_43xx_common_data.h"
29 26
@@ -230,27 +227,6 @@ static struct omap_hwmod am33xx_control_hwmod = {
230 }, 227 },
231}; 228};
232 229
233/* gpio0 */
234static struct omap_hwmod_opt_clk gpio0_opt_clks[] = {
235 { .role = "dbclk", .clk = "gpio0_dbclk" },
236};
237
238static struct omap_hwmod am33xx_gpio0_hwmod = {
239 .name = "gpio1",
240 .class = &am33xx_gpio_hwmod_class,
241 .clkdm_name = "l4_wkup_clkdm",
242 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
243 .main_clk = "dpll_core_m4_div2_ck",
244 .prcm = {
245 .omap4 = {
246 .clkctrl_offs = AM33XX_CM_WKUP_GPIO0_CLKCTRL_OFFSET,
247 .modulemode = MODULEMODE_SWCTRL,
248 },
249 },
250 .opt_clks = gpio0_opt_clks,
251 .opt_clks_cnt = ARRAY_SIZE(gpio0_opt_clks),
252};
253
254/* lcdc */ 230/* lcdc */
255static struct omap_hwmod_class_sysconfig lcdc_sysc = { 231static struct omap_hwmod_class_sysconfig lcdc_sysc = {
256 .rev_offs = 0x0, 232 .rev_offs = 0x0,
@@ -388,22 +364,6 @@ static struct omap_hwmod_ocp_if am33xx_l4_wkup__control = {
388 .user = OCP_USER_MPU, 364 .user = OCP_USER_MPU,
389}; 365};
390 366
391/* L4 WKUP -> I2C1 */
392static struct omap_hwmod_ocp_if am33xx_l4_wkup__i2c1 = {
393 .master = &am33xx_l4_wkup_hwmod,
394 .slave = &am33xx_i2c1_hwmod,
395 .clk = "dpll_core_m4_div2_ck",
396 .user = OCP_USER_MPU,
397};
398
399/* L4 WKUP -> GPIO1 */
400static struct omap_hwmod_ocp_if am33xx_l4_wkup__gpio0 = {
401 .master = &am33xx_l4_wkup_hwmod,
402 .slave = &am33xx_gpio0_hwmod,
403 .clk = "dpll_core_m4_div2_ck",
404 .user = OCP_USER_MPU | OCP_USER_SDMA,
405};
406
407/* L4 WKUP -> ADC_TSC */ 367/* L4 WKUP -> ADC_TSC */
408static struct omap_hwmod_ocp_if am33xx_l4_wkup__adc_tsc = { 368static struct omap_hwmod_ocp_if am33xx_l4_wkup__adc_tsc = {
409 .master = &am33xx_l4_wkup_hwmod, 369 .master = &am33xx_l4_wkup_hwmod,
@@ -434,14 +394,6 @@ static struct omap_hwmod_ocp_if am33xx_l4_wkup__timer1 = {
434 .user = OCP_USER_MPU, 394 .user = OCP_USER_MPU,
435}; 395};
436 396
437/* l4 wkup -> uart1 */
438static struct omap_hwmod_ocp_if am33xx_l4_wkup__uart1 = {
439 .master = &am33xx_l4_wkup_hwmod,
440 .slave = &am33xx_uart1_hwmod,
441 .clk = "dpll_core_m4_div2_ck",
442 .user = OCP_USER_MPU,
443};
444
445/* l4 wkup -> wd_timer1 */ 397/* l4 wkup -> wd_timer1 */
446static struct omap_hwmod_ocp_if am33xx_l4_wkup__wd_timer1 = { 398static struct omap_hwmod_ocp_if am33xx_l4_wkup__wd_timer1 = {
447 .master = &am33xx_l4_wkup_hwmod, 399 .master = &am33xx_l4_wkup_hwmod,
@@ -479,27 +431,16 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
479 &am33xx_l4_wkup__control, 431 &am33xx_l4_wkup__control,
480 &am33xx_l4_wkup__smartreflex0, 432 &am33xx_l4_wkup__smartreflex0,
481 &am33xx_l4_wkup__smartreflex1, 433 &am33xx_l4_wkup__smartreflex1,
482 &am33xx_l4_wkup__uart1,
483 &am33xx_l4_wkup__timer1, 434 &am33xx_l4_wkup__timer1,
484 &am33xx_l4_wkup__rtc, 435 &am33xx_l4_wkup__rtc,
485 &am33xx_l4_wkup__i2c1,
486 &am33xx_l4_wkup__gpio0,
487 &am33xx_l4_wkup__adc_tsc, 436 &am33xx_l4_wkup__adc_tsc,
488 &am33xx_l4_wkup__wd_timer1, 437 &am33xx_l4_wkup__wd_timer1,
489 &am33xx_l4_hs__pruss, 438 &am33xx_l4_hs__pruss,
490 &am33xx_l4_per__dcan0, 439 &am33xx_l4_per__dcan0,
491 &am33xx_l4_per__dcan1, 440 &am33xx_l4_per__dcan1,
492 &am33xx_l4_per__gpio1,
493 &am33xx_l4_per__gpio2,
494 &am33xx_l4_per__gpio3,
495 &am33xx_l4_per__i2c2,
496 &am33xx_l4_per__i2c3,
497 &am33xx_l4_per__mailbox, 441 &am33xx_l4_per__mailbox,
498 &am33xx_l4_ls__mcasp0, 442 &am33xx_l4_ls__mcasp0,
499 &am33xx_l4_ls__mcasp1, 443 &am33xx_l4_ls__mcasp1,
500 &am33xx_l4_ls__mmc0,
501 &am33xx_l4_ls__mmc1,
502 &am33xx_l3_s__mmc2,
503 &am33xx_l4_ls__timer2, 444 &am33xx_l4_ls__timer2,
504 &am33xx_l4_ls__timer3, 445 &am33xx_l4_ls__timer3,
505 &am33xx_l4_ls__timer4, 446 &am33xx_l4_ls__timer4,
@@ -507,11 +448,6 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = {
507 &am33xx_l4_ls__timer6, 448 &am33xx_l4_ls__timer6,
508 &am33xx_l4_ls__timer7, 449 &am33xx_l4_ls__timer7,
509 &am33xx_l3_main__tpcc, 450 &am33xx_l3_main__tpcc,
510 &am33xx_l4_ls__uart2,
511 &am33xx_l4_ls__uart3,
512 &am33xx_l4_ls__uart4,
513 &am33xx_l4_ls__uart5,
514 &am33xx_l4_ls__uart6,
515 &am33xx_l4_ls__spinlock, 451 &am33xx_l4_ls__spinlock,
516 &am33xx_l4_ls__elm, 452 &am33xx_l4_ls__elm,
517 &am33xx_l4_ls__epwmss0, 453 &am33xx_l4_ls__epwmss0,
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 23e6a41a18eb..edff39921bf8 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -484,7 +484,6 @@ static struct omap_hwmod am35xx_uart4_hwmod = {
484static struct omap_hwmod_class i2c_class = { 484static struct omap_hwmod_class i2c_class = {
485 .name = "i2c", 485 .name = "i2c",
486 .sysc = &i2c_sysc, 486 .sysc = &i2c_sysc,
487 .rev = OMAP_I2C_IP_VERSION_1,
488 .reset = &omap_i2c_reset, 487 .reset = &omap_i2c_reset,
489}; 488};
490 489
@@ -707,7 +706,6 @@ static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = {
707static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = { 706static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = {
708 .name = "gpio", 707 .name = "gpio",
709 .sysc = &omap3xxx_gpio_sysc, 708 .sysc = &omap3xxx_gpio_sysc,
710 .rev = 1,
711}; 709};
712 710
713/* gpio1 */ 711/* gpio1 */
@@ -1029,7 +1027,6 @@ static struct omap_hwmod_class_sysconfig omap34xx_sr_sysc = {
1029static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = { 1027static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = {
1030 .name = "smartreflex", 1028 .name = "smartreflex",
1031 .sysc = &omap34xx_sr_sysc, 1029 .sysc = &omap34xx_sr_sysc,
1032 .rev = 1,
1033}; 1030};
1034 1031
1035static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = { 1032static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = {
@@ -1044,7 +1041,6 @@ static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = {
1044static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = { 1041static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = {
1045 .name = "smartreflex", 1042 .name = "smartreflex",
1046 .sysc = &omap36xx_sr_sysc, 1043 .sysc = &omap36xx_sr_sysc,
1047 .rev = 2,
1048}; 1044};
1049 1045
1050/* SR1 */ 1046/* SR1 */
diff --git a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
index aa271ac5ebac..69571abc14fd 100644
--- a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c
@@ -87,26 +87,6 @@ static struct omap_hwmod am43xx_control_hwmod = {
87 }, 87 },
88}; 88};
89 89
90static struct omap_hwmod_opt_clk gpio0_opt_clks[] = {
91 { .role = "dbclk", .clk = "gpio0_dbclk" },
92};
93
94static struct omap_hwmod am43xx_gpio0_hwmod = {
95 .name = "gpio1",
96 .class = &am33xx_gpio_hwmod_class,
97 .clkdm_name = "l4_wkup_clkdm",
98 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
99 .main_clk = "sys_clkin_ck",
100 .prcm = {
101 .omap4 = {
102 .clkctrl_offs = AM43XX_CM_WKUP_GPIO0_CLKCTRL_OFFSET,
103 .modulemode = MODULEMODE_SWCTRL,
104 },
105 },
106 .opt_clks = gpio0_opt_clks,
107 .opt_clks_cnt = ARRAY_SIZE(gpio0_opt_clks),
108};
109
110static struct omap_hwmod_class_sysconfig am43xx_synctimer_sysc = { 90static struct omap_hwmod_class_sysconfig am43xx_synctimer_sysc = {
111 .rev_offs = 0x0, 91 .rev_offs = 0x0,
112 .sysc_offs = 0x4, 92 .sysc_offs = 0x4,
@@ -264,46 +244,6 @@ static struct omap_hwmod am43xx_spi4_hwmod = {
264 }, 244 },
265}; 245};
266 246
267static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
268 { .role = "dbclk", .clk = "gpio4_dbclk" },
269};
270
271static struct omap_hwmod am43xx_gpio4_hwmod = {
272 .name = "gpio5",
273 .class = &am33xx_gpio_hwmod_class,
274 .clkdm_name = "l4ls_clkdm",
275 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
276 .main_clk = "l4ls_gclk",
277 .prcm = {
278 .omap4 = {
279 .clkctrl_offs = AM43XX_CM_PER_GPIO4_CLKCTRL_OFFSET,
280 .modulemode = MODULEMODE_SWCTRL,
281 },
282 },
283 .opt_clks = gpio4_opt_clks,
284 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
285};
286
287static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
288 { .role = "dbclk", .clk = "gpio5_dbclk" },
289};
290
291static struct omap_hwmod am43xx_gpio5_hwmod = {
292 .name = "gpio6",
293 .class = &am33xx_gpio_hwmod_class,
294 .clkdm_name = "l4ls_clkdm",
295 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
296 .main_clk = "l4ls_gclk",
297 .prcm = {
298 .omap4 = {
299 .clkctrl_offs = AM43XX_CM_PER_GPIO5_CLKCTRL_OFFSET,
300 .modulemode = MODULEMODE_SWCTRL,
301 },
302 },
303 .opt_clks = gpio5_opt_clks,
304 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
305};
306
307static struct omap_hwmod_class am43xx_ocp2scp_hwmod_class = { 247static struct omap_hwmod_class am43xx_ocp2scp_hwmod_class = {
308 .name = "ocp2scp", 248 .name = "ocp2scp",
309}; 249};
@@ -650,20 +590,6 @@ static struct omap_hwmod_ocp_if am43xx_l4_wkup__control = {
650 .user = OCP_USER_MPU, 590 .user = OCP_USER_MPU,
651}; 591};
652 592
653static struct omap_hwmod_ocp_if am43xx_l4_wkup__i2c1 = {
654 .master = &am33xx_l4_wkup_hwmod,
655 .slave = &am33xx_i2c1_hwmod,
656 .clk = "sys_clkin_ck",
657 .user = OCP_USER_MPU,
658};
659
660static struct omap_hwmod_ocp_if am43xx_l4_wkup__gpio0 = {
661 .master = &am33xx_l4_wkup_hwmod,
662 .slave = &am43xx_gpio0_hwmod,
663 .clk = "sys_clkin_ck",
664 .user = OCP_USER_MPU | OCP_USER_SDMA,
665};
666
667static struct omap_hwmod_ocp_if am43xx_l4_wkup__adc_tsc = { 593static struct omap_hwmod_ocp_if am43xx_l4_wkup__adc_tsc = {
668 .master = &am33xx_l4_wkup_hwmod, 594 .master = &am33xx_l4_wkup_hwmod,
669 .slave = &am43xx_adc_tsc_hwmod, 595 .slave = &am43xx_adc_tsc_hwmod,
@@ -685,13 +611,6 @@ static struct omap_hwmod_ocp_if am43xx_l4_wkup__timer1 = {
685 .user = OCP_USER_MPU, 611 .user = OCP_USER_MPU,
686}; 612};
687 613
688static struct omap_hwmod_ocp_if am43xx_l4_wkup__uart1 = {
689 .master = &am33xx_l4_wkup_hwmod,
690 .slave = &am33xx_uart1_hwmod,
691 .clk = "sys_clkin_ck",
692 .user = OCP_USER_MPU,
693};
694
695static struct omap_hwmod_ocp_if am43xx_l4_wkup__wd_timer1 = { 614static struct omap_hwmod_ocp_if am43xx_l4_wkup__wd_timer1 = {
696 .master = &am33xx_l4_wkup_hwmod, 615 .master = &am33xx_l4_wkup_hwmod,
697 .slave = &am33xx_wd_timer1_hwmod, 616 .slave = &am33xx_wd_timer1_hwmod,
@@ -776,20 +695,6 @@ static struct omap_hwmod_ocp_if am43xx_l4_ls__mcspi4 = {
776 .user = OCP_USER_MPU, 695 .user = OCP_USER_MPU,
777}; 696};
778 697
779static struct omap_hwmod_ocp_if am43xx_l4_ls__gpio4 = {
780 .master = &am33xx_l4_ls_hwmod,
781 .slave = &am43xx_gpio4_hwmod,
782 .clk = "l4ls_gclk",
783 .user = OCP_USER_MPU | OCP_USER_SDMA,
784};
785
786static struct omap_hwmod_ocp_if am43xx_l4_ls__gpio5 = {
787 .master = &am33xx_l4_ls_hwmod,
788 .slave = &am43xx_gpio5_hwmod,
789 .clk = "l4ls_gclk",
790 .user = OCP_USER_MPU | OCP_USER_SDMA,
791};
792
793static struct omap_hwmod_ocp_if am43xx_l4_ls__ocp2scp0 = { 698static struct omap_hwmod_ocp_if am43xx_l4_ls__ocp2scp0 = {
794 .master = &am33xx_l4_ls_hwmod, 699 .master = &am33xx_l4_ls_hwmod,
795 .slave = &am43xx_ocp2scp0_hwmod, 700 .slave = &am43xx_ocp2scp0_hwmod,
@@ -907,8 +812,6 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
907 &am43xx_l4_ls__mcspi2, 812 &am43xx_l4_ls__mcspi2,
908 &am43xx_l4_ls__mcspi3, 813 &am43xx_l4_ls__mcspi3,
909 &am43xx_l4_ls__mcspi4, 814 &am43xx_l4_ls__mcspi4,
910 &am43xx_l4_ls__gpio4,
911 &am43xx_l4_ls__gpio5,
912 &am43xx_l3_main__pruss, 815 &am43xx_l3_main__pruss,
913 &am33xx_mpu__l3_main, 816 &am33xx_mpu__l3_main,
914 &am33xx_mpu__prcm, 817 &am33xx_mpu__prcm,
@@ -927,27 +830,16 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
927 &am43xx_l4_wkup__control, 830 &am43xx_l4_wkup__control,
928 &am43xx_l4_wkup__smartreflex0, 831 &am43xx_l4_wkup__smartreflex0,
929 &am43xx_l4_wkup__smartreflex1, 832 &am43xx_l4_wkup__smartreflex1,
930 &am43xx_l4_wkup__uart1,
931 &am43xx_l4_wkup__timer1, 833 &am43xx_l4_wkup__timer1,
932 &am43xx_l4_wkup__i2c1,
933 &am43xx_l4_wkup__gpio0,
934 &am43xx_l4_wkup__wd_timer1, 834 &am43xx_l4_wkup__wd_timer1,
935 &am43xx_l4_wkup__adc_tsc, 835 &am43xx_l4_wkup__adc_tsc,
936 &am43xx_l3_s__qspi, 836 &am43xx_l3_s__qspi,
937 &am33xx_l4_per__dcan0, 837 &am33xx_l4_per__dcan0,
938 &am33xx_l4_per__dcan1, 838 &am33xx_l4_per__dcan1,
939 &am33xx_l4_per__gpio1,
940 &am33xx_l4_per__gpio2,
941 &am33xx_l4_per__gpio3,
942 &am33xx_l4_per__i2c2,
943 &am33xx_l4_per__i2c3,
944 &am33xx_l4_per__mailbox, 839 &am33xx_l4_per__mailbox,
945 &am33xx_l4_per__rng, 840 &am33xx_l4_per__rng,
946 &am33xx_l4_ls__mcasp0, 841 &am33xx_l4_ls__mcasp0,
947 &am33xx_l4_ls__mcasp1, 842 &am33xx_l4_ls__mcasp1,
948 &am33xx_l4_ls__mmc0,
949 &am33xx_l4_ls__mmc1,
950 &am33xx_l3_s__mmc2,
951 &am33xx_l4_ls__timer2, 843 &am33xx_l4_ls__timer2,
952 &am33xx_l4_ls__timer3, 844 &am33xx_l4_ls__timer3,
953 &am33xx_l4_ls__timer4, 845 &am33xx_l4_ls__timer4,
@@ -955,11 +847,6 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = {
955 &am33xx_l4_ls__timer6, 847 &am33xx_l4_ls__timer6,
956 &am33xx_l4_ls__timer7, 848 &am33xx_l4_ls__timer7,
957 &am33xx_l3_main__tpcc, 849 &am33xx_l3_main__tpcc,
958 &am33xx_l4_ls__uart2,
959 &am33xx_l4_ls__uart3,
960 &am33xx_l4_ls__uart4,
961 &am33xx_l4_ls__uart5,
962 &am33xx_l4_ls__uart6,
963 &am33xx_l4_ls__spinlock, 850 &am33xx_l4_ls__spinlock,
964 &am33xx_l4_ls__elm, 851 &am33xx_l4_ls__elm,
965 &am33xx_l4_ls__epwmss0, 852 &am33xx_l4_ls__epwmss0,
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index a95dbac57a81..b8de550a15b4 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -21,9 +21,7 @@
21 */ 21 */
22 22
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/platform_data/hsmmc-omap.h>
25#include <linux/power/smartreflex.h> 24#include <linux/power/smartreflex.h>
26#include <linux/platform_data/i2c-omap.h>
27 25
28#include <linux/omap-dma.h> 26#include <linux/omap-dma.h>
29 27
@@ -33,7 +31,6 @@
33#include "cm2_44xx.h" 31#include "cm2_44xx.h"
34#include "prm44xx.h" 32#include "prm44xx.h"
35#include "prm-regbits-44xx.h" 33#include "prm-regbits-44xx.h"
36#include "i2c.h"
37#include "wd_timer.h" 34#include "wd_timer.h"
38 35
39/* Base offset for all OMAP4 interrupts external to MPUSS */ 36/* Base offset for all OMAP4 interrupts external to MPUSS */
@@ -1056,160 +1053,6 @@ static struct omap_hwmod omap44xx_fdif_hwmod = {
1056}; 1053};
1057 1054
1058/* 1055/*
1059 * 'gpio' class
1060 * general purpose io module
1061 */
1062
1063static struct omap_hwmod_class_sysconfig omap44xx_gpio_sysc = {
1064 .rev_offs = 0x0000,
1065 .sysc_offs = 0x0010,
1066 .syss_offs = 0x0114,
1067 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
1068 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1069 SYSS_HAS_RESET_STATUS),
1070 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1071 SIDLE_SMART_WKUP),
1072 .sysc_fields = &omap_hwmod_sysc_type1,
1073};
1074
1075static struct omap_hwmod_class omap44xx_gpio_hwmod_class = {
1076 .name = "gpio",
1077 .sysc = &omap44xx_gpio_sysc,
1078 .rev = 2,
1079};
1080
1081/* gpio1 */
1082static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
1083 { .role = "dbclk", .clk = "gpio1_dbclk" },
1084};
1085
1086static struct omap_hwmod omap44xx_gpio1_hwmod = {
1087 .name = "gpio1",
1088 .class = &omap44xx_gpio_hwmod_class,
1089 .clkdm_name = "l4_wkup_clkdm",
1090 .main_clk = "l4_wkup_clk_mux_ck",
1091 .prcm = {
1092 .omap4 = {
1093 .clkctrl_offs = OMAP4_CM_WKUP_GPIO1_CLKCTRL_OFFSET,
1094 .context_offs = OMAP4_RM_WKUP_GPIO1_CONTEXT_OFFSET,
1095 .modulemode = MODULEMODE_HWCTRL,
1096 },
1097 },
1098 .opt_clks = gpio1_opt_clks,
1099 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
1100};
1101
1102/* gpio2 */
1103static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
1104 { .role = "dbclk", .clk = "gpio2_dbclk" },
1105};
1106
1107static struct omap_hwmod omap44xx_gpio2_hwmod = {
1108 .name = "gpio2",
1109 .class = &omap44xx_gpio_hwmod_class,
1110 .clkdm_name = "l4_per_clkdm",
1111 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1112 .main_clk = "l4_div_ck",
1113 .prcm = {
1114 .omap4 = {
1115 .clkctrl_offs = OMAP4_CM_L4PER_GPIO2_CLKCTRL_OFFSET,
1116 .context_offs = OMAP4_RM_L4PER_GPIO2_CONTEXT_OFFSET,
1117 .modulemode = MODULEMODE_HWCTRL,
1118 },
1119 },
1120 .opt_clks = gpio2_opt_clks,
1121 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
1122};
1123
1124/* gpio3 */
1125static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
1126 { .role = "dbclk", .clk = "gpio3_dbclk" },
1127};
1128
1129static struct omap_hwmod omap44xx_gpio3_hwmod = {
1130 .name = "gpio3",
1131 .class = &omap44xx_gpio_hwmod_class,
1132 .clkdm_name = "l4_per_clkdm",
1133 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1134 .main_clk = "l4_div_ck",
1135 .prcm = {
1136 .omap4 = {
1137 .clkctrl_offs = OMAP4_CM_L4PER_GPIO3_CLKCTRL_OFFSET,
1138 .context_offs = OMAP4_RM_L4PER_GPIO3_CONTEXT_OFFSET,
1139 .modulemode = MODULEMODE_HWCTRL,
1140 },
1141 },
1142 .opt_clks = gpio3_opt_clks,
1143 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
1144};
1145
1146/* gpio4 */
1147static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
1148 { .role = "dbclk", .clk = "gpio4_dbclk" },
1149};
1150
1151static struct omap_hwmod omap44xx_gpio4_hwmod = {
1152 .name = "gpio4",
1153 .class = &omap44xx_gpio_hwmod_class,
1154 .clkdm_name = "l4_per_clkdm",
1155 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1156 .main_clk = "l4_div_ck",
1157 .prcm = {
1158 .omap4 = {
1159 .clkctrl_offs = OMAP4_CM_L4PER_GPIO4_CLKCTRL_OFFSET,
1160 .context_offs = OMAP4_RM_L4PER_GPIO4_CONTEXT_OFFSET,
1161 .modulemode = MODULEMODE_HWCTRL,
1162 },
1163 },
1164 .opt_clks = gpio4_opt_clks,
1165 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
1166};
1167
1168/* gpio5 */
1169static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
1170 { .role = "dbclk", .clk = "gpio5_dbclk" },
1171};
1172
1173static struct omap_hwmod omap44xx_gpio5_hwmod = {
1174 .name = "gpio5",
1175 .class = &omap44xx_gpio_hwmod_class,
1176 .clkdm_name = "l4_per_clkdm",
1177 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1178 .main_clk = "l4_div_ck",
1179 .prcm = {
1180 .omap4 = {
1181 .clkctrl_offs = OMAP4_CM_L4PER_GPIO5_CLKCTRL_OFFSET,
1182 .context_offs = OMAP4_RM_L4PER_GPIO5_CONTEXT_OFFSET,
1183 .modulemode = MODULEMODE_HWCTRL,
1184 },
1185 },
1186 .opt_clks = gpio5_opt_clks,
1187 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
1188};
1189
1190/* gpio6 */
1191static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
1192 { .role = "dbclk", .clk = "gpio6_dbclk" },
1193};
1194
1195static struct omap_hwmod omap44xx_gpio6_hwmod = {
1196 .name = "gpio6",
1197 .class = &omap44xx_gpio_hwmod_class,
1198 .clkdm_name = "l4_per_clkdm",
1199 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
1200 .main_clk = "l4_div_ck",
1201 .prcm = {
1202 .omap4 = {
1203 .clkctrl_offs = OMAP4_CM_L4PER_GPIO6_CLKCTRL_OFFSET,
1204 .context_offs = OMAP4_RM_L4PER_GPIO6_CONTEXT_OFFSET,
1205 .modulemode = MODULEMODE_HWCTRL,
1206 },
1207 },
1208 .opt_clks = gpio6_opt_clks,
1209 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
1210};
1211
1212/*
1213 * 'gpmc' class 1056 * 'gpmc' class
1214 * general purpose memory controller 1057 * general purpose memory controller
1215 */ 1058 */
@@ -1355,94 +1198,6 @@ static struct omap_hwmod omap44xx_hsi_hwmod = {
1355}; 1198};
1356 1199
1357/* 1200/*
1358 * 'i2c' class
1359 * multimaster high-speed i2c controller
1360 */
1361
1362static struct omap_hwmod_class_sysconfig omap44xx_i2c_sysc = {
1363 .rev_offs = 0,
1364 .sysc_offs = 0x0010,
1365 .syss_offs = 0x0090,
1366 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1367 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1368 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1369 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1370 SIDLE_SMART_WKUP),
1371 .sysc_fields = &omap_hwmod_sysc_type1,
1372};
1373
1374static struct omap_hwmod_class omap44xx_i2c_hwmod_class = {
1375 .name = "i2c",
1376 .sysc = &omap44xx_i2c_sysc,
1377 .rev = OMAP_I2C_IP_VERSION_2,
1378 .reset = &omap_i2c_reset,
1379};
1380
1381/* i2c1 */
1382static struct omap_hwmod omap44xx_i2c1_hwmod = {
1383 .name = "i2c1",
1384 .class = &omap44xx_i2c_hwmod_class,
1385 .clkdm_name = "l4_per_clkdm",
1386 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1387 .main_clk = "func_96m_fclk",
1388 .prcm = {
1389 .omap4 = {
1390 .clkctrl_offs = OMAP4_CM_L4PER_I2C1_CLKCTRL_OFFSET,
1391 .context_offs = OMAP4_RM_L4PER_I2C1_CONTEXT_OFFSET,
1392 .modulemode = MODULEMODE_SWCTRL,
1393 },
1394 },
1395};
1396
1397/* i2c2 */
1398static struct omap_hwmod omap44xx_i2c2_hwmod = {
1399 .name = "i2c2",
1400 .class = &omap44xx_i2c_hwmod_class,
1401 .clkdm_name = "l4_per_clkdm",
1402 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1403 .main_clk = "func_96m_fclk",
1404 .prcm = {
1405 .omap4 = {
1406 .clkctrl_offs = OMAP4_CM_L4PER_I2C2_CLKCTRL_OFFSET,
1407 .context_offs = OMAP4_RM_L4PER_I2C2_CONTEXT_OFFSET,
1408 .modulemode = MODULEMODE_SWCTRL,
1409 },
1410 },
1411};
1412
1413/* i2c3 */
1414static struct omap_hwmod omap44xx_i2c3_hwmod = {
1415 .name = "i2c3",
1416 .class = &omap44xx_i2c_hwmod_class,
1417 .clkdm_name = "l4_per_clkdm",
1418 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1419 .main_clk = "func_96m_fclk",
1420 .prcm = {
1421 .omap4 = {
1422 .clkctrl_offs = OMAP4_CM_L4PER_I2C3_CLKCTRL_OFFSET,
1423 .context_offs = OMAP4_RM_L4PER_I2C3_CONTEXT_OFFSET,
1424 .modulemode = MODULEMODE_SWCTRL,
1425 },
1426 },
1427};
1428
1429/* i2c4 */
1430static struct omap_hwmod omap44xx_i2c4_hwmod = {
1431 .name = "i2c4",
1432 .class = &omap44xx_i2c_hwmod_class,
1433 .clkdm_name = "l4_per_clkdm",
1434 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1435 .main_clk = "func_96m_fclk",
1436 .prcm = {
1437 .omap4 = {
1438 .clkctrl_offs = OMAP4_CM_L4PER_I2C4_CLKCTRL_OFFSET,
1439 .context_offs = OMAP4_RM_L4PER_I2C4_CONTEXT_OFFSET,
1440 .modulemode = MODULEMODE_SWCTRL,
1441 },
1442 },
1443};
1444
1445/*
1446 * 'ipu' class 1201 * 'ipu' class
1447 * imaging processor unit 1202 * imaging processor unit
1448 */ 1203 */
@@ -1819,189 +1574,6 @@ static struct omap_hwmod omap44xx_mcpdm_hwmod = {
1819}; 1574};
1820 1575
1821/* 1576/*
1822 * 'mcspi' class
1823 * multichannel serial port interface (mcspi) / master/slave synchronous serial
1824 * bus
1825 */
1826
1827static struct omap_hwmod_class_sysconfig omap44xx_mcspi_sysc = {
1828 .rev_offs = 0x0000,
1829 .sysc_offs = 0x0010,
1830 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_RESET_STATUS |
1831 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
1832 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1833 SIDLE_SMART_WKUP),
1834 .sysc_fields = &omap_hwmod_sysc_type2,
1835};
1836
1837static struct omap_hwmod_class omap44xx_mcspi_hwmod_class = {
1838 .name = "mcspi",
1839 .sysc = &omap44xx_mcspi_sysc,
1840};
1841
1842/* mcspi1 */
1843static struct omap_hwmod omap44xx_mcspi1_hwmod = {
1844 .name = "mcspi1",
1845 .class = &omap44xx_mcspi_hwmod_class,
1846 .clkdm_name = "l4_per_clkdm",
1847 .main_clk = "func_48m_fclk",
1848 .prcm = {
1849 .omap4 = {
1850 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI1_CLKCTRL_OFFSET,
1851 .context_offs = OMAP4_RM_L4PER_MCSPI1_CONTEXT_OFFSET,
1852 .modulemode = MODULEMODE_SWCTRL,
1853 },
1854 },
1855};
1856
1857/* mcspi2 */
1858static struct omap_hwmod omap44xx_mcspi2_hwmod = {
1859 .name = "mcspi2",
1860 .class = &omap44xx_mcspi_hwmod_class,
1861 .clkdm_name = "l4_per_clkdm",
1862 .main_clk = "func_48m_fclk",
1863 .prcm = {
1864 .omap4 = {
1865 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI2_CLKCTRL_OFFSET,
1866 .context_offs = OMAP4_RM_L4PER_MCSPI2_CONTEXT_OFFSET,
1867 .modulemode = MODULEMODE_SWCTRL,
1868 },
1869 },
1870};
1871
1872/* mcspi3 */
1873static struct omap_hwmod omap44xx_mcspi3_hwmod = {
1874 .name = "mcspi3",
1875 .class = &omap44xx_mcspi_hwmod_class,
1876 .clkdm_name = "l4_per_clkdm",
1877 .main_clk = "func_48m_fclk",
1878 .prcm = {
1879 .omap4 = {
1880 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI3_CLKCTRL_OFFSET,
1881 .context_offs = OMAP4_RM_L4PER_MCSPI3_CONTEXT_OFFSET,
1882 .modulemode = MODULEMODE_SWCTRL,
1883 },
1884 },
1885};
1886
1887/* mcspi4 */
1888static struct omap_hwmod omap44xx_mcspi4_hwmod = {
1889 .name = "mcspi4",
1890 .class = &omap44xx_mcspi_hwmod_class,
1891 .clkdm_name = "l4_per_clkdm",
1892 .main_clk = "func_48m_fclk",
1893 .prcm = {
1894 .omap4 = {
1895 .clkctrl_offs = OMAP4_CM_L4PER_MCSPI4_CLKCTRL_OFFSET,
1896 .context_offs = OMAP4_RM_L4PER_MCSPI4_CONTEXT_OFFSET,
1897 .modulemode = MODULEMODE_SWCTRL,
1898 },
1899 },
1900};
1901
1902/*
1903 * 'mmc' class
1904 * multimedia card high-speed/sd/sdio (mmc/sd/sdio) host controller
1905 */
1906
1907static struct omap_hwmod_class_sysconfig omap44xx_mmc_sysc = {
1908 .rev_offs = 0x0000,
1909 .sysc_offs = 0x0010,
1910 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE |
1911 SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
1912 SYSC_HAS_SOFTRESET),
1913 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1914 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
1915 MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
1916 .sysc_fields = &omap_hwmod_sysc_type2,
1917};
1918
1919static struct omap_hwmod_class omap44xx_mmc_hwmod_class = {
1920 .name = "mmc",
1921 .sysc = &omap44xx_mmc_sysc,
1922};
1923
1924/* mmc1 */
1925static struct omap_hsmmc_dev_attr mmc1_dev_attr = {
1926 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
1927};
1928
1929static struct omap_hwmod omap44xx_mmc1_hwmod = {
1930 .name = "mmc1",
1931 .class = &omap44xx_mmc_hwmod_class,
1932 .clkdm_name = "l3_init_clkdm",
1933 .main_clk = "hsmmc1_fclk",
1934 .prcm = {
1935 .omap4 = {
1936 .clkctrl_offs = OMAP4_CM_L3INIT_MMC1_CLKCTRL_OFFSET,
1937 .context_offs = OMAP4_RM_L3INIT_MMC1_CONTEXT_OFFSET,
1938 .modulemode = MODULEMODE_SWCTRL,
1939 },
1940 },
1941 .dev_attr = &mmc1_dev_attr,
1942};
1943
1944/* mmc2 */
1945static struct omap_hwmod omap44xx_mmc2_hwmod = {
1946 .name = "mmc2",
1947 .class = &omap44xx_mmc_hwmod_class,
1948 .clkdm_name = "l3_init_clkdm",
1949 .main_clk = "hsmmc2_fclk",
1950 .prcm = {
1951 .omap4 = {
1952 .clkctrl_offs = OMAP4_CM_L3INIT_MMC2_CLKCTRL_OFFSET,
1953 .context_offs = OMAP4_RM_L3INIT_MMC2_CONTEXT_OFFSET,
1954 .modulemode = MODULEMODE_SWCTRL,
1955 },
1956 },
1957};
1958
1959/* mmc3 */
1960static struct omap_hwmod omap44xx_mmc3_hwmod = {
1961 .name = "mmc3",
1962 .class = &omap44xx_mmc_hwmod_class,
1963 .clkdm_name = "l4_per_clkdm",
1964 .main_clk = "func_48m_fclk",
1965 .prcm = {
1966 .omap4 = {
1967 .clkctrl_offs = OMAP4_CM_L4PER_MMCSD3_CLKCTRL_OFFSET,
1968 .context_offs = OMAP4_RM_L4PER_MMCSD3_CONTEXT_OFFSET,
1969 .modulemode = MODULEMODE_SWCTRL,
1970 },
1971 },
1972};
1973
1974/* mmc4 */
1975static struct omap_hwmod omap44xx_mmc4_hwmod = {
1976 .name = "mmc4",
1977 .class = &omap44xx_mmc_hwmod_class,
1978 .clkdm_name = "l4_per_clkdm",
1979 .main_clk = "func_48m_fclk",
1980 .prcm = {
1981 .omap4 = {
1982 .clkctrl_offs = OMAP4_CM_L4PER_MMCSD4_CLKCTRL_OFFSET,
1983 .context_offs = OMAP4_RM_L4PER_MMCSD4_CONTEXT_OFFSET,
1984 .modulemode = MODULEMODE_SWCTRL,
1985 },
1986 },
1987};
1988
1989/* mmc5 */
1990static struct omap_hwmod omap44xx_mmc5_hwmod = {
1991 .name = "mmc5",
1992 .class = &omap44xx_mmc_hwmod_class,
1993 .clkdm_name = "l4_per_clkdm",
1994 .main_clk = "func_48m_fclk",
1995 .prcm = {
1996 .omap4 = {
1997 .clkctrl_offs = OMAP4_CM_L4PER_MMCSD5_CLKCTRL_OFFSET,
1998 .context_offs = OMAP4_RM_L4PER_MMCSD5_CONTEXT_OFFSET,
1999 .modulemode = MODULEMODE_SWCTRL,
2000 },
2001 },
2002};
2003
2004/*
2005 * 'mmu' class 1577 * 'mmu' class
2006 * The memory management unit performs virtual to physical address translation 1578 * The memory management unit performs virtual to physical address translation
2007 * for its requestors. 1579 * for its requestors.
@@ -2367,7 +1939,6 @@ static struct omap_hwmod_class_sysconfig omap44xx_smartreflex_sysc = {
2367static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = { 1939static struct omap_hwmod_class omap44xx_smartreflex_hwmod_class = {
2368 .name = "smartreflex", 1940 .name = "smartreflex",
2369 .sysc = &omap44xx_smartreflex_sysc, 1941 .sysc = &omap44xx_smartreflex_sysc,
2370 .rev = 2,
2371}; 1942};
2372 1943
2373/* smartreflex_core */ 1944/* smartreflex_core */
@@ -2673,92 +2244,6 @@ static struct omap_hwmod omap44xx_timer11_hwmod = {
2673}; 2244};
2674 2245
2675/* 2246/*
2676 * 'uart' class
2677 * universal asynchronous receiver/transmitter (uart)
2678 */
2679
2680static struct omap_hwmod_class_sysconfig omap44xx_uart_sysc = {
2681 .rev_offs = 0x0050,
2682 .sysc_offs = 0x0054,
2683 .syss_offs = 0x0058,
2684 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
2685 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
2686 SYSS_HAS_RESET_STATUS),
2687 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2688 SIDLE_SMART_WKUP),
2689 .sysc_fields = &omap_hwmod_sysc_type1,
2690};
2691
2692static struct omap_hwmod_class omap44xx_uart_hwmod_class = {
2693 .name = "uart",
2694 .sysc = &omap44xx_uart_sysc,
2695};
2696
2697/* uart1 */
2698static struct omap_hwmod omap44xx_uart1_hwmod = {
2699 .name = "uart1",
2700 .class = &omap44xx_uart_hwmod_class,
2701 .clkdm_name = "l4_per_clkdm",
2702 .flags = HWMOD_SWSUP_SIDLE_ACT,
2703 .main_clk = "func_48m_fclk",
2704 .prcm = {
2705 .omap4 = {
2706 .clkctrl_offs = OMAP4_CM_L4PER_UART1_CLKCTRL_OFFSET,
2707 .context_offs = OMAP4_RM_L4PER_UART1_CONTEXT_OFFSET,
2708 .modulemode = MODULEMODE_SWCTRL,
2709 },
2710 },
2711};
2712
2713/* uart2 */
2714static struct omap_hwmod omap44xx_uart2_hwmod = {
2715 .name = "uart2",
2716 .class = &omap44xx_uart_hwmod_class,
2717 .clkdm_name = "l4_per_clkdm",
2718 .flags = HWMOD_SWSUP_SIDLE_ACT,
2719 .main_clk = "func_48m_fclk",
2720 .prcm = {
2721 .omap4 = {
2722 .clkctrl_offs = OMAP4_CM_L4PER_UART2_CLKCTRL_OFFSET,
2723 .context_offs = OMAP4_RM_L4PER_UART2_CONTEXT_OFFSET,
2724 .modulemode = MODULEMODE_SWCTRL,
2725 },
2726 },
2727};
2728
2729/* uart3 */
2730static struct omap_hwmod omap44xx_uart3_hwmod = {
2731 .name = "uart3",
2732 .class = &omap44xx_uart_hwmod_class,
2733 .clkdm_name = "l4_per_clkdm",
2734 .flags = DEBUG_OMAP4UART3_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
2735 .main_clk = "func_48m_fclk",
2736 .prcm = {
2737 .omap4 = {
2738 .clkctrl_offs = OMAP4_CM_L4PER_UART3_CLKCTRL_OFFSET,
2739 .context_offs = OMAP4_RM_L4PER_UART3_CONTEXT_OFFSET,
2740 .modulemode = MODULEMODE_SWCTRL,
2741 },
2742 },
2743};
2744
2745/* uart4 */
2746static struct omap_hwmod omap44xx_uart4_hwmod = {
2747 .name = "uart4",
2748 .class = &omap44xx_uart_hwmod_class,
2749 .clkdm_name = "l4_per_clkdm",
2750 .flags = DEBUG_OMAP4UART4_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
2751 .main_clk = "func_48m_fclk",
2752 .prcm = {
2753 .omap4 = {
2754 .clkctrl_offs = OMAP4_CM_L4PER_UART4_CLKCTRL_OFFSET,
2755 .context_offs = OMAP4_RM_L4PER_UART4_CONTEXT_OFFSET,
2756 .modulemode = MODULEMODE_SWCTRL,
2757 },
2758 },
2759};
2760
2761/*
2762 * 'usb_host_fs' class 2247 * 'usb_host_fs' class
2763 * full-speed usb host controller 2248 * full-speed usb host controller
2764 */ 2249 */
@@ -3082,22 +2567,6 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__l3_main_1 = {
3082 .user = OCP_USER_MPU | OCP_USER_SDMA, 2567 .user = OCP_USER_MPU | OCP_USER_SDMA,
3083}; 2568};
3084 2569
3085/* mmc1 -> l3_main_1 */
3086static struct omap_hwmod_ocp_if omap44xx_mmc1__l3_main_1 = {
3087 .master = &omap44xx_mmc1_hwmod,
3088 .slave = &omap44xx_l3_main_1_hwmod,
3089 .clk = "l3_div_ck",
3090 .user = OCP_USER_MPU | OCP_USER_SDMA,
3091};
3092
3093/* mmc2 -> l3_main_1 */
3094static struct omap_hwmod_ocp_if omap44xx_mmc2__l3_main_1 = {
3095 .master = &omap44xx_mmc2_hwmod,
3096 .slave = &omap44xx_l3_main_1_hwmod,
3097 .clk = "l3_div_ck",
3098 .user = OCP_USER_MPU | OCP_USER_SDMA,
3099};
3100
3101/* mpu -> l3_main_1 */ 2570/* mpu -> l3_main_1 */
3102static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = { 2571static struct omap_hwmod_ocp_if omap44xx_mpu__l3_main_1 = {
3103 .master = &omap44xx_mpu_hwmod, 2572 .master = &omap44xx_mpu_hwmod,
@@ -3554,54 +3023,6 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__fdif = {
3554 .user = OCP_USER_MPU | OCP_USER_SDMA, 3023 .user = OCP_USER_MPU | OCP_USER_SDMA,
3555}; 3024};
3556 3025
3557/* l4_wkup -> gpio1 */
3558static struct omap_hwmod_ocp_if omap44xx_l4_wkup__gpio1 = {
3559 .master = &omap44xx_l4_wkup_hwmod,
3560 .slave = &omap44xx_gpio1_hwmod,
3561 .clk = "l4_wkup_clk_mux_ck",
3562 .user = OCP_USER_MPU | OCP_USER_SDMA,
3563};
3564
3565/* l4_per -> gpio2 */
3566static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio2 = {
3567 .master = &omap44xx_l4_per_hwmod,
3568 .slave = &omap44xx_gpio2_hwmod,
3569 .clk = "l4_div_ck",
3570 .user = OCP_USER_MPU | OCP_USER_SDMA,
3571};
3572
3573/* l4_per -> gpio3 */
3574static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio3 = {
3575 .master = &omap44xx_l4_per_hwmod,
3576 .slave = &omap44xx_gpio3_hwmod,
3577 .clk = "l4_div_ck",
3578 .user = OCP_USER_MPU | OCP_USER_SDMA,
3579};
3580
3581/* l4_per -> gpio4 */
3582static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio4 = {
3583 .master = &omap44xx_l4_per_hwmod,
3584 .slave = &omap44xx_gpio4_hwmod,
3585 .clk = "l4_div_ck",
3586 .user = OCP_USER_MPU | OCP_USER_SDMA,
3587};
3588
3589/* l4_per -> gpio5 */
3590static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio5 = {
3591 .master = &omap44xx_l4_per_hwmod,
3592 .slave = &omap44xx_gpio5_hwmod,
3593 .clk = "l4_div_ck",
3594 .user = OCP_USER_MPU | OCP_USER_SDMA,
3595};
3596
3597/* l4_per -> gpio6 */
3598static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio6 = {
3599 .master = &omap44xx_l4_per_hwmod,
3600 .slave = &omap44xx_gpio6_hwmod,
3601 .clk = "l4_div_ck",
3602 .user = OCP_USER_MPU | OCP_USER_SDMA,
3603};
3604
3605/* l3_main_2 -> gpmc */ 3026/* l3_main_2 -> gpmc */
3606static struct omap_hwmod_ocp_if omap44xx_l3_main_2__gpmc = { 3027static struct omap_hwmod_ocp_if omap44xx_l3_main_2__gpmc = {
3607 .master = &omap44xx_l3_main_2_hwmod, 3028 .master = &omap44xx_l3_main_2_hwmod,
@@ -3634,38 +3055,6 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__hsi = {
3634 .user = OCP_USER_MPU | OCP_USER_SDMA, 3055 .user = OCP_USER_MPU | OCP_USER_SDMA,
3635}; 3056};
3636 3057
3637/* l4_per -> i2c1 */
3638static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c1 = {
3639 .master = &omap44xx_l4_per_hwmod,
3640 .slave = &omap44xx_i2c1_hwmod,
3641 .clk = "l4_div_ck",
3642 .user = OCP_USER_MPU | OCP_USER_SDMA,
3643};
3644
3645/* l4_per -> i2c2 */
3646static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c2 = {
3647 .master = &omap44xx_l4_per_hwmod,
3648 .slave = &omap44xx_i2c2_hwmod,
3649 .clk = "l4_div_ck",
3650 .user = OCP_USER_MPU | OCP_USER_SDMA,
3651};
3652
3653/* l4_per -> i2c3 */
3654static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c3 = {
3655 .master = &omap44xx_l4_per_hwmod,
3656 .slave = &omap44xx_i2c3_hwmod,
3657 .clk = "l4_div_ck",
3658 .user = OCP_USER_MPU | OCP_USER_SDMA,
3659};
3660
3661/* l4_per -> i2c4 */
3662static struct omap_hwmod_ocp_if omap44xx_l4_per__i2c4 = {
3663 .master = &omap44xx_l4_per_hwmod,
3664 .slave = &omap44xx_i2c4_hwmod,
3665 .clk = "l4_div_ck",
3666 .user = OCP_USER_MPU | OCP_USER_SDMA,
3667};
3668
3669/* l3_main_2 -> ipu */ 3058/* l3_main_2 -> ipu */
3670static struct omap_hwmod_ocp_if omap44xx_l3_main_2__ipu = { 3059static struct omap_hwmod_ocp_if omap44xx_l3_main_2__ipu = {
3671 .master = &omap44xx_l3_main_2_hwmod, 3060 .master = &omap44xx_l3_main_2_hwmod,
@@ -3770,78 +3159,6 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcpdm = {
3770 .user = OCP_USER_MPU | OCP_USER_SDMA, 3159 .user = OCP_USER_MPU | OCP_USER_SDMA,
3771}; 3160};
3772 3161
3773/* l4_per -> mcspi1 */
3774static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi1 = {
3775 .master = &omap44xx_l4_per_hwmod,
3776 .slave = &omap44xx_mcspi1_hwmod,
3777 .clk = "l4_div_ck",
3778 .user = OCP_USER_MPU | OCP_USER_SDMA,
3779};
3780
3781/* l4_per -> mcspi2 */
3782static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi2 = {
3783 .master = &omap44xx_l4_per_hwmod,
3784 .slave = &omap44xx_mcspi2_hwmod,
3785 .clk = "l4_div_ck",
3786 .user = OCP_USER_MPU | OCP_USER_SDMA,
3787};
3788
3789/* l4_per -> mcspi3 */
3790static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi3 = {
3791 .master = &omap44xx_l4_per_hwmod,
3792 .slave = &omap44xx_mcspi3_hwmod,
3793 .clk = "l4_div_ck",
3794 .user = OCP_USER_MPU | OCP_USER_SDMA,
3795};
3796
3797/* l4_per -> mcspi4 */
3798static struct omap_hwmod_ocp_if omap44xx_l4_per__mcspi4 = {
3799 .master = &omap44xx_l4_per_hwmod,
3800 .slave = &omap44xx_mcspi4_hwmod,
3801 .clk = "l4_div_ck",
3802 .user = OCP_USER_MPU | OCP_USER_SDMA,
3803};
3804
3805/* l4_per -> mmc1 */
3806static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc1 = {
3807 .master = &omap44xx_l4_per_hwmod,
3808 .slave = &omap44xx_mmc1_hwmod,
3809 .clk = "l4_div_ck",
3810 .user = OCP_USER_MPU | OCP_USER_SDMA,
3811};
3812
3813/* l4_per -> mmc2 */
3814static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc2 = {
3815 .master = &omap44xx_l4_per_hwmod,
3816 .slave = &omap44xx_mmc2_hwmod,
3817 .clk = "l4_div_ck",
3818 .user = OCP_USER_MPU | OCP_USER_SDMA,
3819};
3820
3821/* l4_per -> mmc3 */
3822static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc3 = {
3823 .master = &omap44xx_l4_per_hwmod,
3824 .slave = &omap44xx_mmc3_hwmod,
3825 .clk = "l4_div_ck",
3826 .user = OCP_USER_MPU | OCP_USER_SDMA,
3827};
3828
3829/* l4_per -> mmc4 */
3830static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc4 = {
3831 .master = &omap44xx_l4_per_hwmod,
3832 .slave = &omap44xx_mmc4_hwmod,
3833 .clk = "l4_div_ck",
3834 .user = OCP_USER_MPU | OCP_USER_SDMA,
3835};
3836
3837/* l4_per -> mmc5 */
3838static struct omap_hwmod_ocp_if omap44xx_l4_per__mmc5 = {
3839 .master = &omap44xx_l4_per_hwmod,
3840 .slave = &omap44xx_mmc5_hwmod,
3841 .clk = "l4_div_ck",
3842 .user = OCP_USER_MPU | OCP_USER_SDMA,
3843};
3844
3845/* l3_main_2 -> ocmc_ram */ 3162/* l3_main_2 -> ocmc_ram */
3846static struct omap_hwmod_ocp_if omap44xx_l3_main_2__ocmc_ram = { 3163static struct omap_hwmod_ocp_if omap44xx_l3_main_2__ocmc_ram = {
3847 .master = &omap44xx_l3_main_2_hwmod, 3164 .master = &omap44xx_l3_main_2_hwmod,
@@ -4050,38 +3367,6 @@ static struct omap_hwmod_ocp_if omap44xx_l4_per__timer11 = {
4050 .user = OCP_USER_MPU | OCP_USER_SDMA, 3367 .user = OCP_USER_MPU | OCP_USER_SDMA,
4051}; 3368};
4052 3369
4053/* l4_per -> uart1 */
4054static struct omap_hwmod_ocp_if omap44xx_l4_per__uart1 = {
4055 .master = &omap44xx_l4_per_hwmod,
4056 .slave = &omap44xx_uart1_hwmod,
4057 .clk = "l4_div_ck",
4058 .user = OCP_USER_MPU | OCP_USER_SDMA,
4059};
4060
4061/* l4_per -> uart2 */
4062static struct omap_hwmod_ocp_if omap44xx_l4_per__uart2 = {
4063 .master = &omap44xx_l4_per_hwmod,
4064 .slave = &omap44xx_uart2_hwmod,
4065 .clk = "l4_div_ck",
4066 .user = OCP_USER_MPU | OCP_USER_SDMA,
4067};
4068
4069/* l4_per -> uart3 */
4070static struct omap_hwmod_ocp_if omap44xx_l4_per__uart3 = {
4071 .master = &omap44xx_l4_per_hwmod,
4072 .slave = &omap44xx_uart3_hwmod,
4073 .clk = "l4_div_ck",
4074 .user = OCP_USER_MPU | OCP_USER_SDMA,
4075};
4076
4077/* l4_per -> uart4 */
4078static struct omap_hwmod_ocp_if omap44xx_l4_per__uart4 = {
4079 .master = &omap44xx_l4_per_hwmod,
4080 .slave = &omap44xx_uart4_hwmod,
4081 .clk = "l4_div_ck",
4082 .user = OCP_USER_MPU | OCP_USER_SDMA,
4083};
4084
4085/* l4_cfg -> usb_host_fs */ 3370/* l4_cfg -> usb_host_fs */
4086static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_cfg__usb_host_fs = { 3371static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_cfg__usb_host_fs = {
4087 .master = &omap44xx_l4_cfg_hwmod, 3372 .master = &omap44xx_l4_cfg_hwmod,
@@ -4164,8 +3449,6 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
4164 &omap44xx_dss__l3_main_1, 3449 &omap44xx_dss__l3_main_1,
4165 &omap44xx_l3_main_2__l3_main_1, 3450 &omap44xx_l3_main_2__l3_main_1,
4166 &omap44xx_l4_cfg__l3_main_1, 3451 &omap44xx_l4_cfg__l3_main_1,
4167 &omap44xx_mmc1__l3_main_1,
4168 &omap44xx_mmc2__l3_main_1,
4169 &omap44xx_mpu__l3_main_1, 3452 &omap44xx_mpu__l3_main_1,
4170 &omap44xx_debugss__l3_main_2, 3453 &omap44xx_debugss__l3_main_2,
4171 &omap44xx_dma_system__l3_main_2, 3454 &omap44xx_dma_system__l3_main_2,
@@ -4222,20 +3505,10 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
4222 &omap44xx_l4_per__dss_venc, 3505 &omap44xx_l4_per__dss_venc,
4223 &omap44xx_l4_per__elm, 3506 &omap44xx_l4_per__elm,
4224 &omap44xx_l4_cfg__fdif, 3507 &omap44xx_l4_cfg__fdif,
4225 &omap44xx_l4_wkup__gpio1,
4226 &omap44xx_l4_per__gpio2,
4227 &omap44xx_l4_per__gpio3,
4228 &omap44xx_l4_per__gpio4,
4229 &omap44xx_l4_per__gpio5,
4230 &omap44xx_l4_per__gpio6,
4231 &omap44xx_l3_main_2__gpmc, 3508 &omap44xx_l3_main_2__gpmc,
4232 &omap44xx_l3_main_2__gpu, 3509 &omap44xx_l3_main_2__gpu,
4233 &omap44xx_l4_per__hdq1w, 3510 &omap44xx_l4_per__hdq1w,
4234 &omap44xx_l4_cfg__hsi, 3511 &omap44xx_l4_cfg__hsi,
4235 &omap44xx_l4_per__i2c1,
4236 &omap44xx_l4_per__i2c2,
4237 &omap44xx_l4_per__i2c3,
4238 &omap44xx_l4_per__i2c4,
4239 &omap44xx_l3_main_2__ipu, 3512 &omap44xx_l3_main_2__ipu,
4240 &omap44xx_l3_main_2__iss, 3513 &omap44xx_l3_main_2__iss,
4241 /* &omap44xx_iva__sl2if, */ 3514 /* &omap44xx_iva__sl2if, */
@@ -4249,15 +3522,6 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
4249 &omap44xx_l4_abe__mcbsp3, 3522 &omap44xx_l4_abe__mcbsp3,
4250 &omap44xx_l4_per__mcbsp4, 3523 &omap44xx_l4_per__mcbsp4,
4251 &omap44xx_l4_abe__mcpdm, 3524 &omap44xx_l4_abe__mcpdm,
4252 &omap44xx_l4_per__mcspi1,
4253 &omap44xx_l4_per__mcspi2,
4254 &omap44xx_l4_per__mcspi3,
4255 &omap44xx_l4_per__mcspi4,
4256 &omap44xx_l4_per__mmc1,
4257 &omap44xx_l4_per__mmc2,
4258 &omap44xx_l4_per__mmc3,
4259 &omap44xx_l4_per__mmc4,
4260 &omap44xx_l4_per__mmc5,
4261 &omap44xx_l3_main_2__mmu_ipu, 3525 &omap44xx_l3_main_2__mmu_ipu,
4262 &omap44xx_l4_cfg__mmu_dsp, 3526 &omap44xx_l4_cfg__mmu_dsp,
4263 &omap44xx_l3_main_2__ocmc_ram, 3527 &omap44xx_l3_main_2__ocmc_ram,
@@ -4286,10 +3550,6 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = {
4286 &omap44xx_l4_per__timer9, 3550 &omap44xx_l4_per__timer9,
4287 &omap44xx_l4_per__timer10, 3551 &omap44xx_l4_per__timer10,
4288 &omap44xx_l4_per__timer11, 3552 &omap44xx_l4_per__timer11,
4289 &omap44xx_l4_per__uart1,
4290 &omap44xx_l4_per__uart2,
4291 &omap44xx_l4_per__uart3,
4292 &omap44xx_l4_per__uart4,
4293 /* &omap44xx_l4_cfg__usb_host_fs, */ 3553 /* &omap44xx_l4_cfg__usb_host_fs, */
4294 &omap44xx_l4_cfg__usb_host_hs, 3554 &omap44xx_l4_cfg__usb_host_hs,
4295 &omap44xx_l4_cfg__usb_otg_hs, 3555 &omap44xx_l4_cfg__usb_otg_hs,
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
index 115473d441cd..29805cc9d74c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -18,9 +18,7 @@
18 */ 18 */
19 19
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/platform_data/hsmmc-omap.h>
22#include <linux/power/smartreflex.h> 21#include <linux/power/smartreflex.h>
23#include <linux/platform_data/i2c-omap.h>
24 22
25#include <linux/omap-dma.h> 23#include <linux/omap-dma.h>
26 24
@@ -29,7 +27,6 @@
29#include "cm1_54xx.h" 27#include "cm1_54xx.h"
30#include "cm2_54xx.h" 28#include "cm2_54xx.h"
31#include "prm54xx.h" 29#include "prm54xx.h"
32#include "i2c.h"
33#include "wd_timer.h" 30#include "wd_timer.h"
34 31
35/* Base offset for all OMAP5 interrupts external to MPUSS */ 32/* Base offset for all OMAP5 interrupts external to MPUSS */
@@ -601,308 +598,6 @@ static struct omap_hwmod omap54xx_emif2_hwmod = {
601}; 598};
602 599
603/* 600/*
604 * 'gpio' class
605 * general purpose io module
606 */
607
608static struct omap_hwmod_class_sysconfig omap54xx_gpio_sysc = {
609 .rev_offs = 0x0000,
610 .sysc_offs = 0x0010,
611 .syss_offs = 0x0114,
612 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
613 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
614 SYSS_HAS_RESET_STATUS),
615 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
616 SIDLE_SMART_WKUP),
617 .sysc_fields = &omap_hwmod_sysc_type1,
618};
619
620static struct omap_hwmod_class omap54xx_gpio_hwmod_class = {
621 .name = "gpio",
622 .sysc = &omap54xx_gpio_sysc,
623 .rev = 2,
624};
625
626/* gpio1 */
627static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
628 { .role = "dbclk", .clk = "gpio1_dbclk" },
629};
630
631static struct omap_hwmod omap54xx_gpio1_hwmod = {
632 .name = "gpio1",
633 .class = &omap54xx_gpio_hwmod_class,
634 .clkdm_name = "wkupaon_clkdm",
635 .main_clk = "wkupaon_iclk_mux",
636 .prcm = {
637 .omap4 = {
638 .clkctrl_offs = OMAP54XX_CM_WKUPAON_GPIO1_CLKCTRL_OFFSET,
639 .context_offs = OMAP54XX_RM_WKUPAON_GPIO1_CONTEXT_OFFSET,
640 .modulemode = MODULEMODE_HWCTRL,
641 },
642 },
643 .opt_clks = gpio1_opt_clks,
644 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
645};
646
647/* gpio2 */
648static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
649 { .role = "dbclk", .clk = "gpio2_dbclk" },
650};
651
652static struct omap_hwmod omap54xx_gpio2_hwmod = {
653 .name = "gpio2",
654 .class = &omap54xx_gpio_hwmod_class,
655 .clkdm_name = "l4per_clkdm",
656 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
657 .main_clk = "l4_root_clk_div",
658 .prcm = {
659 .omap4 = {
660 .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO2_CLKCTRL_OFFSET,
661 .context_offs = OMAP54XX_RM_L4PER_GPIO2_CONTEXT_OFFSET,
662 .modulemode = MODULEMODE_HWCTRL,
663 },
664 },
665 .opt_clks = gpio2_opt_clks,
666 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
667};
668
669/* gpio3 */
670static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
671 { .role = "dbclk", .clk = "gpio3_dbclk" },
672};
673
674static struct omap_hwmod omap54xx_gpio3_hwmod = {
675 .name = "gpio3",
676 .class = &omap54xx_gpio_hwmod_class,
677 .clkdm_name = "l4per_clkdm",
678 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
679 .main_clk = "l4_root_clk_div",
680 .prcm = {
681 .omap4 = {
682 .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO3_CLKCTRL_OFFSET,
683 .context_offs = OMAP54XX_RM_L4PER_GPIO3_CONTEXT_OFFSET,
684 .modulemode = MODULEMODE_HWCTRL,
685 },
686 },
687 .opt_clks = gpio3_opt_clks,
688 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
689};
690
691/* gpio4 */
692static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
693 { .role = "dbclk", .clk = "gpio4_dbclk" },
694};
695
696static struct omap_hwmod omap54xx_gpio4_hwmod = {
697 .name = "gpio4",
698 .class = &omap54xx_gpio_hwmod_class,
699 .clkdm_name = "l4per_clkdm",
700 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
701 .main_clk = "l4_root_clk_div",
702 .prcm = {
703 .omap4 = {
704 .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO4_CLKCTRL_OFFSET,
705 .context_offs = OMAP54XX_RM_L4PER_GPIO4_CONTEXT_OFFSET,
706 .modulemode = MODULEMODE_HWCTRL,
707 },
708 },
709 .opt_clks = gpio4_opt_clks,
710 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
711};
712
713/* gpio5 */
714static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
715 { .role = "dbclk", .clk = "gpio5_dbclk" },
716};
717
718static struct omap_hwmod omap54xx_gpio5_hwmod = {
719 .name = "gpio5",
720 .class = &omap54xx_gpio_hwmod_class,
721 .clkdm_name = "l4per_clkdm",
722 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
723 .main_clk = "l4_root_clk_div",
724 .prcm = {
725 .omap4 = {
726 .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO5_CLKCTRL_OFFSET,
727 .context_offs = OMAP54XX_RM_L4PER_GPIO5_CONTEXT_OFFSET,
728 .modulemode = MODULEMODE_HWCTRL,
729 },
730 },
731 .opt_clks = gpio5_opt_clks,
732 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
733};
734
735/* gpio6 */
736static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
737 { .role = "dbclk", .clk = "gpio6_dbclk" },
738};
739
740static struct omap_hwmod omap54xx_gpio6_hwmod = {
741 .name = "gpio6",
742 .class = &omap54xx_gpio_hwmod_class,
743 .clkdm_name = "l4per_clkdm",
744 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
745 .main_clk = "l4_root_clk_div",
746 .prcm = {
747 .omap4 = {
748 .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO6_CLKCTRL_OFFSET,
749 .context_offs = OMAP54XX_RM_L4PER_GPIO6_CONTEXT_OFFSET,
750 .modulemode = MODULEMODE_HWCTRL,
751 },
752 },
753 .opt_clks = gpio6_opt_clks,
754 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
755};
756
757/* gpio7 */
758static struct omap_hwmod_opt_clk gpio7_opt_clks[] = {
759 { .role = "dbclk", .clk = "gpio7_dbclk" },
760};
761
762static struct omap_hwmod omap54xx_gpio7_hwmod = {
763 .name = "gpio7",
764 .class = &omap54xx_gpio_hwmod_class,
765 .clkdm_name = "l4per_clkdm",
766 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
767 .main_clk = "l4_root_clk_div",
768 .prcm = {
769 .omap4 = {
770 .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO7_CLKCTRL_OFFSET,
771 .context_offs = OMAP54XX_RM_L4PER_GPIO7_CONTEXT_OFFSET,
772 .modulemode = MODULEMODE_HWCTRL,
773 },
774 },
775 .opt_clks = gpio7_opt_clks,
776 .opt_clks_cnt = ARRAY_SIZE(gpio7_opt_clks),
777};
778
779/* gpio8 */
780static struct omap_hwmod_opt_clk gpio8_opt_clks[] = {
781 { .role = "dbclk", .clk = "gpio8_dbclk" },
782};
783
784static struct omap_hwmod omap54xx_gpio8_hwmod = {
785 .name = "gpio8",
786 .class = &omap54xx_gpio_hwmod_class,
787 .clkdm_name = "l4per_clkdm",
788 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
789 .main_clk = "l4_root_clk_div",
790 .prcm = {
791 .omap4 = {
792 .clkctrl_offs = OMAP54XX_CM_L4PER_GPIO8_CLKCTRL_OFFSET,
793 .context_offs = OMAP54XX_RM_L4PER_GPIO8_CONTEXT_OFFSET,
794 .modulemode = MODULEMODE_HWCTRL,
795 },
796 },
797 .opt_clks = gpio8_opt_clks,
798 .opt_clks_cnt = ARRAY_SIZE(gpio8_opt_clks),
799};
800
801/*
802 * 'i2c' class
803 * multimaster high-speed i2c controller
804 */
805
806static struct omap_hwmod_class_sysconfig omap54xx_i2c_sysc = {
807 .rev_offs = 0,
808 .sysc_offs = 0x0010,
809 .syss_offs = 0x0090,
810 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
811 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
812 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
813 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
814 SIDLE_SMART_WKUP),
815 .sysc_fields = &omap_hwmod_sysc_type1,
816};
817
818static struct omap_hwmod_class omap54xx_i2c_hwmod_class = {
819 .name = "i2c",
820 .sysc = &omap54xx_i2c_sysc,
821 .reset = &omap_i2c_reset,
822 .rev = OMAP_I2C_IP_VERSION_2,
823};
824
825/* i2c1 */
826static struct omap_hwmod omap54xx_i2c1_hwmod = {
827 .name = "i2c1",
828 .class = &omap54xx_i2c_hwmod_class,
829 .clkdm_name = "l4per_clkdm",
830 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
831 .main_clk = "func_96m_fclk",
832 .prcm = {
833 .omap4 = {
834 .clkctrl_offs = OMAP54XX_CM_L4PER_I2C1_CLKCTRL_OFFSET,
835 .context_offs = OMAP54XX_RM_L4PER_I2C1_CONTEXT_OFFSET,
836 .modulemode = MODULEMODE_SWCTRL,
837 },
838 },
839};
840
841/* i2c2 */
842static struct omap_hwmod omap54xx_i2c2_hwmod = {
843 .name = "i2c2",
844 .class = &omap54xx_i2c_hwmod_class,
845 .clkdm_name = "l4per_clkdm",
846 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
847 .main_clk = "func_96m_fclk",
848 .prcm = {
849 .omap4 = {
850 .clkctrl_offs = OMAP54XX_CM_L4PER_I2C2_CLKCTRL_OFFSET,
851 .context_offs = OMAP54XX_RM_L4PER_I2C2_CONTEXT_OFFSET,
852 .modulemode = MODULEMODE_SWCTRL,
853 },
854 },
855};
856
857/* i2c3 */
858static struct omap_hwmod omap54xx_i2c3_hwmod = {
859 .name = "i2c3",
860 .class = &omap54xx_i2c_hwmod_class,
861 .clkdm_name = "l4per_clkdm",
862 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
863 .main_clk = "func_96m_fclk",
864 .prcm = {
865 .omap4 = {
866 .clkctrl_offs = OMAP54XX_CM_L4PER_I2C3_CLKCTRL_OFFSET,
867 .context_offs = OMAP54XX_RM_L4PER_I2C3_CONTEXT_OFFSET,
868 .modulemode = MODULEMODE_SWCTRL,
869 },
870 },
871};
872
873/* i2c4 */
874static struct omap_hwmod omap54xx_i2c4_hwmod = {
875 .name = "i2c4",
876 .class = &omap54xx_i2c_hwmod_class,
877 .clkdm_name = "l4per_clkdm",
878 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
879 .main_clk = "func_96m_fclk",
880 .prcm = {
881 .omap4 = {
882 .clkctrl_offs = OMAP54XX_CM_L4PER_I2C4_CLKCTRL_OFFSET,
883 .context_offs = OMAP54XX_RM_L4PER_I2C4_CONTEXT_OFFSET,
884 .modulemode = MODULEMODE_SWCTRL,
885 },
886 },
887};
888
889/* i2c5 */
890static struct omap_hwmod omap54xx_i2c5_hwmod = {
891 .name = "i2c5",
892 .class = &omap54xx_i2c_hwmod_class,
893 .clkdm_name = "l4per_clkdm",
894 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
895 .main_clk = "func_96m_fclk",
896 .prcm = {
897 .omap4 = {
898 .clkctrl_offs = OMAP54XX_CM_L4PER_I2C5_CLKCTRL_OFFSET,
899 .context_offs = OMAP54XX_RM_L4PER_I2C5_CONTEXT_OFFSET,
900 .modulemode = MODULEMODE_SWCTRL,
901 },
902 },
903};
904
905/*
906 * 'kbd' class 601 * 'kbd' class
907 * keyboard controller 602 * keyboard controller
908 */ 603 */
@@ -1185,115 +880,6 @@ static struct omap_hwmod omap54xx_mcspi4_hwmod = {
1185}; 880};
1186 881
1187/* 882/*
1188 * 'mmc' class
1189 * multimedia card high-speed/sd/sdio (mmc/sd/sdio) host controller
1190 */
1191
1192static struct omap_hwmod_class_sysconfig omap54xx_mmc_sysc = {
1193 .rev_offs = 0x0000,
1194 .sysc_offs = 0x0010,
1195 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE |
1196 SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
1197 SYSC_HAS_SOFTRESET),
1198 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1199 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
1200 MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
1201 .sysc_fields = &omap_hwmod_sysc_type2,
1202};
1203
1204static struct omap_hwmod_class omap54xx_mmc_hwmod_class = {
1205 .name = "mmc",
1206 .sysc = &omap54xx_mmc_sysc,
1207};
1208
1209/* mmc1 */
1210static struct omap_hwmod_opt_clk mmc1_opt_clks[] = {
1211 { .role = "32khz_clk", .clk = "mmc1_32khz_clk" },
1212};
1213
1214/* mmc1 dev_attr */
1215static struct omap_hsmmc_dev_attr mmc1_dev_attr = {
1216 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
1217};
1218
1219static struct omap_hwmod omap54xx_mmc1_hwmod = {
1220 .name = "mmc1",
1221 .class = &omap54xx_mmc_hwmod_class,
1222 .clkdm_name = "l3init_clkdm",
1223 .main_clk = "mmc1_fclk",
1224 .prcm = {
1225 .omap4 = {
1226 .clkctrl_offs = OMAP54XX_CM_L3INIT_MMC1_CLKCTRL_OFFSET,
1227 .context_offs = OMAP54XX_RM_L3INIT_MMC1_CONTEXT_OFFSET,
1228 .modulemode = MODULEMODE_SWCTRL,
1229 },
1230 },
1231 .opt_clks = mmc1_opt_clks,
1232 .opt_clks_cnt = ARRAY_SIZE(mmc1_opt_clks),
1233 .dev_attr = &mmc1_dev_attr,
1234};
1235
1236/* mmc2 */
1237static struct omap_hwmod omap54xx_mmc2_hwmod = {
1238 .name = "mmc2",
1239 .class = &omap54xx_mmc_hwmod_class,
1240 .clkdm_name = "l3init_clkdm",
1241 .main_clk = "mmc2_fclk",
1242 .prcm = {
1243 .omap4 = {
1244 .clkctrl_offs = OMAP54XX_CM_L3INIT_MMC2_CLKCTRL_OFFSET,
1245 .context_offs = OMAP54XX_RM_L3INIT_MMC2_CONTEXT_OFFSET,
1246 .modulemode = MODULEMODE_SWCTRL,
1247 },
1248 },
1249};
1250
1251/* mmc3 */
1252static struct omap_hwmod omap54xx_mmc3_hwmod = {
1253 .name = "mmc3",
1254 .class = &omap54xx_mmc_hwmod_class,
1255 .clkdm_name = "l4per_clkdm",
1256 .main_clk = "func_48m_fclk",
1257 .prcm = {
1258 .omap4 = {
1259 .clkctrl_offs = OMAP54XX_CM_L4PER_MMC3_CLKCTRL_OFFSET,
1260 .context_offs = OMAP54XX_RM_L4PER_MMC3_CONTEXT_OFFSET,
1261 .modulemode = MODULEMODE_SWCTRL,
1262 },
1263 },
1264};
1265
1266/* mmc4 */
1267static struct omap_hwmod omap54xx_mmc4_hwmod = {
1268 .name = "mmc4",
1269 .class = &omap54xx_mmc_hwmod_class,
1270 .clkdm_name = "l4per_clkdm",
1271 .main_clk = "func_48m_fclk",
1272 .prcm = {
1273 .omap4 = {
1274 .clkctrl_offs = OMAP54XX_CM_L4PER_MMC4_CLKCTRL_OFFSET,
1275 .context_offs = OMAP54XX_RM_L4PER_MMC4_CONTEXT_OFFSET,
1276 .modulemode = MODULEMODE_SWCTRL,
1277 },
1278 },
1279};
1280
1281/* mmc5 */
1282static struct omap_hwmod omap54xx_mmc5_hwmod = {
1283 .name = "mmc5",
1284 .class = &omap54xx_mmc_hwmod_class,
1285 .clkdm_name = "l4per_clkdm",
1286 .main_clk = "func_96m_fclk",
1287 .prcm = {
1288 .omap4 = {
1289 .clkctrl_offs = OMAP54XX_CM_L4PER_MMC5_CLKCTRL_OFFSET,
1290 .context_offs = OMAP54XX_RM_L4PER_MMC5_CONTEXT_OFFSET,
1291 .modulemode = MODULEMODE_SWCTRL,
1292 },
1293 },
1294};
1295
1296/*
1297 * 'mmu' class 883 * 'mmu' class
1298 * The memory management unit performs virtual to physical address translation 884 * The memory management unit performs virtual to physical address translation
1299 * for its requestors. 885 * for its requestors.
@@ -1658,124 +1244,6 @@ static struct omap_hwmod omap54xx_timer11_hwmod = {
1658}; 1244};
1659 1245
1660/* 1246/*
1661 * 'uart' class
1662 * universal asynchronous receiver/transmitter (uart)
1663 */
1664
1665static struct omap_hwmod_class_sysconfig omap54xx_uart_sysc = {
1666 .rev_offs = 0x0050,
1667 .sysc_offs = 0x0054,
1668 .syss_offs = 0x0058,
1669 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
1670 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
1671 SYSS_HAS_RESET_STATUS),
1672 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1673 SIDLE_SMART_WKUP),
1674 .sysc_fields = &omap_hwmod_sysc_type1,
1675};
1676
1677static struct omap_hwmod_class omap54xx_uart_hwmod_class = {
1678 .name = "uart",
1679 .sysc = &omap54xx_uart_sysc,
1680};
1681
1682/* uart1 */
1683static struct omap_hwmod omap54xx_uart1_hwmod = {
1684 .name = "uart1",
1685 .class = &omap54xx_uart_hwmod_class,
1686 .clkdm_name = "l4per_clkdm",
1687 .flags = HWMOD_SWSUP_SIDLE_ACT,
1688 .main_clk = "func_48m_fclk",
1689 .prcm = {
1690 .omap4 = {
1691 .clkctrl_offs = OMAP54XX_CM_L4PER_UART1_CLKCTRL_OFFSET,
1692 .context_offs = OMAP54XX_RM_L4PER_UART1_CONTEXT_OFFSET,
1693 .modulemode = MODULEMODE_SWCTRL,
1694 },
1695 },
1696};
1697
1698/* uart2 */
1699static struct omap_hwmod omap54xx_uart2_hwmod = {
1700 .name = "uart2",
1701 .class = &omap54xx_uart_hwmod_class,
1702 .clkdm_name = "l4per_clkdm",
1703 .flags = HWMOD_SWSUP_SIDLE_ACT,
1704 .main_clk = "func_48m_fclk",
1705 .prcm = {
1706 .omap4 = {
1707 .clkctrl_offs = OMAP54XX_CM_L4PER_UART2_CLKCTRL_OFFSET,
1708 .context_offs = OMAP54XX_RM_L4PER_UART2_CONTEXT_OFFSET,
1709 .modulemode = MODULEMODE_SWCTRL,
1710 },
1711 },
1712};
1713
1714/* uart3 */
1715static struct omap_hwmod omap54xx_uart3_hwmod = {
1716 .name = "uart3",
1717 .class = &omap54xx_uart_hwmod_class,
1718 .clkdm_name = "l4per_clkdm",
1719 .flags = DEBUG_OMAP4UART3_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
1720 .main_clk = "func_48m_fclk",
1721 .prcm = {
1722 .omap4 = {
1723 .clkctrl_offs = OMAP54XX_CM_L4PER_UART3_CLKCTRL_OFFSET,
1724 .context_offs = OMAP54XX_RM_L4PER_UART3_CONTEXT_OFFSET,
1725 .modulemode = MODULEMODE_SWCTRL,
1726 },
1727 },
1728};
1729
1730/* uart4 */
1731static struct omap_hwmod omap54xx_uart4_hwmod = {
1732 .name = "uart4",
1733 .class = &omap54xx_uart_hwmod_class,
1734 .clkdm_name = "l4per_clkdm",
1735 .flags = DEBUG_OMAP4UART4_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
1736 .main_clk = "func_48m_fclk",
1737 .prcm = {
1738 .omap4 = {
1739 .clkctrl_offs = OMAP54XX_CM_L4PER_UART4_CLKCTRL_OFFSET,
1740 .context_offs = OMAP54XX_RM_L4PER_UART4_CONTEXT_OFFSET,
1741 .modulemode = MODULEMODE_SWCTRL,
1742 },
1743 },
1744};
1745
1746/* uart5 */
1747static struct omap_hwmod omap54xx_uart5_hwmod = {
1748 .name = "uart5",
1749 .class = &omap54xx_uart_hwmod_class,
1750 .clkdm_name = "l4per_clkdm",
1751 .flags = HWMOD_SWSUP_SIDLE_ACT,
1752 .main_clk = "func_48m_fclk",
1753 .prcm = {
1754 .omap4 = {
1755 .clkctrl_offs = OMAP54XX_CM_L4PER_UART5_CLKCTRL_OFFSET,
1756 .context_offs = OMAP54XX_RM_L4PER_UART5_CONTEXT_OFFSET,
1757 .modulemode = MODULEMODE_SWCTRL,
1758 },
1759 },
1760};
1761
1762/* uart6 */
1763static struct omap_hwmod omap54xx_uart6_hwmod = {
1764 .name = "uart6",
1765 .class = &omap54xx_uart_hwmod_class,
1766 .clkdm_name = "l4per_clkdm",
1767 .flags = HWMOD_SWSUP_SIDLE_ACT,
1768 .main_clk = "func_48m_fclk",
1769 .prcm = {
1770 .omap4 = {
1771 .clkctrl_offs = OMAP54XX_CM_L4PER_UART6_CLKCTRL_OFFSET,
1772 .context_offs = OMAP54XX_RM_L4PER_UART6_CONTEXT_OFFSET,
1773 .modulemode = MODULEMODE_SWCTRL,
1774 },
1775 },
1776};
1777
1778/*
1779 * 'usb_host_hs' class 1247 * 'usb_host_hs' class
1780 * high-speed multi-port usb host controller 1248 * high-speed multi-port usb host controller
1781 */ 1249 */
@@ -2274,110 +1742,6 @@ static struct omap_hwmod_ocp_if omap54xx_mpu__emif2 = {
2274 .user = OCP_USER_MPU | OCP_USER_SDMA, 1742 .user = OCP_USER_MPU | OCP_USER_SDMA,
2275}; 1743};
2276 1744
2277/* l4_wkup -> gpio1 */
2278static struct omap_hwmod_ocp_if omap54xx_l4_wkup__gpio1 = {
2279 .master = &omap54xx_l4_wkup_hwmod,
2280 .slave = &omap54xx_gpio1_hwmod,
2281 .clk = "wkupaon_iclk_mux",
2282 .user = OCP_USER_MPU | OCP_USER_SDMA,
2283};
2284
2285/* l4_per -> gpio2 */
2286static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio2 = {
2287 .master = &omap54xx_l4_per_hwmod,
2288 .slave = &omap54xx_gpio2_hwmod,
2289 .clk = "l4_root_clk_div",
2290 .user = OCP_USER_MPU | OCP_USER_SDMA,
2291};
2292
2293/* l4_per -> gpio3 */
2294static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio3 = {
2295 .master = &omap54xx_l4_per_hwmod,
2296 .slave = &omap54xx_gpio3_hwmod,
2297 .clk = "l4_root_clk_div",
2298 .user = OCP_USER_MPU | OCP_USER_SDMA,
2299};
2300
2301/* l4_per -> gpio4 */
2302static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio4 = {
2303 .master = &omap54xx_l4_per_hwmod,
2304 .slave = &omap54xx_gpio4_hwmod,
2305 .clk = "l4_root_clk_div",
2306 .user = OCP_USER_MPU | OCP_USER_SDMA,
2307};
2308
2309/* l4_per -> gpio5 */
2310static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio5 = {
2311 .master = &omap54xx_l4_per_hwmod,
2312 .slave = &omap54xx_gpio5_hwmod,
2313 .clk = "l4_root_clk_div",
2314 .user = OCP_USER_MPU | OCP_USER_SDMA,
2315};
2316
2317/* l4_per -> gpio6 */
2318static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio6 = {
2319 .master = &omap54xx_l4_per_hwmod,
2320 .slave = &omap54xx_gpio6_hwmod,
2321 .clk = "l4_root_clk_div",
2322 .user = OCP_USER_MPU | OCP_USER_SDMA,
2323};
2324
2325/* l4_per -> gpio7 */
2326static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio7 = {
2327 .master = &omap54xx_l4_per_hwmod,
2328 .slave = &omap54xx_gpio7_hwmod,
2329 .clk = "l4_root_clk_div",
2330 .user = OCP_USER_MPU | OCP_USER_SDMA,
2331};
2332
2333/* l4_per -> gpio8 */
2334static struct omap_hwmod_ocp_if omap54xx_l4_per__gpio8 = {
2335 .master = &omap54xx_l4_per_hwmod,
2336 .slave = &omap54xx_gpio8_hwmod,
2337 .clk = "l4_root_clk_div",
2338 .user = OCP_USER_MPU | OCP_USER_SDMA,
2339};
2340
2341/* l4_per -> i2c1 */
2342static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c1 = {
2343 .master = &omap54xx_l4_per_hwmod,
2344 .slave = &omap54xx_i2c1_hwmod,
2345 .clk = "l4_root_clk_div",
2346 .user = OCP_USER_MPU | OCP_USER_SDMA,
2347};
2348
2349/* l4_per -> i2c2 */
2350static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c2 = {
2351 .master = &omap54xx_l4_per_hwmod,
2352 .slave = &omap54xx_i2c2_hwmod,
2353 .clk = "l4_root_clk_div",
2354 .user = OCP_USER_MPU | OCP_USER_SDMA,
2355};
2356
2357/* l4_per -> i2c3 */
2358static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c3 = {
2359 .master = &omap54xx_l4_per_hwmod,
2360 .slave = &omap54xx_i2c3_hwmod,
2361 .clk = "l4_root_clk_div",
2362 .user = OCP_USER_MPU | OCP_USER_SDMA,
2363};
2364
2365/* l4_per -> i2c4 */
2366static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c4 = {
2367 .master = &omap54xx_l4_per_hwmod,
2368 .slave = &omap54xx_i2c4_hwmod,
2369 .clk = "l4_root_clk_div",
2370 .user = OCP_USER_MPU | OCP_USER_SDMA,
2371};
2372
2373/* l4_per -> i2c5 */
2374static struct omap_hwmod_ocp_if omap54xx_l4_per__i2c5 = {
2375 .master = &omap54xx_l4_per_hwmod,
2376 .slave = &omap54xx_i2c5_hwmod,
2377 .clk = "l4_root_clk_div",
2378 .user = OCP_USER_MPU | OCP_USER_SDMA,
2379};
2380
2381/* l4_wkup -> kbd */ 1745/* l4_wkup -> kbd */
2382static struct omap_hwmod_ocp_if omap54xx_l4_wkup__kbd = { 1746static struct omap_hwmod_ocp_if omap54xx_l4_wkup__kbd = {
2383 .master = &omap54xx_l4_wkup_hwmod, 1747 .master = &omap54xx_l4_wkup_hwmod,
@@ -2458,46 +1822,6 @@ static struct omap_hwmod_ocp_if omap54xx_l4_per__mcspi4 = {
2458 .user = OCP_USER_MPU | OCP_USER_SDMA, 1822 .user = OCP_USER_MPU | OCP_USER_SDMA,
2459}; 1823};
2460 1824
2461/* l4_per -> mmc1 */
2462static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc1 = {
2463 .master = &omap54xx_l4_per_hwmod,
2464 .slave = &omap54xx_mmc1_hwmod,
2465 .clk = "l3_iclk_div",
2466 .user = OCP_USER_MPU | OCP_USER_SDMA,
2467};
2468
2469/* l4_per -> mmc2 */
2470static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc2 = {
2471 .master = &omap54xx_l4_per_hwmod,
2472 .slave = &omap54xx_mmc2_hwmod,
2473 .clk = "l3_iclk_div",
2474 .user = OCP_USER_MPU | OCP_USER_SDMA,
2475};
2476
2477/* l4_per -> mmc3 */
2478static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc3 = {
2479 .master = &omap54xx_l4_per_hwmod,
2480 .slave = &omap54xx_mmc3_hwmod,
2481 .clk = "l4_root_clk_div",
2482 .user = OCP_USER_MPU | OCP_USER_SDMA,
2483};
2484
2485/* l4_per -> mmc4 */
2486static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc4 = {
2487 .master = &omap54xx_l4_per_hwmod,
2488 .slave = &omap54xx_mmc4_hwmod,
2489 .clk = "l4_root_clk_div",
2490 .user = OCP_USER_MPU | OCP_USER_SDMA,
2491};
2492
2493/* l4_per -> mmc5 */
2494static struct omap_hwmod_ocp_if omap54xx_l4_per__mmc5 = {
2495 .master = &omap54xx_l4_per_hwmod,
2496 .slave = &omap54xx_mmc5_hwmod,
2497 .clk = "l4_root_clk_div",
2498 .user = OCP_USER_MPU | OCP_USER_SDMA,
2499};
2500
2501/* l4_cfg -> mpu */ 1825/* l4_cfg -> mpu */
2502static struct omap_hwmod_ocp_if omap54xx_l4_cfg__mpu = { 1826static struct omap_hwmod_ocp_if omap54xx_l4_cfg__mpu = {
2503 .master = &omap54xx_l4_cfg_hwmod, 1827 .master = &omap54xx_l4_cfg_hwmod,
@@ -2610,54 +1934,6 @@ static struct omap_hwmod_ocp_if omap54xx_l4_per__timer11 = {
2610 .user = OCP_USER_MPU | OCP_USER_SDMA, 1934 .user = OCP_USER_MPU | OCP_USER_SDMA,
2611}; 1935};
2612 1936
2613/* l4_per -> uart1 */
2614static struct omap_hwmod_ocp_if omap54xx_l4_per__uart1 = {
2615 .master = &omap54xx_l4_per_hwmod,
2616 .slave = &omap54xx_uart1_hwmod,
2617 .clk = "l4_root_clk_div",
2618 .user = OCP_USER_MPU | OCP_USER_SDMA,
2619};
2620
2621/* l4_per -> uart2 */
2622static struct omap_hwmod_ocp_if omap54xx_l4_per__uart2 = {
2623 .master = &omap54xx_l4_per_hwmod,
2624 .slave = &omap54xx_uart2_hwmod,
2625 .clk = "l4_root_clk_div",
2626 .user = OCP_USER_MPU | OCP_USER_SDMA,
2627};
2628
2629/* l4_per -> uart3 */
2630static struct omap_hwmod_ocp_if omap54xx_l4_per__uart3 = {
2631 .master = &omap54xx_l4_per_hwmod,
2632 .slave = &omap54xx_uart3_hwmod,
2633 .clk = "l4_root_clk_div",
2634 .user = OCP_USER_MPU | OCP_USER_SDMA,
2635};
2636
2637/* l4_per -> uart4 */
2638static struct omap_hwmod_ocp_if omap54xx_l4_per__uart4 = {
2639 .master = &omap54xx_l4_per_hwmod,
2640 .slave = &omap54xx_uart4_hwmod,
2641 .clk = "l4_root_clk_div",
2642 .user = OCP_USER_MPU | OCP_USER_SDMA,
2643};
2644
2645/* l4_per -> uart5 */
2646static struct omap_hwmod_ocp_if omap54xx_l4_per__uart5 = {
2647 .master = &omap54xx_l4_per_hwmod,
2648 .slave = &omap54xx_uart5_hwmod,
2649 .clk = "l4_root_clk_div",
2650 .user = OCP_USER_MPU | OCP_USER_SDMA,
2651};
2652
2653/* l4_per -> uart6 */
2654static struct omap_hwmod_ocp_if omap54xx_l4_per__uart6 = {
2655 .master = &omap54xx_l4_per_hwmod,
2656 .slave = &omap54xx_uart6_hwmod,
2657 .clk = "l4_root_clk_div",
2658 .user = OCP_USER_MPU | OCP_USER_SDMA,
2659};
2660
2661/* l4_cfg -> usb_host_hs */ 1937/* l4_cfg -> usb_host_hs */
2662static struct omap_hwmod_ocp_if omap54xx_l4_cfg__usb_host_hs = { 1938static struct omap_hwmod_ocp_if omap54xx_l4_cfg__usb_host_hs = {
2663 .master = &omap54xx_l4_cfg_hwmod, 1939 .master = &omap54xx_l4_cfg_hwmod,
@@ -2719,19 +1995,6 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
2719 &omap54xx_l3_main_2__dss_rfbi, 1995 &omap54xx_l3_main_2__dss_rfbi,
2720 &omap54xx_mpu__emif1, 1996 &omap54xx_mpu__emif1,
2721 &omap54xx_mpu__emif2, 1997 &omap54xx_mpu__emif2,
2722 &omap54xx_l4_wkup__gpio1,
2723 &omap54xx_l4_per__gpio2,
2724 &omap54xx_l4_per__gpio3,
2725 &omap54xx_l4_per__gpio4,
2726 &omap54xx_l4_per__gpio5,
2727 &omap54xx_l4_per__gpio6,
2728 &omap54xx_l4_per__gpio7,
2729 &omap54xx_l4_per__gpio8,
2730 &omap54xx_l4_per__i2c1,
2731 &omap54xx_l4_per__i2c2,
2732 &omap54xx_l4_per__i2c3,
2733 &omap54xx_l4_per__i2c4,
2734 &omap54xx_l4_per__i2c5,
2735 &omap54xx_l3_main_2__mmu_ipu, 1998 &omap54xx_l3_main_2__mmu_ipu,
2736 &omap54xx_l4_wkup__kbd, 1999 &omap54xx_l4_wkup__kbd,
2737 &omap54xx_l4_cfg__mailbox, 2000 &omap54xx_l4_cfg__mailbox,
@@ -2743,11 +2006,6 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
2743 &omap54xx_l4_per__mcspi2, 2006 &omap54xx_l4_per__mcspi2,
2744 &omap54xx_l4_per__mcspi3, 2007 &omap54xx_l4_per__mcspi3,
2745 &omap54xx_l4_per__mcspi4, 2008 &omap54xx_l4_per__mcspi4,
2746 &omap54xx_l4_per__mmc1,
2747 &omap54xx_l4_per__mmc2,
2748 &omap54xx_l4_per__mmc3,
2749 &omap54xx_l4_per__mmc4,
2750 &omap54xx_l4_per__mmc5,
2751 &omap54xx_l4_cfg__mpu, 2009 &omap54xx_l4_cfg__mpu,
2752 &omap54xx_l4_cfg__spinlock, 2010 &omap54xx_l4_cfg__spinlock,
2753 &omap54xx_l4_cfg__ocp2scp1, 2011 &omap54xx_l4_cfg__ocp2scp1,
@@ -2762,12 +2020,6 @@ static struct omap_hwmod_ocp_if *omap54xx_hwmod_ocp_ifs[] __initdata = {
2762 &omap54xx_l4_per__timer9, 2020 &omap54xx_l4_per__timer9,
2763 &omap54xx_l4_per__timer10, 2021 &omap54xx_l4_per__timer10,
2764 &omap54xx_l4_per__timer11, 2022 &omap54xx_l4_per__timer11,
2765 &omap54xx_l4_per__uart1,
2766 &omap54xx_l4_per__uart2,
2767 &omap54xx_l4_per__uart3,
2768 &omap54xx_l4_per__uart4,
2769 &omap54xx_l4_per__uart5,
2770 &omap54xx_l4_per__uart6,
2771 &omap54xx_l4_cfg__usb_host_hs, 2023 &omap54xx_l4_cfg__usb_host_hs,
2772 &omap54xx_l4_cfg__usb_tll_hs, 2024 &omap54xx_l4_cfg__usb_tll_hs,
2773 &omap54xx_l4_cfg__usb_otg_ss, 2025 &omap54xx_l4_cfg__usb_otg_ss,
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index e6c7061a8e73..7e85bd27ce9a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -18,9 +18,7 @@
18 */ 18 */
19 19
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/platform_data/hsmmc-omap.h>
22#include <linux/power/smartreflex.h> 21#include <linux/power/smartreflex.h>
23#include <linux/platform_data/i2c-omap.h>
24 22
25#include <linux/omap-dma.h> 23#include <linux/omap-dma.h>
26 24
@@ -29,7 +27,6 @@
29#include "cm1_7xx.h" 27#include "cm1_7xx.h"
30#include "cm2_7xx.h" 28#include "cm2_7xx.h"
31#include "prm7xx.h" 29#include "prm7xx.h"
32#include "i2c.h"
33#include "wd_timer.h" 30#include "wd_timer.h"
34#include "soc.h" 31#include "soc.h"
35 32
@@ -693,7 +690,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_aes_sysc = {
693static struct omap_hwmod_class dra7xx_aes_hwmod_class = { 690static struct omap_hwmod_class dra7xx_aes_hwmod_class = {
694 .name = "aes", 691 .name = "aes",
695 .sysc = &dra7xx_aes_sysc, 692 .sysc = &dra7xx_aes_sysc,
696 .rev = 2,
697}; 693};
698 694
699/* AES1 */ 695/* AES1 */
@@ -737,7 +733,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_sha0_sysc = {
737static struct omap_hwmod_class dra7xx_sha0_hwmod_class = { 733static struct omap_hwmod_class dra7xx_sha0_hwmod_class = {
738 .name = "sham", 734 .name = "sham",
739 .sysc = &dra7xx_sha0_sysc, 735 .sysc = &dra7xx_sha0_sysc,
740 .rev = 2,
741}; 736};
742 737
743struct omap_hwmod dra7xx_sha0_hwmod = { 738struct omap_hwmod dra7xx_sha0_hwmod = {
@@ -792,205 +787,6 @@ static struct omap_hwmod dra7xx_elm_hwmod = {
792}; 787};
793 788
794/* 789/*
795 * 'gpio' class
796 *
797 */
798
799static struct omap_hwmod_class_sysconfig dra7xx_gpio_sysc = {
800 .rev_offs = 0x0000,
801 .sysc_offs = 0x0010,
802 .syss_offs = 0x0114,
803 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
804 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
805 SYSS_HAS_RESET_STATUS),
806 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
807 SIDLE_SMART_WKUP),
808 .sysc_fields = &omap_hwmod_sysc_type1,
809};
810
811static struct omap_hwmod_class dra7xx_gpio_hwmod_class = {
812 .name = "gpio",
813 .sysc = &dra7xx_gpio_sysc,
814 .rev = 2,
815};
816
817/* gpio1 */
818static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
819 { .role = "dbclk", .clk = "gpio1_dbclk" },
820};
821
822static struct omap_hwmod dra7xx_gpio1_hwmod = {
823 .name = "gpio1",
824 .class = &dra7xx_gpio_hwmod_class,
825 .clkdm_name = "wkupaon_clkdm",
826 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
827 .main_clk = "wkupaon_iclk_mux",
828 .prcm = {
829 .omap4 = {
830 .clkctrl_offs = DRA7XX_CM_WKUPAON_GPIO1_CLKCTRL_OFFSET,
831 .context_offs = DRA7XX_RM_WKUPAON_GPIO1_CONTEXT_OFFSET,
832 .modulemode = MODULEMODE_HWCTRL,
833 },
834 },
835 .opt_clks = gpio1_opt_clks,
836 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
837};
838
839/* gpio2 */
840static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
841 { .role = "dbclk", .clk = "gpio2_dbclk" },
842};
843
844static struct omap_hwmod dra7xx_gpio2_hwmod = {
845 .name = "gpio2",
846 .class = &dra7xx_gpio_hwmod_class,
847 .clkdm_name = "l4per_clkdm",
848 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
849 .main_clk = "l3_iclk_div",
850 .prcm = {
851 .omap4 = {
852 .clkctrl_offs = DRA7XX_CM_L4PER_GPIO2_CLKCTRL_OFFSET,
853 .context_offs = DRA7XX_RM_L4PER_GPIO2_CONTEXT_OFFSET,
854 .modulemode = MODULEMODE_HWCTRL,
855 },
856 },
857 .opt_clks = gpio2_opt_clks,
858 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
859};
860
861/* gpio3 */
862static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
863 { .role = "dbclk", .clk = "gpio3_dbclk" },
864};
865
866static struct omap_hwmod dra7xx_gpio3_hwmod = {
867 .name = "gpio3",
868 .class = &dra7xx_gpio_hwmod_class,
869 .clkdm_name = "l4per_clkdm",
870 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
871 .main_clk = "l3_iclk_div",
872 .prcm = {
873 .omap4 = {
874 .clkctrl_offs = DRA7XX_CM_L4PER_GPIO3_CLKCTRL_OFFSET,
875 .context_offs = DRA7XX_RM_L4PER_GPIO3_CONTEXT_OFFSET,
876 .modulemode = MODULEMODE_HWCTRL,
877 },
878 },
879 .opt_clks = gpio3_opt_clks,
880 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
881};
882
883/* gpio4 */
884static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
885 { .role = "dbclk", .clk = "gpio4_dbclk" },
886};
887
888static struct omap_hwmod dra7xx_gpio4_hwmod = {
889 .name = "gpio4",
890 .class = &dra7xx_gpio_hwmod_class,
891 .clkdm_name = "l4per_clkdm",
892 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
893 .main_clk = "l3_iclk_div",
894 .prcm = {
895 .omap4 = {
896 .clkctrl_offs = DRA7XX_CM_L4PER_GPIO4_CLKCTRL_OFFSET,
897 .context_offs = DRA7XX_RM_L4PER_GPIO4_CONTEXT_OFFSET,
898 .modulemode = MODULEMODE_HWCTRL,
899 },
900 },
901 .opt_clks = gpio4_opt_clks,
902 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
903};
904
905/* gpio5 */
906static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
907 { .role = "dbclk", .clk = "gpio5_dbclk" },
908};
909
910static struct omap_hwmod dra7xx_gpio5_hwmod = {
911 .name = "gpio5",
912 .class = &dra7xx_gpio_hwmod_class,
913 .clkdm_name = "l4per_clkdm",
914 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
915 .main_clk = "l3_iclk_div",
916 .prcm = {
917 .omap4 = {
918 .clkctrl_offs = DRA7XX_CM_L4PER_GPIO5_CLKCTRL_OFFSET,
919 .context_offs = DRA7XX_RM_L4PER_GPIO5_CONTEXT_OFFSET,
920 .modulemode = MODULEMODE_HWCTRL,
921 },
922 },
923 .opt_clks = gpio5_opt_clks,
924 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
925};
926
927/* gpio6 */
928static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
929 { .role = "dbclk", .clk = "gpio6_dbclk" },
930};
931
932static struct omap_hwmod dra7xx_gpio6_hwmod = {
933 .name = "gpio6",
934 .class = &dra7xx_gpio_hwmod_class,
935 .clkdm_name = "l4per_clkdm",
936 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
937 .main_clk = "l3_iclk_div",
938 .prcm = {
939 .omap4 = {
940 .clkctrl_offs = DRA7XX_CM_L4PER_GPIO6_CLKCTRL_OFFSET,
941 .context_offs = DRA7XX_RM_L4PER_GPIO6_CONTEXT_OFFSET,
942 .modulemode = MODULEMODE_HWCTRL,
943 },
944 },
945 .opt_clks = gpio6_opt_clks,
946 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
947};
948
949/* gpio7 */
950static struct omap_hwmod_opt_clk gpio7_opt_clks[] = {
951 { .role = "dbclk", .clk = "gpio7_dbclk" },
952};
953
954static struct omap_hwmod dra7xx_gpio7_hwmod = {
955 .name = "gpio7",
956 .class = &dra7xx_gpio_hwmod_class,
957 .clkdm_name = "l4per_clkdm",
958 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
959 .main_clk = "l3_iclk_div",
960 .prcm = {
961 .omap4 = {
962 .clkctrl_offs = DRA7XX_CM_L4PER_GPIO7_CLKCTRL_OFFSET,
963 .context_offs = DRA7XX_RM_L4PER_GPIO7_CONTEXT_OFFSET,
964 .modulemode = MODULEMODE_HWCTRL,
965 },
966 },
967 .opt_clks = gpio7_opt_clks,
968 .opt_clks_cnt = ARRAY_SIZE(gpio7_opt_clks),
969};
970
971/* gpio8 */
972static struct omap_hwmod_opt_clk gpio8_opt_clks[] = {
973 { .role = "dbclk", .clk = "gpio8_dbclk" },
974};
975
976static struct omap_hwmod dra7xx_gpio8_hwmod = {
977 .name = "gpio8",
978 .class = &dra7xx_gpio_hwmod_class,
979 .clkdm_name = "l4per_clkdm",
980 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
981 .main_clk = "l3_iclk_div",
982 .prcm = {
983 .omap4 = {
984 .clkctrl_offs = DRA7XX_CM_L4PER_GPIO8_CLKCTRL_OFFSET,
985 .context_offs = DRA7XX_RM_L4PER_GPIO8_CONTEXT_OFFSET,
986 .modulemode = MODULEMODE_HWCTRL,
987 },
988 },
989 .opt_clks = gpio8_opt_clks,
990 .opt_clks_cnt = ARRAY_SIZE(gpio8_opt_clks),
991};
992
993/*
994 * 'gpmc' class 790 * 'gpmc' class
995 * 791 *
996 */ 792 */
@@ -1065,110 +861,6 @@ static struct omap_hwmod dra7xx_hdq1w_hwmod = {
1065}; 861};
1066 862
1067/* 863/*
1068 * 'i2c' class
1069 *
1070 */
1071
1072static struct omap_hwmod_class_sysconfig dra7xx_i2c_sysc = {
1073 .rev_offs = 0,
1074 .sysc_offs = 0x0010,
1075 .syss_offs = 0x0090,
1076 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
1077 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1078 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
1079 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1080 SIDLE_SMART_WKUP),
1081 .sysc_fields = &omap_hwmod_sysc_type1,
1082};
1083
1084static struct omap_hwmod_class dra7xx_i2c_hwmod_class = {
1085 .name = "i2c",
1086 .sysc = &dra7xx_i2c_sysc,
1087 .reset = &omap_i2c_reset,
1088 .rev = OMAP_I2C_IP_VERSION_2,
1089};
1090
1091/* i2c1 */
1092static struct omap_hwmod dra7xx_i2c1_hwmod = {
1093 .name = "i2c1",
1094 .class = &dra7xx_i2c_hwmod_class,
1095 .clkdm_name = "l4per_clkdm",
1096 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1097 .main_clk = "func_96m_fclk",
1098 .prcm = {
1099 .omap4 = {
1100 .clkctrl_offs = DRA7XX_CM_L4PER_I2C1_CLKCTRL_OFFSET,
1101 .context_offs = DRA7XX_RM_L4PER_I2C1_CONTEXT_OFFSET,
1102 .modulemode = MODULEMODE_SWCTRL,
1103 },
1104 },
1105};
1106
1107/* i2c2 */
1108static struct omap_hwmod dra7xx_i2c2_hwmod = {
1109 .name = "i2c2",
1110 .class = &dra7xx_i2c_hwmod_class,
1111 .clkdm_name = "l4per_clkdm",
1112 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1113 .main_clk = "func_96m_fclk",
1114 .prcm = {
1115 .omap4 = {
1116 .clkctrl_offs = DRA7XX_CM_L4PER_I2C2_CLKCTRL_OFFSET,
1117 .context_offs = DRA7XX_RM_L4PER_I2C2_CONTEXT_OFFSET,
1118 .modulemode = MODULEMODE_SWCTRL,
1119 },
1120 },
1121};
1122
1123/* i2c3 */
1124static struct omap_hwmod dra7xx_i2c3_hwmod = {
1125 .name = "i2c3",
1126 .class = &dra7xx_i2c_hwmod_class,
1127 .clkdm_name = "l4per_clkdm",
1128 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1129 .main_clk = "func_96m_fclk",
1130 .prcm = {
1131 .omap4 = {
1132 .clkctrl_offs = DRA7XX_CM_L4PER_I2C3_CLKCTRL_OFFSET,
1133 .context_offs = DRA7XX_RM_L4PER_I2C3_CONTEXT_OFFSET,
1134 .modulemode = MODULEMODE_SWCTRL,
1135 },
1136 },
1137};
1138
1139/* i2c4 */
1140static struct omap_hwmod dra7xx_i2c4_hwmod = {
1141 .name = "i2c4",
1142 .class = &dra7xx_i2c_hwmod_class,
1143 .clkdm_name = "l4per_clkdm",
1144 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1145 .main_clk = "func_96m_fclk",
1146 .prcm = {
1147 .omap4 = {
1148 .clkctrl_offs = DRA7XX_CM_L4PER_I2C4_CLKCTRL_OFFSET,
1149 .context_offs = DRA7XX_RM_L4PER_I2C4_CONTEXT_OFFSET,
1150 .modulemode = MODULEMODE_SWCTRL,
1151 },
1152 },
1153};
1154
1155/* i2c5 */
1156static struct omap_hwmod dra7xx_i2c5_hwmod = {
1157 .name = "i2c5",
1158 .class = &dra7xx_i2c_hwmod_class,
1159 .clkdm_name = "ipu_clkdm",
1160 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT,
1161 .main_clk = "func_96m_fclk",
1162 .prcm = {
1163 .omap4 = {
1164 .clkctrl_offs = DRA7XX_CM_IPU_I2C5_CLKCTRL_OFFSET,
1165 .context_offs = DRA7XX_RM_IPU_I2C5_CONTEXT_OFFSET,
1166 .modulemode = MODULEMODE_SWCTRL,
1167 },
1168 },
1169};
1170
1171/*
1172 * 'mailbox' class 864 * 'mailbox' class
1173 * 865 *
1174 */ 866 */
@@ -1632,118 +1324,6 @@ static struct omap_hwmod dra7xx_mcasp8_hwmod = {
1632}; 1324};
1633 1325
1634/* 1326/*
1635 * 'mmc' class
1636 *
1637 */
1638
1639static struct omap_hwmod_class_sysconfig dra7xx_mmc_sysc = {
1640 .rev_offs = 0x0000,
1641 .sysc_offs = 0x0010,
1642 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_MIDLEMODE |
1643 SYSC_HAS_RESET_STATUS | SYSC_HAS_SIDLEMODE |
1644 SYSC_HAS_SOFTRESET),
1645 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
1646 SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
1647 MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
1648 .sysc_fields = &omap_hwmod_sysc_type2,
1649};
1650
1651static struct omap_hwmod_class dra7xx_mmc_hwmod_class = {
1652 .name = "mmc",
1653 .sysc = &dra7xx_mmc_sysc,
1654};
1655
1656/* mmc1 */
1657static struct omap_hwmod_opt_clk mmc1_opt_clks[] = {
1658 { .role = "clk32k", .clk = "mmc1_clk32k" },
1659};
1660
1661/* mmc1 dev_attr */
1662static struct omap_hsmmc_dev_attr mmc1_dev_attr = {
1663 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
1664};
1665
1666static struct omap_hwmod dra7xx_mmc1_hwmod = {
1667 .name = "mmc1",
1668 .class = &dra7xx_mmc_hwmod_class,
1669 .clkdm_name = "l3init_clkdm",
1670 .main_clk = "mmc1_fclk_div",
1671 .prcm = {
1672 .omap4 = {
1673 .clkctrl_offs = DRA7XX_CM_L3INIT_MMC1_CLKCTRL_OFFSET,
1674 .context_offs = DRA7XX_RM_L3INIT_MMC1_CONTEXT_OFFSET,
1675 .modulemode = MODULEMODE_SWCTRL,
1676 },
1677 },
1678 .opt_clks = mmc1_opt_clks,
1679 .opt_clks_cnt = ARRAY_SIZE(mmc1_opt_clks),
1680 .dev_attr = &mmc1_dev_attr,
1681};
1682
1683/* mmc2 */
1684static struct omap_hwmod_opt_clk mmc2_opt_clks[] = {
1685 { .role = "clk32k", .clk = "mmc2_clk32k" },
1686};
1687
1688static struct omap_hwmod dra7xx_mmc2_hwmod = {
1689 .name = "mmc2",
1690 .class = &dra7xx_mmc_hwmod_class,
1691 .clkdm_name = "l3init_clkdm",
1692 .main_clk = "mmc2_fclk_div",
1693 .prcm = {
1694 .omap4 = {
1695 .clkctrl_offs = DRA7XX_CM_L3INIT_MMC2_CLKCTRL_OFFSET,
1696 .context_offs = DRA7XX_RM_L3INIT_MMC2_CONTEXT_OFFSET,
1697 .modulemode = MODULEMODE_SWCTRL,
1698 },
1699 },
1700 .opt_clks = mmc2_opt_clks,
1701 .opt_clks_cnt = ARRAY_SIZE(mmc2_opt_clks),
1702};
1703
1704/* mmc3 */
1705static struct omap_hwmod_opt_clk mmc3_opt_clks[] = {
1706 { .role = "clk32k", .clk = "mmc3_clk32k" },
1707};
1708
1709static struct omap_hwmod dra7xx_mmc3_hwmod = {
1710 .name = "mmc3",
1711 .class = &dra7xx_mmc_hwmod_class,
1712 .clkdm_name = "l4per_clkdm",
1713 .main_clk = "mmc3_gfclk_div",
1714 .prcm = {
1715 .omap4 = {
1716 .clkctrl_offs = DRA7XX_CM_L4PER_MMC3_CLKCTRL_OFFSET,
1717 .context_offs = DRA7XX_RM_L4PER_MMC3_CONTEXT_OFFSET,
1718 .modulemode = MODULEMODE_SWCTRL,
1719 },
1720 },
1721 .opt_clks = mmc3_opt_clks,
1722 .opt_clks_cnt = ARRAY_SIZE(mmc3_opt_clks),
1723};
1724
1725/* mmc4 */
1726static struct omap_hwmod_opt_clk mmc4_opt_clks[] = {
1727 { .role = "clk32k", .clk = "mmc4_clk32k" },
1728};
1729
1730static struct omap_hwmod dra7xx_mmc4_hwmod = {
1731 .name = "mmc4",
1732 .class = &dra7xx_mmc_hwmod_class,
1733 .clkdm_name = "l4per_clkdm",
1734 .main_clk = "mmc4_gfclk_div",
1735 .prcm = {
1736 .omap4 = {
1737 .clkctrl_offs = DRA7XX_CM_L4PER_MMC4_CLKCTRL_OFFSET,
1738 .context_offs = DRA7XX_RM_L4PER_MMC4_CONTEXT_OFFSET,
1739 .modulemode = MODULEMODE_SWCTRL,
1740 },
1741 },
1742 .opt_clks = mmc4_opt_clks,
1743 .opt_clks_cnt = ARRAY_SIZE(mmc4_opt_clks),
1744};
1745
1746/*
1747 * 'mpu' class 1327 * 'mpu' class
1748 * 1328 *
1749 */ 1329 */
@@ -1832,7 +1412,7 @@ static struct omap_hwmod dra7xx_ocp2scp3_hwmod = {
1832 * We use a PCIeSS HWMOD class specific reset handler to deassert the hardreset 1412 * We use a PCIeSS HWMOD class specific reset handler to deassert the hardreset
1833 * lines after asserting them. 1413 * lines after asserting them.
1834 */ 1414 */
1835static int dra7xx_pciess_reset(struct omap_hwmod *oh) 1415int dra7xx_pciess_reset(struct omap_hwmod *oh)
1836{ 1416{
1837 int i; 1417 int i;
1838 1418
@@ -2019,7 +1599,6 @@ static struct omap_hwmod_class_sysconfig dra7xx_smartreflex_sysc = {
2019static struct omap_hwmod_class dra7xx_smartreflex_hwmod_class = { 1599static struct omap_hwmod_class dra7xx_smartreflex_hwmod_class = {
2020 .name = "smartreflex", 1600 .name = "smartreflex",
2021 .sysc = &dra7xx_smartreflex_sysc, 1601 .sysc = &dra7xx_smartreflex_sysc,
2022 .rev = 2,
2023}; 1602};
2024 1603
2025/* smartreflex_core */ 1604/* smartreflex_core */
@@ -2375,188 +1954,6 @@ static struct omap_hwmod dra7xx_timer16_hwmod = {
2375 }, 1954 },
2376}; 1955};
2377 1956
2378/*
2379 * 'uart' class
2380 *
2381 */
2382
2383static struct omap_hwmod_class_sysconfig dra7xx_uart_sysc = {
2384 .rev_offs = 0x0050,
2385 .sysc_offs = 0x0054,
2386 .syss_offs = 0x0058,
2387 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
2388 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
2389 SYSS_HAS_RESET_STATUS),
2390 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
2391 SIDLE_SMART_WKUP),
2392 .sysc_fields = &omap_hwmod_sysc_type1,
2393};
2394
2395static struct omap_hwmod_class dra7xx_uart_hwmod_class = {
2396 .name = "uart",
2397 .sysc = &dra7xx_uart_sysc,
2398};
2399
2400/* uart1 */
2401static struct omap_hwmod dra7xx_uart1_hwmod = {
2402 .name = "uart1",
2403 .class = &dra7xx_uart_hwmod_class,
2404 .clkdm_name = "l4per_clkdm",
2405 .main_clk = "uart1_gfclk_mux",
2406 .flags = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP2UART1_FLAGS,
2407 .prcm = {
2408 .omap4 = {
2409 .clkctrl_offs = DRA7XX_CM_L4PER_UART1_CLKCTRL_OFFSET,
2410 .context_offs = DRA7XX_RM_L4PER_UART1_CONTEXT_OFFSET,
2411 .modulemode = MODULEMODE_SWCTRL,
2412 },
2413 },
2414};
2415
2416/* uart2 */
2417static struct omap_hwmod dra7xx_uart2_hwmod = {
2418 .name = "uart2",
2419 .class = &dra7xx_uart_hwmod_class,
2420 .clkdm_name = "l4per_clkdm",
2421 .main_clk = "uart2_gfclk_mux",
2422 .flags = HWMOD_SWSUP_SIDLE_ACT,
2423 .prcm = {
2424 .omap4 = {
2425 .clkctrl_offs = DRA7XX_CM_L4PER_UART2_CLKCTRL_OFFSET,
2426 .context_offs = DRA7XX_RM_L4PER_UART2_CONTEXT_OFFSET,
2427 .modulemode = MODULEMODE_SWCTRL,
2428 },
2429 },
2430};
2431
2432/* uart3 */
2433static struct omap_hwmod dra7xx_uart3_hwmod = {
2434 .name = "uart3",
2435 .class = &dra7xx_uart_hwmod_class,
2436 .clkdm_name = "l4per_clkdm",
2437 .main_clk = "uart3_gfclk_mux",
2438 .flags = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP4UART3_FLAGS,
2439 .prcm = {
2440 .omap4 = {
2441 .clkctrl_offs = DRA7XX_CM_L4PER_UART3_CLKCTRL_OFFSET,
2442 .context_offs = DRA7XX_RM_L4PER_UART3_CONTEXT_OFFSET,
2443 .modulemode = MODULEMODE_SWCTRL,
2444 },
2445 },
2446};
2447
2448/* uart4 */
2449static struct omap_hwmod dra7xx_uart4_hwmod = {
2450 .name = "uart4",
2451 .class = &dra7xx_uart_hwmod_class,
2452 .clkdm_name = "l4per_clkdm",
2453 .main_clk = "uart4_gfclk_mux",
2454 .flags = HWMOD_SWSUP_SIDLE_ACT | DEBUG_OMAP4UART4_FLAGS,
2455 .prcm = {
2456 .omap4 = {
2457 .clkctrl_offs = DRA7XX_CM_L4PER_UART4_CLKCTRL_OFFSET,
2458 .context_offs = DRA7XX_RM_L4PER_UART4_CONTEXT_OFFSET,
2459 .modulemode = MODULEMODE_SWCTRL,
2460 },
2461 },
2462};
2463
2464/* uart5 */
2465static struct omap_hwmod dra7xx_uart5_hwmod = {
2466 .name = "uart5",
2467 .class = &dra7xx_uart_hwmod_class,
2468 .clkdm_name = "l4per_clkdm",
2469 .main_clk = "uart5_gfclk_mux",
2470 .flags = HWMOD_SWSUP_SIDLE_ACT,
2471 .prcm = {
2472 .omap4 = {
2473 .clkctrl_offs = DRA7XX_CM_L4PER_UART5_CLKCTRL_OFFSET,
2474 .context_offs = DRA7XX_RM_L4PER_UART5_CONTEXT_OFFSET,
2475 .modulemode = MODULEMODE_SWCTRL,
2476 },
2477 },
2478};
2479
2480/* uart6 */
2481static struct omap_hwmod dra7xx_uart6_hwmod = {
2482 .name = "uart6",
2483 .class = &dra7xx_uart_hwmod_class,
2484 .clkdm_name = "ipu_clkdm",
2485 .main_clk = "uart6_gfclk_mux",
2486 .flags = HWMOD_SWSUP_SIDLE_ACT,
2487 .prcm = {
2488 .omap4 = {
2489 .clkctrl_offs = DRA7XX_CM_IPU_UART6_CLKCTRL_OFFSET,
2490 .context_offs = DRA7XX_RM_IPU_UART6_CONTEXT_OFFSET,
2491 .modulemode = MODULEMODE_SWCTRL,
2492 },
2493 },
2494};
2495
2496/* uart7 */
2497static struct omap_hwmod dra7xx_uart7_hwmod = {
2498 .name = "uart7",
2499 .class = &dra7xx_uart_hwmod_class,
2500 .clkdm_name = "l4per2_clkdm",
2501 .main_clk = "uart7_gfclk_mux",
2502 .flags = HWMOD_SWSUP_SIDLE_ACT,
2503 .prcm = {
2504 .omap4 = {
2505 .clkctrl_offs = DRA7XX_CM_L4PER2_UART7_CLKCTRL_OFFSET,
2506 .context_offs = DRA7XX_RM_L4PER2_UART7_CONTEXT_OFFSET,
2507 .modulemode = MODULEMODE_SWCTRL,
2508 },
2509 },
2510};
2511
2512/* uart8 */
2513static struct omap_hwmod dra7xx_uart8_hwmod = {
2514 .name = "uart8",
2515 .class = &dra7xx_uart_hwmod_class,
2516 .clkdm_name = "l4per2_clkdm",
2517 .main_clk = "uart8_gfclk_mux",
2518 .flags = HWMOD_SWSUP_SIDLE_ACT,
2519 .prcm = {
2520 .omap4 = {
2521 .clkctrl_offs = DRA7XX_CM_L4PER2_UART8_CLKCTRL_OFFSET,
2522 .context_offs = DRA7XX_RM_L4PER2_UART8_CONTEXT_OFFSET,
2523 .modulemode = MODULEMODE_SWCTRL,
2524 },
2525 },
2526};
2527
2528/* uart9 */
2529static struct omap_hwmod dra7xx_uart9_hwmod = {
2530 .name = "uart9",
2531 .class = &dra7xx_uart_hwmod_class,
2532 .clkdm_name = "l4per2_clkdm",
2533 .main_clk = "uart9_gfclk_mux",
2534 .flags = HWMOD_SWSUP_SIDLE_ACT,
2535 .prcm = {
2536 .omap4 = {
2537 .clkctrl_offs = DRA7XX_CM_L4PER2_UART9_CLKCTRL_OFFSET,
2538 .context_offs = DRA7XX_RM_L4PER2_UART9_CONTEXT_OFFSET,
2539 .modulemode = MODULEMODE_SWCTRL,
2540 },
2541 },
2542};
2543
2544/* uart10 */
2545static struct omap_hwmod dra7xx_uart10_hwmod = {
2546 .name = "uart10",
2547 .class = &dra7xx_uart_hwmod_class,
2548 .clkdm_name = "wkupaon_clkdm",
2549 .main_clk = "uart10_gfclk_mux",
2550 .flags = HWMOD_SWSUP_SIDLE_ACT,
2551 .prcm = {
2552 .omap4 = {
2553 .clkctrl_offs = DRA7XX_CM_WKUPAON_UART10_CLKCTRL_OFFSET,
2554 .context_offs = DRA7XX_RM_WKUPAON_UART10_CONTEXT_OFFSET,
2555 .modulemode = MODULEMODE_SWCTRL,
2556 },
2557 },
2558};
2559
2560/* DES (the 'P' (public) device) */ 1957/* DES (the 'P' (public) device) */
2561static struct omap_hwmod_class_sysconfig dra7xx_des_sysc = { 1958static struct omap_hwmod_class_sysconfig dra7xx_des_sysc = {
2562 .rev_offs = 0x0030, 1959 .rev_offs = 0x0030,
@@ -3113,70 +2510,6 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per1__elm = {
3113 .user = OCP_USER_MPU | OCP_USER_SDMA, 2510 .user = OCP_USER_MPU | OCP_USER_SDMA,
3114}; 2511};
3115 2512
3116/* l4_wkup -> gpio1 */
3117static struct omap_hwmod_ocp_if dra7xx_l4_wkup__gpio1 = {
3118 .master = &dra7xx_l4_wkup_hwmod,
3119 .slave = &dra7xx_gpio1_hwmod,
3120 .clk = "wkupaon_iclk_mux",
3121 .user = OCP_USER_MPU | OCP_USER_SDMA,
3122};
3123
3124/* l4_per1 -> gpio2 */
3125static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio2 = {
3126 .master = &dra7xx_l4_per1_hwmod,
3127 .slave = &dra7xx_gpio2_hwmod,
3128 .clk = "l3_iclk_div",
3129 .user = OCP_USER_MPU | OCP_USER_SDMA,
3130};
3131
3132/* l4_per1 -> gpio3 */
3133static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio3 = {
3134 .master = &dra7xx_l4_per1_hwmod,
3135 .slave = &dra7xx_gpio3_hwmod,
3136 .clk = "l3_iclk_div",
3137 .user = OCP_USER_MPU | OCP_USER_SDMA,
3138};
3139
3140/* l4_per1 -> gpio4 */
3141static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio4 = {
3142 .master = &dra7xx_l4_per1_hwmod,
3143 .slave = &dra7xx_gpio4_hwmod,
3144 .clk = "l3_iclk_div",
3145 .user = OCP_USER_MPU | OCP_USER_SDMA,
3146};
3147
3148/* l4_per1 -> gpio5 */
3149static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio5 = {
3150 .master = &dra7xx_l4_per1_hwmod,
3151 .slave = &dra7xx_gpio5_hwmod,
3152 .clk = "l3_iclk_div",
3153 .user = OCP_USER_MPU | OCP_USER_SDMA,
3154};
3155
3156/* l4_per1 -> gpio6 */
3157static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio6 = {
3158 .master = &dra7xx_l4_per1_hwmod,
3159 .slave = &dra7xx_gpio6_hwmod,
3160 .clk = "l3_iclk_div",
3161 .user = OCP_USER_MPU | OCP_USER_SDMA,
3162};
3163
3164/* l4_per1 -> gpio7 */
3165static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio7 = {
3166 .master = &dra7xx_l4_per1_hwmod,
3167 .slave = &dra7xx_gpio7_hwmod,
3168 .clk = "l3_iclk_div",
3169 .user = OCP_USER_MPU | OCP_USER_SDMA,
3170};
3171
3172/* l4_per1 -> gpio8 */
3173static struct omap_hwmod_ocp_if dra7xx_l4_per1__gpio8 = {
3174 .master = &dra7xx_l4_per1_hwmod,
3175 .slave = &dra7xx_gpio8_hwmod,
3176 .clk = "l3_iclk_div",
3177 .user = OCP_USER_MPU | OCP_USER_SDMA,
3178};
3179
3180/* l3_main_1 -> gpmc */ 2513/* l3_main_1 -> gpmc */
3181static struct omap_hwmod_ocp_if dra7xx_l3_main_1__gpmc = { 2514static struct omap_hwmod_ocp_if dra7xx_l3_main_1__gpmc = {
3182 .master = &dra7xx_l3_main_1_hwmod, 2515 .master = &dra7xx_l3_main_1_hwmod,
@@ -3193,46 +2526,6 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per1__hdq1w = {
3193 .user = OCP_USER_MPU | OCP_USER_SDMA, 2526 .user = OCP_USER_MPU | OCP_USER_SDMA,
3194}; 2527};
3195 2528
3196/* l4_per1 -> i2c1 */
3197static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c1 = {
3198 .master = &dra7xx_l4_per1_hwmod,
3199 .slave = &dra7xx_i2c1_hwmod,
3200 .clk = "l3_iclk_div",
3201 .user = OCP_USER_MPU | OCP_USER_SDMA,
3202};
3203
3204/* l4_per1 -> i2c2 */
3205static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c2 = {
3206 .master = &dra7xx_l4_per1_hwmod,
3207 .slave = &dra7xx_i2c2_hwmod,
3208 .clk = "l3_iclk_div",
3209 .user = OCP_USER_MPU | OCP_USER_SDMA,
3210};
3211
3212/* l4_per1 -> i2c3 */
3213static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c3 = {
3214 .master = &dra7xx_l4_per1_hwmod,
3215 .slave = &dra7xx_i2c3_hwmod,
3216 .clk = "l3_iclk_div",
3217 .user = OCP_USER_MPU | OCP_USER_SDMA,
3218};
3219
3220/* l4_per1 -> i2c4 */
3221static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c4 = {
3222 .master = &dra7xx_l4_per1_hwmod,
3223 .slave = &dra7xx_i2c4_hwmod,
3224 .clk = "l3_iclk_div",
3225 .user = OCP_USER_MPU | OCP_USER_SDMA,
3226};
3227
3228/* l4_per1 -> i2c5 */
3229static struct omap_hwmod_ocp_if dra7xx_l4_per1__i2c5 = {
3230 .master = &dra7xx_l4_per1_hwmod,
3231 .slave = &dra7xx_i2c5_hwmod,
3232 .clk = "l3_iclk_div",
3233 .user = OCP_USER_MPU | OCP_USER_SDMA,
3234};
3235
3236/* l4_cfg -> mailbox1 */ 2529/* l4_cfg -> mailbox1 */
3237static struct omap_hwmod_ocp_if dra7xx_l4_cfg__mailbox1 = { 2530static struct omap_hwmod_ocp_if dra7xx_l4_cfg__mailbox1 = {
3238 .master = &dra7xx_l4_cfg_hwmod, 2531 .master = &dra7xx_l4_cfg_hwmod,
@@ -3369,38 +2662,6 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per1__mcspi4 = {
3369 .user = OCP_USER_MPU | OCP_USER_SDMA, 2662 .user = OCP_USER_MPU | OCP_USER_SDMA,
3370}; 2663};
3371 2664
3372/* l4_per1 -> mmc1 */
3373static struct omap_hwmod_ocp_if dra7xx_l4_per1__mmc1 = {
3374 .master = &dra7xx_l4_per1_hwmod,
3375 .slave = &dra7xx_mmc1_hwmod,
3376 .clk = "l3_iclk_div",
3377 .user = OCP_USER_MPU | OCP_USER_SDMA,
3378};
3379
3380/* l4_per1 -> mmc2 */
3381static struct omap_hwmod_ocp_if dra7xx_l4_per1__mmc2 = {
3382 .master = &dra7xx_l4_per1_hwmod,
3383 .slave = &dra7xx_mmc2_hwmod,
3384 .clk = "l3_iclk_div",
3385 .user = OCP_USER_MPU | OCP_USER_SDMA,
3386};
3387
3388/* l4_per1 -> mmc3 */
3389static struct omap_hwmod_ocp_if dra7xx_l4_per1__mmc3 = {
3390 .master = &dra7xx_l4_per1_hwmod,
3391 .slave = &dra7xx_mmc3_hwmod,
3392 .clk = "l3_iclk_div",
3393 .user = OCP_USER_MPU | OCP_USER_SDMA,
3394};
3395
3396/* l4_per1 -> mmc4 */
3397static struct omap_hwmod_ocp_if dra7xx_l4_per1__mmc4 = {
3398 .master = &dra7xx_l4_per1_hwmod,
3399 .slave = &dra7xx_mmc4_hwmod,
3400 .clk = "l3_iclk_div",
3401 .user = OCP_USER_MPU | OCP_USER_SDMA,
3402};
3403
3404/* l4_cfg -> mpu */ 2665/* l4_cfg -> mpu */
3405static struct omap_hwmod_ocp_if dra7xx_l4_cfg__mpu = { 2666static struct omap_hwmod_ocp_if dra7xx_l4_cfg__mpu = {
3406 .master = &dra7xx_l4_cfg_hwmod, 2667 .master = &dra7xx_l4_cfg_hwmod,
@@ -3633,62 +2894,6 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per3__timer16 = {
3633 .user = OCP_USER_MPU | OCP_USER_SDMA, 2894 .user = OCP_USER_MPU | OCP_USER_SDMA,
3634}; 2895};
3635 2896
3636/* l4_per1 -> uart1 */
3637static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart1 = {
3638 .master = &dra7xx_l4_per1_hwmod,
3639 .slave = &dra7xx_uart1_hwmod,
3640 .clk = "l3_iclk_div",
3641 .user = OCP_USER_MPU | OCP_USER_SDMA,
3642};
3643
3644/* l4_per1 -> uart2 */
3645static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart2 = {
3646 .master = &dra7xx_l4_per1_hwmod,
3647 .slave = &dra7xx_uart2_hwmod,
3648 .clk = "l3_iclk_div",
3649 .user = OCP_USER_MPU | OCP_USER_SDMA,
3650};
3651
3652/* l4_per1 -> uart3 */
3653static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart3 = {
3654 .master = &dra7xx_l4_per1_hwmod,
3655 .slave = &dra7xx_uart3_hwmod,
3656 .clk = "l3_iclk_div",
3657 .user = OCP_USER_MPU | OCP_USER_SDMA,
3658};
3659
3660/* l4_per1 -> uart4 */
3661static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart4 = {
3662 .master = &dra7xx_l4_per1_hwmod,
3663 .slave = &dra7xx_uart4_hwmod,
3664 .clk = "l3_iclk_div",
3665 .user = OCP_USER_MPU | OCP_USER_SDMA,
3666};
3667
3668/* l4_per1 -> uart5 */
3669static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart5 = {
3670 .master = &dra7xx_l4_per1_hwmod,
3671 .slave = &dra7xx_uart5_hwmod,
3672 .clk = "l3_iclk_div",
3673 .user = OCP_USER_MPU | OCP_USER_SDMA,
3674};
3675
3676/* l4_per1 -> uart6 */
3677static struct omap_hwmod_ocp_if dra7xx_l4_per1__uart6 = {
3678 .master = &dra7xx_l4_per1_hwmod,
3679 .slave = &dra7xx_uart6_hwmod,
3680 .clk = "l3_iclk_div",
3681 .user = OCP_USER_MPU | OCP_USER_SDMA,
3682};
3683
3684/* l4_per2 -> uart7 */
3685static struct omap_hwmod_ocp_if dra7xx_l4_per2__uart7 = {
3686 .master = &dra7xx_l4_per2_hwmod,
3687 .slave = &dra7xx_uart7_hwmod,
3688 .clk = "l3_iclk_div",
3689 .user = OCP_USER_MPU | OCP_USER_SDMA,
3690};
3691
3692/* l4_per1 -> des */ 2897/* l4_per1 -> des */
3693static struct omap_hwmod_ocp_if dra7xx_l4_per1__des = { 2898static struct omap_hwmod_ocp_if dra7xx_l4_per1__des = {
3694 .master = &dra7xx_l4_per1_hwmod, 2899 .master = &dra7xx_l4_per1_hwmod,
@@ -3697,30 +2902,6 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per1__des = {
3697 .user = OCP_USER_MPU | OCP_USER_SDMA, 2902 .user = OCP_USER_MPU | OCP_USER_SDMA,
3698}; 2903};
3699 2904
3700/* l4_per2 -> uart8 */
3701static struct omap_hwmod_ocp_if dra7xx_l4_per2__uart8 = {
3702 .master = &dra7xx_l4_per2_hwmod,
3703 .slave = &dra7xx_uart8_hwmod,
3704 .clk = "l3_iclk_div",
3705 .user = OCP_USER_MPU | OCP_USER_SDMA,
3706};
3707
3708/* l4_per2 -> uart9 */
3709static struct omap_hwmod_ocp_if dra7xx_l4_per2__uart9 = {
3710 .master = &dra7xx_l4_per2_hwmod,
3711 .slave = &dra7xx_uart9_hwmod,
3712 .clk = "l3_iclk_div",
3713 .user = OCP_USER_MPU | OCP_USER_SDMA,
3714};
3715
3716/* l4_wkup -> uart10 */
3717static struct omap_hwmod_ocp_if dra7xx_l4_wkup__uart10 = {
3718 .master = &dra7xx_l4_wkup_hwmod,
3719 .slave = &dra7xx_uart10_hwmod,
3720 .clk = "wkupaon_iclk_mux",
3721 .user = OCP_USER_MPU | OCP_USER_SDMA,
3722};
3723
3724/* l4_per1 -> rng */ 2905/* l4_per1 -> rng */
3725static struct omap_hwmod_ocp_if dra7xx_l4_per1__rng = { 2906static struct omap_hwmod_ocp_if dra7xx_l4_per1__rng = {
3726 .master = &dra7xx_l4_per1_hwmod, 2907 .master = &dra7xx_l4_per1_hwmod,
@@ -3866,21 +3047,8 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
3866 &dra7xx_l3_main_1__aes2, 3047 &dra7xx_l3_main_1__aes2,
3867 &dra7xx_l3_main_1__sha0, 3048 &dra7xx_l3_main_1__sha0,
3868 &dra7xx_l4_per1__elm, 3049 &dra7xx_l4_per1__elm,
3869 &dra7xx_l4_wkup__gpio1,
3870 &dra7xx_l4_per1__gpio2,
3871 &dra7xx_l4_per1__gpio3,
3872 &dra7xx_l4_per1__gpio4,
3873 &dra7xx_l4_per1__gpio5,
3874 &dra7xx_l4_per1__gpio6,
3875 &dra7xx_l4_per1__gpio7,
3876 &dra7xx_l4_per1__gpio8,
3877 &dra7xx_l3_main_1__gpmc, 3050 &dra7xx_l3_main_1__gpmc,
3878 &dra7xx_l4_per1__hdq1w, 3051 &dra7xx_l4_per1__hdq1w,
3879 &dra7xx_l4_per1__i2c1,
3880 &dra7xx_l4_per1__i2c2,
3881 &dra7xx_l4_per1__i2c3,
3882 &dra7xx_l4_per1__i2c4,
3883 &dra7xx_l4_per1__i2c5,
3884 &dra7xx_l4_cfg__mailbox1, 3052 &dra7xx_l4_cfg__mailbox1,
3885 &dra7xx_l4_per3__mailbox2, 3053 &dra7xx_l4_per3__mailbox2,
3886 &dra7xx_l4_per3__mailbox3, 3054 &dra7xx_l4_per3__mailbox3,
@@ -3898,10 +3066,6 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
3898 &dra7xx_l4_per1__mcspi2, 3066 &dra7xx_l4_per1__mcspi2,
3899 &dra7xx_l4_per1__mcspi3, 3067 &dra7xx_l4_per1__mcspi3,
3900 &dra7xx_l4_per1__mcspi4, 3068 &dra7xx_l4_per1__mcspi4,
3901 &dra7xx_l4_per1__mmc1,
3902 &dra7xx_l4_per1__mmc2,
3903 &dra7xx_l4_per1__mmc3,
3904 &dra7xx_l4_per1__mmc4,
3905 &dra7xx_l4_cfg__mpu, 3069 &dra7xx_l4_cfg__mpu,
3906 &dra7xx_l4_cfg__ocp2scp1, 3070 &dra7xx_l4_cfg__ocp2scp1,
3907 &dra7xx_l4_cfg__ocp2scp3, 3071 &dra7xx_l4_cfg__ocp2scp3,
@@ -3929,16 +3093,6 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
3929 &dra7xx_l4_per3__timer14, 3093 &dra7xx_l4_per3__timer14,
3930 &dra7xx_l4_per3__timer15, 3094 &dra7xx_l4_per3__timer15,
3931 &dra7xx_l4_per3__timer16, 3095 &dra7xx_l4_per3__timer16,
3932 &dra7xx_l4_per1__uart1,
3933 &dra7xx_l4_per1__uart2,
3934 &dra7xx_l4_per1__uart3,
3935 &dra7xx_l4_per1__uart4,
3936 &dra7xx_l4_per1__uart5,
3937 &dra7xx_l4_per1__uart6,
3938 &dra7xx_l4_per2__uart7,
3939 &dra7xx_l4_per2__uart8,
3940 &dra7xx_l4_per2__uart9,
3941 &dra7xx_l4_wkup__uart10,
3942 &dra7xx_l4_per1__des, 3096 &dra7xx_l4_per1__des,
3943 &dra7xx_l4_per3__usb_otg_ss1, 3097 &dra7xx_l4_per3__usb_otg_ss1,
3944 &dra7xx_l4_per3__usb_otg_ss2, 3098 &dra7xx_l4_per3__usb_otg_ss2,
diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
index debcd88ab971..83230d9ce5ed 100644
--- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -484,7 +484,6 @@ static struct omap_hwmod_class_sysconfig dm81xx_gpio_sysc = {
484static struct omap_hwmod_class dm81xx_gpio_hwmod_class = { 484static struct omap_hwmod_class dm81xx_gpio_hwmod_class = {
485 .name = "gpio", 485 .name = "gpio",
486 .sysc = &dm81xx_gpio_sysc, 486 .sysc = &dm81xx_gpio_sysc,
487 .rev = 2,
488}; 487};
489 488
490static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 489static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
diff --git a/arch/arm/mach-omap2/pm33xx-core.c b/arch/arm/mach-omap2/pm33xx-core.c
index 724cf5774a6c..c93b6efd565f 100644
--- a/arch/arm/mach-omap2/pm33xx-core.c
+++ b/arch/arm/mach-omap2/pm33xx-core.c
@@ -51,10 +51,12 @@ static int amx3_common_init(void)
51 51
52 /* CEFUSE domain can be turned off post bootup */ 52 /* CEFUSE domain can be turned off post bootup */
53 cefuse_pwrdm = pwrdm_lookup("cefuse_pwrdm"); 53 cefuse_pwrdm = pwrdm_lookup("cefuse_pwrdm");
54 if (cefuse_pwrdm) 54 if (!cefuse_pwrdm)
55 omap_set_pwrdm_state(cefuse_pwrdm, PWRDM_POWER_OFF);
56 else
57 pr_err("PM: Failed to get cefuse_pwrdm\n"); 55 pr_err("PM: Failed to get cefuse_pwrdm\n");
56 else if (omap_type() != OMAP2_DEVICE_TYPE_GP)
57 pr_info("PM: Leaving EFUSE power domain active\n");
58 else
59 omap_set_pwrdm_state(cefuse_pwrdm, PWRDM_POWER_OFF);
58 60
59 return 0; 61 return 0;
60} 62}
diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index 0854ed9ff379..248f6d9a1bb3 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -119,7 +119,10 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
119 } 119 }
120 120
121 sr_data->name = oh->name; 121 sr_data->name = oh->name;
122 sr_data->ip_type = oh->class->rev; 122 if (cpu_is_omap343x())
123 sr_data->ip_type = 1;
124 else
125 sr_data->ip_type = 2;
123 sr_data->senn_mod = 0x1; 126 sr_data->senn_mod = 0x1;
124 sr_data->senp_mod = 0x1; 127 sr_data->senp_mod = 0x1;
125 128
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
index 51984a40b097..4675d9202000 100644
--- a/arch/arm/mach-rockchip/platsmp.c
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -245,6 +245,7 @@ static int __init rockchip_smp_prepare_pmu(void)
245 } 245 }
246 246
247 pmu_base = of_iomap(node, 0); 247 pmu_base = of_iomap(node, 0);
248 of_node_put(node);
248 if (!pmu_base) { 249 if (!pmu_base) {
249 pr_err("%s: could not map pmu registers\n", __func__); 250 pr_err("%s: could not map pmu registers\n", __func__);
250 return -ENOMEM; 251 return -ENOMEM;
diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
index 0592534e0b88..065b09e6f1eb 100644
--- a/arch/arm/mach-rockchip/pm.c
+++ b/arch/arm/mach-rockchip/pm.c
@@ -59,7 +59,7 @@ static inline u32 rk3288_l2_config(void)
59 return l2ctlr; 59 return l2ctlr;
60} 60}
61 61
62static void rk3288_config_bootdata(void) 62static void __init rk3288_config_bootdata(void)
63{ 63{
64 rkpm_bootdata_cpusp = rk3288_bootram_phy + (SZ_4K - 8); 64 rkpm_bootdata_cpusp = rk3288_bootram_phy + (SZ_4K - 8);
65 rkpm_bootdata_cpu_code = __pa_symbol(cpu_resume); 65 rkpm_bootdata_cpu_code = __pa_symbol(cpu_resume);
@@ -230,7 +230,7 @@ static void rk3288_suspend_finish(void)
230 pr_err("%s: Suspend finish failed\n", __func__); 230 pr_err("%s: Suspend finish failed\n", __func__);
231} 231}
232 232
233static int rk3288_suspend_init(struct device_node *np) 233static int __init rk3288_suspend_init(struct device_node *np)
234{ 234{
235 struct device_node *sram_np; 235 struct device_node *sram_np;
236 struct resource res; 236 struct resource res;
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410-module.c b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
index 76c4855a03bc..937d0a83f8fd 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410-module.c
@@ -328,6 +328,8 @@ static const struct {
328 int num_i2c_devs; 328 int num_i2c_devs;
329 const struct spi_board_info *spi_devs; 329 const struct spi_board_info *spi_devs;
330 int num_spi_devs; 330 int num_spi_devs;
331
332 struct gpiod_lookup_table *gpiod_table;
331} gf_mods[] = { 333} gf_mods[] = {
332 { .id = 0x01, .rev = 0xff, .name = "1250-EV1 Springbank" }, 334 { .id = 0x01, .rev = 0xff, .name = "1250-EV1 Springbank" },
333 { .id = 0x02, .rev = 0xff, .name = "1251-EV1 Jura" }, 335 { .id = 0x02, .rev = 0xff, .name = "1251-EV1 Jura" },
@@ -362,13 +364,16 @@ static const struct {
362 .i2c_devs = wm1255_devs, .num_i2c_devs = ARRAY_SIZE(wm1255_devs) }, 364 .i2c_devs = wm1255_devs, .num_i2c_devs = ARRAY_SIZE(wm1255_devs) },
363 { .id = 0x3c, .rev = 0xff, .name = "1273-EV1 Longmorn" }, 365 { .id = 0x3c, .rev = 0xff, .name = "1273-EV1 Longmorn" },
364 { .id = 0x3d, .rev = 0xff, .name = "1277-EV1 Littlemill", 366 { .id = 0x3d, .rev = 0xff, .name = "1277-EV1 Littlemill",
365 .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs) }, 367 .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs),
368 .gpiod_table = &wm8994_gpiod_table },
366 { .id = 0x3e, .rev = 0, .name = "WM5102-6271-EV1-CS127 Amrut", 369 { .id = 0x3e, .rev = 0, .name = "WM5102-6271-EV1-CS127 Amrut",
367 .spi_devs = wm5102_reva_spi_devs, 370 .spi_devs = wm5102_reva_spi_devs,
368 .num_spi_devs = ARRAY_SIZE(wm5102_reva_spi_devs) }, 371 .num_spi_devs = ARRAY_SIZE(wm5102_reva_spi_devs),
372 .gpiod_table = &wm5102_reva_gpiod_table },
369 { .id = 0x3e, .rev = -1, .name = "WM5102-6271-EV1-CS127 Amrut", 373 { .id = 0x3e, .rev = -1, .name = "WM5102-6271-EV1-CS127 Amrut",
370 .spi_devs = wm5102_spi_devs, 374 .spi_devs = wm5102_spi_devs,
371 .num_spi_devs = ARRAY_SIZE(wm5102_spi_devs) }, 375 .num_spi_devs = ARRAY_SIZE(wm5102_spi_devs),
376 .gpiod_table = &wm5102_gpiod_table },
372 { .id = 0x3f, .rev = -1, .name = "WM2200-6271-CS90-M-REV1", 377 { .id = 0x3f, .rev = -1, .name = "WM2200-6271-CS90-M-REV1",
373 .i2c_devs = wm2200_i2c, .num_i2c_devs = ARRAY_SIZE(wm2200_i2c) }, 378 .i2c_devs = wm2200_i2c, .num_i2c_devs = ARRAY_SIZE(wm2200_i2c) },
374}; 379};
@@ -408,6 +413,9 @@ static int wlf_gf_module_probe(struct i2c_client *i2c,
408 413
409 spi_register_board_info(gf_mods[i].spi_devs, 414 spi_register_board_info(gf_mods[i].spi_devs,
410 gf_mods[i].num_spi_devs); 415 gf_mods[i].num_spi_devs);
416
417 if (gf_mods[i].gpiod_table)
418 gpiod_add_lookup_table(gf_mods[i].gpiod_table);
411 } else { 419 } else {
412 dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n", 420 dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n",
413 id, rev + 1); 421 id, rev + 1);
diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c
index 8c2a20591524..e84599dd96f1 100644
--- a/arch/arm/mach-shmobile/pm-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c
@@ -72,6 +72,7 @@ void __init rcar_gen2_pm_init(void)
72 } 72 }
73 73
74 error = of_address_to_resource(np, 0, &res); 74 error = of_address_to_resource(np, 0, &res);
75 of_node_put(np);
75 if (error) { 76 if (error) {
76 pr_err("Failed to get smp-sram address: %d\n", error); 77 pr_err("Failed to get smp-sram address: %d\n", error);
77 return; 78 return;
diff --git a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
index dc526ef2e9b3..ee949255ced3 100644
--- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
@@ -1,6 +1,6 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2/* 2/*
3 * R-Car Generation 2 da9063/da9210 regulator quirk 3 * R-Car Generation 2 da9063(L)/da9210 regulator quirk
4 * 4 *
5 * Certain Gen2 development boards have an da9063 and one or more da9210 5 * Certain Gen2 development boards have an da9063 and one or more da9210
6 * regulators. All of these regulators have their interrupt request lines 6 * regulators. All of these regulators have their interrupt request lines
@@ -65,6 +65,7 @@ static struct i2c_msg da9210_msg = {
65 65
66static const struct of_device_id rcar_gen2_quirk_match[] = { 66static const struct of_device_id rcar_gen2_quirk_match[] = {
67 { .compatible = "dlg,da9063", .data = &da9063_msg }, 67 { .compatible = "dlg,da9063", .data = &da9063_msg },
68 { .compatible = "dlg,da9063l", .data = &da9063_msg },
68 { .compatible = "dlg,da9210", .data = &da9210_msg }, 69 { .compatible = "dlg,da9210", .data = &da9210_msg },
69 {}, 70 {},
70}; 71};
@@ -147,6 +148,7 @@ static int __init rcar_gen2_regulator_quirk(void)
147 148
148 if (!of_machine_is_compatible("renesas,koelsch") && 149 if (!of_machine_is_compatible("renesas,koelsch") &&
149 !of_machine_is_compatible("renesas,lager") && 150 !of_machine_is_compatible("renesas,lager") &&
151 !of_machine_is_compatible("renesas,porter") &&
150 !of_machine_is_compatible("renesas,stout") && 152 !of_machine_is_compatible("renesas,stout") &&
151 !of_machine_is_compatible("renesas,gose")) 153 !of_machine_is_compatible("renesas,gose"))
152 return -ENODEV; 154 return -ENODEV;
@@ -210,7 +212,7 @@ static int __init rcar_gen2_regulator_quirk(void)
210 goto err_free; 212 goto err_free;
211 } 213 }
212 214
213 pr_info("IRQ2 is asserted, installing da9063/da9210 regulator quirk\n"); 215 pr_info("IRQ2 is asserted, installing regulator quirk\n");
214 216
215 bus_register_notifier(&i2c_bus_type, &regulator_quirk_nb); 217 bus_register_notifier(&i2c_bus_type, &regulator_quirk_nb);
216 return 0; 218 return 0;
diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig
index 713c068b953f..651bdf4f9c9e 100644
--- a/arch/arm/mach-stm32/Kconfig
+++ b/arch/arm/mach-stm32/Kconfig
@@ -4,6 +4,7 @@ menuconfig ARCH_STM32
4 select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7 4 select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
5 select ARM_GIC if ARCH_MULTI_V7 5 select ARM_GIC if ARCH_MULTI_V7
6 select ARM_PSCI if ARCH_MULTI_V7 6 select ARM_PSCI if ARCH_MULTI_V7
7 select ARM_AMBA
7 select ARCH_HAS_RESET_CONTROLLER 8 select ARCH_HAS_RESET_CONTROLLER
8 select CLKSRC_STM32 9 select CLKSRC_STM32
9 select PINCTRL 10 select PINCTRL
@@ -18,22 +19,18 @@ if ARM_SINGLE_ARMV7M
18 19
19config MACH_STM32F429 20config MACH_STM32F429
20 bool "STMicroelectronics STM32F429" 21 bool "STMicroelectronics STM32F429"
21 select ARM_AMBA
22 default y 22 default y
23 23
24config MACH_STM32F469 24config MACH_STM32F469
25 bool "STMicroelectronics STM32F469" 25 bool "STMicroelectronics STM32F469"
26 select ARM_AMBA
27 default y 26 default y
28 27
29config MACH_STM32F746 28config MACH_STM32F746
30 bool "STMicroelectronics STM32F746" 29 bool "STMicroelectronics STM32F746"
31 select ARM_AMBA
32 default y 30 default y
33 31
34config MACH_STM32F769 32config MACH_STM32F769
35 bool "STMicroelectronics STM32F769" 33 bool "STMicroelectronics STM32F769"
36 select ARM_AMBA
37 default y 34 default y
38 35
39config MACH_STM32H743 36config MACH_STM32H743
diff --git a/arch/arm/mach-sunxi/mc_smp.c b/arch/arm/mach-sunxi/mc_smp.c
index b4037b603897..239084cf8192 100644
--- a/arch/arm/mach-sunxi/mc_smp.c
+++ b/arch/arm/mach-sunxi/mc_smp.c
@@ -89,6 +89,7 @@ static bool sunxi_core_is_cortex_a15(unsigned int core, unsigned int cluster)
89{ 89{
90 struct device_node *node; 90 struct device_node *node;
91 int cpu = cluster * SUNXI_CPUS_PER_CLUSTER + core; 91 int cpu = cluster * SUNXI_CPUS_PER_CLUSTER + core;
92 bool is_compatible;
92 93
93 node = of_cpu_device_node_get(cpu); 94 node = of_cpu_device_node_get(cpu);
94 95
@@ -107,7 +108,9 @@ static bool sunxi_core_is_cortex_a15(unsigned int core, unsigned int cluster)
107 return false; 108 return false;
108 } 109 }
109 110
110 return of_device_is_compatible(node, "arm,cortex-a15"); 111 is_compatible = of_device_is_compatible(node, "arm,cortex-a15");
112 of_node_put(node);
113 return is_compatible;
111} 114}
112 115
113static int sunxi_cpu_power_switch_set(unsigned int cpu, unsigned int cluster, 116static int sunxi_cpu_power_switch_set(unsigned int cpu, unsigned int cluster,
diff --git a/arch/arm/mach-sunxi/platsmp.c b/arch/arm/mach-sunxi/platsmp.c
index 8fb5088464db..bdde9ef3aaa9 100644
--- a/arch/arm/mach-sunxi/platsmp.c
+++ b/arch/arm/mach-sunxi/platsmp.c
@@ -50,6 +50,7 @@ static void __init sun6i_smp_prepare_cpus(unsigned int max_cpus)
50 } 50 }
51 51
52 prcm_membase = of_iomap(node, 0); 52 prcm_membase = of_iomap(node, 0);
53 of_node_put(node);
53 if (!prcm_membase) { 54 if (!prcm_membase) {
54 pr_err("Couldn't map A31 PRCM registers\n"); 55 pr_err("Couldn't map A31 PRCM registers\n");
55 return; 56 return;
@@ -63,6 +64,7 @@ static void __init sun6i_smp_prepare_cpus(unsigned int max_cpus)
63 } 64 }
64 65
65 cpucfg_membase = of_iomap(node, 0); 66 cpucfg_membase = of_iomap(node, 0);
67 of_node_put(node);
66 if (!cpucfg_membase) 68 if (!cpucfg_membase)
67 pr_err("Couldn't map A31 CPU config registers\n"); 69 pr_err("Couldn't map A31 CPU config registers\n");
68 70
@@ -133,6 +135,7 @@ static void __init sun8i_smp_prepare_cpus(unsigned int max_cpus)
133 } 135 }
134 136
135 prcm_membase = of_iomap(node, 0); 137 prcm_membase = of_iomap(node, 0);
138 of_node_put(node);
136 if (!prcm_membase) { 139 if (!prcm_membase) {
137 pr_err("Couldn't map A23 PRCM registers\n"); 140 pr_err("Couldn't map A23 PRCM registers\n");
138 return; 141 return;
@@ -146,6 +149,7 @@ static void __init sun8i_smp_prepare_cpus(unsigned int max_cpus)
146 } 149 }
147 150
148 cpucfg_membase = of_iomap(node, 0); 151 cpucfg_membase = of_iomap(node, 0);
152 of_node_put(node);
149 if (!cpucfg_membase) 153 if (!cpucfg_membase)
150 pr_err("Couldn't map A23 CPU config registers\n"); 154 pr_err("Couldn't map A23 CPU config registers\n");
151 155
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 7f3b83e0d324..63e89e75639b 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -2,7 +2,7 @@
2menuconfig ARCH_TEGRA 2menuconfig ARCH_TEGRA
3 bool "NVIDIA Tegra" 3 bool "NVIDIA Tegra"
4 depends on ARCH_MULTI_V7 4 depends on ARCH_MULTI_V7
5 select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS 5 select ARCH_HAS_RESET_CONTROLLER
6 select ARM_AMBA 6 select ARM_AMBA
7 select ARM_GIC 7 select ARM_GIC
8 select CLKSRC_MMIO 8 select CLKSRC_MMIO
@@ -11,7 +11,6 @@ menuconfig ARCH_TEGRA
11 select HAVE_ARM_TWD if SMP 11 select HAVE_ARM_TWD if SMP
12 select PINCTRL 12 select PINCTRL
13 select PM_OPP 13 select PM_OPP
14 select ARCH_HAS_RESET_CONTROLLER
15 select RESET_CONTROLLER 14 select RESET_CONTROLLER
16 select SOC_BUS 15 select SOC_BUS
17 select ZONE_DMA if ARM_LPAE 16 select ZONE_DMA if ARM_LPAE
diff --git a/arch/arm/mach-tegra/cpuidle-tegra114.c b/arch/arm/mach-tegra/cpuidle-tegra114.c
index e3fbcfedf845..43c695d83f03 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra114.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra114.c
@@ -21,6 +21,8 @@
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/module.h> 22#include <linux/module.h>
23 23
24#include <linux/firmware/trusted_foundations.h>
25
24#include <asm/cpuidle.h> 26#include <asm/cpuidle.h>
25#include <asm/smp_plat.h> 27#include <asm/smp_plat.h>
26#include <asm/suspend.h> 28#include <asm/suspend.h>
@@ -46,7 +48,7 @@ static int tegra114_idle_power_down(struct cpuidle_device *dev,
46 tegra_set_cpu_in_lp2(); 48 tegra_set_cpu_in_lp2();
47 cpu_pm_enter(); 49 cpu_pm_enter();
48 50
49 call_firmware_op(prepare_idle); 51 call_firmware_op(prepare_idle, TF_PM_MODE_LP2_NOFLUSH_L2);
50 52
51 /* Do suspend by ourselves if the firmware does not implement it */ 53 /* Do suspend by ourselves if the firmware does not implement it */
52 if (call_firmware_op(do_idle, 0) == -ENOSYS) 54 if (call_firmware_op(do_idle, 0) == -ENOSYS)
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index 1ad5719779b0..1b0ade06f204 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -27,12 +27,15 @@
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/suspend.h> 28#include <linux/suspend.h>
29 29
30#include <linux/firmware/trusted_foundations.h>
31
30#include <soc/tegra/flowctrl.h> 32#include <soc/tegra/flowctrl.h>
31#include <soc/tegra/fuse.h> 33#include <soc/tegra/fuse.h>
32#include <soc/tegra/pm.h> 34#include <soc/tegra/pm.h>
33#include <soc/tegra/pmc.h> 35#include <soc/tegra/pmc.h>
34 36
35#include <asm/cacheflush.h> 37#include <asm/cacheflush.h>
38#include <asm/firmware.h>
36#include <asm/idmap.h> 39#include <asm/idmap.h>
37#include <asm/proc-fns.h> 40#include <asm/proc-fns.h>
38#include <asm/smp_plat.h> 41#include <asm/smp_plat.h>
@@ -159,6 +162,28 @@ int tegra_cpu_do_idle(void)
159 162
160static int tegra_sleep_cpu(unsigned long v2p) 163static int tegra_sleep_cpu(unsigned long v2p)
161{ 164{
165 /*
166 * L2 cache disabling using kernel API only allowed when all
167 * secondary CPU's are offline. Cache have to be disabled with
168 * MMU-on if cache maintenance is done via Trusted Foundations
169 * firmware. Note that CPUIDLE won't ever enter powergate on Tegra30
170 * if any of secondary CPU's is online and this is the LP2-idle
171 * code-path only for Tegra20/30.
172 */
173 if (trusted_foundations_registered())
174 outer_disable();
175
176 /*
177 * Note that besides of setting up CPU reset vector this firmware
178 * call may also do the following, depending on the FW version:
179 * 1) Disable L2. But this doesn't matter since we already
180 * disabled the L2.
181 * 2) Disable D-cache. This need to be taken into account in
182 * particular by the tegra_disable_clean_inv_dcache() which
183 * shall avoid the re-disable.
184 */
185 call_firmware_op(prepare_idle, TF_PM_MODE_LP2);
186
162 setup_mm_for_reboot(); 187 setup_mm_for_reboot();
163 tegra_sleep_cpu_finish(v2p); 188 tegra_sleep_cpu_finish(v2p);
164 189
@@ -197,6 +222,14 @@ void tegra_idle_lp2_last(void)
197 222
198 cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu); 223 cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, &tegra_sleep_cpu);
199 224
225 /*
226 * Resume L2 cache if it wasn't re-enabled early during resume,
227 * which is the case for Tegra30 that has to re-enable the cache
228 * via firmware call. In other cases cache is already enabled and
229 * hence re-enabling is a no-op. This is always a no-op on Tegra114+.
230 */
231 outer_resume();
232
200 restore_cpu_complex(); 233 restore_cpu_complex();
201 cpu_cluster_pm_exit(); 234 cpu_cluster_pm_exit();
202} 235}
@@ -215,6 +248,15 @@ enum tegra_suspend_mode tegra_pm_validate_suspend_mode(
215 248
216static int tegra_sleep_core(unsigned long v2p) 249static int tegra_sleep_core(unsigned long v2p)
217{ 250{
251 /*
252 * Cache have to be disabled with MMU-on if cache maintenance is done
253 * via Trusted Foundations firmware. This is a no-op on Tegra114+.
254 */
255 if (trusted_foundations_registered())
256 outer_disable();
257
258 call_firmware_op(prepare_idle, TF_PM_MODE_LP1);
259
218 setup_mm_for_reboot(); 260 setup_mm_for_reboot();
219 tegra_sleep_core_finish(v2p); 261 tegra_sleep_core_finish(v2p);
220 262
@@ -342,6 +384,14 @@ static int tegra_suspend_enter(suspend_state_t state)
342 384
343 cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, tegra_sleep_func); 385 cpu_suspend(PHYS_OFFSET - PAGE_OFFSET, tegra_sleep_func);
344 386
387 /*
388 * Resume L2 cache if it wasn't re-enabled early during resume,
389 * which is the case for Tegra30 that has to re-enable the cache
390 * via firmware call. In other cases cache is already enabled and
391 * hence re-enabling is a no-op.
392 */
393 outer_resume();
394
345 switch (mode) { 395 switch (mode) {
346 case TEGRA_SUSPEND_LP1: 396 case TEGRA_SUSPEND_LP1:
347 tegra_suspend_exit_lp1(); 397 tegra_suspend_exit_lp1();
diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index e22ccf87eded..cd94d7c41fc0 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -20,6 +20,7 @@
20#include <soc/tegra/flowctrl.h> 20#include <soc/tegra/flowctrl.h>
21#include <soc/tegra/fuse.h> 21#include <soc/tegra/fuse.h>
22 22
23#include <asm/assembler.h>
23#include <asm/asm-offsets.h> 24#include <asm/asm-offsets.h>
24#include <asm/cache.h> 25#include <asm/cache.h>
25 26
@@ -29,8 +30,6 @@
29 30
30#define PMC_SCRATCH41 0x140 31#define PMC_SCRATCH41 0x140
31 32
32#define RESET_DATA(x) ((TEGRA_RESET_##x)*4)
33
34#ifdef CONFIG_PM_SLEEP 33#ifdef CONFIG_PM_SLEEP
35/* 34/*
36 * tegra_resume 35 * tegra_resume
@@ -78,6 +77,7 @@ ENTRY(tegra_resume)
78 orr r1, r1, #1 77 orr r1, r1, #1
79 str r1, [r0] 78 str r1, [r0]
80#endif 79#endif
80 bl tegra_resume_trusted_foundations
81 81
82#ifdef CONFIG_CACHE_L2X0 82#ifdef CONFIG_CACHE_L2X0
83 /* L2 cache resume & re-enable */ 83 /* L2 cache resume & re-enable */
@@ -90,6 +90,30 @@ end_ca9_scu_l2_resume:
90 90
91 b cpu_resume 91 b cpu_resume
92ENDPROC(tegra_resume) 92ENDPROC(tegra_resume)
93
94/*
95 * tegra_resume_trusted_foundations
96 *
97 * Trusted Foundations firmware initialization.
98 *
99 * Doesn't return if firmware presents.
100 * Corrupted registers: r1, r2
101 */
102ENTRY(tegra_resume_trusted_foundations)
103 /* Check whether Trusted Foundations firmware presents. */
104 mov32 r2, TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET
105 ldr r1, =__tegra_cpu_reset_handler_data_offset + \
106 RESET_DATA(TF_PRESENT)
107 ldr r1, [r2, r1]
108 cmp r1, #0
109 reteq lr
110
111 .arch_extension sec
112 /* First call after suspend wakes firmware. No arguments required. */
113 smc #0
114
115 b cpu_resume
116ENDPROC(tegra_resume_trusted_foundations)
93#endif 117#endif
94 118
95 .align L1_CACHE_SHIFT 119 .align L1_CACHE_SHIFT
@@ -115,12 +139,19 @@ ENTRY(__tegra_cpu_reset_handler_start)
115 * must be position-independent. 139 * must be position-independent.
116 */ 140 */
117 141
142 .arm
118 .align L1_CACHE_SHIFT 143 .align L1_CACHE_SHIFT
119ENTRY(__tegra_cpu_reset_handler) 144ENTRY(__tegra_cpu_reset_handler)
120 145
121 cpsid aif, 0x13 @ SVC mode, interrupts disabled 146 cpsid aif, 0x13 @ SVC mode, interrupts disabled
122 147
123 tegra_get_soc_id TEGRA_APB_MISC_BASE, r6 148 tegra_get_soc_id TEGRA_APB_MISC_BASE, r6
149
150 adr r12, __tegra_cpu_reset_handler_data
151 ldr r5, [r12, #RESET_DATA(TF_PRESENT)]
152 cmp r5, #0
153 bne after_errata
154
124#ifdef CONFIG_ARCH_TEGRA_2x_SOC 155#ifdef CONFIG_ARCH_TEGRA_2x_SOC
125t20_check: 156t20_check:
126 cmp r6, #TEGRA20 157 cmp r6, #TEGRA20
@@ -155,7 +186,6 @@ after_errata:
155 and r10, r10, #0x3 @ R10 = CPU number 186 and r10, r10, #0x3 @ R10 = CPU number
156 mov r11, #1 187 mov r11, #1
157 mov r11, r11, lsl r10 @ R11 = CPU mask 188 mov r11, r11, lsl r10 @ R11 = CPU mask
158 adr r12, __tegra_cpu_reset_handler_data
159 189
160#ifdef CONFIG_SMP 190#ifdef CONFIG_SMP
161 /* Does the OS know about this CPU? */ 191 /* Does the OS know about this CPU? */
@@ -169,10 +199,9 @@ after_errata:
169 cmp r6, #TEGRA20 199 cmp r6, #TEGRA20
170 bne 1f 200 bne 1f
171 /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */ 201 /* If not CPU0, don't let CPU0 reset CPU1 now that CPU1 is coming up. */
172 mov32 r5, TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET
173 mov r0, #CPU_NOT_RESETTABLE 202 mov r0, #CPU_NOT_RESETTABLE
174 cmp r10, #0 203 cmp r10, #0
175 strbne r0, [r5, #__tegra20_cpu1_resettable_status_offset] 204 strbne r0, [r12, #RESET_DATA(RESETTABLE_STATUS)]
1761: 2051:
177#endif 206#endif
178 207
@@ -277,14 +306,13 @@ ENDPROC(__tegra_cpu_reset_handler)
277 .align L1_CACHE_SHIFT 306 .align L1_CACHE_SHIFT
278 .type __tegra_cpu_reset_handler_data, %object 307 .type __tegra_cpu_reset_handler_data, %object
279 .globl __tegra_cpu_reset_handler_data 308 .globl __tegra_cpu_reset_handler_data
309 .globl __tegra_cpu_reset_handler_data_offset
310 .equ __tegra_cpu_reset_handler_data_offset, \
311 . - __tegra_cpu_reset_handler_start
280__tegra_cpu_reset_handler_data: 312__tegra_cpu_reset_handler_data:
281 .rept TEGRA_RESET_DATA_SIZE 313 .rept TEGRA_RESET_DATA_SIZE
282 .long 0 314 .long 0
283 .endr 315 .endr
284 .globl __tegra20_cpu1_resettable_status_offset
285 .equ __tegra20_cpu1_resettable_status_offset, \
286 . - __tegra_cpu_reset_handler_start
287 .byte 0
288 .align L1_CACHE_SHIFT 316 .align L1_CACHE_SHIFT
289 317
290ENTRY(__tegra_cpu_reset_handler_end) 318ENTRY(__tegra_cpu_reset_handler_end)
diff --git a/arch/arm/mach-tegra/reset.c b/arch/arm/mach-tegra/reset.c
index dc558892753c..35dc5d419b6f 100644
--- a/arch/arm/mach-tegra/reset.c
+++ b/arch/arm/mach-tegra/reset.c
@@ -19,6 +19,8 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <linux/firmware/trusted_foundations.h>
23
22#include <soc/tegra/fuse.h> 24#include <soc/tegra/fuse.h>
23 25
24#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
@@ -89,6 +91,8 @@ static void __init tegra_cpu_reset_handler_enable(void)
89 91
90void __init tegra_cpu_reset_handler_init(void) 92void __init tegra_cpu_reset_handler_init(void)
91{ 93{
94 __tegra_cpu_reset_handler_data[TEGRA_RESET_TF_PRESENT] =
95 trusted_foundations_registered();
92 96
93#ifdef CONFIG_SMP 97#ifdef CONFIG_SMP
94 __tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_PRESENT] = 98 __tegra_cpu_reset_handler_data[TEGRA_RESET_MASK_PRESENT] =
diff --git a/arch/arm/mach-tegra/reset.h b/arch/arm/mach-tegra/reset.h
index 9c479c7925b8..db0e6b3097ab 100644
--- a/arch/arm/mach-tegra/reset.h
+++ b/arch/arm/mach-tegra/reset.h
@@ -25,7 +25,11 @@
25#define TEGRA_RESET_STARTUP_SECONDARY 3 25#define TEGRA_RESET_STARTUP_SECONDARY 3
26#define TEGRA_RESET_STARTUP_LP2 4 26#define TEGRA_RESET_STARTUP_LP2 4
27#define TEGRA_RESET_STARTUP_LP1 5 27#define TEGRA_RESET_STARTUP_LP1 5
28#define TEGRA_RESET_DATA_SIZE 6 28#define TEGRA_RESET_RESETTABLE_STATUS 6
29#define TEGRA_RESET_TF_PRESENT 7
30#define TEGRA_RESET_DATA_SIZE 8
31
32#define RESET_DATA(x) ((TEGRA_RESET_##x)*4)
29 33
30#ifndef __ASSEMBLY__ 34#ifndef __ASSEMBLY__
31 35
@@ -49,7 +53,8 @@ void __tegra_cpu_reset_handler_end(void);
49 (u32)__tegra_cpu_reset_handler_start))) 53 (u32)__tegra_cpu_reset_handler_start)))
50#define tegra20_cpu1_resettable_status \ 54#define tegra20_cpu1_resettable_status \
51 (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \ 55 (IO_ADDRESS(TEGRA_IRAM_BASE + TEGRA_IRAM_RESET_HANDLER_OFFSET + \
52 (u32)__tegra20_cpu1_resettable_status_offset)) 56 ((u32)&__tegra_cpu_reset_handler_data[TEGRA_RESET_RESETTABLE_STATUS] - \
57 (u32)__tegra_cpu_reset_handler_start)))
53#endif 58#endif
54 59
55#define tegra_cpu_reset_handler_offset \ 60#define tegra_cpu_reset_handler_offset \
diff --git a/arch/arm/mach-tegra/sleep-tegra20.S b/arch/arm/mach-tegra/sleep-tegra20.S
index dedeebfccc55..50d51d3465f6 100644
--- a/arch/arm/mach-tegra/sleep-tegra20.S
+++ b/arch/arm/mach-tegra/sleep-tegra20.S
@@ -28,6 +28,7 @@
28#include <asm/cache.h> 28#include <asm/cache.h>
29 29
30#include "irammap.h" 30#include "irammap.h"
31#include "reset.h"
31#include "sleep.h" 32#include "sleep.h"
32 33
33#define EMC_CFG 0xc 34#define EMC_CFG 0xc
@@ -53,6 +54,9 @@
53#define APB_MISC_XM2CFGCPADCTRL2 0x8e4 54#define APB_MISC_XM2CFGCPADCTRL2 0x8e4
54#define APB_MISC_XM2CFGDPADCTRL2 0x8e8 55#define APB_MISC_XM2CFGDPADCTRL2 0x8e8
55 56
57#define __tegra20_cpu1_resettable_status_offset \
58 (__tegra_cpu_reset_handler_data_offset + RESET_DATA(RESETTABLE_STATUS))
59
56.macro pll_enable, rd, r_car_base, pll_base 60.macro pll_enable, rd, r_car_base, pll_base
57 ldr \rd, [\r_car_base, #\pll_base] 61 ldr \rd, [\r_car_base, #\pll_base]
58 tst \rd, #(1 << 30) 62 tst \rd, #(1 << 30)
diff --git a/arch/arm/mach-tegra/sleep.S b/arch/arm/mach-tegra/sleep.S
index 5e3496753df1..1735ded5a812 100644
--- a/arch/arm/mach-tegra/sleep.S
+++ b/arch/arm/mach-tegra/sleep.S
@@ -49,8 +49,9 @@ ENTRY(tegra_disable_clean_inv_dcache)
49 49
50 /* Disable the D-cache */ 50 /* Disable the D-cache */
51 mrc p15, 0, r2, c1, c0, 0 51 mrc p15, 0, r2, c1, c0, 0
52 tst r2, #CR_C @ see tegra_sleep_cpu()
52 bic r2, r2, #CR_C 53 bic r2, r2, #CR_C
53 mcr p15, 0, r2, c1, c0, 0 54 mcrne p15, 0, r2, c1, c0, 0
54 isb 55 isb
55 56
56 /* Flush the D-cache */ 57 /* Flush the D-cache */
@@ -132,10 +133,13 @@ ENTRY(tegra_shut_off_mmu)
132#ifdef CONFIG_CACHE_L2X0 133#ifdef CONFIG_CACHE_L2X0
133 /* Disable L2 cache */ 134 /* Disable L2 cache */
134 check_cpu_part_num 0xc09, r9, r10 135 check_cpu_part_num 0xc09, r9, r10
135 movweq r2, #:lower16:(TEGRA_ARM_PERIF_BASE + 0x3000) 136 retne r0
136 movteq r2, #:upper16:(TEGRA_ARM_PERIF_BASE + 0x3000) 137
137 moveq r3, #0 138 mov32 r2, TEGRA_ARM_PERIF_BASE + 0x3000
138 streq r3, [r2, #L2X0_CTRL] 139 ldr r3, [r2, #L2X0_CTRL]
140 tst r3, #L2X0_CTRL_EN @ see tegra_sleep_cpu()
141 mov r3, #0
142 strne r3, [r2, #L2X0_CTRL]
139#endif 143#endif
140 ret r0 144 ret r0
141ENDPROC(tegra_shut_off_mmu) 145ENDPROC(tegra_shut_off_mmu)
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index f9587be48235..3e88f67dd521 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -35,15 +35,17 @@
35#include <linux/sys_soc.h> 35#include <linux/sys_soc.h>
36#include <linux/usb/tegra_usb_phy.h> 36#include <linux/usb/tegra_usb_phy.h>
37 37
38#include <linux/firmware/trusted_foundations.h>
39
38#include <soc/tegra/fuse.h> 40#include <soc/tegra/fuse.h>
39#include <soc/tegra/pmc.h> 41#include <soc/tegra/pmc.h>
40 42
43#include <asm/firmware.h>
41#include <asm/hardware/cache-l2x0.h> 44#include <asm/hardware/cache-l2x0.h>
42#include <asm/mach/arch.h> 45#include <asm/mach/arch.h>
43#include <asm/mach/time.h> 46#include <asm/mach/time.h>
44#include <asm/mach-types.h> 47#include <asm/mach-types.h>
45#include <asm/setup.h> 48#include <asm/setup.h>
46#include <asm/trusted_foundations.h>
47 49
48#include "board.h" 50#include "board.h"
49#include "common.h" 51#include "common.h"
@@ -74,6 +76,7 @@ static void __init tegra_init_early(void)
74{ 76{
75 of_register_trusted_foundations(); 77 of_register_trusted_foundations();
76 tegra_cpu_reset_handler_init(); 78 tegra_cpu_reset_handler_init();
79 call_firmware_op(l2x0_init);
77} 80}
78 81
79static void __init tegra_dt_init_irq(void) 82static void __init tegra_dt_init_irq(void)
diff --git a/arch/arm/mach-u300/regulator.c b/arch/arm/mach-u300/regulator.c
index 595b574c2c50..96ec72bd3928 100644
--- a/arch/arm/mach-u300/regulator.c
+++ b/arch/arm/mach-u300/regulator.c
@@ -130,3 +130,5 @@ static int __init u300_init_boardpower(void)
130} 130}
131 131
132device_initcall(u300_init_boardpower); 132device_initcall(u300_init_boardpower);
133MODULE_LICENSE("GPL v2");
134MODULE_AUTHOR("Linus Walleij");
diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index f51919974183..bf25f780c1c9 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -183,18 +183,12 @@ static int pxa_ssp_probe(struct platform_device *pdev)
183 183
184static int pxa_ssp_remove(struct platform_device *pdev) 184static int pxa_ssp_remove(struct platform_device *pdev)
185{ 185{
186 struct resource *res;
187 struct ssp_device *ssp; 186 struct ssp_device *ssp;
188 187
189 ssp = platform_get_drvdata(pdev); 188 ssp = platform_get_drvdata(pdev);
190 if (ssp == NULL) 189 if (ssp == NULL)
191 return -ENODEV; 190 return -ENODEV;
192 191
193 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
194 release_mem_region(res->start, resource_size(res));
195
196 clk_put(ssp->clk);
197
198 mutex_lock(&ssp_lock); 192 mutex_lock(&ssp_lock);
199 list_del(&ssp->node); 193 list_del(&ssp->node);
200 mutex_unlock(&ssp_lock); 194 mutex_unlock(&ssp_lock);
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
index 7793ebb5d2b8..0a56c0c23ba1 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
@@ -104,7 +104,7 @@
104}; 104};
105 105
106&codec_analog { 106&codec_analog {
107 hpvcc-supply = <&reg_eldo1>; 107 cpvdd-supply = <&reg_eldo1>;
108 status = "okay"; 108 status = "okay";
109}; 109};
110 110
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index c0b9cc7a6b3a..b7ac6374b178 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -80,7 +80,7 @@
80}; 80};
81 81
82&codec_analog { 82&codec_analog {
83 hpvcc-supply = <&reg_eldo1>; 83 cpvdd-supply = <&reg_eldo1>;
84 status = "okay"; 84 status = "okay";
85}; 85};
86 86
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
index d22736a62481..78c82a665c84 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
@@ -94,7 +94,7 @@
94}; 94};
95 95
96&codec_analog { 96&codec_analog {
97 hpvcc-supply = <&reg_eldo1>; 97 cpvdd-supply = <&reg_eldo1>;
98 status = "okay"; 98 status = "okay";
99}; 99};
100 100
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
index d2651f284aa0..9d20e13f0c02 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
@@ -48,7 +48,7 @@
48#include <dt-bindings/gpio/gpio.h> 48#include <dt-bindings/gpio/gpio.h>
49 49
50&codec_analog { 50&codec_analog {
51 hpvcc-supply = <&reg_eldo1>; 51 cpvdd-supply = <&reg_eldo1>;
52}; 52};
53 53
54&mmc0 { 54&mmc0 {
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
index cc6d06c1b2c7..db271b705529 100644
--- a/drivers/ata/pata_ep93xx.c
+++ b/drivers/ata/pata_ep93xx.c
@@ -44,7 +44,7 @@
44#include <linux/ktime.h> 44#include <linux/ktime.h>
45 45
46#include <linux/platform_data/dma-ep93xx.h> 46#include <linux/platform_data/dma-ep93xx.h>
47#include <mach/platform.h> 47#include <linux/soc/cirrus/ep93xx.h>
48 48
49#define DRV_NAME "ep93xx-ide" 49#define DRV_NAME "ep93xx-ide"
50#define DRV_VERSION "1.0" 50#define DRV_VERSION "1.0"
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index d299ec79e4c3..308475ed4b32 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -47,7 +47,10 @@ enum sysc_clocks {
47 SYSC_MAX_CLOCKS, 47 SYSC_MAX_CLOCKS,
48}; 48};
49 49
50static const char * const clock_names[SYSC_ICK + 1] = { "fck", "ick", }; 50static const char * const clock_names[SYSC_MAX_CLOCKS] = {
51 "fck", "ick", "opt0", "opt1", "opt2", "opt3", "opt4",
52 "opt5", "opt6", "opt7",
53};
51 54
52#define SYSC_IDLEMODE_MASK 3 55#define SYSC_IDLEMODE_MASK 3
53#define SYSC_CLOCKACTIVITY_MASK 3 56#define SYSC_CLOCKACTIVITY_MASK 3
@@ -75,6 +78,7 @@ struct sysc {
75 u32 module_size; 78 u32 module_size;
76 void __iomem *module_va; 79 void __iomem *module_va;
77 int offsets[SYSC_MAX_REGS]; 80 int offsets[SYSC_MAX_REGS];
81 struct ti_sysc_module_data *mdata;
78 struct clk **clocks; 82 struct clk **clocks;
79 const char **clock_roles; 83 const char **clock_roles;
80 int nr_clocks; 84 int nr_clocks;
@@ -94,7 +98,7 @@ struct sysc {
94static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np, 98static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,
95 bool is_child); 99 bool is_child);
96 100
97void sysc_write(struct sysc *ddata, int offset, u32 value) 101static void sysc_write(struct sysc *ddata, int offset, u32 value)
98{ 102{
99 writel_relaxed(value, ddata->module_va + offset); 103 writel_relaxed(value, ddata->module_va + offset);
100} 104}
@@ -128,6 +132,81 @@ static u32 sysc_read_revision(struct sysc *ddata)
128 return sysc_read(ddata, offset); 132 return sysc_read(ddata, offset);
129} 133}
130 134
135static int sysc_add_named_clock_from_child(struct sysc *ddata,
136 const char *name,
137 const char *optfck_name)
138{
139 struct device_node *np = ddata->dev->of_node;
140 struct device_node *child;
141 struct clk_lookup *cl;
142 struct clk *clock;
143 const char *n;
144
145 if (name)
146 n = name;
147 else
148 n = optfck_name;
149
150 /* Does the clock alias already exist? */
151 clock = of_clk_get_by_name(np, n);
152 if (!IS_ERR(clock)) {
153 clk_put(clock);
154
155 return 0;
156 }
157
158 child = of_get_next_available_child(np, NULL);
159 if (!child)
160 return -ENODEV;
161
162 clock = devm_get_clk_from_child(ddata->dev, child, name);
163 if (IS_ERR(clock))
164 return PTR_ERR(clock);
165
166 /*
167 * Use clkdev_add() instead of clkdev_alloc() to avoid the MAX_DEV_ID
168 * limit for clk_get(). If cl ever needs to be freed, it should be done
169 * with clkdev_drop().
170 */
171 cl = kcalloc(1, sizeof(*cl), GFP_KERNEL);
172 if (!cl)
173 return -ENOMEM;
174
175 cl->con_id = n;
176 cl->dev_id = dev_name(ddata->dev);
177 cl->clk = clock;
178 clkdev_add(cl);
179
180 clk_put(clock);
181
182 return 0;
183}
184
185static int sysc_init_ext_opt_clock(struct sysc *ddata, const char *name)
186{
187 const char *optfck_name;
188 int error, index;
189
190 if (ddata->nr_clocks < SYSC_OPTFCK0)
191 index = SYSC_OPTFCK0;
192 else
193 index = ddata->nr_clocks;
194
195 if (name)
196 optfck_name = name;
197 else
198 optfck_name = clock_names[index];
199
200 error = sysc_add_named_clock_from_child(ddata, name, optfck_name);
201 if (error)
202 return error;
203
204 ddata->clock_roles[index] = optfck_name;
205 ddata->nr_clocks++;
206
207 return 0;
208}
209
131static int sysc_get_one_clock(struct sysc *ddata, const char *name) 210static int sysc_get_one_clock(struct sysc *ddata, const char *name)
132{ 211{
133 int error, i, index = -ENODEV; 212 int error, i, index = -ENODEV;
@@ -199,6 +278,12 @@ static int sysc_get_clocks(struct sysc *ddata)
199 if (ddata->nr_clocks < 1) 278 if (ddata->nr_clocks < 1)
200 return 0; 279 return 0;
201 280
281 if ((ddata->cfg.quirks & SYSC_QUIRK_EXT_OPT_CLOCK)) {
282 error = sysc_init_ext_opt_clock(ddata, NULL);
283 if (error)
284 return error;
285 }
286
202 if (ddata->nr_clocks > SYSC_MAX_CLOCKS) { 287 if (ddata->nr_clocks > SYSC_MAX_CLOCKS) {
203 dev_err(ddata->dev, "too many clocks for %pOF\n", np); 288 dev_err(ddata->dev, "too many clocks for %pOF\n", np);
204 289
@@ -231,39 +316,125 @@ static int sysc_get_clocks(struct sysc *ddata)
231 return 0; 316 return 0;
232} 317}
233 318
319static int sysc_enable_main_clocks(struct sysc *ddata)
320{
321 struct clk *clock;
322 int i, error;
323
324 if (!ddata->clocks)
325 return 0;
326
327 for (i = 0; i < SYSC_OPTFCK0; i++) {
328 clock = ddata->clocks[i];
329
330 /* Main clocks may not have ick */
331 if (IS_ERR_OR_NULL(clock))
332 continue;
333
334 error = clk_enable(clock);
335 if (error)
336 goto err_disable;
337 }
338
339 return 0;
340
341err_disable:
342 for (i--; i >= 0; i--) {
343 clock = ddata->clocks[i];
344
345 /* Main clocks may not have ick */
346 if (IS_ERR_OR_NULL(clock))
347 continue;
348
349 clk_disable(clock);
350 }
351
352 return error;
353}
354
355static void sysc_disable_main_clocks(struct sysc *ddata)
356{
357 struct clk *clock;
358 int i;
359
360 if (!ddata->clocks)
361 return;
362
363 for (i = 0; i < SYSC_OPTFCK0; i++) {
364 clock = ddata->clocks[i];
365 if (IS_ERR_OR_NULL(clock))
366 continue;
367
368 clk_disable(clock);
369 }
370}
371
372static int sysc_enable_opt_clocks(struct sysc *ddata)
373{
374 struct clk *clock;
375 int i, error;
376
377 if (!ddata->clocks)
378 return 0;
379
380 for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) {
381 clock = ddata->clocks[i];
382
383 /* Assume no holes for opt clocks */
384 if (IS_ERR_OR_NULL(clock))
385 return 0;
386
387 error = clk_enable(clock);
388 if (error)
389 goto err_disable;
390 }
391
392 return 0;
393
394err_disable:
395 for (i--; i >= 0; i--) {
396 clock = ddata->clocks[i];
397 if (IS_ERR_OR_NULL(clock))
398 continue;
399
400 clk_disable(clock);
401 }
402
403 return error;
404}
405
406static void sysc_disable_opt_clocks(struct sysc *ddata)
407{
408 struct clk *clock;
409 int i;
410
411 if (!ddata->clocks)
412 return;
413
414 for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) {
415 clock = ddata->clocks[i];
416
417 /* Assume no holes for opt clocks */
418 if (IS_ERR_OR_NULL(clock))
419 return;
420
421 clk_disable(clock);
422 }
423}
424
234/** 425/**
235 * sysc_init_resets - reset module on init 426 * sysc_init_resets - init rstctrl reset line if configured
236 * @ddata: device driver data 427 * @ddata: device driver data
237 * 428 *
238 * A module can have both OCP softreset control and external rstctrl. 429 * See sysc_rstctrl_reset_deassert().
239 * If more complicated rstctrl resets are needed, please handle these
240 * directly from the child device driver and map only the module reset
241 * for the parent interconnect target module device.
242 *
243 * Automatic reset of the module on init can be skipped with the
244 * "ti,no-reset-on-init" device tree property.
245 */ 430 */
246static int sysc_init_resets(struct sysc *ddata) 431static int sysc_init_resets(struct sysc *ddata)
247{ 432{
248 int error;
249
250 ddata->rsts = 433 ddata->rsts =
251 devm_reset_control_array_get_optional_exclusive(ddata->dev); 434 devm_reset_control_array_get_optional_exclusive(ddata->dev);
252 if (IS_ERR(ddata->rsts)) 435 if (IS_ERR(ddata->rsts))
253 return PTR_ERR(ddata->rsts); 436 return PTR_ERR(ddata->rsts);
254 437
255 if (ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)
256 goto deassert;
257
258 error = reset_control_assert(ddata->rsts);
259 if (error)
260 return error;
261
262deassert:
263 error = reset_control_deassert(ddata->rsts);
264 if (error)
265 return error;
266
267 return 0; 438 return 0;
268} 439}
269 440
@@ -622,91 +793,239 @@ static void sysc_show_registers(struct sysc *ddata)
622 buf); 793 buf);
623} 794}
624 795
625static int __maybe_unused sysc_runtime_suspend(struct device *dev) 796#define SYSC_IDLE_MASK (SYSC_NR_IDLEMODES - 1)
797
798static int sysc_enable_module(struct device *dev)
626{ 799{
627 struct ti_sysc_platform_data *pdata;
628 struct sysc *ddata; 800 struct sysc *ddata;
629 int error = 0, i; 801 const struct sysc_regbits *regbits;
802 u32 reg, idlemodes, best_mode;
630 803
631 ddata = dev_get_drvdata(dev); 804 ddata = dev_get_drvdata(dev);
805 if (ddata->offsets[SYSC_SYSCONFIG] == -ENODEV)
806 return 0;
632 807
633 if (!ddata->enabled) 808 /*
809 * TODO: Need to prevent clockdomain autoidle?
810 * See clkdm_deny_idle() in arch/mach-omap2/omap_hwmod.c
811 */
812
813 regbits = ddata->cap->regbits;
814 reg = sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
815
816 /* Set SIDLE mode */
817 idlemodes = ddata->cfg.sidlemodes;
818 if (!idlemodes || regbits->sidle_shift < 0)
819 goto set_midle;
820
821 best_mode = fls(ddata->cfg.sidlemodes) - 1;
822 if (best_mode > SYSC_IDLE_MASK) {
823 dev_err(dev, "%s: invalid sidlemode\n", __func__);
824 return -EINVAL;
825 }
826
827 reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift);
828 reg |= best_mode << regbits->sidle_shift;
829 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);
830
831set_midle:
832 /* Set MIDLE mode */
833 idlemodes = ddata->cfg.midlemodes;
834 if (!idlemodes || regbits->midle_shift < 0)
634 return 0; 835 return 0;
635 836
636 if (ddata->legacy_mode) { 837 best_mode = fls(ddata->cfg.midlemodes) - 1;
637 pdata = dev_get_platdata(ddata->dev); 838 if (best_mode > SYSC_IDLE_MASK) {
638 if (!pdata) 839 dev_err(dev, "%s: invalid midlemode\n", __func__);
639 return 0; 840 return -EINVAL;
841 }
640 842
641 if (!pdata->idle_module) 843 reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift);
642 return -ENODEV; 844 reg |= best_mode << regbits->midle_shift;
845 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);
643 846
644 error = pdata->idle_module(dev, &ddata->cookie); 847 return 0;
645 if (error) 848}
646 dev_err(dev, "%s: could not idle: %i\n", 849
647 __func__, error); 850static int sysc_best_idle_mode(u32 idlemodes, u32 *best_mode)
851{
852 if (idlemodes & BIT(SYSC_IDLE_SMART_WKUP))
853 *best_mode = SYSC_IDLE_SMART_WKUP;
854 else if (idlemodes & BIT(SYSC_IDLE_SMART))
855 *best_mode = SYSC_IDLE_SMART;
856 else if (idlemodes & SYSC_IDLE_FORCE)
857 *best_mode = SYSC_IDLE_FORCE;
858 else
859 return -EINVAL;
860
861 return 0;
862}
863
864static int sysc_disable_module(struct device *dev)
865{
866 struct sysc *ddata;
867 const struct sysc_regbits *regbits;
868 u32 reg, idlemodes, best_mode;
869 int ret;
648 870
649 goto idled; 871 ddata = dev_get_drvdata(dev);
872 if (ddata->offsets[SYSC_SYSCONFIG] == -ENODEV)
873 return 0;
874
875 /*
876 * TODO: Need to prevent clockdomain autoidle?
877 * See clkdm_deny_idle() in arch/mach-omap2/omap_hwmod.c
878 */
879
880 regbits = ddata->cap->regbits;
881 reg = sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]);
882
883 /* Set MIDLE mode */
884 idlemodes = ddata->cfg.midlemodes;
885 if (!idlemodes || regbits->midle_shift < 0)
886 goto set_sidle;
887
888 ret = sysc_best_idle_mode(idlemodes, &best_mode);
889 if (ret) {
890 dev_err(dev, "%s: invalid midlemode\n", __func__);
891 return ret;
650 } 892 }
651 893
652 for (i = 0; i < ddata->nr_clocks; i++) { 894 reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift);
653 if (IS_ERR_OR_NULL(ddata->clocks[i])) 895 reg |= best_mode << regbits->midle_shift;
654 continue; 896 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);
655 897
656 if (i >= SYSC_OPTFCK0 && !sysc_opt_clks_needed(ddata)) 898set_sidle:
657 break; 899 /* Set SIDLE mode */
900 idlemodes = ddata->cfg.sidlemodes;
901 if (!idlemodes || regbits->sidle_shift < 0)
902 return 0;
658 903
659 clk_disable(ddata->clocks[i]); 904 ret = sysc_best_idle_mode(idlemodes, &best_mode);
905 if (ret) {
906 dev_err(dev, "%s: invalid sidlemode\n", __func__);
907 return ret;
660 } 908 }
661 909
662idled: 910 reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift);
663 ddata->enabled = false; 911 reg |= best_mode << regbits->sidle_shift;
912 sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg);
664 913
665 return error; 914 return 0;
666} 915}
667 916
668static int __maybe_unused sysc_runtime_resume(struct device *dev) 917static int __maybe_unused sysc_runtime_suspend_legacy(struct device *dev,
918 struct sysc *ddata)
669{ 919{
670 struct ti_sysc_platform_data *pdata; 920 struct ti_sysc_platform_data *pdata;
921 int error;
922
923 pdata = dev_get_platdata(ddata->dev);
924 if (!pdata)
925 return 0;
926
927 if (!pdata->idle_module)
928 return -ENODEV;
929
930 error = pdata->idle_module(dev, &ddata->cookie);
931 if (error)
932 dev_err(dev, "%s: could not idle: %i\n",
933 __func__, error);
934
935 return 0;
936}
937
938static int __maybe_unused sysc_runtime_resume_legacy(struct device *dev,
939 struct sysc *ddata)
940{
941 struct ti_sysc_platform_data *pdata;
942 int error;
943
944 pdata = dev_get_platdata(ddata->dev);
945 if (!pdata)
946 return 0;
947
948 if (!pdata->enable_module)
949 return -ENODEV;
950
951 error = pdata->enable_module(dev, &ddata->cookie);
952 if (error)
953 dev_err(dev, "%s: could not enable: %i\n",
954 __func__, error);
955
956 return 0;
957}
958
959static int __maybe_unused sysc_runtime_suspend(struct device *dev)
960{
671 struct sysc *ddata; 961 struct sysc *ddata;
672 int error = 0, i; 962 int error = 0;
673 963
674 ddata = dev_get_drvdata(dev); 964 ddata = dev_get_drvdata(dev);
675 965
676 if (ddata->enabled) 966 if (!ddata->enabled)
677 return 0; 967 return 0;
678 968
679 if (ddata->legacy_mode) { 969 if (ddata->legacy_mode) {
680 pdata = dev_get_platdata(ddata->dev); 970 error = sysc_runtime_suspend_legacy(dev, ddata);
681 if (!pdata) 971 if (error)
682 return 0; 972 return error;
973 } else {
974 error = sysc_disable_module(dev);
975 if (error)
976 return error;
977 }
683 978
684 if (!pdata->enable_module) 979 sysc_disable_main_clocks(ddata);
685 return -ENODEV;
686 980
687 error = pdata->enable_module(dev, &ddata->cookie); 981 if (sysc_opt_clks_needed(ddata))
688 if (error) 982 sysc_disable_opt_clocks(ddata);
689 dev_err(dev, "%s: could not enable: %i\n",
690 __func__, error);
691 983
692 goto awake; 984 ddata->enabled = false;
693 }
694 985
695 for (i = 0; i < ddata->nr_clocks; i++) { 986 return error;
696 if (IS_ERR_OR_NULL(ddata->clocks[i])) 987}
697 continue;
698 988
699 if (i >= SYSC_OPTFCK0 && !sysc_opt_clks_needed(ddata)) 989static int __maybe_unused sysc_runtime_resume(struct device *dev)
700 break; 990{
991 struct sysc *ddata;
992 int error = 0;
993
994 ddata = dev_get_drvdata(dev);
701 995
702 error = clk_enable(ddata->clocks[i]); 996 if (ddata->enabled)
997 return 0;
998
999 if (sysc_opt_clks_needed(ddata)) {
1000 error = sysc_enable_opt_clocks(ddata);
703 if (error) 1001 if (error)
704 return error; 1002 return error;
705 } 1003 }
706 1004
707awake: 1005 error = sysc_enable_main_clocks(ddata);
1006 if (error)
1007 goto err_opt_clocks;
1008
1009 if (ddata->legacy_mode) {
1010 error = sysc_runtime_resume_legacy(dev, ddata);
1011 if (error)
1012 goto err_main_clocks;
1013 } else {
1014 error = sysc_enable_module(dev);
1015 if (error)
1016 goto err_main_clocks;
1017 }
1018
708 ddata->enabled = true; 1019 ddata->enabled = true;
709 1020
1021 return 0;
1022
1023err_main_clocks:
1024 sysc_disable_main_clocks(ddata);
1025err_opt_clocks:
1026 if (sysc_opt_clks_needed(ddata))
1027 sysc_disable_opt_clocks(ddata);
1028
710 return error; 1029 return error;
711} 1030}
712 1031
@@ -788,12 +1107,17 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
788 SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x4fff1301, 0xffff00ff, 1107 SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x4fff1301, 0xffff00ff,
789 0), 1108 0),
790 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff, 1109 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff,
791 SYSC_QUIRK_LEGACY_IDLE), 1110 SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
792 /* Uarts on omap4 and later */ 1111 /* Uarts on omap4 and later */
793 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x50411e03, 0xffff00ff, 1112 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x50411e03, 0xffff00ff,
794 SYSC_QUIRK_LEGACY_IDLE), 1113 SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
795 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47422e03, 0xffffffff, 1114 SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x47422e03, 0xffffffff,
796 SYSC_QUIRK_LEGACY_IDLE), 1115 SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE),
1116
1117 /* Quirks that need to be set based on the module address */
1118 SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -1, 0x50000800, 0xffffffff,
1119 SYSC_QUIRK_EXT_OPT_CLOCK | SYSC_QUIRK_NO_RESET_ON_INIT |
1120 SYSC_QUIRK_SWSUP_SIDLE),
797 1121
798#ifdef DEBUG 1122#ifdef DEBUG
799 SYSC_QUIRK("adc", 0, 0, 0x10, -1, 0x47300001, 0xffffffff, 0), 1123 SYSC_QUIRK("adc", 0, 0, 0x10, -1, 0x47300001, 0xffffffff, 0),
@@ -805,6 +1129,7 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
805 0xffff00f0, 0), 1129 0xffff00f0, 0),
806 SYSC_QUIRK("dcan", 0, 0, -1, -1, 0xffffffff, 0xffffffff, 0), 1130 SYSC_QUIRK("dcan", 0, 0, -1, -1, 0xffffffff, 0xffffffff, 0),
807 SYSC_QUIRK("dcan", 0, 0, -1, -1, 0x00001401, 0xffffffff, 0), 1131 SYSC_QUIRK("dcan", 0, 0, -1, -1, 0x00001401, 0xffffffff, 0),
1132 SYSC_QUIRK("dmic", 0, 0, 0x10, -1, 0x50010000, 0xffffffff, 0),
808 SYSC_QUIRK("dwc3", 0, 0, 0x10, -1, 0x500a0200, 0xffffffff, 0), 1133 SYSC_QUIRK("dwc3", 0, 0, 0x10, -1, 0x500a0200, 0xffffffff, 0),
809 SYSC_QUIRK("epwmss", 0, 0, 0x4, -1, 0x47400001, 0xffffffff, 0), 1134 SYSC_QUIRK("epwmss", 0, 0, 0x4, -1, 0x47400001, 0xffffffff, 0),
810 SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -1, 0, 0, 0), 1135 SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -1, 0, 0, 0),
@@ -853,6 +1178,42 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {
853#endif 1178#endif
854}; 1179};
855 1180
1181/*
1182 * Early quirks based on module base and register offsets only that are
1183 * needed before the module revision can be read
1184 */
1185static void sysc_init_early_quirks(struct sysc *ddata)
1186{
1187 const struct sysc_revision_quirk *q;
1188 int i;
1189
1190 for (i = 0; i < ARRAY_SIZE(sysc_revision_quirks); i++) {
1191 q = &sysc_revision_quirks[i];
1192
1193 if (!q->base)
1194 continue;
1195
1196 if (q->base != ddata->module_pa)
1197 continue;
1198
1199 if (q->rev_offset >= 0 &&
1200 q->rev_offset != ddata->offsets[SYSC_REVISION])
1201 continue;
1202
1203 if (q->sysc_offset >= 0 &&
1204 q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG])
1205 continue;
1206
1207 if (q->syss_offset >= 0 &&
1208 q->syss_offset != ddata->offsets[SYSC_SYSSTATUS])
1209 continue;
1210
1211 ddata->name = q->name;
1212 ddata->cfg.quirks |= q->quirks;
1213 }
1214}
1215
1216/* Quirks that also consider the revision register value */
856static void sysc_init_revision_quirks(struct sysc *ddata) 1217static void sysc_init_revision_quirks(struct sysc *ddata)
857{ 1218{
858 const struct sysc_revision_quirk *q; 1219 const struct sysc_revision_quirk *q;
@@ -885,6 +1246,55 @@ static void sysc_init_revision_quirks(struct sysc *ddata)
885 } 1246 }
886} 1247}
887 1248
1249/*
1250 * Note that pdata->init_module() typically does a reset first. After
1251 * pdata->init_module() is done, PM runtime can be used for the interconnect
1252 * target module.
1253 */
1254static int sysc_legacy_init(struct sysc *ddata)
1255{
1256 struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev);
1257 int error;
1258
1259 if (!ddata->legacy_mode || !pdata || !pdata->init_module)
1260 return 0;
1261
1262 error = pdata->init_module(ddata->dev, ddata->mdata, &ddata->cookie);
1263 if (error == -EEXIST)
1264 error = 0;
1265
1266 return error;
1267}
1268
1269/**
1270 * sysc_rstctrl_reset_deassert - deassert rstctrl reset
1271 * @ddata: device driver data
1272 * @reset: reset before deassert
1273 *
1274 * A module can have both OCP softreset control and external rstctrl.
1275 * If more complicated rstctrl resets are needed, please handle these
1276 * directly from the child device driver and map only the module reset
1277 * for the parent interconnect target module device.
1278 *
1279 * Automatic reset of the module on init can be skipped with the
1280 * "ti,no-reset-on-init" device tree property.
1281 */
1282static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset)
1283{
1284 int error;
1285
1286 if (!ddata->rsts)
1287 return 0;
1288
1289 if (reset) {
1290 error = reset_control_assert(ddata->rsts);
1291 if (error)
1292 return error;
1293 }
1294
1295 return reset_control_deassert(ddata->rsts);
1296}
1297
888static int sysc_reset(struct sysc *ddata) 1298static int sysc_reset(struct sysc *ddata)
889{ 1299{
890 int offset = ddata->offsets[SYSC_SYSCONFIG]; 1300 int offset = ddata->offsets[SYSC_SYSCONFIG];
@@ -915,38 +1325,58 @@ static int sysc_reset(struct sysc *ddata)
915 100, MAX_MODULE_SOFTRESET_WAIT); 1325 100, MAX_MODULE_SOFTRESET_WAIT);
916} 1326}
917 1327
918/* At this point the module is configured enough to read the revision */ 1328/*
1329 * At this point the module is configured enough to read the revision but
1330 * module may not be completely configured yet to use PM runtime. Enable
1331 * all clocks directly during init to configure the quirks needed for PM
1332 * runtime based on the revision register.
1333 */
919static int sysc_init_module(struct sysc *ddata) 1334static int sysc_init_module(struct sysc *ddata)
920{ 1335{
921 int error; 1336 int error = 0;
1337 bool manage_clocks = true;
1338 bool reset = true;
922 1339
923 if (ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE_ON_INIT) { 1340 if (ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT)
924 ddata->revision = sysc_read_revision(ddata); 1341 reset = false;
925 goto rev_quirks;
926 }
927 1342
928 error = pm_runtime_get_sync(ddata->dev); 1343 error = sysc_rstctrl_reset_deassert(ddata, reset);
929 if (error < 0) { 1344 if (error)
930 pm_runtime_put_noidle(ddata->dev); 1345 return error;
931 1346
932 return 0; 1347 if (ddata->cfg.quirks &
933 } 1348 (SYSC_QUIRK_NO_IDLE | SYSC_QUIRK_NO_IDLE_ON_INIT))
1349 manage_clocks = false;
934 1350
935 error = sysc_reset(ddata); 1351 if (manage_clocks) {
936 if (error) { 1352 error = sysc_enable_opt_clocks(ddata);
937 dev_err(ddata->dev, "Reset failed with %d\n", error); 1353 if (error)
938 pm_runtime_put_sync(ddata->dev); 1354 return error;
939 1355
940 return error; 1356 error = sysc_enable_main_clocks(ddata);
1357 if (error)
1358 goto err_opt_clocks;
941 } 1359 }
942 1360
943 ddata->revision = sysc_read_revision(ddata); 1361 ddata->revision = sysc_read_revision(ddata);
944 pm_runtime_put_sync(ddata->dev);
945
946rev_quirks:
947 sysc_init_revision_quirks(ddata); 1362 sysc_init_revision_quirks(ddata);
948 1363
949 return 0; 1364 error = sysc_legacy_init(ddata);
1365 if (error)
1366 goto err_main_clocks;
1367
1368 error = sysc_reset(ddata);
1369 if (error)
1370 dev_err(ddata->dev, "Reset failed with %d\n", error);
1371
1372err_main_clocks:
1373 if (manage_clocks)
1374 sysc_disable_main_clocks(ddata);
1375err_opt_clocks:
1376 if (manage_clocks)
1377 sysc_disable_opt_clocks(ddata);
1378
1379 return error;
950} 1380}
951 1381
952static int sysc_init_sysc_mask(struct sysc *ddata) 1382static int sysc_init_sysc_mask(struct sysc *ddata)
@@ -1208,7 +1638,7 @@ static int sysc_child_resume_noirq(struct device *dev)
1208} 1638}
1209#endif 1639#endif
1210 1640
1211struct dev_pm_domain sysc_child_pm_domain = { 1641static struct dev_pm_domain sysc_child_pm_domain = {
1212 .ops = { 1642 .ops = {
1213 SET_RUNTIME_PM_OPS(sysc_child_runtime_suspend, 1643 SET_RUNTIME_PM_OPS(sysc_child_runtime_suspend,
1214 sysc_child_runtime_resume, 1644 sysc_child_runtime_resume,
@@ -1281,6 +1711,8 @@ static const struct sysc_dts_quirk sysc_dts_quirks[] = {
1281 .mask = SYSC_QUIRK_NO_IDLE_ON_INIT, }, 1711 .mask = SYSC_QUIRK_NO_IDLE_ON_INIT, },
1282 { .name = "ti,no-reset-on-init", 1712 { .name = "ti,no-reset-on-init",
1283 .mask = SYSC_QUIRK_NO_RESET_ON_INIT, }, 1713 .mask = SYSC_QUIRK_NO_RESET_ON_INIT, },
1714 { .name = "ti,no-idle",
1715 .mask = SYSC_QUIRK_NO_IDLE, },
1284}; 1716};
1285 1717
1286static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np, 1718static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,
@@ -1331,6 +1763,9 @@ static void sysc_unprepare(struct sysc *ddata)
1331{ 1763{
1332 int i; 1764 int i;
1333 1765
1766 if (!ddata->clocks)
1767 return;
1768
1334 for (i = 0; i < SYSC_MAX_CLOCKS; i++) { 1769 for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
1335 if (!IS_ERR_OR_NULL(ddata->clocks[i])) 1770 if (!IS_ERR_OR_NULL(ddata->clocks[i]))
1336 clk_unprepare(ddata->clocks[i]); 1771 clk_unprepare(ddata->clocks[i]);
@@ -1576,28 +2011,26 @@ static const struct sysc_capabilities sysc_dra7_mcan = {
1576static int sysc_init_pdata(struct sysc *ddata) 2011static int sysc_init_pdata(struct sysc *ddata)
1577{ 2012{
1578 struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); 2013 struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev);
1579 struct ti_sysc_module_data mdata; 2014 struct ti_sysc_module_data *mdata;
1580 int error = 0;
1581 2015
1582 if (!pdata || !ddata->legacy_mode) 2016 if (!pdata || !ddata->legacy_mode)
1583 return 0; 2017 return 0;
1584 2018
1585 mdata.name = ddata->legacy_mode; 2019 mdata = devm_kzalloc(ddata->dev, sizeof(*mdata), GFP_KERNEL);
1586 mdata.module_pa = ddata->module_pa; 2020 if (!mdata)
1587 mdata.module_size = ddata->module_size; 2021 return -ENOMEM;
1588 mdata.offsets = ddata->offsets;
1589 mdata.nr_offsets = SYSC_MAX_REGS;
1590 mdata.cap = ddata->cap;
1591 mdata.cfg = &ddata->cfg;
1592 2022
1593 if (!pdata->init_module) 2023 mdata->name = ddata->legacy_mode;
1594 return -ENODEV; 2024 mdata->module_pa = ddata->module_pa;
2025 mdata->module_size = ddata->module_size;
2026 mdata->offsets = ddata->offsets;
2027 mdata->nr_offsets = SYSC_MAX_REGS;
2028 mdata->cap = ddata->cap;
2029 mdata->cfg = &ddata->cfg;
1595 2030
1596 error = pdata->init_module(ddata->dev, &mdata, &ddata->cookie); 2031 ddata->mdata = mdata;
1597 if (error == -EEXIST)
1598 error = 0;
1599 2032
1600 return error; 2033 return 0;
1601} 2034}
1602 2035
1603static int sysc_init_match(struct sysc *ddata) 2036static int sysc_init_match(struct sysc *ddata)
@@ -1651,10 +2084,6 @@ static int sysc_probe(struct platform_device *pdev)
1651 if (error) 2084 if (error)
1652 goto unprepare; 2085 goto unprepare;
1653 2086
1654 error = sysc_get_clocks(ddata);
1655 if (error)
1656 return error;
1657
1658 error = sysc_map_and_check_registers(ddata); 2087 error = sysc_map_and_check_registers(ddata);
1659 if (error) 2088 if (error)
1660 goto unprepare; 2089 goto unprepare;
@@ -1675,15 +2104,21 @@ static int sysc_probe(struct platform_device *pdev)
1675 if (error) 2104 if (error)
1676 goto unprepare; 2105 goto unprepare;
1677 2106
2107 sysc_init_early_quirks(ddata);
2108
2109 error = sysc_get_clocks(ddata);
2110 if (error)
2111 return error;
2112
1678 error = sysc_init_resets(ddata); 2113 error = sysc_init_resets(ddata);
1679 if (error) 2114 if (error)
1680 return error; 2115 return error;
1681 2116
1682 pm_runtime_enable(ddata->dev);
1683 error = sysc_init_module(ddata); 2117 error = sysc_init_module(ddata);
1684 if (error) 2118 if (error)
1685 goto unprepare; 2119 goto unprepare;
1686 2120
2121 pm_runtime_enable(ddata->dev);
1687 error = pm_runtime_get_sync(ddata->dev); 2122 error = pm_runtime_get_sync(ddata->dev);
1688 if (error < 0) { 2123 if (error < 0) {
1689 pm_runtime_put_noidle(ddata->dev); 2124 pm_runtime_put_noidle(ddata->dev);
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 4b3d143f0f8a..48321488f0fd 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -69,6 +69,13 @@ config FTTMR010_TIMER
69 Enables support for the Faraday Technology timer block 69 Enables support for the Faraday Technology timer block
70 FTTMR010. 70 FTTMR010.
71 71
72config IXP4XX_TIMER
73 bool "Intel XScale IXP4xx timer driver" if COMPILE_TEST
74 depends on HAS_IOMEM
75 select CLKSRC_MMIO
76 help
77 Enables support for the Intel XScale IXP4xx SoC timer.
78
72config ROCKCHIP_TIMER 79config ROCKCHIP_TIMER
73 bool "Rockchip timer driver" if COMPILE_TEST 80 bool "Rockchip timer driver" if COMPILE_TEST
74 depends on ARM || ARM64 81 depends on ARM || ARM64
diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile
index be6e0fbc7489..dba4eff880de 100644
--- a/drivers/clocksource/Makefile
+++ b/drivers/clocksource/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_OMAP_DM_TIMER) += timer-ti-dm.o
20obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o 20obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o
21obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o 21obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o
22obj-$(CONFIG_FTTMR010_TIMER) += timer-fttmr010.o 22obj-$(CONFIG_FTTMR010_TIMER) += timer-fttmr010.o
23obj-$(CONFIG_IXP4XX_TIMER) += timer-ixp4xx.o
23obj-$(CONFIG_ROCKCHIP_TIMER) += timer-rockchip.o 24obj-$(CONFIG_ROCKCHIP_TIMER) += timer-rockchip.o
24obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o 25obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o
25obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o 26obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o
diff --git a/drivers/clocksource/timer-ixp4xx.c b/drivers/clocksource/timer-ixp4xx.c
new file mode 100644
index 000000000000..5c2190b654cd
--- /dev/null
+++ b/drivers/clocksource/timer-ixp4xx.c
@@ -0,0 +1,282 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * IXP4 timer driver
4 * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org>
5 *
6 * Based on arch/arm/mach-ixp4xx/common.c
7 * Copyright 2002 (C) Intel Corporation
8 * Copyright 2003-2004 (C) MontaVista, Software, Inc.
9 * Copyright (C) Deepak Saxena <dsaxena@plexity.net>
10 */
11#include <linux/interrupt.h>
12#include <linux/io.h>
13#include <linux/clockchips.h>
14#include <linux/clocksource.h>
15#include <linux/sched_clock.h>
16#include <linux/slab.h>
17#include <linux/bitops.h>
18#include <linux/delay.h>
19#include <linux/of_address.h>
20#include <linux/of_irq.h>
21/* Goes away with OF conversion */
22#include <linux/platform_data/timer-ixp4xx.h>
23
24/*
25 * Constants to make it easy to access Timer Control/Status registers
26 */
27#define IXP4XX_OSTS_OFFSET 0x00 /* Continuous Timestamp */
28#define IXP4XX_OST1_OFFSET 0x04 /* Timer 1 Timestamp */
29#define IXP4XX_OSRT1_OFFSET 0x08 /* Timer 1 Reload */
30#define IXP4XX_OST2_OFFSET 0x0C /* Timer 2 Timestamp */
31#define IXP4XX_OSRT2_OFFSET 0x10 /* Timer 2 Reload */
32#define IXP4XX_OSWT_OFFSET 0x14 /* Watchdog Timer */
33#define IXP4XX_OSWE_OFFSET 0x18 /* Watchdog Enable */
34#define IXP4XX_OSWK_OFFSET 0x1C /* Watchdog Key */
35#define IXP4XX_OSST_OFFSET 0x20 /* Timer Status */
36
37/*
38 * Timer register values and bit definitions
39 */
40#define IXP4XX_OST_ENABLE 0x00000001
41#define IXP4XX_OST_ONE_SHOT 0x00000002
42/* Low order bits of reload value ignored */
43#define IXP4XX_OST_RELOAD_MASK 0x00000003
44#define IXP4XX_OST_DISABLED 0x00000000
45#define IXP4XX_OSST_TIMER_1_PEND 0x00000001
46#define IXP4XX_OSST_TIMER_2_PEND 0x00000002
47#define IXP4XX_OSST_TIMER_TS_PEND 0x00000004
48#define IXP4XX_OSST_TIMER_WDOG_PEND 0x00000008
49#define IXP4XX_OSST_TIMER_WARM_RESET 0x00000010
50
51#define IXP4XX_WDT_KEY 0x0000482E
52#define IXP4XX_WDT_RESET_ENABLE 0x00000001
53#define IXP4XX_WDT_IRQ_ENABLE 0x00000002
54#define IXP4XX_WDT_COUNT_ENABLE 0x00000004
55
56struct ixp4xx_timer {
57 void __iomem *base;
58 unsigned int tick_rate;
59 u32 latch;
60 struct clock_event_device clkevt;
61#ifdef CONFIG_ARM
62 struct delay_timer delay_timer;
63#endif
64};
65
66/*
67 * A local singleton used by sched_clock and delay timer reads, which are
68 * fast and stateless
69 */
70static struct ixp4xx_timer *local_ixp4xx_timer;
71
72static inline struct ixp4xx_timer *
73to_ixp4xx_timer(struct clock_event_device *evt)
74{
75 return container_of(evt, struct ixp4xx_timer, clkevt);
76}
77
78static u64 notrace ixp4xx_read_sched_clock(void)
79{
80 return __raw_readl(local_ixp4xx_timer->base + IXP4XX_OSTS_OFFSET);
81}
82
83static u64 ixp4xx_clocksource_read(struct clocksource *c)
84{
85 return __raw_readl(local_ixp4xx_timer->base + IXP4XX_OSTS_OFFSET);
86}
87
88static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id)
89{
90 struct ixp4xx_timer *tmr = dev_id;
91 struct clock_event_device *evt = &tmr->clkevt;
92
93 /* Clear Pending Interrupt */
94 __raw_writel(IXP4XX_OSST_TIMER_1_PEND,
95 tmr->base + IXP4XX_OSST_OFFSET);
96
97 evt->event_handler(evt);
98
99 return IRQ_HANDLED;
100}
101
102static int ixp4xx_set_next_event(unsigned long cycles,
103 struct clock_event_device *evt)
104{
105 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt);
106 u32 val;
107
108 val = __raw_readl(tmr->base + IXP4XX_OSRT1_OFFSET);
109 /* Keep enable/oneshot bits */
110 val &= IXP4XX_OST_RELOAD_MASK;
111 __raw_writel((cycles & ~IXP4XX_OST_RELOAD_MASK) | val,
112 tmr->base + IXP4XX_OSRT1_OFFSET);
113
114 return 0;
115}
116
117static int ixp4xx_shutdown(struct clock_event_device *evt)
118{
119 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt);
120 u32 val;
121
122 val = __raw_readl(tmr->base + IXP4XX_OSRT1_OFFSET);
123 val &= ~IXP4XX_OST_ENABLE;
124 __raw_writel(val, tmr->base + IXP4XX_OSRT1_OFFSET);
125
126 return 0;
127}
128
129static int ixp4xx_set_oneshot(struct clock_event_device *evt)
130{
131 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt);
132
133 __raw_writel(IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT,
134 tmr->base + IXP4XX_OSRT1_OFFSET);
135
136 return 0;
137}
138
139static int ixp4xx_set_periodic(struct clock_event_device *evt)
140{
141 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt);
142 u32 val;
143
144 val = tmr->latch & ~IXP4XX_OST_RELOAD_MASK;
145 val |= IXP4XX_OST_ENABLE;
146 __raw_writel(val, tmr->base + IXP4XX_OSRT1_OFFSET);
147
148 return 0;
149}
150
151static int ixp4xx_resume(struct clock_event_device *evt)
152{
153 struct ixp4xx_timer *tmr = to_ixp4xx_timer(evt);
154 u32 val;
155
156 val = __raw_readl(tmr->base + IXP4XX_OSRT1_OFFSET);
157 val |= IXP4XX_OST_ENABLE;
158 __raw_writel(val, tmr->base + IXP4XX_OSRT1_OFFSET);
159
160 return 0;
161}
162
163/*
164 * IXP4xx timer tick
165 * We use OS timer1 on the CPU for the timer tick and the timestamp
166 * counter as a source of real clock ticks to account for missed jiffies.
167 */
168static __init int ixp4xx_timer_register(void __iomem *base,
169 int timer_irq,
170 unsigned int timer_freq)
171{
172 struct ixp4xx_timer *tmr;
173 int ret;
174
175 tmr = kzalloc(sizeof(*tmr), GFP_KERNEL);
176 if (!tmr)
177 return -ENOMEM;
178 tmr->base = base;
179 tmr->tick_rate = timer_freq;
180
181 /*
182 * The timer register doesn't allow to specify the two least
183 * significant bits of the timeout value and assumes them being zero.
184 * So make sure the latch is the best value with the two least
185 * significant bits unset.
186 */
187 tmr->latch = DIV_ROUND_CLOSEST(timer_freq,
188 (IXP4XX_OST_RELOAD_MASK + 1) * HZ)
189 * (IXP4XX_OST_RELOAD_MASK + 1);
190
191 local_ixp4xx_timer = tmr;
192
193 /* Reset/disable counter */
194 __raw_writel(0, tmr->base + IXP4XX_OSRT1_OFFSET);
195
196 /* Clear any pending interrupt on timer 1 */
197 __raw_writel(IXP4XX_OSST_TIMER_1_PEND,
198 tmr->base + IXP4XX_OSST_OFFSET);
199
200 /* Reset time-stamp counter */
201 __raw_writel(0, tmr->base + IXP4XX_OSTS_OFFSET);
202
203 clocksource_mmio_init(NULL, "OSTS", timer_freq, 200, 32,
204 ixp4xx_clocksource_read);
205
206 tmr->clkevt.name = "ixp4xx timer1";
207 tmr->clkevt.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
208 tmr->clkevt.rating = 200;
209 tmr->clkevt.set_state_shutdown = ixp4xx_shutdown;
210 tmr->clkevt.set_state_periodic = ixp4xx_set_periodic;
211 tmr->clkevt.set_state_oneshot = ixp4xx_set_oneshot;
212 tmr->clkevt.tick_resume = ixp4xx_resume;
213 tmr->clkevt.set_next_event = ixp4xx_set_next_event;
214 tmr->clkevt.cpumask = cpumask_of(0);
215 tmr->clkevt.irq = timer_irq;
216 ret = request_irq(timer_irq, ixp4xx_timer_interrupt,
217 IRQF_TIMER, "IXP4XX-TIMER1", tmr);
218 if (ret) {
219 pr_crit("no timer IRQ\n");
220 return -ENODEV;
221 }
222 clockevents_config_and_register(&tmr->clkevt, timer_freq,
223 0xf, 0xfffffffe);
224
225 sched_clock_register(ixp4xx_read_sched_clock, 32, timer_freq);
226
227 return 0;
228}
229
230/**
231 * ixp4xx_timer_setup() - Timer setup function to be called from boardfiles
232 * @timerbase: physical base of timer block
233 * @timer_irq: Linux IRQ number for the timer
234 * @timer_freq: Fixed frequency of the timer
235 */
236void __init ixp4xx_timer_setup(resource_size_t timerbase,
237 int timer_irq,
238 unsigned int timer_freq)
239{
240 void __iomem *base;
241
242 base = ioremap(timerbase, 0x100);
243 if (!base) {
244 pr_crit("IXP4xx: can't remap timer\n");
245 return;
246 }
247 ixp4xx_timer_register(base, timer_irq, timer_freq);
248}
249EXPORT_SYMBOL_GPL(ixp4xx_timer_setup);
250
251#ifdef CONFIG_OF
252static __init int ixp4xx_of_timer_init(struct device_node *np)
253{
254 void __iomem *base;
255 int irq;
256 int ret;
257
258 base = of_iomap(np, 0);
259 if (!base) {
260 pr_crit("IXP4xx: can't remap timer\n");
261 return -ENODEV;
262 }
263
264 irq = irq_of_parse_and_map(np, 0);
265 if (irq <= 0) {
266 pr_err("Can't parse IRQ\n");
267 ret = -EINVAL;
268 goto out_unmap;
269 }
270
271 /* TODO: get some fixed clocks into the device tree */
272 ret = ixp4xx_timer_register(base, irq, 66666000);
273 if (ret)
274 goto out_unmap;
275 return 0;
276
277out_unmap:
278 iounmap(base);
279 return ret;
280}
281TIMER_OF_DECLARE(ixp4xx, "intel,ixp4xx-timer", ixp4xx_of_timer_init);
282#endif
diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c
index 9bbde2f26cac..f5414b6dfb55 100644
--- a/drivers/crypto/ixp4xx_crypto.c
+++ b/drivers/crypto/ixp4xx_crypto.c
@@ -30,8 +30,8 @@
30#include <crypto/authenc.h> 30#include <crypto/authenc.h>
31#include <crypto/scatterwalk.h> 31#include <crypto/scatterwalk.h>
32 32
33#include <mach/npe.h> 33#include <linux/soc/ixp4xx/npe.h>
34#include <mach/qmgr.h> 34#include <linux/soc/ixp4xx/qmgr.h>
35 35
36#define MAX_KEYLEN 32 36#define MAX_KEYLEN 32
37 37
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 7b655f6156fb..11fda9eb2466 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -253,6 +253,22 @@ config TI_SCI_PROTOCOL
253 This protocol library is used by client drivers to use the features 253 This protocol library is used by client drivers to use the features
254 provided by the system controller. 254 provided by the system controller.
255 255
256config TRUSTED_FOUNDATIONS
257 bool "Trusted Foundations secure monitor support"
258 depends on ARM
259 help
260 Some devices (including most early Tegra-based consumer devices on
261 the market) are booted with the Trusted Foundations secure monitor
262 active, requiring some core operations to be performed by the secure
263 monitor instead of the kernel.
264
265 This option allows the kernel to invoke the secure monitor whenever
266 required on devices using Trusted Foundations. See the functions and
267 comments in linux/firmware/trusted_foundations.h or the device tree
268 bindings for "tlm,trusted-foundations" for details on how to use it.
269
270 Choose N if you don't know what this is about.
271
256config HAVE_ARM_SMCCC 272config HAVE_ARM_SMCCC
257 bool 273 bool
258 274
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 9a3909a22682..3fa0b34eb72f 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_QCOM_SCM_64) += qcom_scm-64.o
21obj-$(CONFIG_QCOM_SCM_32) += qcom_scm-32.o 21obj-$(CONFIG_QCOM_SCM_32) += qcom_scm-32.o
22CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1) -march=armv7-a 22CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1) -march=armv7-a
23obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o 23obj-$(CONFIG_TI_SCI_PROTOCOL) += ti_sci.o
24obj-$(CONFIG_TRUSTED_FOUNDATIONS) += trusted_foundations.o
24 25
25obj-$(CONFIG_ARM_SCMI_PROTOCOL) += arm_scmi/ 26obj-$(CONFIG_ARM_SCMI_PROTOCOL) += arm_scmi/
26obj-y += psci/ 27obj-y += psci/
diff --git a/arch/arm/firmware/trusted_foundations.c b/drivers/firmware/trusted_foundations.c
index 689e6565abfc..fd4999388ff1 100644
--- a/arch/arm/firmware/trusted_foundations.c
+++ b/drivers/firmware/trusted_foundations.c
@@ -17,8 +17,17 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/of.h> 19#include <linux/of.h>
20
21#include <linux/firmware/trusted_foundations.h>
22
20#include <asm/firmware.h> 23#include <asm/firmware.h>
21#include <asm/trusted_foundations.h> 24#include <asm/hardware/cache-l2x0.h>
25#include <asm/outercache.h>
26
27#define TF_CACHE_MAINT 0xfffff100
28
29#define TF_CACHE_ENABLE 1
30#define TF_CACHE_DISABLE 2
22 31
23#define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200 32#define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200
24 33
@@ -60,16 +69,75 @@ static int tf_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
60 return 0; 69 return 0;
61} 70}
62 71
63static int tf_prepare_idle(void) 72static int tf_prepare_idle(unsigned long mode)
64{ 73{
65 tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S1_NOFLUSH_L2, cpu_boot_addr); 74 switch (mode) {
75 case TF_PM_MODE_LP0:
76 tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S3, cpu_boot_addr);
77 break;
78
79 case TF_PM_MODE_LP1:
80 tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S2, cpu_boot_addr);
81 break;
82
83 case TF_PM_MODE_LP1_NO_MC_CLK:
84 tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S2_NO_MC_CLK,
85 cpu_boot_addr);
86 break;
87
88 case TF_PM_MODE_LP2:
89 tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S1, cpu_boot_addr);
90 break;
91
92 case TF_PM_MODE_LP2_NOFLUSH_L2:
93 tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S1_NOFLUSH_L2,
94 cpu_boot_addr);
95 break;
96
97 default:
98 return -EINVAL;
99 }
66 100
67 return 0; 101 return 0;
68} 102}
69 103
104#ifdef CONFIG_CACHE_L2X0
105static void tf_cache_write_sec(unsigned long val, unsigned int reg)
106{
107 u32 l2x0_way_mask = 0xff;
108
109 switch (reg) {
110 case L2X0_CTRL:
111 if (l2x0_saved_regs.aux_ctrl & L310_AUX_CTRL_ASSOCIATIVITY_16)
112 l2x0_way_mask = 0xffff;
113
114 if (val == L2X0_CTRL_EN)
115 tf_generic_smc(TF_CACHE_MAINT, TF_CACHE_ENABLE,
116 l2x0_saved_regs.aux_ctrl);
117 else
118 tf_generic_smc(TF_CACHE_MAINT, TF_CACHE_DISABLE,
119 l2x0_way_mask);
120 break;
121
122 default:
123 break;
124 }
125}
126
127static int tf_init_cache(void)
128{
129 outer_cache.write_sec = tf_cache_write_sec;
130
131 return 0;
132}
133#endif /* CONFIG_CACHE_L2X0 */
134
70static const struct firmware_ops trusted_foundations_ops = { 135static const struct firmware_ops trusted_foundations_ops = {
71 .set_cpu_boot_addr = tf_set_cpu_boot_addr, 136 .set_cpu_boot_addr = tf_set_cpu_boot_addr,
72 .prepare_idle = tf_prepare_idle, 137 .prepare_idle = tf_prepare_idle,
138#ifdef CONFIG_CACHE_L2X0
139 .l2x0_init = tf_init_cache,
140#endif
73}; 141};
74 142
75void register_trusted_foundations(struct trusted_foundations_platform_data *pd) 143void register_trusted_foundations(struct trusted_foundations_platform_data *pd)
@@ -101,3 +169,8 @@ void of_register_trusted_foundations(void)
101 panic("Trusted Foundation: missing version-minor property\n"); 169 panic("Trusted Foundation: missing version-minor property\n");
102 register_trusted_foundations(&pdata); 170 register_trusted_foundations(&pdata);
103} 171}
172
173bool trusted_foundations_registered(void)
174{
175 return firmware_ops == &trusted_foundations_ops;
176}
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 41f08362dad3..8023d03ec362 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -286,6 +286,19 @@ config GPIO_IOP
286 286
287 If unsure, say N. 287 If unsure, say N.
288 288
289config GPIO_IXP4XX
290 bool "Intel IXP4xx GPIO"
291 depends on ARM # For <asm/mach-types.h>
292 depends on ARCH_IXP4XX
293 select GPIO_GENERIC
294 select IRQ_DOMAIN
295 select IRQ_DOMAIN_HIERARCHY
296 help
297 Say yes here to support the GPIO functionality of a number of Intel
298 IXP4xx series of chips.
299
300 If unsure, say N.
301
289config GPIO_LOONGSON 302config GPIO_LOONGSON
290 bool "Loongson-2/3 GPIO support" 303 bool "Loongson-2/3 GPIO support"
291 depends on CPU_LOONGSON2 || CPU_LOONGSON3 304 depends on CPU_LOONGSON2 || CPU_LOONGSON3
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index e19be766f6a6..6700eee860b7 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -61,6 +61,7 @@ obj-$(CONFIG_GPIO_HLWD) += gpio-hlwd.o
61obj-$(CONFIG_HTC_EGPIO) += gpio-htc-egpio.o 61obj-$(CONFIG_HTC_EGPIO) += gpio-htc-egpio.o
62obj-$(CONFIG_GPIO_ICH) += gpio-ich.o 62obj-$(CONFIG_GPIO_ICH) += gpio-ich.o
63obj-$(CONFIG_GPIO_IOP) += gpio-iop.o 63obj-$(CONFIG_GPIO_IOP) += gpio-iop.o
64obj-$(CONFIG_GPIO_IXP4XX) += gpio-ixp4xx.o
64obj-$(CONFIG_GPIO_IT87) += gpio-it87.o 65obj-$(CONFIG_GPIO_IT87) += gpio-it87.o
65obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o 66obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o
66obj-$(CONFIG_GPIO_KEMPLD) += gpio-kempld.o 67obj-$(CONFIG_GPIO_KEMPLD) += gpio-kempld.o
diff --git a/drivers/gpio/gpio-ixp4xx.c b/drivers/gpio/gpio-ixp4xx.c
new file mode 100644
index 000000000000..4b1cf7ea858d
--- /dev/null
+++ b/drivers/gpio/gpio-ixp4xx.c
@@ -0,0 +1,474 @@
1// SPDX-License-Identifier: GPL-2.0
2//
3// IXP4 GPIO driver
4// Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org>
5//
6// based on previous work and know-how from:
7// Deepak Saxena <dsaxena@plexity.net>
8
9#include <linux/gpio/driver.h>
10#include <linux/io.h>
11#include <linux/irq.h>
12#include <linux/irqdomain.h>
13#include <linux/irqchip.h>
14#include <linux/of_irq.h>
15#include <linux/platform_device.h>
16#include <linux/bitops.h>
17/* Include that go away with DT transition */
18#include <linux/irqchip/irq-ixp4xx.h>
19
20#include <asm/mach-types.h>
21
22#define IXP4XX_REG_GPOUT 0x00
23#define IXP4XX_REG_GPOE 0x04
24#define IXP4XX_REG_GPIN 0x08
25#define IXP4XX_REG_GPIS 0x0C
26#define IXP4XX_REG_GPIT1 0x10
27#define IXP4XX_REG_GPIT2 0x14
28#define IXP4XX_REG_GPCLK 0x18
29#define IXP4XX_REG_GPDBSEL 0x1C
30
31/*
32 * The hardware uses 3 bits to indicate interrupt "style".
33 * we clear and set these three bits accordingly. The lower 24
34 * bits in two registers (GPIT1 and GPIT2) are used to set up
35 * the style for 8 lines each for a total of 16 GPIO lines.
36 */
37#define IXP4XX_GPIO_STYLE_ACTIVE_HIGH 0x0
38#define IXP4XX_GPIO_STYLE_ACTIVE_LOW 0x1
39#define IXP4XX_GPIO_STYLE_RISING_EDGE 0x2
40#define IXP4XX_GPIO_STYLE_FALLING_EDGE 0x3
41#define IXP4XX_GPIO_STYLE_TRANSITIONAL 0x4
42#define IXP4XX_GPIO_STYLE_MASK GENMASK(2, 0)
43#define IXP4XX_GPIO_STYLE_SIZE 3
44
45/**
46 * struct ixp4xx_gpio - IXP4 GPIO state container
47 * @dev: containing device for this instance
48 * @fwnode: the fwnode for this GPIO chip
49 * @gc: gpiochip for this instance
50 * @domain: irqdomain for this chip instance
51 * @base: remapped I/O-memory base
52 * @irq_edge: Each bit represents an IRQ: 1: edge-triggered,
53 * 0: level triggered
54 */
55struct ixp4xx_gpio {
56 struct device *dev;
57 struct fwnode_handle *fwnode;
58 struct gpio_chip gc;
59 struct irq_domain *domain;
60 void __iomem *base;
61 unsigned long long irq_edge;
62};
63
64/**
65 * struct ixp4xx_gpio_map - IXP4 GPIO to parent IRQ map
66 * @gpio_offset: offset of the IXP4 GPIO line
67 * @parent_hwirq: hwirq on the parent IRQ controller
68 */
69struct ixp4xx_gpio_map {
70 int gpio_offset;
71 int parent_hwirq;
72};
73
74/* GPIO lines 0..12 have corresponding IRQs, GPIOs 13..15 have no IRQs */
75const struct ixp4xx_gpio_map ixp4xx_gpiomap[] = {
76 { .gpio_offset = 0, .parent_hwirq = 6 },
77 { .gpio_offset = 1, .parent_hwirq = 7 },
78 { .gpio_offset = 2, .parent_hwirq = 19 },
79 { .gpio_offset = 3, .parent_hwirq = 20 },
80 { .gpio_offset = 4, .parent_hwirq = 21 },
81 { .gpio_offset = 5, .parent_hwirq = 22 },
82 { .gpio_offset = 6, .parent_hwirq = 23 },
83 { .gpio_offset = 7, .parent_hwirq = 24 },
84 { .gpio_offset = 8, .parent_hwirq = 25 },
85 { .gpio_offset = 9, .parent_hwirq = 26 },
86 { .gpio_offset = 10, .parent_hwirq = 27 },
87 { .gpio_offset = 11, .parent_hwirq = 28 },
88 { .gpio_offset = 12, .parent_hwirq = 29 },
89};
90
91static void ixp4xx_gpio_irq_ack(struct irq_data *d)
92{
93 struct ixp4xx_gpio *g = irq_data_get_irq_chip_data(d);
94
95 __raw_writel(BIT(d->hwirq), g->base + IXP4XX_REG_GPIS);
96}
97
98static void ixp4xx_gpio_irq_unmask(struct irq_data *d)
99{
100 struct ixp4xx_gpio *g = irq_data_get_irq_chip_data(d);
101
102 /* ACK when unmasking if not edge-triggered */
103 if (!(g->irq_edge & BIT(d->hwirq)))
104 ixp4xx_gpio_irq_ack(d);
105
106 irq_chip_unmask_parent(d);
107}
108
109static int ixp4xx_gpio_irq_set_type(struct irq_data *d, unsigned int type)
110{
111 struct ixp4xx_gpio *g = irq_data_get_irq_chip_data(d);
112 int line = d->hwirq;
113 unsigned long flags;
114 u32 int_style;
115 u32 int_reg;
116 u32 val;
117
118 switch (type) {
119 case IRQ_TYPE_EDGE_BOTH:
120 irq_set_handler_locked(d, handle_edge_irq);
121 int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL;
122 g->irq_edge |= BIT(d->hwirq);
123 break;
124 case IRQ_TYPE_EDGE_RISING:
125 irq_set_handler_locked(d, handle_edge_irq);
126 int_style = IXP4XX_GPIO_STYLE_RISING_EDGE;
127 g->irq_edge |= BIT(d->hwirq);
128 break;
129 case IRQ_TYPE_EDGE_FALLING:
130 irq_set_handler_locked(d, handle_edge_irq);
131 int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE;
132 g->irq_edge |= BIT(d->hwirq);
133 break;
134 case IRQ_TYPE_LEVEL_HIGH:
135 irq_set_handler_locked(d, handle_level_irq);
136 int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
137 g->irq_edge &= ~BIT(d->hwirq);
138 break;
139 case IRQ_TYPE_LEVEL_LOW:
140 irq_set_handler_locked(d, handle_level_irq);
141 int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW;
142 g->irq_edge &= ~BIT(d->hwirq);
143 break;
144 default:
145 return -EINVAL;
146 }
147
148 if (line >= 8) {
149 /* pins 8-15 */
150 line -= 8;
151 int_reg = IXP4XX_REG_GPIT2;
152 } else {
153 /* pins 0-7 */
154 int_reg = IXP4XX_REG_GPIT1;
155 }
156
157 spin_lock_irqsave(&g->gc.bgpio_lock, flags);
158
159 /* Clear the style for the appropriate pin */
160 val = __raw_readl(g->base + int_reg);
161 val &= ~(IXP4XX_GPIO_STYLE_MASK << (line * IXP4XX_GPIO_STYLE_SIZE));
162 __raw_writel(val, g->base + int_reg);
163
164 __raw_writel(BIT(line), g->base + IXP4XX_REG_GPIS);
165
166 /* Set the new style */
167 val = __raw_readl(g->base + int_reg);
168 val |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE));
169 __raw_writel(val, g->base + int_reg);
170
171 /* Force-configure this line as an input */
172 val = __raw_readl(g->base + IXP4XX_REG_GPOE);
173 val |= BIT(d->hwirq);
174 __raw_writel(val, g->base + IXP4XX_REG_GPOE);
175
176 spin_unlock_irqrestore(&g->gc.bgpio_lock, flags);
177
178 /* This parent only accept level high (asserted) */
179 return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH);
180}
181
182static struct irq_chip ixp4xx_gpio_irqchip = {
183 .name = "IXP4GPIO",
184 .irq_ack = ixp4xx_gpio_irq_ack,
185 .irq_mask = irq_chip_mask_parent,
186 .irq_unmask = ixp4xx_gpio_irq_unmask,
187 .irq_set_type = ixp4xx_gpio_irq_set_type,
188};
189
190static int ixp4xx_gpio_to_irq(struct gpio_chip *gc, unsigned int offset)
191{
192 struct ixp4xx_gpio *g = gpiochip_get_data(gc);
193 struct irq_fwspec fwspec;
194
195 fwspec.fwnode = g->fwnode;
196 fwspec.param_count = 2;
197 fwspec.param[0] = offset;
198 fwspec.param[1] = IRQ_TYPE_NONE;
199
200 return irq_create_fwspec_mapping(&fwspec);
201}
202
203static int ixp4xx_gpio_irq_domain_translate(struct irq_domain *domain,
204 struct irq_fwspec *fwspec,
205 unsigned long *hwirq,
206 unsigned int *type)
207{
208
209 /* We support standard DT translation */
210 if (is_of_node(fwspec->fwnode) && fwspec->param_count == 2) {
211 *hwirq = fwspec->param[0];
212 *type = fwspec->param[1];
213 return 0;
214 }
215
216 /* This goes away when we transition to DT */
217 if (is_fwnode_irqchip(fwspec->fwnode)) {
218 if (fwspec->param_count != 2)
219 return -EINVAL;
220 *hwirq = fwspec->param[0];
221 *type = fwspec->param[1];
222 WARN_ON(*type == IRQ_TYPE_NONE);
223 return 0;
224 }
225 return -EINVAL;
226}
227
228static int ixp4xx_gpio_irq_domain_alloc(struct irq_domain *d,
229 unsigned int irq, unsigned int nr_irqs,
230 void *data)
231{
232 struct ixp4xx_gpio *g = d->host_data;
233 irq_hw_number_t hwirq;
234 unsigned int type = IRQ_TYPE_NONE;
235 struct irq_fwspec *fwspec = data;
236 int ret;
237 int i;
238
239 ret = ixp4xx_gpio_irq_domain_translate(d, fwspec, &hwirq, &type);
240 if (ret)
241 return ret;
242
243 dev_dbg(g->dev, "allocate IRQ %d..%d, hwirq %lu..%lu\n",
244 irq, irq + nr_irqs - 1,
245 hwirq, hwirq + nr_irqs - 1);
246
247 for (i = 0; i < nr_irqs; i++) {
248 struct irq_fwspec parent_fwspec;
249 const struct ixp4xx_gpio_map *map;
250 int j;
251
252 /* Not all lines support IRQs */
253 for (j = 0; j < ARRAY_SIZE(ixp4xx_gpiomap); j++) {
254 map = &ixp4xx_gpiomap[j];
255 if (map->gpio_offset == hwirq)
256 break;
257 }
258 if (j == ARRAY_SIZE(ixp4xx_gpiomap)) {
259 dev_err(g->dev, "can't look up hwirq %lu\n", hwirq);
260 return -EINVAL;
261 }
262 dev_dbg(g->dev, "found parent hwirq %u\n", map->parent_hwirq);
263
264 /*
265 * We set handle_bad_irq because the .set_type() should
266 * always be invoked and set the right type of handler.
267 */
268 irq_domain_set_info(d,
269 irq + i,
270 hwirq + i,
271 &ixp4xx_gpio_irqchip,
272 g,
273 handle_bad_irq,
274 NULL, NULL);
275 irq_set_probe(irq + i);
276
277 /*
278 * Create a IRQ fwspec to send up to the parent irqdomain:
279 * specify the hwirq we address on the parent and tie it
280 * all together up the chain.
281 */
282 parent_fwspec.fwnode = d->parent->fwnode;
283 parent_fwspec.param_count = 2;
284 parent_fwspec.param[0] = map->parent_hwirq;
285 /* This parent only handles asserted level IRQs */
286 parent_fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH;
287 dev_dbg(g->dev, "alloc_irqs_parent for %d parent hwirq %d\n",
288 irq + i, map->parent_hwirq);
289 ret = irq_domain_alloc_irqs_parent(d, irq + i, 1,
290 &parent_fwspec);
291 if (ret)
292 dev_err(g->dev,
293 "failed to allocate parent hwirq %d for hwirq %lu\n",
294 map->parent_hwirq, hwirq);
295 }
296
297 return 0;
298}
299
300static const struct irq_domain_ops ixp4xx_gpio_irqdomain_ops = {
301 .translate = ixp4xx_gpio_irq_domain_translate,
302 .alloc = ixp4xx_gpio_irq_domain_alloc,
303 .free = irq_domain_free_irqs_common,
304};
305
306static int ixp4xx_gpio_probe(struct platform_device *pdev)
307{
308 unsigned long flags;
309 struct device *dev = &pdev->dev;
310 struct device_node *np = dev->of_node;
311 struct irq_domain *parent;
312 struct resource *res;
313 struct ixp4xx_gpio *g;
314 int ret;
315 int i;
316
317 g = devm_kzalloc(dev, sizeof(*g), GFP_KERNEL);
318 if (!g)
319 return -ENOMEM;
320 g->dev = dev;
321
322 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
323 g->base = devm_ioremap_resource(dev, res);
324 if (IS_ERR(g->base)) {
325 dev_err(dev, "ioremap error\n");
326 return PTR_ERR(g->base);
327 }
328
329 /*
330 * Make sure GPIO 14 and 15 are NOT used as clocks but GPIO on
331 * specific machines.
332 */
333 if (machine_is_dsmg600() || machine_is_nas100d())
334 __raw_writel(0x0, g->base + IXP4XX_REG_GPCLK);
335
336 /*
337 * This is a very special big-endian ARM issue: when the IXP4xx is
338 * run in big endian mode, all registers in the machine are switched
339 * around to the CPU-native endianness. As you see mostly in the
340 * driver we use __raw_readl()/__raw_writel() to access the registers
341 * in the appropriate order. With the GPIO library we need to specify
342 * byte order explicitly, so this flag needs to be set when compiling
343 * for big endian.
344 */
345#if defined(CONFIG_CPU_BIG_ENDIAN)
346 flags = BGPIOF_BIG_ENDIAN_BYTE_ORDER;
347#else
348 flags = 0;
349#endif
350
351 /* Populate and register gpio chip */
352 ret = bgpio_init(&g->gc, dev, 4,
353 g->base + IXP4XX_REG_GPIN,
354 g->base + IXP4XX_REG_GPOUT,
355 NULL,
356 NULL,
357 g->base + IXP4XX_REG_GPOE,
358 flags);
359 if (ret) {
360 dev_err(dev, "unable to init generic GPIO\n");
361 return ret;
362 }
363 g->gc.to_irq = ixp4xx_gpio_to_irq;
364 g->gc.ngpio = 16;
365 g->gc.label = "IXP4XX_GPIO_CHIP";
366 /*
367 * TODO: when we have migrated to device tree and all GPIOs
368 * are fetched using phandles, set this to -1 to get rid of
369 * the fixed gpiochip base.
370 */
371 g->gc.base = 0;
372 g->gc.parent = &pdev->dev;
373 g->gc.owner = THIS_MODULE;
374
375 ret = devm_gpiochip_add_data(dev, &g->gc, g);
376 if (ret) {
377 dev_err(dev, "failed to add SoC gpiochip\n");
378 return ret;
379 }
380
381 /*
382 * When we convert to device tree we will simply look up the
383 * parent irqdomain using irq_find_host(parent) as parent comes
384 * from IRQCHIP_DECLARE(), then use of_node_to_fwnode() to get
385 * the fwnode. For now we need this boardfile style code.
386 */
387 if (np) {
388 struct device_node *irq_parent;
389
390 irq_parent = of_irq_find_parent(np);
391 if (!irq_parent) {
392 dev_err(dev, "no IRQ parent node\n");
393 return -ENODEV;
394 }
395 parent = irq_find_host(irq_parent);
396 if (!parent) {
397 dev_err(dev, "no IRQ parent domain\n");
398 return -ENODEV;
399 }
400 g->fwnode = of_node_to_fwnode(np);
401 } else {
402 parent = ixp4xx_get_irq_domain();
403 g->fwnode = irq_domain_alloc_fwnode(g->base);
404 if (!g->fwnode) {
405 dev_err(dev, "no domain base\n");
406 return -ENODEV;
407 }
408 }
409 g->domain = irq_domain_create_hierarchy(parent,
410 IRQ_DOMAIN_FLAG_HIERARCHY,
411 ARRAY_SIZE(ixp4xx_gpiomap),
412 g->fwnode,
413 &ixp4xx_gpio_irqdomain_ops,
414 g);
415 if (!g->domain) {
416 irq_domain_free_fwnode(g->fwnode);
417 dev_err(dev, "no hierarchical irq domain\n");
418 return ret;
419 }
420
421 /*
422 * After adding OF support, this is no longer needed: irqs
423 * will be allocated for the respective fwnodes.
424 */
425 if (!np) {
426 for (i = 0; i < ARRAY_SIZE(ixp4xx_gpiomap); i++) {
427 const struct ixp4xx_gpio_map *map = &ixp4xx_gpiomap[i];
428 struct irq_fwspec fwspec;
429
430 fwspec.fwnode = g->fwnode;
431 /* This is the hwirq for the GPIO line side of things */
432 fwspec.param[0] = map->gpio_offset;
433 fwspec.param[1] = IRQ_TYPE_EDGE_RISING;
434 fwspec.param_count = 2;
435 ret = __irq_domain_alloc_irqs(g->domain,
436 -1, /* just pick something */
437 1,
438 NUMA_NO_NODE,
439 &fwspec,
440 false,
441 NULL);
442 if (ret < 0) {
443 irq_domain_free_fwnode(g->fwnode);
444 dev_err(dev,
445 "can not allocate irq for GPIO line %d parent hwirq %d in hierarchy domain: %d\n",
446 map->gpio_offset, map->parent_hwirq,
447 ret);
448 return ret;
449 }
450 }
451 }
452
453 platform_set_drvdata(pdev, g);
454 dev_info(dev, "IXP4 GPIO @%p registered\n", g->base);
455
456 return 0;
457}
458
459static const struct of_device_id ixp4xx_gpio_of_match[] = {
460 {
461 .compatible = "intel,ixp4xx-gpio",
462 },
463 {},
464};
465
466
467static struct platform_driver ixp4xx_gpio_driver = {
468 .driver = {
469 .name = "ixp4xx-gpio",
470 .of_match_table = of_match_ptr(ixp4xx_gpio_of_match),
471 },
472 .probe = ixp4xx_gpio_probe,
473};
474builtin_platform_driver(ixp4xx_gpio_driver);
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 1fe039d7326b..82398827b64f 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -205,7 +205,7 @@ config KEYBOARD_LKKBD
205 205
206config KEYBOARD_EP93XX 206config KEYBOARD_EP93XX
207 tristate "EP93xx Matrix Keypad support" 207 tristate "EP93xx Matrix Keypad support"
208 depends on ARCH_EP93XX 208 depends on ARCH_EP93XX || COMPILE_TEST
209 select INPUT_MATRIXKMAP 209 select INPUT_MATRIXKMAP
210 help 210 help
211 Say Y here to enable the matrix keypad on the Cirrus EP93XX. 211 Say Y here to enable the matrix keypad on the Cirrus EP93XX.
diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index f77b295e0123..575dac52f7b4 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -27,8 +27,7 @@
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/input/matrix_keypad.h> 28#include <linux/input/matrix_keypad.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30 30#include <linux/soc/cirrus/ep93xx.h>
31#include <mach/hardware.h>
32#include <linux/platform_data/keypad-ep93xx.h> 31#include <linux/platform_data/keypad-ep93xx.h>
33 32
34/* 33/*
@@ -137,10 +136,7 @@ static void ep93xx_keypad_config(struct ep93xx_keypad *keypad)
137 struct ep93xx_keypad_platform_data *pdata = keypad->pdata; 136 struct ep93xx_keypad_platform_data *pdata = keypad->pdata;
138 unsigned int val = 0; 137 unsigned int val = 0;
139 138
140 if (pdata->flags & EP93XX_KEYPAD_KDIV) 139 clk_set_rate(keypad->clk, pdata->clk_rate);
141 clk_set_rate(keypad->clk, EP93XX_KEYTCHCLK_DIV4);
142 else
143 clk_set_rate(keypad->clk, EP93XX_KEYTCHCLK_DIV16);
144 140
145 if (pdata->flags & EP93XX_KEYPAD_DISABLE_3_KEY) 141 if (pdata->flags & EP93XX_KEYPAD_DISABLE_3_KEY)
146 val |= KEY_INIT_DIS3KY; 142 val |= KEY_INIT_DIS3KY;
diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c
index 1fe149f3def2..4776273fa10b 100644
--- a/drivers/input/misc/ixp4xx-beeper.c
+++ b/drivers/input/misc/ixp4xx-beeper.c
@@ -30,6 +30,8 @@ MODULE_ALIAS("platform:ixp4xx-beeper");
30 30
31static DEFINE_SPINLOCK(beep_lock); 31static DEFINE_SPINLOCK(beep_lock);
32 32
33static int ixp4xx_timer2_irq;
34
33static void ixp4xx_spkr_control(unsigned int pin, unsigned int count) 35static void ixp4xx_spkr_control(unsigned int pin, unsigned int count)
34{ 36{
35 unsigned long flags; 37 unsigned long flags;
@@ -90,6 +92,7 @@ static irqreturn_t ixp4xx_spkr_interrupt(int irq, void *dev_id)
90static int ixp4xx_spkr_probe(struct platform_device *dev) 92static int ixp4xx_spkr_probe(struct platform_device *dev)
91{ 93{
92 struct input_dev *input_dev; 94 struct input_dev *input_dev;
95 int irq;
93 int err; 96 int err;
94 97
95 input_dev = input_allocate_device(); 98 input_dev = input_allocate_device();
@@ -110,15 +113,22 @@ static int ixp4xx_spkr_probe(struct platform_device *dev)
110 input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); 113 input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
111 input_dev->event = ixp4xx_spkr_event; 114 input_dev->event = ixp4xx_spkr_event;
112 115
116 irq = platform_get_irq(dev, 0);
117 if (irq < 0) {
118 err = irq;
119 goto err_free_device;
120 }
121
113 err = gpio_request(dev->id, "ixp4-beeper"); 122 err = gpio_request(dev->id, "ixp4-beeper");
114 if (err) 123 if (err)
115 goto err_free_device; 124 goto err_free_device;
116 125
117 err = request_irq(IRQ_IXP4XX_TIMER2, &ixp4xx_spkr_interrupt, 126 err = request_irq(irq, &ixp4xx_spkr_interrupt,
118 IRQF_NO_SUSPEND, "ixp4xx-beeper", 127 IRQF_NO_SUSPEND, "ixp4xx-beeper",
119 (void *) dev->id); 128 (void *) dev->id);
120 if (err) 129 if (err)
121 goto err_free_gpio; 130 goto err_free_gpio;
131 ixp4xx_timer2_irq = irq;
122 132
123 err = input_register_device(input_dev); 133 err = input_register_device(input_dev);
124 if (err) 134 if (err)
@@ -129,7 +139,7 @@ static int ixp4xx_spkr_probe(struct platform_device *dev)
129 return 0; 139 return 0;
130 140
131 err_free_irq: 141 err_free_irq:
132 free_irq(IRQ_IXP4XX_TIMER2, (void *)dev->id); 142 free_irq(irq, (void *)dev->id);
133 err_free_gpio: 143 err_free_gpio:
134 gpio_free(dev->id); 144 gpio_free(dev->id);
135 err_free_device: 145 err_free_device:
@@ -146,10 +156,10 @@ static int ixp4xx_spkr_remove(struct platform_device *dev)
146 input_unregister_device(input_dev); 156 input_unregister_device(input_dev);
147 157
148 /* turn the speaker off */ 158 /* turn the speaker off */
149 disable_irq(IRQ_IXP4XX_TIMER2); 159 disable_irq(ixp4xx_timer2_irq);
150 ixp4xx_spkr_control(pin, 0); 160 ixp4xx_spkr_control(pin, 0);
151 161
152 free_irq(IRQ_IXP4XX_TIMER2, (void *)dev->id); 162 free_irq(ixp4xx_timer2_irq, (void *)dev->id);
153 gpio_free(dev->id); 163 gpio_free(dev->id);
154 164
155 return 0; 165 return 0;
@@ -161,7 +171,7 @@ static void ixp4xx_spkr_shutdown(struct platform_device *dev)
161 unsigned int pin = (unsigned int) input_get_drvdata(input_dev); 171 unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
162 172
163 /* turn off the speaker */ 173 /* turn off the speaker */
164 disable_irq(IRQ_IXP4XX_TIMER2); 174 disable_irq(ixp4xx_timer2_irq);
165 ixp4xx_spkr_control(pin, 0); 175 ixp4xx_spkr_control(pin, 0);
166} 176}
167 177
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index 5438abb1baba..cf7984991062 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -160,6 +160,12 @@ config IMGPDC_IRQ
160 select GENERIC_IRQ_CHIP 160 select GENERIC_IRQ_CHIP
161 select IRQ_DOMAIN 161 select IRQ_DOMAIN
162 162
163config IXP4XX_IRQ
164 bool
165 select IRQ_DOMAIN
166 select GENERIC_IRQ_MULTI_HANDLER
167 select SPARSE_IRQ
168
163config MADERA_IRQ 169config MADERA_IRQ
164 tristate 170 tristate
165 171
diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile
index 85972ae1bd7f..f8c66e958a64 100644
--- a/drivers/irqchip/Makefile
+++ b/drivers/irqchip/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_ATMEL_AIC5_IRQ) += irq-atmel-aic-common.o irq-atmel-aic5.o
43obj-$(CONFIG_I8259) += irq-i8259.o 43obj-$(CONFIG_I8259) += irq-i8259.o
44obj-$(CONFIG_IMGPDC_IRQ) += irq-imgpdc.o 44obj-$(CONFIG_IMGPDC_IRQ) += irq-imgpdc.o
45obj-$(CONFIG_IRQ_MIPS_CPU) += irq-mips-cpu.o 45obj-$(CONFIG_IRQ_MIPS_CPU) += irq-mips-cpu.o
46obj-$(CONFIG_IXP4XX_IRQ) += irq-ixp4xx.o
46obj-$(CONFIG_SIRF_IRQ) += irq-sirfsoc.o 47obj-$(CONFIG_SIRF_IRQ) += irq-sirfsoc.o
47obj-$(CONFIG_JCORE_AIC) += irq-jcore-aic.o 48obj-$(CONFIG_JCORE_AIC) += irq-jcore-aic.o
48obj-$(CONFIG_RDA_INTC) += irq-rda-intc.o 49obj-$(CONFIG_RDA_INTC) += irq-rda-intc.o
diff --git a/drivers/irqchip/irq-ixp4xx.c b/drivers/irqchip/irq-ixp4xx.c
new file mode 100644
index 000000000000..d576809429ac
--- /dev/null
+++ b/drivers/irqchip/irq-ixp4xx.c
@@ -0,0 +1,403 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * irqchip for the IXP4xx interrupt controller
4 * Copyright (C) 2019 Linus Walleij <linus.walleij@linaro.org>
5 *
6 * Based on arch/arm/mach-ixp4xx/common.c
7 * Copyright 2002 (C) Intel Corporation
8 * Copyright 2003-2004 (C) MontaVista, Software, Inc.
9 * Copyright (C) Deepak Saxena <dsaxena@plexity.net>
10 */
11#include <linux/bitops.h>
12#include <linux/gpio/driver.h>
13#include <linux/irq.h>
14#include <linux/io.h>
15#include <linux/irqchip.h>
16#include <linux/irqchip/irq-ixp4xx.h>
17#include <linux/irqdomain.h>
18#include <linux/of.h>
19#include <linux/of_address.h>
20#include <linux/of_irq.h>
21#include <linux/platform_device.h>
22#include <linux/cpu.h>
23
24#include <asm/exception.h>
25#include <asm/mach/irq.h>
26
27#define IXP4XX_ICPR 0x00 /* Interrupt Status */
28#define IXP4XX_ICMR 0x04 /* Interrupt Enable */
29#define IXP4XX_ICLR 0x08 /* Interrupt IRQ/FIQ Select */
30#define IXP4XX_ICIP 0x0C /* IRQ Status */
31#define IXP4XX_ICFP 0x10 /* FIQ Status */
32#define IXP4XX_ICHR 0x14 /* Interrupt Priority */
33#define IXP4XX_ICIH 0x18 /* IRQ Highest Pri Int */
34#define IXP4XX_ICFH 0x1C /* FIQ Highest Pri Int */
35
36/* IXP43x and IXP46x-only */
37#define IXP4XX_ICPR2 0x20 /* Interrupt Status 2 */
38#define IXP4XX_ICMR2 0x24 /* Interrupt Enable 2 */
39#define IXP4XX_ICLR2 0x28 /* Interrupt IRQ/FIQ Select 2 */
40#define IXP4XX_ICIP2 0x2C /* IRQ Status */
41#define IXP4XX_ICFP2 0x30 /* FIQ Status */
42#define IXP4XX_ICEEN 0x34 /* Error High Pri Enable */
43
44/**
45 * struct ixp4xx_irq - state container for the Faraday IRQ controller
46 * @irqbase: IRQ controller memory base in virtual memory
47 * @is_356: if this is an IXP43x, IXP45x or IX46x SoC (with 64 IRQs)
48 * @irqchip: irqchip for this instance
49 * @domain: IRQ domain for this instance
50 */
51struct ixp4xx_irq {
52 void __iomem *irqbase;
53 bool is_356;
54 struct irq_chip irqchip;
55 struct irq_domain *domain;
56};
57
58/* Local static state container */
59static struct ixp4xx_irq ixirq;
60
61/* GPIO Clocks */
62#define IXP4XX_GPIO_CLK_0 14
63#define IXP4XX_GPIO_CLK_1 15
64
65static int ixp4xx_set_irq_type(struct irq_data *d, unsigned int type)
66{
67 /* All are level active high (asserted) here */
68 if (type != IRQ_TYPE_LEVEL_HIGH)
69 return -EINVAL;
70 return 0;
71}
72
73static void ixp4xx_irq_mask(struct irq_data *d)
74{
75 struct ixp4xx_irq *ixi = irq_data_get_irq_chip_data(d);
76 u32 val;
77
78 if (ixi->is_356 && d->hwirq >= 32) {
79 val = __raw_readl(ixi->irqbase + IXP4XX_ICMR2);
80 val &= ~BIT(d->hwirq - 32);
81 __raw_writel(val, ixi->irqbase + IXP4XX_ICMR2);
82 } else {
83 val = __raw_readl(ixi->irqbase + IXP4XX_ICMR);
84 val &= ~BIT(d->hwirq);
85 __raw_writel(val, ixi->irqbase + IXP4XX_ICMR);
86 }
87}
88
89/*
90 * Level triggered interrupts on GPIO lines can only be cleared when the
91 * interrupt condition disappears.
92 */
93static void ixp4xx_irq_unmask(struct irq_data *d)
94{
95 struct ixp4xx_irq *ixi = irq_data_get_irq_chip_data(d);
96 u32 val;
97
98 if (ixi->is_356 && d->hwirq >= 32) {
99 val = __raw_readl(ixi->irqbase + IXP4XX_ICMR2);
100 val |= BIT(d->hwirq - 32);
101 __raw_writel(val, ixi->irqbase + IXP4XX_ICMR2);
102 } else {
103 val = __raw_readl(ixi->irqbase + IXP4XX_ICMR);
104 val |= BIT(d->hwirq);
105 __raw_writel(val, ixi->irqbase + IXP4XX_ICMR);
106 }
107}
108
109asmlinkage void __exception_irq_entry ixp4xx_handle_irq(struct pt_regs *regs)
110{
111 struct ixp4xx_irq *ixi = &ixirq;
112 unsigned long status;
113 int i;
114
115 status = __raw_readl(ixi->irqbase + IXP4XX_ICIP);
116 for_each_set_bit(i, &status, 32)
117 handle_domain_irq(ixi->domain, i, regs);
118
119 /*
120 * IXP465/IXP435 has an upper IRQ status register
121 */
122 if (ixi->is_356) {
123 status = __raw_readl(ixi->irqbase + IXP4XX_ICIP2);
124 for_each_set_bit(i, &status, 32)
125 handle_domain_irq(ixi->domain, i + 32, regs);
126 }
127}
128
129static int ixp4xx_irq_domain_translate(struct irq_domain *domain,
130 struct irq_fwspec *fwspec,
131 unsigned long *hwirq,
132 unsigned int *type)
133{
134 /* We support standard DT translation */
135 if (is_of_node(fwspec->fwnode) && fwspec->param_count == 2) {
136 *hwirq = fwspec->param[0];
137 *type = fwspec->param[1];
138 return 0;
139 }
140
141 if (is_fwnode_irqchip(fwspec->fwnode)) {
142 if (fwspec->param_count != 2)
143 return -EINVAL;
144 *hwirq = fwspec->param[0];
145 *type = fwspec->param[1];
146 WARN_ON(*type == IRQ_TYPE_NONE);
147 return 0;
148 }
149
150 return -EINVAL;
151}
152
153static int ixp4xx_irq_domain_alloc(struct irq_domain *d,
154 unsigned int irq, unsigned int nr_irqs,
155 void *data)
156{
157 struct ixp4xx_irq *ixi = d->host_data;
158 irq_hw_number_t hwirq;
159 unsigned int type = IRQ_TYPE_NONE;
160 struct irq_fwspec *fwspec = data;
161 int ret;
162 int i;
163
164 ret = ixp4xx_irq_domain_translate(d, fwspec, &hwirq, &type);
165 if (ret)
166 return ret;
167
168 for (i = 0; i < nr_irqs; i++) {
169 /*
170 * TODO: after converting IXP4xx to only device tree, set
171 * handle_bad_irq as default handler and assume all consumers
172 * call .set_type() as this is provided in the second cell in
173 * the device tree phandle.
174 */
175 irq_domain_set_info(d,
176 irq + i,
177 hwirq + i,
178 &ixi->irqchip,
179 ixi,
180 handle_level_irq,
181 NULL, NULL);
182 irq_set_probe(irq + i);
183 }
184
185 return 0;
186}
187
188/*
189 * This needs to be a hierarchical irqdomain to work well with the
190 * GPIO irqchip (which is lower in the hierarchy)
191 */
192static const struct irq_domain_ops ixp4xx_irqdomain_ops = {
193 .translate = ixp4xx_irq_domain_translate,
194 .alloc = ixp4xx_irq_domain_alloc,
195 .free = irq_domain_free_irqs_common,
196};
197
198/**
199 * ixp4xx_get_irq_domain() - retrieve the ixp4xx irq domain
200 *
201 * This function will go away when we transition to DT probing.
202 */
203struct irq_domain *ixp4xx_get_irq_domain(void)
204{
205 struct ixp4xx_irq *ixi = &ixirq;
206
207 return ixi->domain;
208}
209EXPORT_SYMBOL_GPL(ixp4xx_get_irq_domain);
210
211/*
212 * This is the Linux IRQ to hwirq mapping table. This goes away when
213 * we have DT support as all IRQ resources are defined in the device
214 * tree. It will register all the IRQs that are not used by the hierarchical
215 * GPIO IRQ chip. The "holes" inbetween these IRQs will be requested by
216 * the GPIO driver using . This is a step-gap solution.
217 */
218struct ixp4xx_irq_chunk {
219 int irq;
220 int hwirq;
221 int nr_irqs;
222};
223
224static const struct ixp4xx_irq_chunk ixp4xx_irq_chunks[] = {
225 {
226 .irq = 16,
227 .hwirq = 0,
228 .nr_irqs = 6,
229 },
230 {
231 .irq = 24,
232 .hwirq = 8,
233 .nr_irqs = 11,
234 },
235 {
236 .irq = 46,
237 .hwirq = 30,
238 .nr_irqs = 2,
239 },
240 /* Only on the 436 variants */
241 {
242 .irq = 48,
243 .hwirq = 32,
244 .nr_irqs = 10,
245 },
246};
247
248/**
249 * ixp4x_irq_setup() - Common setup code for the IXP4xx interrupt controller
250 * @ixi: State container
251 * @irqbase: Virtual memory base for the interrupt controller
252 * @fwnode: Corresponding fwnode abstraction for this controller
253 * @is_356: if this is an IXP43x, IXP45x or IXP46x SoC variant
254 */
255static int ixp4xx_irq_setup(struct ixp4xx_irq *ixi,
256 void __iomem *irqbase,
257 struct fwnode_handle *fwnode,
258 bool is_356)
259{
260 int nr_irqs;
261
262 ixi->irqbase = irqbase;
263 ixi->is_356 = is_356;
264
265 /* Route all sources to IRQ instead of FIQ */
266 __raw_writel(0x0, ixi->irqbase + IXP4XX_ICLR);
267
268 /* Disable all interrupts */
269 __raw_writel(0x0, ixi->irqbase + IXP4XX_ICMR);
270
271 if (is_356) {
272 /* Route upper 32 sources to IRQ instead of FIQ */
273 __raw_writel(0x0, ixi->irqbase + IXP4XX_ICLR2);
274
275 /* Disable upper 32 interrupts */
276 __raw_writel(0x0, ixi->irqbase + IXP4XX_ICMR2);
277
278 nr_irqs = 64;
279 } else {
280 nr_irqs = 32;
281 }
282
283 ixi->irqchip.name = "IXP4xx";
284 ixi->irqchip.irq_mask = ixp4xx_irq_mask;
285 ixi->irqchip.irq_unmask = ixp4xx_irq_unmask;
286 ixi->irqchip.irq_set_type = ixp4xx_set_irq_type;
287
288 ixi->domain = irq_domain_create_linear(fwnode, nr_irqs,
289 &ixp4xx_irqdomain_ops,
290 ixi);
291 if (!ixi->domain) {
292 pr_crit("IXP4XX: can not add primary irqdomain\n");
293 return -ENODEV;
294 }
295
296 set_handle_irq(ixp4xx_handle_irq);
297
298 return 0;
299}
300
301/**
302 * ixp4xx_irq_init() - Function to initialize the irqchip from boardfiles
303 * @irqbase: physical base for the irq controller
304 * @is_356: if this is an IXP43x, IXP45x or IXP46x SoC variant
305 */
306void __init ixp4xx_irq_init(resource_size_t irqbase,
307 bool is_356)
308{
309 struct ixp4xx_irq *ixi = &ixirq;
310 void __iomem *base;
311 struct fwnode_handle *fwnode;
312 struct irq_fwspec fwspec;
313 int nr_chunks;
314 int ret;
315 int i;
316
317 base = ioremap(irqbase, 0x100);
318 if (!base) {
319 pr_crit("IXP4XX: could not ioremap interrupt controller\n");
320 return;
321 }
322 fwnode = irq_domain_alloc_fwnode(base);
323 if (!fwnode) {
324 pr_crit("IXP4XX: no domain handle\n");
325 return;
326 }
327 ret = ixp4xx_irq_setup(ixi, base, fwnode, is_356);
328 if (ret) {
329 pr_crit("IXP4XX: failed to set up irqchip\n");
330 irq_domain_free_fwnode(fwnode);
331 }
332
333 nr_chunks = ARRAY_SIZE(ixp4xx_irq_chunks);
334 if (!is_356)
335 nr_chunks--;
336
337 /*
338 * After adding OF support, this is no longer needed: irqs
339 * will be allocated for the respective fwnodes.
340 */
341 for (i = 0; i < nr_chunks; i++) {
342 const struct ixp4xx_irq_chunk *chunk = &ixp4xx_irq_chunks[i];
343
344 pr_info("Allocate Linux IRQs %d..%d HW IRQs %d..%d\n",
345 chunk->irq, chunk->irq + chunk->nr_irqs - 1,
346 chunk->hwirq, chunk->hwirq + chunk->nr_irqs - 1);
347 fwspec.fwnode = fwnode;
348 fwspec.param[0] = chunk->hwirq;
349 fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH;
350 fwspec.param_count = 2;
351 ret = __irq_domain_alloc_irqs(ixi->domain,
352 chunk->irq,
353 chunk->nr_irqs,
354 NUMA_NO_NODE,
355 &fwspec,
356 false,
357 NULL);
358 if (ret < 0) {
359 pr_crit("IXP4XX: can not allocate irqs in hierarchy %d\n",
360 ret);
361 return;
362 }
363 }
364}
365EXPORT_SYMBOL_GPL(ixp4xx_irq_init);
366
367#ifdef CONFIG_OF
368int __init ixp4xx_of_init_irq(struct device_node *np,
369 struct device_node *parent)
370{
371 struct ixp4xx_irq *ixi = &ixirq;
372 void __iomem *base;
373 struct fwnode_handle *fwnode;
374 bool is_356;
375 int ret;
376
377 base = of_iomap(np, 0);
378 if (!base) {
379 pr_crit("IXP4XX: could not ioremap interrupt controller\n");
380 return -ENODEV;
381 }
382 fwnode = of_node_to_fwnode(np);
383
384 /* These chip variants have 64 interrupts */
385 is_356 = of_device_is_compatible(np, "intel,ixp43x-interrupt") ||
386 of_device_is_compatible(np, "intel,ixp45x-interrupt") ||
387 of_device_is_compatible(np, "intel,ixp46x-interrupt");
388
389 ret = ixp4xx_irq_setup(ixi, base, fwnode, is_356);
390 if (ret)
391 pr_crit("IXP4XX: failed to set up irqchip\n");
392
393 return ret;
394}
395IRQCHIP_DECLARE(ixp42x, "intel,ixp42x-interrupt",
396 ixp4xx_of_init_irq);
397IRQCHIP_DECLARE(ixp43x, "intel,ixp43x-interrupt",
398 ixp4xx_of_init_irq);
399IRQCHIP_DECLARE(ixp45x, "intel,ixp45x-interrupt",
400 ixp4xx_of_init_irq);
401IRQCHIP_DECLARE(ixp46x, "intel,ixp46x-interrupt",
402 ixp4xx_of_init_irq);
403#endif
diff --git a/drivers/net/ethernet/cirrus/Kconfig b/drivers/net/ethernet/cirrus/Kconfig
index e9a0213b08c4..6238e6951336 100644
--- a/drivers/net/ethernet/cirrus/Kconfig
+++ b/drivers/net/ethernet/cirrus/Kconfig
@@ -41,7 +41,7 @@ config CS89x0_PLATFORM
41 41
42config EP93XX_ETH 42config EP93XX_ETH
43 tristate "EP93xx Ethernet support" 43 tristate "EP93xx Ethernet support"
44 depends on ARM && ARCH_EP93XX 44 depends on (ARM && ARCH_EP93XX) || COMPILE_TEST
45 select MII 45 select MII
46 help 46 help
47 This is a driver for the ethernet hardware included in EP93xx CPUs. 47 This is a driver for the ethernet hardware included in EP93xx CPUs.
diff --git a/drivers/net/ethernet/cirrus/ep93xx_eth.c b/drivers/net/ethernet/cirrus/ep93xx_eth.c
index 13dfdfca49fc..a6da9873570b 100644
--- a/drivers/net/ethernet/cirrus/ep93xx_eth.c
+++ b/drivers/net/ethernet/cirrus/ep93xx_eth.c
@@ -25,7 +25,7 @@
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27 27
28#include <mach/hardware.h> 28#include <linux/platform_data/eth-ep93xx.h>
29 29
30#define DRV_MODULE_NAME "ep93xx-eth" 30#define DRV_MODULE_NAME "ep93xx-eth"
31#define DRV_MODULE_VERSION "0.1" 31#define DRV_MODULE_VERSION "0.1"
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index ed6623a9801e..319db3ece263 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -31,14 +31,15 @@
31#include <linux/io.h> 31#include <linux/io.h>
32#include <linux/kernel.h> 32#include <linux/kernel.h>
33#include <linux/net_tstamp.h> 33#include <linux/net_tstamp.h>
34#include <linux/of.h>
34#include <linux/phy.h> 35#include <linux/phy.h>
35#include <linux/platform_device.h> 36#include <linux/platform_device.h>
36#include <linux/ptp_classify.h> 37#include <linux/ptp_classify.h>
37#include <linux/slab.h> 38#include <linux/slab.h>
38#include <linux/module.h> 39#include <linux/module.h>
39#include <mach/ixp46x_ts.h> 40#include <mach/ixp46x_ts.h>
40#include <mach/npe.h> 41#include <linux/soc/ixp4xx/npe.h>
41#include <mach/qmgr.h> 42#include <linux/soc/ixp4xx/qmgr.h>
42 43
43#define DEBUG_DESC 0 44#define DEBUG_DESC 0
44#define DEBUG_RX 0 45#define DEBUG_RX 0
@@ -1497,6 +1498,15 @@ static struct platform_driver ixp4xx_eth_driver = {
1497static int __init eth_init_module(void) 1498static int __init eth_init_module(void)
1498{ 1499{
1499 int err; 1500 int err;
1501
1502 /*
1503 * FIXME: we bail out on device tree boot but this really needs
1504 * to be fixed in a nicer way: this registers the MDIO bus before
1505 * even matching the driver infrastructure, we should only probe
1506 * detected hardware.
1507 */
1508 if (of_have_populated_dt())
1509 return -ENODEV;
1500 if ((err = ixp4xx_mdio_register())) 1510 if ((err = ixp4xx_mdio_register()))
1501 return err; 1511 return err;
1502 return platform_driver_register(&ixp4xx_eth_driver); 1512 return platform_driver_register(&ixp4xx_eth_driver);
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index 5c60dc60a8e6..46a05b6540b8 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -22,8 +22,8 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/poll.h> 23#include <linux/poll.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <mach/npe.h> 25#include <linux/soc/ixp4xx/npe.h>
26#include <mach/qmgr.h> 26#include <linux/soc/ixp4xx/qmgr.h>
27 27
28#define DEBUG_DESC 0 28#define DEBUG_DESC 0
29#define DEBUG_RX 0 29#define DEBUG_RX 0
diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c
index bbf10ae02f0e..fa168581e6b8 100644
--- a/drivers/pwm/pwm-ep93xx.c
+++ b/drivers/pwm/pwm-ep93xx.c
@@ -35,7 +35,7 @@
35 35
36#include <asm/div64.h> 36#include <asm/div64.h>
37 37
38#include <mach/platform.h> /* for ep93xx_pwm_{acquire,release}_gpio() */ 38#include <linux/soc/cirrus/ep93xx.h> /* for ep93xx_pwm_{acquire,release}_gpio() */
39 39
40#define EP93XX_PWMx_TERM_COUNT 0x00 40#define EP93XX_PWMx_TERM_COUNT 0x00
41#define EP93XX_PWMx_DUTY_CYCLE 0x04 41#define EP93XX_PWMx_DUTY_CYCLE 0x04
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
index c07b4a85253f..ae9bf20b26fa 100644
--- a/drivers/soc/Kconfig
+++ b/drivers/soc/Kconfig
@@ -6,6 +6,7 @@ source "drivers/soc/atmel/Kconfig"
6source "drivers/soc/bcm/Kconfig" 6source "drivers/soc/bcm/Kconfig"
7source "drivers/soc/fsl/Kconfig" 7source "drivers/soc/fsl/Kconfig"
8source "drivers/soc/imx/Kconfig" 8source "drivers/soc/imx/Kconfig"
9source "drivers/soc/ixp4xx/Kconfig"
9source "drivers/soc/mediatek/Kconfig" 10source "drivers/soc/mediatek/Kconfig"
10source "drivers/soc/qcom/Kconfig" 11source "drivers/soc/qcom/Kconfig"
11source "drivers/soc/renesas/Kconfig" 12source "drivers/soc/renesas/Kconfig"
diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile
index 90b686e586c6..c7c1a139ad8d 100644
--- a/drivers/soc/Makefile
+++ b/drivers/soc/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_MACH_DOVE) += dove/
11obj-y += fsl/ 11obj-y += fsl/
12obj-$(CONFIG_ARCH_GEMINI) += gemini/ 12obj-$(CONFIG_ARCH_GEMINI) += gemini/
13obj-$(CONFIG_ARCH_MXC) += imx/ 13obj-$(CONFIG_ARCH_MXC) += imx/
14obj-$(CONFIG_ARCH_IXP4XX) += ixp4xx/
14obj-$(CONFIG_SOC_XWAY) += lantiq/ 15obj-$(CONFIG_SOC_XWAY) += lantiq/
15obj-y += mediatek/ 16obj-y += mediatek/
16obj-y += amlogic/ 17obj-y += amlogic/
diff --git a/drivers/soc/ixp4xx/Kconfig b/drivers/soc/ixp4xx/Kconfig
new file mode 100644
index 000000000000..de6becdc78a2
--- /dev/null
+++ b/drivers/soc/ixp4xx/Kconfig
@@ -0,0 +1,16 @@
1menu "IXP4xx SoC drivers"
2
3config IXP4XX_QMGR
4 tristate "IXP4xx Queue Manager support"
5 help
6 This driver supports IXP4xx built-in hardware queue manager
7 and is automatically selected by Ethernet and HSS drivers.
8
9config IXP4XX_NPE
10 tristate "IXP4xx Network Processor Engine support"
11 select FW_LOADER
12 help
13 This driver supports IXP4xx built-in network coprocessors
14 and is automatically selected by Ethernet and HSS drivers.
15
16endmenu
diff --git a/drivers/soc/ixp4xx/Makefile b/drivers/soc/ixp4xx/Makefile
new file mode 100644
index 000000000000..d20d99e6df65
--- /dev/null
+++ b/drivers/soc/ixp4xx/Makefile
@@ -0,0 +1,2 @@
1obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx-qmgr.o
2obj-$(CONFIG_IXP4XX_NPE) += ixp4xx-npe.o
diff --git a/arch/arm/mach-ixp4xx/ixp4xx_npe.c b/drivers/soc/ixp4xx/ixp4xx-npe.c
index d4eb09a62863..15979d4376ab 100644
--- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c
+++ b/drivers/soc/ixp4xx/ixp4xx-npe.c
@@ -20,7 +20,9 @@
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include <mach/npe.h> 23#include <linux/of.h>
24#include <linux/platform_device.h>
25#include <linux/soc/ixp4xx/npe.h>
24 26
25#define DEBUG_MSG 0 27#define DEBUG_MSG 0
26#define DEBUG_FW 0 28#define DEBUG_FW 0
@@ -153,16 +155,10 @@ static struct {
153static struct npe npe_tab[NPE_COUNT] = { 155static struct npe npe_tab[NPE_COUNT] = {
154 { 156 {
155 .id = 0, 157 .id = 0,
156 .regs = (struct npe_regs __iomem *)IXP4XX_NPEA_BASE_VIRT,
157 .regs_phys = IXP4XX_NPEA_BASE_PHYS,
158 }, { 158 }, {
159 .id = 1, 159 .id = 1,
160 .regs = (struct npe_regs __iomem *)IXP4XX_NPEB_BASE_VIRT,
161 .regs_phys = IXP4XX_NPEB_BASE_PHYS,
162 }, { 160 }, {
163 .id = 2, 161 .id = 2,
164 .regs = (struct npe_regs __iomem *)IXP4XX_NPEC_BASE_VIRT,
165 .regs_phys = IXP4XX_NPEC_BASE_PHYS,
166 } 162 }
167}; 163};
168 164
@@ -682,28 +678,37 @@ void npe_release(struct npe *npe)
682 module_put(THIS_MODULE); 678 module_put(THIS_MODULE);
683} 679}
684 680
685 681static int ixp4xx_npe_probe(struct platform_device *pdev)
686static int __init npe_init_module(void)
687{ 682{
688
689 int i, found = 0; 683 int i, found = 0;
684 struct device *dev = &pdev->dev;
685 struct resource *res;
690 686
691 for (i = 0; i < NPE_COUNT; i++) { 687 for (i = 0; i < NPE_COUNT; i++) {
692 struct npe *npe = &npe_tab[i]; 688 struct npe *npe = &npe_tab[i];
689
690 res = platform_get_resource(pdev, IORESOURCE_MEM, i);
691 if (!res)
692 return -ENODEV;
693
693 if (!(ixp4xx_read_feature_bits() & 694 if (!(ixp4xx_read_feature_bits() &
694 (IXP4XX_FEATURE_RESET_NPEA << i))) 695 (IXP4XX_FEATURE_RESET_NPEA << i))) {
696 dev_info(dev, "NPE%d at 0x%08x-0x%08x not available\n",
697 i, res->start, res->end);
695 continue; /* NPE already disabled or not present */ 698 continue; /* NPE already disabled or not present */
696 if (!(npe->mem_res = request_mem_region(npe->regs_phys,
697 REGS_SIZE,
698 npe_name(npe)))) {
699 print_npe(KERN_ERR, npe,
700 "failed to request memory region\n");
701 continue;
702 } 699 }
700 npe->regs = devm_ioremap_resource(dev, res);
701 if (!npe->regs)
702 return -ENOMEM;
703 703
704 if (npe_reset(npe)) 704 if (npe_reset(npe)) {
705 dev_info(dev, "NPE%d at 0x%08x-0x%08x does not reset\n",
706 i, res->start, res->end);
705 continue; 707 continue;
708 }
706 npe->valid = 1; 709 npe->valid = 1;
710 dev_info(dev, "NPE%d at 0x%08x-0x%08x registered\n",
711 i, res->start, res->end);
707 found++; 712 found++;
708 } 713 }
709 714
@@ -712,19 +717,34 @@ static int __init npe_init_module(void)
712 return 0; 717 return 0;
713} 718}
714 719
715static void __exit npe_cleanup_module(void) 720static int ixp4xx_npe_remove(struct platform_device *pdev)
716{ 721{
717 int i; 722 int i;
718 723
719 for (i = 0; i < NPE_COUNT; i++) 724 for (i = 0; i < NPE_COUNT; i++)
720 if (npe_tab[i].mem_res) { 725 if (npe_tab[i].regs) {
721 npe_reset(&npe_tab[i]); 726 npe_reset(&npe_tab[i]);
722 release_resource(npe_tab[i].mem_res);
723 } 727 }
728
729 return 0;
724} 730}
725 731
726module_init(npe_init_module); 732static const struct of_device_id ixp4xx_npe_of_match[] = {
727module_exit(npe_cleanup_module); 733 {
734 .compatible = "intel,ixp4xx-network-processing-engine",
735 },
736 {},
737};
738
739static struct platform_driver ixp4xx_npe_driver = {
740 .driver = {
741 .name = "ixp4xx-npe",
742 .of_match_table = of_match_ptr(ixp4xx_npe_of_match),
743 },
744 .probe = ixp4xx_npe_probe,
745 .remove = ixp4xx_npe_remove,
746};
747module_platform_driver(ixp4xx_npe_driver);
728 748
729MODULE_AUTHOR("Krzysztof Halasa"); 749MODULE_AUTHOR("Krzysztof Halasa");
730MODULE_LICENSE("GPL v2"); 750MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
index 9d1b6b7c394c..13a8a13c9b01 100644
--- a/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
+++ b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
@@ -12,10 +12,13 @@
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <mach/qmgr.h> 15#include <linux/of.h>
16#include <linux/platform_device.h>
17#include <linux/soc/ixp4xx/qmgr.h>
16 18
17static struct qmgr_regs __iomem *qmgr_regs = IXP4XX_QMGR_BASE_VIRT; 19static struct qmgr_regs __iomem *qmgr_regs;
18static struct resource *mem_res; 20static int qmgr_irq_1;
21static int qmgr_irq_2;
19static spinlock_t qmgr_lock; 22static spinlock_t qmgr_lock;
20static u32 used_sram_bitmap[4]; /* 128 16-dword pages */ 23static u32 used_sram_bitmap[4]; /* 128 16-dword pages */
21static void (*irq_handlers[QUEUES])(void *pdev); 24static void (*irq_handlers[QUEUES])(void *pdev);
@@ -25,6 +28,94 @@ static void *irq_pdevs[QUEUES];
25char qmgr_queue_descs[QUEUES][32]; 28char qmgr_queue_descs[QUEUES][32];
26#endif 29#endif
27 30
31void qmgr_put_entry(unsigned int queue, u32 val)
32{
33#if DEBUG_QMGR
34 BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
35
36 printk(KERN_DEBUG "Queue %s(%i) put %X\n",
37 qmgr_queue_descs[queue], queue, val);
38#endif
39 __raw_writel(val, &qmgr_regs->acc[queue][0]);
40}
41
42u32 qmgr_get_entry(unsigned int queue)
43{
44 u32 val;
45 val = __raw_readl(&qmgr_regs->acc[queue][0]);
46#if DEBUG_QMGR
47 BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
48
49 printk(KERN_DEBUG "Queue %s(%i) get %X\n",
50 qmgr_queue_descs[queue], queue, val);
51#endif
52 return val;
53}
54
55static int __qmgr_get_stat1(unsigned int queue)
56{
57 return (__raw_readl(&qmgr_regs->stat1[queue >> 3])
58 >> ((queue & 7) << 2)) & 0xF;
59}
60
61static int __qmgr_get_stat2(unsigned int queue)
62{
63 BUG_ON(queue >= HALF_QUEUES);
64 return (__raw_readl(&qmgr_regs->stat2[queue >> 4])
65 >> ((queue & 0xF) << 1)) & 0x3;
66}
67
68/**
69 * qmgr_stat_empty() - checks if a hardware queue is empty
70 * @queue: queue number
71 *
72 * Returns non-zero value if the queue is empty.
73 */
74int qmgr_stat_empty(unsigned int queue)
75{
76 BUG_ON(queue >= HALF_QUEUES);
77 return __qmgr_get_stat1(queue) & QUEUE_STAT1_EMPTY;
78}
79
80/**
81 * qmgr_stat_below_low_watermark() - checks if a queue is below low watermark
82 * @queue: queue number
83 *
84 * Returns non-zero value if the queue is below low watermark.
85 */
86int qmgr_stat_below_low_watermark(unsigned int queue)
87{
88 if (queue >= HALF_QUEUES)
89 return (__raw_readl(&qmgr_regs->statne_h) >>
90 (queue - HALF_QUEUES)) & 0x01;
91 return __qmgr_get_stat1(queue) & QUEUE_STAT1_NEARLY_EMPTY;
92}
93
94/**
95 * qmgr_stat_full() - checks if a hardware queue is full
96 * @queue: queue number
97 *
98 * Returns non-zero value if the queue is full.
99 */
100int qmgr_stat_full(unsigned int queue)
101{
102 if (queue >= HALF_QUEUES)
103 return (__raw_readl(&qmgr_regs->statf_h) >>
104 (queue - HALF_QUEUES)) & 0x01;
105 return __qmgr_get_stat1(queue) & QUEUE_STAT1_FULL;
106}
107
108/**
109 * qmgr_stat_overflow() - checks if a hardware queue experienced overflow
110 * @queue: queue number
111 *
112 * Returns non-zero value if the queue experienced overflow.
113 */
114int qmgr_stat_overflow(unsigned int queue)
115{
116 return __qmgr_get_stat2(queue) & QUEUE_STAT2_OVERFLOW;
117}
118
28void qmgr_set_irq(unsigned int queue, int src, 119void qmgr_set_irq(unsigned int queue, int src,
29 void (*handler)(void *pdev), void *pdev) 120 void (*handler)(void *pdev), void *pdev)
30{ 121{
@@ -95,7 +186,7 @@ static irqreturn_t qmgr_irq2_a0(int irq, void *pdev)
95 186
96static irqreturn_t qmgr_irq(int irq, void *pdev) 187static irqreturn_t qmgr_irq(int irq, void *pdev)
97{ 188{
98 int i, half = (irq == IRQ_IXP4XX_QM1 ? 0 : 1); 189 int i, half = (irq == qmgr_irq_1 ? 0 : 1);
99 u32 req_bitmap = __raw_readl(&qmgr_regs->irqstat[half]); 190 u32 req_bitmap = __raw_readl(&qmgr_regs->irqstat[half]);
100 191
101 if (!req_bitmap) 192 if (!req_bitmap)
@@ -282,16 +373,29 @@ void qmgr_release_queue(unsigned int queue)
282 module_put(THIS_MODULE); 373 module_put(THIS_MODULE);
283} 374}
284 375
285static int qmgr_init(void) 376static int ixp4xx_qmgr_probe(struct platform_device *pdev)
286{ 377{
287 int i, err; 378 int i, err;
288 irq_handler_t handler1, handler2; 379 irq_handler_t handler1, handler2;
380 struct device *dev = &pdev->dev;
381 struct resource *res;
382 int irq1, irq2;
289 383
290 mem_res = request_mem_region(IXP4XX_QMGR_BASE_PHYS, 384 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
291 IXP4XX_QMGR_REGION_SIZE, 385 if (!res)
292 "IXP4xx Queue Manager"); 386 return -ENODEV;
293 if (mem_res == NULL) 387 qmgr_regs = devm_ioremap_resource(dev, res);
294 return -EBUSY; 388 if (!qmgr_regs)
389 return -ENOMEM;
390
391 irq1 = platform_get_irq(pdev, 0);
392 if (irq1 <= 0)
393 return irq1 ? irq1 : -EINVAL;
394 qmgr_irq_1 = irq1;
395 irq2 = platform_get_irq(pdev, 1);
396 if (irq2 <= 0)
397 return irq2 ? irq2 : -EINVAL;
398 qmgr_irq_2 = irq2;
295 399
296 /* reset qmgr registers */ 400 /* reset qmgr registers */
297 for (i = 0; i < 4; i++) { 401 for (i = 0; i < 4; i++) {
@@ -316,50 +420,62 @@ static int qmgr_init(void)
316 } else 420 } else
317 handler1 = handler2 = qmgr_irq; 421 handler1 = handler2 = qmgr_irq;
318 422
319 err = request_irq(IRQ_IXP4XX_QM1, handler1, 0, "IXP4xx Queue Manager", 423 err = devm_request_irq(dev, irq1, handler1, 0, "IXP4xx Queue Manager",
320 NULL); 424 NULL);
321 if (err) { 425 if (err) {
322 printk(KERN_ERR "qmgr: failed to request IRQ%i (%i)\n", 426 dev_err(dev, "failed to request IRQ%i (%i)\n",
323 IRQ_IXP4XX_QM1, err); 427 irq1, err);
324 goto error_irq; 428 return err;
325 } 429 }
326 430
327 err = request_irq(IRQ_IXP4XX_QM2, handler2, 0, "IXP4xx Queue Manager", 431 err = devm_request_irq(dev, irq2, handler2, 0, "IXP4xx Queue Manager",
328 NULL); 432 NULL);
329 if (err) { 433 if (err) {
330 printk(KERN_ERR "qmgr: failed to request IRQ%i (%i)\n", 434 dev_err(dev, "failed to request IRQ%i (%i)\n",
331 IRQ_IXP4XX_QM2, err); 435 irq2, err);
332 goto error_irq2; 436 return err;
333 } 437 }
334 438
335 used_sram_bitmap[0] = 0xF; /* 4 first pages reserved for config */ 439 used_sram_bitmap[0] = 0xF; /* 4 first pages reserved for config */
336 spin_lock_init(&qmgr_lock); 440 spin_lock_init(&qmgr_lock);
337 441
338 printk(KERN_INFO "IXP4xx Queue Manager initialized.\n"); 442 dev_info(dev, "IXP4xx Queue Manager initialized.\n");
339 return 0; 443 return 0;
340
341error_irq2:
342 free_irq(IRQ_IXP4XX_QM1, NULL);
343error_irq:
344 release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE);
345 return err;
346} 444}
347 445
348static void qmgr_remove(void) 446static int ixp4xx_qmgr_remove(struct platform_device *pdev)
349{ 447{
350 free_irq(IRQ_IXP4XX_QM1, NULL); 448 synchronize_irq(qmgr_irq_1);
351 free_irq(IRQ_IXP4XX_QM2, NULL); 449 synchronize_irq(qmgr_irq_2);
352 synchronize_irq(IRQ_IXP4XX_QM1); 450 return 0;
353 synchronize_irq(IRQ_IXP4XX_QM2);
354 release_mem_region(IXP4XX_QMGR_BASE_PHYS, IXP4XX_QMGR_REGION_SIZE);
355} 451}
356 452
357module_init(qmgr_init); 453static const struct of_device_id ixp4xx_qmgr_of_match[] = {
358module_exit(qmgr_remove); 454 {
455 .compatible = "intel,ixp4xx-ahb-queue-manager",
456 },
457 {},
458};
459
460static struct platform_driver ixp4xx_qmgr_driver = {
461 .driver = {
462 .name = "ixp4xx-qmgr",
463 .of_match_table = of_match_ptr(ixp4xx_qmgr_of_match),
464 },
465 .probe = ixp4xx_qmgr_probe,
466 .remove = ixp4xx_qmgr_remove,
467};
468module_platform_driver(ixp4xx_qmgr_driver);
359 469
360MODULE_LICENSE("GPL v2"); 470MODULE_LICENSE("GPL v2");
361MODULE_AUTHOR("Krzysztof Halasa"); 471MODULE_AUTHOR("Krzysztof Halasa");
362 472
473EXPORT_SYMBOL(qmgr_put_entry);
474EXPORT_SYMBOL(qmgr_get_entry);
475EXPORT_SYMBOL(qmgr_stat_empty);
476EXPORT_SYMBOL(qmgr_stat_below_low_watermark);
477EXPORT_SYMBOL(qmgr_stat_full);
478EXPORT_SYMBOL(qmgr_stat_overflow);
363EXPORT_SYMBOL(qmgr_set_irq); 479EXPORT_SYMBOL(qmgr_set_irq);
364EXPORT_SYMBOL(qmgr_enable_irq); 480EXPORT_SYMBOL(qmgr_enable_irq);
365EXPORT_SYMBOL(qmgr_disable_irq); 481EXPORT_SYMBOL(qmgr_disable_irq);
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index ca8a94f15ac0..38183ac438c6 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -40,8 +40,6 @@ struct da8xx_ohci_hcd {
40 struct phy *usb11_phy; 40 struct phy *usb11_phy;
41 struct regulator *vbus_reg; 41 struct regulator *vbus_reg;
42 struct notifier_block nb; 42 struct notifier_block nb;
43 unsigned int reg_enabled;
44 struct gpio_desc *vbus_gpio;
45 struct gpio_desc *oc_gpio; 43 struct gpio_desc *oc_gpio;
46}; 44};
47 45
@@ -92,29 +90,21 @@ static int ohci_da8xx_set_power(struct usb_hcd *hcd, int on)
92 struct device *dev = hcd->self.controller; 90 struct device *dev = hcd->self.controller;
93 int ret; 91 int ret;
94 92
95 if (da8xx_ohci->vbus_gpio) {
96 gpiod_set_value_cansleep(da8xx_ohci->vbus_gpio, on);
97 return 0;
98 }
99
100 if (!da8xx_ohci->vbus_reg) 93 if (!da8xx_ohci->vbus_reg)
101 return 0; 94 return 0;
102 95
103 if (on && !da8xx_ohci->reg_enabled) { 96 if (on) {
104 ret = regulator_enable(da8xx_ohci->vbus_reg); 97 ret = regulator_enable(da8xx_ohci->vbus_reg);
105 if (ret) { 98 if (ret) {
106 dev_err(dev, "Failed to enable regulator: %d\n", ret); 99 dev_err(dev, "Failed to enable regulator: %d\n", ret);
107 return ret; 100 return ret;
108 } 101 }
109 da8xx_ohci->reg_enabled = 1; 102 } else {
110
111 } else if (!on && da8xx_ohci->reg_enabled) {
112 ret = regulator_disable(da8xx_ohci->vbus_reg); 103 ret = regulator_disable(da8xx_ohci->vbus_reg);
113 if (ret) { 104 if (ret) {
114 dev_err(dev, "Failed to disable regulator: %d\n", ret); 105 dev_err(dev, "Failed to disable regulator: %d\n", ret);
115 return ret; 106 return ret;
116 } 107 }
117 da8xx_ohci->reg_enabled = 0;
118 } 108 }
119 109
120 return 0; 110 return 0;
@@ -124,9 +114,6 @@ static int ohci_da8xx_get_power(struct usb_hcd *hcd)
124{ 114{
125 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); 115 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
126 116
127 if (da8xx_ohci->vbus_gpio)
128 return gpiod_get_value_cansleep(da8xx_ohci->vbus_gpio);
129
130 if (da8xx_ohci->vbus_reg) 117 if (da8xx_ohci->vbus_reg)
131 return regulator_is_enabled(da8xx_ohci->vbus_reg); 118 return regulator_is_enabled(da8xx_ohci->vbus_reg);
132 119
@@ -159,9 +146,6 @@ static int ohci_da8xx_has_set_power(struct usb_hcd *hcd)
159{ 146{
160 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd); 147 struct da8xx_ohci_hcd *da8xx_ohci = to_da8xx_ohci(hcd);
161 148
162 if (da8xx_ohci->vbus_gpio)
163 return 1;
164
165 if (da8xx_ohci->vbus_reg) 149 if (da8xx_ohci->vbus_reg)
166 return 1; 150 return 1;
167 151
@@ -206,12 +190,18 @@ static int ohci_da8xx_regulator_event(struct notifier_block *nb,
206 return 0; 190 return 0;
207} 191}
208 192
209static irqreturn_t ohci_da8xx_oc_handler(int irq, void *data) 193static irqreturn_t ohci_da8xx_oc_thread(int irq, void *data)
210{ 194{
211 struct da8xx_ohci_hcd *da8xx_ohci = data; 195 struct da8xx_ohci_hcd *da8xx_ohci = data;
196 struct device *dev = da8xx_ohci->hcd->self.controller;
197 int ret;
212 198
213 if (gpiod_get_value(da8xx_ohci->oc_gpio)) 199 if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio) &&
214 gpiod_set_value(da8xx_ohci->vbus_gpio, 0); 200 da8xx_ohci->vbus_reg) {
201 ret = regulator_disable(da8xx_ohci->vbus_reg);
202 if (ret)
203 dev_err(dev, "Failed to disable regulator: %d\n", ret);
204 }
215 205
216 return IRQ_HANDLED; 206 return IRQ_HANDLED;
217} 207}
@@ -424,11 +414,6 @@ static int ohci_da8xx_probe(struct platform_device *pdev)
424 } 414 }
425 } 415 }
426 416
427 da8xx_ohci->vbus_gpio = devm_gpiod_get_optional(dev, "vbus",
428 GPIOD_OUT_HIGH);
429 if (IS_ERR(da8xx_ohci->vbus_gpio))
430 goto err;
431
432 da8xx_ohci->oc_gpio = devm_gpiod_get_optional(dev, "oc", GPIOD_IN); 417 da8xx_ohci->oc_gpio = devm_gpiod_get_optional(dev, "oc", GPIOD_IN);
433 if (IS_ERR(da8xx_ohci->oc_gpio)) 418 if (IS_ERR(da8xx_ohci->oc_gpio))
434 goto err; 419 goto err;
@@ -438,8 +423,9 @@ static int ohci_da8xx_probe(struct platform_device *pdev)
438 if (oc_irq < 0) 423 if (oc_irq < 0)
439 goto err; 424 goto err;
440 425
441 error = devm_request_irq(dev, oc_irq, ohci_da8xx_oc_handler, 426 error = devm_request_threaded_irq(dev, oc_irq, NULL,
442 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 427 ohci_da8xx_oc_thread, IRQF_TRIGGER_RISING |
428 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
443 "OHCI over-current indicator", da8xx_ohci); 429 "OHCI over-current indicator", da8xx_ohci);
444 if (error) 430 if (error)
445 goto err; 431 goto err;
diff --git a/drivers/watchdog/ixp4xx_wdt.c b/drivers/watchdog/ixp4xx_wdt.c
index dd139cda936c..9067998759e3 100644
--- a/drivers/watchdog/ixp4xx_wdt.c
+++ b/drivers/watchdog/ixp4xx_wdt.c
@@ -21,6 +21,7 @@
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/fs.h> 22#include <linux/fs.h>
23#include <linux/miscdevice.h> 23#include <linux/miscdevice.h>
24#include <linux/of.h>
24#include <linux/watchdog.h> 25#include <linux/watchdog.h>
25#include <linux/init.h> 26#include <linux/init.h>
26#include <linux/bitops.h> 27#include <linux/bitops.h>
@@ -176,6 +177,14 @@ static int __init ixp4xx_wdt_init(void)
176{ 177{
177 int ret; 178 int ret;
178 179
180 /*
181 * FIXME: we bail out on device tree boot but this really needs
182 * to be fixed in a nicer way: this registers the MDIO bus before
183 * even matching the driver infrastructure, we should only probe
184 * detected hardware.
185 */
186 if (of_have_populated_dt())
187 return -ENODEV;
179 if (!(read_cpuid_id() & 0xf) && !cpu_is_ixp46x()) { 188 if (!(read_cpuid_id() & 0xf) && !cpu_is_ixp46x()) {
180 pr_err("Rev. A0 IXP42x CPU detected - watchdog disabled\n"); 189 pr_err("Rev. A0 IXP42x CPU detected - watchdog disabled\n");
181 190
diff --git a/arch/arm/include/asm/trusted_foundations.h b/include/linux/firmware/trusted_foundations.h
index 00748350cf72..4064e7c74715 100644
--- a/arch/arm/include/asm/trusted_foundations.h
+++ b/include/linux/firmware/trusted_foundations.h
@@ -23,14 +23,24 @@
23 * PSCI standard. 23 * PSCI standard.
24 */ 24 */
25 25
26#ifndef __ASM_ARM_TRUSTED_FOUNDATIONS_H 26#ifndef __FIRMWARE_TRUSTED_FOUNDATIONS_H
27#define __ASM_ARM_TRUSTED_FOUNDATIONS_H 27#define __FIRMWARE_TRUSTED_FOUNDATIONS_H
28 28
29#include <linux/printk.h> 29#include <linux/printk.h>
30#include <linux/bug.h> 30#include <linux/bug.h>
31#include <linux/of.h> 31#include <linux/of.h>
32#include <linux/cpu.h> 32#include <linux/cpu.h>
33#include <linux/smp.h> 33#include <linux/smp.h>
34#include <linux/types.h>
35
36#include <asm/hardware/cache-l2x0.h>
37#include <asm/outercache.h>
38
39#define TF_PM_MODE_LP0 0
40#define TF_PM_MODE_LP1 1
41#define TF_PM_MODE_LP1_NO_MC_CLK 2
42#define TF_PM_MODE_LP2 3
43#define TF_PM_MODE_LP2_NOFLUSH_L2 4
34 44
35struct trusted_foundations_platform_data { 45struct trusted_foundations_platform_data {
36 unsigned int version_major; 46 unsigned int version_major;
@@ -41,8 +51,12 @@ struct trusted_foundations_platform_data {
41 51
42void register_trusted_foundations(struct trusted_foundations_platform_data *pd); 52void register_trusted_foundations(struct trusted_foundations_platform_data *pd);
43void of_register_trusted_foundations(void); 53void of_register_trusted_foundations(void);
54bool trusted_foundations_registered(void);
44 55
45#else /* CONFIG_TRUSTED_FOUNDATIONS */ 56#else /* CONFIG_TRUSTED_FOUNDATIONS */
57static inline void tf_dummy_write_sec(unsigned long val, unsigned int reg)
58{
59}
46 60
47static inline void register_trusted_foundations( 61static inline void register_trusted_foundations(
48 struct trusted_foundations_platform_data *pd) 62 struct trusted_foundations_platform_data *pd)
@@ -53,6 +67,10 @@ static inline void register_trusted_foundations(
53 */ 67 */
54 pr_err("No support for Trusted Foundations, continuing in degraded mode.\n"); 68 pr_err("No support for Trusted Foundations, continuing in degraded mode.\n");
55 pr_err("Secondary processors as well as CPU PM will be disabled.\n"); 69 pr_err("Secondary processors as well as CPU PM will be disabled.\n");
70#if IS_ENABLED(CONFIG_CACHE_L2X0)
71 pr_err("L2X0 cache will be kept disabled.\n");
72 outer_cache.write_sec = tf_dummy_write_sec;
73#endif
56#if IS_ENABLED(CONFIG_SMP) 74#if IS_ENABLED(CONFIG_SMP)
57 setup_max_cpus = 0; 75 setup_max_cpus = 0;
58#endif 76#endif
@@ -68,6 +86,11 @@ static inline void of_register_trusted_foundations(void)
68 if (of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations")) 86 if (of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations"))
69 register_trusted_foundations(NULL); 87 register_trusted_foundations(NULL);
70} 88}
89
90static inline bool trusted_foundations_registered(void)
91{
92 return false;
93}
71#endif /* CONFIG_TRUSTED_FOUNDATIONS */ 94#endif /* CONFIG_TRUSTED_FOUNDATIONS */
72 95
73#endif 96#endif
diff --git a/include/linux/irqchip/irq-ixp4xx.h b/include/linux/irqchip/irq-ixp4xx.h
new file mode 100644
index 000000000000..9395917d6936
--- /dev/null
+++ b/include/linux/irqchip/irq-ixp4xx.h
@@ -0,0 +1,12 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __IRQ_IXP4XX_H
3#define __IRQ_IXP4XX_H
4
5#include <linux/ioport.h>
6struct irq_domain;
7
8void ixp4xx_irq_init(resource_size_t irqbase,
9 bool is_356);
10struct irq_domain *ixp4xx_get_irq_domain(void);
11
12#endif /* __IRQ_IXP4XX_H */
diff --git a/include/linux/platform_data/eth-ep93xx.h b/include/linux/platform_data/eth-ep93xx.h
new file mode 100644
index 000000000000..8eef637a804d
--- /dev/null
+++ b/include/linux/platform_data/eth-ep93xx.h
@@ -0,0 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_PLATFORM_DATA_ETH_EP93XX
3#define _LINUX_PLATFORM_DATA_ETH_EP93XX
4
5struct ep93xx_eth_data {
6 unsigned char dev_addr[6];
7 unsigned char phy_id;
8};
9
10#endif
diff --git a/include/linux/platform_data/keypad-ep93xx.h b/include/linux/platform_data/keypad-ep93xx.h
index 0e36818e3680..3054fced8509 100644
--- a/include/linux/platform_data/keypad-ep93xx.h
+++ b/include/linux/platform_data/keypad-ep93xx.h
@@ -9,8 +9,7 @@ struct matrix_keymap_data;
9#define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */ 9#define EP93XX_KEYPAD_DIAG_MODE (1<<1) /* diagnostic mode */
10#define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */ 10#define EP93XX_KEYPAD_BACK_DRIVE (1<<2) /* back driving mode */
11#define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */ 11#define EP93XX_KEYPAD_TEST_MODE (1<<3) /* scan only column 0 */
12#define EP93XX_KEYPAD_KDIV (1<<4) /* 1/4 clock or 1/16 clock */ 12#define EP93XX_KEYPAD_AUTOREPEAT (1<<4) /* enable key autorepeat */
13#define EP93XX_KEYPAD_AUTOREPEAT (1<<5) /* enable key autorepeat */
14 13
15/** 14/**
16 * struct ep93xx_keypad_platform_data - platform specific device structure 15 * struct ep93xx_keypad_platform_data - platform specific device structure
@@ -24,6 +23,7 @@ struct ep93xx_keypad_platform_data {
24 unsigned int debounce; 23 unsigned int debounce;
25 unsigned int prescale; 24 unsigned int prescale;
26 unsigned int flags; 25 unsigned int flags;
26 unsigned int clk_rate;
27}; 27};
28 28
29#define EP93XX_MATRIX_ROWS (8) 29#define EP93XX_MATRIX_ROWS (8)
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h
index 1ea3aab972b4..9256c0305968 100644
--- a/include/linux/platform_data/ti-sysc.h
+++ b/include/linux/platform_data/ti-sysc.h
@@ -46,8 +46,13 @@ struct sysc_regbits {
46 s8 emufree_shift; 46 s8 emufree_shift;
47}; 47};
48 48
49#define SYSC_QUIRK_LEGACY_IDLE BIT(8) 49#define SYSC_QUIRK_SWSUP_MSTANDBY BIT(13)
50#define SYSC_QUIRK_RESET_STATUS BIT(7) 50#define SYSC_QUIRK_SWSUP_SIDLE_ACT BIT(12)
51#define SYSC_QUIRK_SWSUP_SIDLE BIT(11)
52#define SYSC_QUIRK_EXT_OPT_CLOCK BIT(10)
53#define SYSC_QUIRK_LEGACY_IDLE BIT(9)
54#define SYSC_QUIRK_RESET_STATUS BIT(8)
55#define SYSC_QUIRK_NO_IDLE BIT(7)
51#define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6) 56#define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)
52#define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5) 57#define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5)
53#define SYSC_QUIRK_OPT_CLKS_NEEDED BIT(4) 58#define SYSC_QUIRK_OPT_CLKS_NEEDED BIT(4)
diff --git a/include/linux/platform_data/timer-ixp4xx.h b/include/linux/platform_data/timer-ixp4xx.h
new file mode 100644
index 000000000000..ee92ae7edaed
--- /dev/null
+++ b/include/linux/platform_data/timer-ixp4xx.h
@@ -0,0 +1,11 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __TIMER_IXP4XX_H
3#define __TIMER_IXP4XX_H
4
5#include <linux/ioport.h>
6
7void __init ixp4xx_timer_setup(resource_size_t timerbase,
8 int timer_irq,
9 unsigned int timer_freq);
10
11#endif
diff --git a/include/linux/soc/cirrus/ep93xx.h b/include/linux/soc/cirrus/ep93xx.h
new file mode 100644
index 000000000000..56fbe2dc59b1
--- /dev/null
+++ b/include/linux/soc/cirrus/ep93xx.h
@@ -0,0 +1,37 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _SOC_EP93XX_H
3#define _SOC_EP93XX_H
4
5struct platform_device;
6
7#define EP93XX_CHIP_REV_D0 3
8#define EP93XX_CHIP_REV_D1 4
9#define EP93XX_CHIP_REV_E0 5
10#define EP93XX_CHIP_REV_E1 6
11#define EP93XX_CHIP_REV_E2 7
12
13#ifdef CONFIG_ARCH_EP93XX
14int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
15void ep93xx_pwm_release_gpio(struct platform_device *pdev);
16int ep93xx_ide_acquire_gpio(struct platform_device *pdev);
17void ep93xx_ide_release_gpio(struct platform_device *pdev);
18int ep93xx_keypad_acquire_gpio(struct platform_device *pdev);
19void ep93xx_keypad_release_gpio(struct platform_device *pdev);
20int ep93xx_i2s_acquire(void);
21void ep93xx_i2s_release(void);
22unsigned int ep93xx_chip_revision(void);
23
24#else
25static inline int ep93xx_pwm_acquire_gpio(struct platform_device *pdev) { return 0; }
26static inline void ep93xx_pwm_release_gpio(struct platform_device *pdev) {}
27static inline int ep93xx_ide_acquire_gpio(struct platform_device *pdev) { return 0; }
28static inline void ep93xx_ide_release_gpio(struct platform_device *pdev) {}
29static inline int ep93xx_keypad_acquire_gpio(struct platform_device *pdev) { return 0; }
30static inline void ep93xx_keypad_release_gpio(struct platform_device *pdev) {}
31static inline int ep93xx_i2s_acquire(void) { return 0; }
32static inline void ep93xx_i2s_release(void) {}
33static inline unsigned int ep93xx_chip_revision(void) { return 0; }
34
35#endif
36
37#endif
diff --git a/arch/arm/mach-ixp4xx/include/mach/npe.h b/include/linux/soc/ixp4xx/npe.h
index 3a980845e557..2a91f465d456 100644
--- a/arch/arm/mach-ixp4xx/include/mach/npe.h
+++ b/include/linux/soc/ixp4xx/npe.h
@@ -16,9 +16,7 @@ struct npe_regs {
16}; 16};
17 17
18struct npe { 18struct npe {
19 struct resource *mem_res;
20 struct npe_regs __iomem *regs; 19 struct npe_regs __iomem *regs;
21 u32 regs_phys;
22 int id; 20 int id;
23 int valid; 21 int valid;
24}; 22};
diff --git a/include/linux/soc/ixp4xx/qmgr.h b/include/linux/soc/ixp4xx/qmgr.h
new file mode 100644
index 000000000000..bed8ee94fa57
--- /dev/null
+++ b/include/linux/soc/ixp4xx/qmgr.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (C) 2007 Krzysztof Halasa <khc@pm.waw.pl>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License
6 * as published by the Free Software Foundation.
7 */
8
9#ifndef IXP4XX_QMGR_H
10#define IXP4XX_QMGR_H
11
12#include <linux/io.h>
13#include <linux/kernel.h>
14
15#define DEBUG_QMGR 0
16
17#define HALF_QUEUES 32
18#define QUEUES 64
19#define MAX_QUEUE_LENGTH 4 /* in dwords */
20
21#define QUEUE_STAT1_EMPTY 1 /* queue status bits */
22#define QUEUE_STAT1_NEARLY_EMPTY 2
23#define QUEUE_STAT1_NEARLY_FULL 4
24#define QUEUE_STAT1_FULL 8
25#define QUEUE_STAT2_UNDERFLOW 1
26#define QUEUE_STAT2_OVERFLOW 2
27
28#define QUEUE_WATERMARK_0_ENTRIES 0
29#define QUEUE_WATERMARK_1_ENTRY 1
30#define QUEUE_WATERMARK_2_ENTRIES 2
31#define QUEUE_WATERMARK_4_ENTRIES 3
32#define QUEUE_WATERMARK_8_ENTRIES 4
33#define QUEUE_WATERMARK_16_ENTRIES 5
34#define QUEUE_WATERMARK_32_ENTRIES 6
35#define QUEUE_WATERMARK_64_ENTRIES 7
36
37/* queue interrupt request conditions */
38#define QUEUE_IRQ_SRC_EMPTY 0
39#define QUEUE_IRQ_SRC_NEARLY_EMPTY 1
40#define QUEUE_IRQ_SRC_NEARLY_FULL 2
41#define QUEUE_IRQ_SRC_FULL 3
42#define QUEUE_IRQ_SRC_NOT_EMPTY 4
43#define QUEUE_IRQ_SRC_NOT_NEARLY_EMPTY 5
44#define QUEUE_IRQ_SRC_NOT_NEARLY_FULL 6
45#define QUEUE_IRQ_SRC_NOT_FULL 7
46
47struct qmgr_regs {
48 u32 acc[QUEUES][MAX_QUEUE_LENGTH]; /* 0x000 - 0x3FF */
49 u32 stat1[4]; /* 0x400 - 0x40F */
50 u32 stat2[2]; /* 0x410 - 0x417 */
51 u32 statne_h; /* 0x418 - queue nearly empty */
52 u32 statf_h; /* 0x41C - queue full */
53 u32 irqsrc[4]; /* 0x420 - 0x42F IRC source */
54 u32 irqen[2]; /* 0x430 - 0x437 IRQ enabled */
55 u32 irqstat[2]; /* 0x438 - 0x43F - IRQ access only */
56 u32 reserved[1776];
57 u32 sram[2048]; /* 0x2000 - 0x3FFF - config and buffer */
58};
59
60void qmgr_put_entry(unsigned int queue, u32 val);
61u32 qmgr_get_entry(unsigned int queue);
62int qmgr_stat_empty(unsigned int queue);
63int qmgr_stat_below_low_watermark(unsigned int queue);
64int qmgr_stat_full(unsigned int queue);
65int qmgr_stat_overflow(unsigned int queue);
66void qmgr_release_queue(unsigned int queue);
67void qmgr_set_irq(unsigned int queue, int src,
68 void (*handler)(void *pdev), void *pdev);
69void qmgr_enable_irq(unsigned int queue);
70void qmgr_disable_irq(unsigned int queue);
71
72/* request_ and release_queue() must be called from non-IRQ context */
73
74#if DEBUG_QMGR
75extern char qmgr_queue_descs[QUEUES][32];
76
77int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
78 unsigned int nearly_empty_watermark,
79 unsigned int nearly_full_watermark,
80 const char *desc_format, const char* name);
81#else
82int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
83 unsigned int nearly_empty_watermark,
84 unsigned int nearly_full_watermark);
85#define qmgr_request_queue(queue, len, nearly_empty_watermark, \
86 nearly_full_watermark, desc_format, name) \
87 __qmgr_request_queue(queue, len, nearly_empty_watermark, \
88 nearly_full_watermark)
89#endif
90
91#endif
diff --git a/sound/soc/cirrus/edb93xx.c b/sound/soc/cirrus/edb93xx.c
index 3d011abaa266..f678b4c1514a 100644
--- a/sound/soc/cirrus/edb93xx.c
+++ b/sound/soc/cirrus/edb93xx.c
@@ -22,11 +22,11 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/soc/cirrus/ep93xx.h>
25#include <sound/core.h> 26#include <sound/core.h>
26#include <sound/pcm.h> 27#include <sound/pcm.h>
27#include <sound/soc.h> 28#include <sound/soc.h>
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
29#include <mach/hardware.h>
30 30
31static int edb93xx_hw_params(struct snd_pcm_substream *substream, 31static int edb93xx_hw_params(struct snd_pcm_substream *substream,
32 struct snd_pcm_hw_params *params) 32 struct snd_pcm_hw_params *params)
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index cd5a939ad608..c6bc447429af 100644
--- a/sound/soc/cirrus/ep93xx-ac97.c
+++ b/sound/soc/cirrus/ep93xx-ac97.c
@@ -24,6 +24,7 @@
24#include <sound/soc.h> 24#include <sound/soc.h>
25 25
26#include <linux/platform_data/dma-ep93xx.h> 26#include <linux/platform_data/dma-ep93xx.h>
27#include <linux/soc/cirrus/ep93xx.h>
27 28
28#include "ep93xx-pcm.h" 29#include "ep93xx-pcm.h"
29 30
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c
index 0918c5da575a..beab7c516855 100644
--- a/sound/soc/cirrus/ep93xx-i2s.c
+++ b/sound/soc/cirrus/ep93xx-i2s.c
@@ -27,9 +27,8 @@
27#include <sound/initval.h> 27#include <sound/initval.h>
28#include <sound/soc.h> 28#include <sound/soc.h>
29 29
30#include <mach/hardware.h>
31#include <mach/ep93xx-regs.h>
32#include <linux/platform_data/dma-ep93xx.h> 30#include <linux/platform_data/dma-ep93xx.h>
31#include <linux/soc/cirrus/ep93xx.h>
33 32
34#include "ep93xx-pcm.h" 33#include "ep93xx-pcm.h"
35 34
diff --git a/sound/soc/cirrus/simone.c b/sound/soc/cirrus/simone.c
index 1ec661834e5a..cb850530331b 100644
--- a/sound/soc/cirrus/simone.c
+++ b/sound/soc/cirrus/simone.c
@@ -13,13 +13,13 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/soc/cirrus/ep93xx.h>
16 17
17#include <sound/core.h> 18#include <sound/core.h>
18#include <sound/pcm.h> 19#include <sound/pcm.h>
19#include <sound/soc.h> 20#include <sound/soc.h>
20 21
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
22#include <mach/hardware.h>
23 23
24static struct snd_soc_dai_link simone_dai = { 24static struct snd_soc_dai_link simone_dai = {
25 .name = "AC97", 25 .name = "AC97",
diff --git a/sound/soc/cirrus/snappercl15.c b/sound/soc/cirrus/snappercl15.c
index 11ff7b2672b2..dea4909154c8 100644
--- a/sound/soc/cirrus/snappercl15.c
+++ b/sound/soc/cirrus/snappercl15.c
@@ -13,12 +13,12 @@
13 13
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/soc/cirrus/ep93xx.h>
16#include <sound/core.h> 17#include <sound/core.h>
17#include <sound/pcm.h> 18#include <sound/pcm.h>
18#include <sound/soc.h> 19#include <sound/soc.h>
19 20
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <mach/hardware.h>
22 22
23#include "../codecs/tlv320aic23.h" 23#include "../codecs/tlv320aic23.h"
24 24