aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-16 17:05:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-16 17:05:12 -0500
commit8c609698569578913ad40bb160b97c3f6cfa15ec (patch)
treea8a0a3b90ec9056a05f62a1c84970b5f34a3c139
parent18c83d2c0390fd0e8336ad090a047c56037d19f5 (diff)
parentfa32475ad56d339178c9be12678906f2b39e3b47 (diff)
Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC platform updates from Arnd Bergmann: "Most of the commits are for defconfig changes, to enable newly added drivers or features that people have started using. For the changed lines lines, we have mostly cleanups, the affected platforms are OMAP, Versatile, EP93xx, Samsung, Broadcom, i.MX, and Actions. The largest single change is the introduction of the TI "sysc" bus driver, with the intention of cleaning up more legacy code. Two new SoC platforms get added this time: - Allwinner R40 is a modernized version of the A20 chip, now with a Quad-Core ARM Cortex-A7. According to the manufacturer, it is intended for "Smart Hardware" - Broadcom Hurricane 2 (Aka Strataconnect BCM5334X) is a family of chips meant for managed gigabit ethernet switches, based around a Cortex-A9 CPU. Finally, we gain SMP support for two platforms: Renesas R-Car E2 and Amlogic Meson8/8b, which were previously added but only supported uniprocessor operation" * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (118 commits) ARM: multi_v7_defconfig: Select RPMSG_VIRTIO as module ARM: multi_v7_defconfig: enable CONFIG_GPIO_UNIPHIER arm64: defconfig: enable CONFIG_GPIO_UNIPHIER ARM: meson: enable MESON_IRQ_GPIO in Kconfig for meson8b ARM: meson: Add SMP bringup code for Meson8 and Meson8b ARM: smp_scu: allow the platform code to read the SCU CPU status ARM: smp_scu: add a helper for powering on a specific CPU dt-bindings: Amlogic: Add Meson8 and Meson8b SMP related documentation ARM: OMAP3: Delete an unnecessary variable initialisation in omap3xxx_hwmod_init() ARM: OMAP3: Use common error handling code in omap3xxx_hwmod_init() ARM: defconfig: select the right SX150X driver arm64: defconfig: Enable QCOM_IOMMU arm64: Add ThunderX drivers to defconfig arm64: defconfig: Enable Tegra PCI controller cpufreq: imx6q: Move speed grading check to cpufreq driver arm64: defconfig: re-enable Qualcomm DB410c USB ARM: configs: stm32: Add MDMA support in STM32 defconfig ARM: imx: Enable cpuidle for i.MX6DL starting at 1.1 bus: ti-sysc: Fix unbalanced pm_runtime_enable by adding remove bus: ti-sysc: mark PM functions as __maybe_unused ...
-rw-r--r--Documentation/arm/sunxi/README11
-rw-r--r--Documentation/devicetree/bindings/arm/amlogic/pmu.txt18
-rw-r--r--Documentation/devicetree/bindings/arm/amlogic/smp-sram.txt32
-rw-r--r--Documentation/devicetree/bindings/arm/cpus.txt2
-rw-r--r--Documentation/devicetree/bindings/arm/omap/ctrl.txt2
-rw-r--r--Documentation/devicetree/bindings/arm/sunxi.txt2
-rw-r--r--Documentation/devicetree/bindings/bus/ti-sysc.txt93
-rw-r--r--Documentation/devicetree/bindings/memory-controllers/ti/emif.txt6
-rw-r--r--Documentation/devicetree/bindings/power/ti-smartreflex.txt47
-rw-r--r--MAINTAINERS2
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/Kconfig.debug20
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi10
-rw-r--r--arch/arm/boot/dts/dra7.dtsi34
-rw-r--r--arch/arm/boot/dts/omap3.dtsi1
-rw-r--r--arch/arm/boot/dts/omap4.dtsi256
-rw-r--r--arch/arm/boot/dts/omap5.dtsi1
-rw-r--r--arch/arm/configs/davinci_all_defconfig4
-rw-r--r--arch/arm/configs/exynos_defconfig2
-rw-r--r--arch/arm/configs/imx_v6_v7_defconfig2
-rw-r--r--arch/arm/configs/keystone_defconfig2
-rw-r--r--arch/arm/configs/lpc32xx_defconfig2
-rw-r--r--arch/arm/configs/multi_v7_defconfig7
-rw-r--r--arch/arm/configs/qcom_defconfig42
-rw-r--r--arch/arm/configs/stm32_defconfig11
-rw-r--r--arch/arm/include/asm/smp_scu.h12
-rw-r--r--arch/arm/include/debug/brcmstb.S3
-rw-r--r--arch/arm/include/uapi/asm/ptrace.h1
-rw-r--r--arch/arm/kernel/smp_scu.c43
-rw-r--r--arch/arm/mach-actions/Makefile4
-rw-r--r--arch/arm/mach-actions/headsmp.S52
-rw-r--r--arch/arm/mach-actions/platsmp.c2
-rw-r--r--arch/arm/mach-bcm/Kconfig9
-rw-r--r--arch/arm/mach-bcm/Makefile8
-rw-r--r--arch/arm/mach-bcm/bcm_hr2.c25
-rw-r--r--arch/arm/mach-bcm/board_bcm2835.c11
-rw-r--r--arch/arm/mach-bcm/platsmp.c38
-rw-r--r--arch/arm/mach-bcm/platsmp.h10
-rw-r--r--arch/arm/mach-ep93xx/simone.c54
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c46
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.h3
-rw-r--r--arch/arm/mach-exynos/Kconfig5
-rw-r--r--arch/arm/mach-exynos/common.h11
-rw-r--r--arch/arm/mach-exynos/exynos.c2
-rw-r--r--arch/arm/mach-exynos/firmware.c5
-rw-r--r--arch/arm/mach-exynos/pm.c3
-rw-r--r--arch/arm/mach-exynos/suspend.c4
-rw-r--r--arch/arm/mach-imx/3ds_debugboard.c2
-rw-r--r--arch/arm/mach-imx/cpuidle-imx5.c1
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c9
-rw-r--r--arch/arm/mach-imx/mach-mx31lite.c2
-rw-r--r--arch/arm/mach-imx/mx31moboard-devboard.c1
-rw-r--r--arch/arm/mach-imx/mx31moboard-marxbot.c1
-rw-r--r--arch/arm/mach-integrator/Makefile2
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c2
-rw-r--r--arch/arm/mach-integrator/pci_v3.c900
-rw-r--r--arch/arm/mach-integrator/pci_v3.h10
-rw-r--r--arch/arm/mach-meson/Kconfig2
-rw-r--r--arch/arm/mach-meson/Makefile1
-rw-r--r--arch/arm/mach-meson/platsmp.c440
-rw-r--r--arch/arm/mach-mxs/pm.c2
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c2
-rw-r--r--arch/arm/mach-omap1/board-fsample.c2
-rw-r--r--arch/arm/mach-omap1/board-h2.c2
-rw-r--r--arch/arm/mach-omap1/board-h3.c2
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c2
-rw-r--r--arch/arm/mach-omap1/board-innovator.c4
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c2
-rw-r--r--arch/arm/mach-omap1/board-osk.c2
-rw-r--r--arch/arm/mach-omap1/board-palmte.c2
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c2
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c2
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c2
-rw-r--r--arch/arm/mach-omap1/board-sx1.c2
-rw-r--r--arch/arm/mach-omap2/Kconfig1
-rw-r--r--arch/arm/mach-omap2/Makefile3
-rw-r--r--arch/arm/mach-omap2/common.h1
-rw-r--r--arch/arm/mach-omap2/dma.c2
-rw-r--r--arch/arm/mach-omap2/hdq1w.c22
-rw-r--r--arch/arm/mach-omap2/id.c5
-rw-r--r--arch/arm/mach-omap2/omap4-common.c24
-rw-r--r--arch/arm/mach-omap2/omap_device.c294
-rw-r--r--arch/arm/mach-omap2/omap_device.h4
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c569
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h88
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c27
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c15
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_interconnect_data.c130
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c6
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_data.c39
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c61
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c548
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_54xx_data.c20
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_7xx_data.c57
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_81xx_data.c44
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_common_data.h41
-rw-r--r--arch/arm/mach-omap2/prcm-common.h1
-rw-r--r--arch/arm/mach-omap2/prm.h2
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c14
-rw-r--r--arch/arm/mach-omap2/prm44xx.c21
-rw-r--r--arch/arm/mach-omap2/prm_common.c12
-rw-r--r--arch/arm/mach-omap2/soc.h2
-rw-r--r--arch/arm/mach-s3c24xx/iotiming-s3c2410.c8
-rw-r--r--arch/arm/mach-s3c24xx/iotiming-s3c2412.c8
-rw-r--r--arch/arm/mach-s3c64xx/dev-backlight.c10
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/common.h2
-rw-r--r--arch/arm/mach-shmobile/headsmp-apmu.S39
-rw-r--r--arch/arm/mach-shmobile/platsmp-apmu.c2
-rw-r--r--arch/arm/mach-shmobile/setup-rcar-gen2.c20
-rw-r--r--arch/arm/mach-sunxi/sunxi.c1
-rw-r--r--arch/arm/mach-vexpress/spc.c8
-rw-r--r--arch/arm/plat-omap/dma.c12
-rw-r--r--arch/arm/plat-omap/dmtimer.c10
-rw-r--r--arch/arm/plat-samsung/adc.c12
-rw-r--r--arch/arm/plat-samsung/devs.c33
-rw-r--r--arch/arm/plat-samsung/platformdata.c4
-rw-r--r--arch/arm64/configs/defconfig17
-rw-r--r--drivers/bus/Kconfig7
-rw-r--r--drivers/bus/Makefile1
-rw-r--r--drivers/bus/ti-sysc.c583
-rw-r--r--drivers/clk/bcm/clk-bcm2835-aux.c1
-rw-r--r--drivers/clk/bcm/clk-bcm2835.c30
-rw-r--r--drivers/irqchip/irq-bcm2836.c79
-rw-r--r--include/linux/clk/bcm2835.h24
-rw-r--r--include/linux/irqchip/irq-bcm2836.h70
130 files changed, 2267 insertions, 3144 deletions
diff --git a/Documentation/arm/sunxi/README b/Documentation/arm/sunxi/README
index d7b1f016bd62..f8efc21998bf 100644
--- a/Documentation/arm/sunxi/README
+++ b/Documentation/arm/sunxi/README
@@ -33,6 +33,11 @@ SunXi family
33 33
34 - Next Thing Co GR8 (sun5i) 34 - Next Thing Co GR8 (sun5i)
35 35
36 * Single ARM Cortex-A7 based SoCs
37 - Allwinner V3s (sun8i)
38 + Datasheet
39 http://linux-sunxi.org/File:Allwinner_V3s_Datasheet_V1.0.pdf
40
36 * Dual ARM Cortex-A7 based SoCs 41 * Dual ARM Cortex-A7 based SoCs
37 - Allwinner A20 (sun7i) 42 - Allwinner A20 (sun7i)
38 + User Manual 43 + User Manual
@@ -71,9 +76,11 @@ SunXi family
71 + Datasheet 76 + Datasheet
72 http://dl.linux-sunxi.org/H3/Allwinner_H3_Datasheet_V1.0.pdf 77 http://dl.linux-sunxi.org/H3/Allwinner_H3_Datasheet_V1.0.pdf
73 78
74 - Allwinner V3s (sun8i) 79 - Allwinner R40 (sun8i)
75 + Datasheet 80 + Datasheet
76 http://linux-sunxi.org/File:Allwinner_V3s_Datasheet_V1.0.pdf 81 https://github.com/tinalinux/docs/raw/r40-v1.y/R40_Datasheet_V1.0.pdf
82 + User Manual
83 https://github.com/tinalinux/docs/raw/r40-v1.y/Allwinner_R40_User_Manual_V1.0.pdf
77 84
78 * Quad ARM Cortex-A15, Quad ARM Cortex-A7 based SoCs 85 * Quad ARM Cortex-A15, Quad ARM Cortex-A7 based SoCs
79 - Allwinner A80 86 - Allwinner A80
diff --git a/Documentation/devicetree/bindings/arm/amlogic/pmu.txt b/Documentation/devicetree/bindings/arm/amlogic/pmu.txt
new file mode 100644
index 000000000000..72f8d08198b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/amlogic/pmu.txt
@@ -0,0 +1,18 @@
1Amlogic Meson8 and Meson8b power-management-unit:
2-------------------------------------------------
3
4The pmu is used to turn off and on different power domains of the SoCs
5This includes the power to the CPU cores.
6
7Required node properties:
8- compatible value : depending on the SoC this should be one of:
9 "amlogic,meson8-pmu"
10 "amlogic,meson8b-pmu"
11- reg : physical base address and the size of the registers window
12
13Example:
14
15 pmu@c81000e4 {
16 compatible = "amlogic,meson8b-pmu", "syscon";
17 reg = <0xc81000e0 0x18>;
18 };
diff --git a/Documentation/devicetree/bindings/arm/amlogic/smp-sram.txt b/Documentation/devicetree/bindings/arm/amlogic/smp-sram.txt
new file mode 100644
index 000000000000..3473ddaadfac
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/amlogic/smp-sram.txt
@@ -0,0 +1,32 @@
1Amlogic Meson8 and Meson8b SRAM for smp bringup:
2------------------------------------------------
3
4Amlogic's SMP-capable SoCs use part of the sram for the bringup of the cores.
5Once the core gets powered up it executes the code that is residing at a
6specific location.
7
8Therefore a reserved section sub-node has to be added to the mmio-sram
9declaration.
10
11Required sub-node properties:
12- compatible : depending on the SoC this should be one of:
13 "amlogic,meson8-smp-sram"
14 "amlogic,meson8b-smp-sram"
15
16The rest of the properties should follow the generic mmio-sram discription
17found in ../../misc/sram.txt
18
19Example:
20
21 sram: sram@d9000000 {
22 compatible = "mmio-sram";
23 reg = <0xd9000000 0x20000>;
24 #address-cells = <1>;
25 #size-cells = <1>;
26 ranges = <0 0xd9000000 0x20000>;
27
28 smp-sram@1ff80 {
29 compatible = "amlogic,meson8b-smp-sram";
30 reg = <0x1ff80 0x8>;
31 };
32 };
diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt
index b92f12bd5244..a0009b72e9be 100644
--- a/Documentation/devicetree/bindings/arm/cpus.txt
+++ b/Documentation/devicetree/bindings/arm/cpus.txt
@@ -197,6 +197,8 @@ described below.
197 "actions,s500-smp" 197 "actions,s500-smp"
198 "allwinner,sun6i-a31" 198 "allwinner,sun6i-a31"
199 "allwinner,sun8i-a23" 199 "allwinner,sun8i-a23"
200 "amlogic,meson8-smp"
201 "amlogic,meson8b-smp"
200 "arm,realview-smp" 202 "arm,realview-smp"
201 "brcm,bcm11351-cpu-method" 203 "brcm,bcm11351-cpu-method"
202 "brcm,bcm23550" 204 "brcm,bcm23550"
diff --git a/Documentation/devicetree/bindings/arm/omap/ctrl.txt b/Documentation/devicetree/bindings/arm/omap/ctrl.txt
index 3a4e5901ce31..ce8dabf8c0f9 100644
--- a/Documentation/devicetree/bindings/arm/omap/ctrl.txt
+++ b/Documentation/devicetree/bindings/arm/omap/ctrl.txt
@@ -21,6 +21,8 @@ Required properties:
21 "ti,omap3-scm" 21 "ti,omap3-scm"
22 "ti,omap4-scm-core" 22 "ti,omap4-scm-core"
23 "ti,omap4-scm-padconf-core" 23 "ti,omap4-scm-padconf-core"
24 "ti,omap4-scm-wkup"
25 "ti,omap4-scm-padconf-wkup"
24 "ti,omap5-scm-core" 26 "ti,omap5-scm-core"
25 "ti,omap5-scm-padconf-core" 27 "ti,omap5-scm-padconf-core"
26 "ti,dra7-scm-core" 28 "ti,dra7-scm-core"
diff --git a/Documentation/devicetree/bindings/arm/sunxi.txt b/Documentation/devicetree/bindings/arm/sunxi.txt
index d2c46449b4eb..e4beec3d9ad3 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.txt
+++ b/Documentation/devicetree/bindings/arm/sunxi.txt
@@ -14,6 +14,8 @@ using one of the following compatible strings:
14 allwinner,sun8i-a83t 14 allwinner,sun8i-a83t
15 allwinner,sun8i-h2-plus 15 allwinner,sun8i-h2-plus
16 allwinner,sun8i-h3 16 allwinner,sun8i-h3
17 allwinner-sun8i-r40
18 allwinner,sun8i-v3s
17 allwinner,sun9i-a80 19 allwinner,sun9i-a80
18 allwinner,sun50i-a64 20 allwinner,sun50i-a64
19 nextthing,gr8 21 nextthing,gr8
diff --git a/Documentation/devicetree/bindings/bus/ti-sysc.txt b/Documentation/devicetree/bindings/bus/ti-sysc.txt
new file mode 100644
index 000000000000..fb1790e39398
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/ti-sysc.txt
@@ -0,0 +1,93 @@
1Texas Instruments sysc interconnect target module wrapper binding
2
3Texas Instruments SoCs can have a generic interconnect target module
4hardware for devices connected to various interconnects such as L3
5interconnect (Arteris NoC) and L4 interconnect (Sonics s3220). The sysc
6is mostly used for interaction between module and PRCM. It participates
7in the OCP Disconnect Protocol but other than that is mostly independent
8of the interconnect.
9
10Each interconnect target module can have one or more devices connected to
11it. There is a set of control registers for managing interconnect target
12module clocks, idle modes and interconnect level resets for the module.
13
14These control registers are sprinkled into the unused register address
15space of the first child device IP block managed by the interconnect
16target module and typically are named REVISION, SYSCONFIG and SYSSTATUS.
17
18Required standard properties:
19
20- compatible shall be one of the following generic types:
21
22 "ti,sysc-omap2"
23 "ti,sysc-omap4"
24 "ti,sysc-omap4-simple"
25
26 or one of the following derivative types for hardware
27 needing special workarounds:
28
29 "ti,sysc-omap3430-sr"
30 "ti,sysc-omap3630-sr"
31 "ti,sysc-omap4-sr"
32 "ti,sysc-omap3-sham"
33 "ti,sysc-omap-aes"
34 "ti,sysc-mcasp"
35 "ti,sysc-usb-host-fs"
36
37- reg shall have register areas implemented for the interconnect
38 target module in question such as revision, sysc and syss
39
40- reg-names shall contain the register names implemented for the
41 interconnect target module in question such as
42 "rev, "sysc", and "syss"
43
44- ranges shall contain the interconnect target module IO range
45 available for one or more child device IP blocks managed
46 by the interconnect target module, the ranges may include
47 multiple ranges such as device L4 range for control and
48 parent L3 range for DMA access
49
50Optional properties:
51
52- clocks clock specifier for each name in the clock-names as
53 specified in the binding documentation for ti-clkctrl,
54 typically available for all interconnect targets on TI SoCs
55 based on omap4 except if it's read-only register in hwauto
56 mode as for example omap4 L4_CFG_CLKCTRL
57
58- clock-names should contain at least "fck", and optionally also "ick"
59 depending on the SoC and the interconnect target module
60
61- ti,hwmods optional TI interconnect module name to use legacy
62 hwmod platform data
63
64
65Example: Single instance of MUSB controller on omap4 using interconnect ranges
66using offsets from l4_cfg second segment (0x4a000000 + 0x80000 = 0x4a0ab000):
67
68 target-module@2b000 { /* 0x4a0ab000, ap 84 12.0 */
69 compatible = "ti,sysc-omap2";
70 ti,hwmods = "usb_otg_hs";
71 reg = <0x2b400 0x4>,
72 <0x2b404 0x4>,
73 <0x2b408 0x4>;
74 reg-names = "rev", "sysc", "syss";
75 clocks = <&l3_init_clkctrl OMAP4_USB_OTG_HS_CLKCTRL 0>;
76 clock-names = "fck";
77 #address-cells = <1>;
78 #size-cells = <1>;
79 ranges = <0 0x2b000 0x1000>;
80
81 usb_otg_hs: otg@0 {
82 compatible = "ti,omap4-musb";
83 reg = <0x0 0x7ff>;
84 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>,
85 <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>;
86 usb-phy = <&usb2_phy>;
87 ...
88 };
89 };
90
91Note that other SoCs, such as am335x can have multipe child devices. On am335x
92there are two MUSB instances, two USB PHY instances, and a single CPPI41 DMA
93instance as children of a single interconnet target module.
diff --git a/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt b/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
index 0db60470ebb6..fd823d6091b2 100644
--- a/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
+++ b/Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
@@ -7,8 +7,10 @@ of the EMIF IP and memory parts attached to it.
7 7
8Required properties: 8Required properties:
9- compatible : Should be of the form "ti,emif-<ip-rev>" where <ip-rev> 9- compatible : Should be of the form "ti,emif-<ip-rev>" where <ip-rev>
10 is the IP revision of the specific EMIF instance. 10 is the IP revision of the specific EMIF instance. For newer controllers,
11 For am437x should be ti,emif-am4372. 11 compatible should be one of the following:
12 "ti,emif-am3352"
13 "ti,emif-am4372"
12 14
13- phy-type : <u32> indicating the DDR phy type. Following are the 15- phy-type : <u32> indicating the DDR phy type. Following are the
14 allowed values 16 allowed values
diff --git a/Documentation/devicetree/bindings/power/ti-smartreflex.txt b/Documentation/devicetree/bindings/power/ti-smartreflex.txt
new file mode 100644
index 000000000000..9780957c9115
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/ti-smartreflex.txt
@@ -0,0 +1,47 @@
1Texas Instruments SmartReflex binding
2
3SmartReflex is used to set and adjust the SoC operating points.
4
5
6Required properties:
7
8compatible: Shall be one of the following:
9 "ti,omap3-smartreflex-core"
10 "ti,omap3-smartreflex-iva"
11 "ti,omap4-smartreflex-core"
12 "ti,omap4-smartreflex-mpu"
13 "ti,omap4-smartreflex-iva"
14
15reg: Shall contain the device instance IO range
16
17interrupts: Shall contain the device instance interrupt
18
19
20Optional properties:
21
22ti,hwmods: Shall contain the TI interconnect module name if needed
23 by the SoC
24
25
26Example:
27
28 smartreflex_iva: smartreflex@4a0db000 {
29 compatible = "ti,omap4-smartreflex-iva";
30 reg = <0x4a0db000 0x80>;
31 interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
32 ti,hwmods = "smartreflex_iva";
33 };
34
35 smartreflex_core: smartreflex@4a0dd000 {
36 compatible = "ti,omap4-smartreflex-core";
37 reg = <0x4a0dd000 0x80>;
38 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
39 ti,hwmods = "smartreflex_core";
40 };
41
42 smartreflex_mpu: smartreflex@4a0d9000 {
43 compatible = "ti,omap4-smartreflex-mpu";
44 reg = <0x4a0d9000 0x80>;
45 interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
46 ti,hwmods = "smartreflex_mpu";
47 };
diff --git a/MAINTAINERS b/MAINTAINERS
index e25cc884a8f6..b549f4dd6160 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2162,7 +2162,6 @@ F: sound/soc/zte/
2162 2162
2163ARM/ZYNQ ARCHITECTURE 2163ARM/ZYNQ ARCHITECTURE
2164M: Michal Simek <michal.simek@xilinx.com> 2164M: Michal Simek <michal.simek@xilinx.com>
2165R: Sören Brinkmann <soren.brinkmann@xilinx.com>
2166L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2165L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
2167W: http://wiki.xilinx.com 2166W: http://wiki.xilinx.com
2168T: git https://github.com/Xilinx/linux-xlnx.git 2167T: git https://github.com/Xilinx/linux-xlnx.git
@@ -2937,6 +2936,7 @@ N: bcm583*
2937N: bcm585* 2936N: bcm585*
2938N: bcm586* 2937N: bcm586*
2939N: bcm88312 2938N: bcm88312
2939N: hr2
2940F: arch/arm64/boot/dts/broadcom/ns2* 2940F: arch/arm64/boot/dts/broadcom/ns2*
2941F: drivers/clk/bcm/clk-ns* 2941F: drivers/clk/bcm/clk-ns*
2942F: drivers/pinctrl/bcm/pinctrl-ns* 2942F: drivers/pinctrl/bcm/pinctrl-ns*
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4f3ee0ef8fa7..51c8df561077 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -371,7 +371,7 @@ config ARCH_EBSA110
371 371
372config ARCH_EP93XX 372config ARCH_EP93XX
373 bool "EP93xx-based" 373 bool "EP93xx-based"
374 select ARCH_HAS_HOLES_MEMORYMODEL 374 select ARCH_SPARSEMEM_ENABLE
375 select ARM_AMBA 375 select ARM_AMBA
376 imply ARM_PATCH_PHYS_VIRT 376 imply ARM_PATCH_PHYS_VIRT
377 select ARM_VIC 377 select ARM_VIC
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 954ba8b81052..12b8c8f8ec07 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -170,6 +170,11 @@ choice
170 depends on ARCH_BCM_5301X || ARCH_BCM_NSP 170 depends on ARCH_BCM_5301X || ARCH_BCM_NSP
171 select DEBUG_UART_8250 171 select DEBUG_UART_8250
172 172
173 config DEBUG_BCM_HR2
174 bool "Kernel low-level debugging on Hurricane 2 UART2"
175 depends on ARCH_BCM_HR2
176 select DEBUG_UART_8250
177
173 config DEBUG_BCM_KONA_UART 178 config DEBUG_BCM_KONA_UART
174 bool "Kernel low-level debugging messages via BCM KONA UART" 179 bool "Kernel low-level debugging messages via BCM KONA UART"
175 depends on ARCH_BCM_MOBILE 180 depends on ARCH_BCM_MOBILE
@@ -912,6 +917,13 @@ choice
912 Say Y here if you want kernel low-level debugging support 917 Say Y here if you want kernel low-level debugging support
913 via SCIF2 on Renesas R-Car E2 (R8A7794). 918 via SCIF2 on Renesas R-Car E2 (R8A7794).
914 919
920 config DEBUG_RCAR_GEN2_SCIF4
921 bool "Kernel low-level debugging messages via SCIF4 on R8A7745"
922 depends on ARCH_R8A7745
923 help
924 Say Y here if you want kernel low-level debugging support
925 via SCIF4 on Renesas RZ/G1E (R8A7745).
926
915 config DEBUG_RMOBILE_SCIFA0 927 config DEBUG_RMOBILE_SCIFA0
916 bool "Kernel low-level debugging messages via SCIFA0 on R8A73A4" 928 bool "Kernel low-level debugging messages via SCIFA0 on R8A73A4"
917 depends on ARCH_R8A73A4 929 depends on ARCH_R8A73A4
@@ -1452,6 +1464,7 @@ config DEBUG_LL_INCLUDE
1452 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF2 1464 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN1_SCIF2
1453 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF0 1465 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF0
1454 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF2 1466 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF2
1467 default "debug/renesas-scif.S" if DEBUG_RCAR_GEN2_SCIF4
1455 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA0 1468 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA0
1456 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA1 1469 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA1
1457 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA4 1470 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA4
@@ -1509,6 +1522,7 @@ config DEBUG_UART_PHYS
1509 default 0x11009000 if DEBUG_MT8135_UART3 1522 default 0x11009000 if DEBUG_MT8135_UART3
1510 default 0x16000000 if DEBUG_INTEGRATOR 1523 default 0x16000000 if DEBUG_INTEGRATOR
1511 default 0x18000300 if DEBUG_BCM_5301X 1524 default 0x18000300 if DEBUG_BCM_5301X
1525 default 0x18000400 if DEBUG_BCM_HR2
1512 default 0x18010000 if DEBUG_SIRFATLAS7_UART0 1526 default 0x18010000 if DEBUG_SIRFATLAS7_UART0
1513 default 0x18020000 if DEBUG_SIRFATLAS7_UART1 1527 default 0x18020000 if DEBUG_SIRFATLAS7_UART1
1514 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1 1528 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1
@@ -1571,6 +1585,7 @@ config DEBUG_UART_PHYS
1571 default 0xe6c80000 if DEBUG_RMOBILE_SCIFA4 1585 default 0xe6c80000 if DEBUG_RMOBILE_SCIFA4
1572 default 0xe6e58000 if DEBUG_RCAR_GEN2_SCIF2 1586 default 0xe6e58000 if DEBUG_RCAR_GEN2_SCIF2
1573 default 0xe6e60000 if DEBUG_RCAR_GEN2_SCIF0 1587 default 0xe6e60000 if DEBUG_RCAR_GEN2_SCIF0
1588 default 0xe6ee0000 if DEBUG_RCAR_GEN2_SCIF4
1574 default 0xe8008000 if DEBUG_R7S72100_SCIF2 1589 default 0xe8008000 if DEBUG_R7S72100_SCIF2
1575 default 0xf0000be0 if ARCH_EBSA110 1590 default 0xf0000be0 if ARCH_EBSA110
1576 default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE 1591 default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE
@@ -1605,6 +1620,7 @@ config DEBUG_UART_PHYS
1605 DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \ 1620 DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \
1606 DEBUG_RCAR_GEN1_SCIF0 || DEBUG_RCAR_GEN1_SCIF2 || \ 1621 DEBUG_RCAR_GEN1_SCIF0 || DEBUG_RCAR_GEN1_SCIF2 || \
1607 DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \ 1622 DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \
1623 DEBUG_RCAR_GEN2_SCIF4 || \
1608 DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \ 1624 DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
1609 DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \ 1625 DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
1610 DEBUG_S3C64XX_UART || \ 1626 DEBUG_S3C64XX_UART || \
@@ -1624,6 +1640,7 @@ config DEBUG_UART_VIRT
1624 default 0xf01fb000 if DEBUG_NOMADIK_UART 1640 default 0xf01fb000 if DEBUG_NOMADIK_UART
1625 default 0xf0201000 if DEBUG_BCM2835 || DEBUG_BCM2836 1641 default 0xf0201000 if DEBUG_BCM2835 || DEBUG_BCM2836
1626 default 0xf1000300 if DEBUG_BCM_5301X 1642 default 0xf1000300 if DEBUG_BCM_5301X
1643 default 0xf1000400 if DEBUG_BCM_HR2
1627 default 0xf1002000 if DEBUG_MT8127_UART0 1644 default 0xf1002000 if DEBUG_MT8127_UART0
1628 default 0xf1006000 if DEBUG_MT6589_UART0 1645 default 0xf1006000 if DEBUG_MT6589_UART0
1629 default 0xf1009000 if DEBUG_MT8135_UART3 1646 default 0xf1009000 if DEBUG_MT8135_UART3
@@ -1729,7 +1746,8 @@ config DEBUG_UART_8250_SHIFT
1729 int "Register offset shift for the 8250 debug UART" 1746 int "Register offset shift for the 8250 debug UART"
1730 depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250 1747 depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
1731 default 0 if DEBUG_FOOTBRIDGE_COM1 || ARCH_IOP32X || DEBUG_BCM_5301X || \ 1748 default 0 if DEBUG_FOOTBRIDGE_COM1 || ARCH_IOP32X || DEBUG_BCM_5301X || \
1732 DEBUG_OMAP7XXUART1 || DEBUG_OMAP7XXUART2 || DEBUG_OMAP7XXUART3 1749 DEBUG_BCM_HR2 || DEBUG_OMAP7XXUART1 || DEBUG_OMAP7XXUART2 || \
1750 DEBUG_OMAP7XXUART3
1733 default 2 1751 default 2
1734 1752
1735config DEBUG_UART_8250_WORD 1753config DEBUG_UART_8250_WORD
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 36ae4454554c..def8824fc71c 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -149,6 +149,7 @@ textofs-$(CONFIG_SA1111) := 0x00208000
149endif 149endif
150textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000 150textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000
151textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 151textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
152textofs-$(CONFIG_ARCH_MESON) := 0x00208000
152textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000 153textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
153 154
154# Machine directory name. This list is sorted alphanumerically 155# Machine directory name. This list is sorted alphanumerically
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index e58fab8aec5d..1b81c4e75772 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -130,9 +130,11 @@
130 }; 130 };
131 }; 131 };
132 132
133 pmu { 133 pmu@4b000000 {
134 compatible = "arm,cortex-a8-pmu"; 134 compatible = "arm,cortex-a8-pmu";
135 interrupts = <3>; 135 interrupts = <3>;
136 reg = <0x4b000000 0x1000000>;
137 ti,hwmods = "debugss";
136 }; 138 };
137 139
138 /* 140 /*
@@ -929,6 +931,12 @@
929 }; 931 };
930 }; 932 };
931 933
934 emif: emif@4c000000 {
935 compatible = "ti,emif-am3352";
936 reg = <0x4c000000 0x1000000>;
937 ti,hwmods = "emif";
938 };
939
932 gpmc: gpmc@50000000 { 940 gpmc: gpmc@50000000 {
933 compatible = "ti,am3352-gpmc"; 941 compatible = "ti,am3352-gpmc";
934 ti,hwmods = "gpmc"; 942 ti,hwmods = "gpmc";
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 02a136a4661a..92b5cb40a9d5 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -457,6 +457,7 @@
457 #dma-cells = <1>; 457 #dma-cells = <1>;
458 dma-channels = <32>; 458 dma-channels = <32>;
459 dma-requests = <127>; 459 dma-requests = <127>;
460 ti,hwmods = "dma_system";
460 }; 461 };
461 462
462 edma: edma@43300000 { 463 edma: edma@43300000 {
@@ -1069,6 +1070,13 @@
1069 max-frequency = <192000000>; 1070 max-frequency = <192000000>;
1070 }; 1071 };
1071 1072
1073 hdqw1w: 1w@480b2000 {
1074 compatible = "ti,omap3-1w";
1075 reg = <0x480b2000 0x1000>;
1076 interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
1077 ti,hwmods = "hdq1w";
1078 };
1079
1072 mmc2: mmc@480b4000 { 1080 mmc2: mmc@480b4000 {
1073 compatible = "ti,omap4-hsmmc"; 1081 compatible = "ti,omap4-hsmmc";
1074 reg = <0x480b4000 0x400>; 1082 reg = <0x480b4000 0x400>;
@@ -1489,6 +1497,32 @@
1489 }; 1497 };
1490 }; 1498 };
1491 1499
1500 target-module@4a0dd000 {
1501 compatible = "ti,sysc-omap4-sr";
1502 ti,hwmods = "smartreflex_core";
1503 reg = <0x4a0dd000 0x4>,
1504 <0x4a0dd008 0x4>;
1505 reg-names = "rev", "sysc";
1506 #address-cells = <1>;
1507 #size-cells = <1>;
1508 ranges = <0 0x4a0dd000 0x001000>;
1509
1510 /* SmartReflex child device marked reserved in TRM */
1511 };
1512
1513 target-module@4a0d9000 {
1514 compatible = "ti,sysc-omap4-sr";
1515 ti,hwmods = "smartreflex_mpu";
1516 reg = <0x4a0d9000 0x4>,
1517 <0x4a0d9008 0x4>;
1518 reg-names = "rev", "sysc";
1519 #address-cells = <1>;
1520 #size-cells = <1>;
1521 ranges = <0 0x4a0d9000 0x001000>;
1522
1523 /* SmartReflex child device marked reserved in TRM */
1524 };
1525
1492 omap_dwc3_1: omap_dwc3_1@48880000 { 1526 omap_dwc3_1: omap_dwc3_1@48880000 {
1493 compatible = "ti,dwc3"; 1527 compatible = "ti,dwc3";
1494 ti,hwmods = "usb_otg_ss1"; 1528 ti,hwmods = "usb_otg_ss1";
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index bdaf30c8c405..90b5c7148feb 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -215,6 +215,7 @@
215 #dma-cells = <1>; 215 #dma-cells = <1>;
216 dma-channels = <32>; 216 dma-channels = <32>;
217 dma-requests = <96>; 217 dma-requests = <96>;
218 ti,hwmods = "dma";
218 }; 219 };
219 220
220 gpio1: gpio@48310000 { 221 gpio1: gpio@48310000 {
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 64d00f5893a6..f69de916b06a 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -51,6 +51,17 @@
51 }; 51 };
52 }; 52 };
53 53
54 /*
55 * Note that 4430 needs cross trigger interface (CTI) supported
56 * before we can configure the interrupts. This means sampling
57 * events are not supported for pmu. Note that 4460 does not use
58 * CTI, see also 4460.dtsi.
59 */
60 pmu {
61 compatible = "arm,cortex-a9-pmu";
62 ti,hwmods = "debugss";
63 };
64
54 gic: interrupt-controller@48241000 { 65 gic: interrupt-controller@48241000 {
55 compatible = "arm,cortex-a9-gic"; 66 compatible = "arm,cortex-a9-gic";
56 interrupt-controller; 67 interrupt-controller;
@@ -163,6 +174,7 @@
163 #address-cells = <1>; 174 #address-cells = <1>;
164 #size-cells = <1>; 175 #size-cells = <1>;
165 ranges = <0 0x2000 0x1000>; 176 ranges = <0 0x2000 0x1000>;
177 ti,hwmods = "ctrl_module_core";
166 178
167 scm_conf: scm_conf@0 { 179 scm_conf: scm_conf@0 {
168 compatible = "syscon"; 180 compatible = "syscon";
@@ -175,9 +187,11 @@
175 omap4_padconf_core: scm@100000 { 187 omap4_padconf_core: scm@100000 {
176 compatible = "ti,omap4-scm-padconf-core", 188 compatible = "ti,omap4-scm-padconf-core",
177 "simple-bus"; 189 "simple-bus";
190 reg = <0x100000 0x1000>;
178 #address-cells = <1>; 191 #address-cells = <1>;
179 #size-cells = <1>; 192 #size-cells = <1>;
180 ranges = <0 0x100000 0x1000>; 193 ranges = <0 0x100000 0x1000>;
194 ti,hwmods = "ctrl_module_pad_core";
181 195
182 omap4_pmx_core: pinmux@40 { 196 omap4_pmx_core: pinmux@40 {
183 compatible = "ti,omap4-padconf", 197 compatible = "ti,omap4-padconf",
@@ -252,17 +266,33 @@
252 }; 266 };
253 }; 267 };
254 268
255 omap4_pmx_wkup: pinmux@1e040 { 269 omap4_scm_wkup: scm@c000 {
256 compatible = "ti,omap4-padconf", 270 compatible = "ti,omap4-scm-wkup";
257 "pinctrl-single"; 271 reg = <0xc000 0x1000>;
258 reg = <0x1e040 0x0038>; 272 ti,hwmods = "ctrl_module_wkup";
273 };
274
275 omap4_padconf_wkup: padconf@1e000 {
276 compatible = "ti,omap4-scm-padconf-wkup",
277 "simple-bus";
278 reg = <0x1e000 0x1000>;
259 #address-cells = <1>; 279 #address-cells = <1>;
260 #size-cells = <0>; 280 #size-cells = <1>;
261 #pinctrl-cells = <1>; 281 ranges = <0 0x1e000 0x1000>;
262 #interrupt-cells = <1>; 282 ti,hwmods = "ctrl_module_pad_wkup";
263 interrupt-controller; 283
264 pinctrl-single,register-width = <16>; 284 omap4_pmx_wkup: pinmux@40 {
265 pinctrl-single,function-mask = <0x7fff>; 285 compatible = "ti,omap4-padconf",
286 "pinctrl-single";
287 reg = <0x40 0x0038>;
288 #address-cells = <1>;
289 #size-cells = <0>;
290 #pinctrl-cells = <1>;
291 #interrupt-cells = <1>;
292 interrupt-controller;
293 pinctrl-single,register-width = <16>;
294 pinctrl-single,function-mask = <0x7fff>;
295 };
266 }; 296 };
267 }; 297 };
268 }; 298 };
@@ -282,6 +312,7 @@
282 #dma-cells = <1>; 312 #dma-cells = <1>;
283 dma-channels = <32>; 313 dma-channels = <32>;
284 dma-requests = <127>; 314 dma-requests = <127>;
315 ti,hwmods = "dma_system";
285 }; 316 };
286 317
287 gpio1: gpio@4a310000 { 318 gpio1: gpio@4a310000 {
@@ -351,6 +382,19 @@
351 #interrupt-cells = <2>; 382 #interrupt-cells = <2>;
352 }; 383 };
353 384
385 target-module@48076000 {
386 compatible = "ti,sysc-omap4";
387 ti,hwmods = "slimbus2";
388 reg = <0x48076000 0x4>,
389 <0x48076010 0x4>;
390 reg-names = "rev", "sysc";
391 #address-cells = <1>;
392 #size-cells = <1>;
393 ranges = <0 0x48076000 0x001000>;
394
395 /* No child device binding or driver in mainline */
396 };
397
354 elm: elm@48078000 { 398 elm: elm@48078000 {
355 compatible = "ti,am3352-elm"; 399 compatible = "ti,am3352-elm";
356 reg = <0x48078000 0x2000>; 400 reg = <0x48078000 0x2000>;
@@ -411,6 +455,57 @@
411 clock-frequency = <48000000>; 455 clock-frequency = <48000000>;
412 }; 456 };
413 457
458 target-module@4a0db000 {
459 compatible = "ti,sysc-sr";
460 ti,hwmods = "smartreflex_iva";
461 reg = <0x4a0db000 0x4>,
462 <0x4a0db008 0x4>;
463 reg-names = "rev", "sysc";
464 #address-cells = <1>;
465 #size-cells = <1>;
466 ranges = <0 0x4a0db000 0x001000>;
467
468 smartreflex_iva: smartreflex@0 {
469 compatible = "ti,omap4-smartreflex-iva";
470 reg = <0 0x80>;
471 interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
472 };
473 };
474
475 target-module@4a0dd000 {
476 compatible = "ti,sysc-sr";
477 ti,hwmods = "smartreflex_core";
478 reg = <0x4a0dd000 0x4>,
479 <0x4a0dd008 0x4>;
480 reg-names = "rev", "sysc";
481 #address-cells = <1>;
482 #size-cells = <1>;
483 ranges = <0 0x4a0dd000 0x001000>;
484
485 smartreflex_core: smartreflex@0 {
486 compatible = "ti,omap4-smartreflex-core";
487 reg = <0 0x80>;
488 interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
489 };
490 };
491
492 target-module@4a0d9000 {
493 compatible = "ti,sysc-sr";
494 ti,hwmods = "smartreflex_mpu";
495 reg = <0x4a0d9000 0x4>,
496 <0x4a0d9008 0x4>;
497 reg-names = "rev", "sysc";
498 #address-cells = <1>;
499 #size-cells = <1>;
500 ranges = <0 0x4a0d9000 0x001000>;
501
502 smartreflex_mpu: smartreflex@0 {
503 compatible = "ti,omap4-smartreflex-mpu";
504 reg = <0 0x80>;
505 interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
506 };
507 };
508
414 hwspinlock: spinlock@4a0f6000 { 509 hwspinlock: spinlock@4a0f6000 {
415 compatible = "ti,omap4-hwspinlock"; 510 compatible = "ti,omap4-hwspinlock";
416 reg = <0x4a0f6000 0x1000>; 511 reg = <0x4a0f6000 0x1000>;
@@ -489,6 +584,13 @@
489 dma-names = "tx0", "rx0", "tx1", "rx1"; 584 dma-names = "tx0", "rx0", "tx1", "rx1";
490 }; 585 };
491 586
587 hdqw1w: 1w@480b2000 {
588 compatible = "ti,omap3-1w";
589 reg = <0x480b2000 0x1000>;
590 interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
591 ti,hwmods = "hdq1w";
592 };
593
492 mcspi3: spi@480b8000 { 594 mcspi3: spi@480b8000 {
493 compatible = "ti,omap4-mcspi"; 595 compatible = "ti,omap4-mcspi";
494 reg = <0x480b8000 0x200>; 596 reg = <0x480b8000 0x200>;
@@ -565,6 +667,40 @@
565 dma-names = "tx", "rx"; 667 dma-names = "tx", "rx";
566 }; 668 };
567 669
670 hsi: hsi@4a058000 {
671 compatible = "ti,omap4-hsi";
672 reg = <0x4a058000 0x4000>,
673 <0x4a05c000 0x1000>;
674 reg-names = "sys", "gdd";
675 ti,hwmods = "hsi";
676
677 clocks = <&hsi_fck>;
678 clock-names = "hsi_fck";
679
680 interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
681 interrupt-names = "gdd_mpu";
682
683 #address-cells = <1>;
684 #size-cells = <1>;
685 ranges = <0 0x4a058000 0x4000>;
686
687 hsi_port1: hsi-port@2000 {
688 compatible = "ti,omap4-hsi-port";
689 reg = <0x2000 0x800>,
690 <0x2800 0x800>;
691 reg-names = "tx", "rx";
692 interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
693 };
694
695 hsi_port2: hsi-port@3000 {
696 compatible = "ti,omap4-hsi-port";
697 reg = <0x3000 0x800>,
698 <0x3800 0x800>;
699 reg-names = "tx", "rx";
700 interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
701 };
702 };
703
568 mmu_dsp: mmu@4a066000 { 704 mmu_dsp: mmu@4a066000 {
569 compatible = "ti,omap4-iommu"; 705 compatible = "ti,omap4-iommu";
570 reg = <0x4a066000 0x100>; 706 reg = <0x4a066000 0x100>;
@@ -573,6 +709,19 @@
573 #iommu-cells = <0>; 709 #iommu-cells = <0>;
574 }; 710 };
575 711
712 target-module@52000000 {
713 compatible = "ti,sysc-omap4";
714 ti,hwmods = "iss";
715 reg = <0x52000000 0x4>,
716 <0x52000010 0x4>;
717 reg-names = "rev", "sysc";
718 #address-cells = <1>;
719 #size-cells = <1>;
720 ranges = <0 0x52000000 0x1000000>;
721
722 /* No child device binding, driver in staging */
723 };
724
576 mmu_ipu: mmu@55082000 { 725 mmu_ipu: mmu@55082000 {
577 compatible = "ti,omap4-iommu"; 726 compatible = "ti,omap4-iommu";
578 reg = <0x55082000 0x100>; 727 reg = <0x55082000 0x100>;
@@ -589,6 +738,14 @@
589 ti,hwmods = "wd_timer2"; 738 ti,hwmods = "wd_timer2";
590 }; 739 };
591 740
741 wdt3: wdt@40130000 {
742 compatible = "ti,omap4-wdt", "ti,omap3-wdt";
743 reg = <0x40130000 0x80>, /* MPU private access */
744 <0x49030000 0x80>; /* L3 Interconnect */
745 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
746 ti,hwmods = "wd_timer3";
747 };
748
592 mcpdm: mcpdm@40132000 { 749 mcpdm: mcpdm@40132000 {
593 compatible = "ti,omap4-mcpdm"; 750 compatible = "ti,omap4-mcpdm";
594 reg = <0x40132000 0x7f>, /* MPU private access */ 751 reg = <0x40132000 0x7f>, /* MPU private access */
@@ -659,6 +816,56 @@
659 status = "disabled"; 816 status = "disabled";
660 }; 817 };
661 818
819 target-module@40128000 {
820 compatible = "ti,sysc-mcasp";
821 ti,hwmods = "mcasp";
822 reg = <0x40128004 0x4>;
823 reg-names = "sysc";
824 #address-cells = <1>;
825 #size-cells = <1>;
826 ranges = <0x00000000 0x40128000 0x1000>, /* MPU */
827 <0x49028000 0x49028000 0x1000>; /* L3 */
828
829 /*
830 * Child device unsupported by davinci-mcasp. At least
831 * TX path is disabled for omap4, and only DIT mode
832 * works with no I2S. See also old Android kernel
833 * omap-mcasp driver for more information.
834 */
835 };
836
837 target-module@4012c000 {
838 compatible = "ti,sysc-omap4";
839 ti,hwmods = "slimbus1";
840 reg = <0x4012c000 0x4>,
841 <0x4012c010 0x4>;
842 reg-names = "rev", "sysc";
843 #address-cells = <1>;
844 #size-cells = <1>;
845 ranges = <0x00000000 0x4012c000 0x1000>, /* MPU */
846 <0x4902c000 0x4902c000 0x1000>; /* L3 */
847
848 /* No child device binding or driver in mainline */
849 };
850
851 target-module@401f1000 {
852 compatible = "ti,sysc-omap4";
853 ti,hwmods = "aess";
854 reg = <0x401f1000 0x4>,
855 <0x401f1010 0x4>;
856 reg-names = "rev", "sysc";
857 #address-cells = <1>;
858 #size-cells = <1>;
859 ranges = <0x00000000 0x401f1000 0x1000>, /* MPU */
860 <0x490f1000 0x490f1000 0x1000>; /* L3 */
861
862 /*
863 * No child device binding or driver in mainline.
864 * See Android tree and related upstreaming efforts
865 * for the old driver.
866 */
867 };
868
662 mcbsp4: mcbsp@48096000 { 869 mcbsp4: mcbsp@48096000 {
663 compatible = "ti,omap4-mcbsp"; 870 compatible = "ti,omap4-mcbsp";
664 reg = <0x48096000 0xff>; /* L4 Interconnect */ 871 reg = <0x48096000 0xff>; /* L4 Interconnect */
@@ -747,6 +954,19 @@
747 }; 954 };
748 }; 955 };
749 956
957 target-module@4a10a000 {
958 compatible = "ti,sysc-omap4";
959 ti,hwmods = "fdif";
960 reg = <0x4a10a000 0x4>,
961 <0x4a10a010 0x4>;
962 reg-names = "rev", "sysc";
963 #address-cells = <1>;
964 #size-cells = <1>;
965 ranges = <0 0x4a10a000 0x1000>;
966
967 /* No child device binding or driver in mainline */
968 };
969
750 timer1: timer@4a318000 { 970 timer1: timer@4a318000 {
751 compatible = "ti,omap3430-timer"; 971 compatible = "ti,omap3430-timer";
752 reg = <0x4a318000 0x80>; 972 reg = <0x4a318000 0x80>;
@@ -962,6 +1182,22 @@
962 status = "disabled"; 1182 status = "disabled";
963 }; 1183 };
964 1184
1185 target-module@56000000 {
1186 compatible = "ti,sysc-omap4";
1187 ti,hwmods = "gpu";
1188 reg = <0x5601fc00 0x4>,
1189 <0x5601fc10 0x4>;
1190 reg-names = "rev", "sysc";
1191 #address-cells = <1>;
1192 #size-cells = <1>;
1193 ranges = <0 0x56000000 0x2000000>;
1194
1195 /*
1196 * Closed source PowerVR driver, no child device
1197 * binding or driver in mainline
1198 */
1199 };
1200
965 dss: dss@58000000 { 1201 dss: dss@58000000 {
966 compatible = "ti,omap4-dss"; 1202 compatible = "ti,omap4-dss";
967 reg = <0x58000000 0x80>; 1203 reg = <0x58000000 0x80>;
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index eaff2a5751dd..b86ac7df620d 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -295,6 +295,7 @@
295 #dma-cells = <1>; 295 #dma-cells = <1>;
296 dma-channels = <32>; 296 dma-channels = <32>;
297 dma-requests = <127>; 297 dma-requests = <127>;
298 ti,hwmods = "dma_system";
298 }; 299 };
299 300
300 gpio1: gpio@4ae10000 { 301 gpio1: gpio@4ae10000 {
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index 27d9720f7207..bd0cf22f9ceb 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -34,6 +34,7 @@ CONFIG_DAVINCI_MUX_WARNINGS=y
34CONFIG_DAVINCI_RESET_CLOCKS=y 34CONFIG_DAVINCI_RESET_CLOCKS=y
35CONFIG_PREEMPT=y 35CONFIG_PREEMPT=y
36CONFIG_AEABI=y 36CONFIG_AEABI=y
37CONFIG_CMA=y
37CONFIG_SECCOMP=y 38CONFIG_SECCOMP=y
38CONFIG_ZBOOT_ROM_TEXT=0x0 39CONFIG_ZBOOT_ROM_TEXT=0x0
39CONFIG_ZBOOT_ROM_BSS=0x0 40CONFIG_ZBOOT_ROM_BSS=0x0
@@ -56,9 +57,11 @@ CONFIG_NETFILTER=y
56CONFIG_DEVTMPFS=y 57CONFIG_DEVTMPFS=y
57CONFIG_DEVTMPFS_MOUNT=y 58CONFIG_DEVTMPFS_MOUNT=y
58# CONFIG_FW_LOADER is not set 59# CONFIG_FW_LOADER is not set
60CONFIG_DMA_CMA=y
59CONFIG_DA8XX_MSTPRI=y 61CONFIG_DA8XX_MSTPRI=y
60CONFIG_MTD=m 62CONFIG_MTD=m
61CONFIG_MTD_TESTS=m 63CONFIG_MTD_TESTS=m
64CONFIG_MTD_CMDLINE_PARTS=m
62CONFIG_MTD_BLOCK=m 65CONFIG_MTD_BLOCK=m
63CONFIG_MTD_CFI=m 66CONFIG_MTD_CFI=m
64CONFIG_MTD_CFI_INTELEXT=m 67CONFIG_MTD_CFI_INTELEXT=m
@@ -195,7 +198,6 @@ CONFIG_USB_G_SERIAL=m
195CONFIG_USB_G_PRINTER=m 198CONFIG_USB_G_PRINTER=m
196CONFIG_USB_CDC_COMPOSITE=m 199CONFIG_USB_CDC_COMPOSITE=m
197CONFIG_MMC=y 200CONFIG_MMC=y
198# CONFIG_MMC_BLOCK_BOUNCE is not set
199CONFIG_MMC_DAVINCI=y 201CONFIG_MMC_DAVINCI=y
200CONFIG_NEW_LEDS=y 202CONFIG_NEW_LEDS=y
201CONFIG_LEDS_CLASS=m 203CONFIG_LEDS_CLASS=m
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig
index 8c2a2619971b..f1d7834990ec 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -244,7 +244,7 @@ CONFIG_USB_STORAGE_ONETOUCH=m
244CONFIG_USB_STORAGE_KARMA=m 244CONFIG_USB_STORAGE_KARMA=m
245CONFIG_USB_STORAGE_CYPRESS_ATACB=m 245CONFIG_USB_STORAGE_CYPRESS_ATACB=m
246CONFIG_USB_STORAGE_ENE_UB6250=m 246CONFIG_USB_STORAGE_ENE_UB6250=m
247CONFIG_USB_UAS=m 247CONFIG_USB_UAS=y
248CONFIG_USB_DWC3=y 248CONFIG_USB_DWC3=y
249CONFIG_USB_DWC2=y 249CONFIG_USB_DWC2=y
250CONFIG_USB_HSIC_USB3503=y 250CONFIG_USB_HSIC_USB3503=y
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index 32acac9ab81a..0d4494922561 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -250,6 +250,7 @@ CONFIG_IMX_IPUV3_CORE=y
250CONFIG_DRM=y 250CONFIG_DRM=y
251CONFIG_DRM_PANEL_SIMPLE=y 251CONFIG_DRM_PANEL_SIMPLE=y
252CONFIG_DRM_DW_HDMI_AHB_AUDIO=m 252CONFIG_DRM_DW_HDMI_AHB_AUDIO=m
253CONFIG_DRM_DW_HDMI_CEC=y
253CONFIG_DRM_IMX=y 254CONFIG_DRM_IMX=y
254CONFIG_DRM_IMX_PARALLEL_DISPLAY=y 255CONFIG_DRM_IMX_PARALLEL_DISPLAY=y
255CONFIG_DRM_IMX_TVE=y 256CONFIG_DRM_IMX_TVE=y
@@ -365,6 +366,7 @@ CONFIG_PWM=y
365CONFIG_PWM_FSL_FTM=y 366CONFIG_PWM_FSL_FTM=y
366CONFIG_PWM_IMX=y 367CONFIG_PWM_IMX=y
367CONFIG_NVMEM_IMX_OCOTP=y 368CONFIG_NVMEM_IMX_OCOTP=y
369CONFIG_MUX_MMIO=y
368CONFIG_EXT2_FS=y 370CONFIG_EXT2_FS=y
369CONFIG_EXT2_FS_XATTR=y 371CONFIG_EXT2_FS_XATTR=y
370CONFIG_EXT2_FS_POSIX_ACL=y 372CONFIG_EXT2_FS_POSIX_ACL=y
diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig
index f907869e0ddc..f710c192b33a 100644
--- a/arch/arm/configs/keystone_defconfig
+++ b/arch/arm/configs/keystone_defconfig
@@ -189,6 +189,8 @@ CONFIG_KEYSTONE_NAVIGATOR_DMA=y
189CONFIG_TI_SCI_PM_DOMAINS=y 189CONFIG_TI_SCI_PM_DOMAINS=y
190CONFIG_MEMORY=y 190CONFIG_MEMORY=y
191CONFIG_TI_AEMIF=y 191CONFIG_TI_AEMIF=y
192CONFIG_PWM=y
193CONFIG_PWM_TIECAP=m
192CONFIG_KEYSTONE_IRQ=y 194CONFIG_KEYSTONE_IRQ=y
193CONFIG_RESET_TI_SCI=m 195CONFIG_RESET_TI_SCI=m
194CONFIG_RESET_TI_SYSCON=m 196CONFIG_RESET_TI_SYSCON=m
diff --git a/arch/arm/configs/lpc32xx_defconfig b/arch/arm/configs/lpc32xx_defconfig
index e15fa5f168bb..0b54b4024e51 100644
--- a/arch/arm/configs/lpc32xx_defconfig
+++ b/arch/arm/configs/lpc32xx_defconfig
@@ -108,11 +108,11 @@ CONFIG_GPIO_MAX7300=y
108CONFIG_GPIO_MAX732X=y 108CONFIG_GPIO_MAX732X=y
109CONFIG_GPIO_PCA953X=y 109CONFIG_GPIO_PCA953X=y
110CONFIG_GPIO_PCF857X=y 110CONFIG_GPIO_PCF857X=y
111CONFIG_GPIO_SX150X=y
112CONFIG_GPIO_74X164=y 111CONFIG_GPIO_74X164=y
113CONFIG_GPIO_MAX7301=y 112CONFIG_GPIO_MAX7301=y
114CONFIG_GPIO_MC33880=y 113CONFIG_GPIO_MC33880=y
115CONFIG_PINCTRL_MCP23S08=y 114CONFIG_PINCTRL_MCP23S08=y
115CONFIG_PINCTRL_SX150X=y
116CONFIG_SENSORS_DS620=y 116CONFIG_SENSORS_DS620=y
117CONFIG_SENSORS_MAX6639=y 117CONFIG_SENSORS_MAX6639=y
118CONFIG_WATCHDOG=y 118CONFIG_WATCHDOG=y
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 0cacdbf84a71..61509c4b769f 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -31,6 +31,7 @@ CONFIG_SOC_SAMA5D3=y
31CONFIG_SOC_SAMA5D4=y 31CONFIG_SOC_SAMA5D4=y
32CONFIG_ARCH_BCM=y 32CONFIG_ARCH_BCM=y
33CONFIG_ARCH_BCM_CYGNUS=y 33CONFIG_ARCH_BCM_CYGNUS=y
34CONFIG_ARCH_BCM_HR2=y
34CONFIG_ARCH_BCM_NSP=y 35CONFIG_ARCH_BCM_NSP=y
35CONFIG_ARCH_BCM_21664=y 36CONFIG_ARCH_BCM_21664=y
36CONFIG_ARCH_BCM_281XX=y 37CONFIG_ARCH_BCM_281XX=y
@@ -420,6 +421,7 @@ CONFIG_GPIO_DAVINCI=y
420CONFIG_GPIO_DWAPB=y 421CONFIG_GPIO_DWAPB=y
421CONFIG_GPIO_EM=y 422CONFIG_GPIO_EM=y
422CONFIG_GPIO_RCAR=y 423CONFIG_GPIO_RCAR=y
424CONFIG_GPIO_UNIPHIER=y
423CONFIG_GPIO_XILINX=y 425CONFIG_GPIO_XILINX=y
424CONFIG_GPIO_ZYNQ=y 426CONFIG_GPIO_ZYNQ=y
425CONFIG_GPIO_PCA953X=y 427CONFIG_GPIO_PCA953X=y
@@ -689,10 +691,12 @@ CONFIG_USB_OHCI_EXYNOS=m
689CONFIG_USB_R8A66597_HCD=m 691CONFIG_USB_R8A66597_HCD=m
690CONFIG_USB_RENESAS_USBHS=m 692CONFIG_USB_RENESAS_USBHS=m
691CONFIG_USB_STORAGE=y 693CONFIG_USB_STORAGE=y
694CONFIG_USB_UAS=m
692CONFIG_USB_MUSB_HDRC=m 695CONFIG_USB_MUSB_HDRC=m
693CONFIG_USB_MUSB_SUNXI=m 696CONFIG_USB_MUSB_SUNXI=m
694CONFIG_USB_DWC3=y 697CONFIG_USB_DWC3=y
695CONFIG_USB_DWC2=y 698CONFIG_USB_DWC2=y
699CONFIG_USB_HSIC_USB3503=y
696CONFIG_USB_CHIPIDEA=y 700CONFIG_USB_CHIPIDEA=y
697CONFIG_USB_CHIPIDEA_UDC=y 701CONFIG_USB_CHIPIDEA_UDC=y
698CONFIG_USB_CHIPIDEA_HOST=y 702CONFIG_USB_CHIPIDEA_HOST=y
@@ -727,6 +731,7 @@ CONFIG_MMC_OMAP=y
727CONFIG_MMC_OMAP_HS=y 731CONFIG_MMC_OMAP_HS=y
728CONFIG_MMC_ATMELMCI=y 732CONFIG_MMC_ATMELMCI=y
729CONFIG_MMC_SDHCI_MSM=y 733CONFIG_MMC_SDHCI_MSM=y
734CONFIG_MMC_MESON_MX_SDIO=y
730CONFIG_MMC_MVSDIO=y 735CONFIG_MMC_MVSDIO=y
731CONFIG_MMC_SDHI=y 736CONFIG_MMC_SDHI=y
732CONFIG_MMC_DW=y 737CONFIG_MMC_DW=y
@@ -767,6 +772,7 @@ CONFIG_RTC_DRV_MAX8997=m
767CONFIG_RTC_DRV_MAX77686=y 772CONFIG_RTC_DRV_MAX77686=y
768CONFIG_RTC_DRV_RK808=m 773CONFIG_RTC_DRV_RK808=m
769CONFIG_RTC_DRV_RS5C372=m 774CONFIG_RTC_DRV_RS5C372=m
775CONFIG_RTC_DRV_BQ32K=m
770CONFIG_RTC_DRV_PALMAS=y 776CONFIG_RTC_DRV_PALMAS=y
771CONFIG_RTC_DRV_ST_LPC=y 777CONFIG_RTC_DRV_ST_LPC=y
772CONFIG_RTC_DRV_TWL4030=y 778CONFIG_RTC_DRV_TWL4030=y
@@ -849,6 +855,7 @@ CONFIG_TEGRA_IOMMU_GART=y
849CONFIG_TEGRA_IOMMU_SMMU=y 855CONFIG_TEGRA_IOMMU_SMMU=y
850CONFIG_REMOTEPROC=m 856CONFIG_REMOTEPROC=m
851CONFIG_ST_REMOTEPROC=m 857CONFIG_ST_REMOTEPROC=m
858CONFIG_RPMSG_VIRTIO=m
852CONFIG_PM_DEVFREQ=y 859CONFIG_PM_DEVFREQ=y
853CONFIG_ARM_TEGRA_DEVFREQ=m 860CONFIG_ARM_TEGRA_DEVFREQ=m
854CONFIG_MEMORY=y 861CONFIG_MEMORY=y
diff --git a/arch/arm/configs/qcom_defconfig b/arch/arm/configs/qcom_defconfig
index 879159e4ab58..c784d04e2ab7 100644
--- a/arch/arm/configs/qcom_defconfig
+++ b/arch/arm/configs/qcom_defconfig
@@ -1,5 +1,4 @@
1CONFIG_SYSVIPC=y 1CONFIG_SYSVIPC=y
2CONFIG_FHANDLE=y
3CONFIG_NO_HZ=y 2CONFIG_NO_HZ=y
4CONFIG_HIGH_RES_TIMERS=y 3CONFIG_HIGH_RES_TIMERS=y
5CONFIG_IKCONFIG=y 4CONFIG_IKCONFIG=y
@@ -28,9 +27,7 @@ CONFIG_PCI=y
28CONFIG_PCI_MSI=y 27CONFIG_PCI_MSI=y
29CONFIG_PCIE_QCOM=y 28CONFIG_PCIE_QCOM=y
30CONFIG_SMP=y 29CONFIG_SMP=y
31CONFIG_HAVE_ARM_ARCH_TIMER=y
32CONFIG_PREEMPT=y 30CONFIG_PREEMPT=y
33CONFIG_AEABI=y
34CONFIG_HIGHMEM=y 31CONFIG_HIGHMEM=y
35CONFIG_CLEANCACHE=y 32CONFIG_CLEANCACHE=y
36CONFIG_ARM_APPENDED_DTB=y 33CONFIG_ARM_APPENDED_DTB=y
@@ -57,14 +54,13 @@ CONFIG_CFG80211=y
57CONFIG_RFKILL=y 54CONFIG_RFKILL=y
58CONFIG_DEVTMPFS=y 55CONFIG_DEVTMPFS=y
59CONFIG_DEVTMPFS_MOUNT=y 56CONFIG_DEVTMPFS_MOUNT=y
60CONFIG_QCOM_EBI2=y
61CONFIG_MTD=y 57CONFIG_MTD=y
62CONFIG_MTD_BLOCK=y 58CONFIG_MTD_BLOCK=y
63CONFIG_MTD_M25P80=y 59CONFIG_MTD_M25P80=y
64CONFIG_MTD_SPI_NOR=y 60CONFIG_MTD_SPI_NOR=y
65CONFIG_BLK_DEV_LOOP=y 61CONFIG_BLK_DEV_LOOP=y
66CONFIG_BLK_DEV_RAM=y 62CONFIG_BLK_DEV_RAM=y
67CONFIG_SCSI=y 63CONFIG_QCOM_COINCELL=y
68CONFIG_BLK_DEV_SD=y 64CONFIG_BLK_DEV_SD=y
69CONFIG_CHR_DEV_SG=y 65CONFIG_CHR_DEV_SG=y
70CONFIG_CHR_DEV_SCH=y 66CONFIG_CHR_DEV_SCH=y
@@ -87,6 +83,7 @@ CONFIG_SLIP_MODE_SLIP6=y
87CONFIG_USB_USBNET=y 83CONFIG_USB_USBNET=y
88# CONFIG_USB_NET_AX8817X is not set 84# CONFIG_USB_NET_AX8817X is not set
89# CONFIG_USB_NET_ZAURUS is not set 85# CONFIG_USB_NET_ZAURUS is not set
86CONFIG_BRCMFMAC=m
90CONFIG_INPUT_EVDEV=y 87CONFIG_INPUT_EVDEV=y
91# CONFIG_KEYBOARD_ATKBD is not set 88# CONFIG_KEYBOARD_ATKBD is not set
92CONFIG_KEYBOARD_GPIO=y 89CONFIG_KEYBOARD_GPIO=y
@@ -98,12 +95,15 @@ CONFIG_INPUT_MISC=y
98CONFIG_INPUT_PM8XXX_VIBRATOR=y 95CONFIG_INPUT_PM8XXX_VIBRATOR=y
99CONFIG_INPUT_PMIC8XXX_PWRKEY=y 96CONFIG_INPUT_PMIC8XXX_PWRKEY=y
100CONFIG_INPUT_UINPUT=y 97CONFIG_INPUT_UINPUT=y
98CONFIG_RMI4_CORE=m
99CONFIG_RMI4_I2C=m
100CONFIG_RMI4_F11=y
101CONFIG_RMI4_F12=y
101CONFIG_SERIO_LIBPS2=y 102CONFIG_SERIO_LIBPS2=y
102# CONFIG_LEGACY_PTYS is not set 103# CONFIG_LEGACY_PTYS is not set
103CONFIG_SERIAL_MSM=y 104CONFIG_SERIAL_MSM=y
104CONFIG_SERIAL_MSM_CONSOLE=y 105CONFIG_SERIAL_MSM_CONSOLE=y
105CONFIG_HW_RANDOM=y 106CONFIG_HW_RANDOM=y
106CONFIG_HW_RANDOM_MSM=y
107CONFIG_I2C=y 107CONFIG_I2C=y
108CONFIG_I2C_CHARDEV=y 108CONFIG_I2C_CHARDEV=y
109CONFIG_I2C_QUP=y 109CONFIG_I2C_QUP=y
@@ -121,11 +121,10 @@ CONFIG_PINCTRL_MSM8X74=y
121CONFIG_PINCTRL_QCOM_SPMI_PMIC=y 121CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
122CONFIG_PINCTRL_QCOM_SSBI_PMIC=y 122CONFIG_PINCTRL_QCOM_SSBI_PMIC=y
123CONFIG_GPIOLIB=y 123CONFIG_GPIOLIB=y
124CONFIG_DEBUG_GPIO=y
125CONFIG_GPIO_SYSFS=y 124CONFIG_GPIO_SYSFS=y
126CONFIG_CHARGER_QCOM_SMBB=y
127CONFIG_POWER_RESET=y 125CONFIG_POWER_RESET=y
128CONFIG_POWER_RESET_MSM=y 126CONFIG_POWER_RESET_MSM=y
127CONFIG_CHARGER_QCOM_SMBB=y
129CONFIG_THERMAL=y 128CONFIG_THERMAL=y
130CONFIG_QCOM_TSENS=y 129CONFIG_QCOM_TSENS=y
131CONFIG_MFD_PM8XXX=y 130CONFIG_MFD_PM8XXX=y
@@ -135,8 +134,14 @@ CONFIG_REGULATOR=y
135CONFIG_REGULATOR_FIXED_VOLTAGE=y 134CONFIG_REGULATOR_FIXED_VOLTAGE=y
136CONFIG_REGULATOR_QCOM_RPM=y 135CONFIG_REGULATOR_QCOM_RPM=y
137CONFIG_REGULATOR_QCOM_SMD_RPM=y 136CONFIG_REGULATOR_QCOM_SMD_RPM=y
137CONFIG_REGULATOR_QCOM_SPMI=y
138CONFIG_MEDIA_SUPPORT=y 138CONFIG_MEDIA_SUPPORT=y
139CONFIG_FB=y 139CONFIG_FB=y
140CONFIG_BACKLIGHT_LCD_SUPPORT=y
141# CONFIG_LCD_CLASS_DEVICE is not set
142CONFIG_BACKLIGHT_CLASS_DEVICE=y
143# CONFIG_BACKLIGHT_GENERIC is not set
144CONFIG_BACKLIGHT_LP855X=y
140CONFIG_SOUND=y 145CONFIG_SOUND=y
141CONFIG_SND=y 146CONFIG_SND=y
142CONFIG_SND_DYNAMIC_MINORS=y 147CONFIG_SND_DYNAMIC_MINORS=y
@@ -155,15 +160,21 @@ CONFIG_USB_ACM=y
155CONFIG_USB_CHIPIDEA=y 160CONFIG_USB_CHIPIDEA=y
156CONFIG_USB_CHIPIDEA_UDC=y 161CONFIG_USB_CHIPIDEA_UDC=y
157CONFIG_USB_CHIPIDEA_HOST=y 162CONFIG_USB_CHIPIDEA_HOST=y
163CONFIG_USB_CHIPIDEA_ULPI=y
158CONFIG_USB_SERIAL=y 164CONFIG_USB_SERIAL=y
165CONFIG_USB_HSIC_USB4604=y
159CONFIG_USB_MSM_OTG=y 166CONFIG_USB_MSM_OTG=y
160CONFIG_USB_GADGET=y 167CONFIG_USB_GADGET=y
161CONFIG_USB_GADGET_DEBUG_FILES=y 168CONFIG_USB_GADGET_DEBUG_FILES=y
162CONFIG_USB_GADGET_VBUS_DRAW=500 169CONFIG_USB_GADGET_VBUS_DRAW=500
170CONFIG_USB_CONFIGFS=y
171CONFIG_USB_CONFIGFS_NCM=y
172CONFIG_USB_CONFIGFS_ECM=y
173CONFIG_USB_CONFIGFS_F_FS=y
174CONFIG_USB_ULPI_BUS=y
163CONFIG_MMC=y 175CONFIG_MMC=y
164CONFIG_MMC_BLOCK_MINORS=32 176CONFIG_MMC_BLOCK_MINORS=32
165CONFIG_MMC_ARMMMCI=y 177CONFIG_MMC_ARMMMCI=y
166CONFIG_MMC_QCOM_DML=y
167CONFIG_MMC_SDHCI=y 178CONFIG_MMC_SDHCI=y
168CONFIG_MMC_SDHCI_PLTFM=y 179CONFIG_MMC_SDHCI_PLTFM=y
169CONFIG_MMC_SDHCI_MSM=y 180CONFIG_MMC_SDHCI_MSM=y
@@ -173,7 +184,6 @@ CONFIG_LEDS_GPIO=y
173CONFIG_LEDS_PM8058=y 184CONFIG_LEDS_PM8058=y
174CONFIG_LEDS_TRIGGERS=y 185CONFIG_LEDS_TRIGGERS=y
175CONFIG_LEDS_TRIGGER_HEARTBEAT=y 186CONFIG_LEDS_TRIGGER_HEARTBEAT=y
176CONFIG_RPMSG_QCOM_SMD=y
177CONFIG_RTC_CLASS=y 187CONFIG_RTC_CLASS=y
178CONFIG_RTC_DRV_PM8XXX=y 188CONFIG_RTC_DRV_PM8XXX=y
179CONFIG_DMADEVICES=y 189CONFIG_DMADEVICES=y
@@ -187,15 +197,17 @@ CONFIG_IPQ_GCC_4019=y
187CONFIG_IPQ_LCC_806X=y 197CONFIG_IPQ_LCC_806X=y
188CONFIG_MSM_GCC_8660=y 198CONFIG_MSM_GCC_8660=y
189CONFIG_MSM_LCC_8960=y 199CONFIG_MSM_LCC_8960=y
190CONFIG_MDM_GCC_9615=y
191CONFIG_MDM_LCC_9615=y 200CONFIG_MDM_LCC_9615=y
192CONFIG_MSM_MMCC_8960=y 201CONFIG_MSM_MMCC_8960=y
193CONFIG_MSM_MMCC_8974=y 202CONFIG_MSM_MMCC_8974=y
203CONFIG_HWSPINLOCK=y
194CONFIG_HWSPINLOCK_QCOM=y 204CONFIG_HWSPINLOCK_QCOM=y
195CONFIG_REMOTEPROC=y 205CONFIG_REMOTEPROC=y
196CONFIG_QCOM_ADSP_PIL=y 206CONFIG_QCOM_ADSP_PIL=y
197CONFIG_QCOM_Q6V5_PIL=y 207CONFIG_QCOM_Q6V5_PIL=y
198CONFIG_QCOM_WCNSS_PIL=y 208CONFIG_QCOM_WCNSS_PIL=y
209CONFIG_RPMSG_CHAR=y
210CONFIG_RPMSG_QCOM_SMD=y
199CONFIG_QCOM_GSBI=y 211CONFIG_QCOM_GSBI=y
200CONFIG_QCOM_PM=y 212CONFIG_QCOM_PM=y
201CONFIG_QCOM_SMEM=y 213CONFIG_QCOM_SMEM=y
@@ -203,6 +215,7 @@ CONFIG_QCOM_SMD_RPM=y
203CONFIG_QCOM_SMP2P=y 215CONFIG_QCOM_SMP2P=y
204CONFIG_QCOM_SMSM=y 216CONFIG_QCOM_SMSM=y
205CONFIG_QCOM_WCNSS_CTRL=y 217CONFIG_QCOM_WCNSS_CTRL=y
218CONFIG_EXTCON_QCOM_SPMI_MISC=y
206CONFIG_IIO=y 219CONFIG_IIO=y
207CONFIG_IIO_BUFFER_CB=y 220CONFIG_IIO_BUFFER_CB=y
208CONFIG_IIO_SW_TRIGGER=y 221CONFIG_IIO_SW_TRIGGER=y
@@ -211,9 +224,11 @@ CONFIG_MPU3050_I2C=y
211CONFIG_AK8975=y 224CONFIG_AK8975=y
212CONFIG_IIO_HRTIMER_TRIGGER=y 225CONFIG_IIO_HRTIMER_TRIGGER=y
213CONFIG_BMP280=y 226CONFIG_BMP280=y
227CONFIG_PWM=y
214CONFIG_PHY_QCOM_APQ8064_SATA=y 228CONFIG_PHY_QCOM_APQ8064_SATA=y
215CONFIG_PHY_QCOM_IPQ806X_SATA=y 229CONFIG_PHY_QCOM_IPQ806X_SATA=y
216CONFIG_NVMEM=y 230CONFIG_PHY_QCOM_USB_HS=y
231CONFIG_PHY_QCOM_USB_HSIC=y
217CONFIG_QCOM_QFPROM=y 232CONFIG_QCOM_QFPROM=y
218CONFIG_EXT2_FS=y 233CONFIG_EXT2_FS=y
219CONFIG_EXT2_FS_XATTR=y 234CONFIG_EXT2_FS_XATTR=y
@@ -234,7 +249,4 @@ CONFIG_PRINTK_TIME=y
234CONFIG_DYNAMIC_DEBUG=y 249CONFIG_DYNAMIC_DEBUG=y
235CONFIG_DEBUG_INFO=y 250CONFIG_DEBUG_INFO=y
236CONFIG_MAGIC_SYSRQ=y 251CONFIG_MAGIC_SYSRQ=y
237CONFIG_LOCKUP_DETECTOR=y
238# CONFIG_DETECT_HUNG_TASK is not set
239# CONFIG_SCHED_DEBUG is not set 252# CONFIG_SCHED_DEBUG is not set
240CONFIG_TIMER_STATS=y
diff --git a/arch/arm/configs/stm32_defconfig b/arch/arm/configs/stm32_defconfig
index 90e5c46913a5..bb358ffde7d2 100644
--- a/arch/arm/configs/stm32_defconfig
+++ b/arch/arm/configs/stm32_defconfig
@@ -18,7 +18,6 @@ CONFIG_EMBEDDED=y
18# CONFIG_IOSCHED_DEADLINE is not set 18# CONFIG_IOSCHED_DEADLINE is not set
19# CONFIG_IOSCHED_CFQ is not set 19# CONFIG_IOSCHED_CFQ is not set
20# CONFIG_MMU is not set 20# CONFIG_MMU is not set
21CONFIG_ARM_SINGLE_ARMV7M=y
22CONFIG_ARCH_STM32=y 21CONFIG_ARCH_STM32=y
23CONFIG_CPU_V7M_NUM_IRQ=240 22CONFIG_CPU_V7M_NUM_IRQ=240
24CONFIG_SET_MEM_PARAM=y 23CONFIG_SET_MEM_PARAM=y
@@ -44,18 +43,18 @@ CONFIG_KEYBOARD_GPIO=y
44# CONFIG_UNIX98_PTYS is not set 43# CONFIG_UNIX98_PTYS is not set
45# CONFIG_LEGACY_PTYS is not set 44# CONFIG_LEGACY_PTYS is not set
46CONFIG_SERIAL_NONSTANDARD=y 45CONFIG_SERIAL_NONSTANDARD=y
47# CONFIG_DEVKMEM is not set
48CONFIG_SERIAL_STM32=y 46CONFIG_SERIAL_STM32=y
49CONFIG_SERIAL_STM32_CONSOLE=y 47CONFIG_SERIAL_STM32_CONSOLE=y
50# CONFIG_HW_RANDOM is not set 48# CONFIG_HW_RANDOM is not set
51CONFIG_I2C=y 49CONFIG_I2C=y
52CONFIG_I2C_CHARDEV=y 50CONFIG_I2C_CHARDEV=y
53CONFIG_I2C_STM32F4=y 51CONFIG_I2C_STM32F4=y
52CONFIG_I2C_STM32F7=y
53CONFIG_GPIO_STMPE=y
54# CONFIG_HWMON is not set 54# CONFIG_HWMON is not set
55CONFIG_WATCHDOG=y 55CONFIG_WATCHDOG=y
56CONFIG_REGULATOR=y
57CONFIG_GPIO_STMPE=y
58CONFIG_MFD_STMPE=y 56CONFIG_MFD_STMPE=y
57CONFIG_REGULATOR=y
59CONFIG_REGULATOR_FIXED_VOLTAGE=y 58CONFIG_REGULATOR_FIXED_VOLTAGE=y
60# CONFIG_USB_SUPPORT is not set 59# CONFIG_USB_SUPPORT is not set
61CONFIG_NEW_LEDS=y 60CONFIG_NEW_LEDS=y
@@ -67,6 +66,8 @@ CONFIG_RTC_CLASS=y
67CONFIG_RTC_DRV_STM32=y 66CONFIG_RTC_DRV_STM32=y
68CONFIG_DMADEVICES=y 67CONFIG_DMADEVICES=y
69CONFIG_STM32_DMA=y 68CONFIG_STM32_DMA=y
69CONFIG_STM32_DMAMUX=y
70CONFIG_STM32_MDMA=y
70CONFIG_IIO=y 71CONFIG_IIO=y
71CONFIG_STM32_ADC_CORE=y 72CONFIG_STM32_ADC_CORE=y
72CONFIG_STM32_ADC=y 73CONFIG_STM32_ADC=y
@@ -81,8 +82,6 @@ CONFIG_DEBUG_INFO=y
81CONFIG_MAGIC_SYSRQ=y 82CONFIG_MAGIC_SYSRQ=y
82# CONFIG_SCHED_DEBUG is not set 83# CONFIG_SCHED_DEBUG is not set
83# CONFIG_DEBUG_BUGVERBOSE is not set 84# CONFIG_DEBUG_BUGVERBOSE is not set
84# CONFIG_FTRACE is not set
85CONFIG_CRYPTO=y 85CONFIG_CRYPTO=y
86CONFIG_CRYPTO_DEV_STM32=y
87CONFIG_CRC_ITU_T=y 86CONFIG_CRC_ITU_T=y
88CONFIG_CRC7=y 87CONFIG_CRC7=y
diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index 800f5228939f..b818e5d0cd78 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -28,6 +28,8 @@ static inline unsigned long scu_a9_get_base(void)
28#ifdef CONFIG_HAVE_ARM_SCU 28#ifdef CONFIG_HAVE_ARM_SCU
29unsigned int scu_get_core_count(void __iomem *); 29unsigned int scu_get_core_count(void __iomem *);
30int scu_power_mode(void __iomem *, unsigned int); 30int scu_power_mode(void __iomem *, unsigned int);
31int scu_cpu_power_enable(void __iomem *, unsigned int);
32int scu_get_cpu_power_mode(void __iomem *scu_base, unsigned int logical_cpu);
31#else 33#else
32static inline unsigned int scu_get_core_count(void __iomem *scu_base) 34static inline unsigned int scu_get_core_count(void __iomem *scu_base)
33{ 35{
@@ -37,6 +39,16 @@ static inline int scu_power_mode(void __iomem *scu_base, unsigned int mode)
37{ 39{
38 return -EINVAL; 40 return -EINVAL;
39} 41}
42static inline int scu_cpu_power_enable(void __iomem *scu_base,
43 unsigned int mode)
44{
45 return -EINVAL;
46}
47static inline int scu_get_cpu_power_mode(void __iomem *scu_base,
48 unsigned int logical_cpu)
49{
50 return -EINVAL;
51}
40#endif 52#endif
41 53
42#if defined(CONFIG_SMP) && defined(CONFIG_HAVE_ARM_SCU) 54#if defined(CONFIG_SMP) && defined(CONFIG_HAVE_ARM_SCU)
diff --git a/arch/arm/include/debug/brcmstb.S b/arch/arm/include/debug/brcmstb.S
index 52aaed2b936f..c826f15d2f80 100644
--- a/arch/arm/include/debug/brcmstb.S
+++ b/arch/arm/include/debug/brcmstb.S
@@ -58,6 +58,7 @@
58 /* Check SUN_TOP_CTRL base */ 58 /* Check SUN_TOP_CTRL base */
59 ldr \rp, =SUN_TOP_CTRL_BASE @ load SUN_TOP_CTRL PA 59 ldr \rp, =SUN_TOP_CTRL_BASE @ load SUN_TOP_CTRL PA
60 ldr \rv, [\rp, #0] @ get register contents 60 ldr \rv, [\rp, #0] @ get register contents
61ARM_BE8( rev \rv, \rv )
61 and \rv, \rv, #0xffffff00 @ strip revision bits [7:0] 62 and \rv, \rv, #0xffffff00 @ strip revision bits [7:0]
62 63
63 /* Chip specific detection starts here */ 64 /* Chip specific detection starts here */
@@ -98,11 +99,13 @@
98 .endm 99 .endm
99 100
100 .macro store, rd, rx:vararg 101 .macro store, rd, rx:vararg
102ARM_BE8( rev \rd, \rd )
101 str \rd, \rx 103 str \rd, \rx
102 .endm 104 .endm
103 105
104 .macro load, rd, rx:vararg 106 .macro load, rd, rx:vararg
105 ldr \rd, \rx 107 ldr \rd, \rx
108ARM_BE8( rev \rd, \rd )
106 .endm 109 .endm
107 110
108 .macro senduart,rd,rx 111 .macro senduart,rd,rx
diff --git a/arch/arm/include/uapi/asm/ptrace.h b/arch/arm/include/uapi/asm/ptrace.h
index 3287d790c83c..e61c65b4018d 100644
--- a/arch/arm/include/uapi/asm/ptrace.h
+++ b/arch/arm/include/uapi/asm/ptrace.h
@@ -58,6 +58,7 @@
58#endif 58#endif
59#define FIQ_MODE 0x00000011 59#define FIQ_MODE 0x00000011
60#define IRQ_MODE 0x00000012 60#define IRQ_MODE 0x00000012
61#define MON_MODE 0x00000016
61#define ABT_MODE 0x00000017 62#define ABT_MODE 0x00000017
62#define HYP_MODE 0x0000001a 63#define HYP_MODE 0x0000001a
63#define UND_MODE 0x0000001b 64#define UND_MODE 0x0000001b
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
index 72f9241ad5db..c6b33074c393 100644
--- a/arch/arm/kernel/smp_scu.c
+++ b/arch/arm/kernel/smp_scu.c
@@ -21,6 +21,7 @@
21#define SCU_STANDBY_ENABLE (1 << 5) 21#define SCU_STANDBY_ENABLE (1 << 5)
22#define SCU_CONFIG 0x04 22#define SCU_CONFIG 0x04
23#define SCU_CPU_STATUS 0x08 23#define SCU_CPU_STATUS 0x08
24#define SCU_CPU_STATUS_MASK GENMASK(1, 0)
24#define SCU_INVALIDATE 0x0c 25#define SCU_INVALIDATE 0x0c
25#define SCU_FPGA_REVISION 0x10 26#define SCU_FPGA_REVISION 0x10
26 27
@@ -72,6 +73,24 @@ void scu_enable(void __iomem *scu_base)
72} 73}
73#endif 74#endif
74 75
76static int scu_set_power_mode_internal(void __iomem *scu_base,
77 unsigned int logical_cpu,
78 unsigned int mode)
79{
80 unsigned int val;
81 int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(logical_cpu), 0);
82
83 if (mode > 3 || mode == 1 || cpu > 3)
84 return -EINVAL;
85
86 val = readb_relaxed(scu_base + SCU_CPU_STATUS + cpu);
87 val &= ~SCU_CPU_STATUS_MASK;
88 val |= mode;
89 writeb_relaxed(val, scu_base + SCU_CPU_STATUS + cpu);
90
91 return 0;
92}
93
75/* 94/*
76 * Set the executing CPUs power mode as defined. This will be in 95 * Set the executing CPUs power mode as defined. This will be in
77 * preparation for it executing a WFI instruction. 96 * preparation for it executing a WFI instruction.
@@ -82,15 +101,27 @@ void scu_enable(void __iomem *scu_base)
82 */ 101 */
83int scu_power_mode(void __iomem *scu_base, unsigned int mode) 102int scu_power_mode(void __iomem *scu_base, unsigned int mode)
84{ 103{
104 return scu_set_power_mode_internal(scu_base, smp_processor_id(), mode);
105}
106
107/*
108 * Set the given (logical) CPU's power mode to SCU_PM_NORMAL.
109 */
110int scu_cpu_power_enable(void __iomem *scu_base, unsigned int cpu)
111{
112 return scu_set_power_mode_internal(scu_base, cpu, SCU_PM_NORMAL);
113}
114
115int scu_get_cpu_power_mode(void __iomem *scu_base, unsigned int logical_cpu)
116{
85 unsigned int val; 117 unsigned int val;
86 int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0); 118 int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(logical_cpu), 0);
87 119
88 if (mode > 3 || mode == 1 || cpu > 3) 120 if (cpu > 3)
89 return -EINVAL; 121 return -EINVAL;
90 122
91 val = readb_relaxed(scu_base + SCU_CPU_STATUS + cpu) & ~0x03; 123 val = readb_relaxed(scu_base + SCU_CPU_STATUS + cpu);
92 val |= mode; 124 val &= SCU_CPU_STATUS_MASK;
93 writeb_relaxed(val, scu_base + SCU_CPU_STATUS + cpu);
94 125
95 return 0; 126 return val;
96} 127}
diff --git a/arch/arm/mach-actions/Makefile b/arch/arm/mach-actions/Makefile
index c0f116241da7..13831037d8cd 100644
--- a/arch/arm/mach-actions/Makefile
+++ b/arch/arm/mach-actions/Makefile
@@ -1,3 +1 @@
1obj-${CONFIG_SMP} += platsmp.o headsmp.o obj-${CONFIG_SMP} += platsmp.o
2
3AFLAGS_headsmp.o := -Wa,-march=armv7-a
diff --git a/arch/arm/mach-actions/headsmp.S b/arch/arm/mach-actions/headsmp.S
deleted file mode 100644
index 65f53bdb69e7..000000000000
--- a/arch/arm/mach-actions/headsmp.S
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * Copyright 2012 Actions Semi Inc.
3 * Author: Actions Semi, Inc.
4 *
5 * Copyright (c) 2017 Andreas Färber
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#include <linux/linkage.h>
14#include <linux/init.h>
15
16ENTRY(owl_v7_invalidate_l1)
17 mov r0, #0
18 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
19 mcr p15, 2, r0, c0, c0, 0
20 mrc p15, 1, r0, c0, c0, 0
21
22 ldr r1, =0x7fff
23 and r2, r1, r0, lsr #13
24
25 ldr r1, =0x3ff
26
27 and r3, r1, r0, lsr #3 @ NumWays - 1
28 add r2, r2, #1 @ NumSets
29
30 and r0, r0, #0x7
31 add r0, r0, #4 @ SetShift
32
33 clz r1, r3 @ WayShift
34 add r4, r3, #1 @ NumWays
351: sub r2, r2, #1 @ NumSets--
36 mov r3, r4 @ Temp = NumWays
372: subs r3, r3, #1 @ Temp--
38 mov r5, r3, lsl r1
39 mov r6, r2, lsl r0
40 orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
41 mcr p15, 0, r5, c7, c6, 2
42 bgt 2b
43 cmp r2, #0
44 bgt 1b
45 dsb
46 isb
47 mov pc, lr
48ENDPROC(owl_v7_invalidate_l1)
49
50ENTRY(owl_secondary_startup)
51 bl owl_v7_invalidate_l1
52 b secondary_startup
diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
index 12a9e331b432..3efaa10efc43 100644
--- a/arch/arm/mach-actions/platsmp.c
+++ b/arch/arm/mach-actions/platsmp.c
@@ -71,7 +71,7 @@ static int s500_wakeup_secondary(unsigned int cpu)
71 /* wait for CPUx to run to WFE instruction */ 71 /* wait for CPUx to run to WFE instruction */
72 udelay(200); 72 udelay(200);
73 73
74 writel(virt_to_phys(owl_secondary_startup), 74 writel(__pa_symbol(secondary_startup),
75 timer_base_addr + OWL_CPU1_ADDR + (cpu - 1) * 4); 75 timer_base_addr + OWL_CPU1_ADDR + (cpu - 1) * 4);
76 writel(OWL_CPUx_FLAG_BOOT, 76 writel(OWL_CPUx_FLAG_BOOT,
77 timer_base_addr + OWL_CPU1_FLAG + (cpu - 1) * 4); 77 timer_base_addr + OWL_CPU1_FLAG + (cpu - 1) * 4);
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index 53efe8b22126..c2f3b0d216a4 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -37,6 +37,15 @@ config ARCH_BCM_CYGNUS
37 BCM11300, BCM11320, BCM11350, BCM11360, 37 BCM11300, BCM11320, BCM11350, BCM11360,
38 BCM58300, BCM58302, BCM58303, BCM58305. 38 BCM58300, BCM58302, BCM58303, BCM58305.
39 39
40config ARCH_BCM_HR2
41 bool "Broadcom Hurricane 2 SoC support"
42 depends on ARCH_MULTI_V7
43 select ARCH_BCM_IPROC
44 help
45 Enable support for the Hurricane 2 family,
46 which includes the following variants:
47 BCM53342, BCM53343, BCM53344, BCM53346.
48
40config ARCH_BCM_NSP 49config ARCH_BCM_NSP
41 bool "Broadcom Northstar Plus SoC Support" 50 bool "Broadcom Northstar Plus SoC Support"
42 depends on ARCH_MULTI_V7 51 depends on ARCH_MULTI_V7
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
index 980f5850097c..8fd23b263c60 100644
--- a/arch/arm/mach-bcm/Makefile
+++ b/arch/arm/mach-bcm/Makefile
@@ -13,6 +13,9 @@
13# Cygnus 13# Cygnus
14obj-$(CONFIG_ARCH_BCM_CYGNUS) += bcm_cygnus.o 14obj-$(CONFIG_ARCH_BCM_CYGNUS) += bcm_cygnus.o
15 15
16# Hurricane 2
17obj-$(CONFIG_ARCH_BCM_HR2) += bcm_hr2.o
18
16# Northstar Plus 19# Northstar Plus
17obj-$(CONFIG_ARCH_BCM_NSP) += bcm_nsp.o 20obj-$(CONFIG_ARCH_BCM_NSP) += bcm_nsp.o
18 21
@@ -43,6 +46,11 @@ endif
43 46
44# BCM2835 47# BCM2835
45obj-$(CONFIG_ARCH_BCM2835) += board_bcm2835.o 48obj-$(CONFIG_ARCH_BCM2835) += board_bcm2835.o
49ifeq ($(CONFIG_ARCH_BCM2835),y)
50ifeq ($(CONFIG_ARM),y)
51obj-$(CONFIG_SMP) += platsmp.o
52endif
53endif
46 54
47# BCM5301X 55# BCM5301X
48obj-$(CONFIG_ARCH_BCM_5301X) += bcm_5301x.o 56obj-$(CONFIG_ARCH_BCM_5301X) += bcm_5301x.o
diff --git a/arch/arm/mach-bcm/bcm_hr2.c b/arch/arm/mach-bcm/bcm_hr2.c
new file mode 100644
index 000000000000..c104f28995d7
--- /dev/null
+++ b/arch/arm/mach-bcm/bcm_hr2.c
@@ -0,0 +1,25 @@
1/*
2 * Copyright (C) 2017 Broadcom
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
7 *
8 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#include <asm/mach/arch.h>
15
16static const char * const bcm_hr2_dt_compat[] __initconst = {
17 "brcm,hr2",
18 NULL,
19};
20
21DT_MACHINE_START(BCM_HR2_DT, "Broadcom Hurricane 2 SoC")
22 .l2c_aux_val = 0,
23 .l2c_aux_mask = ~0,
24 .dt_compat = bcm_hr2_dt_compat,
25MACHINE_END
diff --git a/arch/arm/mach-bcm/board_bcm2835.c b/arch/arm/mach-bcm/board_bcm2835.c
index 0c1edfc98696..8cff865ace04 100644
--- a/arch/arm/mach-bcm/board_bcm2835.c
+++ b/arch/arm/mach-bcm/board_bcm2835.c
@@ -15,15 +15,11 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/irqchip.h> 16#include <linux/irqchip.h>
17#include <linux/of_address.h> 17#include <linux/of_address.h>
18#include <linux/clk/bcm2835.h>
19 18
20#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
21#include <asm/mach/map.h> 20#include <asm/mach/map.h>
22 21
23static void __init bcm2835_init(void) 22#include "platsmp.h"
24{
25 bcm2835_init_clocks();
26}
27 23
28static const char * const bcm2835_compat[] = { 24static const char * const bcm2835_compat[] = {
29#ifdef CONFIG_ARCH_MULTI_V6 25#ifdef CONFIG_ARCH_MULTI_V6
@@ -31,11 +27,12 @@ static const char * const bcm2835_compat[] = {
31#endif 27#endif
32#ifdef CONFIG_ARCH_MULTI_V7 28#ifdef CONFIG_ARCH_MULTI_V7
33 "brcm,bcm2836", 29 "brcm,bcm2836",
30 "brcm,bcm2837",
34#endif 31#endif
35 NULL 32 NULL
36}; 33};
37 34
38DT_MACHINE_START(BCM2835, "BCM2835") 35DT_MACHINE_START(BCM2835, "BCM2835")
39 .init_machine = bcm2835_init, 36 .dt_compat = bcm2835_compat,
40 .dt_compat = bcm2835_compat 37 .smp = smp_ops(bcm2836_smp_ops),
41MACHINE_END 38MACHINE_END
diff --git a/arch/arm/mach-bcm/platsmp.c b/arch/arm/mach-bcm/platsmp.c
index 9e3f275934eb..7d954830eb57 100644
--- a/arch/arm/mach-bcm/platsmp.c
+++ b/arch/arm/mach-bcm/platsmp.c
@@ -17,6 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/irqchip/irq-bcm2836.h>
20#include <linux/jiffies.h> 21#include <linux/jiffies.h>
21#include <linux/of.h> 22#include <linux/of.h>
22#include <linux/of_address.h> 23#include <linux/of_address.h>
@@ -287,6 +288,38 @@ out:
287 return ret; 288 return ret;
288} 289}
289 290
291static int bcm2836_boot_secondary(unsigned int cpu, struct task_struct *idle)
292{
293 void __iomem *intc_base;
294 struct device_node *dn;
295 char *name;
296
297 name = "brcm,bcm2836-l1-intc";
298 dn = of_find_compatible_node(NULL, NULL, name);
299 if (!dn) {
300 pr_err("unable to find intc node\n");
301 return -ENODEV;
302 }
303
304 intc_base = of_iomap(dn, 0);
305 of_node_put(dn);
306
307 if (!intc_base) {
308 pr_err("unable to remap intc base register\n");
309 return -ENOMEM;
310 }
311
312 writel(virt_to_phys(secondary_startup),
313 intc_base + LOCAL_MAILBOX3_SET0 + 16 * cpu);
314
315 dsb(sy);
316 sev();
317
318 iounmap(intc_base);
319
320 return 0;
321}
322
290static const struct smp_operations kona_smp_ops __initconst = { 323static const struct smp_operations kona_smp_ops __initconst = {
291 .smp_prepare_cpus = bcm_smp_prepare_cpus, 324 .smp_prepare_cpus = bcm_smp_prepare_cpus,
292 .smp_boot_secondary = kona_boot_secondary, 325 .smp_boot_secondary = kona_boot_secondary,
@@ -305,3 +338,8 @@ static const struct smp_operations nsp_smp_ops __initconst = {
305 .smp_boot_secondary = nsp_boot_secondary, 338 .smp_boot_secondary = nsp_boot_secondary,
306}; 339};
307CPU_METHOD_OF_DECLARE(bcm_smp_nsp, "brcm,bcm-nsp-smp", &nsp_smp_ops); 340CPU_METHOD_OF_DECLARE(bcm_smp_nsp, "brcm,bcm-nsp-smp", &nsp_smp_ops);
341
342const struct smp_operations bcm2836_smp_ops __initconst = {
343 .smp_boot_secondary = bcm2836_boot_secondary,
344};
345CPU_METHOD_OF_DECLARE(bcm_smp_bcm2836, "brcm,bcm2836-smp", &bcm2836_smp_ops);
diff --git a/arch/arm/mach-bcm/platsmp.h b/arch/arm/mach-bcm/platsmp.h
new file mode 100644
index 000000000000..b8b8b3fa350d
--- /dev/null
+++ b/arch/arm/mach-bcm/platsmp.h
@@ -0,0 +1,10 @@
1/*
2 * Copyright (C) 2017 Stefan Wahren <stefan.wahren@i2se.com>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
7 *
8 */
9
10extern const struct smp_operations bcm2836_smp_ops;
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index e61f3dee24c2..41aa57581356 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -42,60 +42,12 @@ static struct ep93xxfb_mach_info __initdata simone_fb_info = {
42 .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING, 42 .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
43}; 43};
44 44
45/*
46 * GPIO lines used for MMC card detection.
47 */
48#define MMC_CARD_DETECT_GPIO EP93XX_GPIO_LINE_EGPIO0
49
50/*
51 * MMC card detection GPIO setup.
52 */
53
54static int simone_mmc_spi_init(struct device *dev,
55 irqreturn_t (*irq_handler)(int, void *), void *mmc)
56{
57 unsigned int gpio = MMC_CARD_DETECT_GPIO;
58 int irq, err;
59
60 err = gpio_request(gpio, dev_name(dev));
61 if (err)
62 return err;
63
64 err = gpio_direction_input(gpio);
65 if (err)
66 goto fail;
67
68 irq = gpio_to_irq(gpio);
69 if (irq < 0)
70 goto fail;
71
72 err = request_irq(irq, irq_handler, IRQF_TRIGGER_FALLING,
73 "MMC card detect", mmc);
74 if (err)
75 goto fail;
76
77 printk(KERN_INFO "%s: using irq %d for MMC card detection\n",
78 dev_name(dev), irq);
79
80 return 0;
81fail:
82 gpio_free(gpio);
83 return err;
84}
85
86static void simone_mmc_spi_exit(struct device *dev, void *mmc)
87{
88 unsigned int gpio = MMC_CARD_DETECT_GPIO;
89
90 free_irq(gpio_to_irq(gpio), mmc);
91 gpio_free(gpio);
92}
93
94static struct mmc_spi_platform_data simone_mmc_spi_data = { 45static struct mmc_spi_platform_data simone_mmc_spi_data = {
95 .init = simone_mmc_spi_init,
96 .exit = simone_mmc_spi_exit,
97 .detect_delay = 500, 46 .detect_delay = 500,
98 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 47 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
48 .flags = MMC_SPI_USE_CD_GPIO,
49 .cd_gpio = EP93XX_GPIO_LINE_EGPIO0,
50 .cd_debounce = 1,
99}; 51};
100 52
101static struct spi_board_info simone_spi_devices[] __initdata = { 53static struct spi_board_info simone_spi_devices[] __initdata = {
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 8745162ec05d..f386ebae0163 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -18,7 +18,10 @@
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/mtd/rawnand.h> 19#include <linux/mtd/rawnand.h>
20#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
21#include <linux/spi/spi.h>
22#include <linux/platform_data/spi-ep93xx.h>
21 23
24#include <mach/gpio-ep93xx.h>
22#include <mach/hardware.h> 25#include <mach/hardware.h>
23 26
24#include <asm/mach-types.h> 27#include <asm/mach-types.h>
@@ -186,24 +189,22 @@ static struct platform_device ts72xx_rtc_device = {
186 .num_resources = ARRAY_SIZE(ts72xx_rtc_resources), 189 .num_resources = ARRAY_SIZE(ts72xx_rtc_resources),
187}; 190};
188 191
192/*************************************************************************
193 * Watchdog (in CPLD)
194 *************************************************************************/
195#define TS72XX_WDT_CONTROL_PHYS_BASE (EP93XX_CS2_PHYS_BASE + 0x03800000)
196#define TS72XX_WDT_FEED_PHYS_BASE (EP93XX_CS2_PHYS_BASE + 0x03c00000)
197
189static struct resource ts72xx_wdt_resources[] = { 198static struct resource ts72xx_wdt_resources[] = {
190 { 199 DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, 0x01),
191 .start = TS72XX_WDT_CONTROL_PHYS_BASE, 200 DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, 0x01),
192 .end = TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
193 .flags = IORESOURCE_MEM,
194 },
195 {
196 .start = TS72XX_WDT_FEED_PHYS_BASE,
197 .end = TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
198 .flags = IORESOURCE_MEM,
199 },
200}; 201};
201 202
202static struct platform_device ts72xx_wdt_device = { 203static struct platform_device ts72xx_wdt_device = {
203 .name = "ts72xx-wdt", 204 .name = "ts72xx-wdt",
204 .id = -1, 205 .id = -1,
205 .num_resources = ARRAY_SIZE(ts72xx_wdt_resources),
206 .resource = ts72xx_wdt_resources, 206 .resource = ts72xx_wdt_resources,
207 .num_resources = ARRAY_SIZE(ts72xx_wdt_resources),
207}; 208};
208 209
209static struct ep93xx_eth_data __initdata ts72xx_eth_data = { 210static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
@@ -232,6 +233,27 @@ static struct platform_device ts73xx_fpga_device = {
232 233
233#endif 234#endif
234 235
236/*************************************************************************
237 * SPI Bus
238 *************************************************************************/
239static struct spi_board_info ts72xx_spi_devices[] __initdata = {
240 {
241 .modalias = "tmp122",
242 .max_speed_hz = 2 * 1000 * 1000,
243 .bus_num = 0,
244 .chip_select = 0,
245 },
246};
247
248static int ts72xx_spi_chipselects[] __initdata = {
249 EP93XX_GPIO_LINE_F(2), /* DIO_17 */
250};
251
252static struct ep93xx_spi_info ts72xx_spi_info __initdata = {
253 .chipselect = ts72xx_spi_chipselects,
254 .num_chipselect = ARRAY_SIZE(ts72xx_spi_chipselects),
255};
256
235static void __init ts72xx_init_machine(void) 257static void __init ts72xx_init_machine(void)
236{ 258{
237 ep93xx_init_devices(); 259 ep93xx_init_devices();
@@ -244,6 +266,8 @@ static void __init ts72xx_init_machine(void)
244 if (board_is_ts7300()) 266 if (board_is_ts7300())
245 platform_device_register(&ts73xx_fpga_device); 267 platform_device_register(&ts73xx_fpga_device);
246#endif 268#endif
269 ep93xx_register_spi(&ts72xx_spi_info, ts72xx_spi_devices,
270 ARRAY_SIZE(ts72xx_spi_devices));
247} 271}
248 272
249MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC") 273MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index b89850f1a965..8a3206a54b39 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -39,9 +39,6 @@
39#define TS72XX_OPTIONS2_TS9420 0x04 39#define TS72XX_OPTIONS2_TS9420 0x04
40#define TS72XX_OPTIONS2_TS9420_BOOT 0x02 40#define TS72XX_OPTIONS2_TS9420_BOOT 0x02
41 41
42#define TS72XX_WDT_CONTROL_PHYS_BASE 0x23800000
43#define TS72XX_WDT_FEED_PHYS_BASE 0x23c00000
44
45#ifndef __ASSEMBLY__ 42#ifndef __ASSEMBLY__
46 43
47static inline int ts72xx_model(void) 44static inline int ts72xx_model(void)
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 0a99140b6ba2..44fa753bd79c 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -85,11 +85,6 @@ config CPU_EXYNOS4210
85 default y 85 default y
86 depends on ARCH_EXYNOS4 86 depends on ARCH_EXYNOS4
87 87
88config SOC_EXYNOS4212
89 bool "SAMSUNG EXYNOS4212"
90 default y
91 depends on ARCH_EXYNOS4
92
93config SOC_EXYNOS4412 88config SOC_EXYNOS4412
94 bool "SAMSUNG EXYNOS4412" 89 bool "SAMSUNG EXYNOS4412"
95 default y 90 default y
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 9424a8a9f308..3f715524c9d6 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -18,7 +18,6 @@
18#define EXYNOS3_SOC_MASK 0xFFFFF000 18#define EXYNOS3_SOC_MASK 0xFFFFF000
19 19
20#define EXYNOS4210_CPU_ID 0x43210000 20#define EXYNOS4210_CPU_ID 0x43210000
21#define EXYNOS4212_CPU_ID 0x43220000
22#define EXYNOS4412_CPU_ID 0xE4412200 21#define EXYNOS4412_CPU_ID 0xE4412200
23#define EXYNOS4_CPU_MASK 0xFFFE0000 22#define EXYNOS4_CPU_MASK 0xFFFE0000
24 23
@@ -39,7 +38,6 @@ static inline int is_samsung_##name(void) \
39 38
40IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK) 39IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK)
41IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) 40IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK)
42IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK)
43IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) 41IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK)
44IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) 42IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK)
45IS_SAMSUNG_CPU(exynos5410, EXYNOS5410_SOC_ID, EXYNOS5_SOC_MASK) 43IS_SAMSUNG_CPU(exynos5410, EXYNOS5410_SOC_ID, EXYNOS5_SOC_MASK)
@@ -59,12 +57,6 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
59# define soc_is_exynos4210() 0 57# define soc_is_exynos4210() 0
60#endif 58#endif
61 59
62#if defined(CONFIG_SOC_EXYNOS4212)
63# define soc_is_exynos4212() is_samsung_exynos4212()
64#else
65# define soc_is_exynos4212() 0
66#endif
67
68#if defined(CONFIG_SOC_EXYNOS4412) 60#if defined(CONFIG_SOC_EXYNOS4412)
69# define soc_is_exynos4412() is_samsung_exynos4412() 61# define soc_is_exynos4412() is_samsung_exynos4412()
70#else 62#else
@@ -105,8 +97,7 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
105# define soc_is_exynos5800() 0 97# define soc_is_exynos5800() 0
106#endif 98#endif
107 99
108#define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4212() || \ 100#define soc_is_exynos4() (soc_is_exynos4210() || soc_is_exynos4412())
109 soc_is_exynos4412())
110#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \ 101#define soc_is_exynos5() (soc_is_exynos5250() || soc_is_exynos5410() || \
111 soc_is_exynos5420() || soc_is_exynos5800()) 102 soc_is_exynos5420() || soc_is_exynos5800())
112 103
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index c404c15ad07f..9a9caac1125a 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -195,7 +195,6 @@ static void __init exynos_dt_machine_init(void)
195 exynos_cpuidle.dev.platform_data = &cpuidle_coupled_exynos_data; 195 exynos_cpuidle.dev.platform_data = &cpuidle_coupled_exynos_data;
196#endif 196#endif
197 if (of_machine_is_compatible("samsung,exynos4210") || 197 if (of_machine_is_compatible("samsung,exynos4210") ||
198 of_machine_is_compatible("samsung,exynos4212") ||
199 (of_machine_is_compatible("samsung,exynos4412") && 198 (of_machine_is_compatible("samsung,exynos4412") &&
200 of_machine_is_compatible("samsung,trats2")) || 199 of_machine_is_compatible("samsung,trats2")) ||
201 of_machine_is_compatible("samsung,exynos3250") || 200 of_machine_is_compatible("samsung,exynos3250") ||
@@ -208,7 +207,6 @@ static char const *const exynos_dt_compat[] __initconst = {
208 "samsung,exynos3250", 207 "samsung,exynos3250",
209 "samsung,exynos4", 208 "samsung,exynos4",
210 "samsung,exynos4210", 209 "samsung,exynos4210",
211 "samsung,exynos4212",
212 "samsung,exynos4412", 210 "samsung,exynos4412",
213 "samsung,exynos5", 211 "samsung,exynos5",
214 "samsung,exynos5250", 212 "samsung,exynos5250",
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
index e81a78b125d9..2a51e4603a6f 100644
--- a/arch/arm/mach-exynos/firmware.c
+++ b/arch/arm/mach-exynos/firmware.c
@@ -70,12 +70,7 @@ static int exynos_cpu_boot(int cpu)
70 70
71 /* 71 /*
72 * The second parameter of SMC_CMD_CPU1BOOT command means CPU id. 72 * The second parameter of SMC_CMD_CPU1BOOT command means CPU id.
73 * But, Exynos4212 has only one secondary CPU so second parameter
74 * isn't used for informing secure firmware about CPU id.
75 */ 73 */
76 if (soc_is_exynos4212())
77 cpu = 0;
78
79 exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0); 74 exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
80 return 0; 75 return 0;
81} 76}
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 1a7e5b5d08d8..c9740d96db9e 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -167,8 +167,7 @@ void exynos_enter_aftr(void)
167 167
168 exynos_pm_central_suspend(); 168 exynos_pm_central_suspend();
169 169
170 if (of_machine_is_compatible("samsung,exynos4212") || 170 if (of_machine_is_compatible("samsung,exynos4412")) {
171 of_machine_is_compatible("samsung,exynos4412")) {
172 /* Setting SEQ_OPTION register */ 171 /* Setting SEQ_OPTION register */
173 pmu_raw_writel(S5P_USE_STANDBY_WFI0 | S5P_USE_STANDBY_WFE0, 172 pmu_raw_writel(S5P_USE_STANDBY_WFI0 | S5P_USE_STANDBY_WFE0,
174 S5P_CENTRAL_SEQ_OPTION); 173 S5P_CENTRAL_SEQ_OPTION);
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index b529ba04ed16..370d37ded7e7 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -225,7 +225,6 @@ static int __init exynos_pmu_irq_init(struct device_node *node,
225 225
226EXYNOS_PMU_IRQ(exynos3250_pmu_irq, "samsung,exynos3250-pmu"); 226EXYNOS_PMU_IRQ(exynos3250_pmu_irq, "samsung,exynos3250-pmu");
227EXYNOS_PMU_IRQ(exynos4210_pmu_irq, "samsung,exynos4210-pmu"); 227EXYNOS_PMU_IRQ(exynos4210_pmu_irq, "samsung,exynos4210-pmu");
228EXYNOS_PMU_IRQ(exynos4212_pmu_irq, "samsung,exynos4212-pmu");
229EXYNOS_PMU_IRQ(exynos4412_pmu_irq, "samsung,exynos4412-pmu"); 228EXYNOS_PMU_IRQ(exynos4412_pmu_irq, "samsung,exynos4412-pmu");
230EXYNOS_PMU_IRQ(exynos5250_pmu_irq, "samsung,exynos5250-pmu"); 229EXYNOS_PMU_IRQ(exynos5250_pmu_irq, "samsung,exynos5250-pmu");
231EXYNOS_PMU_IRQ(exynos5420_pmu_irq, "samsung,exynos5420-pmu"); 230EXYNOS_PMU_IRQ(exynos5420_pmu_irq, "samsung,exynos5420-pmu");
@@ -617,9 +616,6 @@ static const struct of_device_id exynos_pmu_of_device_ids[] __initconst = {
617 .compatible = "samsung,exynos4210-pmu", 616 .compatible = "samsung,exynos4210-pmu",
618 .data = &exynos4_pm_data, 617 .data = &exynos4_pm_data,
619 }, { 618 }, {
620 .compatible = "samsung,exynos4212-pmu",
621 .data = &exynos4_pm_data,
622 }, {
623 .compatible = "samsung,exynos4412-pmu", 619 .compatible = "samsung,exynos4412-pmu",
624 .data = &exynos4_pm_data, 620 .data = &exynos4_pm_data,
625 }, { 621 }, {
diff --git a/arch/arm/mach-imx/3ds_debugboard.c b/arch/arm/mach-imx/3ds_debugboard.c
index cda330c93d61..0015abe9cb2b 100644
--- a/arch/arm/mach-imx/3ds_debugboard.c
+++ b/arch/arm/mach-imx/3ds_debugboard.c
@@ -20,7 +20,7 @@
20#include <linux/smsc911x.h> 20#include <linux/smsc911x.h>
21#include <linux/regulator/machine.h> 21#include <linux/regulator/machine.h>
22#include <linux/regulator/fixed.h> 22#include <linux/regulator/fixed.h>
23 23#include "3ds_debugboard.h"
24#include "hardware.h" 24#include "hardware.h"
25 25
26/* LAN9217 ethernet base address */ 26/* LAN9217 ethernet base address */
diff --git a/arch/arm/mach-imx/cpuidle-imx5.c b/arch/arm/mach-imx/cpuidle-imx5.c
index 3feca526d16b..db0127606aed 100644
--- a/arch/arm/mach-imx/cpuidle-imx5.c
+++ b/arch/arm/mach-imx/cpuidle-imx5.c
@@ -9,6 +9,7 @@
9#include <linux/cpuidle.h> 9#include <linux/cpuidle.h>
10#include <linux/module.h> 10#include <linux/module.h>
11#include <asm/system_misc.h> 11#include <asm/system_misc.h>
12#include "cpuidle.h"
12 13
13static int imx5_cpuidle_enter(struct cpuidle_device *dev, 14static int imx5_cpuidle_enter(struct cpuidle_device *dev,
14 struct cpuidle_driver *drv, int index) 15 struct cpuidle_driver *drv, int index)
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index b5f89fdbbb4b..7d80a0ae723c 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -289,10 +289,13 @@ static void __init imx6q_init_machine(void)
289static void __init imx6q_init_late(void) 289static void __init imx6q_init_late(void)
290{ 290{
291 /* 291 /*
292 * WAIT mode is broken on TO 1.0 and 1.1, so there is no point 292 * WAIT mode is broken on imx6 Dual/Quad revision 1.0 and 1.1 so
293 * to run cpuidle on them. 293 * there is no point to run cpuidle on them.
294 *
295 * It does work on imx6 Solo/DualLite starting from 1.1
294 */ 296 */
295 if (imx_get_soc_revision() > IMX_CHIP_REVISION_1_1) 297 if ((cpu_is_imx6q() && imx_get_soc_revision() > IMX_CHIP_REVISION_1_1) ||
298 (cpu_is_imx6dl() && imx_get_soc_revision() > IMX_CHIP_REVISION_1_0))
296 imx6q_cpuidle_init(); 299 imx6q_cpuidle_init();
297 300
298 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) 301 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c
index f033a57d5694..a3250bc7f114 100644
--- a/arch/arm/mach-imx/mach-mx31lite.c
+++ b/arch/arm/mach-imx/mach-mx31lite.c
@@ -245,7 +245,7 @@ static struct map_desc mx31lite_io_desc[] __initdata = {
245/* 245/*
246 * Set up static virtual mappings. 246 * Set up static virtual mappings.
247 */ 247 */
248void __init mx31lite_map_io(void) 248static void __init mx31lite_map_io(void)
249{ 249{
250 mx31_map_io(); 250 mx31_map_io();
251 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc)); 251 iotable_init(mx31lite_io_desc, ARRAY_SIZE(mx31lite_io_desc));
diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c
index 1e91a0918e83..3c224f41e68e 100644
--- a/arch/arm/mach-imx/mx31moboard-devboard.c
+++ b/arch/arm/mach-imx/mx31moboard-devboard.c
@@ -22,6 +22,7 @@
22 22
23#include <linux/usb/otg.h> 23#include <linux/usb/otg.h>
24 24
25#include "board-mx31moboard.h"
25#include "common.h" 26#include "common.h"
26#include "devices-imx31.h" 27#include "devices-imx31.h"
27#include "ehci.h" 28#include "ehci.h"
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index 922d49175cb4..9a5a869be1ae 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -24,6 +24,7 @@
24 24
25#include <linux/usb/otg.h> 25#include <linux/usb/otg.h>
26 26
27#include "board-mx31moboard.h"
27#include "common.h" 28#include "common.h"
28#include "devices-imx31.h" 29#include "devices-imx31.h"
29#include "ehci.h" 30#include "ehci.h"
diff --git a/arch/arm/mach-integrator/Makefile b/arch/arm/mach-integrator/Makefile
index a5a4470db482..71b97ffe8d32 100644
--- a/arch/arm/mach-integrator/Makefile
+++ b/arch/arm/mach-integrator/Makefile
@@ -8,6 +8,4 @@
8obj-y := core.o lm.o 8obj-y := core.o lm.o
9obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o 9obj-$(CONFIG_ARCH_INTEGRATOR_AP) += integrator_ap.o
10obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o 10obj-$(CONFIG_ARCH_INTEGRATOR_CP) += integrator_cp.o
11
12obj-$(CONFIG_PCI) += pci_v3.o
13obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o 11obj-$(CONFIG_INTEGRATOR_IMPD1) += impd1.o
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index a1af634f8709..8efe484fac13 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -36,7 +36,6 @@
36#include "hardware.h" 36#include "hardware.h"
37#include "cm.h" 37#include "cm.h"
38#include "common.h" 38#include "common.h"
39#include "pci_v3.h"
40#include "lm.h" 39#include "lm.h"
41 40
42/* Regmap to the AP system controller */ 41/* Regmap to the AP system controller */
@@ -74,7 +73,6 @@ static struct map_desc ap_io_desc[] __initdata __maybe_unused = {
74static void __init ap_map_io(void) 73static void __init ap_map_io(void)
75{ 74{
76 iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); 75 iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc));
77 pci_v3_early_init();
78} 76}
79 77
80#ifdef CONFIG_PM 78#ifdef CONFIG_PM
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
deleted file mode 100644
index 2565f0e7b5cf..000000000000
--- a/arch/arm/mach-integrator/pci_v3.c
+++ /dev/null
@@ -1,900 +0,0 @@
1/*
2 * linux/arch/arm/mach-integrator/pci_v3.c
3 *
4 * PCI functions for V3 host PCI bridge
5 *
6 * Copyright (C) 1999 ARM Limited
7 * Copyright (C) 2000-2001 Deep Blue Solutions Ltd
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 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#include <linux/kernel.h>
24#include <linux/pci.h>
25#include <linux/ioport.h>
26#include <linux/interrupt.h>
27#include <linux/spinlock.h>
28#include <linux/init.h>
29#include <linux/io.h>
30#include <linux/platform_device.h>
31#include <linux/of.h>
32#include <linux/of_address.h>
33#include <linux/of_irq.h>
34#include <linux/of_pci.h>
35#include <video/vga.h>
36
37#include <asm/mach/map.h>
38#include <asm/signal.h>
39#include <asm/mach/pci.h>
40#include <asm/irq_regs.h>
41
42#include "pci_v3.h"
43#include "hardware.h"
44
45/*
46 * Where in the memory map does PCI live?
47 *
48 * This represents a fairly liberal usage of address space. Even though
49 * the V3 only has two windows (therefore we need to map stuff on the fly),
50 * we maintain the same addresses, even if they're not mapped.
51 */
52#define PHYS_PCI_MEM_BASE 0x40000000 /* 256M */
53#define PHYS_PCI_PRE_BASE 0x50000000 /* 256M */
54#define PHYS_PCI_IO_BASE 0x60000000 /* 16M */
55#define PHYS_PCI_CONFIG_BASE 0x61000000 /* 16M */
56#define PHYS_PCI_V3_BASE 0x62000000 /* 64K */
57
58#define PCI_MEMORY_VADDR IOMEM(0xe8000000)
59#define PCI_CONFIG_VADDR IOMEM(0xec000000)
60
61/*
62 * V3 Local Bus to PCI Bridge definitions
63 *
64 * Registers (these are taken from page 129 of the EPC User's Manual Rev 1.04
65 * All V3 register names are prefaced by V3_ to avoid clashing with any other
66 * PCI definitions. Their names match the user's manual.
67 *
68 * I'm assuming that I20 is disabled.
69 *
70 */
71#define V3_PCI_VENDOR 0x00000000
72#define V3_PCI_DEVICE 0x00000002
73#define V3_PCI_CMD 0x00000004
74#define V3_PCI_STAT 0x00000006
75#define V3_PCI_CC_REV 0x00000008
76#define V3_PCI_HDR_CFG 0x0000000C
77#define V3_PCI_IO_BASE 0x00000010
78#define V3_PCI_BASE0 0x00000014
79#define V3_PCI_BASE1 0x00000018
80#define V3_PCI_SUB_VENDOR 0x0000002C
81#define V3_PCI_SUB_ID 0x0000002E
82#define V3_PCI_ROM 0x00000030
83#define V3_PCI_BPARAM 0x0000003C
84#define V3_PCI_MAP0 0x00000040
85#define V3_PCI_MAP1 0x00000044
86#define V3_PCI_INT_STAT 0x00000048
87#define V3_PCI_INT_CFG 0x0000004C
88#define V3_LB_BASE0 0x00000054
89#define V3_LB_BASE1 0x00000058
90#define V3_LB_MAP0 0x0000005E
91#define V3_LB_MAP1 0x00000062
92#define V3_LB_BASE2 0x00000064
93#define V3_LB_MAP2 0x00000066
94#define V3_LB_SIZE 0x00000068
95#define V3_LB_IO_BASE 0x0000006E
96#define V3_FIFO_CFG 0x00000070
97#define V3_FIFO_PRIORITY 0x00000072
98#define V3_FIFO_STAT 0x00000074
99#define V3_LB_ISTAT 0x00000076
100#define V3_LB_IMASK 0x00000077
101#define V3_SYSTEM 0x00000078
102#define V3_LB_CFG 0x0000007A
103#define V3_PCI_CFG 0x0000007C
104#define V3_DMA_PCI_ADR0 0x00000080
105#define V3_DMA_PCI_ADR1 0x00000090
106#define V3_DMA_LOCAL_ADR0 0x00000084
107#define V3_DMA_LOCAL_ADR1 0x00000094
108#define V3_DMA_LENGTH0 0x00000088
109#define V3_DMA_LENGTH1 0x00000098
110#define V3_DMA_CSR0 0x0000008B
111#define V3_DMA_CSR1 0x0000009B
112#define V3_DMA_CTLB_ADR0 0x0000008C
113#define V3_DMA_CTLB_ADR1 0x0000009C
114#define V3_DMA_DELAY 0x000000E0
115#define V3_MAIL_DATA 0x000000C0
116#define V3_PCI_MAIL_IEWR 0x000000D0
117#define V3_PCI_MAIL_IERD 0x000000D2
118#define V3_LB_MAIL_IEWR 0x000000D4
119#define V3_LB_MAIL_IERD 0x000000D6
120#define V3_MAIL_WR_STAT 0x000000D8
121#define V3_MAIL_RD_STAT 0x000000DA
122#define V3_QBA_MAP 0x000000DC
123
124/* PCI COMMAND REGISTER bits
125 */
126#define V3_COMMAND_M_FBB_EN (1 << 9)
127#define V3_COMMAND_M_SERR_EN (1 << 8)
128#define V3_COMMAND_M_PAR_EN (1 << 6)
129#define V3_COMMAND_M_MASTER_EN (1 << 2)
130#define V3_COMMAND_M_MEM_EN (1 << 1)
131#define V3_COMMAND_M_IO_EN (1 << 0)
132
133/* SYSTEM REGISTER bits
134 */
135#define V3_SYSTEM_M_RST_OUT (1 << 15)
136#define V3_SYSTEM_M_LOCK (1 << 14)
137
138/* PCI_CFG bits
139 */
140#define V3_PCI_CFG_M_I2O_EN (1 << 15)
141#define V3_PCI_CFG_M_IO_REG_DIS (1 << 14)
142#define V3_PCI_CFG_M_IO_DIS (1 << 13)
143#define V3_PCI_CFG_M_EN3V (1 << 12)
144#define V3_PCI_CFG_M_RETRY_EN (1 << 10)
145#define V3_PCI_CFG_M_AD_LOW1 (1 << 9)
146#define V3_PCI_CFG_M_AD_LOW0 (1 << 8)
147
148/* PCI_BASE register bits (PCI -> Local Bus)
149 */
150#define V3_PCI_BASE_M_ADR_BASE 0xFFF00000
151#define V3_PCI_BASE_M_ADR_BASEL 0x000FFF00
152#define V3_PCI_BASE_M_PREFETCH (1 << 3)
153#define V3_PCI_BASE_M_TYPE (3 << 1)
154#define V3_PCI_BASE_M_IO (1 << 0)
155
156/* PCI MAP register bits (PCI -> Local bus)
157 */
158#define V3_PCI_MAP_M_MAP_ADR 0xFFF00000
159#define V3_PCI_MAP_M_RD_POST_INH (1 << 15)
160#define V3_PCI_MAP_M_ROM_SIZE (3 << 10)
161#define V3_PCI_MAP_M_SWAP (3 << 8)
162#define V3_PCI_MAP_M_ADR_SIZE 0x000000F0
163#define V3_PCI_MAP_M_REG_EN (1 << 1)
164#define V3_PCI_MAP_M_ENABLE (1 << 0)
165
166/*
167 * LB_BASE0,1 register bits (Local bus -> PCI)
168 */
169#define V3_LB_BASE_ADR_BASE 0xfff00000
170#define V3_LB_BASE_SWAP (3 << 8)
171#define V3_LB_BASE_ADR_SIZE (15 << 4)
172#define V3_LB_BASE_PREFETCH (1 << 3)
173#define V3_LB_BASE_ENABLE (1 << 0)
174
175#define V3_LB_BASE_ADR_SIZE_1MB (0 << 4)
176#define V3_LB_BASE_ADR_SIZE_2MB (1 << 4)
177#define V3_LB_BASE_ADR_SIZE_4MB (2 << 4)
178#define V3_LB_BASE_ADR_SIZE_8MB (3 << 4)
179#define V3_LB_BASE_ADR_SIZE_16MB (4 << 4)
180#define V3_LB_BASE_ADR_SIZE_32MB (5 << 4)
181#define V3_LB_BASE_ADR_SIZE_64MB (6 << 4)
182#define V3_LB_BASE_ADR_SIZE_128MB (7 << 4)
183#define V3_LB_BASE_ADR_SIZE_256MB (8 << 4)
184#define V3_LB_BASE_ADR_SIZE_512MB (9 << 4)
185#define V3_LB_BASE_ADR_SIZE_1GB (10 << 4)
186#define V3_LB_BASE_ADR_SIZE_2GB (11 << 4)
187
188#define v3_addr_to_lb_base(a) ((a) & V3_LB_BASE_ADR_BASE)
189
190/*
191 * LB_MAP0,1 register bits (Local bus -> PCI)
192 */
193#define V3_LB_MAP_MAP_ADR 0xfff0
194#define V3_LB_MAP_TYPE (7 << 1)
195#define V3_LB_MAP_AD_LOW_EN (1 << 0)
196
197#define V3_LB_MAP_TYPE_IACK (0 << 1)
198#define V3_LB_MAP_TYPE_IO (1 << 1)
199#define V3_LB_MAP_TYPE_MEM (3 << 1)
200#define V3_LB_MAP_TYPE_CONFIG (5 << 1)
201#define V3_LB_MAP_TYPE_MEM_MULTIPLE (6 << 1)
202
203#define v3_addr_to_lb_map(a) (((a) >> 16) & V3_LB_MAP_MAP_ADR)
204
205/*
206 * LB_BASE2 register bits (Local bus -> PCI IO)
207 */
208#define V3_LB_BASE2_ADR_BASE 0xff00
209#define V3_LB_BASE2_SWAP (3 << 6)
210#define V3_LB_BASE2_ENABLE (1 << 0)
211
212#define v3_addr_to_lb_base2(a) (((a) >> 16) & V3_LB_BASE2_ADR_BASE)
213
214/*
215 * LB_MAP2 register bits (Local bus -> PCI IO)
216 */
217#define V3_LB_MAP2_MAP_ADR 0xff00
218
219#define v3_addr_to_lb_map2(a) (((a) >> 16) & V3_LB_MAP2_MAP_ADR)
220
221/*
222 * The V3 PCI interface chip in Integrator provides several windows from
223 * local bus memory into the PCI memory areas. Unfortunately, there
224 * are not really enough windows for our usage, therefore we reuse
225 * one of the windows for access to PCI configuration space. The
226 * memory map is as follows:
227 *
228 * Local Bus Memory Usage
229 *
230 * 40000000 - 4FFFFFFF PCI memory. 256M non-prefetchable
231 * 50000000 - 5FFFFFFF PCI memory. 256M prefetchable
232 * 60000000 - 60FFFFFF PCI IO. 16M
233 * 61000000 - 61FFFFFF PCI Configuration. 16M
234 *
235 * There are three V3 windows, each described by a pair of V3 registers.
236 * These are LB_BASE0/LB_MAP0, LB_BASE1/LB_MAP1 and LB_BASE2/LB_MAP2.
237 * Base0 and Base1 can be used for any type of PCI memory access. Base2
238 * can be used either for PCI I/O or for I20 accesses. By default, uHAL
239 * uses this only for PCI IO space.
240 *
241 * Normally these spaces are mapped using the following base registers:
242 *
243 * Usage Local Bus Memory Base/Map registers used
244 *
245 * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0
246 * Mem 50000000 - 5FFFFFFF LB_BASE1/LB_MAP1
247 * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2
248 * Cfg 61000000 - 61FFFFFF
249 *
250 * This means that I20 and PCI configuration space accesses will fail.
251 * When PCI configuration accesses are needed (via the uHAL PCI
252 * configuration space primitives) we must remap the spaces as follows:
253 *
254 * Usage Local Bus Memory Base/Map registers used
255 *
256 * Mem 40000000 - 4FFFFFFF LB_BASE0/LB_MAP0
257 * Mem 50000000 - 5FFFFFFF LB_BASE0/LB_MAP0
258 * IO 60000000 - 60FFFFFF LB_BASE2/LB_MAP2
259 * Cfg 61000000 - 61FFFFFF LB_BASE1/LB_MAP1
260 *
261 * To make this work, the code depends on overlapping windows working.
262 * The V3 chip translates an address by checking its range within
263 * each of the BASE/MAP pairs in turn (in ascending register number
264 * order). It will use the first matching pair. So, for example,
265 * if the same address is mapped by both LB_BASE0/LB_MAP0 and
266 * LB_BASE1/LB_MAP1, the V3 will use the translation from
267 * LB_BASE0/LB_MAP0.
268 *
269 * To allow PCI Configuration space access, the code enlarges the
270 * window mapped by LB_BASE0/LB_MAP0 from 256M to 512M. This occludes
271 * the windows currently mapped by LB_BASE1/LB_MAP1 so that it can
272 * be remapped for use by configuration cycles.
273 *
274 * At the end of the PCI Configuration space accesses,
275 * LB_BASE1/LB_MAP1 is reset to map PCI Memory. Finally the window
276 * mapped by LB_BASE0/LB_MAP0 is reduced in size from 512M to 256M to
277 * reveal the now restored LB_BASE1/LB_MAP1 window.
278 *
279 * NOTE: We do not set up I2O mapping. I suspect that this is only
280 * for an intelligent (target) device. Using I2O disables most of
281 * the mappings into PCI memory.
282 */
283
284/* Filled in by probe */
285static void __iomem *pci_v3_base;
286/* CPU side memory ranges */
287static struct resource conf_mem; /* FIXME: remap this instead of static map */
288static struct resource io_mem;
289static struct resource non_mem;
290static struct resource pre_mem;
291/* PCI side memory ranges */
292static u64 non_mem_pci;
293static u64 non_mem_pci_sz;
294static u64 pre_mem_pci;
295static u64 pre_mem_pci_sz;
296
297// V3 access routines
298#define v3_writeb(o,v) __raw_writeb(v, pci_v3_base + (unsigned int)(o))
299#define v3_readb(o) (__raw_readb(pci_v3_base + (unsigned int)(o)))
300
301#define v3_writew(o,v) __raw_writew(v, pci_v3_base + (unsigned int)(o))
302#define v3_readw(o) (__raw_readw(pci_v3_base + (unsigned int)(o)))
303
304#define v3_writel(o,v) __raw_writel(v, pci_v3_base + (unsigned int)(o))
305#define v3_readl(o) (__raw_readl(pci_v3_base + (unsigned int)(o)))
306
307/*============================================================================
308 *
309 * routine: uHALir_PCIMakeConfigAddress()
310 *
311 * parameters: bus = which bus
312 * device = which device
313 * function = which function
314 * offset = configuration space register we are interested in
315 *
316 * description: this routine will generate a platform dependent config
317 * address.
318 *
319 * calls: none
320 *
321 * returns: configuration address to play on the PCI bus
322 *
323 * To generate the appropriate PCI configuration cycles in the PCI
324 * configuration address space, you present the V3 with the following pattern
325 * (which is very nearly a type 1 (except that the lower two bits are 00 and
326 * not 01). In order for this mapping to work you need to set up one of
327 * the local to PCI aperatures to 16Mbytes in length translating to
328 * PCI configuration space starting at 0x0000.0000.
329 *
330 * PCI configuration cycles look like this:
331 *
332 * Type 0:
333 *
334 * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1
335 * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
336 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
337 * | | |D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|0|
338 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
339 *
340 * 31:11 Device select bit.
341 * 10:8 Function number
342 * 7:2 Register number
343 *
344 * Type 1:
345 *
346 * 3 3|3 3 2 2|2 2 2 2|2 2 2 2|1 1 1 1|1 1 1 1|1 1
347 * 3 2|1 0 9 8|7 6 5 4|3 2 1 0|9 8 7 6|5 4 3 2|1 0 9 8|7 6 5 4|3 2 1 0
348 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
349 * | | | | | | | | | | |B|B|B|B|B|B|B|B|D|D|D|D|D|F|F|F|R|R|R|R|R|R|0|1|
350 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
351 *
352 * 31:24 reserved
353 * 23:16 bus number (8 bits = 128 possible buses)
354 * 15:11 Device number (5 bits)
355 * 10:8 function number
356 * 7:2 register number
357 *
358 */
359
360#undef V3_LB_BASE_PREFETCH
361#define V3_LB_BASE_PREFETCH 0
362
363static void __iomem *v3_open_config_window(struct pci_bus *bus,
364 unsigned int devfn, int offset)
365{
366 unsigned int address, mapaddress, busnr;
367
368 busnr = bus->number;
369
370 /*
371 * Trap out illegal values
372 */
373 BUG_ON(offset > 255);
374 BUG_ON(busnr > 255);
375 BUG_ON(devfn > 255);
376
377 if (busnr == 0) {
378 int slot = PCI_SLOT(devfn);
379
380 /*
381 * local bus segment so need a type 0 config cycle
382 *
383 * build the PCI configuration "address" with one-hot in
384 * A31-A11
385 *
386 * mapaddress:
387 * 3:1 = config cycle (101)
388 * 0 = PCI A1 & A0 are 0 (0)
389 */
390 address = PCI_FUNC(devfn) << 8;
391 mapaddress = V3_LB_MAP_TYPE_CONFIG;
392
393 if (slot > 12)
394 /*
395 * high order bits are handled by the MAP register
396 */
397 mapaddress |= 1 << (slot - 5);
398 else
399 /*
400 * low order bits handled directly in the address
401 */
402 address |= 1 << (slot + 11);
403 } else {
404 /*
405 * not the local bus segment so need a type 1 config cycle
406 *
407 * address:
408 * 23:16 = bus number
409 * 15:11 = slot number (7:3 of devfn)
410 * 10:8 = func number (2:0 of devfn)
411 *
412 * mapaddress:
413 * 3:1 = config cycle (101)
414 * 0 = PCI A1 & A0 from host bus (1)
415 */
416 mapaddress = V3_LB_MAP_TYPE_CONFIG | V3_LB_MAP_AD_LOW_EN;
417 address = (busnr << 16) | (devfn << 8);
418 }
419
420 /*
421 * Set up base0 to see all 512Mbytes of memory space (not
422 * prefetchable), this frees up base1 for re-use by
423 * configuration memory
424 */
425 v3_writel(V3_LB_BASE0, v3_addr_to_lb_base(non_mem.start) |
426 V3_LB_BASE_ADR_SIZE_512MB | V3_LB_BASE_ENABLE);
427
428 /*
429 * Set up base1/map1 to point into configuration space.
430 */
431 v3_writel(V3_LB_BASE1, v3_addr_to_lb_base(conf_mem.start) |
432 V3_LB_BASE_ADR_SIZE_16MB | V3_LB_BASE_ENABLE);
433 v3_writew(V3_LB_MAP1, mapaddress);
434
435 return PCI_CONFIG_VADDR + address + offset;
436}
437
438static void v3_close_config_window(void)
439{
440 /*
441 * Reassign base1 for use by prefetchable PCI memory
442 */
443 v3_writel(V3_LB_BASE1, v3_addr_to_lb_base(pre_mem.start) |
444 V3_LB_BASE_ADR_SIZE_256MB | V3_LB_BASE_PREFETCH |
445 V3_LB_BASE_ENABLE);
446 v3_writew(V3_LB_MAP1, v3_addr_to_lb_map(pre_mem_pci) |
447 V3_LB_MAP_TYPE_MEM_MULTIPLE);
448
449 /*
450 * And shrink base0 back to a 256M window (NOTE: MAP0 already correct)
451 */
452 v3_writel(V3_LB_BASE0, v3_addr_to_lb_base(non_mem.start) |
453 V3_LB_BASE_ADR_SIZE_256MB | V3_LB_BASE_ENABLE);
454}
455
456static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where,
457 int size, u32 *val)
458{
459 int ret = pci_generic_config_read(bus, devfn, where, size, val);
460 v3_close_config_window();
461 return ret;
462}
463
464static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where,
465 int size, u32 val)
466{
467 int ret = pci_generic_config_write(bus, devfn, where, size, val);
468 v3_close_config_window();
469 return ret;
470}
471
472static struct pci_ops pci_v3_ops = {
473 .map_bus = v3_open_config_window,
474 .read = v3_read_config,
475 .write = v3_write_config,
476};
477
478static int __init pci_v3_setup_resources(struct pci_sys_data *sys)
479{
480 if (request_resource(&iomem_resource, &non_mem)) {
481 printk(KERN_ERR "PCI: unable to allocate non-prefetchable "
482 "memory region\n");
483 return -EBUSY;
484 }
485 if (request_resource(&iomem_resource, &pre_mem)) {
486 release_resource(&non_mem);
487 printk(KERN_ERR "PCI: unable to allocate prefetchable "
488 "memory region\n");
489 return -EBUSY;
490 }
491
492 /*
493 * the mem resource for this bus
494 * the prefetch mem resource for this bus
495 */
496 pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset);
497 pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset);
498
499 return 1;
500}
501
502/*
503 * These don't seem to be implemented on the Integrator I have, which
504 * means I can't get additional information on the reason for the pm2fb
505 * problems. I suppose I'll just have to mind-meld with the machine. ;)
506 */
507static void __iomem *ap_syscon_base;
508#define INTEGRATOR_SC_PCIENABLE_OFFSET 0x18
509#define INTEGRATOR_SC_LBFADDR_OFFSET 0x20
510#define INTEGRATOR_SC_LBFCODE_OFFSET 0x24
511
512static int
513v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
514{
515 unsigned long pc = instruction_pointer(regs);
516 unsigned long instr = *(unsigned long *)pc;
517#if 0
518 char buf[128];
519
520 sprintf(buf, "V3 fault: addr 0x%08lx, FSR 0x%03x, PC 0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x ISTAT=%02x\n",
521 addr, fsr, pc, instr, __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFADDR_OFFSET), __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFCODE_OFFSET) & 255,
522 v3_readb(V3_LB_ISTAT));
523 printk(KERN_DEBUG "%s", buf);
524#endif
525
526 v3_writeb(V3_LB_ISTAT, 0);
527 __raw_writel(3, ap_syscon_base + INTEGRATOR_SC_PCIENABLE_OFFSET);
528
529 /*
530 * If the instruction being executed was a read,
531 * make it look like it read all-ones.
532 */
533 if ((instr & 0x0c100000) == 0x04100000) {
534 int reg = (instr >> 12) & 15;
535 unsigned long val;
536
537 if (instr & 0x00400000)
538 val = 255;
539 else
540 val = -1;
541
542 regs->uregs[reg] = val;
543 regs->ARM_pc += 4;
544 return 0;
545 }
546
547 if ((instr & 0x0e100090) == 0x00100090) {
548 int reg = (instr >> 12) & 15;
549
550 regs->uregs[reg] = -1;
551 regs->ARM_pc += 4;
552 return 0;
553 }
554
555 return 1;
556}
557
558static irqreturn_t v3_irq(int irq, void *devid)
559{
560#ifdef CONFIG_DEBUG_LL
561 struct pt_regs *regs = get_irq_regs();
562 unsigned long pc = instruction_pointer(regs);
563 unsigned long instr = *(unsigned long *)pc;
564 char buf[128];
565 extern void printascii(const char *);
566
567 sprintf(buf, "V3 int %d: pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x "
568 "ISTAT=%02x\n", irq, pc, instr,
569 __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFADDR_OFFSET),
570 __raw_readl(ap_syscon_base + INTEGRATOR_SC_LBFCODE_OFFSET) & 255,
571 v3_readb(V3_LB_ISTAT));
572 printascii(buf);
573#endif
574
575 v3_writew(V3_PCI_STAT, 0xf000);
576 v3_writeb(V3_LB_ISTAT, 0);
577 __raw_writel(3, ap_syscon_base + INTEGRATOR_SC_PCIENABLE_OFFSET);
578
579#ifdef CONFIG_DEBUG_LL
580 /*
581 * If the instruction being executed was a read,
582 * make it look like it read all-ones.
583 */
584 if ((instr & 0x0c100000) == 0x04100000) {
585 int reg = (instr >> 16) & 15;
586 sprintf(buf, " reg%d = %08lx\n", reg, regs->uregs[reg]);
587 printascii(buf);
588 }
589#endif
590 return IRQ_HANDLED;
591}
592
593static int __init pci_v3_setup(int nr, struct pci_sys_data *sys)
594{
595 int ret = 0;
596
597 if (!ap_syscon_base)
598 return -EINVAL;
599
600 if (nr == 0) {
601 sys->mem_offset = non_mem.start;
602 ret = pci_v3_setup_resources(sys);
603 }
604
605 return ret;
606}
607
608/*
609 * V3_LB_BASE? - local bus address
610 * V3_LB_MAP? - pci bus address
611 */
612static void __init pci_v3_preinit(void)
613{
614 unsigned int temp;
615 phys_addr_t io_address = pci_pio_to_address(io_mem.start);
616
617 pcibios_min_mem = 0x00100000;
618
619 /*
620 * Hook in our fault handler for PCI errors
621 */
622 hook_fault_code(4, v3_pci_fault, SIGBUS, 0, "external abort on linefetch");
623 hook_fault_code(6, v3_pci_fault, SIGBUS, 0, "external abort on linefetch");
624 hook_fault_code(8, v3_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
625 hook_fault_code(10, v3_pci_fault, SIGBUS, 0, "external abort on non-linefetch");
626
627 /*
628 * Unlock V3 registers, but only if they were previously locked.
629 */
630 if (v3_readw(V3_SYSTEM) & V3_SYSTEM_M_LOCK)
631 v3_writew(V3_SYSTEM, 0xa05f);
632
633 /*
634 * Setup window 0 - PCI non-prefetchable memory
635 * Local: 0x40000000 Bus: 0x00000000 Size: 256MB
636 */
637 v3_writel(V3_LB_BASE0, v3_addr_to_lb_base(non_mem.start) |
638 V3_LB_BASE_ADR_SIZE_256MB | V3_LB_BASE_ENABLE);
639 v3_writew(V3_LB_MAP0, v3_addr_to_lb_map(non_mem_pci) |
640 V3_LB_MAP_TYPE_MEM);
641
642 /*
643 * Setup window 1 - PCI prefetchable memory
644 * Local: 0x50000000 Bus: 0x10000000 Size: 256MB
645 */
646 v3_writel(V3_LB_BASE1, v3_addr_to_lb_base(pre_mem.start) |
647 V3_LB_BASE_ADR_SIZE_256MB | V3_LB_BASE_PREFETCH |
648 V3_LB_BASE_ENABLE);
649 v3_writew(V3_LB_MAP1, v3_addr_to_lb_map(pre_mem_pci) |
650 V3_LB_MAP_TYPE_MEM_MULTIPLE);
651
652 /*
653 * Setup window 2 - PCI IO
654 */
655 v3_writel(V3_LB_BASE2, v3_addr_to_lb_base2(io_address) |
656 V3_LB_BASE_ENABLE);
657 v3_writew(V3_LB_MAP2, v3_addr_to_lb_map2(0));
658
659 /*
660 * Disable PCI to host IO cycles
661 */
662 temp = v3_readw(V3_PCI_CFG) & ~V3_PCI_CFG_M_I2O_EN;
663 temp |= V3_PCI_CFG_M_IO_REG_DIS | V3_PCI_CFG_M_IO_DIS;
664 v3_writew(V3_PCI_CFG, temp);
665
666 printk(KERN_DEBUG "FIFO_CFG: %04x FIFO_PRIO: %04x\n",
667 v3_readw(V3_FIFO_CFG), v3_readw(V3_FIFO_PRIORITY));
668
669 /*
670 * Set the V3 FIFO such that writes have higher priority than
671 * reads, and local bus write causes local bus read fifo flush.
672 * Same for PCI.
673 */
674 v3_writew(V3_FIFO_PRIORITY, 0x0a0a);
675
676 /*
677 * Re-lock the system register.
678 */
679 temp = v3_readw(V3_SYSTEM) | V3_SYSTEM_M_LOCK;
680 v3_writew(V3_SYSTEM, temp);
681
682 /*
683 * Clear any error conditions, and enable write errors.
684 */
685 v3_writeb(V3_LB_ISTAT, 0);
686 v3_writew(V3_LB_CFG, v3_readw(V3_LB_CFG) | (1 << 10));
687 v3_writeb(V3_LB_IMASK, 0x28);
688 __raw_writel(3, ap_syscon_base + INTEGRATOR_SC_PCIENABLE_OFFSET);
689}
690
691static void __init pci_v3_postinit(void)
692{
693 unsigned int pci_cmd;
694 phys_addr_t io_address = pci_pio_to_address(io_mem.start);
695
696 pci_cmd = PCI_COMMAND_MEMORY |
697 PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE;
698
699 v3_writew(V3_PCI_CMD, pci_cmd);
700
701 v3_writeb(V3_LB_ISTAT, ~0x40);
702 v3_writeb(V3_LB_IMASK, 0x68);
703
704#if 0
705 ret = request_irq(IRQ_AP_LBUSTIMEOUT, lb_timeout, 0, "bus timeout", NULL);
706 if (ret)
707 printk(KERN_ERR "PCI: unable to grab local bus timeout "
708 "interrupt: %d\n", ret);
709#endif
710
711 register_isa_ports(non_mem.start, io_address, 0);
712}
713
714/*
715 * A small note about bridges and interrupts. The DECchip 21050 (and
716 * later) adheres to the PCI-PCI bridge specification. This says that
717 * the interrupts on the other side of a bridge are swizzled in the
718 * following manner:
719 *
720 * Dev Interrupt Interrupt
721 * Pin on Pin on
722 * Device Connector
723 *
724 * 4 A A
725 * B B
726 * C C
727 * D D
728 *
729 * 5 A B
730 * B C
731 * C D
732 * D A
733 *
734 * 6 A C
735 * B D
736 * C A
737 * D B
738 *
739 * 7 A D
740 * B A
741 * C B
742 * D C
743 *
744 * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A.
745 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4
746 */
747
748/*
749 * This routine handles multiple bridges.
750 */
751static u8 __init pci_v3_swizzle(struct pci_dev *dev, u8 *pinp)
752{
753 if (*pinp == 0)
754 *pinp = 1;
755
756 return pci_common_swizzle(dev, pinp);
757}
758
759static struct hw_pci pci_v3 __initdata = {
760 .swizzle = pci_v3_swizzle,
761 .setup = pci_v3_setup,
762 .nr_controllers = 1,
763 .ops = &pci_v3_ops,
764 .preinit = pci_v3_preinit,
765 .postinit = pci_v3_postinit,
766};
767
768static int __init pci_v3_probe(struct platform_device *pdev)
769{
770 struct device_node *np = pdev->dev.of_node;
771 struct of_pci_range_parser parser;
772 struct of_pci_range range;
773 struct resource *res;
774 int irq, ret;
775
776 /* Remap the Integrator system controller */
777 ap_syscon_base = devm_ioremap(&pdev->dev, INTEGRATOR_SC_BASE, 0x100);
778 if (!ap_syscon_base) {
779 dev_err(&pdev->dev, "unable to remap the AP syscon for PCIv3\n");
780 return -ENODEV;
781 }
782
783 /* Device tree probe path */
784 if (!np) {
785 dev_err(&pdev->dev, "no device tree node for PCIv3\n");
786 return -ENODEV;
787 }
788
789 if (of_pci_range_parser_init(&parser, np))
790 return -EINVAL;
791
792 /* Get base for bridge registers */
793 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
794 if (!res) {
795 dev_err(&pdev->dev, "unable to obtain PCIv3 base\n");
796 return -ENODEV;
797 }
798 pci_v3_base = devm_ioremap(&pdev->dev, res->start,
799 resource_size(res));
800 if (!pci_v3_base) {
801 dev_err(&pdev->dev, "unable to remap PCIv3 base\n");
802 return -ENODEV;
803 }
804
805 /* Get and request error IRQ resource */
806 irq = platform_get_irq(pdev, 0);
807 if (irq <= 0) {
808 dev_err(&pdev->dev, "unable to obtain PCIv3 error IRQ\n");
809 return -ENODEV;
810 }
811 ret = devm_request_irq(&pdev->dev, irq, v3_irq, 0,
812 "PCIv3 error", NULL);
813 if (ret < 0) {
814 dev_err(&pdev->dev, "unable to request PCIv3 error IRQ %d (%d)\n", irq, ret);
815 return ret;
816 }
817
818 for_each_of_pci_range(&parser, &range) {
819 if (!range.flags) {
820 ret = of_pci_range_to_resource(&range, np, &conf_mem);
821 conf_mem.name = "PCIv3 config";
822 }
823 if (range.flags & IORESOURCE_IO) {
824 ret = of_pci_range_to_resource(&range, np, &io_mem);
825 io_mem.name = "PCIv3 I/O";
826 }
827 if ((range.flags & IORESOURCE_MEM) &&
828 !(range.flags & IORESOURCE_PREFETCH)) {
829 non_mem_pci = range.pci_addr;
830 non_mem_pci_sz = range.size;
831 ret = of_pci_range_to_resource(&range, np, &non_mem);
832 non_mem.name = "PCIv3 non-prefetched mem";
833 }
834 if ((range.flags & IORESOURCE_MEM) &&
835 (range.flags & IORESOURCE_PREFETCH)) {
836 pre_mem_pci = range.pci_addr;
837 pre_mem_pci_sz = range.size;
838 ret = of_pci_range_to_resource(&range, np, &pre_mem);
839 pre_mem.name = "PCIv3 prefetched mem";
840 }
841
842 if (ret < 0) {
843 dev_err(&pdev->dev, "missing ranges in device node\n");
844 return ret;
845 }
846 }
847
848 pci_v3.map_irq = of_irq_parse_and_map_pci;
849 pci_common_init_dev(&pdev->dev, &pci_v3);
850
851 return 0;
852}
853
854static const struct of_device_id pci_ids[] = {
855 { .compatible = "v3,v360epc-pci", },
856 {},
857};
858
859static struct platform_driver pci_v3_driver = {
860 .driver = {
861 .name = "pci-v3",
862 .of_match_table = pci_ids,
863 },
864};
865
866static int __init pci_v3_init(void)
867{
868 return platform_driver_probe(&pci_v3_driver, pci_v3_probe);
869}
870
871subsys_initcall(pci_v3_init);
872
873/*
874 * Static mappings for the PCIv3 bridge
875 *
876 * e8000000 40000000 PCI memory PHYS_PCI_MEM_BASE (max 512M)
877 * ec000000 61000000 PCI config space PHYS_PCI_CONFIG_BASE (max 16M)
878 * fee00000 60000000 PCI IO PHYS_PCI_IO_BASE (max 16M)
879 */
880static struct map_desc pci_v3_io_desc[] __initdata __maybe_unused = {
881 {
882 .virtual = (unsigned long)PCI_MEMORY_VADDR,
883 .pfn = __phys_to_pfn(PHYS_PCI_MEM_BASE),
884 .length = SZ_16M,
885 .type = MT_DEVICE
886 }, {
887 .virtual = (unsigned long)PCI_CONFIG_VADDR,
888 .pfn = __phys_to_pfn(PHYS_PCI_CONFIG_BASE),
889 .length = SZ_16M,
890 .type = MT_DEVICE
891 }
892};
893
894int __init pci_v3_early_init(void)
895{
896 iotable_init(pci_v3_io_desc, ARRAY_SIZE(pci_v3_io_desc));
897 vga_base = (unsigned long)PCI_MEMORY_VADDR;
898 pci_map_io_early(__phys_to_pfn(PHYS_PCI_IO_BASE));
899 return 0;
900}
diff --git a/arch/arm/mach-integrator/pci_v3.h b/arch/arm/mach-integrator/pci_v3.h
deleted file mode 100644
index cafc7174baab..000000000000
--- a/arch/arm/mach-integrator/pci_v3.h
+++ /dev/null
@@ -1,10 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/* Simple oneliner include to the PCIv3 early init */
3#ifdef CONFIG_PCI
4extern int pci_v3_early_init(void);
5#else
6static inline int pci_v3_early_init(void)
7{
8 return 0;
9}
10#endif
diff --git a/arch/arm/mach-meson/Kconfig b/arch/arm/mach-meson/Kconfig
index ee30511849ca..aff6164b2083 100644
--- a/arch/arm/mach-meson/Kconfig
+++ b/arch/arm/mach-meson/Kconfig
@@ -9,6 +9,7 @@ menuconfig ARCH_MESON
9 select PINCTRL_MESON 9 select PINCTRL_MESON
10 select COMMON_CLK 10 select COMMON_CLK
11 select COMMON_CLK_AMLOGIC 11 select COMMON_CLK_AMLOGIC
12 select HAVE_ARM_SCU if SMP
12 13
13if ARCH_MESON 14if ARCH_MESON
14 15
@@ -28,5 +29,6 @@ config MACH_MESON8B
28 default ARCH_MESON 29 default ARCH_MESON
29 select MESON6_TIMER 30 select MESON6_TIMER
30 select COMMON_CLK_MESON8B 31 select COMMON_CLK_MESON8B
32 select MESON_IRQ_GPIO
31 33
32endif 34endif
diff --git a/arch/arm/mach-meson/Makefile b/arch/arm/mach-meson/Makefile
index 9d7380eeeedd..bc26c85a7e8f 100644
--- a/arch/arm/mach-meson/Makefile
+++ b/arch/arm/mach-meson/Makefile
@@ -1 +1,2 @@
1obj-$(CONFIG_ARCH_MESON) += meson.o 1obj-$(CONFIG_ARCH_MESON) += meson.o
2obj-$(CONFIG_SMP) += platsmp.o
diff --git a/arch/arm/mach-meson/platsmp.c b/arch/arm/mach-meson/platsmp.c
new file mode 100644
index 000000000000..2555f9056a33
--- /dev/null
+++ b/arch/arm/mach-meson/platsmp.c
@@ -0,0 +1,440 @@
1/*
2 * Copyright (C) 2015 Carlo Caione <carlo@endlessm.com>
3 * Copyright (C) 2017 Martin Blumenstingl <martin.blumenstingl@googlemail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 */
16
17#include <linux/delay.h>
18#include <linux/init.h>
19#include <linux/io.h>
20#include <linux/of.h>
21#include <linux/of_address.h>
22#include <linux/regmap.h>
23#include <linux/reset.h>
24#include <linux/smp.h>
25#include <linux/mfd/syscon.h>
26
27#include <asm/cacheflush.h>
28#include <asm/cp15.h>
29#include <asm/smp_scu.h>
30#include <asm/smp_plat.h>
31
32#define MESON_SMP_SRAM_CPU_CTRL_REG (0x00)
33#define MESON_SMP_SRAM_CPU_CTRL_ADDR_REG(c) (0x04 + ((c - 1) << 2))
34
35#define MESON_CPU_AO_RTI_PWR_A9_CNTL0 (0x00)
36#define MESON_CPU_AO_RTI_PWR_A9_CNTL1 (0x04)
37#define MESON_CPU_AO_RTI_PWR_A9_MEM_PD0 (0x14)
38
39#define MESON_CPU_PWR_A9_CNTL0_M(c) (0x03 << ((c * 2) + 16))
40#define MESON_CPU_PWR_A9_CNTL1_M(c) (0x03 << ((c + 1) << 1))
41#define MESON_CPU_PWR_A9_MEM_PD0_M(c) (0x0f << (32 - (c * 4)))
42#define MESON_CPU_PWR_A9_CNTL1_ST(c) (0x01 << (c + 16))
43
44static void __iomem *sram_base;
45static void __iomem *scu_base;
46static struct regmap *pmu;
47
48static struct reset_control *meson_smp_get_core_reset(int cpu)
49{
50 struct device_node *np = of_get_cpu_node(cpu, 0);
51
52 return of_reset_control_get_exclusive(np, NULL);
53}
54
55static void meson_smp_set_cpu_ctrl(int cpu, bool on_off)
56{
57 u32 val = readl(sram_base + MESON_SMP_SRAM_CPU_CTRL_REG);
58
59 if (on_off)
60 val |= BIT(cpu);
61 else
62 val &= ~BIT(cpu);
63
64 /* keep bit 0 always enabled */
65 val |= BIT(0);
66
67 writel(val, sram_base + MESON_SMP_SRAM_CPU_CTRL_REG);
68}
69
70static void __init meson_smp_prepare_cpus(const char *scu_compatible,
71 const char *pmu_compatible,
72 const char *sram_compatible)
73{
74 static struct device_node *node;
75
76 /* SMP SRAM */
77 node = of_find_compatible_node(NULL, NULL, sram_compatible);
78 if (!node) {
79 pr_err("Missing SRAM node\n");
80 return;
81 }
82
83 sram_base = of_iomap(node, 0);
84 if (!sram_base) {
85 pr_err("Couldn't map SRAM registers\n");
86 return;
87 }
88
89 /* PMU */
90 pmu = syscon_regmap_lookup_by_compatible(pmu_compatible);
91 if (IS_ERR(pmu)) {
92 pr_err("Couldn't map PMU registers\n");
93 return;
94 }
95
96 /* SCU */
97 node = of_find_compatible_node(NULL, NULL, scu_compatible);
98 if (!node) {
99 pr_err("Missing SCU node\n");
100 return;
101 }
102
103 scu_base = of_iomap(node, 0);
104 if (!scu_base) {
105 pr_err("Couln't map SCU registers\n");
106 return;
107 }
108
109 scu_enable(scu_base);
110}
111
112static void __init meson8b_smp_prepare_cpus(unsigned int max_cpus)
113{
114 meson_smp_prepare_cpus("arm,cortex-a5-scu", "amlogic,meson8b-pmu",
115 "amlogic,meson8b-smp-sram");
116}
117
118static void __init meson8_smp_prepare_cpus(unsigned int max_cpus)
119{
120 meson_smp_prepare_cpus("arm,cortex-a9-scu", "amlogic,meson8-pmu",
121 "amlogic,meson8-smp-sram");
122}
123
124static void meson_smp_begin_secondary_boot(unsigned int cpu)
125{
126 /*
127 * Set the entry point before powering on the CPU through the SCU. This
128 * is needed if the CPU is in "warm" state (= after rebooting the
129 * system without power-cycling, or when taking the CPU offline and
130 * then taking it online again.
131 */
132 writel(__pa_symbol(secondary_startup),
133 sram_base + MESON_SMP_SRAM_CPU_CTRL_ADDR_REG(cpu));
134
135 /*
136 * SCU Power on CPU (needs to be done before starting the CPU,
137 * otherwise the secondary CPU will not start).
138 */
139 scu_cpu_power_enable(scu_base, cpu);
140}
141
142static int meson_smp_finalize_secondary_boot(unsigned int cpu)
143{
144 unsigned long timeout;
145
146 timeout = jiffies + (10 * HZ);
147 while (readl(sram_base + MESON_SMP_SRAM_CPU_CTRL_ADDR_REG(cpu))) {
148 if (!time_before(jiffies, timeout)) {
149 pr_err("Timeout while waiting for CPU%d status\n",
150 cpu);
151 return -ETIMEDOUT;
152 }
153 }
154
155 writel(__pa_symbol(secondary_startup),
156 sram_base + MESON_SMP_SRAM_CPU_CTRL_ADDR_REG(cpu));
157
158 meson_smp_set_cpu_ctrl(cpu, true);
159
160 return 0;
161}
162
163static int meson8_smp_boot_secondary(unsigned int cpu,
164 struct task_struct *idle)
165{
166 struct reset_control *rstc;
167 int ret;
168
169 rstc = meson_smp_get_core_reset(cpu);
170 if (IS_ERR(rstc)) {
171 pr_err("Couldn't get the reset controller for CPU%d\n", cpu);
172 return PTR_ERR(rstc);
173 }
174
175 meson_smp_begin_secondary_boot(cpu);
176
177 /* Reset enable */
178 ret = reset_control_assert(rstc);
179 if (ret) {
180 pr_err("Failed to assert CPU%d reset\n", cpu);
181 goto out;
182 }
183
184 /* CPU power ON */
185 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL1,
186 MESON_CPU_PWR_A9_CNTL1_M(cpu), 0);
187 if (ret < 0) {
188 pr_err("Couldn't wake up CPU%d\n", cpu);
189 goto out;
190 }
191
192 udelay(10);
193
194 /* Isolation disable */
195 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL0, BIT(cpu),
196 0);
197 if (ret < 0) {
198 pr_err("Error when disabling isolation of CPU%d\n", cpu);
199 goto out;
200 }
201
202 /* Reset disable */
203 ret = reset_control_deassert(rstc);
204 if (ret) {
205 pr_err("Failed to de-assert CPU%d reset\n", cpu);
206 goto out;
207 }
208
209 ret = meson_smp_finalize_secondary_boot(cpu);
210 if (ret)
211 goto out;
212
213out:
214 reset_control_put(rstc);
215
216 return 0;
217}
218
219static int meson8b_smp_boot_secondary(unsigned int cpu,
220 struct task_struct *idle)
221{
222 struct reset_control *rstc;
223 int ret;
224 u32 val;
225
226 rstc = meson_smp_get_core_reset(cpu);
227 if (IS_ERR(rstc)) {
228 pr_err("Couldn't get the reset controller for CPU%d\n", cpu);
229 return PTR_ERR(rstc);
230 }
231
232 meson_smp_begin_secondary_boot(cpu);
233
234 /* CPU power UP */
235 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL0,
236 MESON_CPU_PWR_A9_CNTL0_M(cpu), 0);
237 if (ret < 0) {
238 pr_err("Couldn't power up CPU%d\n", cpu);
239 goto out;
240 }
241
242 udelay(5);
243
244 /* Reset enable */
245 ret = reset_control_assert(rstc);
246 if (ret) {
247 pr_err("Failed to assert CPU%d reset\n", cpu);
248 goto out;
249 }
250
251 /* Memory power UP */
252 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_MEM_PD0,
253 MESON_CPU_PWR_A9_MEM_PD0_M(cpu), 0);
254 if (ret < 0) {
255 pr_err("Couldn't power up the memory for CPU%d\n", cpu);
256 goto out;
257 }
258
259 /* Wake up CPU */
260 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL1,
261 MESON_CPU_PWR_A9_CNTL1_M(cpu), 0);
262 if (ret < 0) {
263 pr_err("Couldn't wake up CPU%d\n", cpu);
264 goto out;
265 }
266
267 udelay(10);
268
269 ret = regmap_read_poll_timeout(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL1, val,
270 val & MESON_CPU_PWR_A9_CNTL1_ST(cpu),
271 10, 10000);
272 if (ret) {
273 pr_err("Timeout while polling PMU for CPU%d status\n", cpu);
274 goto out;
275 }
276
277 /* Isolation disable */
278 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL0, BIT(cpu),
279 0);
280 if (ret < 0) {
281 pr_err("Error when disabling isolation of CPU%d\n", cpu);
282 goto out;
283 }
284
285 /* Reset disable */
286 ret = reset_control_deassert(rstc);
287 if (ret) {
288 pr_err("Failed to de-assert CPU%d reset\n", cpu);
289 goto out;
290 }
291
292 ret = meson_smp_finalize_secondary_boot(cpu);
293 if (ret)
294 goto out;
295
296out:
297 reset_control_put(rstc);
298
299 return 0;
300}
301
302#ifdef CONFIG_HOTPLUG_CPU
303static void meson8_smp_cpu_die(unsigned int cpu)
304{
305 meson_smp_set_cpu_ctrl(cpu, false);
306
307 v7_exit_coherency_flush(louis);
308
309 scu_power_mode(scu_base, SCU_PM_POWEROFF);
310
311 dsb();
312 wfi();
313
314 /* we should never get here */
315 WARN_ON(1);
316}
317
318static int meson8_smp_cpu_kill(unsigned int cpu)
319{
320 int ret, power_mode;
321 unsigned long timeout;
322
323 timeout = jiffies + (50 * HZ);
324 do {
325 power_mode = scu_get_cpu_power_mode(scu_base, cpu);
326
327 if (power_mode == SCU_PM_POWEROFF)
328 break;
329
330 usleep_range(10000, 15000);
331 } while (time_before(jiffies, timeout));
332
333 if (power_mode != SCU_PM_POWEROFF) {
334 pr_err("Error while waiting for SCU power-off on CPU%d\n",
335 cpu);
336 return -ETIMEDOUT;
337 }
338
339 msleep(30);
340
341 /* Isolation enable */
342 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL0, BIT(cpu),
343 0x3);
344 if (ret < 0) {
345 pr_err("Error when enabling isolation for CPU%d\n", cpu);
346 return ret;
347 }
348
349 udelay(10);
350
351 /* CPU power OFF */
352 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL1,
353 MESON_CPU_PWR_A9_CNTL1_M(cpu), 0x3);
354 if (ret < 0) {
355 pr_err("Couldn't change sleep status of CPU%d\n", cpu);
356 return ret;
357 }
358
359 return 1;
360}
361
362static int meson8b_smp_cpu_kill(unsigned int cpu)
363{
364 int ret, power_mode, count = 5000;
365
366 do {
367 power_mode = scu_get_cpu_power_mode(scu_base, cpu);
368
369 if (power_mode == SCU_PM_POWEROFF)
370 break;
371
372 udelay(10);
373 } while (++count);
374
375 if (power_mode != SCU_PM_POWEROFF) {
376 pr_err("Error while waiting for SCU power-off on CPU%d\n",
377 cpu);
378 return -ETIMEDOUT;
379 }
380
381 udelay(10);
382
383 /* CPU power DOWN */
384 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL0,
385 MESON_CPU_PWR_A9_CNTL0_M(cpu), 0x3);
386 if (ret < 0) {
387 pr_err("Couldn't power down CPU%d\n", cpu);
388 return ret;
389 }
390
391 /* Isolation enable */
392 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL0, BIT(cpu),
393 0x3);
394 if (ret < 0) {
395 pr_err("Error when enabling isolation for CPU%d\n", cpu);
396 return ret;
397 }
398
399 udelay(10);
400
401 /* Sleep status */
402 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_CNTL1,
403 MESON_CPU_PWR_A9_CNTL1_M(cpu), 0x3);
404 if (ret < 0) {
405 pr_err("Couldn't change sleep status of CPU%d\n", cpu);
406 return ret;
407 }
408
409 /* Memory power DOWN */
410 ret = regmap_update_bits(pmu, MESON_CPU_AO_RTI_PWR_A9_MEM_PD0,
411 MESON_CPU_PWR_A9_MEM_PD0_M(cpu), 0xf);
412 if (ret < 0) {
413 pr_err("Couldn't power down the memory of CPU%d\n", cpu);
414 return ret;
415 }
416
417 return 1;
418}
419#endif
420
421static struct smp_operations meson8_smp_ops __initdata = {
422 .smp_prepare_cpus = meson8_smp_prepare_cpus,
423 .smp_boot_secondary = meson8_smp_boot_secondary,
424#ifdef CONFIG_HOTPLUG_CPU
425 .cpu_die = meson8_smp_cpu_die,
426 .cpu_kill = meson8_smp_cpu_kill,
427#endif
428};
429
430static struct smp_operations meson8b_smp_ops __initdata = {
431 .smp_prepare_cpus = meson8b_smp_prepare_cpus,
432 .smp_boot_secondary = meson8b_smp_boot_secondary,
433#ifdef CONFIG_HOTPLUG_CPU
434 .cpu_die = meson8_smp_cpu_die,
435 .cpu_kill = meson8b_smp_cpu_kill,
436#endif
437};
438
439CPU_METHOD_OF_DECLARE(meson8_smp, "amlogic,meson8-smp", &meson8_smp_ops);
440CPU_METHOD_OF_DECLARE(meson8b_smp, "amlogic,meson8b-smp", &meson8b_smp_ops);
diff --git a/arch/arm/mach-mxs/pm.c b/arch/arm/mach-mxs/pm.c
index 0170e99fd70f..6ae057c2cf9f 100644
--- a/arch/arm/mach-mxs/pm.c
+++ b/arch/arm/mach-mxs/pm.c
@@ -30,7 +30,7 @@ static int mxs_suspend_enter(suspend_state_t state)
30 return 0; 30 return 0;
31} 31}
32 32
33static struct platform_suspend_ops mxs_suspend_ops = { 33static const struct platform_suspend_ops mxs_suspend_ops = {
34 .enter = mxs_suspend_enter, 34 .enter = mxs_suspend_enter,
35 .valid = suspend_valid_only_mem, 35 .valid = suspend_valid_only_mem,
36}; 36};
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 6cbc69c92913..52e8e53ca154 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -156,7 +156,7 @@ static struct map_desc ams_delta_io_desc[] __initdata = {
156 } 156 }
157}; 157};
158 158
159static struct omap_lcd_config ams_delta_lcd_config __initdata = { 159static const struct omap_lcd_config ams_delta_lcd_config __initconst = {
160 .ctrl_name = "internal", 160 .ctrl_name = "internal",
161}; 161};
162 162
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index b93ad58b0a63..69bd601feb83 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -266,7 +266,7 @@ static struct platform_device *devices[] __initdata = {
266 &kp_device, 266 &kp_device,
267}; 267};
268 268
269static struct omap_lcd_config fsample_lcd_config = { 269static const struct omap_lcd_config fsample_lcd_config = {
270 .ctrl_name = "internal", 270 .ctrl_name = "internal",
271}; 271};
272 272
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 6a38c7603064..ab51f8554697 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -357,7 +357,7 @@ static struct omap_usb_config h2_usb_config __initdata = {
357 .pins[1] = 3, 357 .pins[1] = 3,
358}; 358};
359 359
360static struct omap_lcd_config h2_lcd_config __initdata = { 360static const struct omap_lcd_config h2_lcd_config __initconst = {
361 .ctrl_name = "internal", 361 .ctrl_name = "internal",
362}; 362};
363 363
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 302260583e8e..ad339f51cc78 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -376,7 +376,7 @@ static struct omap_usb_config h3_usb_config __initdata = {
376 .pins[1] = 3, 376 .pins[1] = 3,
377}; 377};
378 378
379static struct omap_lcd_config h3_lcd_config __initdata = { 379static const struct omap_lcd_config h3_lcd_config __initconst = {
380 .ctrl_name = "internal", 380 .ctrl_name = "internal",
381}; 381};
382 382
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index e424df901dbd..67d46690a56e 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -391,7 +391,7 @@ static struct omap_usb_config htcherald_usb_config __initdata = {
391}; 391};
392 392
393/* LCD Device resources */ 393/* LCD Device resources */
394static struct omap_lcd_config htcherald_lcd_config __initdata = { 394static const struct omap_lcd_config htcherald_lcd_config __initconst = {
395 .ctrl_name = "internal", 395 .ctrl_name = "internal",
396}; 396};
397 397
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index 67e188271643..8c286a29f24b 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -302,7 +302,7 @@ static struct omap_usb_config innovator1510_usb_config __initdata = {
302 .pins[0] = 2, 302 .pins[0] = 2,
303}; 303};
304 304
305static struct omap_lcd_config innovator1510_lcd_config __initdata = { 305static const struct omap_lcd_config innovator1510_lcd_config __initconst = {
306 .ctrl_name = "internal", 306 .ctrl_name = "internal",
307}; 307};
308#endif 308#endif
@@ -323,7 +323,7 @@ static struct omap_usb_config h2_usb_config __initdata = {
323 .pins[1] = 3, 323 .pins[1] = 3,
324}; 324};
325 325
326static struct omap_lcd_config innovator1610_lcd_config __initdata = { 326static const struct omap_lcd_config innovator1610_lcd_config __initconst = {
327 .ctrl_name = "internal", 327 .ctrl_name = "internal",
328}; 328};
329#endif 329#endif
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 06243c0b12d2..eb41db78cd47 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -103,7 +103,7 @@ static struct mipid_platform_data nokia770_mipid_platform_data = {
103 .shutdown = mipid_shutdown, 103 .shutdown = mipid_shutdown,
104}; 104};
105 105
106static struct omap_lcd_config nokia770_lcd_config __initdata = { 106static const struct omap_lcd_config nokia770_lcd_config __initconst = {
107 .ctrl_name = "hwa742", 107 .ctrl_name = "hwa742",
108}; 108};
109 109
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index d579f4e04137..c66372ed29e2 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -295,7 +295,7 @@ static struct omap_usb_config osk_usb_config __initdata = {
295}; 295};
296 296
297#ifdef CONFIG_OMAP_OSK_MISTRAL 297#ifdef CONFIG_OMAP_OSK_MISTRAL
298static struct omap_lcd_config osk_lcd_config __initdata = { 298static const struct omap_lcd_config osk_lcd_config __initconst = {
299 .ctrl_name = "internal", 299 .ctrl_name = "internal",
300}; 300};
301#endif 301#endif
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index e5288cda1a6a..2dc5deb19803 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -178,7 +178,7 @@ static struct omap_usb_config palmte_usb_config __initdata = {
178 .pins[0] = 2, 178 .pins[0] = 2,
179}; 179};
180 180
181static struct omap_lcd_config palmte_lcd_config __initdata = { 181static const struct omap_lcd_config palmte_lcd_config __initconst = {
182 .ctrl_name = "internal", 182 .ctrl_name = "internal",
183}; 183};
184 184
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index d672495f7441..a23327682df0 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -241,7 +241,7 @@ static struct omap_usb_config palmtt_usb_config __initdata = {
241 .pins[0] = 2, 241 .pins[0] = 2,
242}; 242};
243 243
244static struct omap_lcd_config palmtt_lcd_config __initdata = { 244static const struct omap_lcd_config palmtt_lcd_config __initconst = {
245 .ctrl_name = "internal", 245 .ctrl_name = "internal",
246}; 246};
247 247
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index aaf741b0aff6..30b07096197b 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -206,7 +206,7 @@ static struct omap_usb_config palmz71_usb_config __initdata = {
206 .pins[0] = 2, 206 .pins[0] = 2,
207}; 207};
208 208
209static struct omap_lcd_config palmz71_lcd_config __initdata = { 209static const struct omap_lcd_config palmz71_lcd_config __initconst = {
210 .ctrl_name = "internal", 210 .ctrl_name = "internal",
211}; 211};
212 212
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index e994a78bdd09..b4951eb82898 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -225,7 +225,7 @@ static struct platform_device *devices[] __initdata = {
225 &kp_device, 225 &kp_device,
226}; 226};
227 227
228static struct omap_lcd_config perseus2_lcd_config __initdata = { 228static const struct omap_lcd_config perseus2_lcd_config __initconst = {
229 .ctrl_name = "internal", 229 .ctrl_name = "internal",
230}; 230};
231 231
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 6c482254b37c..ec27bb3e370f 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -297,7 +297,7 @@ static struct omap_usb_config sx1_usb_config __initdata = {
297 297
298/*----------- LCD -------------------------*/ 298/*----------- LCD -------------------------*/
299 299
300static struct omap_lcd_config sx1_lcd_config __initdata = { 300static const struct omap_lcd_config sx1_lcd_config __initconst = {
301 .ctrl_name = "internal", 301 .ctrl_name = "internal",
302}; 302};
303 303
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index e31a5a22e171..00b1f17f8d44 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -104,6 +104,7 @@ config ARCH_OMAP2PLUS
104 select OMAP_GPMC 104 select OMAP_GPMC
105 select PINCTRL 105 select PINCTRL
106 select SOC_BUS 106 select SOC_BUS
107 select TI_SYSC
107 select OMAP_IRQCHIP 108 select OMAP_IRQCHIP
108 select CLKSRC_TI_32K 109 select CLKSRC_TI_32K
109 help 110 help
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 38f1748a4500..2f722a805948 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -199,15 +199,12 @@ obj-y += omap_hwmod_common_ipblock_data.o
199obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_ipblock_data.o 199obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_ipblock_data.o
200obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_3xxx_ipblock_data.o 200obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_3xxx_ipblock_data.o
201obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_interconnect_data.o 201obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_interconnect_data.o
202obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_3xxx_interconnect_data.o
203obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2420_data.o 202obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2420_data.o
204obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2xxx_ipblock_data.o 203obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2xxx_ipblock_data.o
205obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2xxx_3xxx_ipblock_data.o 204obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2xxx_3xxx_ipblock_data.o
206obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2xxx_interconnect_data.o 205obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2xxx_interconnect_data.o
207obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2xxx_3xxx_interconnect_data.o
208obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2430_data.o 206obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2430_data.o
209obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_2xxx_3xxx_ipblock_data.o 207obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_2xxx_3xxx_ipblock_data.o
210obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_2xxx_3xxx_interconnect_data.o
211obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o 208obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o
212obj-$(CONFIG_SOC_AM33XX) += omap_hwmod_33xx_data.o 209obj-$(CONFIG_SOC_AM33XX) += omap_hwmod_33xx_data.o
213obj-$(CONFIG_SOC_AM33XX) += omap_hwmod_33xx_43xx_interconnect_data.o 210obj-$(CONFIG_SOC_AM33XX) += omap_hwmod_33xx_43xx_interconnect_data.o
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index b5ad7fcb80ed..bc202835371b 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -225,7 +225,6 @@ extern struct device *omap2_get_iva_device(void);
225extern struct device *omap2_get_l3_device(void); 225extern struct device *omap2_get_l3_device(void);
226extern struct device *omap4_get_dsp_device(void); 226extern struct device *omap4_get_dsp_device(void);
227 227
228unsigned int omap4_xlate_irq(unsigned int hwirq);
229void omap_gic_of_init(void); 228void omap_gic_of_init(void);
230 229
231#ifdef CONFIG_CACHE_L2X0 230#ifdef CONFIG_CACHE_L2X0
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index 694ce0939d50..a005e2a23b86 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -223,7 +223,7 @@ static struct omap_system_dma_plat_info dma_plat_info __initdata = {
223 .dma_read = dma_read, 223 .dma_read = dma_read,
224}; 224};
225 225
226static struct platform_device_info omap_dma_dev_info = { 226static struct platform_device_info omap_dma_dev_info __initdata = {
227 .name = "omap-dma-engine", 227 .name = "omap-dma-engine",
228 .id = -1, 228 .id = -1,
229 .dma_mask = DMA_BIT_MASK(32), 229 .dma_mask = DMA_BIT_MASK(32),
diff --git a/arch/arm/mach-omap2/hdq1w.c b/arch/arm/mach-omap2/hdq1w.c
index f3897d82e53e..2bc4db23ca56 100644
--- a/arch/arm/mach-omap2/hdq1w.c
+++ b/arch/arm/mach-omap2/hdq1w.c
@@ -75,25 +75,3 @@ int omap_hdq1w_reset(struct omap_hwmod *oh)
75 75
76 return 0; 76 return 0;
77} 77}
78
79#ifndef CONFIG_OF
80static int __init omap_init_hdq(void)
81{
82 int id = -1;
83 struct platform_device *pdev;
84 struct omap_hwmod *oh;
85 char *oh_name = "hdq1w";
86 char *devname = "omap_hdq";
87
88 oh = omap_hwmod_lookup(oh_name);
89 if (!oh)
90 return 0;
91
92 pdev = omap_device_build(devname, id, oh, NULL, 0);
93 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
94 devname, oh->name);
95
96 return 0;
97}
98omap_arch_initcall(omap_init_hdq);
99#endif
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 16cb1c195fd8..df2c29edbbcd 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -693,9 +693,12 @@ void __init dra7xxx_check_revision(void)
693 omap_revision = DRA722_REV_ES1_0; 693 omap_revision = DRA722_REV_ES1_0;
694 break; 694 break;
695 case 1: 695 case 1:
696 default:
697 omap_revision = DRA722_REV_ES2_0; 696 omap_revision = DRA722_REV_ES2_0;
698 break; 697 break;
698 case 2:
699 default:
700 omap_revision = DRA722_REV_ES2_1;
701 break;
699 } 702 }
700 break; 703 break;
701 704
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index cf65ab8bb004..b226c8aaf8b1 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -299,30 +299,6 @@ static const struct of_device_id intc_match[] = {
299 299
300static struct device_node *intc_node; 300static struct device_node *intc_node;
301 301
302unsigned int omap4_xlate_irq(unsigned int hwirq)
303{
304 struct of_phandle_args irq_data;
305 unsigned int irq;
306
307 if (!intc_node)
308 intc_node = of_find_matching_node(NULL, intc_match);
309
310 if (WARN_ON(!intc_node))
311 return hwirq;
312
313 irq_data.np = intc_node;
314 irq_data.args_count = 3;
315 irq_data.args[0] = 0;
316 irq_data.args[1] = hwirq - OMAP44XX_IRQ_GIC_START;
317 irq_data.args[2] = IRQ_TYPE_LEVEL_HIGH;
318
319 irq = irq_create_of_mapping(&irq_data);
320 if (WARN_ON(!irq))
321 irq = hwirq;
322
323 return irq;
324}
325
326void __init omap_gic_of_init(void) 302void __init omap_gic_of_init(void)
327{ 303{
328 struct device_node *np; 304 struct device_node *np;
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index acbede082b5b..d45cbfdb4be6 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -35,6 +35,8 @@
35#include <linux/pm_domain.h> 35#include <linux/pm_domain.h>
36#include <linux/pm_runtime.h> 36#include <linux/pm_runtime.h>
37#include <linux/of.h> 37#include <linux/of.h>
38#include <linux/of_address.h>
39#include <linux/of_irq.h>
38#include <linux/notifier.h> 40#include <linux/notifier.h>
39 41
40#include "common.h" 42#include "common.h"
@@ -309,88 +311,6 @@ int omap_device_get_context_loss_count(struct platform_device *pdev)
309} 311}
310 312
311/** 313/**
312 * omap_device_count_resources - count number of struct resource entries needed
313 * @od: struct omap_device *
314 * @flags: Type of resources to include when counting (IRQ/DMA/MEM)
315 *
316 * Count the number of struct resource entries needed for this
317 * omap_device @od. Used by omap_device_build_ss() to determine how
318 * much memory to allocate before calling
319 * omap_device_fill_resources(). Returns the count.
320 */
321static int omap_device_count_resources(struct omap_device *od,
322 unsigned long flags)
323{
324 int c = 0;
325 int i;
326
327 for (i = 0; i < od->hwmods_cnt; i++)
328 c += omap_hwmod_count_resources(od->hwmods[i], flags);
329
330 pr_debug("omap_device: %s: counted %d total resources across %d hwmods\n",
331 od->pdev->name, c, od->hwmods_cnt);
332
333 return c;
334}
335
336/**
337 * omap_device_fill_resources - fill in array of struct resource
338 * @od: struct omap_device *
339 * @res: pointer to an array of struct resource to be filled in
340 *
341 * Populate one or more empty struct resource pointed to by @res with
342 * the resource data for this omap_device @od. Used by
343 * omap_device_build_ss() after calling omap_device_count_resources().
344 * Ideally this function would not be needed at all. If omap_device
345 * replaces platform_device, then we can specify our own
346 * get_resource()/ get_irq()/etc functions that use the underlying
347 * omap_hwmod information. Or if platform_device is extended to use
348 * subarchitecture-specific function pointers, the various
349 * platform_device functions can simply call omap_device internal
350 * functions to get device resources. Hacking around the existing
351 * platform_device code wastes memory. Returns 0.
352 */
353static int omap_device_fill_resources(struct omap_device *od,
354 struct resource *res)
355{
356 int i, r;
357
358 for (i = 0; i < od->hwmods_cnt; i++) {
359 r = omap_hwmod_fill_resources(od->hwmods[i], res);
360 res += r;
361 }
362
363 return 0;
364}
365
366/**
367 * _od_fill_dma_resources - fill in array of struct resource with dma resources
368 * @od: struct omap_device *
369 * @res: pointer to an array of struct resource to be filled in
370 *
371 * Populate one or more empty struct resource pointed to by @res with
372 * the dma resource data for this omap_device @od. Used by
373 * omap_device_alloc() after calling omap_device_count_resources().
374 *
375 * Ideally this function would not be needed at all. If we have
376 * mechanism to get dma resources from DT.
377 *
378 * Returns 0.
379 */
380static int _od_fill_dma_resources(struct omap_device *od,
381 struct resource *res)
382{
383 int i, r;
384
385 for (i = 0; i < od->hwmods_cnt; i++) {
386 r = omap_hwmod_fill_dma_resources(od->hwmods[i], res);
387 res += r;
388 }
389
390 return 0;
391}
392
393/**
394 * omap_device_alloc - allocate an omap_device 314 * omap_device_alloc - allocate an omap_device
395 * @pdev: platform_device that will be included in this omap_device 315 * @pdev: platform_device that will be included in this omap_device
396 * @oh: ptr to the single omap_hwmod that backs this omap_device 316 * @oh: ptr to the single omap_hwmod that backs this omap_device
@@ -407,8 +327,7 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev,
407{ 327{
408 int ret = -ENOMEM; 328 int ret = -ENOMEM;
409 struct omap_device *od; 329 struct omap_device *od;
410 struct resource *res = NULL; 330 int i;
411 int i, res_count;
412 struct omap_hwmod **hwmods; 331 struct omap_hwmod **hwmods;
413 332
414 od = kzalloc(sizeof(struct omap_device), GFP_KERNEL); 333 od = kzalloc(sizeof(struct omap_device), GFP_KERNEL);
@@ -424,74 +343,6 @@ struct omap_device *omap_device_alloc(struct platform_device *pdev,
424 343
425 od->hwmods = hwmods; 344 od->hwmods = hwmods;
426 od->pdev = pdev; 345 od->pdev = pdev;
427
428 /*
429 * Non-DT Boot:
430 * Here, pdev->num_resources = 0, and we should get all the
431 * resources from hwmod.
432 *
433 * DT Boot:
434 * OF framework will construct the resource structure (currently
435 * does for MEM & IRQ resource) and we should respect/use these
436 * resources, killing hwmod dependency.
437 * If pdev->num_resources > 0, we assume that MEM & IRQ resources
438 * have been allocated by OF layer already (through DTB).
439 * As preparation for the future we examine the OF provided resources
440 * to see if we have DMA resources provided already. In this case
441 * there is no need to update the resources for the device, we use the
442 * OF provided ones.
443 *
444 * TODO: Once DMA resource is available from OF layer, we should
445 * kill filling any resources from hwmod.
446 */
447 if (!pdev->num_resources) {
448 /* Count all resources for the device */
449 res_count = omap_device_count_resources(od, IORESOURCE_IRQ |
450 IORESOURCE_DMA |
451 IORESOURCE_MEM);
452 } else {
453 /* Take a look if we already have DMA resource via DT */
454 for (i = 0; i < pdev->num_resources; i++) {
455 struct resource *r = &pdev->resource[i];
456
457 /* We have it, no need to touch the resources */
458 if (r->flags == IORESOURCE_DMA)
459 goto have_everything;
460 }
461 /* Count only DMA resources for the device */
462 res_count = omap_device_count_resources(od, IORESOURCE_DMA);
463 /* The device has no DMA resource, no need for update */
464 if (!res_count)
465 goto have_everything;
466
467 res_count += pdev->num_resources;
468 }
469
470 /* Allocate resources memory to account for new resources */
471 res = kzalloc(sizeof(struct resource) * res_count, GFP_KERNEL);
472 if (!res)
473 goto oda_exit3;
474
475 if (!pdev->num_resources) {
476 dev_dbg(&pdev->dev, "%s: using %d resources from hwmod\n",
477 __func__, res_count);
478 omap_device_fill_resources(od, res);
479 } else {
480 dev_dbg(&pdev->dev,
481 "%s: appending %d DMA resources from hwmod\n",
482 __func__, res_count - pdev->num_resources);
483 memcpy(res, pdev->resource,
484 sizeof(struct resource) * pdev->num_resources);
485 _od_fill_dma_resources(od, &res[pdev->num_resources]);
486 }
487
488 ret = platform_device_add_resources(pdev, res, res_count);
489 kfree(res);
490
491 if (ret)
492 goto oda_exit3;
493
494have_everything:
495 pdev->archdata.od = od; 346 pdev->archdata.od = od;
496 347
497 for (i = 0; i < oh_cnt; i++) { 348 for (i = 0; i < oh_cnt; i++) {
@@ -501,8 +352,6 @@ have_everything:
501 352
502 return od; 353 return od;
503 354
504oda_exit3:
505 kfree(hwmods);
506oda_exit2: 355oda_exit2:
507 kfree(od); 356 kfree(od);
508oda_exit1: 357oda_exit1:
@@ -522,6 +371,93 @@ void omap_device_delete(struct omap_device *od)
522} 371}
523 372
524/** 373/**
374 * omap_device_copy_resources - Add legacy IO and IRQ resources
375 * @oh: interconnect target module
376 * @pdev: platform device to copy resources to
377 *
378 * We still have legacy DMA and smartreflex needing resources.
379 * Let's populate what they need until we can eventually just
380 * remove this function. Note that there should be no need to
381 * call this from omap_device_build_from_dt(), nor should there
382 * be any need to call it for other devices.
383 */
384static int
385omap_device_copy_resources(struct omap_hwmod *oh,
386 struct platform_device *pdev)
387{
388 struct device_node *np, *child;
389 struct property *prop;
390 struct resource *res;
391 const char *name;
392 int error, irq = 0;
393
394 if (!oh || !oh->od || !oh->od->pdev) {
395 error = -EINVAL;
396 goto error;
397 }
398
399 np = oh->od->pdev->dev.of_node;
400 if (!np) {
401 error = -ENODEV;
402 goto error;
403 }
404
405 res = kzalloc(sizeof(*res) * 2, GFP_KERNEL);
406 if (!res)
407 return -ENOMEM;
408
409 /* Do we have a dts range for the interconnect target module? */
410 error = omap_hwmod_parse_module_range(oh, np, res);
411
412 /* No ranges, rely on device reg entry */
413 if (error)
414 error = of_address_to_resource(np, 0, res);
415 if (error)
416 goto free;
417
418 /* SmartReflex needs first IO resource name to be "mpu" */
419 res[0].name = "mpu";
420
421 /*
422 * We may have a configured "ti,sysc" interconnect target with a
423 * dts child with the interrupt. If so use the first child's
424 * first interrupt for "ti-hwmods" legacy support.
425 */
426 of_property_for_each_string(np, "compatible", prop, name)
427 if (!strncmp("ti,sysc-", name, 8))
428 break;
429
430 child = of_get_next_available_child(np, NULL);
431
432 if (name)
433 irq = irq_of_parse_and_map(child, 0);
434 if (!irq)
435 irq = irq_of_parse_and_map(np, 0);
436 if (!irq) {
437 error = -EINVAL;
438 goto free;
439 }
440
441 /* Legacy DMA code needs interrupt name to be "0" */
442 res[1].start = irq;
443 res[1].end = irq;
444 res[1].flags = IORESOURCE_IRQ;
445 res[1].name = "0";
446
447 error = platform_device_add_resources(pdev, res, 2);
448
449free:
450 kfree(res);
451
452error:
453 WARN(error, "%s: %s device %s failed: %i\n",
454 __func__, oh->name, dev_name(&pdev->dev),
455 error);
456
457 return error;
458}
459
460/**
525 * omap_device_build - build and register an omap_device with one omap_hwmod 461 * omap_device_build - build and register an omap_device with one omap_hwmod
526 * @pdev_name: name of the platform_device driver to use 462 * @pdev_name: name of the platform_device driver to use
527 * @pdev_id: this platform_device's connection ID 463 * @pdev_id: this platform_device's connection ID
@@ -540,45 +476,24 @@ struct platform_device __init *omap_device_build(const char *pdev_name,
540 struct omap_hwmod *oh, 476 struct omap_hwmod *oh,
541 void *pdata, int pdata_len) 477 void *pdata, int pdata_len)
542{ 478{
543 struct omap_hwmod *ohs[] = { oh };
544
545 if (!oh)
546 return ERR_PTR(-EINVAL);
547
548 return omap_device_build_ss(pdev_name, pdev_id, ohs, 1, pdata,
549 pdata_len);
550}
551
552/**
553 * omap_device_build_ss - build and register an omap_device with multiple hwmods
554 * @pdev_name: name of the platform_device driver to use
555 * @pdev_id: this platform_device's connection ID
556 * @oh: ptr to the single omap_hwmod that backs this omap_device
557 * @pdata: platform_data ptr to associate with the platform_device
558 * @pdata_len: amount of memory pointed to by @pdata
559 *
560 * Convenience function for building and registering an omap_device
561 * subsystem record. Subsystem records consist of multiple
562 * omap_hwmods. This function in turn builds and registers a
563 * platform_device record. Returns an ERR_PTR() on error, or passes
564 * along the return value of omap_device_register().
565 */
566struct platform_device __init *omap_device_build_ss(const char *pdev_name,
567 int pdev_id,
568 struct omap_hwmod **ohs,
569 int oh_cnt, void *pdata,
570 int pdata_len)
571{
572 int ret = -ENOMEM; 479 int ret = -ENOMEM;
573 struct platform_device *pdev; 480 struct platform_device *pdev;
574 struct omap_device *od; 481 struct omap_device *od;
575 482
576 if (!ohs || oh_cnt == 0 || !pdev_name) 483 if (!oh || !pdev_name)
577 return ERR_PTR(-EINVAL); 484 return ERR_PTR(-EINVAL);
578 485
579 if (!pdata && pdata_len > 0) 486 if (!pdata && pdata_len > 0)
580 return ERR_PTR(-EINVAL); 487 return ERR_PTR(-EINVAL);
581 488
489 if (strncmp(oh->name, "smartreflex", 11) &&
490 strncmp(oh->name, "dma", 3)) {
491 pr_warn("%s need to update %s to probe with dt\na",
492 __func__, pdev_name);
493 ret = -ENODEV;
494 goto odbs_exit;
495 }
496
582 pdev = platform_device_alloc(pdev_name, pdev_id); 497 pdev = platform_device_alloc(pdev_name, pdev_id);
583 if (!pdev) { 498 if (!pdev) {
584 ret = -ENOMEM; 499 ret = -ENOMEM;
@@ -591,7 +506,16 @@ struct platform_device __init *omap_device_build_ss(const char *pdev_name,
591 else 506 else
592 dev_set_name(&pdev->dev, "%s", pdev->name); 507 dev_set_name(&pdev->dev, "%s", pdev->name);
593 508
594 od = omap_device_alloc(pdev, ohs, oh_cnt); 509 /*
510 * Must be called before omap_device_alloc() as oh->od
511 * only contains the currently registered omap_device
512 * and will get overwritten by omap_device_alloc().
513 */
514 ret = omap_device_copy_resources(oh, pdev);
515 if (ret)
516 goto odbs_exit1;
517
518 od = omap_device_alloc(pdev, &oh, 1);
595 if (IS_ERR(od)) 519 if (IS_ERR(od))
596 goto odbs_exit1; 520 goto odbs_exit1;
597 521
diff --git a/arch/arm/mach-omap2/omap_device.h b/arch/arm/mach-omap2/omap_device.h
index 78c02b355179..786b9c00fdb9 100644
--- a/arch/arm/mach-omap2/omap_device.h
+++ b/arch/arm/mach-omap2/omap_device.h
@@ -75,10 +75,6 @@ struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
75 struct omap_hwmod *oh, void *pdata, 75 struct omap_hwmod *oh, void *pdata,
76 int pdata_len); 76 int pdata_len);
77 77
78struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
79 struct omap_hwmod **oh, int oh_cnt,
80 void *pdata, int pdata_len);
81
82struct omap_device *omap_device_alloc(struct platform_device *pdev, 78struct omap_device *omap_device_alloc(struct platform_device *pdev,
83 struct omap_hwmod **ohs, int oh_cnt); 79 struct omap_hwmod **ohs, int oh_cnt);
84void omap_device_delete(struct omap_device *od); 80void omap_device_delete(struct omap_device *od);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 2dbd63239c54..104256a5f0f7 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -994,6 +994,34 @@ static int _enable_clocks(struct omap_hwmod *oh)
994} 994}
995 995
996/** 996/**
997 * _omap4_clkctrl_managed_by_clkfwk - true if clkctrl managed by clock framework
998 * @oh: struct omap_hwmod *
999 */
1000static bool _omap4_clkctrl_managed_by_clkfwk(struct omap_hwmod *oh)
1001{
1002 if (oh->prcm.omap4.flags & HWMOD_OMAP4_CLKFWK_CLKCTR_CLOCK)
1003 return true;
1004
1005 return false;
1006}
1007
1008/**
1009 * _omap4_has_clkctrl_clock - returns true if a module has clkctrl clock
1010 * @oh: struct omap_hwmod *
1011 */
1012static bool _omap4_has_clkctrl_clock(struct omap_hwmod *oh)
1013{
1014 if (oh->prcm.omap4.clkctrl_offs)
1015 return true;
1016
1017 if (!oh->prcm.omap4.clkctrl_offs &&
1018 oh->prcm.omap4.flags & HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET)
1019 return true;
1020
1021 return false;
1022}
1023
1024/**
997 * _disable_clocks - disable hwmod main clock and interface clocks 1025 * _disable_clocks - disable hwmod main clock and interface clocks
998 * @oh: struct omap_hwmod * 1026 * @oh: struct omap_hwmod *
999 * 1027 *
@@ -1030,7 +1058,8 @@ static int _disable_clocks(struct omap_hwmod *oh)
1030 */ 1058 */
1031static void _omap4_enable_module(struct omap_hwmod *oh) 1059static void _omap4_enable_module(struct omap_hwmod *oh)
1032{ 1060{
1033 if (!oh->clkdm || !oh->prcm.omap4.modulemode) 1061 if (!oh->clkdm || !oh->prcm.omap4.modulemode ||
1062 _omap4_clkctrl_managed_by_clkfwk(oh))
1034 return; 1063 return;
1035 1064
1036 pr_debug("omap_hwmod: %s: %s: %d\n", 1065 pr_debug("omap_hwmod: %s: %s: %d\n",
@@ -1061,8 +1090,10 @@ static int _omap4_wait_target_disable(struct omap_hwmod *oh)
1061 if (oh->flags & HWMOD_NO_IDLEST) 1090 if (oh->flags & HWMOD_NO_IDLEST)
1062 return 0; 1091 return 0;
1063 1092
1064 if (!oh->prcm.omap4.clkctrl_offs && 1093 if (_omap4_clkctrl_managed_by_clkfwk(oh))
1065 !(oh->prcm.omap4.flags & HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET)) 1094 return 0;
1095
1096 if (!_omap4_has_clkctrl_clock(oh))
1066 return 0; 1097 return 0;
1067 1098
1068 return omap_cm_wait_module_idle(oh->clkdm->prcm_partition, 1099 return omap_cm_wait_module_idle(oh->clkdm->prcm_partition,
@@ -1071,215 +1102,6 @@ static int _omap4_wait_target_disable(struct omap_hwmod *oh)
1071} 1102}
1072 1103
1073/** 1104/**
1074 * _count_mpu_irqs - count the number of MPU IRQ lines associated with @oh
1075 * @oh: struct omap_hwmod *oh
1076 *
1077 * Count and return the number of MPU IRQs associated with the hwmod
1078 * @oh. Used to allocate struct resource data. Returns 0 if @oh is
1079 * NULL.
1080 */
1081static int _count_mpu_irqs(struct omap_hwmod *oh)
1082{
1083 struct omap_hwmod_irq_info *ohii;
1084 int i = 0;
1085
1086 if (!oh || !oh->mpu_irqs)
1087 return 0;
1088
1089 do {
1090 ohii = &oh->mpu_irqs[i++];
1091 } while (ohii->irq != -1);
1092
1093 return i-1;
1094}
1095
1096/**
1097 * _count_sdma_reqs - count the number of SDMA request lines associated with @oh
1098 * @oh: struct omap_hwmod *oh
1099 *
1100 * Count and return the number of SDMA request lines associated with
1101 * the hwmod @oh. Used to allocate struct resource data. Returns 0
1102 * if @oh is NULL.
1103 */
1104static int _count_sdma_reqs(struct omap_hwmod *oh)
1105{
1106 struct omap_hwmod_dma_info *ohdi;
1107 int i = 0;
1108
1109 if (!oh || !oh->sdma_reqs)
1110 return 0;
1111
1112 do {
1113 ohdi = &oh->sdma_reqs[i++];
1114 } while (ohdi->dma_req != -1);
1115
1116 return i-1;
1117}
1118
1119/**
1120 * _count_ocp_if_addr_spaces - count the number of address space entries for @oh
1121 * @oh: struct omap_hwmod *oh
1122 *
1123 * Count and return the number of address space ranges associated with
1124 * the hwmod @oh. Used to allocate struct resource data. Returns 0
1125 * if @oh is NULL.
1126 */
1127static int _count_ocp_if_addr_spaces(struct omap_hwmod_ocp_if *os)
1128{
1129 struct omap_hwmod_addr_space *mem;
1130 int i = 0;
1131
1132 if (!os || !os->addr)
1133 return 0;
1134
1135 do {
1136 mem = &os->addr[i++];
1137 } while (mem->pa_start != mem->pa_end);
1138
1139 return i-1;
1140}
1141
1142/**
1143 * _get_mpu_irq_by_name - fetch MPU interrupt line number by name
1144 * @oh: struct omap_hwmod * to operate on
1145 * @name: pointer to the name of the MPU interrupt number to fetch (optional)
1146 * @irq: pointer to an unsigned int to store the MPU IRQ number to
1147 *
1148 * Retrieve a MPU hardware IRQ line number named by @name associated
1149 * with the IP block pointed to by @oh. The IRQ number will be filled
1150 * into the address pointed to by @dma. When @name is non-null, the
1151 * IRQ line number associated with the named entry will be returned.
1152 * If @name is null, the first matching entry will be returned. Data
1153 * order is not meaningful in hwmod data, so callers are strongly
1154 * encouraged to use a non-null @name whenever possible to avoid
1155 * unpredictable effects if hwmod data is later added that causes data
1156 * ordering to change. Returns 0 upon success or a negative error
1157 * code upon error.
1158 */
1159static int _get_mpu_irq_by_name(struct omap_hwmod *oh, const char *name,
1160 unsigned int *irq)
1161{
1162 int i;
1163 bool found = false;
1164
1165 if (!oh->mpu_irqs)
1166 return -ENOENT;
1167
1168 i = 0;
1169 while (oh->mpu_irqs[i].irq != -1) {
1170 if (name == oh->mpu_irqs[i].name ||
1171 !strcmp(name, oh->mpu_irqs[i].name)) {
1172 found = true;
1173 break;
1174 }
1175 i++;
1176 }
1177
1178 if (!found)
1179 return -ENOENT;
1180
1181 *irq = oh->mpu_irqs[i].irq;
1182
1183 return 0;
1184}
1185
1186/**
1187 * _get_sdma_req_by_name - fetch SDMA request line ID by name
1188 * @oh: struct omap_hwmod * to operate on
1189 * @name: pointer to the name of the SDMA request line to fetch (optional)
1190 * @dma: pointer to an unsigned int to store the request line ID to
1191 *
1192 * Retrieve an SDMA request line ID named by @name on the IP block
1193 * pointed to by @oh. The ID will be filled into the address pointed
1194 * to by @dma. When @name is non-null, the request line ID associated
1195 * with the named entry will be returned. If @name is null, the first
1196 * matching entry will be returned. Data order is not meaningful in
1197 * hwmod data, so callers are strongly encouraged to use a non-null
1198 * @name whenever possible to avoid unpredictable effects if hwmod
1199 * data is later added that causes data ordering to change. Returns 0
1200 * upon success or a negative error code upon error.
1201 */
1202static int _get_sdma_req_by_name(struct omap_hwmod *oh, const char *name,
1203 unsigned int *dma)
1204{
1205 int i;
1206 bool found = false;
1207
1208 if (!oh->sdma_reqs)
1209 return -ENOENT;
1210
1211 i = 0;
1212 while (oh->sdma_reqs[i].dma_req != -1) {
1213 if (name == oh->sdma_reqs[i].name ||
1214 !strcmp(name, oh->sdma_reqs[i].name)) {
1215 found = true;
1216 break;
1217 }
1218 i++;
1219 }
1220
1221 if (!found)
1222 return -ENOENT;
1223
1224 *dma = oh->sdma_reqs[i].dma_req;
1225
1226 return 0;
1227}
1228
1229/**
1230 * _get_addr_space_by_name - fetch address space start & end by name
1231 * @oh: struct omap_hwmod * to operate on
1232 * @name: pointer to the name of the address space to fetch (optional)
1233 * @pa_start: pointer to a u32 to store the starting address to
1234 * @pa_end: pointer to a u32 to store the ending address to
1235 *
1236 * Retrieve address space start and end addresses for the IP block
1237 * pointed to by @oh. The data will be filled into the addresses
1238 * pointed to by @pa_start and @pa_end. When @name is non-null, the
1239 * address space data associated with the named entry will be
1240 * returned. If @name is null, the first matching entry will be
1241 * returned. Data order is not meaningful in hwmod data, so callers
1242 * are strongly encouraged to use a non-null @name whenever possible
1243 * to avoid unpredictable effects if hwmod data is later added that
1244 * causes data ordering to change. Returns 0 upon success or a
1245 * negative error code upon error.
1246 */
1247static int _get_addr_space_by_name(struct omap_hwmod *oh, const char *name,
1248 u32 *pa_start, u32 *pa_end)
1249{
1250 int j;
1251 struct omap_hwmod_ocp_if *os;
1252 bool found = false;
1253
1254 list_for_each_entry(os, &oh->slave_ports, node) {
1255
1256 if (!os->addr)
1257 return -ENOENT;
1258
1259 j = 0;
1260 while (os->addr[j].pa_start != os->addr[j].pa_end) {
1261 if (name == os->addr[j].name ||
1262 !strcmp(name, os->addr[j].name)) {
1263 found = true;
1264 break;
1265 }
1266 j++;
1267 }
1268
1269 if (found)
1270 break;
1271 }
1272
1273 if (!found)
1274 return -ENOENT;
1275
1276 *pa_start = os->addr[j].pa_start;
1277 *pa_end = os->addr[j].pa_end;
1278
1279 return 0;
1280}
1281
1282/**
1283 * _save_mpu_port_index - find and save the index to @oh's MPU port 1105 * _save_mpu_port_index - find and save the index to @oh's MPU port
1284 * @oh: struct omap_hwmod * 1106 * @oh: struct omap_hwmod *
1285 * 1107 *
@@ -1330,32 +1152,6 @@ static struct omap_hwmod_ocp_if *_find_mpu_rt_port(struct omap_hwmod *oh)
1330}; 1152};
1331 1153
1332/** 1154/**
1333 * _find_mpu_rt_addr_space - return MPU register target address space for @oh
1334 * @oh: struct omap_hwmod *
1335 *
1336 * Returns a pointer to the struct omap_hwmod_addr_space record representing
1337 * the register target MPU address space; or returns NULL upon error.
1338 */
1339static struct omap_hwmod_addr_space * __init _find_mpu_rt_addr_space(struct omap_hwmod *oh)
1340{
1341 struct omap_hwmod_ocp_if *os;
1342 struct omap_hwmod_addr_space *mem;
1343 int found = 0, i = 0;
1344
1345 os = _find_mpu_rt_port(oh);
1346 if (!os || !os->addr)
1347 return NULL;
1348
1349 do {
1350 mem = &os->addr[i++];
1351 if (mem->flags & ADDR_TYPE_RT)
1352 found = 1;
1353 } while (!found && mem->pa_start != mem->pa_end);
1354
1355 return (found) ? mem : NULL;
1356}
1357
1358/**
1359 * _enable_sysc - try to bring a module out of idle via OCP_SYSCONFIG 1155 * _enable_sysc - try to bring a module out of idle via OCP_SYSCONFIG
1360 * @oh: struct omap_hwmod * 1156 * @oh: struct omap_hwmod *
1361 * 1157 *
@@ -1847,7 +1643,8 @@ static int _omap4_disable_module(struct omap_hwmod *oh)
1847{ 1643{
1848 int v; 1644 int v;
1849 1645
1850 if (!oh->clkdm || !oh->prcm.omap4.modulemode) 1646 if (!oh->clkdm || !oh->prcm.omap4.modulemode ||
1647 _omap4_clkctrl_managed_by_clkfwk(oh))
1851 return -EINVAL; 1648 return -EINVAL;
1852 1649
1853 /* 1650 /*
@@ -2362,6 +2159,75 @@ static int of_dev_hwmod_lookup(struct device_node *np,
2362} 2159}
2363 2160
2364/** 2161/**
2162 * omap_hwmod_parse_module_range - map module IO range from device tree
2163 * @oh: struct omap_hwmod *
2164 * @np: struct device_node *
2165 *
2166 * Parse the device tree range an interconnect target module provides
2167 * for it's child device IP blocks. This way we can support the old
2168 * "ti,hwmods" property with just dts data without a need for platform
2169 * data for IO resources. And we don't need all the child IP device
2170 * nodes available in the dts.
2171 */
2172int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
2173 struct device_node *np,
2174 struct resource *res)
2175{
2176 struct property *prop;
2177 const __be32 *ranges;
2178 const char *name;
2179 u32 nr_addr, nr_size;
2180 u64 base, size;
2181 int len, error;
2182
2183 if (!res)
2184 return -EINVAL;
2185
2186 ranges = of_get_property(np, "ranges", &len);
2187 if (!ranges)
2188 return -ENOENT;
2189
2190 len /= sizeof(*ranges);
2191
2192 if (len < 3)
2193 return -EINVAL;
2194
2195 of_property_for_each_string(np, "compatible", prop, name)
2196 if (!strncmp("ti,sysc-", name, 8))
2197 break;
2198
2199 if (!name)
2200 return -ENOENT;
2201
2202 error = of_property_read_u32(np, "#address-cells", &nr_addr);
2203 if (error)
2204 return -ENOENT;
2205
2206 error = of_property_read_u32(np, "#size-cells", &nr_size);
2207 if (error)
2208 return -ENOENT;
2209
2210 if (nr_addr != 1 || nr_size != 1) {
2211 pr_err("%s: invalid range for %s->%s\n", __func__,
2212 oh->name, np->name);
2213 return -EINVAL;
2214 }
2215
2216 ranges++;
2217 base = of_translate_address(np, ranges++);
2218 size = be32_to_cpup(ranges);
2219
2220 pr_debug("omap_hwmod: %s %s at 0x%llx size 0x%llx\n",
2221 oh->name, np->name, base, size);
2222
2223 res->start = base;
2224 res->end = base + size - 1;
2225 res->flags = IORESOURCE_MEM;
2226
2227 return 0;
2228}
2229
2230/**
2365 * _init_mpu_rt_base - populate the virtual address for a hwmod 2231 * _init_mpu_rt_base - populate the virtual address for a hwmod
2366 * @oh: struct omap_hwmod * to locate the virtual address 2232 * @oh: struct omap_hwmod * to locate the virtual address
2367 * @data: (unused, caller should pass NULL) 2233 * @data: (unused, caller should pass NULL)
@@ -2381,8 +2247,9 @@ static int of_dev_hwmod_lookup(struct device_node *np,
2381static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data, 2247static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
2382 int index, struct device_node *np) 2248 int index, struct device_node *np)
2383{ 2249{
2384 struct omap_hwmod_addr_space *mem;
2385 void __iomem *va_start = NULL; 2250 void __iomem *va_start = NULL;
2251 struct resource res;
2252 int error;
2386 2253
2387 if (!oh) 2254 if (!oh)
2388 return -EINVAL; 2255 return -EINVAL;
@@ -2397,28 +2264,22 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,
2397 if (oh->_int_flags & _HWMOD_NO_MPU_PORT) 2264 if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
2398 return -ENXIO; 2265 return -ENXIO;
2399 2266
2400 mem = _find_mpu_rt_addr_space(oh); 2267 if (!np) {
2401 if (!mem) { 2268 pr_err("omap_hwmod: %s: no dt node\n", oh->name);
2402 pr_debug("omap_hwmod: %s: no MPU register target found\n", 2269 return -ENXIO;
2403 oh->name); 2270 }
2404 2271
2405 /* Extract the IO space from device tree blob */ 2272 /* Do we have a dts range for the interconnect target module? */
2406 if (!np) { 2273 error = omap_hwmod_parse_module_range(oh, np, &res);
2407 pr_err("omap_hwmod: %s: no dt node\n", oh->name); 2274 if (!error)
2408 return -ENXIO; 2275 va_start = ioremap(res.start, resource_size(&res));
2409 }
2410 2276
2277 /* No ranges, rely on device reg entry */
2278 if (!va_start)
2411 va_start = of_iomap(np, index + oh->mpu_rt_idx); 2279 va_start = of_iomap(np, index + oh->mpu_rt_idx);
2412 } else {
2413 va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
2414 }
2415
2416 if (!va_start) { 2280 if (!va_start) {
2417 if (mem) 2281 pr_err("omap_hwmod: %s: Missing dt reg%i for %pOF\n",
2418 pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name); 2282 oh->name, index, np);
2419 else
2420 pr_err("omap_hwmod: %s: Missing dt reg%i for %pOF\n",
2421 oh->name, index, np);
2422 return -ENXIO; 2283 return -ENXIO;
2423 } 2284 }
2424 2285
@@ -2829,8 +2690,10 @@ static int _omap4_wait_target_ready(struct omap_hwmod *oh)
2829 if (!_find_mpu_rt_port(oh)) 2690 if (!_find_mpu_rt_port(oh))
2830 return 0; 2691 return 0;
2831 2692
2832 if (!oh->prcm.omap4.clkctrl_offs && 2693 if (_omap4_clkctrl_managed_by_clkfwk(oh))
2833 !(oh->prcm.omap4.flags & HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET)) 2694 return 0;
2695
2696 if (!_omap4_has_clkctrl_clock(oh))
2834 return 0; 2697 return 0;
2835 2698
2836 /* XXX check module SIDLEMODE, hardreset status */ 2699 /* XXX check module SIDLEMODE, hardreset status */
@@ -2986,8 +2849,7 @@ static int _omap4_disable_direct_prcm(struct omap_hwmod *oh)
2986 if (!oh) 2849 if (!oh)
2987 return -EINVAL; 2850 return -EINVAL;
2988 2851
2989 oh->prcm.omap4.clkctrl_offs = 0; 2852 oh->prcm.omap4.flags |= HWMOD_OMAP4_CLKFWK_CLKCTR_CLOCK;
2990 oh->prcm.omap4.modulemode = 0;
2991 2853
2992 return 0; 2854 return 0;
2993} 2855}
@@ -3322,189 +3184,6 @@ int omap_hwmod_shutdown(struct omap_hwmod *oh)
3322 */ 3184 */
3323 3185
3324/** 3186/**
3325 * omap_hwmod_count_resources - count number of struct resources needed by hwmod
3326 * @oh: struct omap_hwmod *
3327 * @flags: Type of resources to include when counting (IRQ/DMA/MEM)
3328 *
3329 * Count the number of struct resource array elements necessary to
3330 * contain omap_hwmod @oh resources. Intended to be called by code
3331 * that registers omap_devices. Intended to be used to determine the
3332 * size of a dynamically-allocated struct resource array, before
3333 * calling omap_hwmod_fill_resources(). Returns the number of struct
3334 * resource array elements needed.
3335 *
3336 * XXX This code is not optimized. It could attempt to merge adjacent
3337 * resource IDs.
3338 *
3339 */
3340int omap_hwmod_count_resources(struct omap_hwmod *oh, unsigned long flags)
3341{
3342 int ret = 0;
3343
3344 if (flags & IORESOURCE_IRQ)
3345 ret += _count_mpu_irqs(oh);
3346
3347 if (flags & IORESOURCE_DMA)
3348 ret += _count_sdma_reqs(oh);
3349
3350 if (flags & IORESOURCE_MEM) {
3351 struct omap_hwmod_ocp_if *os;
3352
3353 list_for_each_entry(os, &oh->slave_ports, node)
3354 ret += _count_ocp_if_addr_spaces(os);
3355 }
3356
3357 return ret;
3358}
3359
3360/**
3361 * omap_hwmod_fill_resources - fill struct resource array with hwmod data
3362 * @oh: struct omap_hwmod *
3363 * @res: pointer to the first element of an array of struct resource to fill
3364 *
3365 * Fill the struct resource array @res with resource data from the
3366 * omap_hwmod @oh. Intended to be called by code that registers
3367 * omap_devices. See also omap_hwmod_count_resources(). Returns the
3368 * number of array elements filled.
3369 */
3370int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
3371{
3372 struct omap_hwmod_ocp_if *os;
3373 int i, j, mpu_irqs_cnt, sdma_reqs_cnt, addr_cnt;
3374 int r = 0;
3375
3376 /* For each IRQ, DMA, memory area, fill in array.*/
3377
3378 mpu_irqs_cnt = _count_mpu_irqs(oh);
3379 for (i = 0; i < mpu_irqs_cnt; i++) {
3380 unsigned int irq;
3381
3382 if (oh->xlate_irq)
3383 irq = oh->xlate_irq((oh->mpu_irqs + i)->irq);
3384 else
3385 irq = (oh->mpu_irqs + i)->irq;
3386 (res + r)->name = (oh->mpu_irqs + i)->name;
3387 (res + r)->start = irq;
3388 (res + r)->end = irq;
3389 (res + r)->flags = IORESOURCE_IRQ;
3390 r++;
3391 }
3392
3393 sdma_reqs_cnt = _count_sdma_reqs(oh);
3394 for (i = 0; i < sdma_reqs_cnt; i++) {
3395 (res + r)->name = (oh->sdma_reqs + i)->name;
3396 (res + r)->start = (oh->sdma_reqs + i)->dma_req;
3397 (res + r)->end = (oh->sdma_reqs + i)->dma_req;
3398 (res + r)->flags = IORESOURCE_DMA;
3399 r++;
3400 }
3401
3402 list_for_each_entry(os, &oh->slave_ports, node) {
3403 addr_cnt = _count_ocp_if_addr_spaces(os);
3404
3405 for (j = 0; j < addr_cnt; j++) {
3406 (res + r)->name = (os->addr + j)->name;
3407 (res + r)->start = (os->addr + j)->pa_start;
3408 (res + r)->end = (os->addr + j)->pa_end;
3409 (res + r)->flags = IORESOURCE_MEM;
3410 r++;
3411 }
3412 }
3413
3414 return r;
3415}
3416
3417/**
3418 * omap_hwmod_fill_dma_resources - fill struct resource array with dma data
3419 * @oh: struct omap_hwmod *
3420 * @res: pointer to the array of struct resource to fill
3421 *
3422 * Fill the struct resource array @res with dma resource data from the
3423 * omap_hwmod @oh. Intended to be called by code that registers
3424 * omap_devices. See also omap_hwmod_count_resources(). Returns the
3425 * number of array elements filled.
3426 */
3427int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res)
3428{
3429 int i, sdma_reqs_cnt;
3430 int r = 0;
3431
3432 sdma_reqs_cnt = _count_sdma_reqs(oh);
3433 for (i = 0; i < sdma_reqs_cnt; i++) {
3434 (res + r)->name = (oh->sdma_reqs + i)->name;
3435 (res + r)->start = (oh->sdma_reqs + i)->dma_req;
3436 (res + r)->end = (oh->sdma_reqs + i)->dma_req;
3437 (res + r)->flags = IORESOURCE_DMA;
3438 r++;
3439 }
3440
3441 return r;
3442}
3443
3444/**
3445 * omap_hwmod_get_resource_byname - fetch IP block integration data by name
3446 * @oh: struct omap_hwmod * to operate on
3447 * @type: one of the IORESOURCE_* constants from include/linux/ioport.h
3448 * @name: pointer to the name of the data to fetch (optional)
3449 * @rsrc: pointer to a struct resource, allocated by the caller
3450 *
3451 * Retrieve MPU IRQ, SDMA request line, or address space start/end
3452 * data for the IP block pointed to by @oh. The data will be filled
3453 * into a struct resource record pointed to by @rsrc. The struct
3454 * resource must be allocated by the caller. When @name is non-null,
3455 * the data associated with the matching entry in the IRQ/SDMA/address
3456 * space hwmod data arrays will be returned. If @name is null, the
3457 * first array entry will be returned. Data order is not meaningful
3458 * in hwmod data, so callers are strongly encouraged to use a non-null
3459 * @name whenever possible to avoid unpredictable effects if hwmod
3460 * data is later added that causes data ordering to change. This
3461 * function is only intended for use by OMAP core code. Device
3462 * drivers should not call this function - the appropriate bus-related
3463 * data accessor functions should be used instead. Returns 0 upon
3464 * success or a negative error code upon error.
3465 */
3466int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
3467 const char *name, struct resource *rsrc)
3468{
3469 int r;
3470 unsigned int irq, dma;
3471 u32 pa_start, pa_end;
3472
3473 if (!oh || !rsrc)
3474 return -EINVAL;
3475
3476 if (type == IORESOURCE_IRQ) {
3477 r = _get_mpu_irq_by_name(oh, name, &irq);
3478 if (r)
3479 return r;
3480
3481 rsrc->start = irq;
3482 rsrc->end = irq;
3483 } else if (type == IORESOURCE_DMA) {
3484 r = _get_sdma_req_by_name(oh, name, &dma);
3485 if (r)
3486 return r;
3487
3488 rsrc->start = dma;
3489 rsrc->end = dma;
3490 } else if (type == IORESOURCE_MEM) {
3491 r = _get_addr_space_by_name(oh, name, &pa_start, &pa_end);
3492 if (r)
3493 return r;
3494
3495 rsrc->start = pa_start;
3496 rsrc->end = pa_end;
3497 } else {
3498 return -EINVAL;
3499 }
3500
3501 rsrc->flags = type;
3502 rsrc->name = name;
3503
3504 return 0;
3505}
3506
3507/**
3508 * omap_hwmod_get_pwrdm - return pointer to this module's main powerdomain 3187 * omap_hwmod_get_pwrdm - return pointer to this module's main powerdomain
3509 * @oh: struct omap_hwmod * 3188 * @oh: struct omap_hwmod *
3510 * 3189 *
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index a8f779381fd8..df2239a58555 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -21,7 +21,6 @@
21 * 21 *
22 * To do: 22 * To do:
23 * - add interconnect error log structures 23 * - add interconnect error log structures
24 * - add pinmuxing
25 * - init_conn_id_bit (CONNID_BIT_VECTOR) 24 * - init_conn_id_bit (CONNID_BIT_VECTOR)
26 * - implement default hwmod SMS/SDRC flags? 25 * - implement default hwmod SMS/SDRC flags?
27 * - move Linux-specific data ("non-ROM data") out 26 * - move Linux-specific data ("non-ROM data") out
@@ -151,50 +150,6 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type3;
151#endif 150#endif
152 151
153/** 152/**
154 * struct omap_hwmod_mux_info - hwmod specific mux configuration
155 * @pads: array of omap_device_pad entries
156 * @nr_pads: number of omap_device_pad entries
157 *
158 * Note that this is currently built during init as needed.
159 */
160struct omap_hwmod_mux_info {
161 int nr_pads;
162 struct omap_device_pad *pads;
163 int nr_pads_dynamic;
164 struct omap_device_pad **pads_dynamic;
165 int *irqs;
166 bool enabled;
167};
168
169/**
170 * struct omap_hwmod_irq_info - MPU IRQs used by the hwmod
171 * @name: name of the IRQ channel (module local name)
172 * @irq: IRQ channel ID (should be non-negative except -1 = terminator)
173 *
174 * @name should be something short, e.g., "tx" or "rx". It is for use
175 * by platform_get_resource_byname(). It is defined locally to the
176 * hwmod.
177 */
178struct omap_hwmod_irq_info {
179 const char *name;
180 s16 irq;
181};
182
183/**
184 * struct omap_hwmod_dma_info - DMA channels used by the hwmod
185 * @name: name of the DMA channel (module local name)
186 * @dma_req: DMA request ID (should be non-negative except -1 = terminator)
187 *
188 * @name should be something short, e.g., "tx" or "rx". It is for use
189 * by platform_get_resource_byname(). It is defined locally to the
190 * hwmod.
191 */
192struct omap_hwmod_dma_info {
193 const char *name;
194 s16 dma_req;
195};
196
197/**
198 * struct omap_hwmod_rst_info - IPs reset lines use by hwmod 153 * struct omap_hwmod_rst_info - IPs reset lines use by hwmod
199 * @name: name of the reset line (module local name) 154 * @name: name of the reset line (module local name)
200 * @rst_shift: Offset of the reset bit 155 * @rst_shift: Offset of the reset bit
@@ -243,34 +198,6 @@ struct omap_hwmod_omap2_firewall {
243 u8 flags; 198 u8 flags;
244}; 199};
245 200
246
247/*
248 * omap_hwmod_addr_space.flags bits
249 *
250 * ADDR_MAP_ON_INIT: Map this address space during omap_hwmod init.
251 * ADDR_TYPE_RT: Address space contains module register target data.
252 */
253#define ADDR_MAP_ON_INIT (1 << 0) /* XXX does not belong */
254#define ADDR_TYPE_RT (1 << 1)
255
256/**
257 * struct omap_hwmod_addr_space - address space handled by the hwmod
258 * @name: name of the address space
259 * @pa_start: starting physical address
260 * @pa_end: ending physical address
261 * @flags: (see omap_hwmod_addr_space.flags macros above)
262 *
263 * Address space doesn't necessarily follow physical interconnect
264 * structure. GPMC is one example.
265 */
266struct omap_hwmod_addr_space {
267 const char *name;
268 u32 pa_start;
269 u32 pa_end;
270 u8 flags;
271};
272
273
274/* 201/*
275 * omap_hwmod_ocp_if.user bits: these indicate the initiators that use this 202 * omap_hwmod_ocp_if.user bits: these indicate the initiators that use this
276 * interface to interact with the hwmod. Used to add sleep dependencies 203 * interface to interact with the hwmod. Used to add sleep dependencies
@@ -446,9 +373,12 @@ struct omap_hwmod_omap2_prcm {
446 * HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET: Some IP blocks have a valid CLKCTRL 373 * HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET: Some IP blocks have a valid CLKCTRL
447 * offset of zero; this flag bit should be set in those cases to 374 * offset of zero; this flag bit should be set in those cases to
448 * distinguish from hwmods that have no clkctrl offset. 375 * distinguish from hwmods that have no clkctrl offset.
376 * HWMOD_OMAP4_CLKFWK_CLKCTR_CLOCK: Module clockctrl clock is managed
377 * by the common clock framework and not hwmod.
449 */ 378 */
450#define HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT (1 << 0) 379#define HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT (1 << 0)
451#define HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET (1 << 1) 380#define HWMOD_OMAP4_ZERO_CLKCTRL_OFFSET (1 << 1)
381#define HWMOD_OMAP4_CLKFWK_CLKCTR_CLOCK (1 << 2)
452 382
453/** 383/**
454 * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data 384 * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data
@@ -626,8 +556,6 @@ struct omap_hwmod_class {
626 * @name: name of the hwmod 556 * @name: name of the hwmod
627 * @class: struct omap_hwmod_class * to the class of this hwmod 557 * @class: struct omap_hwmod_class * to the class of this hwmod
628 * @od: struct omap_device currently associated with this hwmod (internal use) 558 * @od: struct omap_device currently associated with this hwmod (internal use)
629 * @mpu_irqs: ptr to an array of MPU IRQs
630 * @sdma_reqs: ptr to an array of System DMA request IDs
631 * @prcm: PRCM data pertaining to this hwmod 559 * @prcm: PRCM data pertaining to this hwmod
632 * @main_clk: main clock: OMAP clock name 560 * @main_clk: main clock: OMAP clock name
633 * @_clk: pointer to the main struct clk (filled in at runtime) 561 * @_clk: pointer to the main struct clk (filled in at runtime)
@@ -670,9 +598,6 @@ struct omap_hwmod {
670 const char *name; 598 const char *name;
671 struct omap_hwmod_class *class; 599 struct omap_hwmod_class *class;
672 struct omap_device *od; 600 struct omap_device *od;
673 struct omap_hwmod_mux_info *mux;
674 struct omap_hwmod_irq_info *mpu_irqs;
675 struct omap_hwmod_dma_info *sdma_reqs;
676 struct omap_hwmod_rst_info *rst_lines; 601 struct omap_hwmod_rst_info *rst_lines;
677 union { 602 union {
678 struct omap_hwmod_omap2_prcm omap2; 603 struct omap_hwmod_omap2_prcm omap2;
@@ -691,7 +616,6 @@ struct omap_hwmod {
691 struct lock_class_key hwmod_key; /* unique lock class */ 616 struct lock_class_key hwmod_key; /* unique lock class */
692 struct list_head node; 617 struct list_head node;
693 struct omap_hwmod_ocp_if *_mpu_port; 618 struct omap_hwmod_ocp_if *_mpu_port;
694 unsigned int (*xlate_irq)(unsigned int);
695 u32 flags; 619 u32 flags;
696 u8 mpu_rt_idx; 620 u8 mpu_rt_idx;
697 u8 response_lat; 621 u8 response_lat;
@@ -705,11 +629,16 @@ struct omap_hwmod {
705 struct omap_hwmod *parent_hwmod; 629 struct omap_hwmod *parent_hwmod;
706}; 630};
707 631
632struct device_node;
633
708struct omap_hwmod *omap_hwmod_lookup(const char *name); 634struct omap_hwmod *omap_hwmod_lookup(const char *name);
709int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), 635int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
710 void *data); 636 void *data);
711 637
712int __init omap_hwmod_setup_one(const char *name); 638int __init omap_hwmod_setup_one(const char *name);
639int omap_hwmod_parse_module_range(struct omap_hwmod *oh,
640 struct device_node *np,
641 struct resource *res);
713 642
714int omap_hwmod_enable(struct omap_hwmod *oh); 643int omap_hwmod_enable(struct omap_hwmod *oh);
715int omap_hwmod_idle(struct omap_hwmod *oh); 644int omap_hwmod_idle(struct omap_hwmod *oh);
@@ -724,7 +653,6 @@ int omap_hwmod_softreset(struct omap_hwmod *oh);
724 653
725int omap_hwmod_count_resources(struct omap_hwmod *oh, unsigned long flags); 654int omap_hwmod_count_resources(struct omap_hwmod *oh, unsigned long flags);
726int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res); 655int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
727int omap_hwmod_fill_dma_resources(struct omap_hwmod *oh, struct resource *res);
728int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type, 656int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
729 const char *name, struct resource *res); 657 const char *name, struct resource *res);
730 658
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index 65b1647092bd..1a15a347945a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -155,7 +155,6 @@ static struct omap_dma_dev_attr dma_dev_attr = {
155static struct omap_hwmod omap2420_dma_system_hwmod = { 155static struct omap_hwmod omap2420_dma_system_hwmod = {
156 .name = "dma", 156 .name = "dma",
157 .class = &omap2xxx_dma_hwmod_class, 157 .class = &omap2xxx_dma_hwmod_class,
158 .mpu_irqs = omap2_dma_system_irqs,
159 .main_clk = "core_l3_ck", 158 .main_clk = "core_l3_ck",
160 .dev_attr = &dma_dev_attr, 159 .dev_attr = &dma_dev_attr,
161 .flags = HWMOD_NO_IDLEST, 160 .flags = HWMOD_NO_IDLEST,
@@ -371,7 +370,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = {
371 .master = &omap2xxx_l4_core_hwmod, 370 .master = &omap2xxx_l4_core_hwmod,
372 .slave = &omap2420_dma_system_hwmod, 371 .slave = &omap2420_dma_system_hwmod,
373 .clk = "sdma_ick", 372 .clk = "sdma_ick",
374 .addr = omap2_dma_system_addrs,
375 .user = OCP_USER_MPU | OCP_USER_SDMA, 373 .user = OCP_USER_MPU | OCP_USER_SDMA,
376}; 374};
377 375
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 79127b35fe60..3801850bccec 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -153,7 +153,6 @@ static struct omap_dma_dev_attr dma_dev_attr = {
153static struct omap_hwmod omap2430_dma_system_hwmod = { 153static struct omap_hwmod omap2430_dma_system_hwmod = {
154 .name = "dma", 154 .name = "dma",
155 .class = &omap2xxx_dma_hwmod_class, 155 .class = &omap2xxx_dma_hwmod_class,
156 .mpu_irqs = omap2_dma_system_irqs,
157 .main_clk = "core_l3_ck", 156 .main_clk = "core_l3_ck",
158 .dev_attr = &dma_dev_attr, 157 .dev_attr = &dma_dev_attr,
159 .flags = HWMOD_NO_IDLEST, 158 .flags = HWMOD_NO_IDLEST,
@@ -572,7 +571,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__dma_system = {
572 .master = &omap2xxx_l4_core_hwmod, 571 .master = &omap2xxx_l4_core_hwmod,
573 .slave = &omap2430_dma_system_hwmod, 572 .slave = &omap2430_dma_system_hwmod,
574 .clk = "sdma_ick", 573 .clk = "sdma_ick",
575 .addr = omap2_dma_system_addrs,
576 .user = OCP_USER_MPU | OCP_USER_SDMA, 574 .user = OCP_USER_MPU | OCP_USER_SDMA,
577}; 575};
578 576
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c
deleted file mode 100644
index 6d2e32462df9..000000000000
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * omap_hwmod_2xxx_3xxx_interconnect_data.c - common interconnect data, OMAP2/3
3 *
4 * Copyright (C) 2009-2011 Nokia Corporation
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * XXX handle crossbar/shared link difference for L3?
12 * XXX these should be marked initdata for multi-OMAP kernels
13 */
14#include <asm/sizes.h>
15
16#include "omap_hwmod.h"
17
18#include "omap_hwmod_common_data.h"
19
20struct omap_hwmod_addr_space omap2_dma_system_addrs[] = {
21 {
22 .pa_start = 0x48056000,
23 .pa_end = 0x48056000 + SZ_4K - 1,
24 .flags = ADDR_TYPE_RT,
25 },
26 { },
27};
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
index cfaeb0f78cc8..28665d29f23f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
@@ -65,21 +65,6 @@ struct omap_hwmod_class iva_hwmod_class = {
65 .name = "iva", 65 .name = "iva",
66}; 66};
67 67
68/* Common MPU IRQ line data */
69
70struct omap_hwmod_irq_info omap2_dispc_irqs[] = {
71 { .irq = 25 + OMAP_INTC_START, },
72 { .irq = -1, },
73};
74
75struct omap_hwmod_irq_info omap2_dma_system_irqs[] = {
76 { .name = "0", .irq = 12 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ0 */
77 { .name = "1", .irq = 13 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ1 */
78 { .name = "2", .irq = 14 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ2 */
79 { .name = "3", .irq = 15 + OMAP_INTC_START, }, /* INT_24XX_SDMA_IRQ3 */
80 { .irq = -1, },
81};
82
83struct omap_hwmod_class_sysconfig omap2_hdq1w_sysc = { 68struct omap_hwmod_class_sysconfig omap2_hdq1w_sysc = {
84 .rev_offs = 0x0, 69 .rev_offs = 0x0,
85 .sysc_offs = 0x14, 70 .sysc_offs = 0x14,
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 d190f1ad97b7..beec4cd617b1 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
@@ -20,11 +20,6 @@
20#include "prm-regbits-24xx.h" 20#include "prm-regbits-24xx.h"
21#include "wd_timer.h" 21#include "wd_timer.h"
22 22
23static struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = {
24 { .name = "dispc", .dma_req = 5 },
25 { .dma_req = -1, },
26};
27
28/* 23/*
29 * 'dispc' class 24 * 'dispc' class
30 * display controller 25 * display controller
@@ -550,7 +545,6 @@ struct omap_hwmod omap2xxx_dss_core_hwmod = {
550 .name = "dss_core", 545 .name = "dss_core",
551 .class = &omap2_dss_hwmod_class, 546 .class = &omap2_dss_hwmod_class,
552 .main_clk = "dss1_fck", /* instead of dss_fck */ 547 .main_clk = "dss1_fck", /* instead of dss_fck */
553 .sdma_reqs = omap2xxx_dss_sdma_chs,
554 .prcm = { 548 .prcm = {
555 .omap2 = { 549 .omap2 = {
556 .prcm_reg_id = 1, 550 .prcm_reg_id = 1,
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 8236e5c49ec3..e0001232bb4f 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
@@ -159,54 +159,24 @@ struct omap_hwmod_ocp_if am33xx_l4_ls__elm = {
159 .user = OCP_USER_MPU, 159 .user = OCP_USER_MPU,
160}; 160};
161 161
162static struct omap_hwmod_addr_space am33xx_epwmss0_addr_space[] = {
163 {
164 .pa_start = 0x48300000,
165 .pa_end = 0x48300000 + SZ_16 - 1,
166 .flags = ADDR_TYPE_RT
167 },
168 { }
169};
170
171struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss0 = { 162struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss0 = {
172 .master = &am33xx_l4_ls_hwmod, 163 .master = &am33xx_l4_ls_hwmod,
173 .slave = &am33xx_epwmss0_hwmod, 164 .slave = &am33xx_epwmss0_hwmod,
174 .clk = "l4ls_gclk", 165 .clk = "l4ls_gclk",
175 .addr = am33xx_epwmss0_addr_space,
176 .user = OCP_USER_MPU, 166 .user = OCP_USER_MPU,
177}; 167};
178 168
179static struct omap_hwmod_addr_space am33xx_epwmss1_addr_space[] = {
180 {
181 .pa_start = 0x48302000,
182 .pa_end = 0x48302000 + SZ_16 - 1,
183 .flags = ADDR_TYPE_RT
184 },
185 { }
186};
187
188struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss1 = { 169struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss1 = {
189 .master = &am33xx_l4_ls_hwmod, 170 .master = &am33xx_l4_ls_hwmod,
190 .slave = &am33xx_epwmss1_hwmod, 171 .slave = &am33xx_epwmss1_hwmod,
191 .clk = "l4ls_gclk", 172 .clk = "l4ls_gclk",
192 .addr = am33xx_epwmss1_addr_space,
193 .user = OCP_USER_MPU, 173 .user = OCP_USER_MPU,
194}; 174};
195 175
196static struct omap_hwmod_addr_space am33xx_epwmss2_addr_space[] = {
197 {
198 .pa_start = 0x48304000,
199 .pa_end = 0x48304000 + SZ_16 - 1,
200 .flags = ADDR_TYPE_RT
201 },
202 { }
203};
204
205struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss2 = { 176struct omap_hwmod_ocp_if am33xx_l4_ls__epwmss2 = {
206 .master = &am33xx_l4_ls_hwmod, 177 .master = &am33xx_l4_ls_hwmod,
207 .slave = &am33xx_epwmss2_hwmod, 178 .slave = &am33xx_epwmss2_hwmod,
208 .clk = "l4ls_gclk", 179 .clk = "l4ls_gclk",
209 .addr = am33xx_epwmss2_addr_space,
210 .user = OCP_USER_MPU, 180 .user = OCP_USER_MPU,
211}; 181};
212 182
@@ -250,92 +220,42 @@ struct omap_hwmod_ocp_if am33xx_l4_ls__spinlock = {
250}; 220};
251 221
252/* l4 ls -> mcasp0 */ 222/* l4 ls -> mcasp0 */
253static struct omap_hwmod_addr_space am33xx_mcasp0_addr_space[] = {
254 {
255 .pa_start = 0x48038000,
256 .pa_end = 0x48038000 + SZ_8K - 1,
257 .flags = ADDR_TYPE_RT
258 },
259 { }
260};
261
262struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp0 = { 223struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp0 = {
263 .master = &am33xx_l4_ls_hwmod, 224 .master = &am33xx_l4_ls_hwmod,
264 .slave = &am33xx_mcasp0_hwmod, 225 .slave = &am33xx_mcasp0_hwmod,
265 .clk = "l4ls_gclk", 226 .clk = "l4ls_gclk",
266 .addr = am33xx_mcasp0_addr_space,
267 .user = OCP_USER_MPU, 227 .user = OCP_USER_MPU,
268}; 228};
269 229
270/* l4 ls -> mcasp1 */ 230/* l4 ls -> mcasp1 */
271static struct omap_hwmod_addr_space am33xx_mcasp1_addr_space[] = {
272 {
273 .pa_start = 0x4803C000,
274 .pa_end = 0x4803C000 + SZ_8K - 1,
275 .flags = ADDR_TYPE_RT
276 },
277 { }
278};
279
280struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp1 = { 231struct omap_hwmod_ocp_if am33xx_l4_ls__mcasp1 = {
281 .master = &am33xx_l4_ls_hwmod, 232 .master = &am33xx_l4_ls_hwmod,
282 .slave = &am33xx_mcasp1_hwmod, 233 .slave = &am33xx_mcasp1_hwmod,
283 .clk = "l4ls_gclk", 234 .clk = "l4ls_gclk",
284 .addr = am33xx_mcasp1_addr_space,
285 .user = OCP_USER_MPU, 235 .user = OCP_USER_MPU,
286}; 236};
287 237
288/* l4 ls -> mmc0 */ 238/* l4 ls -> mmc0 */
289static struct omap_hwmod_addr_space am33xx_mmc0_addr_space[] = {
290 {
291 .pa_start = 0x48060100,
292 .pa_end = 0x48060100 + SZ_4K - 1,
293 .flags = ADDR_TYPE_RT,
294 },
295 { }
296};
297
298struct omap_hwmod_ocp_if am33xx_l4_ls__mmc0 = { 239struct omap_hwmod_ocp_if am33xx_l4_ls__mmc0 = {
299 .master = &am33xx_l4_ls_hwmod, 240 .master = &am33xx_l4_ls_hwmod,
300 .slave = &am33xx_mmc0_hwmod, 241 .slave = &am33xx_mmc0_hwmod,
301 .clk = "l4ls_gclk", 242 .clk = "l4ls_gclk",
302 .addr = am33xx_mmc0_addr_space,
303 .user = OCP_USER_MPU, 243 .user = OCP_USER_MPU,
304}; 244};
305 245
306/* l4 ls -> mmc1 */ 246/* l4 ls -> mmc1 */
307static struct omap_hwmod_addr_space am33xx_mmc1_addr_space[] = {
308 {
309 .pa_start = 0x481d8100,
310 .pa_end = 0x481d8100 + SZ_4K - 1,
311 .flags = ADDR_TYPE_RT,
312 },
313 { }
314};
315
316struct omap_hwmod_ocp_if am33xx_l4_ls__mmc1 = { 247struct omap_hwmod_ocp_if am33xx_l4_ls__mmc1 = {
317 .master = &am33xx_l4_ls_hwmod, 248 .master = &am33xx_l4_ls_hwmod,
318 .slave = &am33xx_mmc1_hwmod, 249 .slave = &am33xx_mmc1_hwmod,
319 .clk = "l4ls_gclk", 250 .clk = "l4ls_gclk",
320 .addr = am33xx_mmc1_addr_space,
321 .user = OCP_USER_MPU, 251 .user = OCP_USER_MPU,
322}; 252};
323 253
324/* l3 s -> mmc2 */ 254/* l3 s -> mmc2 */
325static struct omap_hwmod_addr_space am33xx_mmc2_addr_space[] = {
326 {
327 .pa_start = 0x47810100,
328 .pa_end = 0x47810100 + SZ_64K - 1,
329 .flags = ADDR_TYPE_RT,
330 },
331 { }
332};
333
334struct omap_hwmod_ocp_if am33xx_l3_s__mmc2 = { 255struct omap_hwmod_ocp_if am33xx_l3_s__mmc2 = {
335 .master = &am33xx_l3_s_hwmod, 256 .master = &am33xx_l3_s_hwmod,
336 .slave = &am33xx_mmc2_hwmod, 257 .slave = &am33xx_mmc2_hwmod,
337 .clk = "l3s_gclk", 258 .clk = "l3s_gclk",
338 .addr = am33xx_mmc2_addr_space,
339 .user = OCP_USER_MPU, 259 .user = OCP_USER_MPU,
340}; 260};
341 261
@@ -412,56 +332,26 @@ struct omap_hwmod_ocp_if am33xx_l3_main__tpcc = {
412}; 332};
413 333
414/* l3 main -> tpcc0 */ 334/* l3 main -> tpcc0 */
415static struct omap_hwmod_addr_space am33xx_tptc0_addr_space[] = {
416 {
417 .pa_start = 0x49800000,
418 .pa_end = 0x49800000 + SZ_8K - 1,
419 .flags = ADDR_TYPE_RT,
420 },
421 { }
422};
423
424struct omap_hwmod_ocp_if am33xx_l3_main__tptc0 = { 335struct omap_hwmod_ocp_if am33xx_l3_main__tptc0 = {
425 .master = &am33xx_l3_main_hwmod, 336 .master = &am33xx_l3_main_hwmod,
426 .slave = &am33xx_tptc0_hwmod, 337 .slave = &am33xx_tptc0_hwmod,
427 .clk = "l3_gclk", 338 .clk = "l3_gclk",
428 .addr = am33xx_tptc0_addr_space,
429 .user = OCP_USER_MPU, 339 .user = OCP_USER_MPU,
430}; 340};
431 341
432/* l3 main -> tpcc1 */ 342/* l3 main -> tpcc1 */
433static struct omap_hwmod_addr_space am33xx_tptc1_addr_space[] = {
434 {
435 .pa_start = 0x49900000,
436 .pa_end = 0x49900000 + SZ_8K - 1,
437 .flags = ADDR_TYPE_RT,
438 },
439 { }
440};
441
442struct omap_hwmod_ocp_if am33xx_l3_main__tptc1 = { 343struct omap_hwmod_ocp_if am33xx_l3_main__tptc1 = {
443 .master = &am33xx_l3_main_hwmod, 344 .master = &am33xx_l3_main_hwmod,
444 .slave = &am33xx_tptc1_hwmod, 345 .slave = &am33xx_tptc1_hwmod,
445 .clk = "l3_gclk", 346 .clk = "l3_gclk",
446 .addr = am33xx_tptc1_addr_space,
447 .user = OCP_USER_MPU, 347 .user = OCP_USER_MPU,
448}; 348};
449 349
450/* l3 main -> tpcc2 */ 350/* l3 main -> tpcc2 */
451static struct omap_hwmod_addr_space am33xx_tptc2_addr_space[] = {
452 {
453 .pa_start = 0x49a00000,
454 .pa_end = 0x49a00000 + SZ_8K - 1,
455 .flags = ADDR_TYPE_RT,
456 },
457 { }
458};
459
460struct omap_hwmod_ocp_if am33xx_l3_main__tptc2 = { 351struct omap_hwmod_ocp_if am33xx_l3_main__tptc2 = {
461 .master = &am33xx_l3_main_hwmod, 352 .master = &am33xx_l3_main_hwmod,
462 .slave = &am33xx_tptc2_hwmod, 353 .slave = &am33xx_tptc2_hwmod,
463 .clk = "l3_gclk", 354 .clk = "l3_gclk",
464 .addr = am33xx_tptc2_addr_space,
465 .user = OCP_USER_MPU, 355 .user = OCP_USER_MPU,
466}; 356};
467 357
@@ -513,38 +403,18 @@ struct omap_hwmod_ocp_if am33xx_l3_main__ocmc = {
513}; 403};
514 404
515/* l3 main -> sha0 HIB2 */ 405/* l3 main -> sha0 HIB2 */
516static struct omap_hwmod_addr_space am33xx_sha0_addrs[] = {
517 {
518 .pa_start = 0x53100000,
519 .pa_end = 0x53100000 + SZ_512 - 1,
520 .flags = ADDR_TYPE_RT
521 },
522 { }
523};
524
525struct omap_hwmod_ocp_if am33xx_l3_main__sha0 = { 406struct omap_hwmod_ocp_if am33xx_l3_main__sha0 = {
526 .master = &am33xx_l3_main_hwmod, 407 .master = &am33xx_l3_main_hwmod,
527 .slave = &am33xx_sha0_hwmod, 408 .slave = &am33xx_sha0_hwmod,
528 .clk = "sha0_fck", 409 .clk = "sha0_fck",
529 .addr = am33xx_sha0_addrs,
530 .user = OCP_USER_MPU | OCP_USER_SDMA, 410 .user = OCP_USER_MPU | OCP_USER_SDMA,
531}; 411};
532 412
533/* l3 main -> AES0 HIB2 */ 413/* l3 main -> AES0 HIB2 */
534static struct omap_hwmod_addr_space am33xx_aes0_addrs[] = {
535 {
536 .pa_start = 0x53500000,
537 .pa_end = 0x53500000 + SZ_1M - 1,
538 .flags = ADDR_TYPE_RT
539 },
540 { }
541};
542
543struct omap_hwmod_ocp_if am33xx_l3_main__aes0 = { 414struct omap_hwmod_ocp_if am33xx_l3_main__aes0 = {
544 .master = &am33xx_l3_main_hwmod, 415 .master = &am33xx_l3_main_hwmod,
545 .slave = &am33xx_aes0_hwmod, 416 .slave = &am33xx_aes0_hwmod,
546 .clk = "aes0_fck", 417 .clk = "aes0_fck",
547 .addr = am33xx_aes0_addrs,
548 .user = OCP_USER_MPU | OCP_USER_SDMA, 418 .user = OCP_USER_MPU | OCP_USER_SDMA,
549}; 419};
550 420
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 de06a1d5ffab..4bcf9f3e1544 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
@@ -778,9 +778,9 @@ struct omap_hwmod am33xx_mcasp1_hwmod = {
778 778
779/* 'mmc' class */ 779/* 'mmc' class */
780static struct omap_hwmod_class_sysconfig am33xx_mmc_sysc = { 780static struct omap_hwmod_class_sysconfig am33xx_mmc_sysc = {
781 .rev_offs = 0x1fc, 781 .rev_offs = 0x2fc,
782 .sysc_offs = 0x10, 782 .sysc_offs = 0x110,
783 .syss_offs = 0x14, 783 .syss_offs = 0x114,
784 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | 784 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
785 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | 785 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
786 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS), 786 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
index 6dc51a774a26..4d16b15bb0cf 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
@@ -320,20 +320,11 @@ static struct omap_hwmod am33xx_usbss_hwmod = {
320 * Interfaces 320 * Interfaces
321 */ 321 */
322 322
323static struct omap_hwmod_addr_space am33xx_emif_addrs[] = {
324 {
325 .pa_start = 0x4c000000,
326 .pa_end = 0x4c000fff,
327 .flags = ADDR_TYPE_RT
328 },
329 { }
330};
331/* l3 main -> emif */ 323/* l3 main -> emif */
332static struct omap_hwmod_ocp_if am33xx_l3_main__emif = { 324static struct omap_hwmod_ocp_if am33xx_l3_main__emif = {
333 .master = &am33xx_l3_main_hwmod, 325 .master = &am33xx_l3_main_hwmod,
334 .slave = &am33xx_emif_hwmod, 326 .slave = &am33xx_emif_hwmod,
335 .clk = "dpll_core_m4_ck", 327 .clk = "dpll_core_m4_ck",
336 .addr = am33xx_emif_addrs,
337 .user = OCP_USER_MPU | OCP_USER_SDMA, 328 .user = OCP_USER_MPU | OCP_USER_SDMA,
338}; 329};
339 330
@@ -370,20 +361,10 @@ static struct omap_hwmod_ocp_if am33xx_l4_hs__pruss = {
370}; 361};
371 362
372/* l3_main -> debugss */ 363/* l3_main -> debugss */
373static struct omap_hwmod_addr_space am33xx_debugss_addrs[] = {
374 {
375 .pa_start = 0x4b000000,
376 .pa_end = 0x4b000000 + SZ_16M - 1,
377 .flags = ADDR_TYPE_RT
378 },
379 { }
380};
381
382static struct omap_hwmod_ocp_if am33xx_l3_main__debugss = { 364static struct omap_hwmod_ocp_if am33xx_l3_main__debugss = {
383 .master = &am33xx_l3_main_hwmod, 365 .master = &am33xx_l3_main_hwmod,
384 .slave = &am33xx_debugss_hwmod, 366 .slave = &am33xx_debugss_hwmod,
385 .clk = "dpll_core_m4_ck", 367 .clk = "dpll_core_m4_ck",
386 .addr = am33xx_debugss_addrs,
387 .user = OCP_USER_MPU, 368 .user = OCP_USER_MPU,
388}; 369};
389 370
@@ -428,20 +409,10 @@ static struct omap_hwmod_ocp_if am33xx_l4_wkup__gpio0 = {
428}; 409};
429 410
430/* L4 WKUP -> ADC_TSC */ 411/* L4 WKUP -> ADC_TSC */
431static struct omap_hwmod_addr_space am33xx_adc_tsc_addrs[] = {
432 {
433 .pa_start = 0x44E0D000,
434 .pa_end = 0x44E0D000 + SZ_8K - 1,
435 .flags = ADDR_TYPE_RT
436 },
437 { }
438};
439
440static struct omap_hwmod_ocp_if am33xx_l4_wkup__adc_tsc = { 412static struct omap_hwmod_ocp_if am33xx_l4_wkup__adc_tsc = {
441 .master = &am33xx_l4_wkup_hwmod, 413 .master = &am33xx_l4_wkup_hwmod,
442 .slave = &am33xx_adc_tsc_hwmod, 414 .slave = &am33xx_adc_tsc_hwmod,
443 .clk = "dpll_core_m4_div2_ck", 415 .clk = "dpll_core_m4_div2_ck",
444 .addr = am33xx_adc_tsc_addrs,
445 .user = OCP_USER_MPU, 416 .user = OCP_USER_MPU,
446}; 417};
447 418
@@ -452,20 +423,10 @@ static struct omap_hwmod_ocp_if am33xx_l4_hs__cpgmac0 = {
452 .user = OCP_USER_MPU, 423 .user = OCP_USER_MPU,
453}; 424};
454 425
455static struct omap_hwmod_addr_space am33xx_lcdc_addr_space[] = {
456 {
457 .pa_start = 0x4830E000,
458 .pa_end = 0x4830E000 + SZ_8K - 1,
459 .flags = ADDR_TYPE_RT,
460 },
461 { }
462};
463
464static struct omap_hwmod_ocp_if am33xx_l3_main__lcdc = { 426static struct omap_hwmod_ocp_if am33xx_l3_main__lcdc = {
465 .master = &am33xx_l3_main_hwmod, 427 .master = &am33xx_l3_main_hwmod,
466 .slave = &am33xx_lcdc_hwmod, 428 .slave = &am33xx_lcdc_hwmod,
467 .clk = "dpll_core_m4_ck", 429 .clk = "dpll_core_m4_ck",
468 .addr = am33xx_lcdc_addr_space,
469 .user = OCP_USER_MPU, 430 .user = OCP_USER_MPU,
470}; 431};
471 432
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index c3276436b0ae..d2106ae4410a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -565,12 +565,6 @@ static struct omap_hwmod_class i2c_class = {
565 .reset = &omap_i2c_reset, 565 .reset = &omap_i2c_reset,
566}; 566};
567 567
568static struct omap_hwmod_dma_info omap3xxx_dss_sdma_chs[] = {
569 { .name = "dispc", .dma_req = 5 },
570 { .name = "dsi1", .dma_req = 74 },
571 { .dma_req = -1, },
572};
573
574/* dss */ 568/* dss */
575static struct omap_hwmod_opt_clk dss_opt_clks[] = { 569static struct omap_hwmod_opt_clk dss_opt_clks[] = {
576 /* 570 /*
@@ -587,7 +581,6 @@ static struct omap_hwmod omap3430es1_dss_core_hwmod = {
587 .name = "dss_core", 581 .name = "dss_core",
588 .class = &omap2_dss_hwmod_class, 582 .class = &omap2_dss_hwmod_class,
589 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */ 583 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */
590 .sdma_reqs = omap3xxx_dss_sdma_chs,
591 .prcm = { 584 .prcm = {
592 .omap2 = { 585 .omap2 = {
593 .prcm_reg_id = 1, 586 .prcm_reg_id = 1,
@@ -607,7 +600,6 @@ static struct omap_hwmod omap3xxx_dss_core_hwmod = {
607 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 600 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
608 .class = &omap2_dss_hwmod_class, 601 .class = &omap2_dss_hwmod_class,
609 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */ 602 .main_clk = "dss1_alwon_fck", /* instead of dss_fck */
610 .sdma_reqs = omap3xxx_dss_sdma_chs,
611 .prcm = { 603 .prcm = {
612 .omap2 = { 604 .omap2 = {
613 .prcm_reg_id = 1, 605 .prcm_reg_id = 1,
@@ -647,7 +639,6 @@ static struct omap_hwmod_class omap3_dispc_hwmod_class = {
647static struct omap_hwmod omap3xxx_dss_dispc_hwmod = { 639static struct omap_hwmod omap3xxx_dss_dispc_hwmod = {
648 .name = "dss_dispc", 640 .name = "dss_dispc",
649 .class = &omap3_dispc_hwmod_class, 641 .class = &omap3_dispc_hwmod_class,
650 .mpu_irqs = omap2_dispc_irqs,
651 .main_clk = "dss1_alwon_fck", 642 .main_clk = "dss1_alwon_fck",
652 .prcm = { 643 .prcm = {
653 .omap2 = { 644 .omap2 = {
@@ -1017,7 +1008,6 @@ static struct omap_hwmod_class omap3xxx_dma_hwmod_class = {
1017static struct omap_hwmod omap3xxx_dma_system_hwmod = { 1008static struct omap_hwmod omap3xxx_dma_system_hwmod = {
1018 .name = "dma", 1009 .name = "dma",
1019 .class = &omap3xxx_dma_hwmod_class, 1010 .class = &omap3xxx_dma_hwmod_class,
1020 .mpu_irqs = omap2_dma_system_irqs,
1021 .main_clk = "core_l3_ick", 1011 .main_clk = "core_l3_ick",
1022 .prcm = { 1012 .prcm = {
1023 .omap2 = { 1013 .omap2 = {
@@ -2108,20 +2098,10 @@ static struct omap_hwmod_ocp_if omap3_l4_core__i2c3 = {
2108}; 2098};
2109 2099
2110/* L4 CORE -> SR1 interface */ 2100/* L4 CORE -> SR1 interface */
2111static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = {
2112 {
2113 .pa_start = OMAP34XX_SR1_BASE,
2114 .pa_end = OMAP34XX_SR1_BASE + SZ_1K - 1,
2115 .flags = ADDR_TYPE_RT,
2116 },
2117 { },
2118};
2119
2120static struct omap_hwmod_ocp_if omap34xx_l4_core__sr1 = { 2101static struct omap_hwmod_ocp_if omap34xx_l4_core__sr1 = {
2121 .master = &omap3xxx_l4_core_hwmod, 2102 .master = &omap3xxx_l4_core_hwmod,
2122 .slave = &omap34xx_sr1_hwmod, 2103 .slave = &omap34xx_sr1_hwmod,
2123 .clk = "sr_l4_ick", 2104 .clk = "sr_l4_ick",
2124 .addr = omap3_sr1_addr_space,
2125 .user = OCP_USER_MPU, 2105 .user = OCP_USER_MPU,
2126}; 2106};
2127 2107
@@ -2129,25 +2109,15 @@ static struct omap_hwmod_ocp_if omap36xx_l4_core__sr1 = {
2129 .master = &omap3xxx_l4_core_hwmod, 2109 .master = &omap3xxx_l4_core_hwmod,
2130 .slave = &omap36xx_sr1_hwmod, 2110 .slave = &omap36xx_sr1_hwmod,
2131 .clk = "sr_l4_ick", 2111 .clk = "sr_l4_ick",
2132 .addr = omap3_sr1_addr_space,
2133 .user = OCP_USER_MPU, 2112 .user = OCP_USER_MPU,
2134}; 2113};
2135 2114
2136/* L4 CORE -> SR1 interface */ 2115/* L4 CORE -> SR2 interface */
2137static struct omap_hwmod_addr_space omap3_sr2_addr_space[] = {
2138 {
2139 .pa_start = OMAP34XX_SR2_BASE,
2140 .pa_end = OMAP34XX_SR2_BASE + SZ_1K - 1,
2141 .flags = ADDR_TYPE_RT,
2142 },
2143 { },
2144};
2145 2116
2146static struct omap_hwmod_ocp_if omap34xx_l4_core__sr2 = { 2117static struct omap_hwmod_ocp_if omap34xx_l4_core__sr2 = {
2147 .master = &omap3xxx_l4_core_hwmod, 2118 .master = &omap3xxx_l4_core_hwmod,
2148 .slave = &omap34xx_sr2_hwmod, 2119 .slave = &omap34xx_sr2_hwmod,
2149 .clk = "sr_l4_ick", 2120 .clk = "sr_l4_ick",
2150 .addr = omap3_sr2_addr_space,
2151 .user = OCP_USER_MPU, 2121 .user = OCP_USER_MPU,
2152}; 2122};
2153 2123
@@ -2155,7 +2125,6 @@ static struct omap_hwmod_ocp_if omap36xx_l4_core__sr2 = {
2155 .master = &omap3xxx_l4_core_hwmod, 2125 .master = &omap3xxx_l4_core_hwmod,
2156 .slave = &omap36xx_sr2_hwmod, 2126 .slave = &omap36xx_sr2_hwmod,
2157 .clk = "sr_l4_ick", 2127 .clk = "sr_l4_ick",
2158 .addr = omap3_sr2_addr_space,
2159 .user = OCP_USER_MPU, 2128 .user = OCP_USER_MPU,
2160}; 2129};
2161 2130
@@ -2524,21 +2493,11 @@ static struct omap_hwmod_ocp_if omap3xxx_dma_system__l3 = {
2524 .user = OCP_USER_MPU | OCP_USER_SDMA, 2493 .user = OCP_USER_MPU | OCP_USER_SDMA,
2525}; 2494};
2526 2495
2527static struct omap_hwmod_addr_space omap3xxx_dma_system_addrs[] = {
2528 {
2529 .pa_start = 0x48056000,
2530 .pa_end = 0x48056fff,
2531 .flags = ADDR_TYPE_RT,
2532 },
2533 { },
2534};
2535
2536/* l4_cfg -> dma_system */ 2496/* l4_cfg -> dma_system */
2537static struct omap_hwmod_ocp_if omap3xxx_l4_core__dma_system = { 2497static struct omap_hwmod_ocp_if omap3xxx_l4_core__dma_system = {
2538 .master = &omap3xxx_l4_core_hwmod, 2498 .master = &omap3xxx_l4_core_hwmod,
2539 .slave = &omap3xxx_dma_system_hwmod, 2499 .slave = &omap3xxx_dma_system_hwmod,
2540 .clk = "core_l4_ick", 2500 .clk = "core_l4_ick",
2541 .addr = omap3xxx_dma_system_addrs,
2542 .user = OCP_USER_MPU | OCP_USER_SDMA, 2501 .user = OCP_USER_MPU | OCP_USER_SDMA,
2543}; 2502};
2544 2503
@@ -3148,7 +3107,7 @@ int __init omap3xxx_hwmod_init(void)
3148 int r; 3107 int r;
3149 struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL, **h_sham = NULL; 3108 struct omap_hwmod_ocp_if **h = NULL, **h_gp = NULL, **h_sham = NULL;
3150 struct omap_hwmod_ocp_if **h_aes = NULL; 3109 struct omap_hwmod_ocp_if **h_aes = NULL;
3151 struct device_node *bus = NULL; 3110 struct device_node *bus;
3152 unsigned int rev; 3111 unsigned int rev;
3153 3112
3154 omap_hwmod_init(); 3113 omap_hwmod_init();
@@ -3208,18 +3167,14 @@ int __init omap3xxx_hwmod_init(void)
3208 3167
3209 if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) { 3168 if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) {
3210 r = omap_hwmod_register_links(h_sham); 3169 r = omap_hwmod_register_links(h_sham);
3211 if (r < 0) { 3170 if (r < 0)
3212 of_node_put(bus); 3171 goto put_node;
3213 return r;
3214 }
3215 } 3172 }
3216 3173
3217 if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) { 3174 if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) {
3218 r = omap_hwmod_register_links(h_aes); 3175 r = omap_hwmod_register_links(h_aes);
3219 if (r < 0) { 3176 if (r < 0)
3220 of_node_put(bus); 3177 goto put_node;
3221 return r;
3222 }
3223 } 3178 }
3224 of_node_put(bus); 3179 of_node_put(bus);
3225 3180
@@ -3270,4 +3225,8 @@ int __init omap3xxx_hwmod_init(void)
3270 r = omap_hwmod_register_links(omap3xxx_dss_hwmod_ocp_ifs); 3225 r = omap_hwmod_register_links(omap3xxx_dss_hwmod_ocp_ifs);
3271 3226
3272 return r; 3227 return r;
3228
3229put_node:
3230 of_node_put(bus);
3231 return r;
3273} 3232}
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 3e2d792fd9df..c47709659a54 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -465,20 +465,10 @@ static struct omap_dma_dev_attr dma_dev_attr = {
465}; 465};
466 466
467/* dma_system */ 467/* dma_system */
468static struct omap_hwmod_irq_info omap44xx_dma_system_irqs[] = {
469 { .name = "0", .irq = 12 + OMAP44XX_IRQ_GIC_START },
470 { .name = "1", .irq = 13 + OMAP44XX_IRQ_GIC_START },
471 { .name = "2", .irq = 14 + OMAP44XX_IRQ_GIC_START },
472 { .name = "3", .irq = 15 + OMAP44XX_IRQ_GIC_START },
473 { .irq = -1 }
474};
475
476static struct omap_hwmod omap44xx_dma_system_hwmod = { 468static struct omap_hwmod omap44xx_dma_system_hwmod = {
477 .name = "dma_system", 469 .name = "dma_system",
478 .class = &omap44xx_dma_hwmod_class, 470 .class = &omap44xx_dma_hwmod_class,
479 .clkdm_name = "l3_dma_clkdm", 471 .clkdm_name = "l3_dma_clkdm",
480 .mpu_irqs = omap44xx_dma_system_irqs,
481 .xlate_irq = omap4_xlate_irq,
482 .main_clk = "l3_div_ck", 472 .main_clk = "l3_div_ck",
483 .prcm = { 473 .prcm = {
484 .omap4 = { 474 .omap4 = {
@@ -620,16 +610,6 @@ static struct omap_hwmod_class omap44xx_dispc_hwmod_class = {
620}; 610};
621 611
622/* dss_dispc */ 612/* dss_dispc */
623static struct omap_hwmod_irq_info omap44xx_dss_dispc_irqs[] = {
624 { .irq = 25 + OMAP44XX_IRQ_GIC_START },
625 { .irq = -1 }
626};
627
628static struct omap_hwmod_dma_info omap44xx_dss_dispc_sdma_reqs[] = {
629 { .dma_req = 5 + OMAP44XX_DMA_REQ_START },
630 { .dma_req = -1 }
631};
632
633static struct omap_dss_dispc_dev_attr omap44xx_dss_dispc_dev_attr = { 613static struct omap_dss_dispc_dev_attr omap44xx_dss_dispc_dev_attr = {
634 .manager_count = 3, 614 .manager_count = 3,
635 .has_framedonetv_irq = 1 615 .has_framedonetv_irq = 1
@@ -639,9 +619,6 @@ static struct omap_hwmod omap44xx_dss_dispc_hwmod = {
639 .name = "dss_dispc", 619 .name = "dss_dispc",
640 .class = &omap44xx_dispc_hwmod_class, 620 .class = &omap44xx_dispc_hwmod_class,
641 .clkdm_name = "l3_dss_clkdm", 621 .clkdm_name = "l3_dss_clkdm",
642 .mpu_irqs = omap44xx_dss_dispc_irqs,
643 .xlate_irq = omap4_xlate_irq,
644 .sdma_reqs = omap44xx_dss_dispc_sdma_reqs,
645 .main_clk = "dss_dss_clk", 622 .main_clk = "dss_dss_clk",
646 .prcm = { 623 .prcm = {
647 .omap4 = { 624 .omap4 = {
@@ -675,16 +652,6 @@ static struct omap_hwmod_class omap44xx_dsi_hwmod_class = {
675}; 652};
676 653
677/* dss_dsi1 */ 654/* dss_dsi1 */
678static struct omap_hwmod_irq_info omap44xx_dss_dsi1_irqs[] = {
679 { .irq = 53 + OMAP44XX_IRQ_GIC_START },
680 { .irq = -1 }
681};
682
683static struct omap_hwmod_dma_info omap44xx_dss_dsi1_sdma_reqs[] = {
684 { .dma_req = 74 + OMAP44XX_DMA_REQ_START },
685 { .dma_req = -1 }
686};
687
688static struct omap_hwmod_opt_clk dss_dsi1_opt_clks[] = { 655static struct omap_hwmod_opt_clk dss_dsi1_opt_clks[] = {
689 { .role = "sys_clk", .clk = "dss_sys_clk" }, 656 { .role = "sys_clk", .clk = "dss_sys_clk" },
690}; 657};
@@ -693,9 +660,6 @@ static struct omap_hwmod omap44xx_dss_dsi1_hwmod = {
693 .name = "dss_dsi1", 660 .name = "dss_dsi1",
694 .class = &omap44xx_dsi_hwmod_class, 661 .class = &omap44xx_dsi_hwmod_class,
695 .clkdm_name = "l3_dss_clkdm", 662 .clkdm_name = "l3_dss_clkdm",
696 .mpu_irqs = omap44xx_dss_dsi1_irqs,
697 .xlate_irq = omap4_xlate_irq,
698 .sdma_reqs = omap44xx_dss_dsi1_sdma_reqs,
699 .main_clk = "dss_dss_clk", 663 .main_clk = "dss_dss_clk",
700 .prcm = { 664 .prcm = {
701 .omap4 = { 665 .omap4 = {
@@ -709,16 +673,6 @@ static struct omap_hwmod omap44xx_dss_dsi1_hwmod = {
709}; 673};
710 674
711/* dss_dsi2 */ 675/* dss_dsi2 */
712static struct omap_hwmod_irq_info omap44xx_dss_dsi2_irqs[] = {
713 { .irq = 84 + OMAP44XX_IRQ_GIC_START },
714 { .irq = -1 }
715};
716
717static struct omap_hwmod_dma_info omap44xx_dss_dsi2_sdma_reqs[] = {
718 { .dma_req = 83 + OMAP44XX_DMA_REQ_START },
719 { .dma_req = -1 }
720};
721
722static struct omap_hwmod_opt_clk dss_dsi2_opt_clks[] = { 676static struct omap_hwmod_opt_clk dss_dsi2_opt_clks[] = {
723 { .role = "sys_clk", .clk = "dss_sys_clk" }, 677 { .role = "sys_clk", .clk = "dss_sys_clk" },
724}; 678};
@@ -727,9 +681,6 @@ static struct omap_hwmod omap44xx_dss_dsi2_hwmod = {
727 .name = "dss_dsi2", 681 .name = "dss_dsi2",
728 .class = &omap44xx_dsi_hwmod_class, 682 .class = &omap44xx_dsi_hwmod_class,
729 .clkdm_name = "l3_dss_clkdm", 683 .clkdm_name = "l3_dss_clkdm",
730 .mpu_irqs = omap44xx_dss_dsi2_irqs,
731 .xlate_irq = omap4_xlate_irq,
732 .sdma_reqs = omap44xx_dss_dsi2_sdma_reqs,
733 .main_clk = "dss_dss_clk", 684 .main_clk = "dss_dss_clk",
734 .prcm = { 685 .prcm = {
735 .omap4 = { 686 .omap4 = {
@@ -763,16 +714,6 @@ static struct omap_hwmod_class omap44xx_hdmi_hwmod_class = {
763}; 714};
764 715
765/* dss_hdmi */ 716/* dss_hdmi */
766static struct omap_hwmod_irq_info omap44xx_dss_hdmi_irqs[] = {
767 { .irq = 101 + OMAP44XX_IRQ_GIC_START },
768 { .irq = -1 }
769};
770
771static struct omap_hwmod_dma_info omap44xx_dss_hdmi_sdma_reqs[] = {
772 { .dma_req = 75 + OMAP44XX_DMA_REQ_START },
773 { .dma_req = -1 }
774};
775
776static struct omap_hwmod_opt_clk dss_hdmi_opt_clks[] = { 717static struct omap_hwmod_opt_clk dss_hdmi_opt_clks[] = {
777 { .role = "sys_clk", .clk = "dss_sys_clk" }, 718 { .role = "sys_clk", .clk = "dss_sys_clk" },
778 { .role = "hdmi_clk", .clk = "dss_48mhz_clk" }, 719 { .role = "hdmi_clk", .clk = "dss_48mhz_clk" },
@@ -787,9 +728,6 @@ static struct omap_hwmod omap44xx_dss_hdmi_hwmod = {
787 * set idle mode by software. 728 * set idle mode by software.
788 */ 729 */
789 .flags = HWMOD_SWSUP_SIDLE | HWMOD_OPT_CLKS_NEEDED, 730 .flags = HWMOD_SWSUP_SIDLE | HWMOD_OPT_CLKS_NEEDED,
790 .mpu_irqs = omap44xx_dss_hdmi_irqs,
791 .xlate_irq = omap4_xlate_irq,
792 .sdma_reqs = omap44xx_dss_hdmi_sdma_reqs,
793 .main_clk = "dss_48mhz_clk", 731 .main_clk = "dss_48mhz_clk",
794 .prcm = { 732 .prcm = {
795 .omap4 = { 733 .omap4 = {
@@ -823,11 +761,6 @@ static struct omap_hwmod_class omap44xx_rfbi_hwmod_class = {
823}; 761};
824 762
825/* dss_rfbi */ 763/* dss_rfbi */
826static struct omap_hwmod_dma_info omap44xx_dss_rfbi_sdma_reqs[] = {
827 { .dma_req = 13 + OMAP44XX_DMA_REQ_START },
828 { .dma_req = -1 }
829};
830
831static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = { 764static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
832 { .role = "ick", .clk = "l3_div_ck" }, 765 { .role = "ick", .clk = "l3_div_ck" },
833}; 766};
@@ -836,7 +769,6 @@ static struct omap_hwmod omap44xx_dss_rfbi_hwmod = {
836 .name = "dss_rfbi", 769 .name = "dss_rfbi",
837 .class = &omap44xx_rfbi_hwmod_class, 770 .class = &omap44xx_rfbi_hwmod_class,
838 .clkdm_name = "l3_dss_clkdm", 771 .clkdm_name = "l3_dss_clkdm",
839 .sdma_reqs = omap44xx_dss_rfbi_sdma_reqs,
840 .main_clk = "dss_dss_clk", 772 .main_clk = "dss_dss_clk",
841 .prcm = { 773 .prcm = {
842 .omap4 = { 774 .omap4 = {
@@ -1936,19 +1868,6 @@ static struct omap_hwmod_class omap44xx_mcspi_hwmod_class = {
1936}; 1868};
1937 1869
1938/* mcspi1 */ 1870/* mcspi1 */
1939static struct omap_hwmod_dma_info omap44xx_mcspi1_sdma_reqs[] = {
1940 { .name = "tx0", .dma_req = 34 + OMAP44XX_DMA_REQ_START },
1941 { .name = "rx0", .dma_req = 35 + OMAP44XX_DMA_REQ_START },
1942 { .name = "tx1", .dma_req = 36 + OMAP44XX_DMA_REQ_START },
1943 { .name = "rx1", .dma_req = 37 + OMAP44XX_DMA_REQ_START },
1944 { .name = "tx2", .dma_req = 38 + OMAP44XX_DMA_REQ_START },
1945 { .name = "rx2", .dma_req = 39 + OMAP44XX_DMA_REQ_START },
1946 { .name = "tx3", .dma_req = 40 + OMAP44XX_DMA_REQ_START },
1947 { .name = "rx3", .dma_req = 41 + OMAP44XX_DMA_REQ_START },
1948 { .dma_req = -1 }
1949};
1950
1951/* mcspi1 dev_attr */
1952static struct omap2_mcspi_dev_attr mcspi1_dev_attr = { 1871static struct omap2_mcspi_dev_attr mcspi1_dev_attr = {
1953 .num_chipselect = 4, 1872 .num_chipselect = 4,
1954}; 1873};
@@ -1957,7 +1876,6 @@ static struct omap_hwmod omap44xx_mcspi1_hwmod = {
1957 .name = "mcspi1", 1876 .name = "mcspi1",
1958 .class = &omap44xx_mcspi_hwmod_class, 1877 .class = &omap44xx_mcspi_hwmod_class,
1959 .clkdm_name = "l4_per_clkdm", 1878 .clkdm_name = "l4_per_clkdm",
1960 .sdma_reqs = omap44xx_mcspi1_sdma_reqs,
1961 .main_clk = "func_48m_fclk", 1879 .main_clk = "func_48m_fclk",
1962 .prcm = { 1880 .prcm = {
1963 .omap4 = { 1881 .omap4 = {
@@ -1970,15 +1888,6 @@ static struct omap_hwmod omap44xx_mcspi1_hwmod = {
1970}; 1888};
1971 1889
1972/* mcspi2 */ 1890/* mcspi2 */
1973static struct omap_hwmod_dma_info omap44xx_mcspi2_sdma_reqs[] = {
1974 { .name = "tx0", .dma_req = 42 + OMAP44XX_DMA_REQ_START },
1975 { .name = "rx0", .dma_req = 43 + OMAP44XX_DMA_REQ_START },
1976 { .name = "tx1", .dma_req = 44 + OMAP44XX_DMA_REQ_START },
1977 { .name = "rx1", .dma_req = 45 + OMAP44XX_DMA_REQ_START },
1978 { .dma_req = -1 }
1979};
1980
1981/* mcspi2 dev_attr */
1982static struct omap2_mcspi_dev_attr mcspi2_dev_attr = { 1891static struct omap2_mcspi_dev_attr mcspi2_dev_attr = {
1983 .num_chipselect = 2, 1892 .num_chipselect = 2,
1984}; 1893};
@@ -1987,7 +1896,6 @@ static struct omap_hwmod omap44xx_mcspi2_hwmod = {
1987 .name = "mcspi2", 1896 .name = "mcspi2",
1988 .class = &omap44xx_mcspi_hwmod_class, 1897 .class = &omap44xx_mcspi_hwmod_class,
1989 .clkdm_name = "l4_per_clkdm", 1898 .clkdm_name = "l4_per_clkdm",
1990 .sdma_reqs = omap44xx_mcspi2_sdma_reqs,
1991 .main_clk = "func_48m_fclk", 1899 .main_clk = "func_48m_fclk",
1992 .prcm = { 1900 .prcm = {
1993 .omap4 = { 1901 .omap4 = {
@@ -2000,15 +1908,6 @@ static struct omap_hwmod omap44xx_mcspi2_hwmod = {
2000}; 1908};
2001 1909
2002/* mcspi3 */ 1910/* mcspi3 */
2003static struct omap_hwmod_dma_info omap44xx_mcspi3_sdma_reqs[] = {
2004 { .name = "tx0", .dma_req = 14 + OMAP44XX_DMA_REQ_START },
2005 { .name = "rx0", .dma_req = 15 + OMAP44XX_DMA_REQ_START },
2006 { .name = "tx1", .dma_req = 22 + OMAP44XX_DMA_REQ_START },
2007 { .name = "rx1", .dma_req = 23 + OMAP44XX_DMA_REQ_START },
2008 { .dma_req = -1 }
2009};
2010
2011/* mcspi3 dev_attr */
2012static struct omap2_mcspi_dev_attr mcspi3_dev_attr = { 1911static struct omap2_mcspi_dev_attr mcspi3_dev_attr = {
2013 .num_chipselect = 2, 1912 .num_chipselect = 2,
2014}; 1913};
@@ -2017,7 +1916,6 @@ static struct omap_hwmod omap44xx_mcspi3_hwmod = {
2017 .name = "mcspi3", 1916 .name = "mcspi3",
2018 .class = &omap44xx_mcspi_hwmod_class, 1917 .class = &omap44xx_mcspi_hwmod_class,
2019 .clkdm_name = "l4_per_clkdm", 1918 .clkdm_name = "l4_per_clkdm",
2020 .sdma_reqs = omap44xx_mcspi3_sdma_reqs,
2021 .main_clk = "func_48m_fclk", 1919 .main_clk = "func_48m_fclk",
2022 .prcm = { 1920 .prcm = {
2023 .omap4 = { 1921 .omap4 = {
@@ -2030,13 +1928,6 @@ static struct omap_hwmod omap44xx_mcspi3_hwmod = {
2030}; 1928};
2031 1929
2032/* mcspi4 */ 1930/* mcspi4 */
2033static struct omap_hwmod_dma_info omap44xx_mcspi4_sdma_reqs[] = {
2034 { .name = "tx0", .dma_req = 69 + OMAP44XX_DMA_REQ_START },
2035 { .name = "rx0", .dma_req = 70 + OMAP44XX_DMA_REQ_START },
2036 { .dma_req = -1 }
2037};
2038
2039/* mcspi4 dev_attr */
2040static struct omap2_mcspi_dev_attr mcspi4_dev_attr = { 1931static struct omap2_mcspi_dev_attr mcspi4_dev_attr = {
2041 .num_chipselect = 1, 1932 .num_chipselect = 1,
2042}; 1933};
@@ -2045,7 +1936,6 @@ static struct omap_hwmod omap44xx_mcspi4_hwmod = {
2045 .name = "mcspi4", 1936 .name = "mcspi4",
2046 .class = &omap44xx_mcspi_hwmod_class, 1937 .class = &omap44xx_mcspi_hwmod_class,
2047 .clkdm_name = "l4_per_clkdm", 1938 .clkdm_name = "l4_per_clkdm",
2048 .sdma_reqs = omap44xx_mcspi4_sdma_reqs,
2049 .main_clk = "func_48m_fclk", 1939 .main_clk = "func_48m_fclk",
2050 .prcm = { 1940 .prcm = {
2051 .omap4 = { 1941 .omap4 = {
@@ -2080,13 +1970,6 @@ static struct omap_hwmod_class omap44xx_mmc_hwmod_class = {
2080}; 1970};
2081 1971
2082/* mmc1 */ 1972/* mmc1 */
2083static struct omap_hwmod_dma_info omap44xx_mmc1_sdma_reqs[] = {
2084 { .name = "tx", .dma_req = 60 + OMAP44XX_DMA_REQ_START },
2085 { .name = "rx", .dma_req = 61 + OMAP44XX_DMA_REQ_START },
2086 { .dma_req = -1 }
2087};
2088
2089/* mmc1 dev_attr */
2090static struct omap_hsmmc_dev_attr mmc1_dev_attr = { 1973static struct omap_hsmmc_dev_attr mmc1_dev_attr = {
2091 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT, 1974 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
2092}; 1975};
@@ -2095,7 +1978,6 @@ static struct omap_hwmod omap44xx_mmc1_hwmod = {
2095 .name = "mmc1", 1978 .name = "mmc1",
2096 .class = &omap44xx_mmc_hwmod_class, 1979 .class = &omap44xx_mmc_hwmod_class,
2097 .clkdm_name = "l3_init_clkdm", 1980 .clkdm_name = "l3_init_clkdm",
2098 .sdma_reqs = omap44xx_mmc1_sdma_reqs,
2099 .main_clk = "hsmmc1_fclk", 1981 .main_clk = "hsmmc1_fclk",
2100 .prcm = { 1982 .prcm = {
2101 .omap4 = { 1983 .omap4 = {
@@ -2108,17 +1990,10 @@ static struct omap_hwmod omap44xx_mmc1_hwmod = {
2108}; 1990};
2109 1991
2110/* mmc2 */ 1992/* mmc2 */
2111static struct omap_hwmod_dma_info omap44xx_mmc2_sdma_reqs[] = {
2112 { .name = "tx", .dma_req = 46 + OMAP44XX_DMA_REQ_START },
2113 { .name = "rx", .dma_req = 47 + OMAP44XX_DMA_REQ_START },
2114 { .dma_req = -1 }
2115};
2116
2117static struct omap_hwmod omap44xx_mmc2_hwmod = { 1993static struct omap_hwmod omap44xx_mmc2_hwmod = {
2118 .name = "mmc2", 1994 .name = "mmc2",
2119 .class = &omap44xx_mmc_hwmod_class, 1995 .class = &omap44xx_mmc_hwmod_class,
2120 .clkdm_name = "l3_init_clkdm", 1996 .clkdm_name = "l3_init_clkdm",
2121 .sdma_reqs = omap44xx_mmc2_sdma_reqs,
2122 .main_clk = "hsmmc2_fclk", 1997 .main_clk = "hsmmc2_fclk",
2123 .prcm = { 1998 .prcm = {
2124 .omap4 = { 1999 .omap4 = {
@@ -2130,17 +2005,10 @@ static struct omap_hwmod omap44xx_mmc2_hwmod = {
2130}; 2005};
2131 2006
2132/* mmc3 */ 2007/* mmc3 */
2133static struct omap_hwmod_dma_info omap44xx_mmc3_sdma_reqs[] = {
2134 { .name = "tx", .dma_req = 76 + OMAP44XX_DMA_REQ_START },
2135 { .name = "rx", .dma_req = 77 + OMAP44XX_DMA_REQ_START },
2136 { .dma_req = -1 }
2137};
2138
2139static struct omap_hwmod omap44xx_mmc3_hwmod = { 2008static struct omap_hwmod omap44xx_mmc3_hwmod = {
2140 .name = "mmc3", 2009 .name = "mmc3",
2141 .class = &omap44xx_mmc_hwmod_class, 2010 .class = &omap44xx_mmc_hwmod_class,
2142 .clkdm_name = "l4_per_clkdm", 2011 .clkdm_name = "l4_per_clkdm",
2143 .sdma_reqs = omap44xx_mmc3_sdma_reqs,
2144 .main_clk = "func_48m_fclk", 2012 .main_clk = "func_48m_fclk",
2145 .prcm = { 2013 .prcm = {
2146 .omap4 = { 2014 .omap4 = {
@@ -2152,17 +2020,10 @@ static struct omap_hwmod omap44xx_mmc3_hwmod = {
2152}; 2020};
2153 2021
2154/* mmc4 */ 2022/* mmc4 */
2155static struct omap_hwmod_dma_info omap44xx_mmc4_sdma_reqs[] = {
2156 { .name = "tx", .dma_req = 56 + OMAP44XX_DMA_REQ_START },
2157 { .name = "rx", .dma_req = 57 + OMAP44XX_DMA_REQ_START },
2158 { .dma_req = -1 }
2159};
2160
2161static struct omap_hwmod omap44xx_mmc4_hwmod = { 2023static struct omap_hwmod omap44xx_mmc4_hwmod = {
2162 .name = "mmc4", 2024 .name = "mmc4",
2163 .class = &omap44xx_mmc_hwmod_class, 2025 .class = &omap44xx_mmc_hwmod_class,
2164 .clkdm_name = "l4_per_clkdm", 2026 .clkdm_name = "l4_per_clkdm",
2165 .sdma_reqs = omap44xx_mmc4_sdma_reqs,
2166 .main_clk = "func_48m_fclk", 2027 .main_clk = "func_48m_fclk",
2167 .prcm = { 2028 .prcm = {
2168 .omap4 = { 2029 .omap4 = {
@@ -2174,17 +2035,10 @@ static struct omap_hwmod omap44xx_mmc4_hwmod = {
2174}; 2035};
2175 2036
2176/* mmc5 */ 2037/* mmc5 */
2177static struct omap_hwmod_dma_info omap44xx_mmc5_sdma_reqs[] = {
2178 { .name = "tx", .dma_req = 58 + OMAP44XX_DMA_REQ_START },
2179 { .name = "rx", .dma_req = 59 + OMAP44XX_DMA_REQ_START },
2180 { .dma_req = -1 }
2181};
2182
2183static struct omap_hwmod omap44xx_mmc5_hwmod = { 2038static struct omap_hwmod omap44xx_mmc5_hwmod = {
2184 .name = "mmc5", 2039 .name = "mmc5",
2185 .class = &omap44xx_mmc_hwmod_class, 2040 .class = &omap44xx_mmc_hwmod_class,
2186 .clkdm_name = "l4_per_clkdm", 2041 .clkdm_name = "l4_per_clkdm",
2187 .sdma_reqs = omap44xx_mmc5_sdma_reqs,
2188 .main_clk = "func_48m_fclk", 2042 .main_clk = "func_48m_fclk",
2189 .prcm = { 2043 .prcm = {
2190 .omap4 = { 2044 .omap4 = {
@@ -3538,81 +3392,19 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ocp_wp_noc = {
3538 .user = OCP_USER_MPU | OCP_USER_SDMA, 3392 .user = OCP_USER_MPU | OCP_USER_SDMA,
3539}; 3393};
3540 3394
3541static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = {
3542 {
3543 .name = "dmem",
3544 .pa_start = 0x40180000,
3545 .pa_end = 0x4018ffff
3546 },
3547 {
3548 .name = "cmem",
3549 .pa_start = 0x401a0000,
3550 .pa_end = 0x401a1fff
3551 },
3552 {
3553 .name = "smem",
3554 .pa_start = 0x401c0000,
3555 .pa_end = 0x401c5fff
3556 },
3557 {
3558 .name = "pmem",
3559 .pa_start = 0x401e0000,
3560 .pa_end = 0x401e1fff
3561 },
3562 {
3563 .name = "mpu",
3564 .pa_start = 0x401f1000,
3565 .pa_end = 0x401f13ff,
3566 .flags = ADDR_TYPE_RT
3567 },
3568 { }
3569};
3570
3571/* l4_abe -> aess */ 3395/* l4_abe -> aess */
3572static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_abe__aess = { 3396static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_abe__aess = {
3573 .master = &omap44xx_l4_abe_hwmod, 3397 .master = &omap44xx_l4_abe_hwmod,
3574 .slave = &omap44xx_aess_hwmod, 3398 .slave = &omap44xx_aess_hwmod,
3575 .clk = "ocp_abe_iclk", 3399 .clk = "ocp_abe_iclk",
3576 .addr = omap44xx_aess_addrs,
3577 .user = OCP_USER_MPU, 3400 .user = OCP_USER_MPU,
3578}; 3401};
3579 3402
3580static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = {
3581 {
3582 .name = "dmem_dma",
3583 .pa_start = 0x49080000,
3584 .pa_end = 0x4908ffff
3585 },
3586 {
3587 .name = "cmem_dma",
3588 .pa_start = 0x490a0000,
3589 .pa_end = 0x490a1fff
3590 },
3591 {
3592 .name = "smem_dma",
3593 .pa_start = 0x490c0000,
3594 .pa_end = 0x490c5fff
3595 },
3596 {
3597 .name = "pmem_dma",
3598 .pa_start = 0x490e0000,
3599 .pa_end = 0x490e1fff
3600 },
3601 {
3602 .name = "dma",
3603 .pa_start = 0x490f1000,
3604 .pa_end = 0x490f13ff,
3605 .flags = ADDR_TYPE_RT
3606 },
3607 { }
3608};
3609
3610/* l4_abe -> aess (dma) */ 3403/* l4_abe -> aess (dma) */
3611static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_abe__aess_dma = { 3404static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_abe__aess_dma = {
3612 .master = &omap44xx_l4_abe_hwmod, 3405 .master = &omap44xx_l4_abe_hwmod,
3613 .slave = &omap44xx_aess_hwmod, 3406 .slave = &omap44xx_aess_hwmod,
3614 .clk = "ocp_abe_iclk", 3407 .clk = "ocp_abe_iclk",
3615 .addr = omap44xx_aess_dma_addrs,
3616 .user = OCP_USER_SDMA, 3408 .user = OCP_USER_SDMA,
3617}; 3409};
3618 3410
@@ -3632,75 +3424,35 @@ static struct omap_hwmod_ocp_if omap44xx_l4_wkup__counter_32k = {
3632 .user = OCP_USER_MPU | OCP_USER_SDMA, 3424 .user = OCP_USER_MPU | OCP_USER_SDMA,
3633}; 3425};
3634 3426
3635static struct omap_hwmod_addr_space omap44xx_ctrl_module_core_addrs[] = {
3636 {
3637 .pa_start = 0x4a002000,
3638 .pa_end = 0x4a0027ff,
3639 .flags = ADDR_TYPE_RT
3640 },
3641 { }
3642};
3643
3644/* l4_cfg -> ctrl_module_core */ 3427/* l4_cfg -> ctrl_module_core */
3645static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ctrl_module_core = { 3428static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ctrl_module_core = {
3646 .master = &omap44xx_l4_cfg_hwmod, 3429 .master = &omap44xx_l4_cfg_hwmod,
3647 .slave = &omap44xx_ctrl_module_core_hwmod, 3430 .slave = &omap44xx_ctrl_module_core_hwmod,
3648 .clk = "l4_div_ck", 3431 .clk = "l4_div_ck",
3649 .addr = omap44xx_ctrl_module_core_addrs,
3650 .user = OCP_USER_MPU | OCP_USER_SDMA, 3432 .user = OCP_USER_MPU | OCP_USER_SDMA,
3651}; 3433};
3652 3434
3653static struct omap_hwmod_addr_space omap44xx_ctrl_module_pad_core_addrs[] = {
3654 {
3655 .pa_start = 0x4a100000,
3656 .pa_end = 0x4a1007ff,
3657 .flags = ADDR_TYPE_RT
3658 },
3659 { }
3660};
3661
3662/* l4_cfg -> ctrl_module_pad_core */ 3435/* l4_cfg -> ctrl_module_pad_core */
3663static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ctrl_module_pad_core = { 3436static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ctrl_module_pad_core = {
3664 .master = &omap44xx_l4_cfg_hwmod, 3437 .master = &omap44xx_l4_cfg_hwmod,
3665 .slave = &omap44xx_ctrl_module_pad_core_hwmod, 3438 .slave = &omap44xx_ctrl_module_pad_core_hwmod,
3666 .clk = "l4_div_ck", 3439 .clk = "l4_div_ck",
3667 .addr = omap44xx_ctrl_module_pad_core_addrs,
3668 .user = OCP_USER_MPU | OCP_USER_SDMA, 3440 .user = OCP_USER_MPU | OCP_USER_SDMA,
3669}; 3441};
3670 3442
3671static struct omap_hwmod_addr_space omap44xx_ctrl_module_wkup_addrs[] = {
3672 {
3673 .pa_start = 0x4a30c000,
3674 .pa_end = 0x4a30c7ff,
3675 .flags = ADDR_TYPE_RT
3676 },
3677 { }
3678};
3679
3680/* l4_wkup -> ctrl_module_wkup */ 3443/* l4_wkup -> ctrl_module_wkup */
3681static struct omap_hwmod_ocp_if omap44xx_l4_wkup__ctrl_module_wkup = { 3444static struct omap_hwmod_ocp_if omap44xx_l4_wkup__ctrl_module_wkup = {
3682 .master = &omap44xx_l4_wkup_hwmod, 3445 .master = &omap44xx_l4_wkup_hwmod,
3683 .slave = &omap44xx_ctrl_module_wkup_hwmod, 3446 .slave = &omap44xx_ctrl_module_wkup_hwmod,
3684 .clk = "l4_wkup_clk_mux_ck", 3447 .clk = "l4_wkup_clk_mux_ck",
3685 .addr = omap44xx_ctrl_module_wkup_addrs,
3686 .user = OCP_USER_MPU | OCP_USER_SDMA, 3448 .user = OCP_USER_MPU | OCP_USER_SDMA,
3687}; 3449};
3688 3450
3689static struct omap_hwmod_addr_space omap44xx_ctrl_module_pad_wkup_addrs[] = {
3690 {
3691 .pa_start = 0x4a31e000,
3692 .pa_end = 0x4a31e7ff,
3693 .flags = ADDR_TYPE_RT
3694 },
3695 { }
3696};
3697
3698/* l4_wkup -> ctrl_module_pad_wkup */ 3451/* l4_wkup -> ctrl_module_pad_wkup */
3699static struct omap_hwmod_ocp_if omap44xx_l4_wkup__ctrl_module_pad_wkup = { 3452static struct omap_hwmod_ocp_if omap44xx_l4_wkup__ctrl_module_pad_wkup = {
3700 .master = &omap44xx_l4_wkup_hwmod, 3453 .master = &omap44xx_l4_wkup_hwmod,
3701 .slave = &omap44xx_ctrl_module_pad_wkup_hwmod, 3454 .slave = &omap44xx_ctrl_module_pad_wkup_hwmod,
3702 .clk = "l4_wkup_clk_mux_ck", 3455 .clk = "l4_wkup_clk_mux_ck",
3703 .addr = omap44xx_ctrl_module_pad_wkup_addrs,
3704 .user = OCP_USER_MPU | OCP_USER_SDMA, 3456 .user = OCP_USER_MPU | OCP_USER_SDMA,
3705}; 3457};
3706 3458
@@ -3712,21 +3464,11 @@ static struct omap_hwmod_ocp_if omap44xx_l3_instr__debugss = {
3712 .user = OCP_USER_MPU | OCP_USER_SDMA, 3464 .user = OCP_USER_MPU | OCP_USER_SDMA,
3713}; 3465};
3714 3466
3715static struct omap_hwmod_addr_space omap44xx_dma_system_addrs[] = {
3716 {
3717 .pa_start = 0x4a056000,
3718 .pa_end = 0x4a056fff,
3719 .flags = ADDR_TYPE_RT
3720 },
3721 { }
3722};
3723
3724/* l4_cfg -> dma_system */ 3467/* l4_cfg -> dma_system */
3725static struct omap_hwmod_ocp_if omap44xx_l4_cfg__dma_system = { 3468static struct omap_hwmod_ocp_if omap44xx_l4_cfg__dma_system = {
3726 .master = &omap44xx_l4_cfg_hwmod, 3469 .master = &omap44xx_l4_cfg_hwmod,
3727 .slave = &omap44xx_dma_system_hwmod, 3470 .slave = &omap44xx_dma_system_hwmod,
3728 .clk = "l4_div_ck", 3471 .clk = "l4_div_ck",
3729 .addr = omap44xx_dma_system_addrs,
3730 .user = OCP_USER_MPU | OCP_USER_SDMA, 3472 .user = OCP_USER_MPU | OCP_USER_SDMA,
3731}; 3473};
3732 3474
@@ -3762,255 +3504,115 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__dsp = {
3762 .user = OCP_USER_MPU | OCP_USER_SDMA, 3504 .user = OCP_USER_MPU | OCP_USER_SDMA,
3763}; 3505};
3764 3506
3765static struct omap_hwmod_addr_space omap44xx_dss_dma_addrs[] = {
3766 {
3767 .pa_start = 0x58000000,
3768 .pa_end = 0x5800007f,
3769 .flags = ADDR_TYPE_RT
3770 },
3771 { }
3772};
3773
3774/* l3_main_2 -> dss */ 3507/* l3_main_2 -> dss */
3775static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss = { 3508static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss = {
3776 .master = &omap44xx_l3_main_2_hwmod, 3509 .master = &omap44xx_l3_main_2_hwmod,
3777 .slave = &omap44xx_dss_hwmod, 3510 .slave = &omap44xx_dss_hwmod,
3778 .clk = "l3_div_ck", 3511 .clk = "l3_div_ck",
3779 .addr = omap44xx_dss_dma_addrs,
3780 .user = OCP_USER_SDMA, 3512 .user = OCP_USER_SDMA,
3781}; 3513};
3782 3514
3783static struct omap_hwmod_addr_space omap44xx_dss_addrs[] = {
3784 {
3785 .pa_start = 0x48040000,
3786 .pa_end = 0x4804007f,
3787 .flags = ADDR_TYPE_RT
3788 },
3789 { }
3790};
3791
3792/* l4_per -> dss */ 3515/* l4_per -> dss */
3793static struct omap_hwmod_ocp_if omap44xx_l4_per__dss = { 3516static struct omap_hwmod_ocp_if omap44xx_l4_per__dss = {
3794 .master = &omap44xx_l4_per_hwmod, 3517 .master = &omap44xx_l4_per_hwmod,
3795 .slave = &omap44xx_dss_hwmod, 3518 .slave = &omap44xx_dss_hwmod,
3796 .clk = "l4_div_ck", 3519 .clk = "l4_div_ck",
3797 .addr = omap44xx_dss_addrs,
3798 .user = OCP_USER_MPU, 3520 .user = OCP_USER_MPU,
3799}; 3521};
3800 3522
3801static struct omap_hwmod_addr_space omap44xx_dss_dispc_dma_addrs[] = {
3802 {
3803 .pa_start = 0x58001000,
3804 .pa_end = 0x58001fff,
3805 .flags = ADDR_TYPE_RT
3806 },
3807 { }
3808};
3809
3810/* l3_main_2 -> dss_dispc */ 3523/* l3_main_2 -> dss_dispc */
3811static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dispc = { 3524static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dispc = {
3812 .master = &omap44xx_l3_main_2_hwmod, 3525 .master = &omap44xx_l3_main_2_hwmod,
3813 .slave = &omap44xx_dss_dispc_hwmod, 3526 .slave = &omap44xx_dss_dispc_hwmod,
3814 .clk = "l3_div_ck", 3527 .clk = "l3_div_ck",
3815 .addr = omap44xx_dss_dispc_dma_addrs,
3816 .user = OCP_USER_SDMA, 3528 .user = OCP_USER_SDMA,
3817}; 3529};
3818 3530
3819static struct omap_hwmod_addr_space omap44xx_dss_dispc_addrs[] = {
3820 {
3821 .pa_start = 0x48041000,
3822 .pa_end = 0x48041fff,
3823 .flags = ADDR_TYPE_RT
3824 },
3825 { }
3826};
3827
3828/* l4_per -> dss_dispc */ 3531/* l4_per -> dss_dispc */
3829static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dispc = { 3532static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dispc = {
3830 .master = &omap44xx_l4_per_hwmod, 3533 .master = &omap44xx_l4_per_hwmod,
3831 .slave = &omap44xx_dss_dispc_hwmod, 3534 .slave = &omap44xx_dss_dispc_hwmod,
3832 .clk = "l4_div_ck", 3535 .clk = "l4_div_ck",
3833 .addr = omap44xx_dss_dispc_addrs,
3834 .user = OCP_USER_MPU, 3536 .user = OCP_USER_MPU,
3835}; 3537};
3836 3538
3837static struct omap_hwmod_addr_space omap44xx_dss_dsi1_dma_addrs[] = {
3838 {
3839 .pa_start = 0x58004000,
3840 .pa_end = 0x580041ff,
3841 .flags = ADDR_TYPE_RT
3842 },
3843 { }
3844};
3845
3846/* l3_main_2 -> dss_dsi1 */ 3539/* l3_main_2 -> dss_dsi1 */
3847static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi1 = { 3540static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi1 = {
3848 .master = &omap44xx_l3_main_2_hwmod, 3541 .master = &omap44xx_l3_main_2_hwmod,
3849 .slave = &omap44xx_dss_dsi1_hwmod, 3542 .slave = &omap44xx_dss_dsi1_hwmod,
3850 .clk = "l3_div_ck", 3543 .clk = "l3_div_ck",
3851 .addr = omap44xx_dss_dsi1_dma_addrs,
3852 .user = OCP_USER_SDMA, 3544 .user = OCP_USER_SDMA,
3853}; 3545};
3854 3546
3855static struct omap_hwmod_addr_space omap44xx_dss_dsi1_addrs[] = {
3856 {
3857 .pa_start = 0x48044000,
3858 .pa_end = 0x480441ff,
3859 .flags = ADDR_TYPE_RT
3860 },
3861 { }
3862};
3863
3864/* l4_per -> dss_dsi1 */ 3547/* l4_per -> dss_dsi1 */
3865static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi1 = { 3548static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi1 = {
3866 .master = &omap44xx_l4_per_hwmod, 3549 .master = &omap44xx_l4_per_hwmod,
3867 .slave = &omap44xx_dss_dsi1_hwmod, 3550 .slave = &omap44xx_dss_dsi1_hwmod,
3868 .clk = "l4_div_ck", 3551 .clk = "l4_div_ck",
3869 .addr = omap44xx_dss_dsi1_addrs,
3870 .user = OCP_USER_MPU, 3552 .user = OCP_USER_MPU,
3871}; 3553};
3872 3554
3873static struct omap_hwmod_addr_space omap44xx_dss_dsi2_dma_addrs[] = {
3874 {
3875 .pa_start = 0x58005000,
3876 .pa_end = 0x580051ff,
3877 .flags = ADDR_TYPE_RT
3878 },
3879 { }
3880};
3881
3882/* l3_main_2 -> dss_dsi2 */ 3555/* l3_main_2 -> dss_dsi2 */
3883static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi2 = { 3556static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_dsi2 = {
3884 .master = &omap44xx_l3_main_2_hwmod, 3557 .master = &omap44xx_l3_main_2_hwmod,
3885 .slave = &omap44xx_dss_dsi2_hwmod, 3558 .slave = &omap44xx_dss_dsi2_hwmod,
3886 .clk = "l3_div_ck", 3559 .clk = "l3_div_ck",
3887 .addr = omap44xx_dss_dsi2_dma_addrs,
3888 .user = OCP_USER_SDMA, 3560 .user = OCP_USER_SDMA,
3889}; 3561};
3890 3562
3891static struct omap_hwmod_addr_space omap44xx_dss_dsi2_addrs[] = {
3892 {
3893 .pa_start = 0x48045000,
3894 .pa_end = 0x480451ff,
3895 .flags = ADDR_TYPE_RT
3896 },
3897 { }
3898};
3899
3900/* l4_per -> dss_dsi2 */ 3563/* l4_per -> dss_dsi2 */
3901static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi2 = { 3564static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_dsi2 = {
3902 .master = &omap44xx_l4_per_hwmod, 3565 .master = &omap44xx_l4_per_hwmod,
3903 .slave = &omap44xx_dss_dsi2_hwmod, 3566 .slave = &omap44xx_dss_dsi2_hwmod,
3904 .clk = "l4_div_ck", 3567 .clk = "l4_div_ck",
3905 .addr = omap44xx_dss_dsi2_addrs,
3906 .user = OCP_USER_MPU, 3568 .user = OCP_USER_MPU,
3907}; 3569};
3908 3570
3909static struct omap_hwmod_addr_space omap44xx_dss_hdmi_dma_addrs[] = {
3910 {
3911 .pa_start = 0x58006000,
3912 .pa_end = 0x58006fff,
3913 .flags = ADDR_TYPE_RT
3914 },
3915 { }
3916};
3917
3918/* l3_main_2 -> dss_hdmi */ 3571/* l3_main_2 -> dss_hdmi */
3919static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_hdmi = { 3572static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_hdmi = {
3920 .master = &omap44xx_l3_main_2_hwmod, 3573 .master = &omap44xx_l3_main_2_hwmod,
3921 .slave = &omap44xx_dss_hdmi_hwmod, 3574 .slave = &omap44xx_dss_hdmi_hwmod,
3922 .clk = "l3_div_ck", 3575 .clk = "l3_div_ck",
3923 .addr = omap44xx_dss_hdmi_dma_addrs,
3924 .user = OCP_USER_SDMA, 3576 .user = OCP_USER_SDMA,
3925}; 3577};
3926 3578
3927static struct omap_hwmod_addr_space omap44xx_dss_hdmi_addrs[] = {
3928 {
3929 .pa_start = 0x48046000,
3930 .pa_end = 0x48046fff,
3931 .flags = ADDR_TYPE_RT
3932 },
3933 { }
3934};
3935
3936/* l4_per -> dss_hdmi */ 3579/* l4_per -> dss_hdmi */
3937static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_hdmi = { 3580static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_hdmi = {
3938 .master = &omap44xx_l4_per_hwmod, 3581 .master = &omap44xx_l4_per_hwmod,
3939 .slave = &omap44xx_dss_hdmi_hwmod, 3582 .slave = &omap44xx_dss_hdmi_hwmod,
3940 .clk = "l4_div_ck", 3583 .clk = "l4_div_ck",
3941 .addr = omap44xx_dss_hdmi_addrs,
3942 .user = OCP_USER_MPU, 3584 .user = OCP_USER_MPU,
3943}; 3585};
3944 3586
3945static struct omap_hwmod_addr_space omap44xx_dss_rfbi_dma_addrs[] = {
3946 {
3947 .pa_start = 0x58002000,
3948 .pa_end = 0x580020ff,
3949 .flags = ADDR_TYPE_RT
3950 },
3951 { }
3952};
3953
3954/* l3_main_2 -> dss_rfbi */ 3587/* l3_main_2 -> dss_rfbi */
3955static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_rfbi = { 3588static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_rfbi = {
3956 .master = &omap44xx_l3_main_2_hwmod, 3589 .master = &omap44xx_l3_main_2_hwmod,
3957 .slave = &omap44xx_dss_rfbi_hwmod, 3590 .slave = &omap44xx_dss_rfbi_hwmod,
3958 .clk = "l3_div_ck", 3591 .clk = "l3_div_ck",
3959 .addr = omap44xx_dss_rfbi_dma_addrs,
3960 .user = OCP_USER_SDMA, 3592 .user = OCP_USER_SDMA,
3961}; 3593};
3962 3594
3963static struct omap_hwmod_addr_space omap44xx_dss_rfbi_addrs[] = {
3964 {
3965 .pa_start = 0x48042000,
3966 .pa_end = 0x480420ff,
3967 .flags = ADDR_TYPE_RT
3968 },
3969 { }
3970};
3971
3972/* l4_per -> dss_rfbi */ 3595/* l4_per -> dss_rfbi */
3973static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_rfbi = { 3596static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_rfbi = {
3974 .master = &omap44xx_l4_per_hwmod, 3597 .master = &omap44xx_l4_per_hwmod,
3975 .slave = &omap44xx_dss_rfbi_hwmod, 3598 .slave = &omap44xx_dss_rfbi_hwmod,
3976 .clk = "l4_div_ck", 3599 .clk = "l4_div_ck",
3977 .addr = omap44xx_dss_rfbi_addrs,
3978 .user = OCP_USER_MPU, 3600 .user = OCP_USER_MPU,
3979}; 3601};
3980 3602
3981static struct omap_hwmod_addr_space omap44xx_dss_venc_dma_addrs[] = {
3982 {
3983 .pa_start = 0x58003000,
3984 .pa_end = 0x580030ff,
3985 .flags = ADDR_TYPE_RT
3986 },
3987 { }
3988};
3989
3990/* l3_main_2 -> dss_venc */ 3603/* l3_main_2 -> dss_venc */
3991static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_venc = { 3604static struct omap_hwmod_ocp_if omap44xx_l3_main_2__dss_venc = {
3992 .master = &omap44xx_l3_main_2_hwmod, 3605 .master = &omap44xx_l3_main_2_hwmod,
3993 .slave = &omap44xx_dss_venc_hwmod, 3606 .slave = &omap44xx_dss_venc_hwmod,
3994 .clk = "l3_div_ck", 3607 .clk = "l3_div_ck",
3995 .addr = omap44xx_dss_venc_dma_addrs,
3996 .user = OCP_USER_SDMA, 3608 .user = OCP_USER_SDMA,
3997}; 3609};
3998 3610
3999static struct omap_hwmod_addr_space omap44xx_dss_venc_addrs[] = {
4000 {
4001 .pa_start = 0x48043000,
4002 .pa_end = 0x480430ff,
4003 .flags = ADDR_TYPE_RT
4004 },
4005 { }
4006};
4007
4008/* l4_per -> dss_venc */ 3611/* l4_per -> dss_venc */
4009static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_venc = { 3612static struct omap_hwmod_ocp_if omap44xx_l4_per__dss_venc = {
4010 .master = &omap44xx_l4_per_hwmod, 3613 .master = &omap44xx_l4_per_hwmod,
4011 .slave = &omap44xx_dss_venc_hwmod, 3614 .slave = &omap44xx_dss_venc_hwmod,
4012 .clk = "l4_div_ck", 3615 .clk = "l4_div_ck",
4013 .addr = omap44xx_dss_venc_addrs,
4014 .user = OCP_USER_MPU, 3616 .user = OCP_USER_MPU,
4015}; 3617};
4016 3618
@@ -4030,21 +3632,11 @@ static struct omap_hwmod_ocp_if omap44xx_l4_per__elm = {
4030 .user = OCP_USER_MPU | OCP_USER_SDMA, 3632 .user = OCP_USER_MPU | OCP_USER_SDMA,
4031}; 3633};
4032 3634
4033static struct omap_hwmod_addr_space omap44xx_fdif_addrs[] = {
4034 {
4035 .pa_start = 0x4a10a000,
4036 .pa_end = 0x4a10a1ff,
4037 .flags = ADDR_TYPE_RT
4038 },
4039 { }
4040};
4041
4042/* l4_cfg -> fdif */ 3635/* l4_cfg -> fdif */
4043static struct omap_hwmod_ocp_if omap44xx_l4_cfg__fdif = { 3636static struct omap_hwmod_ocp_if omap44xx_l4_cfg__fdif = {
4044 .master = &omap44xx_l4_cfg_hwmod, 3637 .master = &omap44xx_l4_cfg_hwmod,
4045 .slave = &omap44xx_fdif_hwmod, 3638 .slave = &omap44xx_fdif_hwmod,
4046 .clk = "l4_div_ck", 3639 .clk = "l4_div_ck",
4047 .addr = omap44xx_fdif_addrs,
4048 .user = OCP_USER_MPU | OCP_USER_SDMA, 3640 .user = OCP_USER_MPU | OCP_USER_SDMA,
4049}; 3641};
4050 3642
@@ -4104,57 +3696,27 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_2__gpmc = {
4104 .user = OCP_USER_MPU | OCP_USER_SDMA, 3696 .user = OCP_USER_MPU | OCP_USER_SDMA,
4105}; 3697};
4106 3698
4107static struct omap_hwmod_addr_space omap44xx_gpu_addrs[] = {
4108 {
4109 .pa_start = 0x56000000,
4110 .pa_end = 0x5600ffff,
4111 .flags = ADDR_TYPE_RT
4112 },
4113 { }
4114};
4115
4116/* l3_main_2 -> gpu */ 3699/* l3_main_2 -> gpu */
4117static struct omap_hwmod_ocp_if omap44xx_l3_main_2__gpu = { 3700static struct omap_hwmod_ocp_if omap44xx_l3_main_2__gpu = {
4118 .master = &omap44xx_l3_main_2_hwmod, 3701 .master = &omap44xx_l3_main_2_hwmod,
4119 .slave = &omap44xx_gpu_hwmod, 3702 .slave = &omap44xx_gpu_hwmod,
4120 .clk = "l3_div_ck", 3703 .clk = "l3_div_ck",
4121 .addr = omap44xx_gpu_addrs,
4122 .user = OCP_USER_MPU | OCP_USER_SDMA, 3704 .user = OCP_USER_MPU | OCP_USER_SDMA,
4123}; 3705};
4124 3706
4125static struct omap_hwmod_addr_space omap44xx_hdq1w_addrs[] = {
4126 {
4127 .pa_start = 0x480b2000,
4128 .pa_end = 0x480b201f,
4129 .flags = ADDR_TYPE_RT
4130 },
4131 { }
4132};
4133
4134/* l4_per -> hdq1w */ 3707/* l4_per -> hdq1w */
4135static struct omap_hwmod_ocp_if omap44xx_l4_per__hdq1w = { 3708static struct omap_hwmod_ocp_if omap44xx_l4_per__hdq1w = {
4136 .master = &omap44xx_l4_per_hwmod, 3709 .master = &omap44xx_l4_per_hwmod,
4137 .slave = &omap44xx_hdq1w_hwmod, 3710 .slave = &omap44xx_hdq1w_hwmod,
4138 .clk = "l4_div_ck", 3711 .clk = "l4_div_ck",
4139 .addr = omap44xx_hdq1w_addrs,
4140 .user = OCP_USER_MPU | OCP_USER_SDMA, 3712 .user = OCP_USER_MPU | OCP_USER_SDMA,
4141}; 3713};
4142 3714
4143static struct omap_hwmod_addr_space omap44xx_hsi_addrs[] = {
4144 {
4145 .pa_start = 0x4a058000,
4146 .pa_end = 0x4a05bfff,
4147 .flags = ADDR_TYPE_RT
4148 },
4149 { }
4150};
4151
4152/* l4_cfg -> hsi */ 3715/* l4_cfg -> hsi */
4153static struct omap_hwmod_ocp_if omap44xx_l4_cfg__hsi = { 3716static struct omap_hwmod_ocp_if omap44xx_l4_cfg__hsi = {
4154 .master = &omap44xx_l4_cfg_hwmod, 3717 .master = &omap44xx_l4_cfg_hwmod,
4155 .slave = &omap44xx_hsi_hwmod, 3718 .slave = &omap44xx_hsi_hwmod,
4156 .clk = "l4_div_ck", 3719 .clk = "l4_div_ck",
4157 .addr = omap44xx_hsi_addrs,
4158 .user = OCP_USER_MPU | OCP_USER_SDMA, 3720 .user = OCP_USER_MPU | OCP_USER_SDMA,
4159}; 3721};
4160 3722
@@ -4198,21 +3760,11 @@ static struct omap_hwmod_ocp_if omap44xx_l3_main_2__ipu = {
4198 .user = OCP_USER_MPU | OCP_USER_SDMA, 3760 .user = OCP_USER_MPU | OCP_USER_SDMA,
4199}; 3761};
4200 3762
4201static struct omap_hwmod_addr_space omap44xx_iss_addrs[] = {
4202 {
4203 .pa_start = 0x52000000,
4204 .pa_end = 0x520000ff,
4205 .flags = ADDR_TYPE_RT
4206 },
4207 { }
4208};
4209
4210/* l3_main_2 -> iss */ 3763/* l3_main_2 -> iss */
4211static struct omap_hwmod_ocp_if omap44xx_l3_main_2__iss = { 3764static struct omap_hwmod_ocp_if omap44xx_l3_main_2__iss = {
4212 .master = &omap44xx_l3_main_2_hwmod, 3765 .master = &omap44xx_l3_main_2_hwmod,
4213 .slave = &omap44xx_iss_hwmod, 3766 .slave = &omap44xx_iss_hwmod,
4214 .clk = "l3_div_ck", 3767 .clk = "l3_div_ck",
4215 .addr = omap44xx_iss_addrs,
4216 .user = OCP_USER_MPU | OCP_USER_SDMA, 3768 .user = OCP_USER_MPU | OCP_USER_SDMA,
4217}; 3769};
4218 3770
@@ -4248,39 +3800,19 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__mailbox = {
4248 .user = OCP_USER_MPU | OCP_USER_SDMA, 3800 .user = OCP_USER_MPU | OCP_USER_SDMA,
4249}; 3801};
4250 3802
4251static struct omap_hwmod_addr_space omap44xx_mcasp_addrs[] = {
4252 {
4253 .pa_start = 0x40128000,
4254 .pa_end = 0x401283ff,
4255 .flags = ADDR_TYPE_RT
4256 },
4257 { }
4258};
4259
4260/* l4_abe -> mcasp */ 3803/* l4_abe -> mcasp */
4261static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcasp = { 3804static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcasp = {
4262 .master = &omap44xx_l4_abe_hwmod, 3805 .master = &omap44xx_l4_abe_hwmod,
4263 .slave = &omap44xx_mcasp_hwmod, 3806 .slave = &omap44xx_mcasp_hwmod,
4264 .clk = "ocp_abe_iclk", 3807 .clk = "ocp_abe_iclk",
4265 .addr = omap44xx_mcasp_addrs,
4266 .user = OCP_USER_MPU, 3808 .user = OCP_USER_MPU,
4267}; 3809};
4268 3810
4269static struct omap_hwmod_addr_space omap44xx_mcasp_dma_addrs[] = {
4270 {
4271 .pa_start = 0x49028000,
4272 .pa_end = 0x490283ff,
4273 .flags = ADDR_TYPE_RT
4274 },
4275 { }
4276};
4277
4278/* l4_abe -> mcasp (dma) */ 3811/* l4_abe -> mcasp (dma) */
4279static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcasp_dma = { 3812static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcasp_dma = {
4280 .master = &omap44xx_l4_abe_hwmod, 3813 .master = &omap44xx_l4_abe_hwmod,
4281 .slave = &omap44xx_mcasp_hwmod, 3814 .slave = &omap44xx_mcasp_hwmod,
4282 .clk = "ocp_abe_iclk", 3815 .clk = "ocp_abe_iclk",
4283 .addr = omap44xx_mcasp_dma_addrs,
4284 .user = OCP_USER_SDMA, 3816 .user = OCP_USER_SDMA,
4285}; 3817};
4286 3818
@@ -4460,111 +3992,51 @@ static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l3_main_2__sl2if = {
4460 .user = OCP_USER_MPU | OCP_USER_SDMA, 3992 .user = OCP_USER_MPU | OCP_USER_SDMA,
4461}; 3993};
4462 3994
4463static struct omap_hwmod_addr_space omap44xx_slimbus1_addrs[] = {
4464 {
4465 .pa_start = 0x4012c000,
4466 .pa_end = 0x4012c3ff,
4467 .flags = ADDR_TYPE_RT
4468 },
4469 { }
4470};
4471
4472/* l4_abe -> slimbus1 */ 3995/* l4_abe -> slimbus1 */
4473static struct omap_hwmod_ocp_if omap44xx_l4_abe__slimbus1 = { 3996static struct omap_hwmod_ocp_if omap44xx_l4_abe__slimbus1 = {
4474 .master = &omap44xx_l4_abe_hwmod, 3997 .master = &omap44xx_l4_abe_hwmod,
4475 .slave = &omap44xx_slimbus1_hwmod, 3998 .slave = &omap44xx_slimbus1_hwmod,
4476 .clk = "ocp_abe_iclk", 3999 .clk = "ocp_abe_iclk",
4477 .addr = omap44xx_slimbus1_addrs,
4478 .user = OCP_USER_MPU, 4000 .user = OCP_USER_MPU,
4479}; 4001};
4480 4002
4481static struct omap_hwmod_addr_space omap44xx_slimbus1_dma_addrs[] = {
4482 {
4483 .pa_start = 0x4902c000,
4484 .pa_end = 0x4902c3ff,
4485 .flags = ADDR_TYPE_RT
4486 },
4487 { }
4488};
4489
4490/* l4_abe -> slimbus1 (dma) */ 4003/* l4_abe -> slimbus1 (dma) */
4491static struct omap_hwmod_ocp_if omap44xx_l4_abe__slimbus1_dma = { 4004static struct omap_hwmod_ocp_if omap44xx_l4_abe__slimbus1_dma = {
4492 .master = &omap44xx_l4_abe_hwmod, 4005 .master = &omap44xx_l4_abe_hwmod,
4493 .slave = &omap44xx_slimbus1_hwmod, 4006 .slave = &omap44xx_slimbus1_hwmod,
4494 .clk = "ocp_abe_iclk", 4007 .clk = "ocp_abe_iclk",
4495 .addr = omap44xx_slimbus1_dma_addrs,
4496 .user = OCP_USER_SDMA, 4008 .user = OCP_USER_SDMA,
4497}; 4009};
4498 4010
4499static struct omap_hwmod_addr_space omap44xx_slimbus2_addrs[] = {
4500 {
4501 .pa_start = 0x48076000,
4502 .pa_end = 0x480763ff,
4503 .flags = ADDR_TYPE_RT
4504 },
4505 { }
4506};
4507
4508/* l4_per -> slimbus2 */ 4011/* l4_per -> slimbus2 */
4509static struct omap_hwmod_ocp_if omap44xx_l4_per__slimbus2 = { 4012static struct omap_hwmod_ocp_if omap44xx_l4_per__slimbus2 = {
4510 .master = &omap44xx_l4_per_hwmod, 4013 .master = &omap44xx_l4_per_hwmod,
4511 .slave = &omap44xx_slimbus2_hwmod, 4014 .slave = &omap44xx_slimbus2_hwmod,
4512 .clk = "l4_div_ck", 4015 .clk = "l4_div_ck",
4513 .addr = omap44xx_slimbus2_addrs,
4514 .user = OCP_USER_MPU | OCP_USER_SDMA, 4016 .user = OCP_USER_MPU | OCP_USER_SDMA,
4515}; 4017};
4516 4018
4517static struct omap_hwmod_addr_space omap44xx_smartreflex_core_addrs[] = {
4518 {
4519 .pa_start = 0x4a0dd000,
4520 .pa_end = 0x4a0dd03f,
4521 .flags = ADDR_TYPE_RT
4522 },
4523 { }
4524};
4525
4526/* l4_cfg -> smartreflex_core */ 4019/* l4_cfg -> smartreflex_core */
4527static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_core = { 4020static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_core = {
4528 .master = &omap44xx_l4_cfg_hwmod, 4021 .master = &omap44xx_l4_cfg_hwmod,
4529 .slave = &omap44xx_smartreflex_core_hwmod, 4022 .slave = &omap44xx_smartreflex_core_hwmod,
4530 .clk = "l4_div_ck", 4023 .clk = "l4_div_ck",
4531 .addr = omap44xx_smartreflex_core_addrs,
4532 .user = OCP_USER_MPU | OCP_USER_SDMA, 4024 .user = OCP_USER_MPU | OCP_USER_SDMA,
4533}; 4025};
4534 4026
4535static struct omap_hwmod_addr_space omap44xx_smartreflex_iva_addrs[] = {
4536 {
4537 .pa_start = 0x4a0db000,
4538 .pa_end = 0x4a0db03f,
4539 .flags = ADDR_TYPE_RT
4540 },
4541 { }
4542};
4543
4544/* l4_cfg -> smartreflex_iva */ 4027/* l4_cfg -> smartreflex_iva */
4545static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_iva = { 4028static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_iva = {
4546 .master = &omap44xx_l4_cfg_hwmod, 4029 .master = &omap44xx_l4_cfg_hwmod,
4547 .slave = &omap44xx_smartreflex_iva_hwmod, 4030 .slave = &omap44xx_smartreflex_iva_hwmod,
4548 .clk = "l4_div_ck", 4031 .clk = "l4_div_ck",
4549 .addr = omap44xx_smartreflex_iva_addrs,
4550 .user = OCP_USER_MPU | OCP_USER_SDMA, 4032 .user = OCP_USER_MPU | OCP_USER_SDMA,
4551}; 4033};
4552 4034
4553static struct omap_hwmod_addr_space omap44xx_smartreflex_mpu_addrs[] = {
4554 {
4555 .pa_start = 0x4a0d9000,
4556 .pa_end = 0x4a0d903f,
4557 .flags = ADDR_TYPE_RT
4558 },
4559 { }
4560};
4561
4562/* l4_cfg -> smartreflex_mpu */ 4035/* l4_cfg -> smartreflex_mpu */
4563static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_mpu = { 4036static struct omap_hwmod_ocp_if omap44xx_l4_cfg__smartreflex_mpu = {
4564 .master = &omap44xx_l4_cfg_hwmod, 4037 .master = &omap44xx_l4_cfg_hwmod,
4565 .slave = &omap44xx_smartreflex_mpu_hwmod, 4038 .slave = &omap44xx_smartreflex_mpu_hwmod,
4566 .clk = "l4_div_ck", 4039 .clk = "l4_div_ck",
4567 .addr = omap44xx_smartreflex_mpu_addrs,
4568 .user = OCP_USER_MPU | OCP_USER_SDMA, 4040 .user = OCP_USER_MPU | OCP_USER_SDMA,
4569}; 4041};
4570 4042
@@ -4736,39 +4208,19 @@ static struct omap_hwmod_ocp_if omap44xx_l4_wkup__wd_timer2 = {
4736 .user = OCP_USER_MPU | OCP_USER_SDMA, 4208 .user = OCP_USER_MPU | OCP_USER_SDMA,
4737}; 4209};
4738 4210
4739static struct omap_hwmod_addr_space omap44xx_wd_timer3_addrs[] = {
4740 {
4741 .pa_start = 0x40130000,
4742 .pa_end = 0x4013007f,
4743 .flags = ADDR_TYPE_RT
4744 },
4745 { }
4746};
4747
4748/* l4_abe -> wd_timer3 */ 4211/* l4_abe -> wd_timer3 */
4749static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3 = { 4212static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3 = {
4750 .master = &omap44xx_l4_abe_hwmod, 4213 .master = &omap44xx_l4_abe_hwmod,
4751 .slave = &omap44xx_wd_timer3_hwmod, 4214 .slave = &omap44xx_wd_timer3_hwmod,
4752 .clk = "ocp_abe_iclk", 4215 .clk = "ocp_abe_iclk",
4753 .addr = omap44xx_wd_timer3_addrs,
4754 .user = OCP_USER_MPU, 4216 .user = OCP_USER_MPU,
4755}; 4217};
4756 4218
4757static struct omap_hwmod_addr_space omap44xx_wd_timer3_dma_addrs[] = {
4758 {
4759 .pa_start = 0x49030000,
4760 .pa_end = 0x4903007f,
4761 .flags = ADDR_TYPE_RT
4762 },
4763 { }
4764};
4765
4766/* l4_abe -> wd_timer3 (dma) */ 4219/* l4_abe -> wd_timer3 (dma) */
4767static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3_dma = { 4220static struct omap_hwmod_ocp_if omap44xx_l4_abe__wd_timer3_dma = {
4768 .master = &omap44xx_l4_abe_hwmod, 4221 .master = &omap44xx_l4_abe_hwmod,
4769 .slave = &omap44xx_wd_timer3_hwmod, 4222 .slave = &omap44xx_wd_timer3_hwmod,
4770 .clk = "ocp_abe_iclk", 4223 .clk = "ocp_abe_iclk",
4771 .addr = omap44xx_wd_timer3_dma_addrs,
4772 .user = OCP_USER_SDMA, 4224 .user = OCP_USER_SDMA,
4773}; 4225};
4774 4226
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
index 9a67f013ebad..988e7eaa1330 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -275,20 +275,10 @@ static struct omap_dma_dev_attr dma_dev_attr = {
275}; 275};
276 276
277/* dma_system */ 277/* dma_system */
278static struct omap_hwmod_irq_info omap54xx_dma_system_irqs[] = {
279 { .name = "0", .irq = 12 + OMAP54XX_IRQ_GIC_START },
280 { .name = "1", .irq = 13 + OMAP54XX_IRQ_GIC_START },
281 { .name = "2", .irq = 14 + OMAP54XX_IRQ_GIC_START },
282 { .name = "3", .irq = 15 + OMAP54XX_IRQ_GIC_START },
283 { .irq = -1 }
284};
285
286static struct omap_hwmod omap54xx_dma_system_hwmod = { 278static struct omap_hwmod omap54xx_dma_system_hwmod = {
287 .name = "dma_system", 279 .name = "dma_system",
288 .class = &omap54xx_dma_hwmod_class, 280 .class = &omap54xx_dma_hwmod_class,
289 .clkdm_name = "dma_clkdm", 281 .clkdm_name = "dma_clkdm",
290 .mpu_irqs = omap54xx_dma_system_irqs,
291 .xlate_irq = omap4_xlate_irq,
292 .main_clk = "l3_iclk_div", 282 .main_clk = "l3_iclk_div",
293 .prcm = { 283 .prcm = {
294 .omap4 = { 284 .omap4 = {
@@ -2255,21 +2245,11 @@ static struct omap_hwmod_ocp_if omap54xx_l4_wkup__counter_32k = {
2255 .user = OCP_USER_MPU | OCP_USER_SDMA, 2245 .user = OCP_USER_MPU | OCP_USER_SDMA,
2256}; 2246};
2257 2247
2258static struct omap_hwmod_addr_space omap54xx_dma_system_addrs[] = {
2259 {
2260 .pa_start = 0x4a056000,
2261 .pa_end = 0x4a056fff,
2262 .flags = ADDR_TYPE_RT
2263 },
2264 { }
2265};
2266
2267/* l4_cfg -> dma_system */ 2248/* l4_cfg -> dma_system */
2268static struct omap_hwmod_ocp_if omap54xx_l4_cfg__dma_system = { 2249static struct omap_hwmod_ocp_if omap54xx_l4_cfg__dma_system = {
2269 .master = &omap54xx_l4_cfg_hwmod, 2250 .master = &omap54xx_l4_cfg_hwmod,
2270 .slave = &omap54xx_dma_system_hwmod, 2251 .slave = &omap54xx_dma_system_hwmod,
2271 .clk = "l4_root_clk_div", 2252 .clk = "l4_root_clk_div",
2272 .addr = omap54xx_dma_system_addrs,
2273 .user = OCP_USER_MPU | OCP_USER_SDMA, 2253 .user = OCP_USER_MPU | OCP_USER_SDMA,
2274}; 2254};
2275 2255
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index 2f4f7002f38d..d05e553d6346 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -572,11 +572,6 @@ static struct omap_hwmod_class dra7xx_dss_hwmod_class = {
572}; 572};
573 573
574/* dss */ 574/* dss */
575static struct omap_hwmod_dma_info dra7xx_dss_sdma_reqs[] = {
576 { .dma_req = 75 + DRA7XX_DMA_REQ_START },
577 { .dma_req = -1 }
578};
579
580static struct omap_hwmod_opt_clk dss_opt_clks[] = { 575static struct omap_hwmod_opt_clk dss_opt_clks[] = {
581 { .role = "dss_clk", .clk = "dss_dss_clk" }, 576 { .role = "dss_clk", .clk = "dss_dss_clk" },
582 { .role = "hdmi_phy_clk", .clk = "dss_48mhz_clk" }, 577 { .role = "hdmi_phy_clk", .clk = "dss_48mhz_clk" },
@@ -592,7 +587,6 @@ static struct omap_hwmod dra7xx_dss_hwmod = {
592 .class = &dra7xx_dss_hwmod_class, 587 .class = &dra7xx_dss_hwmod_class,
593 .clkdm_name = "dss_clkdm", 588 .clkdm_name = "dss_clkdm",
594 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, 589 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
595 .sdma_reqs = dra7xx_dss_sdma_reqs,
596 .main_clk = "dss_dss_clk", 590 .main_clk = "dss_dss_clk",
597 .prcm = { 591 .prcm = {
598 .omap4 = { 592 .omap4 = {
@@ -2995,21 +2989,11 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per2__dcan2 = {
2995 .user = OCP_USER_MPU | OCP_USER_SDMA, 2989 .user = OCP_USER_MPU | OCP_USER_SDMA,
2996}; 2990};
2997 2991
2998static struct omap_hwmod_addr_space dra7xx_dma_system_addrs[] = {
2999 {
3000 .pa_start = 0x4a056000,
3001 .pa_end = 0x4a056fff,
3002 .flags = ADDR_TYPE_RT
3003 },
3004 { }
3005};
3006
3007/* l4_cfg -> dma_system */ 2992/* l4_cfg -> dma_system */
3008static struct omap_hwmod_ocp_if dra7xx_l4_cfg__dma_system = { 2993static struct omap_hwmod_ocp_if dra7xx_l4_cfg__dma_system = {
3009 .master = &dra7xx_l4_cfg_hwmod, 2994 .master = &dra7xx_l4_cfg_hwmod,
3010 .slave = &dra7xx_dma_system_hwmod, 2995 .slave = &dra7xx_dma_system_hwmod,
3011 .clk = "l3_iclk_div", 2996 .clk = "l3_iclk_div",
3012 .addr = dra7xx_dma_system_addrs,
3013 .user = OCP_USER_MPU | OCP_USER_SDMA, 2997 .user = OCP_USER_MPU | OCP_USER_SDMA,
3014}; 2998};
3015 2999
@@ -3253,21 +3237,11 @@ static struct omap_hwmod_ocp_if dra7xx_l3_main_1__gpmc = {
3253 .user = OCP_USER_MPU | OCP_USER_SDMA, 3237 .user = OCP_USER_MPU | OCP_USER_SDMA,
3254}; 3238};
3255 3239
3256static struct omap_hwmod_addr_space dra7xx_hdq1w_addrs[] = {
3257 {
3258 .pa_start = 0x480b2000,
3259 .pa_end = 0x480b201f,
3260 .flags = ADDR_TYPE_RT
3261 },
3262 { }
3263};
3264
3265/* l4_per1 -> hdq1w */ 3240/* l4_per1 -> hdq1w */
3266static struct omap_hwmod_ocp_if dra7xx_l4_per1__hdq1w = { 3241static struct omap_hwmod_ocp_if dra7xx_l4_per1__hdq1w = {
3267 .master = &dra7xx_l4_per1_hwmod, 3242 .master = &dra7xx_l4_per1_hwmod,
3268 .slave = &dra7xx_hdq1w_hwmod, 3243 .slave = &dra7xx_hdq1w_hwmod,
3269 .clk = "l3_iclk_div", 3244 .clk = "l3_iclk_div",
3270 .addr = dra7xx_hdq1w_addrs,
3271 .user = OCP_USER_MPU | OCP_USER_SDMA, 3245 .user = OCP_USER_MPU | OCP_USER_SDMA,
3272}; 3246};
3273 3247
@@ -3551,58 +3525,27 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per3__rtcss = {
3551 .user = OCP_USER_MPU | OCP_USER_SDMA, 3525 .user = OCP_USER_MPU | OCP_USER_SDMA,
3552}; 3526};
3553 3527
3554static struct omap_hwmod_addr_space dra7xx_sata_addrs[] = {
3555 {
3556 .name = "sysc",
3557 .pa_start = 0x4a141100,
3558 .pa_end = 0x4a141107,
3559 .flags = ADDR_TYPE_RT
3560 },
3561 { }
3562};
3563
3564/* l4_cfg -> sata */ 3528/* l4_cfg -> sata */
3565static struct omap_hwmod_ocp_if dra7xx_l4_cfg__sata = { 3529static struct omap_hwmod_ocp_if dra7xx_l4_cfg__sata = {
3566 .master = &dra7xx_l4_cfg_hwmod, 3530 .master = &dra7xx_l4_cfg_hwmod,
3567 .slave = &dra7xx_sata_hwmod, 3531 .slave = &dra7xx_sata_hwmod,
3568 .clk = "l3_iclk_div", 3532 .clk = "l3_iclk_div",
3569 .addr = dra7xx_sata_addrs,
3570 .user = OCP_USER_MPU | OCP_USER_SDMA, 3533 .user = OCP_USER_MPU | OCP_USER_SDMA,
3571}; 3534};
3572 3535
3573static struct omap_hwmod_addr_space dra7xx_smartreflex_core_addrs[] = {
3574 {
3575 .pa_start = 0x4a0dd000,
3576 .pa_end = 0x4a0dd07f,
3577 .flags = ADDR_TYPE_RT
3578 },
3579 { }
3580};
3581
3582/* l4_cfg -> smartreflex_core */ 3536/* l4_cfg -> smartreflex_core */
3583static struct omap_hwmod_ocp_if dra7xx_l4_cfg__smartreflex_core = { 3537static struct omap_hwmod_ocp_if dra7xx_l4_cfg__smartreflex_core = {
3584 .master = &dra7xx_l4_cfg_hwmod, 3538 .master = &dra7xx_l4_cfg_hwmod,
3585 .slave = &dra7xx_smartreflex_core_hwmod, 3539 .slave = &dra7xx_smartreflex_core_hwmod,
3586 .clk = "l4_root_clk_div", 3540 .clk = "l4_root_clk_div",
3587 .addr = dra7xx_smartreflex_core_addrs,
3588 .user = OCP_USER_MPU | OCP_USER_SDMA, 3541 .user = OCP_USER_MPU | OCP_USER_SDMA,
3589}; 3542};
3590 3543
3591static struct omap_hwmod_addr_space dra7xx_smartreflex_mpu_addrs[] = {
3592 {
3593 .pa_start = 0x4a0d9000,
3594 .pa_end = 0x4a0d907f,
3595 .flags = ADDR_TYPE_RT
3596 },
3597 { }
3598};
3599
3600/* l4_cfg -> smartreflex_mpu */ 3544/* l4_cfg -> smartreflex_mpu */
3601static struct omap_hwmod_ocp_if dra7xx_l4_cfg__smartreflex_mpu = { 3545static struct omap_hwmod_ocp_if dra7xx_l4_cfg__smartreflex_mpu = {
3602 .master = &dra7xx_l4_cfg_hwmod, 3546 .master = &dra7xx_l4_cfg_hwmod,
3603 .slave = &dra7xx_smartreflex_mpu_hwmod, 3547 .slave = &dra7xx_smartreflex_mpu_hwmod,
3604 .clk = "l4_root_clk_div", 3548 .clk = "l4_root_clk_div",
3605 .addr = dra7xx_smartreflex_mpu_addrs,
3606 .user = OCP_USER_MPU | OCP_USER_SDMA, 3549 .user = OCP_USER_MPU | OCP_USER_SDMA,
3607}; 3550};
3608 3551
diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
index 310afe474ec4..77a515b11ec2 100644
--- a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -1260,15 +1260,6 @@ static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tpcc = {
1260 .user = OCP_USER_MPU, 1260 .user = OCP_USER_MPU,
1261}; 1261};
1262 1262
1263static struct omap_hwmod_addr_space dm81xx_tptc0_addr_space[] = {
1264 {
1265 .pa_start = 0x49800000,
1266 .pa_end = 0x49800000 + SZ_8K - 1,
1267 .flags = ADDR_TYPE_RT,
1268 },
1269 { },
1270};
1271
1272static struct omap_hwmod_class dm81xx_tptc0_hwmod_class = { 1263static struct omap_hwmod_class dm81xx_tptc0_hwmod_class = {
1273 .name = "tptc0", 1264 .name = "tptc0",
1274}; 1265};
@@ -1290,7 +1281,6 @@ static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc0 = {
1290 .master = &dm81xx_alwon_l3_fast_hwmod, 1281 .master = &dm81xx_alwon_l3_fast_hwmod,
1291 .slave = &dm81xx_tptc0_hwmod, 1282 .slave = &dm81xx_tptc0_hwmod,
1292 .clk = "sysclk4_ck", 1283 .clk = "sysclk4_ck",
1293 .addr = dm81xx_tptc0_addr_space,
1294 .user = OCP_USER_MPU, 1284 .user = OCP_USER_MPU,
1295}; 1285};
1296 1286
@@ -1298,19 +1288,9 @@ static struct omap_hwmod_ocp_if dm81xx_tptc0__alwon_l3_fast = {
1298 .master = &dm81xx_tptc0_hwmod, 1288 .master = &dm81xx_tptc0_hwmod,
1299 .slave = &dm81xx_alwon_l3_fast_hwmod, 1289 .slave = &dm81xx_alwon_l3_fast_hwmod,
1300 .clk = "sysclk4_ck", 1290 .clk = "sysclk4_ck",
1301 .addr = dm81xx_tptc0_addr_space,
1302 .user = OCP_USER_MPU, 1291 .user = OCP_USER_MPU,
1303}; 1292};
1304 1293
1305static struct omap_hwmod_addr_space dm81xx_tptc1_addr_space[] = {
1306 {
1307 .pa_start = 0x49900000,
1308 .pa_end = 0x49900000 + SZ_8K - 1,
1309 .flags = ADDR_TYPE_RT,
1310 },
1311 { },
1312};
1313
1314static struct omap_hwmod_class dm81xx_tptc1_hwmod_class = { 1294static struct omap_hwmod_class dm81xx_tptc1_hwmod_class = {
1315 .name = "tptc1", 1295 .name = "tptc1",
1316}; 1296};
@@ -1332,7 +1312,6 @@ static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc1 = {
1332 .master = &dm81xx_alwon_l3_fast_hwmod, 1312 .master = &dm81xx_alwon_l3_fast_hwmod,
1333 .slave = &dm81xx_tptc1_hwmod, 1313 .slave = &dm81xx_tptc1_hwmod,
1334 .clk = "sysclk4_ck", 1314 .clk = "sysclk4_ck",
1335 .addr = dm81xx_tptc1_addr_space,
1336 .user = OCP_USER_MPU, 1315 .user = OCP_USER_MPU,
1337}; 1316};
1338 1317
@@ -1340,19 +1319,9 @@ static struct omap_hwmod_ocp_if dm81xx_tptc1__alwon_l3_fast = {
1340 .master = &dm81xx_tptc1_hwmod, 1319 .master = &dm81xx_tptc1_hwmod,
1341 .slave = &dm81xx_alwon_l3_fast_hwmod, 1320 .slave = &dm81xx_alwon_l3_fast_hwmod,
1342 .clk = "sysclk4_ck", 1321 .clk = "sysclk4_ck",
1343 .addr = dm81xx_tptc1_addr_space,
1344 .user = OCP_USER_MPU, 1322 .user = OCP_USER_MPU,
1345}; 1323};
1346 1324
1347static struct omap_hwmod_addr_space dm81xx_tptc2_addr_space[] = {
1348 {
1349 .pa_start = 0x49a00000,
1350 .pa_end = 0x49a00000 + SZ_8K - 1,
1351 .flags = ADDR_TYPE_RT,
1352 },
1353 { },
1354};
1355
1356static struct omap_hwmod_class dm81xx_tptc2_hwmod_class = { 1325static struct omap_hwmod_class dm81xx_tptc2_hwmod_class = {
1357 .name = "tptc2", 1326 .name = "tptc2",
1358}; 1327};
@@ -1374,7 +1343,6 @@ static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc2 = {
1374 .master = &dm81xx_alwon_l3_fast_hwmod, 1343 .master = &dm81xx_alwon_l3_fast_hwmod,
1375 .slave = &dm81xx_tptc2_hwmod, 1344 .slave = &dm81xx_tptc2_hwmod,
1376 .clk = "sysclk4_ck", 1345 .clk = "sysclk4_ck",
1377 .addr = dm81xx_tptc2_addr_space,
1378 .user = OCP_USER_MPU, 1346 .user = OCP_USER_MPU,
1379}; 1347};
1380 1348
@@ -1382,19 +1350,9 @@ static struct omap_hwmod_ocp_if dm81xx_tptc2__alwon_l3_fast = {
1382 .master = &dm81xx_tptc2_hwmod, 1350 .master = &dm81xx_tptc2_hwmod,
1383 .slave = &dm81xx_alwon_l3_fast_hwmod, 1351 .slave = &dm81xx_alwon_l3_fast_hwmod,
1384 .clk = "sysclk4_ck", 1352 .clk = "sysclk4_ck",
1385 .addr = dm81xx_tptc2_addr_space,
1386 .user = OCP_USER_MPU, 1353 .user = OCP_USER_MPU,
1387}; 1354};
1388 1355
1389static struct omap_hwmod_addr_space dm81xx_tptc3_addr_space[] = {
1390 {
1391 .pa_start = 0x49b00000,
1392 .pa_end = 0x49b00000 + SZ_8K - 1,
1393 .flags = ADDR_TYPE_RT,
1394 },
1395 { },
1396};
1397
1398static struct omap_hwmod_class dm81xx_tptc3_hwmod_class = { 1356static struct omap_hwmod_class dm81xx_tptc3_hwmod_class = {
1399 .name = "tptc3", 1357 .name = "tptc3",
1400}; 1358};
@@ -1416,7 +1374,6 @@ static struct omap_hwmod_ocp_if dm81xx_alwon_l3_fast__tptc3 = {
1416 .master = &dm81xx_alwon_l3_fast_hwmod, 1374 .master = &dm81xx_alwon_l3_fast_hwmod,
1417 .slave = &dm81xx_tptc3_hwmod, 1375 .slave = &dm81xx_tptc3_hwmod,
1418 .clk = "sysclk4_ck", 1376 .clk = "sysclk4_ck",
1419 .addr = dm81xx_tptc3_addr_space,
1420 .user = OCP_USER_MPU, 1377 .user = OCP_USER_MPU,
1421}; 1378};
1422 1379
@@ -1424,7 +1381,6 @@ static struct omap_hwmod_ocp_if dm81xx_tptc3__alwon_l3_fast = {
1424 .master = &dm81xx_tptc3_hwmod, 1381 .master = &dm81xx_tptc3_hwmod,
1425 .slave = &dm81xx_alwon_l3_fast_hwmod, 1382 .slave = &dm81xx_alwon_l3_fast_hwmod,
1426 .clk = "sysclk4_ck", 1383 .clk = "sysclk4_ck",
1427 .addr = dm81xx_tptc3_addr_space,
1428 .user = OCP_USER_MPU, 1384 .user = OCP_USER_MPU,
1429}; 1385};
1430 1386
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.h b/arch/arm/mach-omap2/omap_hwmod_common_data.h
index f22e9cb39f4a..29a52df2de26 100644
--- a/arch/arm/mach-omap2/omap_hwmod_common_data.h
+++ b/arch/arm/mach-omap2/omap_hwmod_common_data.h
@@ -18,9 +18,6 @@
18#include "common.h" 18#include "common.h"
19#include "display.h" 19#include "display.h"
20 20
21/* Common address space across OMAP2xxx/3xxx */
22extern struct omap_hwmod_addr_space omap2_dma_system_addrs[];
23
24/* Common IP block data across OMAP2xxx */ 21/* Common IP block data across OMAP2xxx */
25extern struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr; 22extern struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr;
26extern struct omap_hwmod omap2xxx_l3_main_hwmod; 23extern struct omap_hwmod omap2xxx_l3_main_hwmod;
@@ -89,44 +86,6 @@ extern struct omap_hwmod_ocp_if omap2xxx_l4_core__rng;
89extern struct omap_hwmod_ocp_if omap2xxx_l4_core__sham; 86extern struct omap_hwmod_ocp_if omap2xxx_l4_core__sham;
90extern struct omap_hwmod_ocp_if omap2xxx_l4_core__aes; 87extern struct omap_hwmod_ocp_if omap2xxx_l4_core__aes;
91 88
92/* Common IP block data */
93extern struct omap_hwmod_dma_info omap2_uart1_sdma_reqs[];
94extern struct omap_hwmod_dma_info omap2_uart2_sdma_reqs[];
95extern struct omap_hwmod_dma_info omap2_uart3_sdma_reqs[];
96extern struct omap_hwmod_dma_info omap2_i2c1_sdma_reqs[];
97extern struct omap_hwmod_dma_info omap2_i2c2_sdma_reqs[];
98extern struct omap_hwmod_dma_info omap2_mcspi1_sdma_reqs[];
99extern struct omap_hwmod_dma_info omap2_mcspi2_sdma_reqs[];
100extern struct omap_hwmod_dma_info omap2_mcbsp1_sdma_reqs[];
101extern struct omap_hwmod_dma_info omap2_mcbsp2_sdma_reqs[];
102
103/* Common IP block data on OMAP2430/OMAP3 */
104extern struct omap_hwmod_dma_info omap2_mcbsp3_sdma_reqs[];
105
106/* Common IP block data across OMAP2/3 */
107extern struct omap_hwmod_irq_info omap2_timer1_mpu_irqs[];
108extern struct omap_hwmod_irq_info omap2_timer2_mpu_irqs[];
109extern struct omap_hwmod_irq_info omap2_timer3_mpu_irqs[];
110extern struct omap_hwmod_irq_info omap2_timer4_mpu_irqs[];
111extern struct omap_hwmod_irq_info omap2_timer5_mpu_irqs[];
112extern struct omap_hwmod_irq_info omap2_timer6_mpu_irqs[];
113extern struct omap_hwmod_irq_info omap2_timer7_mpu_irqs[];
114extern struct omap_hwmod_irq_info omap2_timer8_mpu_irqs[];
115extern struct omap_hwmod_irq_info omap2_timer9_mpu_irqs[];
116extern struct omap_hwmod_irq_info omap2_timer10_mpu_irqs[];
117extern struct omap_hwmod_irq_info omap2_timer11_mpu_irqs[];
118extern struct omap_hwmod_irq_info omap2_uart1_mpu_irqs[];
119extern struct omap_hwmod_irq_info omap2_uart2_mpu_irqs[];
120extern struct omap_hwmod_irq_info omap2_uart3_mpu_irqs[];
121extern struct omap_hwmod_irq_info omap2_dispc_irqs[];
122extern struct omap_hwmod_irq_info omap2_i2c1_mpu_irqs[];
123extern struct omap_hwmod_irq_info omap2_i2c2_mpu_irqs[];
124extern struct omap_hwmod_irq_info omap2_dma_system_irqs[];
125extern struct omap_hwmod_irq_info omap2_mcspi1_mpu_irqs[];
126extern struct omap_hwmod_irq_info omap2_mcspi2_mpu_irqs[];
127extern struct omap_hwmod_addr_space omap2xxx_timer12_addrs[];
128extern struct omap_hwmod_irq_info omap2_hdq1w_mpu_irqs[];
129
130/* OMAP hwmod classes - forward declarations */ 89/* OMAP hwmod classes - forward declarations */
131extern struct omap_hwmod_class l3_hwmod_class; 90extern struct omap_hwmod_class l3_hwmod_class;
132extern struct omap_hwmod_class l4_hwmod_class; 91extern struct omap_hwmod_class l4_hwmod_class;
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index ee7041d523cf..0592b23902c6 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -506,7 +506,6 @@ struct omap_prcm_irq_setup {
506 u8 nr_irqs; 506 u8 nr_irqs;
507 const struct omap_prcm_irq *irqs; 507 const struct omap_prcm_irq *irqs;
508 int irq; 508 int irq;
509 unsigned int (*xlate_irq)(unsigned int);
510 void (*read_pending_irqs)(unsigned long *events); 509 void (*read_pending_irqs)(unsigned long *events);
511 void (*ocp_barrier)(void); 510 void (*ocp_barrier)(void);
512 void (*save_and_clear_irqen)(u32 *saved_mask); 511 void (*save_and_clear_irqen)(u32 *saved_mask);
diff --git a/arch/arm/mach-omap2/prm.h b/arch/arm/mach-omap2/prm.h
index 94dc3565add8..f0fb50871055 100644
--- a/arch/arm/mach-omap2/prm.h
+++ b/arch/arm/mach-omap2/prm.h
@@ -29,11 +29,9 @@ int omap2_prcm_base_init(void);
29 * 29 *
30 * PRM_HAS_IO_WAKEUP: has IO wakeup capability 30 * PRM_HAS_IO_WAKEUP: has IO wakeup capability
31 * PRM_HAS_VOLTAGE: has voltage domains 31 * PRM_HAS_VOLTAGE: has voltage domains
32 * PRM_IRQ_DEFAULT: use default irq number for PRM irq
33 */ 32 */
34#define PRM_HAS_IO_WAKEUP BIT(0) 33#define PRM_HAS_IO_WAKEUP BIT(0)
35#define PRM_HAS_VOLTAGE BIT(1) 34#define PRM_HAS_VOLTAGE BIT(1)
36#define PRM_IRQ_DEFAULT BIT(2)
37 35
38/* 36/*
39 * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP 37 * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index a2dd13217c89..05858f966f7d 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -704,12 +704,18 @@ static int omap3xxx_prm_late_init(void)
704 omap3430_pre_es3_1_reconfigure_io_chain; 704 omap3430_pre_es3_1_reconfigure_io_chain;
705 705
706 np = of_find_matching_node(NULL, omap3_prm_dt_match_table); 706 np = of_find_matching_node(NULL, omap3_prm_dt_match_table);
707 if (np) { 707 if (!np) {
708 irq_num = of_irq_get(np, 0); 708 pr_err("PRM: no device tree node for interrupt?\n");
709 if (irq_num > 0) 709
710 omap3_prcm_irq_setup.irq = irq_num; 710 return -ENODEV;
711 } 711 }
712 712
713 irq_num = of_irq_get(np, 0);
714 if (irq_num == -EPROBE_DEFER)
715 return irq_num;
716
717 omap3_prcm_irq_setup.irq = irq_num;
718
713 omap3xxx_prm_enable_io_wakeup(); 719 omap3xxx_prm_enable_io_wakeup();
714 720
715 return omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); 721 return omap_prcm_register_chain_handler(&omap3_prcm_irq_setup);
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 1c0c1663f078..acb95936dfe7 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -50,8 +50,6 @@ static struct omap_prcm_irq_setup omap4_prcm_irq_setup = {
50 .nr_regs = 2, 50 .nr_regs = 2,
51 .irqs = omap4_prcm_irqs, 51 .irqs = omap4_prcm_irqs,
52 .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs), 52 .nr_irqs = ARRAY_SIZE(omap4_prcm_irqs),
53 .irq = 11 + OMAP44XX_IRQ_GIC_START,
54 .xlate_irq = omap4_xlate_irq,
55 .read_pending_irqs = &omap44xx_prm_read_pending_irqs, 53 .read_pending_irqs = &omap44xx_prm_read_pending_irqs,
56 .ocp_barrier = &omap44xx_prm_ocp_barrier, 54 .ocp_barrier = &omap44xx_prm_ocp_barrier,
57 .save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen, 55 .save_and_clear_irqen = &omap44xx_prm_save_and_clear_irqen,
@@ -743,23 +741,10 @@ static int omap44xx_prm_late_init(void)
743 return 0; 741 return 0;
744 742
745 irq_num = of_irq_get(prm_init_data->np, 0); 743 irq_num = of_irq_get(prm_init_data->np, 0);
746 /* 744 if (irq_num == -EPROBE_DEFER)
747 * Already have OMAP4 IRQ num. For all other platforms, we need 745 return irq_num;
748 * IRQ numbers from DT
749 */
750 if (irq_num <= 0 && !(prm_init_data->flags & PRM_IRQ_DEFAULT)) {
751 if (irq_num == -EPROBE_DEFER)
752 return irq_num;
753
754 /* Have nothing to do */
755 return 0;
756 }
757 746
758 /* Once OMAP4 DT is filled as well */ 747 omap4_prcm_irq_setup.irq = irq_num;
759 if (irq_num > 0) {
760 omap4_prcm_irq_setup.irq = irq_num;
761 omap4_prcm_irq_setup.xlate_irq = NULL;
762 }
763 748
764 omap44xx_prm_enable_io_wakeup(); 749 omap44xx_prm_enable_io_wakeup();
765 750
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c
index 09180a59b1c9..021b5a8b9c0a 100644
--- a/arch/arm/mach-omap2/prm_common.c
+++ b/arch/arm/mach-omap2/prm_common.c
@@ -218,10 +218,7 @@ void omap_prcm_irq_cleanup(void)
218 kfree(prcm_irq_setup->priority_mask); 218 kfree(prcm_irq_setup->priority_mask);
219 prcm_irq_setup->priority_mask = NULL; 219 prcm_irq_setup->priority_mask = NULL;
220 220
221 if (prcm_irq_setup->xlate_irq) 221 irq = prcm_irq_setup->irq;
222 irq = prcm_irq_setup->xlate_irq(prcm_irq_setup->irq);
223 else
224 irq = prcm_irq_setup->irq;
225 irq_set_chained_handler(irq, NULL); 222 irq_set_chained_handler(irq, NULL);
226 223
227 if (prcm_irq_setup->base_irq > 0) 224 if (prcm_irq_setup->base_irq > 0)
@@ -307,10 +304,7 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup)
307 1 << (offset & 0x1f); 304 1 << (offset & 0x1f);
308 } 305 }
309 306
310 if (irq_setup->xlate_irq) 307 irq = irq_setup->irq;
311 irq = irq_setup->xlate_irq(irq_setup->irq);
312 else
313 irq = irq_setup->irq;
314 irq_set_chained_handler(irq, omap_prcm_irq_handler); 308 irq_set_chained_handler(irq, omap_prcm_irq_handler);
315 309
316 irq_setup->base_irq = irq_alloc_descs(-1, 0, irq_setup->nr_regs * 32, 310 irq_setup->base_irq = irq_alloc_descs(-1, 0, irq_setup->nr_regs * 32,
@@ -671,7 +665,7 @@ static struct omap_prcm_init_data omap4_prm_data __initdata = {
671 .index = TI_CLKM_PRM, 665 .index = TI_CLKM_PRM,
672 .init = omap44xx_prm_init, 666 .init = omap44xx_prm_init,
673 .device_inst_offset = OMAP4430_PRM_DEVICE_INST, 667 .device_inst_offset = OMAP4430_PRM_DEVICE_INST,
674 .flags = PRM_HAS_IO_WAKEUP | PRM_HAS_VOLTAGE | PRM_IRQ_DEFAULT, 668 .flags = PRM_HAS_IO_WAKEUP | PRM_HAS_VOLTAGE,
675}; 669};
676#endif 670#endif
677 671
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index 754cd0fc0e7b..28fa1f8d8363 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -395,8 +395,8 @@ IS_OMAP_TYPE(3430, 0x3430)
395#define DRA752_REV_ES1_1 (DRA7XX_CLASS | (0x52 << 16) | (0x11 << 8)) 395#define DRA752_REV_ES1_1 (DRA7XX_CLASS | (0x52 << 16) | (0x11 << 8))
396#define DRA752_REV_ES2_0 (DRA7XX_CLASS | (0x52 << 16) | (0x20 << 8)) 396#define DRA752_REV_ES2_0 (DRA7XX_CLASS | (0x52 << 16) | (0x20 << 8))
397#define DRA722_REV_ES1_0 (DRA7XX_CLASS | (0x22 << 16) | (0x10 << 8)) 397#define DRA722_REV_ES1_0 (DRA7XX_CLASS | (0x22 << 16) | (0x10 << 8))
398#define DRA722_REV_ES1_0 (DRA7XX_CLASS | (0x22 << 16) | (0x10 << 8))
399#define DRA722_REV_ES2_0 (DRA7XX_CLASS | (0x22 << 16) | (0x20 << 8)) 398#define DRA722_REV_ES2_0 (DRA7XX_CLASS | (0x22 << 16) | (0x20 << 8))
399#define DRA722_REV_ES2_1 (DRA7XX_CLASS | (0x22 << 16) | (0x21 << 8))
400 400
401void omap2xxx_check_revision(void); 401void omap2xxx_check_revision(void);
402void omap3xxx_check_revision(void); 402void omap3xxx_check_revision(void);
diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
index b7970f1fa3d5..d5f1f06e4811 100644
--- a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
@@ -206,7 +206,7 @@ static int calc_tacc(unsigned int cyc, int nwait_en,
206} 206}
207 207
208/** 208/**
209 * s3c2410_calc_bank - calculate bank timing infromation 209 * s3c2410_calc_bank - calculate bank timing information
210 * @cfg: The configuration we need to calculate for. 210 * @cfg: The configuration we need to calculate for.
211 * @bt: The bank timing information. 211 * @bt: The bank timing information.
212 * 212 *
@@ -453,11 +453,9 @@ int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg,
453 s3c_freq_iodbg("%s: bank %d: con %08lx\n", 453 s3c_freq_iodbg("%s: bank %d: con %08lx\n",
454 __func__, bank, bankcon); 454 __func__, bank, bankcon);
455 455
456 bt = kzalloc(sizeof(struct s3c2410_iobank_timing), GFP_KERNEL); 456 bt = kzalloc(sizeof(*bt), GFP_KERNEL);
457 if (!bt) { 457 if (!bt)
458 printk(KERN_ERR "%s: no memory for bank\n", __func__);
459 return -ENOMEM; 458 return -ENOMEM;
460 }
461 459
462 /* find out in nWait is enabled for bank. */ 460 /* find out in nWait is enabled for bank. */
463 461
diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
index 28b13951de87..c5b12f6b02b5 100644
--- a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
@@ -35,7 +35,7 @@
35#define print_ns(x) ((x) / 10), ((x) % 10) 35#define print_ns(x) ((x) / 10), ((x) % 10)
36 36
37/** 37/**
38 * s3c2412_print_timing - print timing infromation via printk. 38 * s3c2412_print_timing - print timing information via printk.
39 * @pfx: The prefix to print each line with. 39 * @pfx: The prefix to print each line with.
40 * @iot: The IO timing information 40 * @iot: The IO timing information
41 */ 41 */
@@ -242,11 +242,9 @@ int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg,
242 if (!bank_is_io(bank, bankcfg)) 242 if (!bank_is_io(bank, bankcfg))
243 continue; 243 continue;
244 244
245 bt = kzalloc(sizeof(struct s3c2412_iobank_timing), GFP_KERNEL); 245 bt = kzalloc(sizeof(*bt), GFP_KERNEL);
246 if (!bt) { 246 if (!bt)
247 printk(KERN_ERR "%s: no memory for bank\n", __func__);
248 return -ENOMEM; 247 return -ENOMEM;
249 }
250 248
251 timings->bank[bank].io_2412 = bt; 249 timings->bank[bank].io_2412 = bt;
252 s3c2412_iotiming_getbank(cfg, bt, bank); 250 s3c2412_iotiming_getbank(cfg, bt, bank);
diff --git a/arch/arm/mach-s3c64xx/dev-backlight.c b/arch/arm/mach-s3c64xx/dev-backlight.c
index e62e789f9aee..7ef8b9019344 100644
--- a/arch/arm/mach-s3c64xx/dev-backlight.c
+++ b/arch/arm/mach-s3c64xx/dev-backlight.c
@@ -94,17 +94,14 @@ void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
94 94
95 samsung_bl_device = kmemdup(&samsung_dfl_bl_device, 95 samsung_bl_device = kmemdup(&samsung_dfl_bl_device,
96 sizeof(struct platform_device), GFP_KERNEL); 96 sizeof(struct platform_device), GFP_KERNEL);
97 if (!samsung_bl_device) { 97 if (!samsung_bl_device)
98 printk(KERN_ERR "%s: no memory for platform dev\n", __func__);
99 return; 98 return;
100 }
101 99
102 samsung_bl_drvdata = kmemdup(&samsung_dfl_bl_data, 100 samsung_bl_drvdata = kmemdup(&samsung_dfl_bl_data,
103 sizeof(samsung_dfl_bl_data), GFP_KERNEL); 101 sizeof(samsung_dfl_bl_data), GFP_KERNEL);
104 if (!samsung_bl_drvdata) { 102 if (!samsung_bl_drvdata)
105 printk(KERN_ERR "%s: no memory for platform dev\n", __func__);
106 goto err_data; 103 goto err_data;
107 } 104
108 samsung_bl_device->dev.platform_data = &samsung_bl_drvdata->plat_data; 105 samsung_bl_device->dev.platform_data = &samsung_bl_drvdata->plat_data;
109 samsung_bl_drvdata->gpio_info = gpio_info; 106 samsung_bl_drvdata->gpio_info = gpio_info;
110 samsung_bl_data = &samsung_bl_drvdata->plat_data; 107 samsung_bl_data = &samsung_bl_drvdata->plat_data;
@@ -144,5 +141,4 @@ err_plat_reg2:
144 kfree(samsung_bl_data); 141 kfree(samsung_bl_data);
145err_data: 142err_data:
146 kfree(samsung_bl_device); 143 kfree(samsung_bl_device);
147 return;
148} 144}
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index e16b81ec4b07..1939f521579c 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -23,6 +23,7 @@ cpu-y := platsmp.o headsmp.o
23# Shared SoC family objects 23# Shared SoC family objects
24obj-$(CONFIG_ARCH_RCAR_GEN2) += setup-rcar-gen2.o platsmp-apmu.o $(cpu-y) 24obj-$(CONFIG_ARCH_RCAR_GEN2) += setup-rcar-gen2.o platsmp-apmu.o $(cpu-y)
25CFLAGS_setup-rcar-gen2.o += -march=armv7-a 25CFLAGS_setup-rcar-gen2.o += -march=armv7-a
26obj-$(CONFIG_ARCH_RCAR_GEN2) += headsmp-apmu.o
26obj-$(CONFIG_ARCH_R8A7790) += regulator-quirk-rcar-gen2.o 27obj-$(CONFIG_ARCH_R8A7790) += regulator-quirk-rcar-gen2.o
27obj-$(CONFIG_ARCH_R8A7791) += regulator-quirk-rcar-gen2.o 28obj-$(CONFIG_ARCH_R8A7791) += regulator-quirk-rcar-gen2.o
28obj-$(CONFIG_ARCH_R8A7793) += regulator-quirk-rcar-gen2.o 29obj-$(CONFIG_ARCH_R8A7793) += regulator-quirk-rcar-gen2.o
diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index f8fcd799d677..a8fa4f7e1f60 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -2,6 +2,7 @@
2#ifndef __ARCH_MACH_COMMON_H 2#ifndef __ARCH_MACH_COMMON_H
3#define __ARCH_MACH_COMMON_H 3#define __ARCH_MACH_COMMON_H
4 4
5extern void shmobile_init_cntvoff(void);
5extern void shmobile_init_delay(void); 6extern void shmobile_init_delay(void);
6extern void shmobile_boot_vector(void); 7extern void shmobile_boot_vector(void);
7extern unsigned long shmobile_boot_fn; 8extern unsigned long shmobile_boot_fn;
@@ -12,6 +13,7 @@ extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
12 unsigned long arg); 13 unsigned long arg);
13extern bool shmobile_smp_cpu_can_disable(unsigned int cpu); 14extern bool shmobile_smp_cpu_can_disable(unsigned int cpu);
14extern bool shmobile_smp_init_fallback_ops(void); 15extern bool shmobile_smp_init_fallback_ops(void);
16extern void shmobile_boot_apmu(void);
15extern void shmobile_boot_scu(void); 17extern void shmobile_boot_scu(void);
16extern void shmobile_smp_scu_prepare_cpus(phys_addr_t scu_base_phys, 18extern void shmobile_smp_scu_prepare_cpus(phys_addr_t scu_base_phys,
17 unsigned int max_cpus); 19 unsigned int max_cpus);
diff --git a/arch/arm/mach-shmobile/headsmp-apmu.S b/arch/arm/mach-shmobile/headsmp-apmu.S
new file mode 100644
index 000000000000..5672b5849401
--- /dev/null
+++ b/arch/arm/mach-shmobile/headsmp-apmu.S
@@ -0,0 +1,39 @@
1/*
2 * SMP support for APMU based systems with Cortex A7/A15
3 *
4 * Copyright (C) 2014 Renesas Electronics Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/linkage.h>
12#include <asm/assembler.h>
13
14ENTRY(shmobile_init_cntvoff)
15 /*
16 * CNTVOFF has to be initialized either from non-secure Hypervisor
17 * mode or secure Monitor mode with SCR.NS==1. If TrustZone is enabled
18 * then it should be handled by the secure code
19 */
20 cps #MON_MODE
21 mrc p15, 0, r1, c1, c1, 0 /* Get Secure Config */
22 orr r0, r1, #1
23 mcr p15, 0, r0, c1, c1, 0 /* Set Non Secure bit */
24 instr_sync
25 mov r0, #0
26 mcrr p15, 4, r0, r0, c14 /* CNTVOFF = 0 */
27 instr_sync
28 mcr p15, 0, r1, c1, c1, 0 /* Set Secure bit */
29 instr_sync
30 cps #SVC_MODE
31 ret lr
32ENDPROC(shmobile_init_cntvoff)
33
34#ifdef CONFIG_SMP
35ENTRY(shmobile_boot_apmu)
36 bl shmobile_init_cntvoff
37 b secondary_startup
38ENDPROC(shmobile_boot_apmu)
39#endif
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index 3ca2c13346f0..4422b615a6ee 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -204,7 +204,7 @@ void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
204int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) 204int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
205{ 205{
206 /* For this particular CPU register boot vector */ 206 /* For this particular CPU register boot vector */
207 shmobile_smp_hook(cpu, __pa_symbol(secondary_startup), 0); 207 shmobile_smp_hook(cpu, __pa_symbol(shmobile_boot_apmu), 0);
208 208
209 return apmu_wrap(cpu, apmu_power_on); 209 return apmu_wrap(cpu, apmu_power_on);
210} 210}
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 7ab1690fab82..5561dbed7a33 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -70,28 +70,12 @@ void __init rcar_gen2_timer_init(void)
70 void __iomem *base; 70 void __iomem *base;
71 u32 freq; 71 u32 freq;
72 72
73 shmobile_init_cntvoff();
74
73 if (of_machine_is_compatible("renesas,r8a7745") || 75 if (of_machine_is_compatible("renesas,r8a7745") ||
74 of_machine_is_compatible("renesas,r8a7792") || 76 of_machine_is_compatible("renesas,r8a7792") ||
75 of_machine_is_compatible("renesas,r8a7794")) { 77 of_machine_is_compatible("renesas,r8a7794")) {
76 freq = 260000000 / 8; /* ZS / 8 */ 78 freq = 260000000 / 8; /* ZS / 8 */
77 /* CNTVOFF has to be initialized either from non-secure
78 * Hypervisor mode or secure Monitor mode with SCR.NS==1.
79 * If TrustZone is enabled then it should be handled by the
80 * secure code.
81 */
82 asm volatile(
83 " cps 0x16\n"
84 " mrc p15, 0, r1, c1, c1, 0\n"
85 " orr r0, r1, #1\n"
86 " mcr p15, 0, r0, c1, c1, 0\n"
87 " isb\n"
88 " mov r0, #0\n"
89 " mcrr p15, 4, r0, r0, c14\n"
90 " isb\n"
91 " mcr p15, 0, r1, c1, c1, 0\n"
92 " isb\n"
93 " cps 0x13\n"
94 : : : "r0", "r1");
95 } else { 79 } else {
96 /* At Linux boot time the r8a7790 arch timer comes up 80 /* At Linux boot time the r8a7790 arch timer comes up
97 * with the counter disabled. Moreover, it may also report 81 * with the counter disabled. Moreover, it may also report
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index 7ab353fb25f2..5e9602ce1573 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -65,6 +65,7 @@ static const char * const sun8i_board_dt_compat[] = {
65 "allwinner,sun8i-a83t", 65 "allwinner,sun8i-a83t",
66 "allwinner,sun8i-h2-plus", 66 "allwinner,sun8i-h2-plus",
67 "allwinner,sun8i-h3", 67 "allwinner,sun8i-h3",
68 "allwinner,sun8i-r40",
68 "allwinner,sun8i-v3s", 69 "allwinner,sun8i-v3s",
69 NULL, 70 NULL,
70}; 71};
diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c
index fe488523694c..21c064267af5 100644
--- a/arch/arm/mach-vexpress/spc.c
+++ b/arch/arm/mach-vexpress/spc.c
@@ -451,10 +451,8 @@ int __init ve_spc_init(void __iomem *baseaddr, u32 a15_clusid, int irq)
451{ 451{
452 int ret; 452 int ret;
453 info = kzalloc(sizeof(*info), GFP_KERNEL); 453 info = kzalloc(sizeof(*info), GFP_KERNEL);
454 if (!info) { 454 if (!info)
455 pr_err(SPCLOG "unable to allocate mem\n");
456 return -ENOMEM; 455 return -ENOMEM;
457 }
458 456
459 info->baseaddr = baseaddr; 457 info->baseaddr = baseaddr;
460 info->a15_clusid = a15_clusid; 458 info->a15_clusid = a15_clusid;
@@ -535,10 +533,8 @@ static struct clk *ve_spc_clk_register(struct device *cpu_dev)
535 struct clk_spc *spc; 533 struct clk_spc *spc;
536 534
537 spc = kzalloc(sizeof(*spc), GFP_KERNEL); 535 spc = kzalloc(sizeof(*spc), GFP_KERNEL);
538 if (!spc) { 536 if (!spc)
539 pr_err("could not allocate spc clk\n");
540 return ERR_PTR(-ENOMEM); 537 return ERR_PTR(-ENOMEM);
541 }
542 538
543 spc->hw.init = &init; 539 spc->hw.init = &init;
544 spc->cluster = topology_physical_package_id(cpu_dev->id); 540 spc->cluster = topology_physical_package_id(cpu_dev->id);
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 1e460b4ee3b9..d4012d6c0dcb 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1316,16 +1316,14 @@ static int omap_system_dma_probe(struct platform_device *pdev)
1316 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE; 1316 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE;
1317 1317
1318 dma_chan = devm_kcalloc(&pdev->dev, dma_lch_count, 1318 dma_chan = devm_kcalloc(&pdev->dev, dma_lch_count,
1319 sizeof(struct omap_dma_lch), GFP_KERNEL); 1319 sizeof(*dma_chan), GFP_KERNEL);
1320 if (!dma_chan) { 1320 if (!dma_chan)
1321 dev_err(&pdev->dev, "%s: kzalloc fail\n", __func__);
1322 return -ENOMEM; 1321 return -ENOMEM;
1323 }
1324
1325 1322
1326 if (dma_omap2plus()) { 1323 if (dma_omap2plus()) {
1327 dma_linked_lch = kzalloc(sizeof(struct dma_link_info) * 1324 dma_linked_lch = kcalloc(dma_lch_count,
1328 dma_lch_count, GFP_KERNEL); 1325 sizeof(*dma_linked_lch),
1326 GFP_KERNEL);
1329 if (!dma_linked_lch) { 1327 if (!dma_linked_lch) {
1330 ret = -ENOMEM; 1328 ret = -ENOMEM;
1331 goto exit_dma_lch_fail; 1329 goto exit_dma_lch_fail;
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 7a327bd32521..d443e481c3e9 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -254,8 +254,8 @@ static struct omap_dm_timer *_omap_dm_timer_request(int req_type, void *data)
254 if (cap == (t->capability & cap)) { 254 if (cap == (t->capability & cap)) {
255 /* 255 /*
256 * If timer is not NULL, we have already found 256 * If timer is not NULL, we have already found
257 * one timer but it was not an exact match 257 * one timer. But it was not an exact match
258 * because it had more capabilites that what 258 * because it had more capabilities than what
259 * was required. Therefore, unreserve the last 259 * was required. Therefore, unreserve the last
260 * timer found and see if this one is a better 260 * timer found and see if this one is a better
261 * match. 261 * match.
@@ -857,11 +857,9 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
857 return -ENODEV; 857 return -ENODEV;
858 } 858 }
859 859
860 timer = devm_kzalloc(dev, sizeof(struct omap_dm_timer), GFP_KERNEL); 860 timer = devm_kzalloc(dev, sizeof(*timer), GFP_KERNEL);
861 if (!timer) { 861 if (!timer)
862 dev_err(dev, "%s: memory alloc failed!\n", __func__);
863 return -ENOMEM; 862 return -ENOMEM;
864 }
865 863
866 timer->fclk = ERR_PTR(-ENODEV); 864 timer->fclk = ERR_PTR(-ENODEV);
867 timer->io_base = devm_ioremap_resource(dev, mem); 865 timer->io_base = devm_ioremap_resource(dev, mem);
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index daf3db9f0058..e9de9e92ce01 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -238,11 +238,9 @@ struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev,
238 if (!pdev) 238 if (!pdev)
239 return ERR_PTR(-EINVAL); 239 return ERR_PTR(-EINVAL);
240 240
241 client = kzalloc(sizeof(struct s3c_adc_client), GFP_KERNEL); 241 client = kzalloc(sizeof(*client), GFP_KERNEL);
242 if (!client) { 242 if (!client)
243 dev_err(&pdev->dev, "no memory for adc client\n");
244 return ERR_PTR(-ENOMEM); 243 return ERR_PTR(-ENOMEM);
245 }
246 244
247 client->pdev = pdev; 245 client->pdev = pdev;
248 client->is_ts = is_ts; 246 client->is_ts = is_ts;
@@ -344,11 +342,9 @@ static int s3c_adc_probe(struct platform_device *pdev)
344 int ret; 342 int ret;
345 unsigned tmp; 343 unsigned tmp;
346 344
347 adc = devm_kzalloc(dev, sizeof(struct adc_device), GFP_KERNEL); 345 adc = devm_kzalloc(dev, sizeof(*adc), GFP_KERNEL);
348 if (adc == NULL) { 346 if (!adc)
349 dev_err(dev, "failed to allocate adc_device\n");
350 return -ENOMEM; 347 return -ENOMEM;
351 }
352 348
353 spin_lock_init(&adc->lock); 349 spin_lock_init(&adc->lock);
354 350
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index dc269d9143bc..5668e4eb03df 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -339,8 +339,7 @@ void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
339 pd->bus_num = 0; 339 pd->bus_num = 0;
340 } 340 }
341 341
342 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), 342 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c0);
343 &s3c_device_i2c0);
344 343
345 if (!npd->cfg_gpio) 344 if (!npd->cfg_gpio)
346 npd->cfg_gpio = s3c_i2c0_cfg_gpio; 345 npd->cfg_gpio = s3c_i2c0_cfg_gpio;
@@ -368,8 +367,7 @@ void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
368 pd->bus_num = 1; 367 pd->bus_num = 1;
369 } 368 }
370 369
371 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), 370 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c1);
372 &s3c_device_i2c1);
373 371
374 if (!npd->cfg_gpio) 372 if (!npd->cfg_gpio)
375 npd->cfg_gpio = s3c_i2c1_cfg_gpio; 373 npd->cfg_gpio = s3c_i2c1_cfg_gpio;
@@ -398,8 +396,7 @@ void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd)
398 pd->bus_num = 2; 396 pd->bus_num = 2;
399 } 397 }
400 398
401 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), 399 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c2);
402 &s3c_device_i2c2);
403 400
404 if (!npd->cfg_gpio) 401 if (!npd->cfg_gpio)
405 npd->cfg_gpio = s3c_i2c2_cfg_gpio; 402 npd->cfg_gpio = s3c_i2c2_cfg_gpio;
@@ -428,8 +425,7 @@ void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
428 pd->bus_num = 3; 425 pd->bus_num = 3;
429 } 426 }
430 427
431 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), 428 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c3);
432 &s3c_device_i2c3);
433 429
434 if (!npd->cfg_gpio) 430 if (!npd->cfg_gpio)
435 npd->cfg_gpio = s3c_i2c3_cfg_gpio; 431 npd->cfg_gpio = s3c_i2c3_cfg_gpio;
@@ -458,8 +454,7 @@ void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
458 pd->bus_num = 4; 454 pd->bus_num = 4;
459 } 455 }
460 456
461 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), 457 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c4);
462 &s3c_device_i2c4);
463 458
464 if (!npd->cfg_gpio) 459 if (!npd->cfg_gpio)
465 npd->cfg_gpio = s3c_i2c4_cfg_gpio; 460 npd->cfg_gpio = s3c_i2c4_cfg_gpio;
@@ -488,8 +483,7 @@ void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
488 pd->bus_num = 5; 483 pd->bus_num = 5;
489 } 484 }
490 485
491 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), 486 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c5);
492 &s3c_device_i2c5);
493 487
494 if (!npd->cfg_gpio) 488 if (!npd->cfg_gpio)
495 npd->cfg_gpio = s3c_i2c5_cfg_gpio; 489 npd->cfg_gpio = s3c_i2c5_cfg_gpio;
@@ -518,8 +512,7 @@ void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
518 pd->bus_num = 6; 512 pd->bus_num = 6;
519 } 513 }
520 514
521 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), 515 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c6);
522 &s3c_device_i2c6);
523 516
524 if (!npd->cfg_gpio) 517 if (!npd->cfg_gpio)
525 npd->cfg_gpio = s3c_i2c6_cfg_gpio; 518 npd->cfg_gpio = s3c_i2c6_cfg_gpio;
@@ -548,8 +541,7 @@ void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
548 pd->bus_num = 7; 541 pd->bus_num = 7;
549 } 542 }
550 543
551 npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), 544 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_i2c7);
552 &s3c_device_i2c7);
553 545
554 if (!npd->cfg_gpio) 546 if (!npd->cfg_gpio)
555 npd->cfg_gpio = s3c_i2c7_cfg_gpio; 547 npd->cfg_gpio = s3c_i2c7_cfg_gpio;
@@ -615,8 +607,7 @@ void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
615{ 607{
616 struct samsung_keypad_platdata *npd; 608 struct samsung_keypad_platdata *npd;
617 609
618 npd = s3c_set_platdata(pd, sizeof(struct samsung_keypad_platdata), 610 npd = s3c_set_platdata(pd, sizeof(*npd), &samsung_device_keypad);
619 &samsung_device_keypad);
620 611
621 if (!npd->cfg_gpio) 612 if (!npd->cfg_gpio)
622 npd->cfg_gpio = samsung_keypad_cfg_gpio; 613 npd->cfg_gpio = samsung_keypad_cfg_gpio;
@@ -721,8 +712,7 @@ void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
721 * time then there is little chance the system is going to run. 712 * time then there is little chance the system is going to run.
722 */ 713 */
723 714
724 npd = s3c_set_platdata(nand, sizeof(struct s3c2410_platform_nand), 715 npd = s3c_set_platdata(nand, sizeof(*npd), &s3c_device_nand);
725 &s3c_device_nand);
726 if (!npd) 716 if (!npd)
727 return; 717 return;
728 718
@@ -1022,8 +1012,7 @@ void __init dwc2_hsotg_set_platdata(struct dwc2_hsotg_plat *pd)
1022{ 1012{
1023 struct dwc2_hsotg_plat *npd; 1013 struct dwc2_hsotg_plat *npd;
1024 1014
1025 npd = s3c_set_platdata(pd, sizeof(struct dwc2_hsotg_plat), 1015 npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_usb_hsotg);
1026 &s3c_device_usb_hsotg);
1027 1016
1028 if (!npd->phy_init) 1017 if (!npd->phy_init)
1029 npd->phy_init = s5p_usb_phy_init; 1018 npd->phy_init = s5p_usb_phy_init;
diff --git a/arch/arm/plat-samsung/platformdata.c b/arch/arm/plat-samsung/platformdata.c
index b430e9946287..6cf52ee7eeec 100644
--- a/arch/arm/plat-samsung/platformdata.c
+++ b/arch/arm/plat-samsung/platformdata.c
@@ -29,10 +29,8 @@ void __init *s3c_set_platdata(void *pd, size_t pdsize,
29 } 29 }
30 30
31 npd = kmemdup(pd, pdsize, GFP_KERNEL); 31 npd = kmemdup(pd, pdsize, GFP_KERNEL);
32 if (!npd) { 32 if (!npd)
33 printk(KERN_ERR "%s: cannot clone platform data\n", pdev->name);
34 return NULL; 33 return NULL;
35 }
36 34
37 pdev->dev.platform_data = npd; 35 pdev->dev.platform_data = npd;
38 return npd; 36 return npd;
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 34480e9af2e7..6356c6da34ea 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -51,6 +51,8 @@ CONFIG_ARCH_SEATTLE=y
51CONFIG_ARCH_RENESAS=y 51CONFIG_ARCH_RENESAS=y
52CONFIG_ARCH_R8A7795=y 52CONFIG_ARCH_R8A7795=y
53CONFIG_ARCH_R8A7796=y 53CONFIG_ARCH_R8A7796=y
54CONFIG_ARCH_R8A77970=y
55CONFIG_ARCH_R8A77995=y
54CONFIG_ARCH_STRATIX10=y 56CONFIG_ARCH_STRATIX10=y
55CONFIG_ARCH_TEGRA=y 57CONFIG_ARCH_TEGRA=y
56CONFIG_ARCH_SPRD=y 58CONFIG_ARCH_SPRD=y
@@ -72,10 +74,13 @@ CONFIG_PCIE_QCOM=y
72CONFIG_PCIE_KIRIN=y 74CONFIG_PCIE_KIRIN=y
73CONFIG_PCIE_ARMADA_8K=y 75CONFIG_PCIE_ARMADA_8K=y
74CONFIG_PCI_AARDVARK=y 76CONFIG_PCI_AARDVARK=y
77CONFIG_PCI_TEGRA=y
75CONFIG_PCIE_RCAR=y 78CONFIG_PCIE_RCAR=y
76CONFIG_PCIE_ROCKCHIP=m 79CONFIG_PCIE_ROCKCHIP=m
77CONFIG_PCI_HOST_GENERIC=y 80CONFIG_PCI_HOST_GENERIC=y
78CONFIG_PCI_XGENE=y 81CONFIG_PCI_XGENE=y
82CONFIG_PCI_HOST_THUNDER_PEM=y
83CONFIG_PCI_HOST_THUNDER_ECAM=y
79CONFIG_ARM64_VA_BITS_48=y 84CONFIG_ARM64_VA_BITS_48=y
80CONFIG_SCHED_MC=y 85CONFIG_SCHED_MC=y
81CONFIG_NUMA=y 86CONFIG_NUMA=y
@@ -156,6 +161,7 @@ CONFIG_MTD_BLOCK=y
156CONFIG_MTD_M25P80=y 161CONFIG_MTD_M25P80=y
157CONFIG_MTD_NAND=y 162CONFIG_MTD_NAND=y
158CONFIG_MTD_NAND_DENALI_DT=y 163CONFIG_MTD_NAND_DENALI_DT=y
164CONFIG_MTD_NAND_PXA3xx=y
159CONFIG_MTD_SPI_NOR=y 165CONFIG_MTD_SPI_NOR=y
160CONFIG_BLK_DEV_LOOP=y 166CONFIG_BLK_DEV_LOOP=y
161CONFIG_BLK_DEV_NBD=m 167CONFIG_BLK_DEV_NBD=m
@@ -188,6 +194,7 @@ CONFIG_VIRTIO_NET=y
188CONFIG_AMD_XGBE=y 194CONFIG_AMD_XGBE=y
189CONFIG_NET_XGENE=y 195CONFIG_NET_XGENE=y
190CONFIG_MACB=y 196CONFIG_MACB=y
197CONFIG_THUNDER_NIC_PF=y
191CONFIG_HNS_DSAF=y 198CONFIG_HNS_DSAF=y
192CONFIG_HNS_ENET=y 199CONFIG_HNS_ENET=y
193CONFIG_E1000E=y 200CONFIG_E1000E=y
@@ -204,6 +211,7 @@ CONFIG_STMMAC_ETH=m
204CONFIG_MDIO_BUS_MUX_MMIOREG=y 211CONFIG_MDIO_BUS_MUX_MMIOREG=y
205CONFIG_AT803X_PHY=m 212CONFIG_AT803X_PHY=m
206CONFIG_MARVELL_PHY=m 213CONFIG_MARVELL_PHY=m
214CONFIG_MARVELL_10G_PHY=m
207CONFIG_MESON_GXL_PHY=m 215CONFIG_MESON_GXL_PHY=m
208CONFIG_MICREL_PHY=y 216CONFIG_MICREL_PHY=y
209CONFIG_REALTEK_PHY=m 217CONFIG_REALTEK_PHY=m
@@ -297,6 +305,7 @@ CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
297CONFIG_GPIO_DWAPB=y 305CONFIG_GPIO_DWAPB=y
298CONFIG_GPIO_PL061=y 306CONFIG_GPIO_PL061=y
299CONFIG_GPIO_RCAR=y 307CONFIG_GPIO_RCAR=y
308CONFIG_GPIO_UNIPHIER=y
300CONFIG_GPIO_XGENE=y 309CONFIG_GPIO_XGENE=y
301CONFIG_GPIO_XGENE_SB=y 310CONFIG_GPIO_XGENE_SB=y
302CONFIG_GPIO_PCA953X=y 311CONFIG_GPIO_PCA953X=y
@@ -315,6 +324,7 @@ CONFIG_CPU_THERMAL=y
315CONFIG_THERMAL_EMULATION=y 324CONFIG_THERMAL_EMULATION=y
316CONFIG_BRCMSTB_THERMAL=m 325CONFIG_BRCMSTB_THERMAL=m
317CONFIG_EXYNOS_THERMAL=y 326CONFIG_EXYNOS_THERMAL=y
327CONFIG_RCAR_GEN3_THERMAL=y
318CONFIG_ROCKCHIP_THERMAL=m 328CONFIG_ROCKCHIP_THERMAL=m
319CONFIG_WATCHDOG=y 329CONFIG_WATCHDOG=y
320CONFIG_S3C2410_WATCHDOG=y 330CONFIG_S3C2410_WATCHDOG=y
@@ -386,6 +396,7 @@ CONFIG_DRM_TEGRA=m
386CONFIG_DRM_PANEL_SIMPLE=m 396CONFIG_DRM_PANEL_SIMPLE=m
387CONFIG_DRM_I2C_ADV7511=m 397CONFIG_DRM_I2C_ADV7511=m
388CONFIG_DRM_VC4=m 398CONFIG_DRM_VC4=m
399CONFIG_DRM_HISI_HIBMC=m
389CONFIG_DRM_HISI_KIRIN=m 400CONFIG_DRM_HISI_KIRIN=m
390CONFIG_DRM_MESON=m 401CONFIG_DRM_MESON=m
391CONFIG_FB=y 402CONFIG_FB=y
@@ -423,6 +434,7 @@ CONFIG_USB_DWC2=y
423CONFIG_USB_CHIPIDEA=y 434CONFIG_USB_CHIPIDEA=y
424CONFIG_USB_CHIPIDEA_UDC=y 435CONFIG_USB_CHIPIDEA_UDC=y
425CONFIG_USB_CHIPIDEA_HOST=y 436CONFIG_USB_CHIPIDEA_HOST=y
437CONFIG_USB_CHIPIDEA_ULPI=y
426CONFIG_USB_ISP1760=y 438CONFIG_USB_ISP1760=y
427CONFIG_USB_HSIC_USB3503=y 439CONFIG_USB_HSIC_USB3503=y
428CONFIG_NOP_USB_XCEIV=y 440CONFIG_NOP_USB_XCEIV=y
@@ -431,6 +443,7 @@ CONFIG_USB_QCOM_8X16_PHY=y
431CONFIG_USB_ULPI=y 443CONFIG_USB_ULPI=y
432CONFIG_USB_GADGET=y 444CONFIG_USB_GADGET=y
433CONFIG_USB_RENESAS_USBHS_UDC=m 445CONFIG_USB_RENESAS_USBHS_UDC=m
446CONFIG_USB_ULPI_BUS=y
434CONFIG_MMC=y 447CONFIG_MMC=y
435CONFIG_MMC_BLOCK_MINORS=32 448CONFIG_MMC_BLOCK_MINORS=32
436CONFIG_MMC_ARMMMCI=y 449CONFIG_MMC_ARMMMCI=y
@@ -470,6 +483,7 @@ CONFIG_RTC_DRV_EFI=y
470CONFIG_RTC_DRV_S3C=y 483CONFIG_RTC_DRV_S3C=y
471CONFIG_RTC_DRV_PL031=y 484CONFIG_RTC_DRV_PL031=y
472CONFIG_RTC_DRV_SUN6I=y 485CONFIG_RTC_DRV_SUN6I=y
486CONFIG_RTC_DRV_ARMADA38X=y
473CONFIG_RTC_DRV_TEGRA=y 487CONFIG_RTC_DRV_TEGRA=y
474CONFIG_RTC_DRV_XGENE=y 488CONFIG_RTC_DRV_XGENE=y
475CONFIG_DMADEVICES=y 489CONFIG_DMADEVICES=y
@@ -510,6 +524,7 @@ CONFIG_HI6220_MBOX=y
510CONFIG_ROCKCHIP_IOMMU=y 524CONFIG_ROCKCHIP_IOMMU=y
511CONFIG_ARM_SMMU=y 525CONFIG_ARM_SMMU=y
512CONFIG_ARM_SMMU_V3=y 526CONFIG_ARM_SMMU_V3=y
527CONFIG_QCOM_IOMMU=y
513CONFIG_RPMSG_QCOM_SMD=y 528CONFIG_RPMSG_QCOM_SMD=y
514CONFIG_RASPBERRYPI_POWER=y 529CONFIG_RASPBERRYPI_POWER=y
515CONFIG_QCOM_SMEM=y 530CONFIG_QCOM_SMEM=y
@@ -533,7 +548,9 @@ CONFIG_PWM_SAMSUNG=y
533CONFIG_PWM_TEGRA=m 548CONFIG_PWM_TEGRA=m
534CONFIG_PHY_RCAR_GEN3_USB2=y 549CONFIG_PHY_RCAR_GEN3_USB2=y
535CONFIG_PHY_HI6220_USB=y 550CONFIG_PHY_HI6220_USB=y
551CONFIG_PHY_QCOM_USB_HS=y
536CONFIG_PHY_SUN4I_USB=y 552CONFIG_PHY_SUN4I_USB=y
553CONFIG_PHY_MVEBU_CP110_COMPHY=y
537CONFIG_PHY_ROCKCHIP_INNO_USB2=y 554CONFIG_PHY_ROCKCHIP_INNO_USB2=y
538CONFIG_PHY_ROCKCHIP_EMMC=y 555CONFIG_PHY_ROCKCHIP_EMMC=y
539CONFIG_PHY_ROCKCHIP_PCIE=m 556CONFIG_PHY_ROCKCHIP_PCIE=m
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 3e66f4cc1a59..fa94a85bf410 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -158,6 +158,13 @@ config TEGRA_GMI
158 Driver for the Tegra Generic Memory Interface bus which can be used 158 Driver for the Tegra Generic Memory Interface bus which can be used
159 to attach devices such as NOR, UART, FPGA and more. 159 to attach devices such as NOR, UART, FPGA and more.
160 160
161config TI_SYSC
162 bool "TI sysc interconnect target module driver"
163 depends on ARCH_OMAP2PLUS
164 help
165 Generic driver for Texas Instruments interconnect target module
166 found on many TI SoCs.
167
161config UNIPHIER_SYSTEM_BUS 168config UNIPHIER_SYSTEM_BUS
162 tristate "UniPhier System Bus driver" 169 tristate "UniPhier System Bus driver"
163 depends on ARCH_UNIPHIER && OF 170 depends on ARCH_UNIPHIER && OF
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index 3ae96cffabd5..94a079008cbe 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -21,6 +21,7 @@ obj-$(CONFIG_SUNXI_RSB) += sunxi-rsb.o
21obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o 21obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o
22obj-$(CONFIG_TEGRA_ACONNECT) += tegra-aconnect.o 22obj-$(CONFIG_TEGRA_ACONNECT) += tegra-aconnect.o
23obj-$(CONFIG_TEGRA_GMI) += tegra-gmi.o 23obj-$(CONFIG_TEGRA_GMI) += tegra-gmi.o
24obj-$(CONFIG_TI_SYSC) += ti-sysc.o
24obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o 25obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o
25obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress-config.o 26obj-$(CONFIG_VEXPRESS_CONFIG) += vexpress-config.o
26 27
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
new file mode 100644
index 000000000000..c3c76a1ea8a8
--- /dev/null
+++ b/drivers/bus/ti-sysc.c
@@ -0,0 +1,583 @@
1/*
2 * ti-sysc.c - Texas Instruments sysc interconnect target driver
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#include <linux/io.h>
15#include <linux/clk.h>
16#include <linux/module.h>
17#include <linux/platform_device.h>
18#include <linux/pm_runtime.h>
19#include <linux/of_address.h>
20#include <linux/of_platform.h>
21
22enum sysc_registers {
23 SYSC_REVISION,
24 SYSC_SYSCONFIG,
25 SYSC_SYSSTATUS,
26 SYSC_MAX_REGS,
27};
28
29static const char * const reg_names[] = { "rev", "sysc", "syss", };
30
31enum sysc_clocks {
32 SYSC_FCK,
33 SYSC_ICK,
34 SYSC_MAX_CLOCKS,
35};
36
37static const char * const clock_names[] = { "fck", "ick", };
38
39/**
40 * struct sysc - TI sysc interconnect target module registers and capabilities
41 * @dev: struct device pointer
42 * @module_pa: physical address of the interconnect target module
43 * @module_size: size of the interconnect target module
44 * @module_va: virtual address of the interconnect target module
45 * @offsets: register offsets from module base
46 * @clocks: clocks used by the interconnect target module
47 * @legacy_mode: configured for legacy mode if set
48 */
49struct sysc {
50 struct device *dev;
51 u64 module_pa;
52 u32 module_size;
53 void __iomem *module_va;
54 int offsets[SYSC_MAX_REGS];
55 struct clk *clocks[SYSC_MAX_CLOCKS];
56 const char *legacy_mode;
57};
58
59static u32 sysc_read_revision(struct sysc *ddata)
60{
61 return readl_relaxed(ddata->module_va +
62 ddata->offsets[SYSC_REVISION]);
63}
64
65static int sysc_get_one_clock(struct sysc *ddata,
66 enum sysc_clocks index)
67{
68 const char *name;
69 int error;
70
71 switch (index) {
72 case SYSC_FCK:
73 break;
74 case SYSC_ICK:
75 break;
76 default:
77 return -EINVAL;
78 }
79 name = clock_names[index];
80
81 ddata->clocks[index] = devm_clk_get(ddata->dev, name);
82 if (IS_ERR(ddata->clocks[index])) {
83 if (PTR_ERR(ddata->clocks[index]) == -ENOENT)
84 return 0;
85
86 dev_err(ddata->dev, "clock get error for %s: %li\n",
87 name, PTR_ERR(ddata->clocks[index]));
88
89 return PTR_ERR(ddata->clocks[index]);
90 }
91
92 error = clk_prepare(ddata->clocks[index]);
93 if (error) {
94 dev_err(ddata->dev, "clock prepare error for %s: %i\n",
95 name, error);
96
97 return error;
98 }
99
100 return 0;
101}
102
103static int sysc_get_clocks(struct sysc *ddata)
104{
105 int i, error;
106
107 if (ddata->legacy_mode)
108 return 0;
109
110 for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
111 error = sysc_get_one_clock(ddata, i);
112 if (error && error != -ENOENT)
113 return error;
114 }
115
116 return 0;
117}
118
119/**
120 * sysc_parse_and_check_child_range - parses module IO region from ranges
121 * @ddata: device driver data
122 *
123 * In general we only need rev, syss, and sysc registers and not the whole
124 * module range. But we do want the offsets for these registers from the
125 * module base. This allows us to check them against the legacy hwmod
126 * platform data. Let's also check the ranges are configured properly.
127 */
128static int sysc_parse_and_check_child_range(struct sysc *ddata)
129{
130 struct device_node *np = ddata->dev->of_node;
131 const __be32 *ranges;
132 u32 nr_addr, nr_size;
133 int len, error;
134
135 ranges = of_get_property(np, "ranges", &len);
136 if (!ranges) {
137 dev_err(ddata->dev, "missing ranges for %pOF\n", np);
138
139 return -ENOENT;
140 }
141
142 len /= sizeof(*ranges);
143
144 if (len < 3) {
145 dev_err(ddata->dev, "incomplete ranges for %pOF\n", np);
146
147 return -EINVAL;
148 }
149
150 error = of_property_read_u32(np, "#address-cells", &nr_addr);
151 if (error)
152 return -ENOENT;
153
154 error = of_property_read_u32(np, "#size-cells", &nr_size);
155 if (error)
156 return -ENOENT;
157
158 if (nr_addr != 1 || nr_size != 1) {
159 dev_err(ddata->dev, "invalid ranges for %pOF\n", np);
160
161 return -EINVAL;
162 }
163
164 ranges++;
165 ddata->module_pa = of_translate_address(np, ranges++);
166 ddata->module_size = be32_to_cpup(ranges);
167
168 dev_dbg(ddata->dev, "interconnect target 0x%llx size 0x%x for %pOF\n",
169 ddata->module_pa, ddata->module_size, np);
170
171 return 0;
172}
173
174/**
175 * sysc_check_one_child - check child configuration
176 * @ddata: device driver data
177 * @np: child device node
178 *
179 * Let's avoid messy situations where we have new interconnect target
180 * node but children have "ti,hwmods". These belong to the interconnect
181 * target node and are managed by this driver.
182 */
183static int sysc_check_one_child(struct sysc *ddata,
184 struct device_node *np)
185{
186 const char *name;
187
188 name = of_get_property(np, "ti,hwmods", NULL);
189 if (name)
190 dev_warn(ddata->dev, "really a child ti,hwmods property?");
191
192 return 0;
193}
194
195static int sysc_check_children(struct sysc *ddata)
196{
197 struct device_node *child;
198 int error;
199
200 for_each_child_of_node(ddata->dev->of_node, child) {
201 error = sysc_check_one_child(ddata, child);
202 if (error)
203 return error;
204 }
205
206 return 0;
207}
208
209/**
210 * sysc_parse_one - parses the interconnect target module registers
211 * @ddata: device driver data
212 * @reg: register to parse
213 */
214static int sysc_parse_one(struct sysc *ddata, enum sysc_registers reg)
215{
216 struct resource *res;
217 const char *name;
218
219 switch (reg) {
220 case SYSC_REVISION:
221 case SYSC_SYSCONFIG:
222 case SYSC_SYSSTATUS:
223 name = reg_names[reg];
224 break;
225 default:
226 return -EINVAL;
227 }
228
229 res = platform_get_resource_byname(to_platform_device(ddata->dev),
230 IORESOURCE_MEM, name);
231 if (!res) {
232 dev_dbg(ddata->dev, "has no %s register\n", name);
233 ddata->offsets[reg] = -ENODEV;
234
235 return 0;
236 }
237
238 ddata->offsets[reg] = res->start - ddata->module_pa;
239
240 return 0;
241}
242
243static int sysc_parse_registers(struct sysc *ddata)
244{
245 int i, error;
246
247 for (i = 0; i < SYSC_MAX_REGS; i++) {
248 error = sysc_parse_one(ddata, i);
249 if (error)
250 return error;
251 }
252
253 return 0;
254}
255
256/**
257 * sysc_check_registers - check for misconfigured register overlaps
258 * @ddata: device driver data
259 */
260static int sysc_check_registers(struct sysc *ddata)
261{
262 int i, j, nr_regs = 0, nr_matches = 0;
263
264 for (i = 0; i < SYSC_MAX_REGS; i++) {
265 if (ddata->offsets[i] < 0)
266 continue;
267
268 if (ddata->offsets[i] > (ddata->module_size - 4)) {
269 dev_err(ddata->dev, "register outside module range");
270
271 return -EINVAL;
272 }
273
274 for (j = 0; j < SYSC_MAX_REGS; j++) {
275 if (ddata->offsets[j] < 0)
276 continue;
277
278 if (ddata->offsets[i] == ddata->offsets[j])
279 nr_matches++;
280 }
281 nr_regs++;
282 }
283
284 if (nr_regs < 1) {
285 dev_err(ddata->dev, "missing registers\n");
286
287 return -EINVAL;
288 }
289
290 if (nr_matches > nr_regs) {
291 dev_err(ddata->dev, "overlapping registers: (%i/%i)",
292 nr_regs, nr_matches);
293
294 return -EINVAL;
295 }
296
297 return 0;
298}
299
300/**
301 * syc_ioremap - ioremap register space for the interconnect target module
302 * @ddata: deviec driver data
303 *
304 * Note that the interconnect target module registers can be anywhere
305 * within the first child device address space. For example, SGX has
306 * them at offset 0x1fc00 in the 32MB module address space. We just
307 * what we need around the interconnect target module registers.
308 */
309static int sysc_ioremap(struct sysc *ddata)
310{
311 u32 size = 0;
312
313 if (ddata->offsets[SYSC_SYSSTATUS] >= 0)
314 size = ddata->offsets[SYSC_SYSSTATUS];
315 else if (ddata->offsets[SYSC_SYSCONFIG] >= 0)
316 size = ddata->offsets[SYSC_SYSCONFIG];
317 else if (ddata->offsets[SYSC_REVISION] >= 0)
318 size = ddata->offsets[SYSC_REVISION];
319 else
320 return -EINVAL;
321
322 size &= 0xfff00;
323 size += SZ_256;
324
325 ddata->module_va = devm_ioremap(ddata->dev,
326 ddata->module_pa,
327 size);
328 if (!ddata->module_va)
329 return -EIO;
330
331 return 0;
332}
333
334/**
335 * sysc_map_and_check_registers - ioremap and check device registers
336 * @ddata: device driver data
337 */
338static int sysc_map_and_check_registers(struct sysc *ddata)
339{
340 int error;
341
342 error = sysc_parse_and_check_child_range(ddata);
343 if (error)
344 return error;
345
346 error = sysc_check_children(ddata);
347 if (error)
348 return error;
349
350 error = sysc_parse_registers(ddata);
351 if (error)
352 return error;
353
354 error = sysc_ioremap(ddata);
355 if (error)
356 return error;
357
358 error = sysc_check_registers(ddata);
359 if (error)
360 return error;
361
362 return 0;
363}
364
365/**
366 * sysc_show_rev - read and show interconnect target module revision
367 * @bufp: buffer to print the information to
368 * @ddata: device driver data
369 */
370static int sysc_show_rev(char *bufp, struct sysc *ddata)
371{
372 int error, len;
373
374 if (ddata->offsets[SYSC_REVISION] < 0)
375 return sprintf(bufp, ":NA");
376
377 error = pm_runtime_get_sync(ddata->dev);
378 if (error < 0) {
379 pm_runtime_put_noidle(ddata->dev);
380
381 return 0;
382 }
383
384 len = sprintf(bufp, ":%08x", sysc_read_revision(ddata));
385
386 pm_runtime_mark_last_busy(ddata->dev);
387 pm_runtime_put_autosuspend(ddata->dev);
388
389 return len;
390}
391
392static int sysc_show_reg(struct sysc *ddata,
393 char *bufp, enum sysc_registers reg)
394{
395 if (ddata->offsets[reg] < 0)
396 return sprintf(bufp, ":NA");
397
398 return sprintf(bufp, ":%x", ddata->offsets[reg]);
399}
400
401/**
402 * sysc_show_registers - show information about interconnect target module
403 * @ddata: device driver data
404 */
405static void sysc_show_registers(struct sysc *ddata)
406{
407 char buf[128];
408 char *bufp = buf;
409 int i;
410
411 for (i = 0; i < SYSC_MAX_REGS; i++)
412 bufp += sysc_show_reg(ddata, bufp, i);
413
414 bufp += sysc_show_rev(bufp, ddata);
415
416 dev_dbg(ddata->dev, "%llx:%x%s\n",
417 ddata->module_pa, ddata->module_size,
418 buf);
419}
420
421static int __maybe_unused sysc_runtime_suspend(struct device *dev)
422{
423 struct sysc *ddata;
424 int i;
425
426 ddata = dev_get_drvdata(dev);
427
428 if (ddata->legacy_mode)
429 return 0;
430
431 for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
432 if (IS_ERR_OR_NULL(ddata->clocks[i]))
433 continue;
434 clk_disable(ddata->clocks[i]);
435 }
436
437 return 0;
438}
439
440static int __maybe_unused sysc_runtime_resume(struct device *dev)
441{
442 struct sysc *ddata;
443 int i, error;
444
445 ddata = dev_get_drvdata(dev);
446
447 if (ddata->legacy_mode)
448 return 0;
449
450 for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
451 if (IS_ERR_OR_NULL(ddata->clocks[i]))
452 continue;
453 error = clk_enable(ddata->clocks[i]);
454 if (error)
455 return error;
456 }
457
458 return 0;
459}
460
461static const struct dev_pm_ops sysc_pm_ops = {
462 SET_RUNTIME_PM_OPS(sysc_runtime_suspend,
463 sysc_runtime_resume,
464 NULL)
465};
466
467static void sysc_unprepare(struct sysc *ddata)
468{
469 int i;
470
471 for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
472 if (!IS_ERR_OR_NULL(ddata->clocks[i]))
473 clk_unprepare(ddata->clocks[i]);
474 }
475}
476
477static int sysc_probe(struct platform_device *pdev)
478{
479 struct device_node *np = pdev->dev.of_node;
480 struct sysc *ddata;
481 int error;
482
483 ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
484 if (!ddata)
485 return -ENOMEM;
486
487 ddata->dev = &pdev->dev;
488 ddata->legacy_mode = of_get_property(np, "ti,hwmods", NULL);
489
490 error = sysc_get_clocks(ddata);
491 if (error)
492 return error;
493
494 error = sysc_map_and_check_registers(ddata);
495 if (error)
496 goto unprepare;
497
498 platform_set_drvdata(pdev, ddata);
499
500 pm_runtime_enable(ddata->dev);
501 error = pm_runtime_get_sync(ddata->dev);
502 if (error < 0) {
503 pm_runtime_put_noidle(ddata->dev);
504 pm_runtime_disable(ddata->dev);
505 goto unprepare;
506 }
507
508 pm_runtime_use_autosuspend(ddata->dev);
509
510 sysc_show_registers(ddata);
511
512 error = of_platform_populate(ddata->dev->of_node,
513 NULL, NULL, ddata->dev);
514 if (error)
515 goto err;
516
517 pm_runtime_mark_last_busy(ddata->dev);
518 pm_runtime_put_autosuspend(ddata->dev);
519
520 return 0;
521
522err:
523 pm_runtime_dont_use_autosuspend(&pdev->dev);
524 pm_runtime_put_sync(&pdev->dev);
525 pm_runtime_disable(&pdev->dev);
526unprepare:
527 sysc_unprepare(ddata);
528
529 return error;
530}
531
532static int sysc_remove(struct platform_device *pdev)
533{
534 struct sysc *ddata = platform_get_drvdata(pdev);
535 int error;
536
537 error = pm_runtime_get_sync(ddata->dev);
538 if (error < 0) {
539 pm_runtime_put_noidle(ddata->dev);
540 pm_runtime_disable(ddata->dev);
541 goto unprepare;
542 }
543
544 of_platform_depopulate(&pdev->dev);
545
546 pm_runtime_dont_use_autosuspend(&pdev->dev);
547 pm_runtime_put_sync(&pdev->dev);
548 pm_runtime_disable(&pdev->dev);
549
550unprepare:
551 sysc_unprepare(ddata);
552
553 return 0;
554}
555
556static const struct of_device_id sysc_match[] = {
557 { .compatible = "ti,sysc-omap2" },
558 { .compatible = "ti,sysc-omap4" },
559 { .compatible = "ti,sysc-omap4-simple" },
560 { .compatible = "ti,sysc-omap3430-sr" },
561 { .compatible = "ti,sysc-omap3630-sr" },
562 { .compatible = "ti,sysc-omap4-sr" },
563 { .compatible = "ti,sysc-omap3-sham" },
564 { .compatible = "ti,sysc-omap-aes" },
565 { .compatible = "ti,sysc-mcasp" },
566 { .compatible = "ti,sysc-usb-host-fs" },
567 { },
568};
569MODULE_DEVICE_TABLE(of, sysc_match);
570
571static struct platform_driver sysc_driver = {
572 .probe = sysc_probe,
573 .remove = sysc_remove,
574 .driver = {
575 .name = "ti-sysc",
576 .of_match_table = sysc_match,
577 .pm = &sysc_pm_ops,
578 },
579};
580module_platform_driver(sysc_driver);
581
582MODULE_DESCRIPTION("TI sysc interconnect target driver");
583MODULE_LICENSE("GPL v2");
diff --git a/drivers/clk/bcm/clk-bcm2835-aux.c b/drivers/clk/bcm/clk-bcm2835-aux.c
index bd750cf2238d..77e276d61702 100644
--- a/drivers/clk/bcm/clk-bcm2835-aux.c
+++ b/drivers/clk/bcm/clk-bcm2835-aux.c
@@ -14,7 +14,6 @@
14 14
15#include <linux/clk.h> 15#include <linux/clk.h>
16#include <linux/clk-provider.h> 16#include <linux/clk-provider.h>
17#include <linux/clk/bcm2835.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/platform_device.h> 18#include <linux/platform_device.h>
20#include <dt-bindings/clock/bcm2835-aux.h> 19#include <dt-bindings/clock/bcm2835-aux.h>
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c
index 58ce6af8452d..44301a3d9963 100644
--- a/drivers/clk/bcm/clk-bcm2835.c
+++ b/drivers/clk/bcm/clk-bcm2835.c
@@ -37,7 +37,6 @@
37#include <linux/clk-provider.h> 37#include <linux/clk-provider.h>
38#include <linux/clkdev.h> 38#include <linux/clkdev.h>
39#include <linux/clk.h> 39#include <linux/clk.h>
40#include <linux/clk/bcm2835.h>
41#include <linux/debugfs.h> 40#include <linux/debugfs.h>
42#include <linux/delay.h> 41#include <linux/delay.h>
43#include <linux/module.h> 42#include <linux/module.h>
@@ -416,35 +415,6 @@ static int bcm2835_debugfs_regset(struct bcm2835_cprman *cprman, u32 base,
416 return regdump ? 0 : -ENOMEM; 415 return regdump ? 0 : -ENOMEM;
417} 416}
418 417
419/*
420 * These are fixed clocks. They're probably not all root clocks and it may
421 * be possible to turn them on and off but until this is mapped out better
422 * it's the only way they can be used.
423 */
424void __init bcm2835_init_clocks(void)
425{
426 struct clk_hw *hw;
427 int ret;
428
429 hw = clk_hw_register_fixed_rate(NULL, "apb_pclk", NULL, 0, 126000000);
430 if (IS_ERR(hw))
431 pr_err("apb_pclk not registered\n");
432
433 hw = clk_hw_register_fixed_rate(NULL, "uart0_pclk", NULL, 0, 3000000);
434 if (IS_ERR(hw))
435 pr_err("uart0_pclk not registered\n");
436 ret = clk_hw_register_clkdev(hw, NULL, "20201000.uart");
437 if (ret)
438 pr_err("uart0_pclk alias not registered\n");
439
440 hw = clk_hw_register_fixed_rate(NULL, "uart1_pclk", NULL, 0, 125000000);
441 if (IS_ERR(hw))
442 pr_err("uart1_pclk not registered\n");
443 ret = clk_hw_register_clkdev(hw, NULL, "20215000.uart");
444 if (ret)
445 pr_err("uart1_pclk alias not registered\n");
446}
447
448struct bcm2835_pll_data { 418struct bcm2835_pll_data {
449 const char *name; 419 const char *name;
450 u32 cm_ctrl_reg; 420 u32 cm_ctrl_reg;
diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c
index dc8c1e3eafe7..667b9e14b032 100644
--- a/drivers/irqchip/irq-bcm2836.c
+++ b/drivers/irqchip/irq-bcm2836.c
@@ -19,62 +19,9 @@
19#include <linux/of_irq.h> 19#include <linux/of_irq.h>
20#include <linux/irqchip.h> 20#include <linux/irqchip.h>
21#include <linux/irqdomain.h> 21#include <linux/irqdomain.h>
22#include <asm/exception.h> 22#include <linux/irqchip/irq-bcm2836.h>
23
24#define LOCAL_CONTROL 0x000
25#define LOCAL_PRESCALER 0x008
26 23
27/* 24#include <asm/exception.h>
28 * The low 2 bits identify the CPU that the GPU IRQ goes to, and the
29 * next 2 bits identify the CPU that the GPU FIQ goes to.
30 */
31#define LOCAL_GPU_ROUTING 0x00c
32/* When setting bits 0-3, enables PMU interrupts on that CPU. */
33#define LOCAL_PM_ROUTING_SET 0x010
34/* When setting bits 0-3, disables PMU interrupts on that CPU. */
35#define LOCAL_PM_ROUTING_CLR 0x014
36/*
37 * The low 4 bits of this are the CPU's timer IRQ enables, and the
38 * next 4 bits are the CPU's timer FIQ enables (which override the IRQ
39 * bits).
40 */
41#define LOCAL_TIMER_INT_CONTROL0 0x040
42/*
43 * The low 4 bits of this are the CPU's per-mailbox IRQ enables, and
44 * the next 4 bits are the CPU's per-mailbox FIQ enables (which
45 * override the IRQ bits).
46 */
47#define LOCAL_MAILBOX_INT_CONTROL0 0x050
48/*
49 * The CPU's interrupt status register. Bits are defined by the the
50 * LOCAL_IRQ_* bits below.
51 */
52#define LOCAL_IRQ_PENDING0 0x060
53/* Same status bits as above, but for FIQ. */
54#define LOCAL_FIQ_PENDING0 0x070
55/*
56 * Mailbox write-to-set bits. There are 16 mailboxes, 4 per CPU, and
57 * these bits are organized by mailbox number and then CPU number. We
58 * use mailbox 0 for IPIs. The mailbox's interrupt is raised while
59 * any bit is set.
60 */
61#define LOCAL_MAILBOX0_SET0 0x080
62#define LOCAL_MAILBOX3_SET0 0x08c
63/* Mailbox write-to-clear bits. */
64#define LOCAL_MAILBOX0_CLR0 0x0c0
65#define LOCAL_MAILBOX3_CLR0 0x0cc
66
67#define LOCAL_IRQ_CNTPSIRQ 0
68#define LOCAL_IRQ_CNTPNSIRQ 1
69#define LOCAL_IRQ_CNTHPIRQ 2
70#define LOCAL_IRQ_CNTVIRQ 3
71#define LOCAL_IRQ_MAILBOX0 4
72#define LOCAL_IRQ_MAILBOX1 5
73#define LOCAL_IRQ_MAILBOX2 6
74#define LOCAL_IRQ_MAILBOX3 7
75#define LOCAL_IRQ_GPU_FAST 8
76#define LOCAL_IRQ_PMU_FAST 9
77#define LAST_IRQ LOCAL_IRQ_PMU_FAST
78 25
79struct bcm2836_arm_irqchip_intc { 26struct bcm2836_arm_irqchip_intc {
80 struct irq_domain *domain; 27 struct irq_domain *domain;
@@ -215,24 +162,6 @@ static int bcm2836_cpu_dying(unsigned int cpu)
215 cpu); 162 cpu);
216 return 0; 163 return 0;
217} 164}
218
219#ifdef CONFIG_ARM
220static int __init bcm2836_smp_boot_secondary(unsigned int cpu,
221 struct task_struct *idle)
222{
223 unsigned long secondary_startup_phys =
224 (unsigned long)virt_to_phys((void *)secondary_startup);
225
226 writel(secondary_startup_phys,
227 intc.base + LOCAL_MAILBOX3_SET0 + 16 * cpu);
228
229 return 0;
230}
231
232static const struct smp_operations bcm2836_smp_ops __initconst = {
233 .smp_boot_secondary = bcm2836_smp_boot_secondary,
234};
235#endif
236#endif 165#endif
237 166
238static const struct irq_domain_ops bcm2836_arm_irqchip_intc_ops = { 167static const struct irq_domain_ops bcm2836_arm_irqchip_intc_ops = {
@@ -249,10 +178,6 @@ bcm2836_arm_irqchip_smp_init(void)
249 bcm2836_cpu_dying); 178 bcm2836_cpu_dying);
250 179
251 set_smp_cross_call(bcm2836_arm_irqchip_send_ipi); 180 set_smp_cross_call(bcm2836_arm_irqchip_send_ipi);
252
253#ifdef CONFIG_ARM
254 smp_set_ops(&bcm2836_smp_ops);
255#endif
256#endif 181#endif
257} 182}
258 183
diff --git a/include/linux/clk/bcm2835.h b/include/linux/clk/bcm2835.h
deleted file mode 100644
index aa937f6c17da..000000000000
--- a/include/linux/clk/bcm2835.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Copyright (C) 2010 Broadcom
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __LINUX_CLK_BCM2835_H_
20#define __LINUX_CLK_BCM2835_H_
21
22void __init bcm2835_init_clocks(void);
23
24#endif
diff --git a/include/linux/irqchip/irq-bcm2836.h b/include/linux/irqchip/irq-bcm2836.h
new file mode 100644
index 000000000000..218a6e1b18d8
--- /dev/null
+++ b/include/linux/irqchip/irq-bcm2836.h
@@ -0,0 +1,70 @@
1/*
2 * Root interrupt controller for the BCM2836 (Raspberry Pi 2).
3 *
4 * Copyright 2015 Broadcom
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#define LOCAL_CONTROL 0x000
18#define LOCAL_PRESCALER 0x008
19
20/*
21 * The low 2 bits identify the CPU that the GPU IRQ goes to, and the
22 * next 2 bits identify the CPU that the GPU FIQ goes to.
23 */
24#define LOCAL_GPU_ROUTING 0x00c
25/* When setting bits 0-3, enables PMU interrupts on that CPU. */
26#define LOCAL_PM_ROUTING_SET 0x010
27/* When setting bits 0-3, disables PMU interrupts on that CPU. */
28#define LOCAL_PM_ROUTING_CLR 0x014
29/*
30 * The low 4 bits of this are the CPU's timer IRQ enables, and the
31 * next 4 bits are the CPU's timer FIQ enables (which override the IRQ
32 * bits).
33 */
34#define LOCAL_TIMER_INT_CONTROL0 0x040
35/*
36 * The low 4 bits of this are the CPU's per-mailbox IRQ enables, and
37 * the next 4 bits are the CPU's per-mailbox FIQ enables (which
38 * override the IRQ bits).
39 */
40#define LOCAL_MAILBOX_INT_CONTROL0 0x050
41/*
42 * The CPU's interrupt status register. Bits are defined by the the
43 * LOCAL_IRQ_* bits below.
44 */
45#define LOCAL_IRQ_PENDING0 0x060
46/* Same status bits as above, but for FIQ. */
47#define LOCAL_FIQ_PENDING0 0x070
48/*
49 * Mailbox write-to-set bits. There are 16 mailboxes, 4 per CPU, and
50 * these bits are organized by mailbox number and then CPU number. We
51 * use mailbox 0 for IPIs. The mailbox's interrupt is raised while
52 * any bit is set.
53 */
54#define LOCAL_MAILBOX0_SET0 0x080
55#define LOCAL_MAILBOX3_SET0 0x08c
56/* Mailbox write-to-clear bits. */
57#define LOCAL_MAILBOX0_CLR0 0x0c0
58#define LOCAL_MAILBOX3_CLR0 0x0cc
59
60#define LOCAL_IRQ_CNTPSIRQ 0
61#define LOCAL_IRQ_CNTPNSIRQ 1
62#define LOCAL_IRQ_CNTHPIRQ 2
63#define LOCAL_IRQ_CNTVIRQ 3
64#define LOCAL_IRQ_MAILBOX0 4
65#define LOCAL_IRQ_MAILBOX1 5
66#define LOCAL_IRQ_MAILBOX2 6
67#define LOCAL_IRQ_MAILBOX3 7
68#define LOCAL_IRQ_GPU_FAST 8
69#define LOCAL_IRQ_PMU_FAST 9
70#define LAST_IRQ LOCAL_IRQ_PMU_FAST