aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-02 12:38:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-02 12:38:16 -0400
commit99c6bcf46d2233d33e441834e958ed0bc22b190a (patch)
tree25abf5e856bc0f08d75e623715eb5acc4d4de2b2 /arch/arm/mach-ux500
parent97b1007a2924aaa9126398623f6755a8c3c6a616 (diff)
parent2fdfe1c26fb9f24cfdf124384abb35396ca2cd3f (diff)
Merge tag 'multiplatform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC multiplatform updates from Olof Johansson: "More multiplatform enablement for ARM platforms. The ones converted in this branch are: - bcm2835 - cns3xxx - sirf - nomadik - msx - spear - tegra - ux500 We're getting close to having most of them converted! One of the larger platforms remaining is Samsung Exynos, and there are a bunch of supporting patches in this merge window for it. There was a patch in this branch to a early version of multiplatform conversion, but it ended up being reverted due to need of more bake time. The revert commit is part of the branch since it would have required rebasing multiple dependent branches and they were stable by then" * tag 'multiplatform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (70 commits) mmc: sdhci-s3c: Fix operation on non-single image Samsung platforms clocksource: nomadik-mtu: fix up clocksource/timer Revert "ARM: exynos: enable multiplatform support" ARM: SPEAr13xx: Fix typo "ARCH_HAVE_CPUFREQ" ARM: exynos: enable multiplatform support rtc: s3c: make header file local mtd: onenand/samsung: make regs-onenand.h file local thermal/exynos: remove unnecessary header inclusions mmc: sdhci-s3c: remove platform dependencies ARM: samsung: move mfc device definition to s5p-dev-mfc.c ARM: exynos: move debug-macro.S to include/debug/ ARM: exynos: prepare for sparse IRQ ARM: exynos: introduce EXYNOS_ATAGS symbol ARM: tegra: build assembly files with -march=armv7-a ARM: Push selects for TWD/SCU into machine entries ARM: ux500: build hotplug.o for ARMv7-a ARM: ux500: move to multiplatform ARM: ux500: make remaining headers local ARM: ux500: make irqs.h local to platform ARM: ux500: get rid of <mach/[hardware|db8500-regs].h> ...
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r--arch/arm/mach-ux500/Kconfig16
-rw-r--r--arch/arm/mach-ux500/Makefile4
-rw-r--r--arch/arm/mach-ux500/board-mop500-audio.c7
-rw-r--r--arch/arm/mach-ux500/board-mop500-pins.c2
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c4
-rw-r--r--arch/arm/mach-ux500/board-mop500-u8500uib.c9
-rw-r--r--arch/arm/mach-ux500/board-mop500-uib.c1
-rw-r--r--arch/arm/mach-ux500/board-mop500.c66
-rw-r--r--arch/arm/mach-ux500/board-mop500.h4
-rw-r--r--arch/arm/mach-ux500/cache-l2x0.c2
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c12
-rw-r--r--arch/arm/mach-ux500/cpu.c33
-rw-r--r--arch/arm/mach-ux500/cpuidle.c5
-rw-r--r--arch/arm/mach-ux500/db8500-regs.h (renamed from arch/arm/mach-ux500/include/mach/db8500-regs.h)28
-rw-r--r--arch/arm/mach-ux500/devices-common.c3
-rw-r--r--arch/arm/mach-ux500/devices-db8500.c8
-rw-r--r--arch/arm/mach-ux500/devices-db8500.h3
-rw-r--r--arch/arm/mach-ux500/devices.c5
-rw-r--r--arch/arm/mach-ux500/devices.h (renamed from arch/arm/mach-ux500/include/mach/devices.h)0
-rw-r--r--arch/arm/mach-ux500/hotplug.c2
-rw-r--r--arch/arm/mach-ux500/id.c4
-rw-r--r--arch/arm/mach-ux500/include/mach/debug-macro.S39
-rw-r--r--arch/arm/mach-ux500/include/mach/hardware.h47
-rw-r--r--arch/arm/mach-ux500/include/mach/msp.h27
-rw-r--r--arch/arm/mach-ux500/include/mach/timex.h6
-rw-r--r--arch/arm/mach-ux500/include/mach/uncompress.h57
-rw-r--r--arch/arm/mach-ux500/irqs-board-mop500.h (renamed from arch/arm/mach-ux500/include/mach/irqs-board-mop500.h)0
-rw-r--r--arch/arm/mach-ux500/irqs-db8500.h (renamed from arch/arm/mach-ux500/include/mach/irqs-db8500.h)25
-rw-r--r--arch/arm/mach-ux500/irqs.h (renamed from arch/arm/mach-ux500/include/mach/irqs.h)6
-rw-r--r--arch/arm/mach-ux500/platsmp.c4
-rw-r--r--arch/arm/mach-ux500/pm.c167
-rw-r--r--arch/arm/mach-ux500/setup.h (renamed from arch/arm/mach-ux500/include/mach/setup.h)0
-rw-r--r--arch/arm/mach-ux500/timer.c6
-rw-r--r--arch/arm/mach-ux500/usb.c2
34 files changed, 283 insertions, 321 deletions
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 3e5bbd0e5b23..f66d7deae46d 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -1,3 +1,19 @@
1config ARCH_U8500
2 bool "ST-Ericsson U8500 Series" if ARCH_MULTI_V7
3 depends on MMU
4 select ARCH_HAS_CPUFREQ
5 select ARCH_REQUIRE_GPIOLIB
6 select ARM_AMBA
7 select CLKDEV_LOOKUP
8 select CPU_V7
9 select GENERIC_CLOCKEVENTS
10 select HAVE_ARM_SCU if SMP
11 select HAVE_ARM_TWD if LOCAL_TIMERS
12 select HAVE_SMP
13 select MIGHT_HAVE_CACHE_L2X0
14 help
15 Support for ST-Ericsson's Ux500 architecture
16
1if ARCH_U8500 17if ARCH_U8500
2 18
3config UX500_SOC_COMMON 19config UX500_SOC_COMMON
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index f24710dfc395..bf9b6be5b180 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5obj-y := cpu.o devices.o devices-common.o \ 5obj-y := cpu.o devices.o devices-common.o \
6 id.o usb.o timer.o 6 id.o usb.o timer.o pm.o
7obj-$(CONFIG_CPU_IDLE) += cpuidle.o 7obj-$(CONFIG_CPU_IDLE) += cpuidle.o
8obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 8obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
9obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o 9obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o
@@ -15,3 +15,5 @@ obj-$(CONFIG_MACH_MOP500) += board-mop500.o board-mop500-sdi.o \
15 board-mop500-audio.o 15 board-mop500-audio.o
16obj-$(CONFIG_SMP) += platsmp.o headsmp.o 16obj-$(CONFIG_SMP) += platsmp.o headsmp.o
17obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 17obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
18
19CFLAGS_hotplug.o += -march=armv7-a
diff --git a/arch/arm/mach-ux500/board-mop500-audio.c b/arch/arm/mach-ux500/board-mop500-audio.c
index 7209db7cdc72..aba9e5692958 100644
--- a/arch/arm/mach-ux500/board-mop500-audio.c
+++ b/arch/arm/mach-ux500/board-mop500-audio.c
@@ -10,10 +10,9 @@
10#include <linux/platform_data/pinctrl-nomadik.h> 10#include <linux/platform_data/pinctrl-nomadik.h>
11#include <linux/platform_data/dma-ste-dma40.h> 11#include <linux/platform_data/dma-ste-dma40.h>
12 12
13#include <mach/devices.h> 13#include "devices.h"
14#include <mach/hardware.h> 14#include "irqs.h"
15#include <mach/irqs.h> 15#include <linux/platform_data/asoc-ux500-msp.h>
16#include <mach/msp.h>
17 16
18#include "ste-dma40-db8500.h" 17#include "ste-dma40-db8500.h"
19#include "board-mop500.h" 18#include "board-mop500.h"
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c
index 0a3f30df1eb8..f3976f9c404a 100644
--- a/arch/arm/mach-ux500/board-mop500-pins.c
+++ b/arch/arm/mach-ux500/board-mop500-pins.c
@@ -13,8 +13,6 @@
13 13
14#include <asm/mach-types.h> 14#include <asm/mach-types.h>
15 15
16#include <mach/hardware.h>
17
18#include "pins-db8500.h" 16#include "pins-db8500.h"
19#include "board-mop500.h" 17#include "board-mop500.h"
20 18
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 6db0740128de..0ef38775a0c1 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -14,9 +14,9 @@
14#include <linux/platform_data/dma-ste-dma40.h> 14#include <linux/platform_data/dma-ste-dma40.h>
15 15
16#include <asm/mach-types.h> 16#include <asm/mach-types.h>
17#include <mach/devices.h> 17#include "devices.h"
18#include <mach/hardware.h>
19 18
19#include "db8500-regs.h"
20#include "devices-db8500.h" 20#include "devices-db8500.h"
21#include "board-mop500.h" 21#include "board-mop500.h"
22#include "ste-dma40-db8500.h" 22#include "ste-dma40-db8500.h"
diff --git a/arch/arm/mach-ux500/board-mop500-u8500uib.c b/arch/arm/mach-ux500/board-mop500-u8500uib.c
index ead91c968ff4..d397c19570af 100644
--- a/arch/arm/mach-ux500/board-mop500-u8500uib.c
+++ b/arch/arm/mach-ux500/board-mop500-u8500uib.c
@@ -12,12 +12,15 @@
12#include <linux/mfd/tc3589x.h> 12#include <linux/mfd/tc3589x.h>
13#include <linux/input/matrix_keypad.h> 13#include <linux/input/matrix_keypad.h>
14 14
15#include <mach/irqs.h> 15#include "irqs.h"
16 16
17#include "board-mop500.h" 17#include "board-mop500.h"
18 18
19/* Dummy data that can be overridden by staging driver */ 19static struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = {
20struct i2c_board_info __initdata __weak mop500_i2c3_devices_u8500[] = { 20 {
21 I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B),
22 .irq = NOMADIK_GPIO_TO_IRQ(84),
23 },
21}; 24};
22 25
23/* 26/*
diff --git a/arch/arm/mach-ux500/board-mop500-uib.c b/arch/arm/mach-ux500/board-mop500-uib.c
index 7037d3687e9f..bdaa422da028 100644
--- a/arch/arm/mach-ux500/board-mop500-uib.c
+++ b/arch/arm/mach-ux500/board-mop500-uib.c
@@ -11,7 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/i2c.h> 12#include <linux/i2c.h>
13 13
14#include <mach/hardware.h>
15#include "board-mop500.h" 14#include "board-mop500.h"
16#include "id.h" 15#include "id.h"
17 16
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 574916b70b2e..a15dd6b63a8f 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -44,13 +44,13 @@
44#include <asm/mach-types.h> 44#include <asm/mach-types.h>
45#include <asm/mach/arch.h> 45#include <asm/mach/arch.h>
46 46
47#include <mach/hardware.h> 47#include "setup.h"
48#include <mach/setup.h> 48#include "devices.h"
49#include <mach/devices.h> 49#include "irqs.h"
50#include <mach/irqs.h>
51#include <linux/platform_data/crypto-ux500.h> 50#include <linux/platform_data/crypto-ux500.h>
52 51
53#include "ste-dma40-db8500.h" 52#include "ste-dma40-db8500.h"
53#include "db8500-regs.h"
54#include "devices-db8500.h" 54#include "devices-db8500.h"
55#include "board-mop500.h" 55#include "board-mop500.h"
56#include "board-mop500-regulators.h" 56#include "board-mop500-regulators.h"
@@ -237,63 +237,6 @@ struct ab8500_platform_data ab8500_platdata = {
237 .codec = &ab8500_codec_pdata, 237 .codec = &ab8500_codec_pdata,
238}; 238};
239 239
240/*
241 * Thermal Sensor
242 */
243
244static struct resource db8500_thsens_resources[] = {
245 {
246 .name = "IRQ_HOTMON_LOW",
247 .start = IRQ_PRCMU_HOTMON_LOW,
248 .end = IRQ_PRCMU_HOTMON_LOW,
249 .flags = IORESOURCE_IRQ,
250 },
251 {
252 .name = "IRQ_HOTMON_HIGH",
253 .start = IRQ_PRCMU_HOTMON_HIGH,
254 .end = IRQ_PRCMU_HOTMON_HIGH,
255 .flags = IORESOURCE_IRQ,
256 },
257};
258
259static struct db8500_thsens_platform_data db8500_thsens_data = {
260 .trip_points[0] = {
261 .temp = 70000,
262 .type = THERMAL_TRIP_ACTIVE,
263 .cdev_name = {
264 [0] = "thermal-cpufreq-0",
265 },
266 },
267 .trip_points[1] = {
268 .temp = 75000,
269 .type = THERMAL_TRIP_ACTIVE,
270 .cdev_name = {
271 [0] = "thermal-cpufreq-0",
272 },
273 },
274 .trip_points[2] = {
275 .temp = 80000,
276 .type = THERMAL_TRIP_ACTIVE,
277 .cdev_name = {
278 [0] = "thermal-cpufreq-0",
279 },
280 },
281 .trip_points[3] = {
282 .temp = 85000,
283 .type = THERMAL_TRIP_CRITICAL,
284 },
285 .num_trips = 4,
286};
287
288static struct platform_device u8500_thsens_device = {
289 .name = "db8500-thermal",
290 .resource = db8500_thsens_resources,
291 .num_resources = ARRAY_SIZE(db8500_thsens_resources),
292 .dev = {
293 .platform_data = &db8500_thsens_data,
294 },
295};
296
297static struct platform_device u8500_cpufreq_cooling_device = { 240static struct platform_device u8500_cpufreq_cooling_device = {
298 .name = "db8500-cpufreq-cooling", 241 .name = "db8500-cpufreq-cooling",
299}; 242};
@@ -663,7 +606,6 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
663 &snowball_key_dev, 606 &snowball_key_dev,
664 &snowball_sbnet_dev, 607 &snowball_sbnet_dev,
665 &snowball_gpio_en_3v3_regulator_dev, 608 &snowball_gpio_en_3v3_regulator_dev,
666 &u8500_thsens_device,
667 &u8500_cpufreq_cooling_device, 609 &u8500_cpufreq_cooling_device,
668 &sdi0_regulator, 610 &sdi0_regulator,
669}; 611};
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index d38951be70df..49514b825034 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -8,8 +8,8 @@
8#define __BOARD_MOP500_H 8#define __BOARD_MOP500_H
9 9
10/* For NOMADIK_NR_GPIO */ 10/* For NOMADIK_NR_GPIO */
11#include <mach/irqs.h> 11#include "irqs.h"
12#include <mach/msp.h> 12#include <linux/platform_data/asoc-ux500-msp.h>
13#include <linux/amba/mmci.h> 13#include <linux/amba/mmci.h>
14 14
15/* Snowball specific GPIO assignments, this board has no GPIO expander */ 15/* Snowball specific GPIO assignments, this board has no GPIO expander */
diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c
index f815efe54c73..f58615b5c601 100644
--- a/arch/arm/mach-ux500/cache-l2x0.c
+++ b/arch/arm/mach-ux500/cache-l2x0.c
@@ -9,8 +9,8 @@
9 9
10#include <asm/cacheflush.h> 10#include <asm/cacheflush.h>
11#include <asm/hardware/cache-l2x0.h> 11#include <asm/hardware/cache-l2x0.h>
12#include <mach/hardware.h>
13 12
13#include "db8500-regs.h"
14#include "id.h" 14#include "id.h"
15 15
16static void __iomem *l2x0_base; 16static void __iomem *l2x0_base;
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 5c6c2e633868..995928ba22fd 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -28,15 +28,13 @@
28#include <asm/mach/map.h> 28#include <asm/mach/map.h>
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30 30
31#include <mach/hardware.h> 31#include "setup.h"
32#include <mach/setup.h> 32#include "devices.h"
33#include <mach/devices.h> 33#include "irqs.h"
34#include <mach/db8500-regs.h>
35#include <mach/irqs.h>
36 34
37#include "devices-db8500.h" 35#include "devices-db8500.h"
38#include "ste-dma40-db8500.h" 36#include "ste-dma40-db8500.h"
39 37#include "db8500-regs.h"
40#include "board-mop500.h" 38#include "board-mop500.h"
41#include "id.h" 39#include "id.h"
42 40
@@ -94,8 +92,6 @@ void __init u8500_map_io(void)
94 iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc)); 92 iotable_init(u9540_io_desc, ARRAY_SIZE(u9540_io_desc));
95 else 93 else
96 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc)); 94 iotable_init(u8500_io_desc, ARRAY_SIZE(u8500_io_desc));
97
98 _PRCMU_BASE = __io_address(U8500_PRCMU_BASE);
99} 95}
100 96
101static struct resource db8500_pmu_resources[] = { 97static struct resource db8500_pmu_resources[] = {
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index 537870d3fea8..915e2636cbaa 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -8,7 +8,7 @@
8 8
9#include <linux/platform_device.h> 9#include <linux/platform_device.h>
10#include <linux/io.h> 10#include <linux/io.h>
11#include <linux/mfd/db8500-prcmu.h> 11#include <linux/mfd/dbx500-prcmu.h>
12#include <linux/clksrc-dbx500-prcmu.h> 12#include <linux/clksrc-dbx500-prcmu.h>
13#include <linux/sys_soc.h> 13#include <linux/sys_soc.h>
14#include <linux/err.h> 14#include <linux/err.h>
@@ -20,18 +20,17 @@
20#include <linux/irqchip.h> 20#include <linux/irqchip.h>
21#include <linux/irqchip/arm-gic.h> 21#include <linux/irqchip/arm-gic.h>
22#include <linux/platform_data/clk-ux500.h> 22#include <linux/platform_data/clk-ux500.h>
23#include <linux/platform_data/arm-ux500-pm.h>
23 24
24#include <asm/mach/map.h> 25#include <asm/mach/map.h>
25 26
26#include <mach/hardware.h> 27#include "setup.h"
27#include <mach/setup.h> 28#include "devices.h"
28#include <mach/devices.h>
29 29
30#include "board-mop500.h" 30#include "board-mop500.h"
31#include "db8500-regs.h"
31#include "id.h" 32#include "id.h"
32 33
33void __iomem *_PRCMU_BASE;
34
35/* 34/*
36 * FIXME: Should we set up the GPIO domain here? 35 * FIXME: Should we set up the GPIO domain here?
37 * 36 *
@@ -68,13 +67,23 @@ void __init ux500_init_irq(void)
68 * Init clocks here so that they are available for system timer 67 * Init clocks here so that they are available for system timer
69 * initialization. 68 * initialization.
70 */ 69 */
71 if (cpu_is_u8500_family() || cpu_is_u9540()) 70 if (cpu_is_u8500_family()) {
72 db8500_prcmu_early_init(); 71 prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1);
73 72 ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1);
74 if (cpu_is_u8500_family() || cpu_is_u9540()) 73 u8500_clk_init(U8500_CLKRST1_BASE, U8500_CLKRST2_BASE,
75 u8500_clk_init(); 74 U8500_CLKRST3_BASE, U8500_CLKRST5_BASE,
76 else if (cpu_is_u8540()) 75 U8500_CLKRST6_BASE);
76 } else if (cpu_is_u9540()) {
77 prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1);
78 ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1);
79 u8500_clk_init(U8500_CLKRST1_BASE, U8500_CLKRST2_BASE,
80 U8500_CLKRST3_BASE, U8500_CLKRST5_BASE,
81 U8500_CLKRST6_BASE);
82 } else if (cpu_is_u8540()) {
83 prcmu_early_init(U8500_PRCMU_BASE, SZ_8K + SZ_4K - 1);
84 ux500_pm_init(U8500_PRCMU_BASE, SZ_8K + SZ_4K - 1);
77 u8540_clk_init(); 85 u8540_clk_init();
86 }
78} 87}
79 88
80void __init ux500_init_late(void) 89void __init ux500_init_late(void)
diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c
index 488e07472d98..317a2be129fb 100644
--- a/arch/arm/mach-ux500/cpuidle.c
+++ b/arch/arm/mach-ux500/cpuidle.c
@@ -15,10 +15,13 @@
15#include <linux/atomic.h> 15#include <linux/atomic.h>
16#include <linux/smp.h> 16#include <linux/smp.h>
17#include <linux/mfd/dbx500-prcmu.h> 17#include <linux/mfd/dbx500-prcmu.h>
18#include <linux/platform_data/arm-ux500-pm.h>
18 19
19#include <asm/cpuidle.h> 20#include <asm/cpuidle.h>
20#include <asm/proc-fns.h> 21#include <asm/proc-fns.h>
21 22
23#include "db8500-regs.h"
24
22static atomic_t master = ATOMIC_INIT(0); 25static atomic_t master = ATOMIC_INIT(0);
23static DEFINE_SPINLOCK(master_lock); 26static DEFINE_SPINLOCK(master_lock);
24 27
@@ -111,7 +114,7 @@ static struct cpuidle_driver ux500_idle_driver = {
111 114
112int __init ux500_idle_init(void) 115int __init ux500_idle_init(void)
113{ 116{
114 /* Configure wake up reasons */ 117 /* Configure wake up reasons */
115 prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | 118 prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) |
116 PRCMU_WAKEUP(ABB)); 119 PRCMU_WAKEUP(ABB));
117 120
diff --git a/arch/arm/mach-ux500/include/mach/db8500-regs.h b/arch/arm/mach-ux500/db8500-regs.h
index 1530d493879d..b2d7a0b98629 100644
--- a/arch/arm/mach-ux500/include/mach/db8500-regs.h
+++ b/arch/arm/mach-ux500/db8500-regs.h
@@ -170,4 +170,32 @@
170/* SoC identification number information */ 170/* SoC identification number information */
171#define U8500_BB_UID_BASE (U8500_BACKUPRAM1_BASE + 0xFC0) 171#define U8500_BB_UID_BASE (U8500_BACKUPRAM1_BASE + 0xFC0)
172 172
173/* Offsets to specific addresses in some IP blocks for DMA */
174#define MSP_TX_RX_REG_OFFSET 0
175#define CRYP1_RX_REG_OFFSET 0x10
176#define CRYP1_TX_REG_OFFSET 0x8
177#define HASH1_TX_REG_OFFSET 0x4
178
179/*
180 * Macros to get at IO space when running virtually
181 * We dont map all the peripherals, let ioremap do
182 * this for us. We map only very basic peripherals here.
183 */
184#define U8500_IO_VIRTUAL 0xf0000000
185#define U8500_IO_PHYSICAL 0xa0000000
186/* This is where we map in the ROM to check ASIC IDs */
187#define UX500_VIRT_ROM 0xf0000000
188
189/* This macro is used in assembly, so no cast */
190#define IO_ADDRESS(x) \
191 (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + U8500_IO_VIRTUAL)
192
193/* typesafe io address */
194#define __io_address(n) IOMEM(IO_ADDRESS(n))
195
196/* Used by some plat-nomadik code */
197#define io_p2v(n) __io_address(n)
198
199#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
200
173#endif 201#endif
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c
index 16b5f71e6974..f71b3d7bd4fb 100644
--- a/arch/arm/mach-ux500/devices-common.c
+++ b/arch/arm/mach-ux500/devices-common.c
@@ -13,8 +13,7 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/platform_data/pinctrl-nomadik.h> 14#include <linux/platform_data/pinctrl-nomadik.h>
15 15
16#include <mach/hardware.h> 16#include "irqs.h"
17#include <mach/irqs.h>
18 17
19#include "devices-common.h" 18#include "devices-common.h"
20 19
diff --git a/arch/arm/mach-ux500/devices-db8500.c b/arch/arm/mach-ux500/devices-db8500.c
index f3d9419f75d3..1cf94ce0feec 100644
--- a/arch/arm/mach-ux500/devices-db8500.c
+++ b/arch/arm/mach-ux500/devices-db8500.c
@@ -15,10 +15,10 @@
15#include <linux/platform_data/dma-ste-dma40.h> 15#include <linux/platform_data/dma-ste-dma40.h>
16#include <linux/mfd/dbx500-prcmu.h> 16#include <linux/mfd/dbx500-prcmu.h>
17 17
18#include <mach/hardware.h> 18#include "setup.h"
19#include <mach/setup.h> 19#include "irqs.h"
20#include <mach/irqs.h>
21 20
21#include "db8500-regs.h"
22#include "devices-db8500.h" 22#include "devices-db8500.h"
23#include "ste-dma40-db8500.h" 23#include "ste-dma40-db8500.h"
24 24
@@ -199,6 +199,8 @@ struct platform_device u8500_ske_keypad_device = {
199 199
200struct prcmu_pdata db8500_prcmu_pdata = { 200struct prcmu_pdata db8500_prcmu_pdata = {
201 .ab_platdata = &ab8500_platdata, 201 .ab_platdata = &ab8500_platdata,
202 .ab_irq = IRQ_DB8500_AB8500,
203 .irq_base = IRQ_PRCMU_BASE,
202 .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET, 204 .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
203 .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET, 205 .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
204}; 206};
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h
index dbcb35c48f06..321998320f98 100644
--- a/arch/arm/mach-ux500/devices-db8500.h
+++ b/arch/arm/mach-ux500/devices-db8500.h
@@ -9,7 +9,8 @@
9#define __DEVICES_DB8500_H 9#define __DEVICES_DB8500_H
10 10
11#include <linux/platform_data/usb-musb-ux500.h> 11#include <linux/platform_data/usb-musb-ux500.h>
12#include <mach/irqs.h> 12#include "irqs.h"
13#include "db8500-regs.h"
13#include "devices-common.h" 14#include "devices-common.h"
14 15
15struct ske_keypad_platform_data; 16struct ske_keypad_platform_data;
diff --git a/arch/arm/mach-ux500/devices.c b/arch/arm/mach-ux500/devices.c
index ea0a2f92ca70..0f9e52b95935 100644
--- a/arch/arm/mach-ux500/devices.c
+++ b/arch/arm/mach-ux500/devices.c
@@ -11,8 +11,9 @@
11#include <linux/io.h> 11#include <linux/io.h>
12#include <linux/amba/bus.h> 12#include <linux/amba/bus.h>
13 13
14#include <mach/hardware.h> 14#include "setup.h"
15#include <mach/setup.h> 15
16#include "db8500-regs.h"
16 17
17void __init amba_add_devices(struct amba_device *devs[], int num) 18void __init amba_add_devices(struct amba_device *devs[], int num)
18{ 19{
diff --git a/arch/arm/mach-ux500/include/mach/devices.h b/arch/arm/mach-ux500/devices.h
index cbc6f1e4104d..cbc6f1e4104d 100644
--- a/arch/arm/mach-ux500/include/mach/devices.h
+++ b/arch/arm/mach-ux500/devices.h
diff --git a/arch/arm/mach-ux500/hotplug.c b/arch/arm/mach-ux500/hotplug.c
index 2f6af259015d..87abcf278432 100644
--- a/arch/arm/mach-ux500/hotplug.c
+++ b/arch/arm/mach-ux500/hotplug.c
@@ -15,7 +15,7 @@
15#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
16#include <asm/smp_plat.h> 16#include <asm/smp_plat.h>
17 17
18#include <mach/setup.h> 18#include "setup.h"
19 19
20/* 20/*
21 * platform-specific code to shutdown a CPU 21 * platform-specific code to shutdown a CPU
diff --git a/arch/arm/mach-ux500/id.c b/arch/arm/mach-ux500/id.c
index 9f951842e1e5..0d33d1a06955 100644
--- a/arch/arm/mach-ux500/id.c
+++ b/arch/arm/mach-ux500/id.c
@@ -14,9 +14,9 @@
14#include <asm/cacheflush.h> 14#include <asm/cacheflush.h>
15#include <asm/mach/map.h> 15#include <asm/mach/map.h>
16 16
17#include <mach/hardware.h> 17#include "setup.h"
18#include <mach/setup.h>
19 18
19#include "db8500-regs.h"
20#include "id.h" 20#include "id.h"
21 21
22struct dbx500_asic_id dbx500_id; 22struct dbx500_asic_id dbx500_id;
diff --git a/arch/arm/mach-ux500/include/mach/debug-macro.S b/arch/arm/mach-ux500/include/mach/debug-macro.S
deleted file mode 100644
index 67035223334a..000000000000
--- a/arch/arm/mach-ux500/include/mach/debug-macro.S
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright (C) 2009 ST-Ericsson
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11#include <mach/hardware.h>
12
13#if CONFIG_UX500_DEBUG_UART > 2
14#error Invalid Ux500 debug UART
15#endif
16
17/*
18 * DEBUG_LL only works if only one SOC is built in. We don't use #else below
19 * in order to get "__UX500_UART redefined" warnings if more than one SOC is
20 * built, so that there's some hint during the build that something is wrong.
21 */
22
23#ifdef CONFIG_UX500_SOC_DB8500
24#define __UX500_UART(n) U8500_UART##n##_BASE
25#endif
26
27#ifndef __UX500_UART
28#error Unknown SOC
29#endif
30
31#define UX500_UART(n) __UX500_UART(n)
32#define UART_BASE UX500_UART(CONFIG_UX500_DEBUG_UART)
33
34 .macro addruart, rp, rv, tmp
35 ldr \rp, =UART_BASE @ no, physical address
36 ldr \rv, =IO_ADDRESS(UART_BASE) @ yes, virtual address
37 .endm
38
39#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h
deleted file mode 100644
index 5201ddace503..000000000000
--- a/arch/arm/mach-ux500/include/mach/hardware.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson.
3 *
4 * U8500 hardware definitions
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10#ifndef __MACH_HARDWARE_H
11#define __MACH_HARDWARE_H
12
13/*
14 * Macros to get at IO space when running virtually
15 * We dont map all the peripherals, let ioremap do
16 * this for us. We map only very basic peripherals here.
17 */
18#define U8500_IO_VIRTUAL 0xf0000000
19#define U8500_IO_PHYSICAL 0xa0000000
20/* This is where we map in the ROM to check ASIC IDs */
21#define UX500_VIRT_ROM 0xf0000000
22
23/* This macro is used in assembly, so no cast */
24#define IO_ADDRESS(x) \
25 (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + U8500_IO_VIRTUAL)
26
27/* typesafe io address */
28#define __io_address(n) IOMEM(IO_ADDRESS(n))
29
30/* Used by some plat-nomadik code */
31#define io_p2v(n) __io_address(n)
32
33#include <mach/db8500-regs.h>
34
35#define MSP_TX_RX_REG_OFFSET 0
36#define CRYP1_RX_REG_OFFSET 0x10
37#define CRYP1_TX_REG_OFFSET 0x8
38#define HASH1_TX_REG_OFFSET 0x4
39
40#ifndef __ASSEMBLY__
41
42extern void __iomem *_PRCMU_BASE;
43
44#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
45
46#endif /* __ASSEMBLY__ */
47#endif /* __MACH_HARDWARE_H */
diff --git a/arch/arm/mach-ux500/include/mach/msp.h b/arch/arm/mach-ux500/include/mach/msp.h
deleted file mode 100644
index 9991aea3d577..000000000000
--- a/arch/arm/mach-ux500/include/mach/msp.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL), version 2.
6 */
7
8#ifndef __MSP_H
9#define __MSP_H
10
11#include <linux/platform_data/dma-ste-dma40.h>
12
13enum msp_i2s_id {
14 MSP_I2S_0 = 0,
15 MSP_I2S_1,
16 MSP_I2S_2,
17 MSP_I2S_3,
18};
19
20/* Platform data structure for a MSP I2S-device */
21struct msp_i2s_platform_data {
22 enum msp_i2s_id id;
23 struct stedma40_chan_cfg *msp_i2s_dma_rx;
24 struct stedma40_chan_cfg *msp_i2s_dma_tx;
25};
26
27#endif
diff --git a/arch/arm/mach-ux500/include/mach/timex.h b/arch/arm/mach-ux500/include/mach/timex.h
deleted file mode 100644
index d0942c174018..000000000000
--- a/arch/arm/mach-ux500/include/mach/timex.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_ARCH_TIMEX_H
2#define __ASM_ARCH_TIMEX_H
3
4#define CLOCK_TICK_RATE 110000000
5
6#endif
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
deleted file mode 100644
index 36969d52e53a..000000000000
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef __ASM_ARCH_UNCOMPRESS_H
19#define __ASM_ARCH_UNCOMPRESS_H
20
21#include <asm/setup.h>
22#include <asm/mach-types.h>
23#include <linux/io.h>
24#include <linux/amba/serial.h>
25#include <mach/hardware.h>
26
27void __iomem *ux500_uart_base;
28
29static void putc(const char c)
30{
31 /* Do nothing if the UART is not enabled. */
32 if (!(__raw_readb(ux500_uart_base + UART011_CR) & 0x1))
33 return;
34
35 if (c == '\n')
36 putc('\r');
37
38 while (__raw_readb(ux500_uart_base + UART01x_FR) & (1 << 5))
39 barrier();
40 __raw_writeb(c, ux500_uart_base + UART01x_DR);
41}
42
43static void flush(void)
44{
45 if (!(__raw_readb(ux500_uart_base + UART011_CR) & 0x1))
46 return;
47 while (__raw_readb(ux500_uart_base + UART01x_FR) & (1 << 3))
48 barrier();
49}
50
51static inline void arch_decomp_setup(void)
52{
53 /* Use machine_is_foo() macro if you need to switch base someday */
54 ux500_uart_base = (void __iomem *)U8500_UART2_BASE;
55}
56
57#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h b/arch/arm/mach-ux500/irqs-board-mop500.h
index d526dd8e87d3..d526dd8e87d3 100644
--- a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
+++ b/arch/arm/mach-ux500/irqs-board-mop500.h
diff --git a/arch/arm/mach-ux500/include/mach/irqs-db8500.h b/arch/arm/mach-ux500/irqs-db8500.h
index 68bc14974608..f3a9d5947ef3 100644
--- a/arch/arm/mach-ux500/include/mach/irqs-db8500.h
+++ b/arch/arm/mach-ux500/irqs-db8500.h
@@ -109,31 +109,6 @@
109 109
110/* Virtual interrupts corresponding to the PRCMU wakeups. */ 110/* Virtual interrupts corresponding to the PRCMU wakeups. */
111#define IRQ_PRCMU_BASE IRQ_SOC_START 111#define IRQ_PRCMU_BASE IRQ_SOC_START
112#define NUM_PRCMU_WAKEUPS (IRQ_PRCMU_END - IRQ_PRCMU_BASE)
113
114#define IRQ_PRCMU_RTC (IRQ_PRCMU_BASE)
115#define IRQ_PRCMU_RTT0 (IRQ_PRCMU_BASE + 1)
116#define IRQ_PRCMU_RTT1 (IRQ_PRCMU_BASE + 2)
117#define IRQ_PRCMU_HSI0 (IRQ_PRCMU_BASE + 3)
118#define IRQ_PRCMU_HSI1 (IRQ_PRCMU_BASE + 4)
119#define IRQ_PRCMU_CA_WAKE (IRQ_PRCMU_BASE + 5)
120#define IRQ_PRCMU_USB (IRQ_PRCMU_BASE + 6)
121#define IRQ_PRCMU_ABB (IRQ_PRCMU_BASE + 7)
122#define IRQ_PRCMU_ABB_FIFO (IRQ_PRCMU_BASE + 8)
123#define IRQ_PRCMU_ARM (IRQ_PRCMU_BASE + 9)
124#define IRQ_PRCMU_MODEM_SW_RESET_REQ (IRQ_PRCMU_BASE + 10)
125#define IRQ_PRCMU_GPIO0 (IRQ_PRCMU_BASE + 11)
126#define IRQ_PRCMU_GPIO1 (IRQ_PRCMU_BASE + 12)
127#define IRQ_PRCMU_GPIO2 (IRQ_PRCMU_BASE + 13)
128#define IRQ_PRCMU_GPIO3 (IRQ_PRCMU_BASE + 14)
129#define IRQ_PRCMU_GPIO4 (IRQ_PRCMU_BASE + 15)
130#define IRQ_PRCMU_GPIO5 (IRQ_PRCMU_BASE + 16)
131#define IRQ_PRCMU_GPIO6 (IRQ_PRCMU_BASE + 17)
132#define IRQ_PRCMU_GPIO7 (IRQ_PRCMU_BASE + 18)
133#define IRQ_PRCMU_GPIO8 (IRQ_PRCMU_BASE + 19)
134#define IRQ_PRCMU_CA_SLEEP (IRQ_PRCMU_BASE + 20)
135#define IRQ_PRCMU_HOTMON_LOW (IRQ_PRCMU_BASE + 21)
136#define IRQ_PRCMU_HOTMON_HIGH (IRQ_PRCMU_BASE + 22)
137#define IRQ_PRCMU_END (IRQ_PRCMU_BASE + 23) 112#define IRQ_PRCMU_END (IRQ_PRCMU_BASE + 23)
138 113
139/* 114/*
diff --git a/arch/arm/mach-ux500/include/mach/irqs.h b/arch/arm/mach-ux500/irqs.h
index fc77b4274c8d..15b2af698ed7 100644
--- a/arch/arm/mach-ux500/include/mach/irqs.h
+++ b/arch/arm/mach-ux500/irqs.h
@@ -10,8 +10,6 @@
10#ifndef ASM_ARCH_IRQS_H 10#ifndef ASM_ARCH_IRQS_H
11#define ASM_ARCH_IRQS_H 11#define ASM_ARCH_IRQS_H
12 12
13#include <mach/hardware.h>
14
15#define IRQ_LOCALTIMER 29 13#define IRQ_LOCALTIMER 29
16#define IRQ_LOCALWDOG 30 14#define IRQ_LOCALWDOG 30
17 15
@@ -36,14 +34,14 @@
36/* This will be overridden by SoC-specific irq headers */ 34/* This will be overridden by SoC-specific irq headers */
37#define IRQ_SOC_END IRQ_SOC_START 35#define IRQ_SOC_END IRQ_SOC_START
38 36
39#include <mach/irqs-db8500.h> 37#include "irqs-db8500.h"
40 38
41#define IRQ_BOARD_START IRQ_SOC_END 39#define IRQ_BOARD_START IRQ_SOC_END
42/* This will be overridden by board-specific irq headers */ 40/* This will be overridden by board-specific irq headers */
43#define IRQ_BOARD_END IRQ_BOARD_START 41#define IRQ_BOARD_END IRQ_BOARD_START
44 42
45#ifdef CONFIG_MACH_MOP500 43#ifdef CONFIG_MACH_MOP500
46#include <mach/irqs-board-mop500.h> 44#include "irqs-board-mop500.h"
47#endif 45#endif
48 46
49#define UX500_NR_IRQS IRQ_BOARD_END 47#define UX500_NR_IRQS IRQ_BOARD_END
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index 152b1309b9af..14d90469392f 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -21,9 +21,9 @@
21#include <asm/smp_plat.h> 21#include <asm/smp_plat.h>
22#include <asm/smp_scu.h> 22#include <asm/smp_scu.h>
23 23
24#include <mach/hardware.h> 24#include "setup.h"
25#include <mach/setup.h>
26 25
26#include "db8500-regs.h"
27#include "id.h" 27#include "id.h"
28 28
29/* This is called from headsmp.S to wakeup the secondary core */ 29/* This is called from headsmp.S to wakeup the secondary core */
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c
new file mode 100644
index 000000000000..1a468f0fd22e
--- /dev/null
+++ b/arch/arm/mach-ux500/pm.c
@@ -0,0 +1,167 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010-2013
3 * Author: Rickard Andersson <rickard.andersson@stericsson.com> for
4 * ST-Ericsson.
5 * Author: Daniel Lezcano <daniel.lezcano@linaro.org> for Linaro.
6 * License terms: GNU General Public License (GPL) version 2
7 *
8 */
9
10#include <linux/kernel.h>
11#include <linux/irqchip/arm-gic.h>
12#include <linux/delay.h>
13#include <linux/io.h>
14#include <linux/platform_data/arm-ux500-pm.h>
15
16#include "db8500-regs.h"
17
18/* ARM WFI Standby signal register */
19#define PRCM_ARM_WFI_STANDBY (prcmu_base + 0x130)
20#define PRCM_ARM_WFI_STANDBY_WFI0 0x08
21#define PRCM_ARM_WFI_STANDBY_WFI1 0x10
22#define PRCM_IOCR (prcmu_base + 0x310)
23#define PRCM_IOCR_IOFORCE 0x1
24
25/* Dual A9 core interrupt management unit registers */
26#define PRCM_A9_MASK_REQ (prcmu_base + 0x328)
27#define PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ 0x1
28
29#define PRCM_A9_MASK_ACK (prcmu_base + 0x32c)
30#define PRCM_ARMITMSK31TO0 (prcmu_base + 0x11c)
31#define PRCM_ARMITMSK63TO32 (prcmu_base + 0x120)
32#define PRCM_ARMITMSK95TO64 (prcmu_base + 0x124)
33#define PRCM_ARMITMSK127TO96 (prcmu_base + 0x128)
34#define PRCM_POWER_STATE_VAL (prcmu_base + 0x25C)
35#define PRCM_ARMITVAL31TO0 (prcmu_base + 0x260)
36#define PRCM_ARMITVAL63TO32 (prcmu_base + 0x264)
37#define PRCM_ARMITVAL95TO64 (prcmu_base + 0x268)
38#define PRCM_ARMITVAL127TO96 (prcmu_base + 0x26C)
39
40static void __iomem *prcmu_base;
41
42/* This function decouple the gic from the prcmu */
43int prcmu_gic_decouple(void)
44{
45 u32 val = readl(PRCM_A9_MASK_REQ);
46
47 /* Set bit 0 register value to 1 */
48 writel(val | PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ,
49 PRCM_A9_MASK_REQ);
50
51 /* Make sure the register is updated */
52 readl(PRCM_A9_MASK_REQ);
53
54 /* Wait a few cycles for the gic mask completion */
55 udelay(1);
56
57 return 0;
58}
59
60/* This function recouple the gic with the prcmu */
61int prcmu_gic_recouple(void)
62{
63 u32 val = readl(PRCM_A9_MASK_REQ);
64
65 /* Set bit 0 register value to 0 */
66 writel(val & ~PRCM_A9_MASK_REQ_PRCM_A9_MASK_REQ, PRCM_A9_MASK_REQ);
67
68 return 0;
69}
70
71#define PRCMU_GIC_NUMBER_REGS 5
72
73/*
74 * This function checks if there are pending irq on the gic. It only
75 * makes sense if the gic has been decoupled before with the
76 * db8500_prcmu_gic_decouple function. Disabling an interrupt only
77 * disables the forwarding of the interrupt to any CPU interface. It
78 * does not prevent the interrupt from changing state, for example
79 * becoming pending, or active and pending if it is already
80 * active. Hence, we have to check the interrupt is pending *and* is
81 * active.
82 */
83bool prcmu_gic_pending_irq(void)
84{
85 u32 pr; /* Pending register */
86 u32 er; /* Enable register */
87 void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE);
88 int i;
89
90 /* 5 registers. STI & PPI not skipped */
91 for (i = 0; i < PRCMU_GIC_NUMBER_REGS; i++) {
92
93 pr = readl_relaxed(dist_base + GIC_DIST_PENDING_SET + i * 4);
94 er = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);
95
96 if (pr & er)
97 return true; /* There is a pending interrupt */
98 }
99
100 return false;
101}
102
103/*
104 * This function checks if there are pending interrupt on the
105 * prcmu which has been delegated to monitor the irqs with the
106 * db8500_prcmu_copy_gic_settings function.
107 */
108bool prcmu_pending_irq(void)
109{
110 u32 it, im;
111 int i;
112
113 for (i = 0; i < PRCMU_GIC_NUMBER_REGS - 1; i++) {
114 it = readl(PRCM_ARMITVAL31TO0 + i * 4);
115 im = readl(PRCM_ARMITMSK31TO0 + i * 4);
116 if (it & im)
117 return true; /* There is a pending interrupt */
118 }
119
120 return false;
121}
122
123/*
124 * This function checks if the specified cpu is in in WFI. It's usage
125 * makes sense only if the gic is decoupled with the db8500_prcmu_gic_decouple
126 * function. Of course passing smp_processor_id() to this function will
127 * always return false...
128 */
129bool prcmu_is_cpu_in_wfi(int cpu)
130{
131 return readl(PRCM_ARM_WFI_STANDBY) & cpu ? PRCM_ARM_WFI_STANDBY_WFI1 :
132 PRCM_ARM_WFI_STANDBY_WFI0;
133}
134
135/*
136 * This function copies the gic SPI settings to the prcmu in order to
137 * monitor them and abort/finish the retention/off sequence or state.
138 */
139int prcmu_copy_gic_settings(void)
140{
141 u32 er; /* Enable register */
142 void __iomem *dist_base = __io_address(U8500_GIC_DIST_BASE);
143 int i;
144
145 /* We skip the STI and PPI */
146 for (i = 0; i < PRCMU_GIC_NUMBER_REGS - 1; i++) {
147 er = readl_relaxed(dist_base +
148 GIC_DIST_ENABLE_SET + (i + 1) * 4);
149 writel(er, PRCM_ARMITMSK31TO0 + i * 4);
150 }
151
152 return 0;
153}
154
155void __init ux500_pm_init(u32 phy_base, u32 size)
156{
157 prcmu_base = ioremap(phy_base, size);
158 if (!prcmu_base) {
159 pr_err("could not remap PRCMU for PM functions\n");
160 return;
161 }
162 /*
163 * On watchdog reboot the GIC is in some cases decoupled.
164 * This will make sure that the GIC is correctly configured.
165 */
166 prcmu_gic_recouple();
167}
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/setup.h
index bddce2b49372..bddce2b49372 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/setup.h
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c
index d07bbe7f04a6..b6bd0efcbe64 100644
--- a/arch/arm/mach-ux500/timer.c
+++ b/arch/arm/mach-ux500/timer.c
@@ -14,10 +14,10 @@
14 14
15#include <asm/smp_twd.h> 15#include <asm/smp_twd.h>
16 16
17#include <mach/setup.h> 17#include "setup.h"
18#include <mach/hardware.h> 18#include "irqs.h"
19#include <mach/irqs.h>
20 19
20#include "db8500-regs.h"
21#include "id.h" 21#include "id.h"
22 22
23#ifdef CONFIG_HAVE_ARM_TWD 23#ifdef CONFIG_HAVE_ARM_TWD
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c
index 78ac65f62e87..2dfc72f7cd8a 100644
--- a/arch/arm/mach-ux500/usb.c
+++ b/arch/arm/mach-ux500/usb.c
@@ -10,7 +10,7 @@
10#include <linux/platform_data/usb-musb-ux500.h> 10#include <linux/platform_data/usb-musb-ux500.h>
11#include <linux/platform_data/dma-ste-dma40.h> 11#include <linux/platform_data/dma-ste-dma40.h>
12 12
13#include <mach/hardware.h> 13#include "db8500-regs.h"
14 14
15#define MUSB_DMA40_RX_CH { \ 15#define MUSB_DMA40_RX_CH { \
16 .mode = STEDMA40_MODE_LOGICAL, \ 16 .mode = STEDMA40_MODE_LOGICAL, \