aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-18 15:35:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-18 15:35:46 -0400
commit9896c7b57e9d67948f1f52f903efae5ec6c74321 (patch)
tree16218e9503df222e48fef3eba661e478bb4a9aa7
parentf2b1e0f6385d4487a81871eb47809a1375af527f (diff)
parentb54891be1a7785de7ec0e5c1fc9ba597713d22a8 (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: "We get support for three new 32-bit SoC platforms this time. The amount of changes in arch/arm for any of them is miniscule, as all the interesting code is in device driver subsystems (irqchip, clk, pinctrl, ...) these days. I'm listing them here, as the addition of the Kconfig statement is the main relevant milestone for a new platform. In each case, some drivers are are shared with existing platforms, while other drivers are added for v4.7 as well, or come in a later release. - The Aspeed platform is probably the most interesting one, this is what most whitebox servers use as their baseboard management controller. We get support for the very common ast2400 and ast2500 SoCs. The OpenBMC project focuses on this chip, and the LWN article about their ELC 2016 presentation at https://lwn.net/Articles/683320/ triggered the submission, but the code comes from IBM's OpenPOWER team rather than the team at Facebook. There are still a lot more drivers that need to get added over time, and I hope both teams can work together on that. - OXNAS is an old platform for Network Attached Storage devices from Oxford Semiconductor. There are models with ARM10 (!) and ARM11MPCore cores, but for now, we only support the original ARM9 based versions. The product lineup was subsequently part of PLX, Avago and now the new Broadcom Ltd. https://wiki.openwrt.org/doc/hardware/soc/soc.oxnas has some more information. - V2M-MPS2 is a prototyping platform from ARM for their Cortex-M cores and is related to the existing Realview / Versatile Express lineup, but without MMU. We now support various NOMMU platforms, so adding a new one is fairly straightforward. http://infocenter.arm.com/help/topic/com.arm.doc.100112_0100_03_en/ has detailed information about the platform. Other noteworthy updates: - Work on LPC32xx has resumed, and Vladimir Zapolskiy and Sylvain Lemieux are now maintaining the platform. This is an older ARM9 based platform from NXP (not Freescale), but it remains in use in embedded markets. - Kevin Hilman is now co-maintaining the Amlogic Meson platform for both 32-bit and 64-bit ARM, and started contributing some patches. - As is often the case, work on the OMAP platforms makes up the bulk of the actual SoC code changes in arch/arm, but there isn't a lot of that either" * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (42 commits) MAINTAINERS: ARM/Amlogic: add co-maintainer, misc. updates MAINTAINERS: add ARM/NXP LPC32XX SoC specific drivers to the section MAINTAINERS: add new maintainers of NXP LPC32xx SoC MAINTAINERS: move ARM/NXP LPC32xx record to ARM section arm: Add Aspeed machine ARM: lpc32xx: remove duplicate const on lpc32xx_auxdata_lookup ARM: lpc32xx: remove leftovers of legacy clock source and provider drivers ARM: lpc32xx: remove reboot header file ARM: dove: Remove CLK_IS_ROOT ARM: orion5x: Remove CLK_IS_ROOT ARM: mv78xx0: Remove CLK_IS_ROOT ARM: davinci: da850: use clk->set_parent for async3 ARM: davinci: Move clock init after ioremap. MAINTAINERS: Update ARM Versatile Express platform entry ARM: vexpress/mps2: introduce MPS2 platform MAINTAINERS: add maintainer entry for ARM/OXNAS platform ARM: Add new mach-oxnas irqchip: versatile-fpga: add new compatible for OX810SE SoC ARM: uniphier: correct the call order of of_node_put() MAINTAINERS: fix stale TI DaVinci entries ...
-rw-r--r--Documentation/devicetree/bindings/arm/atmel-at91.txt4
-rw-r--r--MAINTAINERS48
-rw-r--r--arch/arm/Kconfig16
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/mach-aspeed/Kconfig30
-rw-r--r--arch/arm/mach-at91/sama5.c20
-rw-r--r--arch/arm/mach-at91/soc.c81
-rw-r--r--arch/arm/mach-at91/soc.h12
-rw-r--r--arch/arm/mach-davinci/Makefile4
-rw-r--r--arch/arm/mach-davinci/clock.c21
-rw-r--r--arch/arm/mach-davinci/clock.h1
-rw-r--r--arch/arm/mach-davinci/common.c6
-rw-r--r--arch/arm/mach-davinci/da830.c2
-rw-r--r--arch/arm/mach-davinci/da850.c83
-rw-r--r--arch/arm/mach-davinci/dm355.c1
-rw-r--r--arch/arm/mach-davinci/dm365.c1
-rw-r--r--arch/arm/mach-davinci/dm644x.c1
-rw-r--r--arch/arm/mach-davinci/dm646x.c1
-rw-r--r--arch/arm/mach-davinci/usb-da8xx.c107
-rw-r--r--arch/arm/mach-davinci/usb.c73
-rw-r--r--arch/arm/mach-dove/common.c3
-rw-r--r--arch/arm/mach-imx/Kconfig2
-rw-r--r--arch/arm/mach-lpc32xx/common.c95
-rw-r--r--arch/arm/mach-lpc32xx/common.h24
-rw-r--r--arch/arm/mach-lpc32xx/phy3250.c2
-rw-r--r--arch/arm/mach-mediatek/Kconfig4
-rw-r--r--arch/arm/mach-mv78xx0/common.c3
-rw-r--r--arch/arm/mach-omap2/Makefile2
-rw-r--r--arch/arm/mach-omap2/omap-wakeupgen.c5
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c12
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_7xx_data.c364
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_reset.c65
-rw-r--r--arch/arm/mach-omap2/powerdomains7xx_data.c82
-rw-r--r--arch/arm/mach-omap2/soc.h140
-rw-r--r--arch/arm/mach-orion5x/common.c3
-rw-r--r--arch/arm/mach-oxnas/Kconfig24
-rw-r--r--arch/arm/mach-shmobile/timer.c52
-rw-r--r--arch/arm/mach-sti/Kconfig9
-rw-r--r--arch/arm/mach-uniphier/platsmp.c4
-rw-r--r--arch/arm/mach-vexpress/Makefile4
-rw-r--r--arch/arm/mach-vexpress/Makefile.boot3
-rw-r--r--arch/arm/mach-vexpress/v2m-mps2.c21
-rw-r--r--drivers/irqchip/irq-versatile-fpga.c1
45 files changed, 946 insertions, 495 deletions
diff --git a/Documentation/devicetree/bindings/arm/atmel-at91.txt b/Documentation/devicetree/bindings/arm/atmel-at91.txt
index 7fd64ec9ee1d..0b1fcbfe2299 100644
--- a/Documentation/devicetree/bindings/arm/atmel-at91.txt
+++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt
@@ -41,6 +41,10 @@ compatible: must be one of:
41 - "atmel,sama5d43" 41 - "atmel,sama5d43"
42 - "atmel,sama5d44" 42 - "atmel,sama5d44"
43 43
44Chipid required properties:
45- compatible: Should be "atmel,sama5d2-chipid"
46- reg : Should contain registers location and length
47
44PIT Timer required properties: 48PIT Timer required properties:
45- compatible: Should be "atmel,at91sam9260-pit" 49- compatible: Should be "atmel,at91sam9260-pit"
46- reg: Should contain registers location and length 50- reg: Should contain registers location and length
diff --git a/MAINTAINERS b/MAINTAINERS
index 8267754b9427..01eefc861477 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -949,12 +949,15 @@ F: drivers/clk/sunxi/
949 949
950ARM/Amlogic Meson SoC support 950ARM/Amlogic Meson SoC support
951M: Carlo Caione <carlo@caione.org> 951M: Carlo Caione <carlo@caione.org>
952M: Kevin Hilman <khilman@baylibre.com>
952L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 953L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
953L: linux-meson@googlegroups.com 954L: linux-amlogic@lists.infradead.org
954W: http://linux-meson.com/ 955W: http://linux-meson.com/
955S: Maintained 956S: Maintained
956F: arch/arm/mach-meson/ 957F: arch/arm/mach-meson/
957F: arch/arm/boot/dts/meson* 958F: arch/arm/boot/dts/meson*
959F: arch/arm64/boot/dts/amlogic/
960F: drivers/pinctrl/meson/
958N: meson 961N: meson
959 962
960ARM/Annapurna Labs ALPINE ARCHITECTURE 963ARM/Annapurna Labs ALPINE ARCHITECTURE
@@ -976,6 +979,13 @@ F: arch/arm/mach-artpec
976F: arch/arm/boot/dts/artpec6* 979F: arch/arm/boot/dts/artpec6*
977F: drivers/clk/clk-artpec6.c 980F: drivers/clk/clk-artpec6.c
978 981
982ARM/ASPEED MACHINE SUPPORT
983M: Joel Stanley <joel@jms.id.au>
984S: Maintained
985F: arch/arm/mach-aspeed/
986F: arch/arm/boot/dts/aspeed-*
987F: drivers/*/*aspeed*
988
979ARM/ATMEL AT91RM9200, AT91SAM9 AND SAMA5 SOC SUPPORT 989ARM/ATMEL AT91RM9200, AT91SAM9 AND SAMA5 SOC SUPPORT
980M: Nicolas Ferre <nicolas.ferre@atmel.com> 990M: Nicolas Ferre <nicolas.ferre@atmel.com>
981M: Alexandre Belloni <alexandre.belloni@free-electrons.com> 991M: Alexandre Belloni <alexandre.belloni@free-electrons.com>
@@ -1307,6 +1317,20 @@ F: drivers/mtd/spi-nor/nxp-spifi.c
1307F: drivers/rtc/rtc-lpc24xx.c 1317F: drivers/rtc/rtc-lpc24xx.c
1308N: lpc18xx 1318N: lpc18xx
1309 1319
1320ARM/LPC32XX SOC SUPPORT
1321M: Vladimir Zapolskiy <vz@mleia.com>
1322M: Sylvain Lemieux <slemieux.tyco@gmail.com>
1323L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1324T: git git://github.com/vzapolskiy/linux-lpc32xx.git
1325S: Maintained
1326F: arch/arm/boot/dts/lpc32*
1327F: arch/arm/mach-lpc32xx/
1328F: drivers/i2c/busses/i2c-pnx.c
1329F: drivers/net/ethernet/nxp/lpc_eth.c
1330F: drivers/usb/host/ohci-nxp.c
1331F: drivers/watchdog/pnx4008_wdt.c
1332N: lpc32xx
1333
1310ARM/MAGICIAN MACHINE SUPPORT 1334ARM/MAGICIAN MACHINE SUPPORT
1311M: Philipp Zabel <philipp.zabel@gmail.com> 1335M: Philipp Zabel <philipp.zabel@gmail.com>
1312S: Maintained 1336S: Maintained
@@ -1357,6 +1381,15 @@ W: http://www.digriz.org.uk/ts78xx/kernel
1357S: Maintained 1381S: Maintained
1358F: arch/arm/mach-orion5x/ts78xx-* 1382F: arch/arm/mach-orion5x/ts78xx-*
1359 1383
1384ARM/OXNAS platform support
1385M: Neil Armstrong <narmstrong@baylibre.com>
1386L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1387S: Maintained
1388F: arch/arm/mach-oxnas/
1389F: arch/arm/boot/dts/oxnas*
1390F: arch/arm/boot/dts/wd-mbwe.dts
1391N: oxnas
1392
1360ARM/Mediatek RTC DRIVER 1393ARM/Mediatek RTC DRIVER
1361M: Eddie Huang <eddie.huang@mediatek.com> 1394M: Eddie Huang <eddie.huang@mediatek.com>
1362L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1395L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1643,6 +1676,7 @@ F: arch/arm/boot/dts/sti*
1643F: drivers/char/hw_random/st-rng.c 1676F: drivers/char/hw_random/st-rng.c
1644F: drivers/clocksource/arm_global_timer.c 1677F: drivers/clocksource/arm_global_timer.c
1645F: drivers/clocksource/clksrc_st_lpc.c 1678F: drivers/clocksource/clksrc_st_lpc.c
1679F: drivers/cpufreq/sti-cpufreq.c
1646F: drivers/i2c/busses/i2c-st.c 1680F: drivers/i2c/busses/i2c-st.c
1647F: drivers/media/rc/st_rc.c 1681F: drivers/media/rc/st_rc.c
1648F: drivers/media/platform/sti/c8sectpfe/ 1682F: drivers/media/platform/sti/c8sectpfe/
@@ -1652,6 +1686,7 @@ F: drivers/phy/phy-miphy365x.c
1652F: drivers/phy/phy-stih407-usb.c 1686F: drivers/phy/phy-stih407-usb.c
1653F: drivers/phy/phy-stih41x-usb.c 1687F: drivers/phy/phy-stih41x-usb.c
1654F: drivers/pinctrl/pinctrl-st.c 1688F: drivers/pinctrl/pinctrl-st.c
1689F: drivers/remoteproc/st_remoteproc.c
1655F: drivers/reset/sti/ 1690F: drivers/reset/sti/
1656F: drivers/rtc/rtc-st-lpc.c 1691F: drivers/rtc/rtc-st-lpc.c
1657F: drivers/tty/serial/st-asc.c 1692F: drivers/tty/serial/st-asc.c
@@ -1776,6 +1811,7 @@ F: */*/vexpress*
1776F: */*/*/vexpress* 1811F: */*/*/vexpress*
1777F: drivers/clk/versatile/clk-vexpress-osc.c 1812F: drivers/clk/versatile/clk-vexpress-osc.c
1778F: drivers/clocksource/versatile.c 1813F: drivers/clocksource/versatile.c
1814N: mps2
1779 1815
1780ARM/VFP SUPPORT 1816ARM/VFP SUPPORT
1781M: Russell King <linux@armlinux.org.uk> 1817M: Russell King <linux@armlinux.org.uk>
@@ -6789,12 +6825,6 @@ W: logfs.org
6789S: Maintained 6825S: Maintained
6790F: fs/logfs/ 6826F: fs/logfs/
6791 6827
6792LPC32XX MACHINE SUPPORT
6793M: Roland Stigge <stigge@antcom.de>
6794L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
6795S: Maintained
6796F: arch/arm/mach-lpc32xx/
6797
6798LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) 6828LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
6799M: Sathya Prakash <sathya.prakash@broadcom.com> 6829M: Sathya Prakash <sathya.prakash@broadcom.com>
6800M: Chaitra P B <chaitra.basappa@broadcom.com> 6830M: Chaitra P B <chaitra.basappa@broadcom.com>
@@ -10174,8 +10204,8 @@ F: arch/arm/mach-s3c24xx/bast-irq.c
10174TI DAVINCI MACHINE SUPPORT 10204TI DAVINCI MACHINE SUPPORT
10175M: Sekhar Nori <nsekhar@ti.com> 10205M: Sekhar Nori <nsekhar@ti.com>
10176M: Kevin Hilman <khilman@kernel.org> 10206M: Kevin Hilman <khilman@kernel.org>
10177T: git git://gitorious.org/linux-davinci/linux-davinci.git 10207L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
10178Q: http://patchwork.kernel.org/project/linux-davinci/list/ 10208T: git git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git
10179S: Supported 10209S: Supported
10180F: arch/arm/mach-davinci/ 10210F: arch/arm/mach-davinci/
10181F: drivers/i2c/busses/i2c-davinci.c 10211F: drivers/i2c/busses/i2c-davinci.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 970f1cf94f7a..b99d25b4133e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -777,6 +777,8 @@ source "arch/arm/mach-meson/Kconfig"
777 777
778source "arch/arm/mach-moxart/Kconfig" 778source "arch/arm/mach-moxart/Kconfig"
779 779
780source "arch/arm/mach-aspeed/Kconfig"
781
780source "arch/arm/mach-mv78xx0/Kconfig" 782source "arch/arm/mach-mv78xx0/Kconfig"
781 783
782source "arch/arm/mach-imx/Kconfig" 784source "arch/arm/mach-imx/Kconfig"
@@ -806,6 +808,8 @@ source "arch/arm/plat-pxa/Kconfig"
806 808
807source "arch/arm/mach-mmp/Kconfig" 809source "arch/arm/mach-mmp/Kconfig"
808 810
811source "arch/arm/mach-oxnas/Kconfig"
812
809source "arch/arm/mach-qcom/Kconfig" 813source "arch/arm/mach-qcom/Kconfig"
810 814
811source "arch/arm/mach-realview/Kconfig" 815source "arch/arm/mach-realview/Kconfig"
@@ -894,6 +898,18 @@ config MACH_STM32F429
894 depends on ARCH_STM32 898 depends on ARCH_STM32
895 default y 899 default y
896 900
901config ARCH_MPS2
902 bool "ARM MPS2 paltform"
903 depends on ARM_SINGLE_ARMV7M
904 select ARM_AMBA
905 select CLKSRC_MPS2
906 help
907 Support for Cortex-M Prototyping System (or V2M-MPS2) which comes
908 with a range of available cores like Cortex-M3/M4/M7.
909
910 Please, note that depends which Application Note is used memory map
911 for the platform may vary, so adjustment of RAM base might be needed.
912
897# Definitions to make life easier 913# Definitions to make life easier
898config ARCH_ACORN 914config ARCH_ACORN
899 bool 915 bool
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 8c3ce2ac44c4..274e8a6582f1 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -183,6 +183,7 @@ machine-$(CONFIG_ARCH_LPC18XX) += lpc18xx
183machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx 183machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx
184machine-$(CONFIG_ARCH_MESON) += meson 184machine-$(CONFIG_ARCH_MESON) += meson
185machine-$(CONFIG_ARCH_MMP) += mmp 185machine-$(CONFIG_ARCH_MMP) += mmp
186machine-$(CONFIG_ARCH_MPS2) += vexpress
186machine-$(CONFIG_ARCH_MOXART) += moxart 187machine-$(CONFIG_ARCH_MOXART) += moxart
187machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0 188machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0
188machine-$(CONFIG_ARCH_MVEBU) += mvebu 189machine-$(CONFIG_ARCH_MVEBU) += mvebu
diff --git a/arch/arm/mach-aspeed/Kconfig b/arch/arm/mach-aspeed/Kconfig
new file mode 100644
index 000000000000..5225fbcb250d
--- /dev/null
+++ b/arch/arm/mach-aspeed/Kconfig
@@ -0,0 +1,30 @@
1menuconfig ARCH_ASPEED
2 bool "Aspeed BMC architectures"
3 depends on ARCH_MULTI_V5 || ARCH_MULTI_V6
4 select SRAM
5 select WATCHDOG
6 select ASPEED_WATCHDOG
7 select MOXART_TIMER
8 help
9 Say Y here if you want to run your kernel on an ASpeed BMC SoC.
10
11if ARCH_ASPEED
12
13config MACH_ASPEED_G4
14 bool "Aspeed SoC 4th Generation"
15 depends on ARCH_MULTI_V5
16 select CPU_ARM926T
17 help
18 Say yes if you intend to run on an Aspeed ast2400 or similar
19 fourth generation BMCs, such as those used by OpenPower Power8
20 systems.
21
22config MACH_ASPEED_G5
23 bool "Aspeed SoC 5th Generation"
24 depends on ARCH_MULTI_V6
25 select CPU_V6
26 help
27 Say yes if you intend to run on an Aspeed ast2500 or similar
28 fifth generation Aspeed BMCs.
29
30endif
diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c
index df8fdf1cf66d..922b85f07cd2 100644
--- a/arch/arm/mach-at91/sama5.c
+++ b/arch/arm/mach-at91/sama5.c
@@ -18,8 +18,26 @@
18#include "soc.h" 18#include "soc.h"
19 19
20static const struct at91_soc sama5_socs[] = { 20static const struct at91_soc sama5_socs[] = {
21 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D27_EXID_MATCH, 21 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D21CU_EXID_MATCH,
22 "sama5d21", "sama5d2"),
23 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D22CU_EXID_MATCH,
24 "sama5d22", "sama5d2"),
25 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D23CU_EXID_MATCH,
26 "sama5d23", "sama5d2"),
27 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D24CX_EXID_MATCH,
28 "sama5d24", "sama5d2"),
29 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D24CU_EXID_MATCH,
30 "sama5d24", "sama5d2"),
31 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D26CU_EXID_MATCH,
32 "sama5d26", "sama5d2"),
33 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D27CU_EXID_MATCH,
22 "sama5d27", "sama5d2"), 34 "sama5d27", "sama5d2"),
35 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D27CN_EXID_MATCH,
36 "sama5d27", "sama5d2"),
37 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D28CU_EXID_MATCH,
38 "sama5d28", "sama5d2"),
39 AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D28CN_EXID_MATCH,
40 "sama5d28", "sama5d2"),
23 AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D31_EXID_MATCH, 41 AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D31_EXID_MATCH,
24 "sama5d31", "sama5d3"), 42 "sama5d31", "sama5d3"),
25 AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D33_EXID_MATCH, 43 AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D33_EXID_MATCH,
diff --git a/arch/arm/mach-at91/soc.c b/arch/arm/mach-at91/soc.c
index 54343ffa3e53..c6fda75ddb89 100644
--- a/arch/arm/mach-at91/soc.c
+++ b/arch/arm/mach-at91/soc.c
@@ -22,48 +22,93 @@
22#include "soc.h" 22#include "soc.h"
23 23
24#define AT91_DBGU_CIDR 0x40 24#define AT91_DBGU_CIDR 0x40
25#define AT91_DBGU_CIDR_VERSION(x) ((x) & 0x1f)
26#define AT91_DBGU_CIDR_EXT BIT(31)
27#define AT91_DBGU_CIDR_MATCH_MASK 0x7fffffe0
28#define AT91_DBGU_EXID 0x44 25#define AT91_DBGU_EXID 0x44
26#define AT91_CHIPID_CIDR 0x00
27#define AT91_CHIPID_EXID 0x04
28#define AT91_CIDR_VERSION(x) ((x) & 0x1f)
29#define AT91_CIDR_EXT BIT(31)
30#define AT91_CIDR_MATCH_MASK 0x7fffffe0
29 31
30struct soc_device * __init at91_soc_init(const struct at91_soc *socs) 32static int __init at91_get_cidr_exid_from_dbgu(u32 *cidr, u32 *exid)
31{ 33{
32 struct soc_device_attribute *soc_dev_attr;
33 const struct at91_soc *soc;
34 struct soc_device *soc_dev;
35 struct device_node *np; 34 struct device_node *np;
36 void __iomem *regs; 35 void __iomem *regs;
37 u32 cidr, exid;
38 36
39 np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-dbgu"); 37 np = of_find_compatible_node(NULL, NULL, "atmel,at91rm9200-dbgu");
40 if (!np) 38 if (!np)
41 np = of_find_compatible_node(NULL, NULL, 39 np = of_find_compatible_node(NULL, NULL,
42 "atmel,at91sam9260-dbgu"); 40 "atmel,at91sam9260-dbgu");
41 if (!np)
42 return -ENODEV;
43 43
44 if (!np) { 44 regs = of_iomap(np, 0);
45 pr_warn("Could not find DBGU node"); 45 of_node_put(np);
46 return NULL; 46
47 if (!regs) {
48 pr_warn("Could not map DBGU iomem range");
49 return -ENXIO;
47 } 50 }
48 51
52 *cidr = readl(regs + AT91_DBGU_CIDR);
53 *exid = readl(regs + AT91_DBGU_EXID);
54
55 iounmap(regs);
56
57 return 0;
58}
59
60static int __init at91_get_cidr_exid_from_chipid(u32 *cidr, u32 *exid)
61{
62 struct device_node *np;
63 void __iomem *regs;
64
65 np = of_find_compatible_node(NULL, NULL, "atmel,sama5d2-chipid");
66 if (!np)
67 return -ENODEV;
68
49 regs = of_iomap(np, 0); 69 regs = of_iomap(np, 0);
50 of_node_put(np); 70 of_node_put(np);
51 71
52 if (!regs) { 72 if (!regs) {
53 pr_warn("Could not map DBGU iomem range"); 73 pr_warn("Could not map DBGU iomem range");
54 return NULL; 74 return -ENXIO;
55 } 75 }
56 76
57 cidr = readl(regs + AT91_DBGU_CIDR); 77 *cidr = readl(regs + AT91_CHIPID_CIDR);
58 exid = readl(regs + AT91_DBGU_EXID); 78 *exid = readl(regs + AT91_CHIPID_EXID);
59 79
60 iounmap(regs); 80 iounmap(regs);
61 81
82 return 0;
83}
84
85struct soc_device * __init at91_soc_init(const struct at91_soc *socs)
86{
87 struct soc_device_attribute *soc_dev_attr;
88 const struct at91_soc *soc;
89 struct soc_device *soc_dev;
90 u32 cidr, exid;
91 int ret;
92
93 /*
94 * With SAMA5D2 and later SoCs, CIDR and EXID registers are no more
95 * in the dbgu device but in the chipid device whose purpose is only
96 * to expose these two registers.
97 */
98 ret = at91_get_cidr_exid_from_dbgu(&cidr, &exid);
99 if (ret)
100 ret = at91_get_cidr_exid_from_chipid(&cidr, &exid);
101 if (ret) {
102 if (ret == -ENODEV)
103 pr_warn("Could not find identification node");
104 return NULL;
105 }
106
62 for (soc = socs; soc->name; soc++) { 107 for (soc = socs; soc->name; soc++) {
63 if (soc->cidr_match != (cidr & AT91_DBGU_CIDR_MATCH_MASK)) 108 if (soc->cidr_match != (cidr & AT91_CIDR_MATCH_MASK))
64 continue; 109 continue;
65 110
66 if (!(cidr & AT91_DBGU_CIDR_EXT) || soc->exid_match == exid) 111 if (!(cidr & AT91_CIDR_EXT) || soc->exid_match == exid)
67 break; 112 break;
68 } 113 }
69 114
@@ -79,7 +124,7 @@ struct soc_device * __init at91_soc_init(const struct at91_soc *socs)
79 soc_dev_attr->family = soc->family; 124 soc_dev_attr->family = soc->family;
80 soc_dev_attr->soc_id = soc->name; 125 soc_dev_attr->soc_id = soc->name;
81 soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%X", 126 soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%X",
82 AT91_DBGU_CIDR_VERSION(cidr)); 127 AT91_CIDR_VERSION(cidr));
83 soc_dev = soc_device_register(soc_dev_attr); 128 soc_dev = soc_device_register(soc_dev_attr);
84 if (IS_ERR(soc_dev)) { 129 if (IS_ERR(soc_dev)) {
85 kfree(soc_dev_attr->revision); 130 kfree(soc_dev_attr->revision);
@@ -91,7 +136,7 @@ struct soc_device * __init at91_soc_init(const struct at91_soc *socs)
91 if (soc->family) 136 if (soc->family)
92 pr_info("Detected SoC family: %s\n", soc->family); 137 pr_info("Detected SoC family: %s\n", soc->family);
93 pr_info("Detected SoC: %s, revision %X\n", soc->name, 138 pr_info("Detected SoC: %s, revision %X\n", soc->name,
94 AT91_DBGU_CIDR_VERSION(cidr)); 139 AT91_CIDR_VERSION(cidr));
95 140
96 return soc_dev; 141 return soc_dev;
97} 142}
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index 8ede0ef86172..228efded5085 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -63,7 +63,17 @@ at91_soc_init(const struct at91_soc *socs);
63#define AT91SAM9XE512_CIDR_MATCH 0x329aa3a0 63#define AT91SAM9XE512_CIDR_MATCH 0x329aa3a0
64 64
65#define SAMA5D2_CIDR_MATCH 0x0a5c08c0 65#define SAMA5D2_CIDR_MATCH 0x0a5c08c0
66#define SAMA5D27_EXID_MATCH 0x00000021 66#define SAMA5D21CU_EXID_MATCH 0x0000005a
67#define SAMA5D22CU_EXID_MATCH 0x00000059
68#define SAMA5D22CN_EXID_MATCH 0x00000069
69#define SAMA5D23CU_EXID_MATCH 0x00000058
70#define SAMA5D24CX_EXID_MATCH 0x00000004
71#define SAMA5D24CU_EXID_MATCH 0x00000014
72#define SAMA5D26CU_EXID_MATCH 0x00000012
73#define SAMA5D27CU_EXID_MATCH 0x00000011
74#define SAMA5D27CN_EXID_MATCH 0x00000021
75#define SAMA5D28CU_EXID_MATCH 0x00000010
76#define SAMA5D28CN_EXID_MATCH 0x00000020
67 77
68#define SAMA5D3_CIDR_MATCH 0x0a5c07c0 78#define SAMA5D3_CIDR_MATCH 0x0a5c07c0
69#define SAMA5D31_EXID_MATCH 0x00444300 79#define SAMA5D31_EXID_MATCH 0x00444300
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index 2e3464b8bab4..da4c336b4637 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -14,8 +14,8 @@ obj-$(CONFIG_ARCH_DAVINCI_DM644x) += dm644x.o devices.o
14obj-$(CONFIG_ARCH_DAVINCI_DM355) += dm355.o devices.o 14obj-$(CONFIG_ARCH_DAVINCI_DM355) += dm355.o devices.o
15obj-$(CONFIG_ARCH_DAVINCI_DM646x) += dm646x.o devices.o 15obj-$(CONFIG_ARCH_DAVINCI_DM646x) += dm646x.o devices.o
16obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o 16obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o
17obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o 17obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o usb-da8xx.o
18obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o 18obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o usb-da8xx.o
19 19
20obj-$(CONFIG_AINTC) += irq.o 20obj-$(CONFIG_AINTC) += irq.o
21obj-$(CONFIG_CP_INTC) += cp_intc.o 21obj-$(CONFIG_CP_INTC) += cp_intc.o
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index 3424eac6b588..df42c93a93d6 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -195,6 +195,14 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
195 return -EINVAL; 195 return -EINVAL;
196 196
197 mutex_lock(&clocks_mutex); 197 mutex_lock(&clocks_mutex);
198 if (clk->set_parent) {
199 int ret = clk->set_parent(clk, parent);
200
201 if (ret) {
202 mutex_unlock(&clocks_mutex);
203 return ret;
204 }
205 }
198 clk->parent = parent; 206 clk->parent = parent;
199 list_del_init(&clk->childnode); 207 list_del_init(&clk->childnode);
200 list_add(&clk->childnode, &clk->parent->children); 208 list_add(&clk->childnode, &clk->parent->children);
@@ -224,8 +232,17 @@ int clk_register(struct clk *clk)
224 232
225 mutex_lock(&clocks_mutex); 233 mutex_lock(&clocks_mutex);
226 list_add_tail(&clk->node, &clocks); 234 list_add_tail(&clk->node, &clocks);
227 if (clk->parent) 235 if (clk->parent) {
236 if (clk->set_parent) {
237 int ret = clk->set_parent(clk, clk->parent);
238
239 if (ret) {
240 mutex_unlock(&clocks_mutex);
241 return ret;
242 }
243 }
228 list_add_tail(&clk->childnode, &clk->parent->children); 244 list_add_tail(&clk->childnode, &clk->parent->children);
245 }
229 mutex_unlock(&clocks_mutex); 246 mutex_unlock(&clocks_mutex);
230 247
231 /* If rate is already set, use it */ 248 /* If rate is already set, use it */
@@ -560,7 +577,7 @@ EXPORT_SYMBOL(davinci_set_pllrate);
560 * than that used by default in <soc>.c file. The reference clock rate 577 * than that used by default in <soc>.c file. The reference clock rate
561 * should be updated early in the boot process; ideally soon after the 578 * should be updated early in the boot process; ideally soon after the
562 * clock tree has been initialized once with the default reference clock 579 * clock tree has been initialized once with the default reference clock
563 * rate (davinci_common_init()). 580 * rate (davinci_clk_init()).
564 * 581 *
565 * Returns 0 on success, error otherwise. 582 * Returns 0 on success, error otherwise.
566 */ 583 */
diff --git a/arch/arm/mach-davinci/clock.h b/arch/arm/mach-davinci/clock.h
index 1e4e836173a1..e2a5437a1aee 100644
--- a/arch/arm/mach-davinci/clock.h
+++ b/arch/arm/mach-davinci/clock.h
@@ -106,6 +106,7 @@ struct clk {
106 int (*reset) (struct clk *clk, bool reset); 106 int (*reset) (struct clk *clk, bool reset);
107 void (*clk_enable) (struct clk *clk); 107 void (*clk_enable) (struct clk *clk);
108 void (*clk_disable) (struct clk *clk); 108 void (*clk_disable) (struct clk *clk);
109 int (*set_parent) (struct clk *clk, struct clk *parent);
109}; 110};
110 111
111/* Clock flags: SoC-specific flags start at BIT(16) */ 112/* Clock flags: SoC-specific flags start at BIT(16) */
diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index 742133b7266a..049025f6d531 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -108,12 +108,6 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
108 if (ret < 0) 108 if (ret < 0)
109 goto err; 109 goto err;
110 110
111 if (davinci_soc_info.cpu_clks) {
112 ret = davinci_clk_init(davinci_soc_info.cpu_clks);
113
114 if (ret != 0)
115 goto err;
116 }
117 111
118 return; 112 return;
119 113
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index 7187e7fc2822..426fd7477357 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -1214,4 +1214,6 @@ void __init da830_init(void)
1214 1214
1215 da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K); 1215 da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K);
1216 WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module"); 1216 WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module");
1217
1218 davinci_clk_init(davinci_soc_info_da830.cpu_clks);
1217} 1219}
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 97d8779a9a65..239886299968 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -34,9 +34,6 @@
34#include "clock.h" 34#include "clock.h"
35#include "mux.h" 35#include "mux.h"
36 36
37/* SoC specific clock flags */
38#define DA850_CLK_ASYNC3 BIT(16)
39
40#define DA850_PLL1_BASE 0x01e1a000 37#define DA850_PLL1_BASE 0x01e1a000
41#define DA850_TIMER64P2_BASE 0x01f0c000 38#define DA850_TIMER64P2_BASE 0x01f0c000
42#define DA850_TIMER64P3_BASE 0x01f0d000 39#define DA850_TIMER64P3_BASE 0x01f0d000
@@ -161,6 +158,32 @@ static struct clk pll1_sysclk3 = {
161 .div_reg = PLLDIV3, 158 .div_reg = PLLDIV3,
162}; 159};
163 160
161static int da850_async3_set_parent(struct clk *clk, struct clk *parent)
162{
163 u32 val;
164
165 val = readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG));
166
167 if (parent == &pll0_sysclk2) {
168 val &= ~CFGCHIP3_ASYNC3_CLKSRC;
169 } else if (parent == &pll1_sysclk2) {
170 val |= CFGCHIP3_ASYNC3_CLKSRC;
171 } else {
172 pr_err("Bad parent on async3 clock mux\n");
173 return -EINVAL;
174 }
175
176 writel(val, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG));
177
178 return 0;
179}
180
181static struct clk async3_clk = {
182 .name = "async3",
183 .parent = &pll1_sysclk2,
184 .set_parent = da850_async3_set_parent,
185};
186
164static struct clk i2c0_clk = { 187static struct clk i2c0_clk = {
165 .name = "i2c0", 188 .name = "i2c0",
166 .parent = &pll0_aux_clk, 189 .parent = &pll0_aux_clk,
@@ -234,18 +257,16 @@ static struct clk uart0_clk = {
234 257
235static struct clk uart1_clk = { 258static struct clk uart1_clk = {
236 .name = "uart1", 259 .name = "uart1",
237 .parent = &pll0_sysclk2, 260 .parent = &async3_clk,
238 .lpsc = DA8XX_LPSC1_UART1, 261 .lpsc = DA8XX_LPSC1_UART1,
239 .gpsc = 1, 262 .gpsc = 1,
240 .flags = DA850_CLK_ASYNC3,
241}; 263};
242 264
243static struct clk uart2_clk = { 265static struct clk uart2_clk = {
244 .name = "uart2", 266 .name = "uart2",
245 .parent = &pll0_sysclk2, 267 .parent = &async3_clk,
246 .lpsc = DA8XX_LPSC1_UART2, 268 .lpsc = DA8XX_LPSC1_UART2,
247 .gpsc = 1, 269 .gpsc = 1,
248 .flags = DA850_CLK_ASYNC3,
249}; 270};
250 271
251static struct clk aintc_clk = { 272static struct clk aintc_clk = {
@@ -300,10 +321,9 @@ static struct clk emac_clk = {
300 321
301static struct clk mcasp_clk = { 322static struct clk mcasp_clk = {
302 .name = "mcasp", 323 .name = "mcasp",
303 .parent = &pll0_sysclk2, 324 .parent = &async3_clk,
304 .lpsc = DA8XX_LPSC1_McASP0, 325 .lpsc = DA8XX_LPSC1_McASP0,
305 .gpsc = 1, 326 .gpsc = 1,
306 .flags = DA850_CLK_ASYNC3,
307}; 327};
308 328
309static struct clk lcdc_clk = { 329static struct clk lcdc_clk = {
@@ -355,10 +375,9 @@ static struct clk spi0_clk = {
355 375
356static struct clk spi1_clk = { 376static struct clk spi1_clk = {
357 .name = "spi1", 377 .name = "spi1",
358 .parent = &pll0_sysclk2, 378 .parent = &async3_clk,
359 .lpsc = DA8XX_LPSC1_SPI1, 379 .lpsc = DA8XX_LPSC1_SPI1,
360 .gpsc = 1, 380 .gpsc = 1,
361 .flags = DA850_CLK_ASYNC3,
362}; 381};
363 382
364static struct clk vpif_clk = { 383static struct clk vpif_clk = {
@@ -386,10 +405,9 @@ static struct clk dsp_clk = {
386 405
387static struct clk ehrpwm_clk = { 406static struct clk ehrpwm_clk = {
388 .name = "ehrpwm", 407 .name = "ehrpwm",
389 .parent = &pll0_sysclk2, 408 .parent = &async3_clk,
390 .lpsc = DA8XX_LPSC1_PWM, 409 .lpsc = DA8XX_LPSC1_PWM,
391 .gpsc = 1, 410 .gpsc = 1,
392 .flags = DA850_CLK_ASYNC3,
393}; 411};
394 412
395#define DA8XX_EHRPWM_TBCLKSYNC BIT(12) 413#define DA8XX_EHRPWM_TBCLKSYNC BIT(12)
@@ -421,10 +439,9 @@ static struct clk ehrpwm_tbclk = {
421 439
422static struct clk ecap_clk = { 440static struct clk ecap_clk = {
423 .name = "ecap", 441 .name = "ecap",
424 .parent = &pll0_sysclk2, 442 .parent = &async3_clk,
425 .lpsc = DA8XX_LPSC1_ECAP, 443 .lpsc = DA8XX_LPSC1_ECAP,
426 .gpsc = 1, 444 .gpsc = 1,
427 .flags = DA850_CLK_ASYNC3,
428}; 445};
429 446
430static struct clk_lookup da850_clks[] = { 447static struct clk_lookup da850_clks[] = {
@@ -442,6 +459,7 @@ static struct clk_lookup da850_clks[] = {
442 CLK(NULL, "pll1_aux", &pll1_aux_clk), 459 CLK(NULL, "pll1_aux", &pll1_aux_clk),
443 CLK(NULL, "pll1_sysclk2", &pll1_sysclk2), 460 CLK(NULL, "pll1_sysclk2", &pll1_sysclk2),
444 CLK(NULL, "pll1_sysclk3", &pll1_sysclk3), 461 CLK(NULL, "pll1_sysclk3", &pll1_sysclk3),
462 CLK(NULL, "async3", &async3_clk),
445 CLK("i2c_davinci.1", NULL, &i2c0_clk), 463 CLK("i2c_davinci.1", NULL, &i2c0_clk),
446 CLK(NULL, "timer0", &timerp64_0_clk), 464 CLK(NULL, "timer0", &timerp64_0_clk),
447 CLK("davinci-wdt", NULL, &timerp64_1_clk), 465 CLK("davinci-wdt", NULL, &timerp64_1_clk),
@@ -909,30 +927,6 @@ static struct davinci_timer_info da850_timer_info = {
909 .clocksource_id = T0_TOP, 927 .clocksource_id = T0_TOP,
910}; 928};
911 929
912static void da850_set_async3_src(int pllnum)
913{
914 struct clk *clk, *newparent = pllnum ? &pll1_sysclk2 : &pll0_sysclk2;
915 struct clk_lookup *c;
916 unsigned int v;
917 int ret;
918
919 for (c = da850_clks; c->clk; c++) {
920 clk = c->clk;
921 if (clk->flags & DA850_CLK_ASYNC3) {
922 ret = clk_set_parent(clk, newparent);
923 WARN(ret, "DA850: unable to re-parent clock %s",
924 clk->name);
925 }
926 }
927
928 v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG));
929 if (pllnum)
930 v |= CFGCHIP3_ASYNC3_CLKSRC;
931 else
932 v &= ~CFGCHIP3_ASYNC3_CLKSRC;
933 __raw_writel(v, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG));
934}
935
936#ifdef CONFIG_CPU_FREQ 930#ifdef CONFIG_CPU_FREQ
937/* 931/*
938 * Notes: 932 * Notes:
@@ -1328,15 +1322,6 @@ void __init da850_init(void)
1328 if (WARN(!da8xx_syscfg1_base, "Unable to map syscfg1 module")) 1322 if (WARN(!da8xx_syscfg1_base, "Unable to map syscfg1 module"))
1329 return; 1323 return;
1330 1324
1331 /*
1332 * Move the clock source of Async3 domain to PLL1 SYSCLK2.
1333 * This helps keeping the peripherals on this domain insulated
1334 * from CPU frequency changes caused by DVFS. The firmware sets
1335 * both PLL0 and PLL1 to the same frequency so, there should not
1336 * be any noticeable change even in non-DVFS use cases.
1337 */
1338 da850_set_async3_src(1);
1339
1340 /* Unlock writing to PLL0 registers */ 1325 /* Unlock writing to PLL0 registers */
1341 v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG)); 1326 v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG));
1342 v &= ~CFGCHIP0_PLL_MASTER_LOCK; 1327 v &= ~CFGCHIP0_PLL_MASTER_LOCK;
@@ -1346,4 +1331,6 @@ void __init da850_init(void)
1346 v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG)); 1331 v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG));
1347 v &= ~CFGCHIP3_PLL1_MASTER_LOCK; 1332 v &= ~CFGCHIP3_PLL1_MASTER_LOCK;
1348 __raw_writel(v, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG)); 1333 __raw_writel(v, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG));
1334
1335 davinci_clk_init(davinci_soc_info_da850.cpu_clks);
1349} 1336}
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index a0ecf499c2f2..5a19cca7ed6a 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -1052,6 +1052,7 @@ void __init dm355_init(void)
1052{ 1052{
1053 davinci_common_init(&davinci_soc_info_dm355); 1053 davinci_common_init(&davinci_soc_info_dm355);
1054 davinci_map_sysmod(); 1054 davinci_map_sysmod();
1055 davinci_clk_init(davinci_soc_info_dm355.cpu_clks);
1055} 1056}
1056 1057
1057int __init dm355_init_video(struct vpfe_config *vpfe_cfg, 1058int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 384d3674dd9b..8aa004b02fe9 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -1176,6 +1176,7 @@ void __init dm365_init(void)
1176{ 1176{
1177 davinci_common_init(&davinci_soc_info_dm365); 1177 davinci_common_init(&davinci_soc_info_dm365);
1178 davinci_map_sysmod(); 1178 davinci_map_sysmod();
1179 davinci_clk_init(davinci_soc_info_dm365.cpu_clks);
1179} 1180}
1180 1181
1181static struct resource dm365_vpss_resources[] = { 1182static struct resource dm365_vpss_resources[] = {
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index b4b3a8b9ca20..0afa279ec460 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -932,6 +932,7 @@ void __init dm644x_init(void)
932{ 932{
933 davinci_common_init(&davinci_soc_info_dm644x); 933 davinci_common_init(&davinci_soc_info_dm644x);
934 davinci_map_sysmod(); 934 davinci_map_sysmod();
935 davinci_clk_init(davinci_soc_info_dm644x.cpu_clks);
935} 936}
936 937
937int __init dm644x_init_video(struct vpfe_config *vpfe_cfg, 938int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index a43db0f5fbaa..da21353cac45 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -956,6 +956,7 @@ void __init dm646x_init(void)
956{ 956{
957 davinci_common_init(&davinci_soc_info_dm646x); 957 davinci_common_init(&davinci_soc_info_dm646x);
958 davinci_map_sysmod(); 958 davinci_map_sysmod();
959 davinci_clk_init(davinci_soc_info_dm646x.cpu_clks);
959} 960}
960 961
961static int __init dm646x_init_devices(void) 962static int __init dm646x_init_devices(void)
diff --git a/arch/arm/mach-davinci/usb-da8xx.c b/arch/arm/mach-davinci/usb-da8xx.c
new file mode 100644
index 000000000000..f141f5171906
--- /dev/null
+++ b/arch/arm/mach-davinci/usb-da8xx.c
@@ -0,0 +1,107 @@
1/*
2 * DA8xx USB
3 */
4#include <linux/dma-mapping.h>
5#include <linux/init.h>
6#include <linux/platform_data/usb-davinci.h>
7#include <linux/platform_device.h>
8#include <linux/usb/musb.h>
9
10#include <mach/common.h>
11#include <mach/cputype.h>
12#include <mach/da8xx.h>
13#include <mach/irqs.h>
14
15#define DA8XX_USB0_BASE 0x01e00000
16#define DA8XX_USB1_BASE 0x01e25000
17
18#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
19
20static struct musb_hdrc_config musb_config = {
21 .multipoint = true,
22 .num_eps = 5,
23 .ram_bits = 10,
24};
25
26static struct musb_hdrc_platform_data usb_data = {
27 /* OTG requires a Mini-AB connector */
28 .mode = MUSB_OTG,
29 .clock = "usb20",
30 .config = &musb_config,
31};
32
33static struct resource da8xx_usb20_resources[] = {
34 {
35 .start = DA8XX_USB0_BASE,
36 .end = DA8XX_USB0_BASE + SZ_64K - 1,
37 .flags = IORESOURCE_MEM,
38 },
39 {
40 .start = IRQ_DA8XX_USB_INT,
41 .flags = IORESOURCE_IRQ,
42 .name = "mc",
43 },
44};
45
46static u64 usb_dmamask = DMA_BIT_MASK(32);
47
48static struct platform_device usb_dev = {
49 .name = "musb-da8xx",
50 .id = -1,
51 .dev = {
52 .platform_data = &usb_data,
53 .dma_mask = &usb_dmamask,
54 .coherent_dma_mask = DMA_BIT_MASK(32),
55 },
56 .resource = da8xx_usb20_resources,
57 .num_resources = ARRAY_SIZE(da8xx_usb20_resources),
58};
59
60int __init da8xx_register_usb20(unsigned int mA, unsigned int potpgt)
61{
62 usb_data.power = mA > 510 ? 255 : mA / 2;
63 usb_data.potpgt = (potpgt + 1) / 2;
64
65 return platform_device_register(&usb_dev);
66}
67
68#else
69
70int __init da8xx_register_usb20(unsigned int mA, unsigned int potpgt)
71{
72 return 0;
73}
74
75#endif /* CONFIG_USB_MUSB_HDRC */
76
77static struct resource da8xx_usb11_resources[] = {
78 [0] = {
79 .start = DA8XX_USB1_BASE,
80 .end = DA8XX_USB1_BASE + SZ_4K - 1,
81 .flags = IORESOURCE_MEM,
82 },
83 [1] = {
84 .start = IRQ_DA8XX_IRQN,
85 .end = IRQ_DA8XX_IRQN,
86 .flags = IORESOURCE_IRQ,
87 },
88};
89
90static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32);
91
92static struct platform_device da8xx_usb11_device = {
93 .name = "ohci",
94 .id = 0,
95 .dev = {
96 .dma_mask = &da8xx_usb11_dma_mask,
97 .coherent_dma_mask = DMA_BIT_MASK(32),
98 },
99 .num_resources = ARRAY_SIZE(da8xx_usb11_resources),
100 .resource = da8xx_usb11_resources,
101};
102
103int __init da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata)
104{
105 da8xx_usb11_device.dev.platform_data = pdata;
106 return platform_device_register(&da8xx_usb11_device);
107}
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index 6ed5a54ae74d..0e7e89c1f331 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -10,14 +10,10 @@
10#include <mach/common.h> 10#include <mach/common.h>
11#include <mach/irqs.h> 11#include <mach/irqs.h>
12#include <mach/cputype.h> 12#include <mach/cputype.h>
13#include <mach/da8xx.h>
14#include <linux/platform_data/usb-davinci.h> 13#include <linux/platform_data/usb-davinci.h>
15 14
16#define DAVINCI_USB_OTG_BASE 0x01c64000 15#define DAVINCI_USB_OTG_BASE 0x01c64000
17 16
18#define DA8XX_USB0_BASE 0x01e00000
19#define DA8XX_USB1_BASE 0x01e25000
20
21#if IS_ENABLED(CONFIG_USB_MUSB_HDRC) 17#if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
22static struct musb_hdrc_config musb_config = { 18static struct musb_hdrc_config musb_config = {
23 .multipoint = true, 19 .multipoint = true,
@@ -81,79 +77,10 @@ void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
81 platform_device_register(&usb_dev); 77 platform_device_register(&usb_dev);
82} 78}
83 79
84#ifdef CONFIG_ARCH_DAVINCI_DA8XX
85static struct resource da8xx_usb20_resources[] = {
86 {
87 .start = DA8XX_USB0_BASE,
88 .end = DA8XX_USB0_BASE + SZ_64K - 1,
89 .flags = IORESOURCE_MEM,
90 },
91 {
92 .start = IRQ_DA8XX_USB_INT,
93 .flags = IORESOURCE_IRQ,
94 .name = "mc",
95 },
96};
97
98int __init da8xx_register_usb20(unsigned mA, unsigned potpgt)
99{
100 usb_data.clock = "usb20";
101 usb_data.power = mA > 510 ? 255 : mA / 2;
102 usb_data.potpgt = (potpgt + 1) / 2;
103
104 usb_dev.resource = da8xx_usb20_resources;
105 usb_dev.num_resources = ARRAY_SIZE(da8xx_usb20_resources);
106 usb_dev.name = "musb-da8xx";
107
108 return platform_device_register(&usb_dev);
109}
110#endif /* CONFIG_DAVINCI_DA8XX */
111
112#else 80#else
113 81
114void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms) 82void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
115{ 83{
116} 84}
117 85
118#ifdef CONFIG_ARCH_DAVINCI_DA8XX
119int __init da8xx_register_usb20(unsigned mA, unsigned potpgt)
120{
121 return 0;
122}
123#endif
124
125#endif /* CONFIG_USB_MUSB_HDRC */ 86#endif /* CONFIG_USB_MUSB_HDRC */
126
127#ifdef CONFIG_ARCH_DAVINCI_DA8XX
128static struct resource da8xx_usb11_resources[] = {
129 [0] = {
130 .start = DA8XX_USB1_BASE,
131 .end = DA8XX_USB1_BASE + SZ_4K - 1,
132 .flags = IORESOURCE_MEM,
133 },
134 [1] = {
135 .start = IRQ_DA8XX_IRQN,
136 .end = IRQ_DA8XX_IRQN,
137 .flags = IORESOURCE_IRQ,
138 },
139};
140
141static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32);
142
143static struct platform_device da8xx_usb11_device = {
144 .name = "ohci",
145 .id = 0,
146 .dev = {
147 .dma_mask = &da8xx_usb11_dma_mask,
148 .coherent_dma_mask = DMA_BIT_MASK(32),
149 },
150 .num_resources = ARRAY_SIZE(da8xx_usb11_resources),
151 .resource = da8xx_usb11_resources,
152};
153
154int __init da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata)
155{
156 da8xx_usb11_device.dev.platform_data = pdata;
157 return platform_device_register(&da8xx_usb11_device);
158}
159#endif /* CONFIG_DAVINCI_DA8XX */
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 0cdaa3851d2e..0d420a2bfe3e 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -88,8 +88,7 @@ static void __init dove_clk_init(void)
88 struct clk *nand, *camera, *i2s0, *i2s1, *crypto, *ac97, *pdma; 88 struct clk *nand, *camera, *i2s0, *i2s1, *crypto, *ac97, *pdma;
89 struct clk *xor0, *xor1, *ge, *gephy; 89 struct clk *xor0, *xor1, *ge, *gephy;
90 90
91 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT, 91 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, 0, dove_tclk);
92 dove_tclk);
93 92
94 usb0 = dove_register_gate("usb0", "tclk", CLOCK_GATING_BIT_USB0); 93 usb0 = dove_register_gate("usb0", "tclk", CLOCK_GATING_BIT_USB0);
95 usb1 = dove_register_gate("usb1", "tclk", CLOCK_GATING_BIT_USB1); 94 usb1 = dove_register_gate("usb1", "tclk", CLOCK_GATING_BIT_USB1);
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 8973fae25436..dd905b9602a0 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -526,7 +526,7 @@ config SOC_IMX6Q
526 bool "i.MX6 Quad/DualLite support" 526 bool "i.MX6 Quad/DualLite support"
527 select ARM_ERRATA_764369 if SMP 527 select ARM_ERRATA_764369 if SMP
528 select HAVE_ARM_SCU if SMP 528 select HAVE_ARM_SCU if SMP
529 select HAVE_ARM_TWD if SMP 529 select HAVE_ARM_TWD
530 select PCI_DOMAINS if PCI 530 select PCI_DOMAINS if PCI
531 select PINCTRL_IMX6Q 531 select PINCTRL_IMX6Q
532 select SOC_IMX6 532 select SOC_IMX6
diff --git a/arch/arm/mach-lpc32xx/common.c b/arch/arm/mach-lpc32xx/common.c
index 5b7a1e78c3a5..2f6067bce7c3 100644
--- a/arch/arm/mach-lpc32xx/common.c
+++ b/arch/arm/mach-lpc32xx/common.c
@@ -17,13 +17,6 @@
17 */ 17 */
18 18
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/platform_device.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/err.h>
24#include <linux/i2c.h>
25#include <linux/i2c-pnx.h>
26#include <linux/io.h>
27 20
28#include <asm/mach/map.h> 21#include <asm/mach/map.h>
29#include <asm/system_info.h> 22#include <asm/system_info.h>
@@ -44,19 +37,6 @@ void lpc32xx_get_uid(u32 devid[4])
44} 37}
45 38
46/* 39/*
47 * Returns SYSCLK source
48 * 0 = PLL397, 1 = main oscillator
49 */
50int clk_is_sysclk_mainosc(void)
51{
52 if ((__raw_readl(LPC32XX_CLKPWR_SYSCLK_CTRL) &
53 LPC32XX_CLKPWR_SYSCTRL_SYSCLKMUX) == 0)
54 return 1;
55
56 return 0;
57}
58
59/*
60 * Detects and returns IRAM size for the device variation 40 * Detects and returns IRAM size for the device variation
61 */ 41 */
62#define LPC32XX_IRAM_BANK_SIZE SZ_128K 42#define LPC32XX_IRAM_BANK_SIZE SZ_128K
@@ -87,81 +67,6 @@ u32 lpc32xx_return_iram_size(void)
87} 67}
88EXPORT_SYMBOL_GPL(lpc32xx_return_iram_size); 68EXPORT_SYMBOL_GPL(lpc32xx_return_iram_size);
89 69
90/*
91 * Computes PLL rate from PLL register and input clock
92 */
93u32 clk_check_pll_setup(u32 ifreq, struct clk_pll_setup *pllsetup)
94{
95 u32 ilfreq, p, m, n, fcco, fref, cfreq;
96 int mode;
97
98 /*
99 * PLL requirements
100 * ifreq must be >= 1MHz and <= 20MHz
101 * FCCO must be >= 156MHz and <= 320MHz
102 * FREF must be >= 1MHz and <= 27MHz
103 * Assume the passed input data is not valid
104 */
105
106 ilfreq = ifreq;
107 m = pllsetup->pll_m;
108 n = pllsetup->pll_n;
109 p = pllsetup->pll_p;
110
111 mode = (pllsetup->cco_bypass_b15 << 2) |
112 (pllsetup->direct_output_b14 << 1) |
113 pllsetup->fdbk_div_ctrl_b13;
114
115 switch (mode) {
116 case 0x0: /* Non-integer mode */
117 cfreq = (m * ilfreq) / (2 * p * n);
118 fcco = (m * ilfreq) / n;
119 fref = ilfreq / n;
120 break;
121
122 case 0x1: /* integer mode */
123 cfreq = (m * ilfreq) / n;
124 fcco = (m * ilfreq) / (n * 2 * p);
125 fref = ilfreq / n;
126 break;
127
128 case 0x2:
129 case 0x3: /* Direct mode */
130 cfreq = (m * ilfreq) / n;
131 fcco = cfreq;
132 fref = ilfreq / n;
133 break;
134
135 case 0x4:
136 case 0x5: /* Bypass mode */
137 cfreq = ilfreq / (2 * p);
138 fcco = 156000000;
139 fref = 1000000;
140 break;
141
142 case 0x6:
143 case 0x7: /* Direct bypass mode */
144 default:
145 cfreq = ilfreq;
146 fcco = 156000000;
147 fref = 1000000;
148 break;
149 }
150
151 if (fcco < 156000000 || fcco > 320000000)
152 cfreq = 0;
153
154 if (fref < 1000000 || fref > 27000000)
155 cfreq = 0;
156
157 return (u32) cfreq;
158}
159
160u32 clk_get_pclk_div(void)
161{
162 return 1 + ((__raw_readl(LPC32XX_CLKPWR_HCLK_DIV) >> 2) & 0x1F);
163}
164
165static struct map_desc lpc32xx_io_desc[] __initdata = { 70static struct map_desc lpc32xx_io_desc[] __initdata = {
166 { 71 {
167 .virtual = (unsigned long)IO_ADDRESS(LPC32XX_AHB0_START), 72 .virtual = (unsigned long)IO_ADDRESS(LPC32XX_AHB0_START),
diff --git a/arch/arm/mach-lpc32xx/common.h b/arch/arm/mach-lpc32xx/common.h
index 2d90801ed1e1..30c9e64fc65b 100644
--- a/arch/arm/mach-lpc32xx/common.h
+++ b/arch/arm/mach-lpc32xx/common.h
@@ -19,37 +19,15 @@
19#ifndef __LPC32XX_COMMON_H 19#ifndef __LPC32XX_COMMON_H
20#define __LPC32XX_COMMON_H 20#define __LPC32XX_COMMON_H
21 21
22#include <mach/board.h> 22#include <linux/init.h>
23#include <linux/platform_device.h>
24#include <linux/reboot.h>
25 23
26/* 24/*
27 * Other arch specific structures and functions 25 * Other arch specific structures and functions
28 */ 26 */
29extern void lpc32xx_timer_init(void);
30extern void __init lpc32xx_init_irq(void); 27extern void __init lpc32xx_init_irq(void);
31extern void __init lpc32xx_map_io(void); 28extern void __init lpc32xx_map_io(void);
32extern void __init lpc32xx_serial_init(void); 29extern void __init lpc32xx_serial_init(void);
33 30
34
35/*
36 * Structure used for setting up and querying the PLLS
37 */
38struct clk_pll_setup {
39 int analog_on;
40 int cco_bypass_b15;
41 int direct_output_b14;
42 int fdbk_div_ctrl_b13;
43 int pll_p;
44 int pll_n;
45 u32 pll_m;
46};
47
48extern int clk_is_sysclk_mainosc(void);
49extern u32 clk_check_pll_setup(u32 ifreq, struct clk_pll_setup *pllsetup);
50extern u32 clk_get_pllrate_from_reg(u32 inputclk, u32 regval);
51extern u32 clk_get_pclk_div(void);
52
53/* 31/*
54 * Returns the LPC32xx unique 128-bit chip ID 32 * Returns the LPC32xx unique 128-bit chip ID
55 */ 33 */
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index f9209d091c4b..81265e80302d 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -159,7 +159,7 @@ static struct lpc32xx_mlc_platform_data lpc32xx_mlc_data = {
159 .dma_filter = pl08x_filter_id, 159 .dma_filter = pl08x_filter_id,
160}; 160};
161 161
162static const struct of_dev_auxdata const lpc32xx_auxdata_lookup[] __initconst = { 162static const struct of_dev_auxdata lpc32xx_auxdata_lookup[] __initconst = {
163 OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", NULL), 163 OF_DEV_AUXDATA("arm,pl022", 0x20084000, "dev:ssp0", NULL),
164 OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", NULL), 164 OF_DEV_AUXDATA("arm,pl022", 0x2008C000, "dev:ssp1", NULL),
165 OF_DEV_AUXDATA("arm,pl110", 0x31040000, "dev:clcd", &lpc32xx_clcd_data), 165 OF_DEV_AUXDATA("arm,pl110", 0x31040000, "dev:clcd", &lpc32xx_clcd_data),
diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig
index 8ced4ad94af0..70e49d54434e 100644
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -10,6 +10,10 @@ menuconfig ARCH_MEDIATEK
10 10
11if ARCH_MEDIATEK 11if ARCH_MEDIATEK
12 12
13config MACH_MT2701
14 bool "MediaTek MT2701 SoCs support"
15 default ARCH_MEDIATEK
16
13config MACH_MT6589 17config MACH_MT6589
14 bool "MediaTek MT6589 SoCs support" 18 bool "MediaTek MT6589 SoCs support"
15 default ARCH_MEDIATEK 19 default ARCH_MEDIATEK
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 99cc93900a24..45a05207b418 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -168,8 +168,7 @@ static struct clk *tclk;
168 168
169static void __init clk_init(void) 169static void __init clk_init(void)
170{ 170{
171 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT, 171 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, 0, get_tclk());
172 get_tclk());
173 172
174 orion_clkdev_init(tclk); 173 orion_clkdev_init(tclk);
175} 174}
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 0ba6a0e6fa19..04e276ce8413 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ 5ccflags-y := -I$(srctree)/$(src)/include \
6 -I$(srctree)/arch/arm/plat-omap/include 6 -I$(srctree)/arch/arm/plat-omap/include
7 7
8# Common support 8# Common support
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 2c04f2741476..0c4754386532 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -327,6 +327,11 @@ static int irq_cpu_hotplug_notify(struct notifier_block *self,
327{ 327{
328 unsigned int cpu = (unsigned int)hcpu; 328 unsigned int cpu = (unsigned int)hcpu;
329 329
330 /*
331 * Corresponding FROZEN transitions do not have to be handled,
332 * they are handled by at a higher level
333 * (drivers/cpuidle/coupled.c).
334 */
330 switch (action) { 335 switch (action) {
331 case CPU_ONLINE: 336 case CPU_ONLINE:
332 wakeupgen_irqmask_all(cpu, 0); 337 wakeupgen_irqmask_all(cpu, 0);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 2af6ff63e3b4..83cb527755a9 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2207,15 +2207,15 @@ static int _idle(struct omap_hwmod *oh)
2207 2207
2208 pr_debug("omap_hwmod: %s: idling\n", oh->name); 2208 pr_debug("omap_hwmod: %s: idling\n", oh->name);
2209 2209
2210 if (_are_all_hardreset_lines_asserted(oh))
2211 return 0;
2212
2210 if (oh->_state != _HWMOD_STATE_ENABLED) { 2213 if (oh->_state != _HWMOD_STATE_ENABLED) {
2211 WARN(1, "omap_hwmod: %s: idle state can only be entered from enabled state\n", 2214 WARN(1, "omap_hwmod: %s: idle state can only be entered from enabled state\n",
2212 oh->name); 2215 oh->name);
2213 return -EINVAL; 2216 return -EINVAL;
2214 } 2217 }
2215 2218
2216 if (_are_all_hardreset_lines_asserted(oh))
2217 return 0;
2218
2219 if (oh->class->sysc) 2219 if (oh->class->sysc)
2220 _idle_sysc(oh); 2220 _idle_sysc(oh);
2221 _del_initiator_dep(oh, mpu_oh); 2221 _del_initiator_dep(oh, mpu_oh);
@@ -2262,6 +2262,9 @@ static int _shutdown(struct omap_hwmod *oh)
2262 int ret, i; 2262 int ret, i;
2263 u8 prev_state; 2263 u8 prev_state;
2264 2264
2265 if (_are_all_hardreset_lines_asserted(oh))
2266 return 0;
2267
2265 if (oh->_state != _HWMOD_STATE_IDLE && 2268 if (oh->_state != _HWMOD_STATE_IDLE &&
2266 oh->_state != _HWMOD_STATE_ENABLED) { 2269 oh->_state != _HWMOD_STATE_ENABLED) {
2267 WARN(1, "omap_hwmod: %s: disabled state can only be entered from idle, or enabled state\n", 2270 WARN(1, "omap_hwmod: %s: disabled state can only be entered from idle, or enabled state\n",
@@ -2269,9 +2272,6 @@ static int _shutdown(struct omap_hwmod *oh)
2269 return -EINVAL; 2272 return -EINVAL;
2270 } 2273 }
2271 2274
2272 if (_are_all_hardreset_lines_asserted(oh))
2273 return 0;
2274
2275 pr_debug("omap_hwmod: %s: disabling\n", oh->name); 2275 pr_debug("omap_hwmod: %s: disabling\n", oh->name);
2276 2276
2277 if (oh->class->pre_shutdown) { 2277 if (oh->class->pre_shutdown) {
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index 7c7a31169475..4041bad79a9a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -754,6 +754,8 @@ const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
754 */ 754 */
755 755
756extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh); 756extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh);
757void omap_hwmod_rtc_unlock(struct omap_hwmod *oh);
758void omap_hwmod_rtc_lock(struct omap_hwmod *oh);
757 759
758/* 760/*
759 * Chip variant-specific hwmod init routines - XXX should be converted 761 * Chip variant-specific hwmod init routines - XXX should be converted
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 907a452b78ea..aed33621deeb 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
@@ -918,6 +918,8 @@ static struct omap_hwmod_class_sysconfig am33xx_rtc_sysc = {
918static struct omap_hwmod_class am33xx_rtc_hwmod_class = { 918static struct omap_hwmod_class am33xx_rtc_hwmod_class = {
919 .name = "rtc", 919 .name = "rtc",
920 .sysc = &am33xx_rtc_sysc, 920 .sysc = &am33xx_rtc_sysc,
921 .unlock = &omap_hwmod_rtc_unlock,
922 .lock = &omap_hwmod_rtc_lock,
921}; 923};
922 924
923struct omap_hwmod am33xx_rtc_hwmod = { 925struct omap_hwmod am33xx_rtc_hwmod = {
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index 9442d89bd229..d0e7e5259ec3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -383,6 +383,68 @@ static struct omap_hwmod dra7xx_dcan2_hwmod = {
383 }, 383 },
384}; 384};
385 385
386/* pwmss */
387static struct omap_hwmod_class_sysconfig dra7xx_epwmss_sysc = {
388 .rev_offs = 0x0,
389 .sysc_offs = 0x4,
390 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET,
391 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
392 .sysc_fields = &omap_hwmod_sysc_type2,
393};
394
395/*
396 * epwmss class
397 */
398static struct omap_hwmod_class dra7xx_epwmss_hwmod_class = {
399 .name = "epwmss",
400 .sysc = &dra7xx_epwmss_sysc,
401};
402
403/* epwmss0 */
404static struct omap_hwmod dra7xx_epwmss0_hwmod = {
405 .name = "epwmss0",
406 .class = &dra7xx_epwmss_hwmod_class,
407 .clkdm_name = "l4per2_clkdm",
408 .main_clk = "l4_root_clk_div",
409 .prcm = {
410 .omap4 = {
411 .modulemode = MODULEMODE_SWCTRL,
412 .clkctrl_offs = DRA7XX_CM_L4PER2_PWMSS1_CLKCTRL_OFFSET,
413 .context_offs = DRA7XX_RM_L4PER2_PWMSS1_CONTEXT_OFFSET,
414 },
415 },
416};
417
418/* epwmss1 */
419static struct omap_hwmod dra7xx_epwmss1_hwmod = {
420 .name = "epwmss1",
421 .class = &dra7xx_epwmss_hwmod_class,
422 .clkdm_name = "l4per2_clkdm",
423 .main_clk = "l4_root_clk_div",
424 .prcm = {
425 .omap4 = {
426 .modulemode = MODULEMODE_SWCTRL,
427 .clkctrl_offs = DRA7XX_CM_L4PER2_PWMSS2_CLKCTRL_OFFSET,
428 .context_offs = DRA7XX_RM_L4PER2_PWMSS2_CONTEXT_OFFSET,
429 },
430 },
431};
432
433/* epwmss2 */
434static struct omap_hwmod dra7xx_epwmss2_hwmod = {
435 .name = "epwmss2",
436 .class = &dra7xx_epwmss_hwmod_class,
437 .clkdm_name = "l4per2_clkdm",
438 .main_clk = "l4_root_clk_div",
439 .prcm = {
440 .omap4 = {
441 .modulemode = MODULEMODE_SWCTRL,
442 .clkctrl_offs = DRA7XX_CM_L4PER2_PWMSS3_CLKCTRL_OFFSET,
443 .context_offs = DRA7XX_RM_L4PER2_PWMSS3_CONTEXT_OFFSET,
444 },
445 },
446};
447
386/* 448/*
387 * 'dma' class 449 * 'dma' class
388 * 450 *
@@ -1374,6 +1436,52 @@ static struct omap_hwmod_class dra7xx_mcasp_hwmod_class = {
1374 .sysc = &dra7xx_mcasp_sysc, 1436 .sysc = &dra7xx_mcasp_sysc,
1375}; 1437};
1376 1438
1439/* mcasp1 */
1440static struct omap_hwmod_opt_clk mcasp1_opt_clks[] = {
1441 { .role = "ahclkx", .clk = "mcasp1_ahclkx_mux" },
1442 { .role = "ahclkr", .clk = "mcasp1_ahclkr_mux" },
1443};
1444
1445static struct omap_hwmod dra7xx_mcasp1_hwmod = {
1446 .name = "mcasp1",
1447 .class = &dra7xx_mcasp_hwmod_class,
1448 .clkdm_name = "ipu_clkdm",
1449 .main_clk = "mcasp1_aux_gfclk_mux",
1450 .flags = HWMOD_OPT_CLKS_NEEDED,
1451 .prcm = {
1452 .omap4 = {
1453 .clkctrl_offs = DRA7XX_CM_IPU_MCASP1_CLKCTRL_OFFSET,
1454 .context_offs = DRA7XX_RM_IPU_MCASP1_CONTEXT_OFFSET,
1455 .modulemode = MODULEMODE_SWCTRL,
1456 },
1457 },
1458 .opt_clks = mcasp1_opt_clks,
1459 .opt_clks_cnt = ARRAY_SIZE(mcasp1_opt_clks),
1460};
1461
1462/* mcasp2 */
1463static struct omap_hwmod_opt_clk mcasp2_opt_clks[] = {
1464 { .role = "ahclkx", .clk = "mcasp2_ahclkx_mux" },
1465 { .role = "ahclkr", .clk = "mcasp2_ahclkr_mux" },
1466};
1467
1468static struct omap_hwmod dra7xx_mcasp2_hwmod = {
1469 .name = "mcasp2",
1470 .class = &dra7xx_mcasp_hwmod_class,
1471 .clkdm_name = "l4per2_clkdm",
1472 .main_clk = "mcasp2_aux_gfclk_mux",
1473 .flags = HWMOD_OPT_CLKS_NEEDED,
1474 .prcm = {
1475 .omap4 = {
1476 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP2_CLKCTRL_OFFSET,
1477 .context_offs = DRA7XX_RM_L4PER2_MCASP2_CONTEXT_OFFSET,
1478 .modulemode = MODULEMODE_SWCTRL,
1479 },
1480 },
1481 .opt_clks = mcasp2_opt_clks,
1482 .opt_clks_cnt = ARRAY_SIZE(mcasp2_opt_clks),
1483};
1484
1377/* mcasp3 */ 1485/* mcasp3 */
1378static struct omap_hwmod_opt_clk mcasp3_opt_clks[] = { 1486static struct omap_hwmod_opt_clk mcasp3_opt_clks[] = {
1379 { .role = "ahclkx", .clk = "mcasp3_ahclkx_mux" }, 1487 { .role = "ahclkx", .clk = "mcasp3_ahclkx_mux" },
@@ -1396,6 +1504,116 @@ static struct omap_hwmod dra7xx_mcasp3_hwmod = {
1396 .opt_clks_cnt = ARRAY_SIZE(mcasp3_opt_clks), 1504 .opt_clks_cnt = ARRAY_SIZE(mcasp3_opt_clks),
1397}; 1505};
1398 1506
1507/* mcasp4 */
1508static struct omap_hwmod_opt_clk mcasp4_opt_clks[] = {
1509 { .role = "ahclkx", .clk = "mcasp4_ahclkx_mux" },
1510};
1511
1512static struct omap_hwmod dra7xx_mcasp4_hwmod = {
1513 .name = "mcasp4",
1514 .class = &dra7xx_mcasp_hwmod_class,
1515 .clkdm_name = "l4per2_clkdm",
1516 .main_clk = "mcasp4_aux_gfclk_mux",
1517 .flags = HWMOD_OPT_CLKS_NEEDED,
1518 .prcm = {
1519 .omap4 = {
1520 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP4_CLKCTRL_OFFSET,
1521 .context_offs = DRA7XX_RM_L4PER2_MCASP4_CONTEXT_OFFSET,
1522 .modulemode = MODULEMODE_SWCTRL,
1523 },
1524 },
1525 .opt_clks = mcasp4_opt_clks,
1526 .opt_clks_cnt = ARRAY_SIZE(mcasp4_opt_clks),
1527};
1528
1529/* mcasp5 */
1530static struct omap_hwmod_opt_clk mcasp5_opt_clks[] = {
1531 { .role = "ahclkx", .clk = "mcasp5_ahclkx_mux" },
1532};
1533
1534static struct omap_hwmod dra7xx_mcasp5_hwmod = {
1535 .name = "mcasp5",
1536 .class = &dra7xx_mcasp_hwmod_class,
1537 .clkdm_name = "l4per2_clkdm",
1538 .main_clk = "mcasp5_aux_gfclk_mux",
1539 .flags = HWMOD_OPT_CLKS_NEEDED,
1540 .prcm = {
1541 .omap4 = {
1542 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP5_CLKCTRL_OFFSET,
1543 .context_offs = DRA7XX_RM_L4PER2_MCASP5_CONTEXT_OFFSET,
1544 .modulemode = MODULEMODE_SWCTRL,
1545 },
1546 },
1547 .opt_clks = mcasp5_opt_clks,
1548 .opt_clks_cnt = ARRAY_SIZE(mcasp5_opt_clks),
1549};
1550
1551/* mcasp6 */
1552static struct omap_hwmod_opt_clk mcasp6_opt_clks[] = {
1553 { .role = "ahclkx", .clk = "mcasp6_ahclkx_mux" },
1554};
1555
1556static struct omap_hwmod dra7xx_mcasp6_hwmod = {
1557 .name = "mcasp6",
1558 .class = &dra7xx_mcasp_hwmod_class,
1559 .clkdm_name = "l4per2_clkdm",
1560 .main_clk = "mcasp6_aux_gfclk_mux",
1561 .flags = HWMOD_OPT_CLKS_NEEDED,
1562 .prcm = {
1563 .omap4 = {
1564 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP6_CLKCTRL_OFFSET,
1565 .context_offs = DRA7XX_RM_L4PER2_MCASP6_CONTEXT_OFFSET,
1566 .modulemode = MODULEMODE_SWCTRL,
1567 },
1568 },
1569 .opt_clks = mcasp6_opt_clks,
1570 .opt_clks_cnt = ARRAY_SIZE(mcasp6_opt_clks),
1571};
1572
1573/* mcasp7 */
1574static struct omap_hwmod_opt_clk mcasp7_opt_clks[] = {
1575 { .role = "ahclkx", .clk = "mcasp7_ahclkx_mux" },
1576};
1577
1578static struct omap_hwmod dra7xx_mcasp7_hwmod = {
1579 .name = "mcasp7",
1580 .class = &dra7xx_mcasp_hwmod_class,
1581 .clkdm_name = "l4per2_clkdm",
1582 .main_clk = "mcasp7_aux_gfclk_mux",
1583 .flags = HWMOD_OPT_CLKS_NEEDED,
1584 .prcm = {
1585 .omap4 = {
1586 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP7_CLKCTRL_OFFSET,
1587 .context_offs = DRA7XX_RM_L4PER2_MCASP7_CONTEXT_OFFSET,
1588 .modulemode = MODULEMODE_SWCTRL,
1589 },
1590 },
1591 .opt_clks = mcasp7_opt_clks,
1592 .opt_clks_cnt = ARRAY_SIZE(mcasp7_opt_clks),
1593};
1594
1595/* mcasp8 */
1596static struct omap_hwmod_opt_clk mcasp8_opt_clks[] = {
1597 { .role = "ahclkx", .clk = "mcasp8_ahclkx_mux" },
1598};
1599
1600static struct omap_hwmod dra7xx_mcasp8_hwmod = {
1601 .name = "mcasp8",
1602 .class = &dra7xx_mcasp_hwmod_class,
1603 .clkdm_name = "l4per2_clkdm",
1604 .main_clk = "mcasp8_aux_gfclk_mux",
1605 .flags = HWMOD_OPT_CLKS_NEEDED,
1606 .prcm = {
1607 .omap4 = {
1608 .clkctrl_offs = DRA7XX_CM_L4PER2_MCASP8_CLKCTRL_OFFSET,
1609 .context_offs = DRA7XX_RM_L4PER2_MCASP8_CONTEXT_OFFSET,
1610 .modulemode = MODULEMODE_SWCTRL,
1611 },
1612 },
1613 .opt_clks = mcasp8_opt_clks,
1614 .opt_clks_cnt = ARRAY_SIZE(mcasp8_opt_clks),
1615};
1616
1399/* 1617/*
1400 * 'mmc' class 1618 * 'mmc' class
1401 * 1619 *
@@ -1707,6 +1925,8 @@ static struct omap_hwmod_class_sysconfig dra7xx_rtcss_sysc = {
1707static struct omap_hwmod_class dra7xx_rtcss_hwmod_class = { 1925static struct omap_hwmod_class dra7xx_rtcss_hwmod_class = {
1708 .name = "rtcss", 1926 .name = "rtcss",
1709 .sysc = &dra7xx_rtcss_sysc, 1927 .sysc = &dra7xx_rtcss_sysc,
1928 .unlock = &omap_hwmod_rtc_unlock,
1929 .lock = &omap_hwmod_rtc_lock,
1710}; 1930};
1711 1931
1712/* rtcss */ 1932/* rtcss */
@@ -2065,6 +2285,20 @@ static struct omap_hwmod dra7xx_timer11_hwmod = {
2065 }, 2285 },
2066}; 2286};
2067 2287
2288/* timer12 */
2289static struct omap_hwmod dra7xx_timer12_hwmod = {
2290 .name = "timer12",
2291 .class = &dra7xx_timer_hwmod_class,
2292 .clkdm_name = "wkupaon_clkdm",
2293 .main_clk = "secure_32k_clk_src_ck",
2294 .prcm = {
2295 .omap4 = {
2296 .clkctrl_offs = DRA7XX_CM_WKUPAON_TIMER12_CLKCTRL_OFFSET,
2297 .context_offs = DRA7XX_RM_WKUPAON_TIMER12_CONTEXT_OFFSET,
2298 },
2299 },
2300};
2301
2068/* timer13 */ 2302/* timer13 */
2069static struct omap_hwmod dra7xx_timer13_hwmod = { 2303static struct omap_hwmod dra7xx_timer13_hwmod = {
2070 .name = "timer13", 2304 .name = "timer13",
@@ -2726,6 +2960,38 @@ static struct omap_hwmod_ocp_if dra7xx_l3_main_1__hdmi = {
2726 .user = OCP_USER_MPU | OCP_USER_SDMA, 2960 .user = OCP_USER_MPU | OCP_USER_SDMA,
2727}; 2961};
2728 2962
2963/* l4_per2 -> mcasp1 */
2964static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp1 = {
2965 .master = &dra7xx_l4_per2_hwmod,
2966 .slave = &dra7xx_mcasp1_hwmod,
2967 .clk = "l4_root_clk_div",
2968 .user = OCP_USER_MPU | OCP_USER_SDMA,
2969};
2970
2971/* l3_main_1 -> mcasp1 */
2972static struct omap_hwmod_ocp_if dra7xx_l3_main_1__mcasp1 = {
2973 .master = &dra7xx_l3_main_1_hwmod,
2974 .slave = &dra7xx_mcasp1_hwmod,
2975 .clk = "l3_iclk_div",
2976 .user = OCP_USER_MPU | OCP_USER_SDMA,
2977};
2978
2979/* l4_per2 -> mcasp2 */
2980static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp2 = {
2981 .master = &dra7xx_l4_per2_hwmod,
2982 .slave = &dra7xx_mcasp2_hwmod,
2983 .clk = "l4_root_clk_div",
2984 .user = OCP_USER_MPU | OCP_USER_SDMA,
2985};
2986
2987/* l3_main_1 -> mcasp2 */
2988static struct omap_hwmod_ocp_if dra7xx_l3_main_1__mcasp2 = {
2989 .master = &dra7xx_l3_main_1_hwmod,
2990 .slave = &dra7xx_mcasp2_hwmod,
2991 .clk = "l3_iclk_div",
2992 .user = OCP_USER_MPU | OCP_USER_SDMA,
2993};
2994
2729/* l4_per2 -> mcasp3 */ 2995/* l4_per2 -> mcasp3 */
2730static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp3 = { 2996static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp3 = {
2731 .master = &dra7xx_l4_per2_hwmod, 2997 .master = &dra7xx_l4_per2_hwmod,
@@ -2742,6 +3008,46 @@ static struct omap_hwmod_ocp_if dra7xx_l3_main_1__mcasp3 = {
2742 .user = OCP_USER_MPU | OCP_USER_SDMA, 3008 .user = OCP_USER_MPU | OCP_USER_SDMA,
2743}; 3009};
2744 3010
3011/* l4_per2 -> mcasp4 */
3012static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp4 = {
3013 .master = &dra7xx_l4_per2_hwmod,
3014 .slave = &dra7xx_mcasp4_hwmod,
3015 .clk = "l4_root_clk_div",
3016 .user = OCP_USER_MPU | OCP_USER_SDMA,
3017};
3018
3019/* l4_per2 -> mcasp5 */
3020static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp5 = {
3021 .master = &dra7xx_l4_per2_hwmod,
3022 .slave = &dra7xx_mcasp5_hwmod,
3023 .clk = "l4_root_clk_div",
3024 .user = OCP_USER_MPU | OCP_USER_SDMA,
3025};
3026
3027/* l4_per2 -> mcasp6 */
3028static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp6 = {
3029 .master = &dra7xx_l4_per2_hwmod,
3030 .slave = &dra7xx_mcasp6_hwmod,
3031 .clk = "l4_root_clk_div",
3032 .user = OCP_USER_MPU | OCP_USER_SDMA,
3033};
3034
3035/* l4_per2 -> mcasp7 */
3036static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp7 = {
3037 .master = &dra7xx_l4_per2_hwmod,
3038 .slave = &dra7xx_mcasp7_hwmod,
3039 .clk = "l4_root_clk_div",
3040 .user = OCP_USER_MPU | OCP_USER_SDMA,
3041};
3042
3043/* l4_per2 -> mcasp8 */
3044static struct omap_hwmod_ocp_if dra7xx_l4_per2__mcasp8 = {
3045 .master = &dra7xx_l4_per2_hwmod,
3046 .slave = &dra7xx_mcasp8_hwmod,
3047 .clk = "l4_root_clk_div",
3048 .user = OCP_USER_MPU | OCP_USER_SDMA,
3049};
3050
2745/* l4_per1 -> elm */ 3051/* l4_per1 -> elm */
2746static struct omap_hwmod_ocp_if dra7xx_l4_per1__elm = { 3052static struct omap_hwmod_ocp_if dra7xx_l4_per1__elm = {
2747 .master = &dra7xx_l4_per1_hwmod, 3053 .master = &dra7xx_l4_per1_hwmod,
@@ -3281,6 +3587,14 @@ static struct omap_hwmod_ocp_if dra7xx_l4_per1__timer11 = {
3281 .user = OCP_USER_MPU | OCP_USER_SDMA, 3587 .user = OCP_USER_MPU | OCP_USER_SDMA,
3282}; 3588};
3283 3589
3590/* l4_wkup -> timer12 */
3591static struct omap_hwmod_ocp_if dra7xx_l4_wkup__timer12 = {
3592 .master = &dra7xx_l4_wkup_hwmod,
3593 .slave = &dra7xx_timer12_hwmod,
3594 .clk = "wkupaon_iclk_mux",
3595 .user = OCP_USER_MPU | OCP_USER_SDMA,
3596};
3597
3284/* l4_per3 -> timer13 */ 3598/* l4_per3 -> timer13 */
3285static struct omap_hwmod_ocp_if dra7xx_l4_per3__timer13 = { 3599static struct omap_hwmod_ocp_if dra7xx_l4_per3__timer13 = {
3286 .master = &dra7xx_l4_per3_hwmod, 3600 .master = &dra7xx_l4_per3_hwmod,
@@ -3465,6 +3779,30 @@ static struct omap_hwmod_ocp_if dra7xx_l4_wkup__wd_timer2 = {
3465 .user = OCP_USER_MPU | OCP_USER_SDMA, 3779 .user = OCP_USER_MPU | OCP_USER_SDMA,
3466}; 3780};
3467 3781
3782/* l4_per2 -> epwmss0 */
3783static struct omap_hwmod_ocp_if dra7xx_l4_per2__epwmss0 = {
3784 .master = &dra7xx_l4_per2_hwmod,
3785 .slave = &dra7xx_epwmss0_hwmod,
3786 .clk = "l4_root_clk_div",
3787 .user = OCP_USER_MPU,
3788};
3789
3790/* l4_per2 -> epwmss1 */
3791static struct omap_hwmod_ocp_if dra7xx_l4_per2__epwmss1 = {
3792 .master = &dra7xx_l4_per2_hwmod,
3793 .slave = &dra7xx_epwmss1_hwmod,
3794 .clk = "l4_root_clk_div",
3795 .user = OCP_USER_MPU,
3796};
3797
3798/* l4_per2 -> epwmss2 */
3799static struct omap_hwmod_ocp_if dra7xx_l4_per2__epwmss2 = {
3800 .master = &dra7xx_l4_per2_hwmod,
3801 .slave = &dra7xx_epwmss2_hwmod,
3802 .clk = "l4_root_clk_div",
3803 .user = OCP_USER_MPU,
3804};
3805
3468static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = { 3806static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
3469 &dra7xx_l3_main_1__dmm, 3807 &dra7xx_l3_main_1__dmm,
3470 &dra7xx_l3_main_2__l3_instr, 3808 &dra7xx_l3_main_2__l3_instr,
@@ -3484,8 +3822,17 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
3484 &dra7xx_l4_wkup__dcan1, 3822 &dra7xx_l4_wkup__dcan1,
3485 &dra7xx_l4_per2__dcan2, 3823 &dra7xx_l4_per2__dcan2,
3486 &dra7xx_l4_per2__cpgmac0, 3824 &dra7xx_l4_per2__cpgmac0,
3825 &dra7xx_l4_per2__mcasp1,
3826 &dra7xx_l3_main_1__mcasp1,
3827 &dra7xx_l4_per2__mcasp2,
3828 &dra7xx_l3_main_1__mcasp2,
3487 &dra7xx_l4_per2__mcasp3, 3829 &dra7xx_l4_per2__mcasp3,
3488 &dra7xx_l3_main_1__mcasp3, 3830 &dra7xx_l3_main_1__mcasp3,
3831 &dra7xx_l4_per2__mcasp4,
3832 &dra7xx_l4_per2__mcasp5,
3833 &dra7xx_l4_per2__mcasp6,
3834 &dra7xx_l4_per2__mcasp7,
3835 &dra7xx_l4_per2__mcasp8,
3489 &dra7xx_gmac__mdio, 3836 &dra7xx_gmac__mdio,
3490 &dra7xx_l4_cfg__dma_system, 3837 &dra7xx_l4_cfg__dma_system,
3491 &dra7xx_l3_main_1__tpcc, 3838 &dra7xx_l3_main_1__tpcc,
@@ -3577,9 +3924,19 @@ static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
3577 &dra7xx_l3_main_1__vcp2, 3924 &dra7xx_l3_main_1__vcp2,
3578 &dra7xx_l4_per2__vcp2, 3925 &dra7xx_l4_per2__vcp2,
3579 &dra7xx_l4_wkup__wd_timer2, 3926 &dra7xx_l4_wkup__wd_timer2,
3927 &dra7xx_l4_per2__epwmss0,
3928 &dra7xx_l4_per2__epwmss1,
3929 &dra7xx_l4_per2__epwmss2,
3930 NULL,
3931};
3932
3933/* GP-only hwmod links */
3934static struct omap_hwmod_ocp_if *dra7xx_gp_hwmod_ocp_ifs[] __initdata = {
3935 &dra7xx_l4_wkup__timer12,
3580 NULL, 3936 NULL,
3581}; 3937};
3582 3938
3939/* SoC variant specific hwmod links */
3583static struct omap_hwmod_ocp_if *dra74x_hwmod_ocp_ifs[] __initdata = { 3940static struct omap_hwmod_ocp_if *dra74x_hwmod_ocp_ifs[] __initdata = {
3584 &dra7xx_l4_per3__usb_otg_ss4, 3941 &dra7xx_l4_per3__usb_otg_ss4,
3585 NULL, 3942 NULL,
@@ -3597,9 +3954,12 @@ int __init dra7xx_hwmod_init(void)
3597 ret = omap_hwmod_register_links(dra7xx_hwmod_ocp_ifs); 3954 ret = omap_hwmod_register_links(dra7xx_hwmod_ocp_ifs);
3598 3955
3599 if (!ret && soc_is_dra74x()) 3956 if (!ret && soc_is_dra74x())
3600 return omap_hwmod_register_links(dra74x_hwmod_ocp_ifs); 3957 ret = omap_hwmod_register_links(dra74x_hwmod_ocp_ifs);
3601 else if (!ret && soc_is_dra72x()) 3958 else if (!ret && soc_is_dra72x())
3602 return omap_hwmod_register_links(dra72x_hwmod_ocp_ifs); 3959 ret = omap_hwmod_register_links(dra72x_hwmod_ocp_ifs);
3960
3961 if (!ret && omap_type() == OMAP2_DEVICE_TYPE_GP)
3962 ret = omap_hwmod_register_links(dra7xx_gp_hwmod_ocp_ifs);
3603 3963
3604 return ret; 3964 return ret;
3605} 3965}
diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c
index 65e186c9df55..b68f9c0aff0b 100644
--- a/arch/arm/mach-omap2/omap_hwmod_reset.c
+++ b/arch/arm/mach-omap2/omap_hwmod_reset.c
@@ -29,6 +29,16 @@
29#include <sound/aess.h> 29#include <sound/aess.h>
30 30
31#include "omap_hwmod.h" 31#include "omap_hwmod.h"
32#include "common.h"
33
34#define OMAP_RTC_STATUS_REG 0x44
35#define OMAP_RTC_KICK0_REG 0x6c
36#define OMAP_RTC_KICK1_REG 0x70
37
38#define OMAP_RTC_KICK0_VALUE 0x83E70B13
39#define OMAP_RTC_KICK1_VALUE 0x95A4F1E0
40#define OMAP_RTC_STATUS_BUSY BIT(0)
41#define OMAP_RTC_MAX_READY_TIME 50
32 42
33/** 43/**
34 * omap_hwmod_aess_preprogram - enable AESS internal autogating 44 * omap_hwmod_aess_preprogram - enable AESS internal autogating
@@ -51,3 +61,58 @@ int omap_hwmod_aess_preprogram(struct omap_hwmod *oh)
51 61
52 return 0; 62 return 0;
53} 63}
64
65/**
66 * omap_rtc_wait_not_busy - Wait for the RTC BUSY flag
67 * @oh: struct omap_hwmod *
68 *
69 * For updating certain RTC registers, the MPU must wait
70 * for the BUSY status in OMAP_RTC_STATUS_REG to become zero.
71 * Once the BUSY status is zero, there is a 15 microseconds access
72 * period in which the MPU can program.
73 */
74static void omap_rtc_wait_not_busy(struct omap_hwmod *oh)
75{
76 int i;
77
78 /* BUSY may stay active for 1/32768 second (~30 usec) */
79 omap_test_timeout(omap_hwmod_read(oh, OMAP_RTC_STATUS_REG)
80 & OMAP_RTC_STATUS_BUSY, OMAP_RTC_MAX_READY_TIME, i);
81 /* now we have ~15 microseconds to read/write various registers */
82}
83
84/**
85 * omap_hwmod_rtc_unlock - Unlock the Kicker mechanism.
86 * @oh: struct omap_hwmod *
87 *
88 * RTC IP have kicker feature. This prevents spurious writes to its registers.
89 * In order to write into any of the RTC registers, KICK values has te be
90 * written in respective KICK registers. This is needed for hwmod to write into
91 * sysconfig register.
92 */
93void omap_hwmod_rtc_unlock(struct omap_hwmod *oh)
94{
95 local_irq_disable();
96 omap_rtc_wait_not_busy(oh);
97 omap_hwmod_write(OMAP_RTC_KICK0_VALUE, oh, OMAP_RTC_KICK0_REG);
98 omap_hwmod_write(OMAP_RTC_KICK1_VALUE, oh, OMAP_RTC_KICK1_REG);
99 local_irq_enable();
100}
101
102/**
103 * omap_hwmod_rtc_lock - Lock the Kicker mechanism.
104 * @oh: struct omap_hwmod *
105 *
106 * RTC IP have kicker feature. This prevents spurious writes to its registers.
107 * Once the RTC registers are written, KICK mechanism needs to be locked,
108 * in order to prevent any spurious writes. This function locks back the RTC
109 * registers once hwmod completes its write into sysconfig register.
110 */
111void omap_hwmod_rtc_lock(struct omap_hwmod *oh)
112{
113 local_irq_disable();
114 omap_rtc_wait_not_busy(oh);
115 omap_hwmod_write(0x0, oh, OMAP_RTC_KICK0_REG);
116 omap_hwmod_write(0x0, oh, OMAP_RTC_KICK1_REG);
117 local_irq_enable();
118}
diff --git a/arch/arm/mach-omap2/powerdomains7xx_data.c b/arch/arm/mach-omap2/powerdomains7xx_data.c
index 287a2037aa16..0ec2d00f4237 100644
--- a/arch/arm/mach-omap2/powerdomains7xx_data.c
+++ b/arch/arm/mach-omap2/powerdomains7xx_data.c
@@ -35,7 +35,7 @@ static struct powerdomain iva_7xx_pwrdm = {
35 .name = "iva_pwrdm", 35 .name = "iva_pwrdm",
36 .prcm_offs = DRA7XX_PRM_IVA_INST, 36 .prcm_offs = DRA7XX_PRM_IVA_INST,
37 .prcm_partition = DRA7XX_PRM_PARTITION, 37 .prcm_partition = DRA7XX_PRM_PARTITION,
38 .pwrsts = PWRSTS_OFF_RET_ON, 38 .pwrsts = PWRSTS_OFF_ON,
39 .pwrsts_logic_ret = PWRSTS_OFF, 39 .pwrsts_logic_ret = PWRSTS_OFF,
40 .banks = 4, 40 .banks = 4,
41 .pwrsts_mem_ret = { 41 .pwrsts_mem_ret = {
@@ -45,10 +45,10 @@ static struct powerdomain iva_7xx_pwrdm = {
45 [3] = PWRSTS_OFF_RET, /* tcm2_mem */ 45 [3] = PWRSTS_OFF_RET, /* tcm2_mem */
46 }, 46 },
47 .pwrsts_mem_on = { 47 .pwrsts_mem_on = {
48 [0] = PWRSTS_OFF_RET, /* hwa_mem */ 48 [0] = PWRSTS_ON, /* hwa_mem */
49 [1] = PWRSTS_OFF_RET, /* sl2_mem */ 49 [1] = PWRSTS_ON, /* sl2_mem */
50 [2] = PWRSTS_OFF_RET, /* tcm1_mem */ 50 [2] = PWRSTS_ON, /* tcm1_mem */
51 [3] = PWRSTS_OFF_RET, /* tcm2_mem */ 51 [3] = PWRSTS_ON, /* tcm2_mem */
52 }, 52 },
53 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 53 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
54}; 54};
@@ -75,7 +75,7 @@ static struct powerdomain ipu_7xx_pwrdm = {
75 .name = "ipu_pwrdm", 75 .name = "ipu_pwrdm",
76 .prcm_offs = DRA7XX_PRM_IPU_INST, 76 .prcm_offs = DRA7XX_PRM_IPU_INST,
77 .prcm_partition = DRA7XX_PRM_PARTITION, 77 .prcm_partition = DRA7XX_PRM_PARTITION,
78 .pwrsts = PWRSTS_OFF_RET_ON, 78 .pwrsts = PWRSTS_OFF_ON,
79 .pwrsts_logic_ret = PWRSTS_OFF, 79 .pwrsts_logic_ret = PWRSTS_OFF,
80 .banks = 2, 80 .banks = 2,
81 .pwrsts_mem_ret = { 81 .pwrsts_mem_ret = {
@@ -83,8 +83,8 @@ static struct powerdomain ipu_7xx_pwrdm = {
83 [1] = PWRSTS_OFF_RET, /* periphmem */ 83 [1] = PWRSTS_OFF_RET, /* periphmem */
84 }, 84 },
85 .pwrsts_mem_on = { 85 .pwrsts_mem_on = {
86 [0] = PWRSTS_OFF_RET, /* aessmem */ 86 [0] = PWRSTS_ON, /* aessmem */
87 [1] = PWRSTS_OFF_RET, /* periphmem */ 87 [1] = PWRSTS_ON, /* periphmem */
88 }, 88 },
89 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 89 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
90}; 90};
@@ -94,14 +94,14 @@ static struct powerdomain dss_7xx_pwrdm = {
94 .name = "dss_pwrdm", 94 .name = "dss_pwrdm",
95 .prcm_offs = DRA7XX_PRM_DSS_INST, 95 .prcm_offs = DRA7XX_PRM_DSS_INST,
96 .prcm_partition = DRA7XX_PRM_PARTITION, 96 .prcm_partition = DRA7XX_PRM_PARTITION,
97 .pwrsts = PWRSTS_OFF_RET_ON, 97 .pwrsts = PWRSTS_OFF_ON,
98 .pwrsts_logic_ret = PWRSTS_OFF, 98 .pwrsts_logic_ret = PWRSTS_OFF,
99 .banks = 1, 99 .banks = 1,
100 .pwrsts_mem_ret = { 100 .pwrsts_mem_ret = {
101 [0] = PWRSTS_OFF_RET, /* dss_mem */ 101 [0] = PWRSTS_OFF_RET, /* dss_mem */
102 }, 102 },
103 .pwrsts_mem_on = { 103 .pwrsts_mem_on = {
104 [0] = PWRSTS_OFF_RET, /* dss_mem */ 104 [0] = PWRSTS_ON, /* dss_mem */
105 }, 105 },
106 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 106 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
107}; 107};
@@ -112,15 +112,15 @@ static struct powerdomain l4per_7xx_pwrdm = {
112 .prcm_offs = DRA7XX_PRM_L4PER_INST, 112 .prcm_offs = DRA7XX_PRM_L4PER_INST,
113 .prcm_partition = DRA7XX_PRM_PARTITION, 113 .prcm_partition = DRA7XX_PRM_PARTITION,
114 .pwrsts = PWRSTS_RET_ON, 114 .pwrsts = PWRSTS_RET_ON,
115 .pwrsts_logic_ret = PWRSTS_OFF_RET, 115 .pwrsts_logic_ret = PWRSTS_RET,
116 .banks = 2, 116 .banks = 2,
117 .pwrsts_mem_ret = { 117 .pwrsts_mem_ret = {
118 [0] = PWRSTS_OFF_RET, /* nonretained_bank */ 118 [0] = PWRSTS_OFF_RET, /* nonretained_bank */
119 [1] = PWRSTS_OFF_RET, /* retained_bank */ 119 [1] = PWRSTS_OFF_RET, /* retained_bank */
120 }, 120 },
121 .pwrsts_mem_on = { 121 .pwrsts_mem_on = {
122 [0] = PWRSTS_OFF_RET, /* nonretained_bank */ 122 [0] = PWRSTS_ON, /* nonretained_bank */
123 [1] = PWRSTS_OFF_RET, /* retained_bank */ 123 [1] = PWRSTS_ON, /* retained_bank */
124 }, 124 },
125 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 125 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
126}; 126};
@@ -136,7 +136,7 @@ static struct powerdomain gpu_7xx_pwrdm = {
136 [0] = PWRSTS_OFF_RET, /* gpu_mem */ 136 [0] = PWRSTS_OFF_RET, /* gpu_mem */
137 }, 137 },
138 .pwrsts_mem_on = { 138 .pwrsts_mem_on = {
139 [0] = PWRSTS_OFF_RET, /* gpu_mem */ 139 [0] = PWRSTS_ON, /* gpu_mem */
140 }, 140 },
141 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 141 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
142}; 142};
@@ -160,7 +160,7 @@ static struct powerdomain core_7xx_pwrdm = {
160 .name = "core_pwrdm", 160 .name = "core_pwrdm",
161 .prcm_offs = DRA7XX_PRM_CORE_INST, 161 .prcm_offs = DRA7XX_PRM_CORE_INST,
162 .prcm_partition = DRA7XX_PRM_PARTITION, 162 .prcm_partition = DRA7XX_PRM_PARTITION,
163 .pwrsts = PWRSTS_INA_ON, 163 .pwrsts = PWRSTS_ON,
164 .pwrsts_logic_ret = PWRSTS_RET, 164 .pwrsts_logic_ret = PWRSTS_RET,
165 .banks = 5, 165 .banks = 5,
166 .pwrsts_mem_ret = { 166 .pwrsts_mem_ret = {
@@ -171,11 +171,11 @@ static struct powerdomain core_7xx_pwrdm = {
171 [4] = PWRSTS_OFF_RET, /* ipu_unicache */ 171 [4] = PWRSTS_OFF_RET, /* ipu_unicache */
172 }, 172 },
173 .pwrsts_mem_on = { 173 .pwrsts_mem_on = {
174 [0] = PWRSTS_OFF_RET, /* core_nret_bank */ 174 [0] = PWRSTS_ON, /* core_nret_bank */
175 [1] = PWRSTS_OFF_RET, /* core_ocmram */ 175 [1] = PWRSTS_ON, /* core_ocmram */
176 [2] = PWRSTS_OFF_RET, /* core_other_bank */ 176 [2] = PWRSTS_ON, /* core_other_bank */
177 [3] = PWRSTS_OFF_RET, /* ipu_l2ram */ 177 [3] = PWRSTS_ON, /* ipu_l2ram */
178 [4] = PWRSTS_OFF_RET, /* ipu_unicache */ 178 [4] = PWRSTS_ON, /* ipu_unicache */
179 }, 179 },
180 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 180 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
181}; 181};
@@ -225,14 +225,14 @@ static struct powerdomain vpe_7xx_pwrdm = {
225 .name = "vpe_pwrdm", 225 .name = "vpe_pwrdm",
226 .prcm_offs = DRA7XX_PRM_VPE_INST, 226 .prcm_offs = DRA7XX_PRM_VPE_INST,
227 .prcm_partition = DRA7XX_PRM_PARTITION, 227 .prcm_partition = DRA7XX_PRM_PARTITION,
228 .pwrsts = PWRSTS_OFF_RET_ON, 228 .pwrsts = PWRSTS_OFF_ON,
229 .pwrsts_logic_ret = PWRSTS_OFF_RET, 229 .pwrsts_logic_ret = PWRSTS_OFF,
230 .banks = 1, 230 .banks = 1,
231 .pwrsts_mem_ret = { 231 .pwrsts_mem_ret = {
232 [0] = PWRSTS_OFF_RET, /* vpe_bank */ 232 [0] = PWRSTS_OFF_RET, /* vpe_bank */
233 }, 233 },
234 .pwrsts_mem_on = { 234 .pwrsts_mem_on = {
235 [0] = PWRSTS_OFF_RET, /* vpe_bank */ 235 [0] = PWRSTS_ON, /* vpe_bank */
236 }, 236 },
237 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 237 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
238}; 238};
@@ -250,8 +250,8 @@ static struct powerdomain mpu_7xx_pwrdm = {
250 [1] = PWRSTS_RET, /* mpu_ram */ 250 [1] = PWRSTS_RET, /* mpu_ram */
251 }, 251 },
252 .pwrsts_mem_on = { 252 .pwrsts_mem_on = {
253 [0] = PWRSTS_OFF_RET, /* mpu_l2 */ 253 [0] = PWRSTS_ON, /* mpu_l2 */
254 [1] = PWRSTS_OFF_RET, /* mpu_ram */ 254 [1] = PWRSTS_ON, /* mpu_ram */
255 }, 255 },
256}; 256};
257 257
@@ -261,7 +261,7 @@ static struct powerdomain l3init_7xx_pwrdm = {
261 .prcm_offs = DRA7XX_PRM_L3INIT_INST, 261 .prcm_offs = DRA7XX_PRM_L3INIT_INST,
262 .prcm_partition = DRA7XX_PRM_PARTITION, 262 .prcm_partition = DRA7XX_PRM_PARTITION,
263 .pwrsts = PWRSTS_RET_ON, 263 .pwrsts = PWRSTS_RET_ON,
264 .pwrsts_logic_ret = PWRSTS_OFF_RET, 264 .pwrsts_logic_ret = PWRSTS_RET,
265 .banks = 3, 265 .banks = 3,
266 .pwrsts_mem_ret = { 266 .pwrsts_mem_ret = {
267 [0] = PWRSTS_OFF_RET, /* gmac_bank */ 267 [0] = PWRSTS_OFF_RET, /* gmac_bank */
@@ -269,9 +269,9 @@ static struct powerdomain l3init_7xx_pwrdm = {
269 [2] = PWRSTS_OFF_RET, /* l3init_bank2 */ 269 [2] = PWRSTS_OFF_RET, /* l3init_bank2 */
270 }, 270 },
271 .pwrsts_mem_on = { 271 .pwrsts_mem_on = {
272 [0] = PWRSTS_OFF_RET, /* gmac_bank */ 272 [0] = PWRSTS_ON, /* gmac_bank */
273 [1] = PWRSTS_OFF_RET, /* l3init_bank1 */ 273 [1] = PWRSTS_ON, /* l3init_bank1 */
274 [2] = PWRSTS_OFF_RET, /* l3init_bank2 */ 274 [2] = PWRSTS_ON, /* l3init_bank2 */
275 }, 275 },
276 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 276 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
277}; 277};
@@ -287,7 +287,7 @@ static struct powerdomain eve3_7xx_pwrdm = {
287 [0] = PWRSTS_OFF_RET, /* eve3_bank */ 287 [0] = PWRSTS_OFF_RET, /* eve3_bank */
288 }, 288 },
289 .pwrsts_mem_on = { 289 .pwrsts_mem_on = {
290 [0] = PWRSTS_OFF_RET, /* eve3_bank */ 290 [0] = PWRSTS_ON, /* eve3_bank */
291 }, 291 },
292 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 292 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
293}; 293};
@@ -303,7 +303,7 @@ static struct powerdomain emu_7xx_pwrdm = {
303 [0] = PWRSTS_OFF_RET, /* emu_bank */ 303 [0] = PWRSTS_OFF_RET, /* emu_bank */
304 }, 304 },
305 .pwrsts_mem_on = { 305 .pwrsts_mem_on = {
306 [0] = PWRSTS_OFF_RET, /* emu_bank */ 306 [0] = PWRSTS_ON, /* emu_bank */
307 }, 307 },
308}; 308};
309 309
@@ -320,9 +320,9 @@ static struct powerdomain dsp2_7xx_pwrdm = {
320 [2] = PWRSTS_OFF_RET, /* dsp2_l2 */ 320 [2] = PWRSTS_OFF_RET, /* dsp2_l2 */
321 }, 321 },
322 .pwrsts_mem_on = { 322 .pwrsts_mem_on = {
323 [0] = PWRSTS_OFF_RET, /* dsp2_edma */ 323 [0] = PWRSTS_ON, /* dsp2_edma */
324 [1] = PWRSTS_OFF_RET, /* dsp2_l1 */ 324 [1] = PWRSTS_ON, /* dsp2_l1 */
325 [2] = PWRSTS_OFF_RET, /* dsp2_l2 */ 325 [2] = PWRSTS_ON, /* dsp2_l2 */
326 }, 326 },
327 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 327 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
328}; 328};
@@ -340,9 +340,9 @@ static struct powerdomain dsp1_7xx_pwrdm = {
340 [2] = PWRSTS_OFF_RET, /* dsp1_l2 */ 340 [2] = PWRSTS_OFF_RET, /* dsp1_l2 */
341 }, 341 },
342 .pwrsts_mem_on = { 342 .pwrsts_mem_on = {
343 [0] = PWRSTS_OFF_RET, /* dsp1_edma */ 343 [0] = PWRSTS_ON, /* dsp1_edma */
344 [1] = PWRSTS_OFF_RET, /* dsp1_l1 */ 344 [1] = PWRSTS_ON, /* dsp1_l1 */
345 [2] = PWRSTS_OFF_RET, /* dsp1_l2 */ 345 [2] = PWRSTS_ON, /* dsp1_l2 */
346 }, 346 },
347 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 347 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
348}; 348};
@@ -358,7 +358,7 @@ static struct powerdomain cam_7xx_pwrdm = {
358 [0] = PWRSTS_OFF_RET, /* vip_bank */ 358 [0] = PWRSTS_OFF_RET, /* vip_bank */
359 }, 359 },
360 .pwrsts_mem_on = { 360 .pwrsts_mem_on = {
361 [0] = PWRSTS_OFF_RET, /* vip_bank */ 361 [0] = PWRSTS_ON, /* vip_bank */
362 }, 362 },
363 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 363 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
364}; 364};
@@ -374,7 +374,7 @@ static struct powerdomain eve4_7xx_pwrdm = {
374 [0] = PWRSTS_OFF_RET, /* eve4_bank */ 374 [0] = PWRSTS_OFF_RET, /* eve4_bank */
375 }, 375 },
376 .pwrsts_mem_on = { 376 .pwrsts_mem_on = {
377 [0] = PWRSTS_OFF_RET, /* eve4_bank */ 377 [0] = PWRSTS_ON, /* eve4_bank */
378 }, 378 },
379 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 379 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
380}; 380};
@@ -390,7 +390,7 @@ static struct powerdomain eve2_7xx_pwrdm = {
390 [0] = PWRSTS_OFF_RET, /* eve2_bank */ 390 [0] = PWRSTS_OFF_RET, /* eve2_bank */
391 }, 391 },
392 .pwrsts_mem_on = { 392 .pwrsts_mem_on = {
393 [0] = PWRSTS_OFF_RET, /* eve2_bank */ 393 [0] = PWRSTS_ON, /* eve2_bank */
394 }, 394 },
395 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 395 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
396}; 396};
@@ -406,7 +406,7 @@ static struct powerdomain eve1_7xx_pwrdm = {
406 [0] = PWRSTS_OFF_RET, /* eve1_bank */ 406 [0] = PWRSTS_OFF_RET, /* eve1_bank */
407 }, 407 },
408 .pwrsts_mem_on = { 408 .pwrsts_mem_on = {
409 [0] = PWRSTS_OFF_RET, /* eve1_bank */ 409 [0] = PWRSTS_ON, /* eve1_bank */
410 }, 410 },
411 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 411 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
412}; 412};
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index 364418c78bf3..2aa01c270898 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -39,82 +39,10 @@
39#include <linux/of.h> 39#include <linux/of.h>
40 40
41/* 41/*
42 * Test if multicore OMAP support is needed 42 * OMAP2+ is always defined as ARCH_MULTIPLATFORM in Kconfig
43 */ 43 */
44#undef MULTI_OMAP2 44#undef MULTI_OMAP2
45#undef OMAP_NAME
46
47#ifdef CONFIG_ARCH_MULTIPLATFORM
48#define MULTI_OMAP2 45#define MULTI_OMAP2
49#endif
50#ifdef CONFIG_SOC_OMAP2420
51# ifdef OMAP_NAME
52# undef MULTI_OMAP2
53# define MULTI_OMAP2
54# else
55# define OMAP_NAME omap2420
56# endif
57#endif
58#ifdef CONFIG_SOC_OMAP2430
59# ifdef OMAP_NAME
60# undef MULTI_OMAP2
61# define MULTI_OMAP2
62# else
63# define OMAP_NAME omap2430
64# endif
65#endif
66#ifdef CONFIG_ARCH_OMAP3
67# ifdef OMAP_NAME
68# undef MULTI_OMAP2
69# define MULTI_OMAP2
70# else
71# define OMAP_NAME omap3
72# endif
73#endif
74#ifdef CONFIG_ARCH_OMAP4
75# ifdef OMAP_NAME
76# undef MULTI_OMAP2
77# define MULTI_OMAP2
78# else
79# define OMAP_NAME omap4
80# endif
81#endif
82
83#ifdef CONFIG_SOC_OMAP5
84# ifdef OMAP_NAME
85# undef MULTI_OMAP2
86# define MULTI_OMAP2
87# else
88# define OMAP_NAME omap5
89# endif
90#endif
91
92#ifdef CONFIG_SOC_AM33XX
93# ifdef OMAP_NAME
94# undef MULTI_OMAP2
95# define MULTI_OMAP2
96# else
97# define OMAP_NAME am33xx
98# endif
99#endif
100
101#ifdef CONFIG_SOC_AM43XX
102# ifdef OMAP_NAME
103# undef MULTI_OMAP2
104# define MULTI_OMAP2
105# else
106# define OMAP_NAME am43xx
107# endif
108#endif
109
110#ifdef CONFIG_SOC_DRA7XX
111# ifdef OMAP_NAME
112# undef MULTI_OMAP2
113# define MULTI_OMAP2
114# else
115# define OMAP_NAME DRA7XX
116# endif
117#endif
118 46
119/* 47/*
120 * Omap device type i.e. EMU/HS/TST/GP/BAD 48 * Omap device type i.e. EMU/HS/TST/GP/BAD
@@ -242,11 +170,6 @@ IS_AM_SUBCLASS(437x, 0x437)
242IS_DRA_SUBCLASS(75x, 0x75) 170IS_DRA_SUBCLASS(75x, 0x75)
243IS_DRA_SUBCLASS(72x, 0x72) 171IS_DRA_SUBCLASS(72x, 0x72)
244 172
245#define soc_is_omap24xx() 0
246#define soc_is_omap242x() 0
247#define soc_is_omap243x() 0
248#define soc_is_omap34xx() 0
249#define soc_is_omap343x() 0
250#define soc_is_ti81xx() 0 173#define soc_is_ti81xx() 0
251#define soc_is_ti816x() 0 174#define soc_is_ti816x() 0
252#define soc_is_ti814x() 0 175#define soc_is_ti814x() 0
@@ -265,46 +188,27 @@ IS_DRA_SUBCLASS(72x, 0x72)
265#define soc_is_dra74x() 0 188#define soc_is_dra74x() 0
266#define soc_is_dra72x() 0 189#define soc_is_dra72x() 0
267 190
268#if defined(MULTI_OMAP2) 191#if defined(CONFIG_ARCH_OMAP2)
269# if defined(CONFIG_ARCH_OMAP2) 192# define soc_is_omap24xx() is_omap24xx()
270# undef soc_is_omap24xx
271# define soc_is_omap24xx() is_omap24xx()
272# endif
273# if defined (CONFIG_SOC_OMAP2420)
274# undef soc_is_omap242x
275# define soc_is_omap242x() is_omap242x()
276# endif
277# if defined (CONFIG_SOC_OMAP2430)
278# undef soc_is_omap243x
279# define soc_is_omap243x() is_omap243x()
280# endif
281# if defined(CONFIG_ARCH_OMAP3)
282# undef soc_is_omap34xx
283# undef soc_is_omap343x
284# define soc_is_omap34xx() is_omap34xx()
285# define soc_is_omap343x() is_omap343x()
286# endif
287#else 193#else
288# if defined(CONFIG_ARCH_OMAP2) 194# define soc_is_omap24xx() 0
289# undef soc_is_omap24xx 195#endif
290# define soc_is_omap24xx() 1 196#if defined(CONFIG_SOC_OMAP2420)
291# endif 197# define soc_is_omap242x() is_omap242x()
292# if defined(CONFIG_SOC_OMAP2420) 198#else
293# undef soc_is_omap242x 199# define soc_is_omap242x() 0
294# define soc_is_omap242x() 1 200#endif
295# endif 201#if defined(CONFIG_SOC_OMAP2430)
296# if defined(CONFIG_SOC_OMAP2430) 202# define soc_is_omap243x() is_omap243x()
297# undef soc_is_omap243x 203#else
298# define soc_is_omap243x() 1 204# define soc_is_omap243x() 0
299# endif 205#endif
300# if defined(CONFIG_ARCH_OMAP3) 206#if defined(CONFIG_ARCH_OMAP3)
301# undef soc_is_omap34xx 207# define soc_is_omap34xx() is_omap34xx()
302# define soc_is_omap34xx() 1 208# define soc_is_omap343x() is_omap343x()
303# endif 209#else
304# if defined(CONFIG_SOC_OMAP3430) 210# define soc_is_omap34xx() 0
305# undef soc_is_omap343x 211# define soc_is_omap343x() 0
306# define soc_is_omap343x() 1
307# endif
308#endif 212#endif
309 213
310/* 214/*
@@ -339,7 +243,6 @@ IS_OMAP_TYPE(3430, 0x3430)
339#define soc_is_omap5430() 0 243#define soc_is_omap5430() 0
340 244
341/* These are needed for the common code */ 245/* These are needed for the common code */
342#ifdef CONFIG_ARCH_OMAP2PLUS
343#define soc_is_omap7xx() 0 246#define soc_is_omap7xx() 0
344#define soc_is_omap15xx() 0 247#define soc_is_omap15xx() 0
345#define soc_is_omap16xx() 0 248#define soc_is_omap16xx() 0
@@ -350,7 +253,6 @@ IS_OMAP_TYPE(3430, 0x3430)
350#define soc_is_omap1710() 0 253#define soc_is_omap1710() 0
351#define cpu_class_is_omap1() 0 254#define cpu_class_is_omap1() 0
352#define cpu_class_is_omap2() 1 255#define cpu_class_is_omap2() 1
353#endif
354 256
355#if defined(CONFIG_ARCH_OMAP2) 257#if defined(CONFIG_ARCH_OMAP2)
356# undef soc_is_omap2420 258# undef soc_is_omap2420
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index 70c3366c8d03..058994e99570 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -66,8 +66,7 @@ static struct clk *tclk;
66 66
67void __init clk_init(void) 67void __init clk_init(void)
68{ 68{
69 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT, 69 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, 0, orion5x_tclk);
70 orion5x_tclk);
71 70
72 orion_clkdev_init(tclk); 71 orion_clkdev_init(tclk);
73} 72}
diff --git a/arch/arm/mach-oxnas/Kconfig b/arch/arm/mach-oxnas/Kconfig
new file mode 100644
index 000000000000..4fff3c7666df
--- /dev/null
+++ b/arch/arm/mach-oxnas/Kconfig
@@ -0,0 +1,24 @@
1menuconfig ARCH_OXNAS
2 bool "Oxford Semiconductor OXNAS Family SoCs"
3 select ARCH_REQUIRE_GPIOLIB
4 select ARCH_HAS_RESET_CONTROLLER
5 select PINCTRL
6 depends on ARCH_MULTI_V5
7 help
8 Support for OxNas SoC family developed by Oxford Semiconductor.
9
10if ARCH_OXNAS
11
12config MACH_OX810SE
13 bool "Support OX810SE Based Products"
14 select ARM_TIMER_SP804
15 select COMMON_CLK_OXNAS
16 select CPU_ARM926T
17 select MFD_SYSCON
18 select PINCTRL_OXNAS
19 select RESET_OXNAS
20 select VERSATILE_FPGA_IRQ
21 help
22 Include Support for the Oxford Semiconductor OX810SE SoC Based Products.
23
24endif
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
index 67d79f9c6bad..6196a6380385 100644
--- a/arch/arm/mach-shmobile/timer.c
+++ b/arch/arm/mach-shmobile/timer.c
@@ -20,28 +20,9 @@
20 20
21#include "common.h" 21#include "common.h"
22 22
23static void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz,
24 unsigned int mult, unsigned int div)
25{
26 /* calculate a worst-case loops-per-jiffy value
27 * based on maximum cpu core hz setting and the
28 * __delay() implementation in arch/arm/lib/delay.S
29 *
30 * this will result in a longer delay than expected
31 * when the cpu core runs on lower frequencies.
32 */
33
34 unsigned int value = HZ * div / mult;
35
36 if (!preset_lpj)
37 preset_lpj = max_cpu_core_hz / value;
38}
39
40void __init shmobile_init_delay(void) 23void __init shmobile_init_delay(void)
41{ 24{
42 struct device_node *np, *cpus; 25 struct device_node *np, *cpus;
43 unsigned int div = 0;
44 bool has_arch_timer = false;
45 u32 max_freq = 0; 26 u32 max_freq = 0;
46 27
47 cpus = of_find_node_by_path("/cpus"); 28 cpus = of_find_node_by_path("/cpus");
@@ -51,25 +32,32 @@ void __init shmobile_init_delay(void)
51 for_each_child_of_node(cpus, np) { 32 for_each_child_of_node(cpus, np) {
52 u32 freq; 33 u32 freq;
53 34
35 if (IS_ENABLED(CONFIG_ARM_ARCH_TIMER) &&
36 (of_device_is_compatible(np, "arm,cortex-a7") ||
37 of_device_is_compatible(np, "arm,cortex-a15"))) {
38 of_node_put(np);
39 of_node_put(cpus);
40 return;
41 }
42
54 if (!of_property_read_u32(np, "clock-frequency", &freq)) 43 if (!of_property_read_u32(np, "clock-frequency", &freq))
55 max_freq = max(max_freq, freq); 44 max_freq = max(max_freq, freq);
56
57 if (of_device_is_compatible(np, "arm,cortex-a8")) {
58 div = 2;
59 } else if (of_device_is_compatible(np, "arm,cortex-a9")) {
60 div = 1;
61 } else if (of_device_is_compatible(np, "arm,cortex-a7") ||
62 of_device_is_compatible(np, "arm,cortex-a15")) {
63 div = 1;
64 has_arch_timer = true;
65 }
66 } 45 }
67 46
68 of_node_put(cpus); 47 of_node_put(cpus);
69 48
70 if (!max_freq || !div) 49 if (!max_freq)
71 return; 50 return;
72 51
73 if (!has_arch_timer || !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) 52 /*
74 shmobile_setup_delay_hz(max_freq, 1, div); 53 * Calculate a worst-case loops-per-jiffy value
54 * based on maximum cpu core hz setting and the
55 * __delay() implementation in arch/arm/lib/delay.S.
56 *
57 * This will result in a longer delay than expected
58 * when the cpu core runs on lower frequencies.
59 */
60
61 if (!preset_lpj)
62 preset_lpj = max_freq / HZ;
75} 63}
diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig
index a196d14f65f5..6f1af29f935d 100644
--- a/arch/arm/mach-sti/Kconfig
+++ b/arch/arm/mach-sti/Kconfig
@@ -18,11 +18,10 @@ menuconfig ARCH_STI
18 select PL310_ERRATA_769419 if CACHE_L2X0 18 select PL310_ERRATA_769419 if CACHE_L2X0
19 select RESET_CONTROLLER 19 select RESET_CONTROLLER
20 help 20 help
21 Include support for STiH41x SOCs like STiH415/416 using the device tree 21 Include support for STMicroelectronics' STiH415/416, STiH407/10 and
22 for discovery 22 STiH418 family SoCs using the Device Tree for discovery. More
23 More information at Documentation/arm/STiH41x and 23 information can be found in Documentation/arm/sti/ and
24 at Documentation/devicetree 24 Documentation/devicetree.
25
26 25
27if ARCH_STI 26if ARCH_STI
28 27
diff --git a/arch/arm/mach-uniphier/platsmp.c b/arch/arm/mach-uniphier/platsmp.c
index db04142f88bc..e802ca836ec7 100644
--- a/arch/arm/mach-uniphier/platsmp.c
+++ b/arch/arm/mach-uniphier/platsmp.c
@@ -99,16 +99,16 @@ static int __init uniphier_smp_prepare_trampoline(unsigned int max_cpus)
99 int ret; 99 int ret;
100 100
101 np = of_find_compatible_node(NULL, NULL, "socionext,uniphier-smpctrl"); 101 np = of_find_compatible_node(NULL, NULL, "socionext,uniphier-smpctrl");
102 of_node_put(np);
103 ret = of_address_to_resource(np, 0, &res); 102 ret = of_address_to_resource(np, 0, &res);
103 of_node_put(np);
104 if (!ret) { 104 if (!ret) {
105 rom_rsv2_phys = res.start + UNIPHIER_SMPCTRL_ROM_RSV2; 105 rom_rsv2_phys = res.start + UNIPHIER_SMPCTRL_ROM_RSV2;
106 } else { 106 } else {
107 /* try old binding too */ 107 /* try old binding too */
108 np = of_find_compatible_node(NULL, NULL, 108 np = of_find_compatible_node(NULL, NULL,
109 "socionext,uniphier-system-bus-controller"); 109 "socionext,uniphier-system-bus-controller");
110 of_node_put(np);
111 ret = of_address_to_resource(np, 1, &res); 110 ret = of_address_to_resource(np, 1, &res);
111 of_node_put(np);
112 if (ret) { 112 if (ret) {
113 pr_err("failed to get resource of SMP control\n"); 113 pr_err("failed to get resource of SMP control\n");
114 return ret; 114 return ret;
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile
index f5c1006dd6a1..73caae71f307 100644
--- a/arch/arm/mach-vexpress/Makefile
+++ b/arch/arm/mach-vexpress/Makefile
@@ -4,7 +4,7 @@
4ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := \ 4ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := \
5 -I$(srctree)/arch/arm/plat-versatile/include 5 -I$(srctree)/arch/arm/plat-versatile/include
6 6
7obj-y := v2m.o 7obj-$(CONFIG_ARCH_VEXPRESS) := v2m.o
8obj-$(CONFIG_ARCH_VEXPRESS_DCSCB) += dcscb.o dcscb_setup.o 8obj-$(CONFIG_ARCH_VEXPRESS_DCSCB) += dcscb.o dcscb_setup.o
9CFLAGS_dcscb.o += -march=armv7-a 9CFLAGS_dcscb.o += -march=armv7-a
10CFLAGS_REMOVE_dcscb.o = -pg 10CFLAGS_REMOVE_dcscb.o = -pg
@@ -15,3 +15,5 @@ CFLAGS_tc2_pm.o += -march=armv7-a
15CFLAGS_REMOVE_tc2_pm.o = -pg 15CFLAGS_REMOVE_tc2_pm.o = -pg
16obj-$(CONFIG_SMP) += platsmp.o 16obj-$(CONFIG_SMP) += platsmp.o
17obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 17obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
18
19obj-$(CONFIG_ARCH_MPS2) += v2m-mps2.o
diff --git a/arch/arm/mach-vexpress/Makefile.boot b/arch/arm/mach-vexpress/Makefile.boot
new file mode 100644
index 000000000000..eacfc3f5c33e
--- /dev/null
+++ b/arch/arm/mach-vexpress/Makefile.boot
@@ -0,0 +1,3 @@
1# Empty file waiting for deletion once Makefile.boot isn't needed any more.
2# Patch waits for application at
3# http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7889/1 .
diff --git a/arch/arm/mach-vexpress/v2m-mps2.c b/arch/arm/mach-vexpress/v2m-mps2.c
new file mode 100644
index 000000000000..e7ad9c27231c
--- /dev/null
+++ b/arch/arm/mach-vexpress/v2m-mps2.c
@@ -0,0 +1,21 @@
1/*
2 * Copyright (C) 2015 ARM Limited
3 *
4 * Author: Vladimir Murzin <vladimir.murzin@arm.com>
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
12#include <asm/mach/arch.h>
13
14static const char *const mps2_compat[] __initconst = {
15 "arm,mps2",
16 NULL
17};
18
19DT_MACHINE_START(MPS2DT, "MPS2 (Device Tree Support)")
20 .dt_compat = mps2_compat,
21MACHINE_END
diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c
index 598ab3f0e0ac..37dd4645bf18 100644
--- a/drivers/irqchip/irq-versatile-fpga.c
+++ b/drivers/irqchip/irq-versatile-fpga.c
@@ -227,4 +227,5 @@ int __init fpga_irq_of_init(struct device_node *node,
227} 227}
228IRQCHIP_DECLARE(arm_fpga, "arm,versatile-fpga-irq", fpga_irq_of_init); 228IRQCHIP_DECLARE(arm_fpga, "arm,versatile-fpga-irq", fpga_irq_of_init);
229IRQCHIP_DECLARE(arm_fpga_sic, "arm,versatile-sic", fpga_irq_of_init); 229IRQCHIP_DECLARE(arm_fpga_sic, "arm,versatile-sic", fpga_irq_of_init);
230IRQCHIP_DECLARE(ox810se_rps, "oxsemi,ox810se-rps-irq", fpga_irq_of_init);
230#endif 231#endif