aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig12
-rw-r--r--arch/arm/boot/compressed/mmcif-sh7372.c2
-rw-r--r--arch/arm/boot/compressed/sdhi-sh7372.c2
-rw-r--r--arch/arm/boot/dts/tegra-harmony.dts12
-rw-r--r--arch/arm/boot/dts/tegra-seaboard.dts6
-rw-r--r--arch/arm/include/asm/hardware/cache-l2x0.h11
-rw-r--r--arch/arm/include/asm/pmu.h10
-rw-r--r--arch/arm/kernel/pmu.c26
-rw-r--r--arch/arm/kernel/relocate_kernel.S3
-rw-r--r--arch/arm/kernel/setup.c15
-rw-r--r--arch/arm/kernel/smp_twd.c4
-rw-r--r--arch/arm/mach-at91/at91sam9261.c2
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/entry-macro.S1
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/system.h1
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/uncompress.h1
-rw-r--r--arch/arm/mach-cns3xxx/pcie.c2
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c28
-rw-r--r--arch/arm/mach-davinci/include/mach/psc.h2
-rw-r--r--arch/arm/mach-davinci/sleep.S6
-rw-r--r--arch/arm/mach-dove/common.c2
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ts72xx.h26
-rw-r--r--arch/arm/mach-exynos4/clock.c4
-rw-r--r--arch/arm/mach-exynos4/cpu.c11
-rw-r--r--arch/arm/mach-exynos4/include/mach/irqs.h5
-rw-r--r--arch/arm/mach-exynos4/include/mach/regs-pmu.h2
-rw-r--r--arch/arm/mach-exynos4/irq-eint.c7
-rw-r--r--arch/arm/mach-exynos4/mach-universal_c210.c4
-rw-r--r--arch/arm/mach-exynos4/mct.c10
-rw-r--r--arch/arm/mach-exynos4/platsmp.c2
-rw-r--r--arch/arm/mach-exynos4/setup-keypad.c11
-rw-r--r--arch/arm/mach-exynos4/setup-usb-phy.c2
-rw-r--r--arch/arm/mach-footbridge/Kconfig1
-rw-r--r--arch/arm/mach-footbridge/dc21285.c1
-rw-r--r--arch/arm/mach-imx/mach-cpuimx27.c2
-rw-r--r--arch/arm/mach-imx/mach-cpuimx35.c2
-rw-r--r--arch/arm/mach-imx/mach-eukrea_cpuimx25.c2
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c8
-rw-r--r--arch/arm/mach-integrator/pci_v3.c2
-rw-r--r--arch/arm/mach-omap1/Makefile2
-rw-r--r--arch/arm/mach-omap1/timer.c173
-rw-r--r--arch/arm/mach-omap2/Makefile81
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c9
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c9
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c11
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c9
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c9
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c8
-rw-r--r--arch/arm/mach-omap2/board-apollon.c9
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c13
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c9
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c12
-rw-r--r--arch/arm/mach-omap2/board-generic.c2
-rw-r--r--arch/arm/mach-omap2/board-h4.c9
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c13
-rw-r--r--arch/arm/mach-omap2/board-ldp.c9
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c13
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c9
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c11
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c11
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c9
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c11
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c9
-rw-r--r--arch/arm/mach-omap2/board-overo.c11
-rw-r--r--arch/arm/mach-omap2/board-rm680.c17
-rw-r--r--arch/arm/mach-omap2/board-rx51.c17
-rw-r--r--arch/arm/mach-omap2/board-ti8168evm.c9
-rw-r--r--arch/arm/mach-omap2/board-zoom.c23
-rw-r--r--arch/arm/mach-omap2/clock2420_data.c48
-rw-r--r--arch/arm/mach-omap2/clock2430_data.c48
-rw-r--r--arch/arm/mach-omap2/clock3xxx_data.c49
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c43
-rw-r--r--arch/arm/mach-omap2/clockdomain.c151
-rw-r--r--arch/arm/mach-omap2/clockdomain.h22
-rw-r--r--arch/arm/mach-omap2/clockdomain2xxx_3xxx.c4
-rw-r--r--arch/arm/mach-omap2/clockdomain44xx.c2
-rw-r--r--arch/arm/mach-omap2/clockdomains2420_data.c154
-rw-r--r--arch/arm/mach-omap2/clockdomains2430_data.c181
-rw-r--r--arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c803
-rw-r--r--arch/arm/mach-omap2/clockdomains3xxx_data.c398
-rw-r--r--arch/arm/mach-omap2/clockdomains44xx_data.c409
-rw-r--r--arch/arm/mach-omap2/id.c191
-rw-r--r--arch/arm/mach-omap2/io.c52
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c3
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c59
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c68
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c196
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c104
-rw-r--r--arch/arm/mach-omap2/pm.c2
-rw-r--r--arch/arm/mach-omap2/powerdomain-common.c7
-rw-r--r--arch/arm/mach-omap2/powerdomain.c86
-rw-r--r--arch/arm/mach-omap2/powerdomain.h9
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c19
-rw-r--r--arch/arm/mach-omap2/powerdomains2xxx_data.c44
-rw-r--r--arch/arm/mach-omap2/powerdomains3xxx_data.c81
-rw-r--r--arch/arm/mach-omap2/powerdomains44xx_data.c20
-rw-r--r--arch/arm/mach-omap2/timer.c194
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c2
-rw-r--r--arch/arm/mach-orion5x/pci.c1
-rw-r--r--arch/arm/mach-prima2/clock.c1
-rw-r--r--arch/arm/mach-prima2/irq.c1
-rw-r--r--arch/arm/mach-prima2/rstc.c1
-rw-r--r--arch/arm/mach-prima2/timer.c1
-rw-r--r--arch/arm/mach-realview/include/mach/system.h1
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c39
-rw-r--r--arch/arm/mach-s3c64xx/pm.c1
-rw-r--r--arch/arm/mach-s5p64x0/irq-eint.c2
-rw-r--r--arch/arm/mach-s5pv210/pm.c2
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c3
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c4
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c29
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c2
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7372.h4
-rw-r--r--arch/arm/mach-shmobile/intc-sh7372.c7
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c176
-rw-r--r--arch/arm/mach-ux500/Makefile2
-rw-r--r--arch/arm/mach-ux500/cpu.c29
-rw-r--r--arch/arm/mach-ux500/include/mach/db5500-regs.h2
-rw-r--r--arch/arm/mach-ux500/include/mach/db8500-regs.h3
-rw-r--r--arch/arm/mach-ux500/timer.c68
-rw-r--r--arch/arm/mach-vexpress/v2m.c7
-rw-r--r--arch/arm/mm/abort-macro.S2
-rw-r--r--arch/arm/mm/cache-l2x0.c21
-rw-r--r--arch/arm/mm/init.c2
-rw-r--r--arch/arm/mm/proc-arm920.S2
-rw-r--r--arch/arm/mm/proc-arm926.S2
-rw-r--r--arch/arm/mm/proc-sa1100.S10
-rw-r--r--arch/arm/mm/proc-v6.S16
-rw-r--r--arch/arm/mm/proc-v7.S6
-rw-r--r--arch/arm/mm/proc-xsc3.S6
-rw-r--r--arch/arm/plat-nomadik/Kconfig8
-rw-r--r--arch/arm/plat-nomadik/include/plat/mtu.h47
-rw-r--r--arch/arm/plat-nomadik/timer.c138
-rw-r--r--arch/arm/plat-omap/dmtimer.c713
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h2
-rw-r--r--arch/arm/plat-omap/include/plat/common.h9
-rw-r--r--arch/arm/plat-omap/include/plat/cpu.h108
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h233
-rw-r--r--arch/arm/plat-omap/include/plat/io.h2
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h2
-rw-r--r--arch/arm/plat-omap/omap_device.c3
-rw-r--r--arch/arm/plat-s5p/clock.c2
-rw-r--r--arch/arm/plat-s5p/irq-gpioint.c6
-rw-r--r--arch/arm/plat-samsung/clock.c11
-rw-r--r--arch/arm/plat-samsung/include/plat/backlight.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/clock.h8
-rw-r--r--arch/arm/plat-samsung/include/plat/watchdog-reset.h10
-rw-r--r--arch/arm/plat-samsung/irq-vic-timer.c5
-rw-r--r--arch/arm/tools/mach-types6
149 files changed, 3306 insertions, 2702 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5ebc5d922ea1..3269576dbfa8 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1271,6 +1271,18 @@ config ARM_ERRATA_754327
1271 This workaround defines cpu_relax() as smp_mb(), preventing correctly 1271 This workaround defines cpu_relax() as smp_mb(), preventing correctly
1272 written polling loops from denying visibility of updates to memory. 1272 written polling loops from denying visibility of updates to memory.
1273 1273
1274config ARM_ERRATA_364296
1275 bool "ARM errata: Possible cache data corruption with hit-under-miss enabled"
1276 depends on CPU_V6 && !SMP
1277 help
1278 This options enables the workaround for the 364296 ARM1136
1279 r0p2 erratum (possible cache data corruption with
1280 hit-under-miss enabled). It sets the undocumented bit 31 in
1281 the auxiliary control register and the FI bit in the control
1282 register, thus disabling hit-under-miss without putting the
1283 processor into full low interrupt latency mode. ARM11MPCore
1284 is not affected.
1285
1274endmenu 1286endmenu
1275 1287
1276source "arch/arm/common/Kconfig" 1288source "arch/arm/common/Kconfig"
diff --git a/arch/arm/boot/compressed/mmcif-sh7372.c b/arch/arm/boot/compressed/mmcif-sh7372.c
index b6f61d9a5a1b..672ae95db5c3 100644
--- a/arch/arm/boot/compressed/mmcif-sh7372.c
+++ b/arch/arm/boot/compressed/mmcif-sh7372.c
@@ -82,7 +82,7 @@ asmlinkage void mmc_loader(unsigned char *buf, unsigned long len)
82 82
83 83
84 /* Disable clock to MMC hardware block */ 84 /* Disable clock to MMC hardware block */
85 __raw_writel(__raw_readl(SMSTPCR3) & (1 << 12), SMSTPCR3); 85 __raw_writel(__raw_readl(SMSTPCR3) | (1 << 12), SMSTPCR3);
86 86
87 mmc_update_progress(MMC_PROGRESS_DONE); 87 mmc_update_progress(MMC_PROGRESS_DONE);
88} 88}
diff --git a/arch/arm/boot/compressed/sdhi-sh7372.c b/arch/arm/boot/compressed/sdhi-sh7372.c
index d403a8b24d7f..d279294f2381 100644
--- a/arch/arm/boot/compressed/sdhi-sh7372.c
+++ b/arch/arm/boot/compressed/sdhi-sh7372.c
@@ -85,7 +85,7 @@ asmlinkage void mmc_loader(unsigned short *buf, unsigned long len)
85 goto err; 85 goto err;
86 86
87 /* Disable clock to SDHI1 hardware block */ 87 /* Disable clock to SDHI1 hardware block */
88 __raw_writel(__raw_readl(SMSTPCR3) & (1 << 13), SMSTPCR3); 88 __raw_writel(__raw_readl(SMSTPCR3) | (1 << 13), SMSTPCR3);
89 89
90 mmc_update_progress(MMC_PROGRESS_DONE); 90 mmc_update_progress(MMC_PROGRESS_DONE);
91 91
diff --git a/arch/arm/boot/dts/tegra-harmony.dts b/arch/arm/boot/dts/tegra-harmony.dts
index 4c053340ce33..e5818668d091 100644
--- a/arch/arm/boot/dts/tegra-harmony.dts
+++ b/arch/arm/boot/dts/tegra-harmony.dts
@@ -57,14 +57,14 @@
57 }; 57 };
58 58
59 sdhci@c8000200 { 59 sdhci@c8000200 {
60 gpios = <&gpio 69 0>, /* cd, gpio PI5 */ 60 cd-gpios = <&gpio 69 0>; /* gpio PI5 */
61 <&gpio 57 0>, /* wp, gpio PH1 */ 61 wp-gpios = <&gpio 57 0>; /* gpio PH1 */
62 <&gpio 155 0>; /* power, gpio PT3 */ 62 power-gpios = <&gpio 155 0>; /* gpio PT3 */
63 }; 63 };
64 64
65 sdhci@c8000600 { 65 sdhci@c8000600 {
66 gpios = <&gpio 58 0>, /* cd, gpio PH2 */ 66 cd-gpios = <&gpio 58 0>; /* gpio PH2 */
67 <&gpio 59 0>, /* wp, gpio PH3 */ 67 wp-gpios = <&gpio 59 0>; /* gpio PH3 */
68 <&gpio 70 0>; /* power, gpio PI6 */ 68 power-gpios = <&gpio 70 0>; /* gpio PI6 */
69 }; 69 };
70}; 70};
diff --git a/arch/arm/boot/dts/tegra-seaboard.dts b/arch/arm/boot/dts/tegra-seaboard.dts
index 1940cae00748..64cedca6fc79 100644
--- a/arch/arm/boot/dts/tegra-seaboard.dts
+++ b/arch/arm/boot/dts/tegra-seaboard.dts
@@ -21,8 +21,8 @@
21 }; 21 };
22 22
23 sdhci@c8000400 { 23 sdhci@c8000400 {
24 gpios = <&gpio 69 0>, /* cd, gpio PI5 */ 24 cd-gpios = <&gpio 69 0>; /* gpio PI5 */
25 <&gpio 57 0>, /* wp, gpio PH1 */ 25 wp-gpios = <&gpio 57 0>; /* gpio PH1 */
26 <&gpio 70 0>; /* power, gpio PI6 */ 26 power-gpios = <&gpio 70 0>; /* gpio PI6 */
27 }; 27 };
28}; 28};
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index 16bd48031583..99a6ed7e1bfd 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -45,8 +45,13 @@
45#define L2X0_CLEAN_INV_LINE_PA 0x7F0 45#define L2X0_CLEAN_INV_LINE_PA 0x7F0
46#define L2X0_CLEAN_INV_LINE_IDX 0x7F8 46#define L2X0_CLEAN_INV_LINE_IDX 0x7F8
47#define L2X0_CLEAN_INV_WAY 0x7FC 47#define L2X0_CLEAN_INV_WAY 0x7FC
48#define L2X0_LOCKDOWN_WAY_D 0x900 48/*
49#define L2X0_LOCKDOWN_WAY_I 0x904 49 * The lockdown registers repeat 8 times for L310, the L210 has only one
50 * D and one I lockdown register at 0x0900 and 0x0904.
51 */
52#define L2X0_LOCKDOWN_WAY_D_BASE 0x900
53#define L2X0_LOCKDOWN_WAY_I_BASE 0x904
54#define L2X0_LOCKDOWN_STRIDE 0x08
50#define L2X0_TEST_OPERATION 0xF00 55#define L2X0_TEST_OPERATION 0xF00
51#define L2X0_LINE_DATA 0xF10 56#define L2X0_LINE_DATA 0xF10
52#define L2X0_LINE_TAG 0xF30 57#define L2X0_LINE_TAG 0xF30
@@ -64,7 +69,7 @@
64#define L2X0_AUX_CTRL_MASK 0xc0000fff 69#define L2X0_AUX_CTRL_MASK 0xc0000fff
65#define L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT 16 70#define L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT 16
66#define L2X0_AUX_CTRL_WAY_SIZE_SHIFT 17 71#define L2X0_AUX_CTRL_WAY_SIZE_SHIFT 17
67#define L2X0_AUX_CTRL_WAY_SIZE_MASK (0x3 << 17) 72#define L2X0_AUX_CTRL_WAY_SIZE_MASK (0x7 << 17)
68#define L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT 22 73#define L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT 22
69#define L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT 26 74#define L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT 26
70#define L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT 27 75#define L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT 27
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index 67c70a31a1be..b7e82c4aced6 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -41,7 +41,7 @@ struct arm_pmu_platdata {
41 * encoded error on failure. 41 * encoded error on failure.
42 */ 42 */
43extern struct platform_device * 43extern struct platform_device *
44reserve_pmu(enum arm_pmu_type device); 44reserve_pmu(enum arm_pmu_type type);
45 45
46/** 46/**
47 * release_pmu() - Relinquish control of the performance counters 47 * release_pmu() - Relinquish control of the performance counters
@@ -62,26 +62,26 @@ release_pmu(enum arm_pmu_type type);
62 * the actual hardware initialisation. 62 * the actual hardware initialisation.
63 */ 63 */
64extern int 64extern int
65init_pmu(enum arm_pmu_type device); 65init_pmu(enum arm_pmu_type type);
66 66
67#else /* CONFIG_CPU_HAS_PMU */ 67#else /* CONFIG_CPU_HAS_PMU */
68 68
69#include <linux/err.h> 69#include <linux/err.h>
70 70
71static inline struct platform_device * 71static inline struct platform_device *
72reserve_pmu(enum arm_pmu_type device) 72reserve_pmu(enum arm_pmu_type type)
73{ 73{
74 return ERR_PTR(-ENODEV); 74 return ERR_PTR(-ENODEV);
75} 75}
76 76
77static inline int 77static inline int
78release_pmu(struct platform_device *pdev) 78release_pmu(enum arm_pmu_type type)
79{ 79{
80 return -ENODEV; 80 return -ENODEV;
81} 81}
82 82
83static inline int 83static inline int
84init_pmu(enum arm_pmu_type device) 84init_pmu(enum arm_pmu_type type)
85{ 85{
86 return -ENODEV; 86 return -ENODEV;
87} 87}
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c
index 2b70709376c3..c53474fe84df 100644
--- a/arch/arm/kernel/pmu.c
+++ b/arch/arm/kernel/pmu.c
@@ -31,7 +31,7 @@ static int __devinit pmu_register(struct platform_device *pdev,
31{ 31{
32 if (type < 0 || type >= ARM_NUM_PMU_DEVICES) { 32 if (type < 0 || type >= ARM_NUM_PMU_DEVICES) {
33 pr_warning("received registration request for unknown " 33 pr_warning("received registration request for unknown "
34 "device %d\n", type); 34 "PMU device type %d\n", type);
35 return -EINVAL; 35 return -EINVAL;
36 } 36 }
37 37
@@ -112,17 +112,17 @@ static int __init register_pmu_driver(void)
112device_initcall(register_pmu_driver); 112device_initcall(register_pmu_driver);
113 113
114struct platform_device * 114struct platform_device *
115reserve_pmu(enum arm_pmu_type device) 115reserve_pmu(enum arm_pmu_type type)
116{ 116{
117 struct platform_device *pdev; 117 struct platform_device *pdev;
118 118
119 if (test_and_set_bit_lock(device, &pmu_lock)) { 119 if (test_and_set_bit_lock(type, &pmu_lock)) {
120 pdev = ERR_PTR(-EBUSY); 120 pdev = ERR_PTR(-EBUSY);
121 } else if (pmu_devices[device] == NULL) { 121 } else if (pmu_devices[type] == NULL) {
122 clear_bit_unlock(device, &pmu_lock); 122 clear_bit_unlock(type, &pmu_lock);
123 pdev = ERR_PTR(-ENODEV); 123 pdev = ERR_PTR(-ENODEV);
124 } else { 124 } else {
125 pdev = pmu_devices[device]; 125 pdev = pmu_devices[type];
126 } 126 }
127 127
128 return pdev; 128 return pdev;
@@ -130,11 +130,11 @@ reserve_pmu(enum arm_pmu_type device)
130EXPORT_SYMBOL_GPL(reserve_pmu); 130EXPORT_SYMBOL_GPL(reserve_pmu);
131 131
132int 132int
133release_pmu(enum arm_pmu_type device) 133release_pmu(enum arm_pmu_type type)
134{ 134{
135 if (WARN_ON(!pmu_devices[device])) 135 if (WARN_ON(!pmu_devices[type]))
136 return -EINVAL; 136 return -EINVAL;
137 clear_bit_unlock(device, &pmu_lock); 137 clear_bit_unlock(type, &pmu_lock);
138 return 0; 138 return 0;
139} 139}
140EXPORT_SYMBOL_GPL(release_pmu); 140EXPORT_SYMBOL_GPL(release_pmu);
@@ -182,17 +182,17 @@ init_cpu_pmu(void)
182} 182}
183 183
184int 184int
185init_pmu(enum arm_pmu_type device) 185init_pmu(enum arm_pmu_type type)
186{ 186{
187 int err = 0; 187 int err = 0;
188 188
189 switch (device) { 189 switch (type) {
190 case ARM_PMU_DEVICE_CPU: 190 case ARM_PMU_DEVICE_CPU:
191 err = init_cpu_pmu(); 191 err = init_cpu_pmu();
192 break; 192 break;
193 default: 193 default:
194 pr_warning("attempt to initialise unknown device %d\n", 194 pr_warning("attempt to initialise PMU of unknown "
195 device); 195 "type %d\n", type);
196 err = -EINVAL; 196 err = -EINVAL;
197 } 197 }
198 198
diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S
index 9cf4cbf8f95b..d0cdedf4864d 100644
--- a/arch/arm/kernel/relocate_kernel.S
+++ b/arch/arm/kernel/relocate_kernel.S
@@ -57,7 +57,8 @@ relocate_new_kernel:
57 mov r0,#0 57 mov r0,#0
58 ldr r1,kexec_mach_type 58 ldr r1,kexec_mach_type
59 ldr r2,kexec_boot_atags 59 ldr r2,kexec_boot_atags
60 mov pc,lr 60 ARM( mov pc, lr )
61 THUMB( bx lr )
61 62
62 .align 63 .align
63 64
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 70bca649e925..e514c76043b4 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -280,18 +280,19 @@ static void __init cacheid_init(void)
280 if (arch >= CPU_ARCH_ARMv6) { 280 if (arch >= CPU_ARCH_ARMv6) {
281 if ((cachetype & (7 << 29)) == 4 << 29) { 281 if ((cachetype & (7 << 29)) == 4 << 29) {
282 /* ARMv7 register format */ 282 /* ARMv7 register format */
283 arch = CPU_ARCH_ARMv7;
283 cacheid = CACHEID_VIPT_NONALIASING; 284 cacheid = CACHEID_VIPT_NONALIASING;
284 if ((cachetype & (3 << 14)) == 1 << 14) 285 if ((cachetype & (3 << 14)) == 1 << 14)
285 cacheid |= CACHEID_ASID_TAGGED; 286 cacheid |= CACHEID_ASID_TAGGED;
286 else if (cpu_has_aliasing_icache(CPU_ARCH_ARMv7))
287 cacheid |= CACHEID_VIPT_I_ALIASING;
288 } else if (cachetype & (1 << 23)) {
289 cacheid = CACHEID_VIPT_ALIASING;
290 } else { 287 } else {
291 cacheid = CACHEID_VIPT_NONALIASING; 288 arch = CPU_ARCH_ARMv6;
292 if (cpu_has_aliasing_icache(CPU_ARCH_ARMv6)) 289 if (cachetype & (1 << 23))
293 cacheid |= CACHEID_VIPT_I_ALIASING; 290 cacheid = CACHEID_VIPT_ALIASING;
291 else
292 cacheid = CACHEID_VIPT_NONALIASING;
294 } 293 }
294 if (cpu_has_aliasing_icache(arch))
295 cacheid |= CACHEID_VIPT_I_ALIASING;
295 } else { 296 } else {
296 cacheid = CACHEID_VIVT; 297 cacheid = CACHEID_VIVT;
297 } 298 }
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 2c277d40cee6..01c186222f3b 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -137,8 +137,8 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
137 clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk); 137 clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
138 clk->min_delta_ns = clockevent_delta2ns(0xf, clk); 138 clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
139 139
140 clockevents_register_device(clk);
141
140 /* Make sure our local interrupt controller has this enabled */ 142 /* Make sure our local interrupt controller has this enabled */
141 gic_enable_ppi(clk->irq); 143 gic_enable_ppi(clk->irq);
142
143 clockevents_register_device(clk);
144} 144}
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index d522b47e30b5..6c8e3b5f669f 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -157,7 +157,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
157 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), 157 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
158 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), 158 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
159 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), 159 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
160 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc1_clk), 160 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
161 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), 161 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
162 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), 162 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
163 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), 163 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
diff --git a/arch/arm/mach-cns3xxx/include/mach/entry-macro.S b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S
index 6bd83ed90afe..d87bfc397d39 100644
--- a/arch/arm/mach-cns3xxx/include/mach/entry-macro.S
+++ b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S
@@ -8,7 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <mach/hardware.h>
12#include <asm/hardware/entry-macro-gic.S> 11#include <asm/hardware/entry-macro-gic.S>
13 12
14 .macro disable_fiq 13 .macro disable_fiq
diff --git a/arch/arm/mach-cns3xxx/include/mach/system.h b/arch/arm/mach-cns3xxx/include/mach/system.h
index 58bb03ae3cf4..4f16c9b79f78 100644
--- a/arch/arm/mach-cns3xxx/include/mach/system.h
+++ b/arch/arm/mach-cns3xxx/include/mach/system.h
@@ -13,7 +13,6 @@
13 13
14#include <linux/io.h> 14#include <linux/io.h>
15#include <asm/proc-fns.h> 15#include <asm/proc-fns.h>
16#include <mach/hardware.h>
17 16
18static inline void arch_idle(void) 17static inline void arch_idle(void)
19{ 18{
diff --git a/arch/arm/mach-cns3xxx/include/mach/uncompress.h b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
index de8ead9b91f7..a91b6058ab4f 100644
--- a/arch/arm/mach-cns3xxx/include/mach/uncompress.h
+++ b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
@@ -8,7 +8,6 @@
8 */ 8 */
9 9
10#include <asm/mach-types.h> 10#include <asm/mach-types.h>
11#include <mach/hardware.h>
12#include <mach/cns3xxx.h> 11#include <mach/cns3xxx.h>
13 12
14#define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) 13#define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00))
diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c
index 06fd25d70aec..0f8fca48a5ed 100644
--- a/arch/arm/mach-cns3xxx/pcie.c
+++ b/arch/arm/mach-cns3xxx/pcie.c
@@ -49,7 +49,7 @@ static struct cns3xxx_pcie *sysdata_to_cnspci(void *sysdata)
49 return &cns3xxx_pcie[root->domain]; 49 return &cns3xxx_pcie[root->domain];
50} 50}
51 51
52static struct cns3xxx_pcie *pdev_to_cnspci(struct pci_dev *dev) 52static struct cns3xxx_pcie *pdev_to_cnspci(const struct pci_dev *dev)
53{ 53{
54 return sysdata_to_cnspci(dev->sysdata); 54 return sysdata_to_cnspci(dev->sysdata);
55} 55}
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index bd5394537c88..008d51407cd7 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -115,6 +115,32 @@ static struct spi_board_info da850evm_spi_info[] = {
115 }, 115 },
116}; 116};
117 117
118#ifdef CONFIG_MTD
119static void da850_evm_m25p80_notify_add(struct mtd_info *mtd)
120{
121 char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
122 size_t retlen;
123
124 if (!strcmp(mtd->name, "MAC-Address")) {
125 mtd->read(mtd, 0, ETH_ALEN, &retlen, mac_addr);
126 if (retlen == ETH_ALEN)
127 pr_info("Read MAC addr from SPI Flash: %pM\n",
128 mac_addr);
129 }
130}
131
132static struct mtd_notifier da850evm_spi_notifier = {
133 .add = da850_evm_m25p80_notify_add,
134};
135
136static void da850_evm_setup_mac_addr(void)
137{
138 register_mtd_user(&da850evm_spi_notifier);
139}
140#else
141static void da850_evm_setup_mac_addr(void) { }
142#endif
143
118static struct mtd_partition da850_evm_norflash_partition[] = { 144static struct mtd_partition da850_evm_norflash_partition[] = {
119 { 145 {
120 .name = "bootloaders + env", 146 .name = "bootloaders + env",
@@ -1244,6 +1270,8 @@ static __init void da850_evm_init(void)
1244 if (ret) 1270 if (ret)
1245 pr_warning("da850_evm_init: sata registration failed: %d\n", 1271 pr_warning("da850_evm_init: sata registration failed: %d\n",
1246 ret); 1272 ret);
1273
1274 da850_evm_setup_mac_addr();
1247} 1275}
1248 1276
1249#ifdef CONFIG_SERIAL_8250_CONSOLE 1277#ifdef CONFIG_SERIAL_8250_CONSOLE
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h
index 47fd0bc3d3e7..fa59c097223d 100644
--- a/arch/arm/mach-davinci/include/mach/psc.h
+++ b/arch/arm/mach-davinci/include/mach/psc.h
@@ -243,7 +243,7 @@
243#define PSC_STATE_DISABLE 2 243#define PSC_STATE_DISABLE 2
244#define PSC_STATE_ENABLE 3 244#define PSC_STATE_ENABLE 3
245 245
246#define MDSTAT_STATE_MASK 0x1f 246#define MDSTAT_STATE_MASK 0x3f
247#define MDCTL_FORCE BIT(31) 247#define MDCTL_FORCE BIT(31)
248 248
249#ifndef __ASSEMBLER__ 249#ifndef __ASSEMBLER__
diff --git a/arch/arm/mach-davinci/sleep.S b/arch/arm/mach-davinci/sleep.S
index fb5e72b532b0..5f1e045a3ad1 100644
--- a/arch/arm/mach-davinci/sleep.S
+++ b/arch/arm/mach-davinci/sleep.S
@@ -217,7 +217,11 @@ ddr2clk_stop_done:
217ENDPROC(davinci_ddr_psc_config) 217ENDPROC(davinci_ddr_psc_config)
218 218
219CACHE_FLUSH: 219CACHE_FLUSH:
220 .word arm926_flush_kern_cache_all 220#ifdef CONFIG_CPU_V6
221 .word v6_flush_kern_cache_all
222#else
223 .word arm926_flush_kern_cache_all
224#endif
221 225
222ENTRY(davinci_cpu_suspend_sz) 226ENTRY(davinci_cpu_suspend_sz)
223 .word . - davinci_cpu_suspend 227 .word . - davinci_cpu_suspend
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 83dce859886d..a9e0dae86a26 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -158,7 +158,7 @@ void __init dove_spi0_init(void)
158 158
159void __init dove_spi1_init(void) 159void __init dove_spi1_init(void)
160{ 160{
161 orion_spi_init(DOVE_SPI1_PHYS_BASE, get_tclk()); 161 orion_spi_1_init(DOVE_SPI1_PHYS_BASE, get_tclk());
162} 162}
163 163
164/***************************************************************************** 164/*****************************************************************************
diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
index 0eabec62cd9d..f1397a13e76b 100644
--- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h
+++ b/arch/arm/mach-ep93xx/include/mach/ts72xx.h
@@ -6,7 +6,7 @@
6 * TS72xx memory map: 6 * TS72xx memory map:
7 * 7 *
8 * virt phys size 8 * virt phys size
9 * febff000 22000000 4K model number register 9 * febff000 22000000 4K model number register (bits 0-2)
10 * febfe000 22400000 4K options register 10 * febfe000 22400000 4K options register
11 * febfd000 22800000 4K options register #2 11 * febfd000 22800000 4K options register #2
12 * febf9000 10800000 4K TS-5620 RTC index register 12 * febf9000 10800000 4K TS-5620 RTC index register
@@ -20,6 +20,9 @@
20#define TS72XX_MODEL_TS7200 0x00 20#define TS72XX_MODEL_TS7200 0x00
21#define TS72XX_MODEL_TS7250 0x01 21#define TS72XX_MODEL_TS7250 0x01
22#define TS72XX_MODEL_TS7260 0x02 22#define TS72XX_MODEL_TS7260 0x02
23#define TS72XX_MODEL_TS7300 0x03
24#define TS72XX_MODEL_TS7400 0x04
25#define TS72XX_MODEL_MASK 0x07
23 26
24 27
25#define TS72XX_OPTIONS_PHYS_BASE 0x22400000 28#define TS72XX_OPTIONS_PHYS_BASE 0x22400000
@@ -51,19 +54,34 @@
51 54
52#ifndef __ASSEMBLY__ 55#ifndef __ASSEMBLY__
53 56
57static inline int ts72xx_model(void)
58{
59 return __raw_readb(TS72XX_MODEL_VIRT_BASE) & TS72XX_MODEL_MASK;
60}
61
54static inline int board_is_ts7200(void) 62static inline int board_is_ts7200(void)
55{ 63{
56 return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7200; 64 return ts72xx_model() == TS72XX_MODEL_TS7200;
57} 65}
58 66
59static inline int board_is_ts7250(void) 67static inline int board_is_ts7250(void)
60{ 68{
61 return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7250; 69 return ts72xx_model() == TS72XX_MODEL_TS7250;
62} 70}
63 71
64static inline int board_is_ts7260(void) 72static inline int board_is_ts7260(void)
65{ 73{
66 return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7260; 74 return ts72xx_model() == TS72XX_MODEL_TS7260;
75}
76
77static inline int board_is_ts7300(void)
78{
79 return ts72xx_model() == TS72XX_MODEL_TS7300;
80}
81
82static inline int board_is_ts7400(void)
83{
84 return ts72xx_model() == TS72XX_MODEL_TS7400;
67} 85}
68 86
69static inline int is_max197_installed(void) 87static inline int is_max197_installed(void)
diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
index 851dea018578..79d6cd0c8e7b 100644
--- a/arch/arm/mach-exynos4/clock.c
+++ b/arch/arm/mach-exynos4/clock.c
@@ -520,7 +520,7 @@ static struct clk init_clocks_off[] = {
520 .ctrlbit = (1 << 21), 520 .ctrlbit = (1 << 21),
521 }, { 521 }, {
522 .name = "ac97", 522 .name = "ac97",
523 .id = -1, 523 .devname = "samsung-ac97",
524 .enable = exynos4_clk_ip_peril_ctrl, 524 .enable = exynos4_clk_ip_peril_ctrl,
525 .ctrlbit = (1 << 27), 525 .ctrlbit = (1 << 27),
526 }, { 526 }, {
@@ -1160,7 +1160,7 @@ void __init_or_cpufreq exynos4_setup_clocks(void)
1160 1160
1161 vpllsrc = clk_get_rate(&clk_vpllsrc.clk); 1161 vpllsrc = clk_get_rate(&clk_vpllsrc.clk);
1162 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), 1162 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0),
1163 __raw_readl(S5P_VPLL_CON1), pll_4650); 1163 __raw_readl(S5P_VPLL_CON1), pll_4650c);
1164 1164
1165 clk_fout_apll.ops = &exynos4_fout_apll_ops; 1165 clk_fout_apll.ops = &exynos4_fout_apll_ops;
1166 clk_fout_mpll.rate = mpll; 1166 clk_fout_mpll.rate = mpll;
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c
index 2d8a40c9e6e5..746d6fc6d397 100644
--- a/arch/arm/mach-exynos4/cpu.c
+++ b/arch/arm/mach-exynos4/cpu.c
@@ -24,12 +24,13 @@
24#include <plat/exynos4.h> 24#include <plat/exynos4.h>
25#include <plat/adc-core.h> 25#include <plat/adc-core.h>
26#include <plat/sdhci.h> 26#include <plat/sdhci.h>
27#include <plat/devs.h>
28#include <plat/fb-core.h> 27#include <plat/fb-core.h>
29#include <plat/fimc-core.h> 28#include <plat/fimc-core.h>
30#include <plat/iic-core.h> 29#include <plat/iic-core.h>
30#include <plat/reset.h>
31 31
32#include <mach/regs-irq.h> 32#include <mach/regs-irq.h>
33#include <mach/regs-pmu.h>
33 34
34extern int combiner_init(unsigned int combiner_nr, void __iomem *base, 35extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
35 unsigned int irq_start); 36 unsigned int irq_start);
@@ -128,6 +129,11 @@ static void exynos4_idle(void)
128 local_irq_enable(); 129 local_irq_enable();
129} 130}
130 131
132static void exynos4_sw_reset(void)
133{
134 __raw_writel(0x1, S5P_SWRESET);
135}
136
131/* 137/*
132 * exynos4_map_io 138 * exynos4_map_io
133 * 139 *
@@ -241,5 +247,8 @@ int __init exynos4_init(void)
241 /* set idle function */ 247 /* set idle function */
242 pm_idle = exynos4_idle; 248 pm_idle = exynos4_idle;
243 249
250 /* set sw_reset function */
251 s5p_reset_hook = exynos4_sw_reset;
252
244 return sysdev_register(&exynos4_sysdev); 253 return sysdev_register(&exynos4_sysdev);
245} 254}
diff --git a/arch/arm/mach-exynos4/include/mach/irqs.h b/arch/arm/mach-exynos4/include/mach/irqs.h
index 934d2a493982..f8952f8f3757 100644
--- a/arch/arm/mach-exynos4/include/mach/irqs.h
+++ b/arch/arm/mach-exynos4/include/mach/irqs.h
@@ -80,9 +80,8 @@
80#define IRQ_HSMMC3 IRQ_SPI(76) 80#define IRQ_HSMMC3 IRQ_SPI(76)
81#define IRQ_DWMCI IRQ_SPI(77) 81#define IRQ_DWMCI IRQ_SPI(77)
82 82
83#define IRQ_MIPICSI0 IRQ_SPI(78) 83#define IRQ_MIPI_CSIS0 IRQ_SPI(78)
84 84#define IRQ_MIPI_CSIS1 IRQ_SPI(80)
85#define IRQ_MIPICSI1 IRQ_SPI(80)
86 85
87#define IRQ_ONENAND_AUDI IRQ_SPI(82) 86#define IRQ_ONENAND_AUDI IRQ_SPI(82)
88#define IRQ_ROTATOR IRQ_SPI(83) 87#define IRQ_ROTATOR IRQ_SPI(83)
diff --git a/arch/arm/mach-exynos4/include/mach/regs-pmu.h b/arch/arm/mach-exynos4/include/mach/regs-pmu.h
index fa49bbb8e7b0..cdf9b47c303c 100644
--- a/arch/arm/mach-exynos4/include/mach/regs-pmu.h
+++ b/arch/arm/mach-exynos4/include/mach/regs-pmu.h
@@ -29,6 +29,8 @@
29#define S5P_USE_STANDBY_WFE1 (1 << 25) 29#define S5P_USE_STANDBY_WFE1 (1 << 25)
30#define S5P_USE_MASK ((0x3 << 16) | (0x3 << 24)) 30#define S5P_USE_MASK ((0x3 << 16) | (0x3 << 24))
31 31
32#define S5P_SWRESET S5P_PMUREG(0x0400)
33
32#define S5P_WAKEUP_STAT S5P_PMUREG(0x0600) 34#define S5P_WAKEUP_STAT S5P_PMUREG(0x0600)
33#define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604) 35#define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604)
34#define S5P_WAKEUP_MASK S5P_PMUREG(0x0608) 36#define S5P_WAKEUP_MASK S5P_PMUREG(0x0608)
diff --git a/arch/arm/mach-exynos4/irq-eint.c b/arch/arm/mach-exynos4/irq-eint.c
index 9d87d2ac7f68..badb8c66fc9b 100644
--- a/arch/arm/mach-exynos4/irq-eint.c
+++ b/arch/arm/mach-exynos4/irq-eint.c
@@ -23,6 +23,8 @@
23 23
24#include <mach/regs-gpio.h> 24#include <mach/regs-gpio.h>
25 25
26#include <asm/mach/irq.h>
27
26static DEFINE_SPINLOCK(eint_lock); 28static DEFINE_SPINLOCK(eint_lock);
27 29
28static unsigned int eint0_15_data[16]; 30static unsigned int eint0_15_data[16];
@@ -184,8 +186,11 @@ static inline void exynos4_irq_demux_eint(unsigned int start)
184 186
185static void exynos4_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc) 187static void exynos4_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
186{ 188{
189 struct irq_chip *chip = irq_get_chip(irq);
190 chained_irq_enter(chip, desc);
187 exynos4_irq_demux_eint(IRQ_EINT(16)); 191 exynos4_irq_demux_eint(IRQ_EINT(16));
188 exynos4_irq_demux_eint(IRQ_EINT(24)); 192 exynos4_irq_demux_eint(IRQ_EINT(24));
193 chained_irq_exit(chip, desc);
189} 194}
190 195
191static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc) 196static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
@@ -193,6 +198,7 @@ static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
193 u32 *irq_data = irq_get_handler_data(irq); 198 u32 *irq_data = irq_get_handler_data(irq);
194 struct irq_chip *chip = irq_get_chip(irq); 199 struct irq_chip *chip = irq_get_chip(irq);
195 200
201 chained_irq_enter(chip, desc);
196 chip->irq_mask(&desc->irq_data); 202 chip->irq_mask(&desc->irq_data);
197 203
198 if (chip->irq_ack) 204 if (chip->irq_ack)
@@ -201,6 +207,7 @@ static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
201 generic_handle_irq(*irq_data); 207 generic_handle_irq(*irq_data);
202 208
203 chip->irq_unmask(&desc->irq_data); 209 chip->irq_unmask(&desc->irq_data);
210 chained_irq_exit(chip, desc);
204} 211}
205 212
206int __init exynos4_init_irq_eint(void) 213int __init exynos4_init_irq_eint(void)
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c
index 0e280d12301e..b3b5d8911004 100644
--- a/arch/arm/mach-exynos4/mach-universal_c210.c
+++ b/arch/arm/mach-exynos4/mach-universal_c210.c
@@ -79,7 +79,7 @@ static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = {
79}; 79};
80 80
81static struct regulator_consumer_supply max8952_consumer = 81static struct regulator_consumer_supply max8952_consumer =
82 REGULATOR_SUPPLY("vddarm", NULL); 82 REGULATOR_SUPPLY("vdd_arm", NULL);
83 83
84static struct max8952_platform_data universal_max8952_pdata __initdata = { 84static struct max8952_platform_data universal_max8952_pdata __initdata = {
85 .gpio_vid0 = EXYNOS4_GPX0(3), 85 .gpio_vid0 = EXYNOS4_GPX0(3),
@@ -105,7 +105,7 @@ static struct max8952_platform_data universal_max8952_pdata __initdata = {
105}; 105};
106 106
107static struct regulator_consumer_supply lp3974_buck1_consumer = 107static struct regulator_consumer_supply lp3974_buck1_consumer =
108 REGULATOR_SUPPLY("vddint", NULL); 108 REGULATOR_SUPPLY("vdd_int", NULL);
109 109
110static struct regulator_consumer_supply lp3974_buck2_consumer = 110static struct regulator_consumer_supply lp3974_buck2_consumer =
111 REGULATOR_SUPPLY("vddg3d", NULL); 111 REGULATOR_SUPPLY("vddg3d", NULL);
diff --git a/arch/arm/mach-exynos4/mct.c b/arch/arm/mach-exynos4/mct.c
index 1ae059b7ad7b..ddd86864fb83 100644
--- a/arch/arm/mach-exynos4/mct.c
+++ b/arch/arm/mach-exynos4/mct.c
@@ -132,12 +132,18 @@ static cycle_t exynos4_frc_read(struct clocksource *cs)
132 return ((cycle_t)hi << 32) | lo; 132 return ((cycle_t)hi << 32) | lo;
133} 133}
134 134
135static void exynos4_frc_resume(struct clocksource *cs)
136{
137 exynos4_mct_frc_start(0, 0);
138}
139
135struct clocksource mct_frc = { 140struct clocksource mct_frc = {
136 .name = "mct-frc", 141 .name = "mct-frc",
137 .rating = 400, 142 .rating = 400,
138 .read = exynos4_frc_read, 143 .read = exynos4_frc_read,
139 .mask = CLOCKSOURCE_MASK(64), 144 .mask = CLOCKSOURCE_MASK(64),
140 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 145 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
146 .resume = exynos4_frc_resume,
141}; 147};
142 148
143static void __init exynos4_clocksource_init(void) 149static void __init exynos4_clocksource_init(void)
@@ -389,9 +395,11 @@ static void exynos4_mct_tick_init(struct clock_event_device *evt)
389} 395}
390 396
391/* Setup the local clock events for a CPU */ 397/* Setup the local clock events for a CPU */
392void __cpuinit local_timer_setup(struct clock_event_device *evt) 398int __cpuinit local_timer_setup(struct clock_event_device *evt)
393{ 399{
394 exynos4_mct_tick_init(evt); 400 exynos4_mct_tick_init(evt);
401
402 return 0;
395} 403}
396 404
397int local_timer_ack(void) 405int local_timer_ack(void)
diff --git a/arch/arm/mach-exynos4/platsmp.c b/arch/arm/mach-exynos4/platsmp.c
index 7c2282c6ba81..df6ef1b2f98b 100644
--- a/arch/arm/mach-exynos4/platsmp.c
+++ b/arch/arm/mach-exynos4/platsmp.c
@@ -106,6 +106,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
106 */ 106 */
107 spin_lock(&boot_lock); 107 spin_lock(&boot_lock);
108 spin_unlock(&boot_lock); 108 spin_unlock(&boot_lock);
109
110 set_cpu_online(cpu, true);
109} 111}
110 112
111int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) 113int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
diff --git a/arch/arm/mach-exynos4/setup-keypad.c b/arch/arm/mach-exynos4/setup-keypad.c
index 1ee0ebff111f..7862bfb5933d 100644
--- a/arch/arm/mach-exynos4/setup-keypad.c
+++ b/arch/arm/mach-exynos4/setup-keypad.c
@@ -19,15 +19,16 @@ void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)
19 19
20 if (rows > 8) { 20 if (rows > 8) {
21 /* Set all the necessary GPX2 pins: KP_ROW[0~7] */ 21 /* Set all the necessary GPX2 pins: KP_ROW[0~7] */
22 s3c_gpio_cfgrange_nopull(EXYNOS4_GPX2(0), 8, S3C_GPIO_SFN(3)); 22 s3c_gpio_cfgall_range(EXYNOS4_GPX2(0), 8, S3C_GPIO_SFN(3),
23 S3C_GPIO_PULL_UP);
23 24
24 /* Set all the necessary GPX3 pins: KP_ROW[8~] */ 25 /* Set all the necessary GPX3 pins: KP_ROW[8~] */
25 s3c_gpio_cfgrange_nopull(EXYNOS4_GPX3(0), (rows - 8), 26 s3c_gpio_cfgall_range(EXYNOS4_GPX3(0), (rows - 8),
26 S3C_GPIO_SFN(3)); 27 S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);
27 } else { 28 } else {
28 /* Set all the necessary GPX2 pins: KP_ROW[x] */ 29 /* Set all the necessary GPX2 pins: KP_ROW[x] */
29 s3c_gpio_cfgrange_nopull(EXYNOS4_GPX2(0), rows, 30 s3c_gpio_cfgall_range(EXYNOS4_GPX2(0), rows, S3C_GPIO_SFN(3),
30 S3C_GPIO_SFN(3)); 31 S3C_GPIO_PULL_UP);
31 } 32 }
32 33
33 /* Set all the necessary GPX1 pins to special-function 3: KP_COL[x] */ 34 /* Set all the necessary GPX1 pins to special-function 3: KP_COL[x] */
diff --git a/arch/arm/mach-exynos4/setup-usb-phy.c b/arch/arm/mach-exynos4/setup-usb-phy.c
index 0883c1b824b9..39aca045f660 100644
--- a/arch/arm/mach-exynos4/setup-usb-phy.c
+++ b/arch/arm/mach-exynos4/setup-usb-phy.c
@@ -82,7 +82,7 @@ static int exynos4_usb_phy1_init(struct platform_device *pdev)
82 82
83 rstcon &= ~(HOST_LINK_PORT_SWRST_MASK | PHY1_SWRST_MASK); 83 rstcon &= ~(HOST_LINK_PORT_SWRST_MASK | PHY1_SWRST_MASK);
84 writel(rstcon, EXYNOS4_RSTCON); 84 writel(rstcon, EXYNOS4_RSTCON);
85 udelay(50); 85 udelay(80);
86 86
87 clk_disable(otg_clk); 87 clk_disable(otg_clk);
88 clk_put(otg_clk); 88 clk_put(otg_clk);
diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig
index dc26fff22cf0..c8e7afcf14ec 100644
--- a/arch/arm/mach-footbridge/Kconfig
+++ b/arch/arm/mach-footbridge/Kconfig
@@ -62,6 +62,7 @@ config ARCH_EBSA285_HOST
62config ARCH_NETWINDER 62config ARCH_NETWINDER
63 bool "NetWinder" 63 bool "NetWinder"
64 select CLKSRC_I8253 64 select CLKSRC_I8253
65 select CLKEVT_I8253
65 select FOOTBRIDGE_HOST 66 select FOOTBRIDGE_HOST
66 select ISA 67 select ISA
67 select ISA_DMA 68 select ISA_DMA
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
index 1331fff51ae2..18c32a5541d9 100644
--- a/arch/arm/mach-footbridge/dc21285.c
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -18,6 +18,7 @@
18#include <linux/irq.h> 18#include <linux/irq.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <video/vga.h>
21 22
22#include <asm/irq.h> 23#include <asm/irq.h>
23#include <asm/system.h> 24#include <asm/system.h>
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c
index 87887ac5806b..f851fe903687 100644
--- a/arch/arm/mach-imx/mach-cpuimx27.c
+++ b/arch/arm/mach-imx/mach-cpuimx27.c
@@ -310,7 +310,7 @@ static struct sys_timer eukrea_cpuimx27_timer = {
310 .init = eukrea_cpuimx27_timer_init, 310 .init = eukrea_cpuimx27_timer_init,
311}; 311};
312 312
313MACHINE_START(CPUIMX27, "EUKREA CPUIMX27") 313MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27")
314 .boot_params = MX27_PHYS_OFFSET + 0x100, 314 .boot_params = MX27_PHYS_OFFSET + 0x100,
315 .map_io = mx27_map_io, 315 .map_io = mx27_map_io,
316 .init_early = imx27_init_early, 316 .init_early = imx27_init_early,
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index f39a478ba1a6..4bd083ba9af2 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -192,7 +192,7 @@ struct sys_timer eukrea_cpuimx35_timer = {
192 .init = eukrea_cpuimx35_timer_init, 192 .init = eukrea_cpuimx35_timer_init,
193}; 193};
194 194
195MACHINE_START(EUKREA_CPUIMX35, "Eukrea CPUIMX35") 195MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35")
196 /* Maintainer: Eukrea Electromatique */ 196 /* Maintainer: Eukrea Electromatique */
197 .boot_params = MX3x_PHYS_OFFSET + 0x100, 197 .boot_params = MX3x_PHYS_OFFSET + 0x100,
198 .map_io = mx35_map_io, 198 .map_io = mx35_map_io,
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index da36da52969d..2442d5da883d 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -161,7 +161,7 @@ static struct sys_timer eukrea_cpuimx25_timer = {
161 .init = eukrea_cpuimx25_timer_init, 161 .init = eukrea_cpuimx25_timer_init,
162}; 162};
163 163
164MACHINE_START(EUKREA_CPUIMX25, "Eukrea CPUIMX25") 164MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25")
165 /* Maintainer: Eukrea Electromatique */ 165 /* Maintainer: Eukrea Electromatique */
166 .boot_params = MX25_PHYS_OFFSET + 0x100, 166 .boot_params = MX25_PHYS_OFFSET + 0x100,
167 .map_io = mx25_map_io, 167 .map_io = mx25_map_io,
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 2fbbdd5eac35..8cdc730dcb3a 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -32,6 +32,7 @@
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/io.h> 33#include <linux/io.h>
34#include <linux/mtd/physmap.h> 34#include <linux/mtd/physmap.h>
35#include <video/vga.h>
35 36
36#include <mach/hardware.h> 37#include <mach/hardware.h>
37#include <mach/platform.h> 38#include <mach/platform.h>
@@ -154,6 +155,7 @@ static struct map_desc ap_io_desc[] __initdata = {
154static void __init ap_map_io(void) 155static void __init ap_map_io(void)
155{ 156{
156 iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); 157 iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc));
158 vga_base = PCI_MEMORY_VADDR;
157} 159}
158 160
159#define INTEGRATOR_SC_VALID_INT 0x003fffff 161#define INTEGRATOR_SC_VALID_INT 0x003fffff
@@ -337,15 +339,15 @@ static unsigned long timer_reload;
337static void integrator_clocksource_init(u32 khz) 339static void integrator_clocksource_init(u32 khz)
338{ 340{
339 void __iomem *base = (void __iomem *)TIMER2_VA_BASE; 341 void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
340 u32 ctrl = TIMER_CTRL_ENABLE; 342 u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC;
341 343
342 if (khz >= 1500) { 344 if (khz >= 1500) {
343 khz /= 16; 345 khz /= 16;
344 ctrl = TIMER_CTRL_DIV16; 346 ctrl |= TIMER_CTRL_DIV16;
345 } 347 }
346 348
347 writel(ctrl, base + TIMER_CTRL);
348 writel(0xffff, base + TIMER_LOAD); 349 writel(0xffff, base + TIMER_LOAD);
350 writel(ctrl, base + TIMER_CTRL);
349 351
350 clocksource_mmio_init(base + TIMER_VALUE, "timer2", 352 clocksource_mmio_init(base + TIMER_VALUE, "timer2",
351 khz * 1000, 200, 16, clocksource_mmio_readl_down); 353 khz * 1000, 200, 16, clocksource_mmio_readl_down);
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c
index dd56bfb351e3..11b86e5b71c2 100644
--- a/arch/arm/mach-integrator/pci_v3.c
+++ b/arch/arm/mach-integrator/pci_v3.c
@@ -27,7 +27,6 @@
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/io.h> 29#include <linux/io.h>
30#include <video/vga.h>
31 30
32#include <mach/hardware.h> 31#include <mach/hardware.h>
33#include <mach/platform.h> 32#include <mach/platform.h>
@@ -505,7 +504,6 @@ void __init pci_v3_preinit(void)
505 504
506 pcibios_min_io = 0x6000; 505 pcibios_min_io = 0x6000;
507 pcibios_min_mem = 0x00100000; 506 pcibios_min_mem = 0x00100000;
508 vga_base = PCI_MEMORY_VADDR;
509 507
510 /* 508 /*
511 * Hook in our fault handler for PCI errors 509 * Hook in our fault handler for PCI errors
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 5b114d1558c8..11c85cd2731a 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -4,7 +4,7 @@
4 4
5# Common support 5# Common support
6obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o 6obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o
7obj-y += clock.o clock_data.o opp_data.o reset.o pm_bus.o 7obj-y += clock.o clock_data.o opp_data.o reset.o pm_bus.o timer.o
8 8
9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
10 10
diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
new file mode 100644
index 000000000000..6e90665a7c47
--- /dev/null
+++ b/arch/arm/mach-omap1/timer.c
@@ -0,0 +1,173 @@
1/**
2 * OMAP1 Dual-Mode Timers - platform device registration
3 *
4 * Contains first level initialization routines which internally
5 * generates timer device information and registers with linux
6 * device model. It also has low level function to chnage the timer
7 * input clock source.
8 *
9 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
10 * Tarun Kanti DebBarma <tarun.kanti@ti.com>
11 * Thara Gopinath <thara@ti.com>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 *
17 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
18 * kind, whether express or implied; without even the implied warranty
19 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 */
22
23#include <linux/clk.h>
24#include <linux/io.h>
25#include <linux/err.h>
26#include <linux/slab.h>
27#include <linux/platform_device.h>
28
29#include <mach/irqs.h>
30
31#include <plat/dmtimer.h>
32
33#define OMAP1610_GPTIMER1_BASE 0xfffb1400
34#define OMAP1610_GPTIMER2_BASE 0xfffb1c00
35#define OMAP1610_GPTIMER3_BASE 0xfffb2400
36#define OMAP1610_GPTIMER4_BASE 0xfffb2c00
37#define OMAP1610_GPTIMER5_BASE 0xfffb3400
38#define OMAP1610_GPTIMER6_BASE 0xfffb3c00
39#define OMAP1610_GPTIMER7_BASE 0xfffb7400
40#define OMAP1610_GPTIMER8_BASE 0xfffbd400
41
42#define OMAP1_DM_TIMER_COUNT 8
43
44static int omap1_dm_timer_set_src(struct platform_device *pdev,
45 int source)
46{
47 int n = (pdev->id - 1) << 1;
48 u32 l;
49
50 l = __raw_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
51 l |= source << n;
52 __raw_writel(l, MOD_CONF_CTRL_1);
53
54 return 0;
55}
56
57
58int __init omap1_dm_timer_init(void)
59{
60 int i;
61 int ret;
62 struct dmtimer_platform_data *pdata;
63 struct platform_device *pdev;
64
65 if (!cpu_is_omap16xx())
66 return 0;
67
68 for (i = 1; i <= OMAP1_DM_TIMER_COUNT; i++) {
69 struct resource res[2];
70 u32 base, irq;
71
72 switch (i) {
73 case 1:
74 base = OMAP1610_GPTIMER1_BASE;
75 irq = INT_1610_GPTIMER1;
76 break;
77 case 2:
78 base = OMAP1610_GPTIMER2_BASE;
79 irq = INT_1610_GPTIMER2;
80 break;
81 case 3:
82 base = OMAP1610_GPTIMER3_BASE;
83 irq = INT_1610_GPTIMER3;
84 break;
85 case 4:
86 base = OMAP1610_GPTIMER4_BASE;
87 irq = INT_1610_GPTIMER4;
88 break;
89 case 5:
90 base = OMAP1610_GPTIMER5_BASE;
91 irq = INT_1610_GPTIMER5;
92 break;
93 case 6:
94 base = OMAP1610_GPTIMER6_BASE;
95 irq = INT_1610_GPTIMER6;
96 break;
97 case 7:
98 base = OMAP1610_GPTIMER7_BASE;
99 irq = INT_1610_GPTIMER7;
100 break;
101 case 8:
102 base = OMAP1610_GPTIMER8_BASE;
103 irq = INT_1610_GPTIMER8;
104 break;
105 default:
106 /*
107 * not supposed to reach here.
108 * this is to remove warning.
109 */
110 return -EINVAL;
111 }
112
113 pdev = platform_device_alloc("omap_timer", i);
114 if (!pdev) {
115 pr_err("%s: Failed to device alloc for dmtimer%d\n",
116 __func__, i);
117 return -ENOMEM;
118 }
119
120 memset(res, 0, 2 * sizeof(struct resource));
121 res[0].start = base;
122 res[0].end = base + 0x46;
123 res[0].flags = IORESOURCE_MEM;
124 res[1].start = irq;
125 res[1].end = irq;
126 res[1].flags = IORESOURCE_IRQ;
127 ret = platform_device_add_resources(pdev, res,
128 ARRAY_SIZE(res));
129 if (ret) {
130 dev_err(&pdev->dev, "%s: Failed to add resources.\n",
131 __func__);
132 goto err_free_pdev;
133 }
134
135 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
136 if (!pdata) {
137 dev_err(&pdev->dev, "%s: Failed to allocate pdata.\n",
138 __func__);
139 ret = -ENOMEM;
140 goto err_free_pdata;
141 }
142
143 pdata->set_timer_src = omap1_dm_timer_set_src;
144 pdata->needs_manual_reset = 1;
145
146 ret = platform_device_add_data(pdev, pdata, sizeof(*pdata));
147 if (ret) {
148 dev_err(&pdev->dev, "%s: Failed to add platform data.\n",
149 __func__);
150 goto err_free_pdata;
151 }
152
153 ret = platform_device_add(pdev);
154 if (ret) {
155 dev_err(&pdev->dev, "%s: Failed to add platform device.\n",
156 __func__);
157 goto err_free_pdata;
158 }
159
160 dev_dbg(&pdev->dev, " Registered.\n");
161 }
162
163 return 0;
164
165err_free_pdata:
166 kfree(pdata);
167
168err_free_pdev:
169 platform_device_unregister(pdev);
170
171 return ret;
172}
173arch_initcall(omap1_dm_timer_init);
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f34336560437..cd45c045ab8c 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -116,9 +116,12 @@ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \
116obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \ 116obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \
117 clockdomain2xxx_3xxx.o \ 117 clockdomain2xxx_3xxx.o \
118 clockdomains2xxx_3xxx_data.o 118 clockdomains2xxx_3xxx_data.o
119obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o
120obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o
119obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ 121obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \
120 clockdomain2xxx_3xxx.o \ 122 clockdomain2xxx_3xxx.o \
121 clockdomains2xxx_3xxx_data.o 123 clockdomains2xxx_3xxx_data.o \
124 clockdomains3xxx_data.o
122obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ 125obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \
123 clockdomain44xx.o \ 126 clockdomain44xx.o \
124 clockdomains44xx_data.o 127 clockdomains44xx_data.o
@@ -185,78 +188,66 @@ endif
185# Specific board support 188# Specific board support
186obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o 189obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
187obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o 190obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
188obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o \ 191obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
189 hsmmc.o
190obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o 192obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
191obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \ 193obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o
192 hsmmc.o 194obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o
193obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o \ 195obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o
194 hsmmc.o 196obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o
195obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \ 197obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o
196 board-flash.o \ 198obj-$(CONFIG_MACH_ENCORE) += board-omap3encore.o
197 hsmmc.o 199obj-$(CONFIG_MACH_OVERO) += board-overo.o
198obj-$(CONFIG_MACH_OMAP3530_LV_SOM) += board-omap3logic.o \ 200obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o
199 hsmmc.o 201obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o
200obj-$(CONFIG_MACH_OMAP3_TORPEDO) += board-omap3logic.o \ 202obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o
201 hsmmc.o
202obj-$(CONFIG_MACH_OVERO) += board-overo.o \
203 hsmmc.o
204obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \
205 hsmmc.o
206obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \
207 hsmmc.o
208obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
209 hsmmc.o \
210 board-flash.o
211obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o 203obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
212obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \ 204obj-$(CONFIG_MACH_NOKIA_RM680) += board-rm680.o \
213 sdram-nokia.o \ 205 sdram-nokia.o
214 hsmmc.o
215obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ 206obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
216 sdram-nokia.o \ 207 sdram-nokia.o \
217 board-rx51-peripherals.o \ 208 board-rx51-peripherals.o \
218 board-rx51-video.o \ 209 board-rx51-video.o
219 hsmmc.o
220obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom.o \ 210obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom.o \
221 board-zoom-peripherals.o \ 211 board-zoom-peripherals.o \
222 board-zoom-display.o \ 212 board-zoom-display.o \
223 board-flash.o \
224 hsmmc.o \
225 board-zoom-debugboard.o 213 board-zoom-debugboard.o
226obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom.o \ 214obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom.o \
227 board-zoom-peripherals.o \ 215 board-zoom-peripherals.o \
228 board-zoom-display.o \ 216 board-zoom-display.o \
229 board-flash.o \
230 hsmmc.o \
231 board-zoom-debugboard.o 217 board-zoom-debugboard.o
232obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o \ 218obj-$(CONFIG_MACH_OMAP_3630SDP) += board-3630sdp.o \
233 board-zoom-peripherals.o \ 219 board-zoom-peripherals.o \
234 board-zoom-display.o \ 220 board-zoom-display.o
235 board-flash.o \ 221obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o
236 hsmmc.o
237obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \
238 hsmmc.o
239obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o 222obj-$(CONFIG_MACH_CM_T3517) += board-cm-t3517.o
240obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o \ 223obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o
241 hsmmc.o 224obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o
242obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \
243 hsmmc.o
244obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \ 225obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o \
245 hsmmc.o \
246 omap_phy_internal.o 226 omap_phy_internal.o
247obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \ 227obj-$(CONFIG_MACH_OMAP4_PANDA) += board-omap4panda.o \
248 hsmmc.o \ 228 omap_phy_internal.o
229
230obj-$(CONFIG_MACH_PCM049) += board-omap4pcm049.o \
249 omap_phy_internal.o 231 omap_phy_internal.o
250 232
251obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \ 233obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \
252 omap_phy_internal.o \ 234 omap_phy_internal.o
253 235
254obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o 236obj-$(CONFIG_MACH_CRANEBOARD) += board-am3517crane.o
255 237
256obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o \ 238obj-$(CONFIG_MACH_SBC3530) += board-omap3stalker.o
257 hsmmc.o
258obj-$(CONFIG_MACH_TI8168EVM) += board-ti8168evm.o 239obj-$(CONFIG_MACH_TI8168EVM) += board-ti8168evm.o
240
259# Platform specific device init code 241# Platform specific device init code
242
243omap-flash-$(CONFIG_MTD_NAND_OMAP2) := board-flash.o
244omap-flash-$(CONFIG_MTD_ONENAND_OMAP2) := board-flash.o
245obj-y += $(omap-flash-y) $(omap-flash-m)
246
247omap-hsmmc-$(CONFIG_MMC_OMAP_HS) := hsmmc.o
248obj-y += $(omap-hsmmc-m) $(omap-hsmmc-y)
249
250
260usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o 251usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o
261obj-y += $(usbfs-m) $(usbfs-y) 252obj-y += $(usbfs-m) $(usbfs-y)
262obj-y += usb-musb.o 253obj-y += usb-musb.o
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 2028464cf5b9..618216c8f742 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -141,12 +141,6 @@ static struct omap_board_config_kernel sdp2430_config[] __initdata = {
141 {OMAP_TAG_LCD, &sdp2430_lcd_config}, 141 {OMAP_TAG_LCD, &sdp2430_lcd_config},
142}; 142};
143 143
144static void __init omap_2430sdp_init_early(void)
145{
146 omap2_init_common_infrastructure();
147 omap2_init_common_devices(NULL, NULL);
148}
149
150static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = { 144static struct regulator_consumer_supply sdp2430_vmmc1_supplies[] = {
151 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), 145 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
152}; 146};
@@ -235,6 +229,7 @@ static void __init omap_2430sdp_init(void)
235 229
236 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); 230 platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
237 omap_serial_init(); 231 omap_serial_init();
232 omap_sdrc_init(NULL, NULL);
238 omap2_hsmmc_init(mmc); 233 omap2_hsmmc_init(mmc);
239 omap2_usbfs_init(&sdp2430_usb_config); 234 omap2_usbfs_init(&sdp2430_usb_config);
240 235
@@ -259,7 +254,7 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
259 .boot_params = 0x80000100, 254 .boot_params = 0x80000100,
260 .reserve = omap_reserve, 255 .reserve = omap_reserve,
261 .map_io = omap_2430sdp_map_io, 256 .map_io = omap_2430sdp_map_io,
262 .init_early = omap_2430sdp_init_early, 257 .init_early = omap2430_init_early,
263 .init_irq = omap2_init_irq, 258 .init_irq = omap2_init_irq,
264 .init_machine = omap_2430sdp_init, 259 .init_machine = omap_2430sdp_init,
265 .timer = &omap2_timer, 260 .timer = &omap2_timer,
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index bd600cfb7f80..9bb48eaa4381 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -225,12 +225,6 @@ static struct omap_dss_board_info sdp3430_dss_data = {
225static struct omap_board_config_kernel sdp3430_config[] __initdata = { 225static struct omap_board_config_kernel sdp3430_config[] __initdata = {
226}; 226};
227 227
228static void __init omap_3430sdp_init_early(void)
229{
230 omap2_init_common_infrastructure();
231 omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);
232}
233
234static struct omap2_hsmmc_info mmc[] = { 228static struct omap2_hsmmc_info mmc[] = {
235 { 229 {
236 .mmc = 1, 230 .mmc = 1,
@@ -719,6 +713,7 @@ static void __init omap_3430sdp_init(void)
719 gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV1; 713 gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV1;
720 omap_ads7846_init(1, gpio_pendown, 310, NULL); 714 omap_ads7846_init(1, gpio_pendown, 310, NULL);
721 board_serial_init(); 715 board_serial_init();
716 omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL);
722 usb_musb_init(NULL); 717 usb_musb_init(NULL);
723 board_smc91x_init(); 718 board_smc91x_init();
724 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0); 719 board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
@@ -732,7 +727,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
732 .boot_params = 0x80000100, 727 .boot_params = 0x80000100,
733 .reserve = omap_reserve, 728 .reserve = omap_reserve,
734 .map_io = omap3_map_io, 729 .map_io = omap3_map_io,
735 .init_early = omap_3430sdp_init_early, 730 .init_early = omap3430_init_early,
736 .init_irq = omap3_init_irq, 731 .init_irq = omap3_init_irq,
737 .init_machine = omap_3430sdp_init, 732 .init_machine = omap_3430sdp_init,
738 .timer = &omap3_timer, 733 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index e4f37b57a0c4..94febc85d805 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -70,13 +70,6 @@ static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
70static struct omap_board_config_kernel sdp_config[] __initdata = { 70static struct omap_board_config_kernel sdp_config[] __initdata = {
71}; 71};
72 72
73static void __init omap_sdp_init_early(void)
74{
75 omap2_init_common_infrastructure();
76 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
77 h8mbx00u0mer0em_sdrc_params);
78}
79
80#ifdef CONFIG_OMAP_MUX 73#ifdef CONFIG_OMAP_MUX
81static struct omap_board_mux board_mux[] __initdata = { 74static struct omap_board_mux board_mux[] __initdata = {
82 { .reg_offset = OMAP_MUX_TERMINATOR }, 75 { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -207,6 +200,8 @@ static void __init omap_sdp_init(void)
207 omap_board_config = sdp_config; 200 omap_board_config = sdp_config;
208 omap_board_config_size = ARRAY_SIZE(sdp_config); 201 omap_board_config_size = ARRAY_SIZE(sdp_config);
209 zoom_peripherals_init(); 202 zoom_peripherals_init();
203 omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
204 h8mbx00u0mer0em_sdrc_params);
210 zoom_display_init(); 205 zoom_display_init();
211 board_smc91x_init(); 206 board_smc91x_init();
212 board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16); 207 board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
@@ -218,7 +213,7 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
218 .boot_params = 0x80000100, 213 .boot_params = 0x80000100,
219 .reserve = omap_reserve, 214 .reserve = omap_reserve,
220 .map_io = omap3_map_io, 215 .map_io = omap3_map_io,
221 .init_early = omap_sdp_init_early, 216 .init_early = omap3630_init_early,
222 .init_irq = omap3_init_irq, 217 .init_irq = omap3_init_irq,
223 .init_machine = omap_sdp_init, 218 .init_machine = omap_sdp_init,
224 .timer = &omap3_timer, 219 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index c7cef44c75d4..ab19d305f61e 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -389,12 +389,6 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = {
389 { OMAP_TAG_LCD, &sdp4430_lcd_config }, 389 { OMAP_TAG_LCD, &sdp4430_lcd_config },
390}; 390};
391 391
392static void __init omap_4430sdp_init_early(void)
393{
394 omap2_init_common_infrastructure();
395 omap2_init_common_devices(NULL, NULL);
396}
397
398static struct omap_musb_board_data musb_board_data = { 392static struct omap_musb_board_data musb_board_data = {
399 .interface_type = MUSB_INTERFACE_UTMI, 393 .interface_type = MUSB_INTERFACE_UTMI,
400 .mode = MUSB_OTG, 394 .mode = MUSB_OTG,
@@ -809,6 +803,7 @@ static void __init omap_4430sdp_init(void)
809 omap_sfh7741prox_init(); 803 omap_sfh7741prox_init();
810 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); 804 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
811 board_serial_init(); 805 board_serial_init();
806 omap_sdrc_init(NULL, NULL);
812 omap4_sdp4430_wifi_init(); 807 omap4_sdp4430_wifi_init();
813 omap4_twl6030_hsmmc_init(mmc); 808 omap4_twl6030_hsmmc_init(mmc);
814 809
@@ -841,7 +836,7 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
841 .boot_params = 0x80000100, 836 .boot_params = 0x80000100,
842 .reserve = omap_reserve, 837 .reserve = omap_reserve,
843 .map_io = omap_4430sdp_map_io, 838 .map_io = omap_4430sdp_map_io,
844 .init_early = omap_4430sdp_init_early, 839 .init_early = omap4430_init_early,
845 .init_irq = gic_init_irq, 840 .init_irq = gic_init_irq,
846 .init_machine = omap_4430sdp_init, 841 .init_machine = omap_4430sdp_init,
847 .timer = &omap4_timer, 842 .timer = &omap4_timer,
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 933e9353cb37..9e1b2c248328 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -47,12 +47,6 @@ static struct omap_board_mux board_mux[] __initdata = {
47}; 47};
48#endif 48#endif
49 49
50static void __init am3517_crane_init_early(void)
51{
52 omap2_init_common_infrastructure();
53 omap2_init_common_devices(NULL, NULL);
54}
55
56static struct usbhs_omap_board_data usbhs_bdata __initdata = { 50static struct usbhs_omap_board_data usbhs_bdata __initdata = {
57 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 51 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
58 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, 52 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -70,6 +64,7 @@ static void __init am3517_crane_init(void)
70 64
71 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 65 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
72 omap_serial_init(); 66 omap_serial_init();
67 omap_sdrc_init(NULL, NULL);
73 68
74 omap_board_config = am3517_crane_config; 69 omap_board_config = am3517_crane_config;
75 omap_board_config_size = ARRAY_SIZE(am3517_crane_config); 70 omap_board_config_size = ARRAY_SIZE(am3517_crane_config);
@@ -101,7 +96,7 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
101 .boot_params = 0x80000100, 96 .boot_params = 0x80000100,
102 .reserve = omap_reserve, 97 .reserve = omap_reserve,
103 .map_io = omap3_map_io, 98 .map_io = omap3_map_io,
104 .init_early = am3517_crane_init_early, 99 .init_early = am35xx_init_early,
105 .init_irq = omap3_init_irq, 100 .init_irq = omap3_init_irq,
106 .init_machine = am3517_crane_init, 101 .init_machine = am3517_crane_init,
107 .timer = &omap3_timer, 102 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index f3006c304150..7d842940c252 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -362,11 +362,6 @@ static struct omap_dss_board_info am3517_evm_dss_data = {
362/* 362/*
363 * Board initialization 363 * Board initialization
364 */ 364 */
365static void __init am3517_evm_init_early(void)
366{
367 omap2_init_common_infrastructure();
368 omap2_init_common_devices(NULL, NULL);
369}
370 365
371static struct omap_musb_board_data musb_board_data = { 366static struct omap_musb_board_data musb_board_data = {
372 .interface_type = MUSB_INTERFACE_ULPI, 367 .interface_type = MUSB_INTERFACE_ULPI,
@@ -469,6 +464,7 @@ static void __init am3517_evm_init(void)
469 am3517_evm_i2c_init(); 464 am3517_evm_i2c_init();
470 omap_display_init(&am3517_evm_dss_data); 465 omap_display_init(&am3517_evm_dss_data);
471 omap_serial_init(); 466 omap_serial_init();
467 omap_sdrc_init(NULL, NULL);
472 468
473 /* Configure GPIO for EHCI port */ 469 /* Configure GPIO for EHCI port */
474 omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); 470 omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
@@ -493,7 +489,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM")
493 .boot_params = 0x80000100, 489 .boot_params = 0x80000100,
494 .reserve = omap_reserve, 490 .reserve = omap_reserve,
495 .map_io = omap3_map_io, 491 .map_io = omap3_map_io,
496 .init_early = am3517_evm_init_early, 492 .init_early = am35xx_init_early,
497 .init_irq = omap3_init_irq, 493 .init_irq = omap3_init_irq,
498 .init_machine = am3517_evm_init, 494 .init_machine = am3517_evm_init,
499 .timer = &omap3_timer, 495 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index 70211703ff9f..cf546f86014e 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -273,12 +273,6 @@ static struct omap_board_config_kernel apollon_config[] __initdata = {
273 { OMAP_TAG_LCD, &apollon_lcd_config }, 273 { OMAP_TAG_LCD, &apollon_lcd_config },
274}; 274};
275 275
276static void __init omap_apollon_init_early(void)
277{
278 omap2_init_common_infrastructure();
279 omap2_init_common_devices(NULL, NULL);
280}
281
282static struct gpio apollon_gpio_leds[] __initdata = { 276static struct gpio apollon_gpio_leds[] __initdata = {
283 { LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */ 277 { LED0_GPIO13, GPIOF_OUT_INIT_LOW, "LED0" }, /* LED0 - AA10 */
284 { LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6 */ 278 { LED1_GPIO14, GPIOF_OUT_INIT_LOW, "LED1" }, /* LED1 - AA6 */
@@ -340,6 +334,7 @@ static void __init omap_apollon_init(void)
340 */ 334 */
341 platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices)); 335 platform_add_devices(apollon_devices, ARRAY_SIZE(apollon_devices));
342 omap_serial_init(); 336 omap_serial_init();
337 omap_sdrc_init(NULL, NULL);
343} 338}
344 339
345static void __init omap_apollon_map_io(void) 340static void __init omap_apollon_map_io(void)
@@ -353,7 +348,7 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon")
353 .boot_params = 0x80000100, 348 .boot_params = 0x80000100,
354 .reserve = omap_reserve, 349 .reserve = omap_reserve,
355 .map_io = omap_apollon_map_io, 350 .map_io = omap_apollon_map_io,
356 .init_early = omap_apollon_init_early, 351 .init_early = omap2420_init_early,
357 .init_irq = omap2_init_irq, 352 .init_irq = omap2_init_irq,
358 .init_machine = omap_apollon_init, 353 .init_machine = omap_apollon_init,
359 .timer = &omap2_timer, 354 .timer = &omap2_timer,
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 3af8aab435b5..e15d39bffe79 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -471,13 +471,6 @@ static void __init cm_t35_init_i2c(void)
471 omap3_pmic_init("tps65930", &cm_t35_twldata); 471 omap3_pmic_init("tps65930", &cm_t35_twldata);
472} 472}
473 473
474static void __init cm_t35_init_early(void)
475{
476 omap2_init_common_infrastructure();
477 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
478 mt46h32m32lf6_sdrc_params);
479}
480
481#ifdef CONFIG_OMAP_MUX 474#ifdef CONFIG_OMAP_MUX
482static struct omap_board_mux board_mux[] __initdata = { 475static struct omap_board_mux board_mux[] __initdata = {
483 /* nCS and IRQ for CM-T35 ethernet */ 476 /* nCS and IRQ for CM-T35 ethernet */
@@ -610,6 +603,8 @@ static void __init cm_t3x_common_init(void)
610 omap_board_config_size = ARRAY_SIZE(cm_t35_config); 603 omap_board_config_size = ARRAY_SIZE(cm_t35_config);
611 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); 604 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
612 omap_serial_init(); 605 omap_serial_init();
606 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
607 mt46h32m32lf6_sdrc_params);
613 cm_t35_init_i2c(); 608 cm_t35_init_i2c();
614 omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL); 609 omap_ads7846_init(1, CM_T35_GPIO_PENDOWN, 0, NULL);
615 cm_t35_init_ethernet(); 610 cm_t35_init_ethernet();
@@ -637,7 +632,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35")
637 .boot_params = 0x80000100, 632 .boot_params = 0x80000100,
638 .reserve = omap_reserve, 633 .reserve = omap_reserve,
639 .map_io = omap3_map_io, 634 .map_io = omap3_map_io,
640 .init_early = cm_t35_init_early, 635 .init_early = omap35xx_init_early,
641 .init_irq = omap3_init_irq, 636 .init_irq = omap3_init_irq,
642 .init_machine = cm_t35_init, 637 .init_machine = cm_t35_init,
643 .timer = &omap3_timer, 638 .timer = &omap3_timer,
@@ -647,7 +642,7 @@ MACHINE_START(CM_T3730, "Compulab CM-T3730")
647 .boot_params = 0x80000100, 642 .boot_params = 0x80000100,
648 .reserve = omap_reserve, 643 .reserve = omap_reserve,
649 .map_io = omap3_map_io, 644 .map_io = omap3_map_io,
650 .init_early = cm_t35_init_early, 645 .init_early = omap3630_init_early,
651 .init_irq = omap3_init_irq, 646 .init_irq = omap3_init_irq,
652 .init_machine = cm_t3730_init, 647 .init_machine = cm_t3730_init,
653 .timer = &omap3_timer, 648 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 05c72f4c1b57..867bf671719c 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -251,12 +251,6 @@ static inline void cm_t3517_init_nand(void) {}
251static struct omap_board_config_kernel cm_t3517_config[] __initdata = { 251static struct omap_board_config_kernel cm_t3517_config[] __initdata = {
252}; 252};
253 253
254static void __init cm_t3517_init_early(void)
255{
256 omap2_init_common_infrastructure();
257 omap2_init_common_devices(NULL, NULL);
258}
259
260#ifdef CONFIG_OMAP_MUX 254#ifdef CONFIG_OMAP_MUX
261static struct omap_board_mux board_mux[] __initdata = { 255static struct omap_board_mux board_mux[] __initdata = {
262 /* GPIO186 - Green LED */ 256 /* GPIO186 - Green LED */
@@ -289,6 +283,7 @@ static void __init cm_t3517_init(void)
289{ 283{
290 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 284 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
291 omap_serial_init(); 285 omap_serial_init();
286 omap_sdrc_init(NULL, NULL);
292 omap_board_config = cm_t3517_config; 287 omap_board_config = cm_t3517_config;
293 omap_board_config_size = ARRAY_SIZE(cm_t3517_config); 288 omap_board_config_size = ARRAY_SIZE(cm_t3517_config);
294 cm_t3517_init_leds(); 289 cm_t3517_init_leds();
@@ -302,7 +297,7 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
302 .boot_params = 0x80000100, 297 .boot_params = 0x80000100,
303 .reserve = omap_reserve, 298 .reserve = omap_reserve,
304 .map_io = omap3_map_io, 299 .map_io = omap3_map_io,
305 .init_early = cm_t3517_init_early, 300 .init_early = am35xx_init_early,
306 .init_irq = omap3_init_irq, 301 .init_irq = omap3_init_irq,
307 .init_machine = cm_t3517_init, 302 .init_machine = cm_t3517_init,
308 .timer = &omap3_timer, 303 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index b6002ec31c6a..4b1f6c68c358 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -397,14 +397,6 @@ static struct platform_device keys_gpio = {
397 }, 397 },
398}; 398};
399 399
400
401static void __init devkit8000_init_early(void)
402{
403 omap2_init_common_infrastructure();
404 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
405 mt46h32m32lf6_sdrc_params);
406}
407
408static void __init devkit8000_init_irq(void) 400static void __init devkit8000_init_irq(void)
409{ 401{
410 omap3_init_irq(); 402 omap3_init_irq();
@@ -645,6 +637,8 @@ static void __init devkit8000_init(void)
645{ 637{
646 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); 638 omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
647 omap_serial_init(); 639 omap_serial_init();
640 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
641 mt46h32m32lf6_sdrc_params);
648 642
649 omap_dm9000_init(); 643 omap_dm9000_init();
650 644
@@ -670,7 +664,7 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000")
670 .boot_params = 0x80000100, 664 .boot_params = 0x80000100,
671 .reserve = omap_reserve, 665 .reserve = omap_reserve,
672 .map_io = omap3_map_io, 666 .map_io = omap3_map_io,
673 .init_early = devkit8000_init_early, 667 .init_early = omap35xx_init_early,
674 .init_irq = devkit8000_init_irq, 668 .init_irq = devkit8000_init_irq,
675 .init_machine = devkit8000_init, 669 .init_machine = devkit8000_init,
676 .timer = &omap3_secure_timer, 670 .timer = &omap3_secure_timer,
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 54db41a84a9b..5223898f50e4 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -36,12 +36,12 @@ static struct omap_board_config_kernel generic_config[] = {
36static void __init omap_generic_init_early(void) 36static void __init omap_generic_init_early(void)
37{ 37{
38 omap2_init_common_infrastructure(); 38 omap2_init_common_infrastructure();
39 omap2_init_common_devices(NULL, NULL);
40} 39}
41 40
42static void __init omap_generic_init(void) 41static void __init omap_generic_init(void)
43{ 42{
44 omap_serial_init(); 43 omap_serial_init();
44 omap_sdrc_init(NULL, NULL);
45 omap_board_config = generic_config; 45 omap_board_config = generic_config;
46 omap_board_config_size = ARRAY_SIZE(generic_config); 46 omap_board_config_size = ARRAY_SIZE(generic_config);
47} 47}
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 45de2b319ec9..948fde010c69 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -290,12 +290,6 @@ static struct omap_board_config_kernel h4_config[] __initdata = {
290 { OMAP_TAG_LCD, &h4_lcd_config }, 290 { OMAP_TAG_LCD, &h4_lcd_config },
291}; 291};
292 292
293static void __init omap_h4_init_early(void)
294{
295 omap2_init_common_infrastructure();
296 omap2_init_common_devices(NULL, NULL);
297}
298
299static void __init omap_h4_init_irq(void) 293static void __init omap_h4_init_irq(void)
300{ 294{
301 omap2_init_irq(); 295 omap2_init_irq();
@@ -371,6 +365,7 @@ static void __init omap_h4_init(void)
371 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); 365 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
372 omap2_usbfs_init(&h4_usb_config); 366 omap2_usbfs_init(&h4_usb_config);
373 omap_serial_init(); 367 omap_serial_init();
368 omap_sdrc_init(NULL, NULL);
374 h4_init_flash(); 369 h4_init_flash();
375} 370}
376 371
@@ -385,7 +380,7 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
385 .boot_params = 0x80000100, 380 .boot_params = 0x80000100,
386 .reserve = omap_reserve, 381 .reserve = omap_reserve,
387 .map_io = omap_h4_map_io, 382 .map_io = omap_h4_map_io,
388 .init_early = omap_h4_init_early, 383 .init_early = omap2420_init_early,
389 .init_irq = omap_h4_init_irq, 384 .init_irq = omap_h4_init_irq,
390 .init_machine = omap_h4_init, 385 .init_machine = omap_h4_init,
391 .timer = &omap2_timer, 386 .timer = &omap2_timer,
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 35be778caf1b..7b66338e451b 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -491,13 +491,6 @@ static struct platform_device *igep_devices[] __initdata = {
491 &igep_vwlan_device, 491 &igep_vwlan_device,
492}; 492};
493 493
494static void __init igep_init_early(void)
495{
496 omap2_init_common_infrastructure();
497 omap2_init_common_devices(m65kxxxxam_sdrc_params,
498 m65kxxxxam_sdrc_params);
499}
500
501static int igep2_keymap[] = { 494static int igep2_keymap[] = {
502 KEY(0, 0, KEY_LEFT), 495 KEY(0, 0, KEY_LEFT),
503 KEY(0, 1, KEY_RIGHT), 496 KEY(0, 1, KEY_RIGHT),
@@ -650,6 +643,8 @@ static void __init igep_init(void)
650 igep_i2c_init(); 643 igep_i2c_init();
651 platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices)); 644 platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices));
652 omap_serial_init(); 645 omap_serial_init();
646 omap_sdrc_init(m65kxxxxam_sdrc_params,
647 m65kxxxxam_sdrc_params);
653 usb_musb_init(NULL); 648 usb_musb_init(NULL);
654 649
655 igep_flash_init(); 650 igep_flash_init();
@@ -675,7 +670,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board")
675 .boot_params = 0x80000100, 670 .boot_params = 0x80000100,
676 .reserve = omap_reserve, 671 .reserve = omap_reserve,
677 .map_io = omap3_map_io, 672 .map_io = omap3_map_io,
678 .init_early = igep_init_early, 673 .init_early = omap35xx_init_early,
679 .init_irq = omap3_init_irq, 674 .init_irq = omap3_init_irq,
680 .init_machine = igep_init, 675 .init_machine = igep_init,
681 .timer = &omap3_timer, 676 .timer = &omap3_timer,
@@ -685,7 +680,7 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module")
685 .boot_params = 0x80000100, 680 .boot_params = 0x80000100,
686 .reserve = omap_reserve, 681 .reserve = omap_reserve,
687 .map_io = omap3_map_io, 682 .map_io = omap3_map_io,
688 .init_early = igep_init_early, 683 .init_early = omap35xx_init_early,
689 .init_irq = omap3_init_irq, 684 .init_irq = omap3_init_irq,
690 .init_machine = igep_init, 685 .init_machine = igep_init,
691 .timer = &omap3_timer, 686 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 218764c9377e..401b9449f722 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -193,12 +193,6 @@ static struct omap_board_config_kernel ldp_config[] __initdata = {
193 { OMAP_TAG_LCD, &ldp_lcd_config }, 193 { OMAP_TAG_LCD, &ldp_lcd_config },
194}; 194};
195 195
196static void __init omap_ldp_init_early(void)
197{
198 omap2_init_common_infrastructure();
199 omap2_init_common_devices(NULL, NULL);
200}
201
202static struct twl4030_gpio_platform_data ldp_gpio_data = { 196static struct twl4030_gpio_platform_data ldp_gpio_data = {
203 .gpio_base = OMAP_MAX_GPIO_LINES, 197 .gpio_base = OMAP_MAX_GPIO_LINES,
204 .irq_base = TWL4030_GPIO_IRQ_BASE, 198 .irq_base = TWL4030_GPIO_IRQ_BASE,
@@ -325,6 +319,7 @@ static void __init omap_ldp_init(void)
325 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); 319 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
326 omap_ads7846_init(1, 54, 310, NULL); 320 omap_ads7846_init(1, 54, 310, NULL);
327 omap_serial_init(); 321 omap_serial_init();
322 omap_sdrc_init(NULL, NULL);
328 usb_musb_init(NULL); 323 usb_musb_init(NULL);
329 board_nand_init(ldp_nand_partitions, 324 board_nand_init(ldp_nand_partitions,
330 ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); 325 ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);
@@ -336,7 +331,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board")
336 .boot_params = 0x80000100, 331 .boot_params = 0x80000100,
337 .reserve = omap_reserve, 332 .reserve = omap_reserve,
338 .map_io = omap3_map_io, 333 .map_io = omap3_map_io,
339 .init_early = omap_ldp_init_early, 334 .init_early = omap3430_init_early,
340 .init_irq = omap3_init_irq, 335 .init_irq = omap3_init_irq,
341 .init_machine = omap_ldp_init, 336 .init_machine = omap_ldp_init,
342 .timer = &omap3_timer, 337 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index e11f0c5d608a..77a4e19222e2 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -622,12 +622,6 @@ static void __init n8x0_map_io(void)
622 omap242x_map_common_io(); 622 omap242x_map_common_io();
623} 623}
624 624
625static void __init n8x0_init_early(void)
626{
627 omap2_init_common_infrastructure();
628 omap2_init_common_devices(NULL, NULL);
629}
630
631#ifdef CONFIG_OMAP_MUX 625#ifdef CONFIG_OMAP_MUX
632static struct omap_board_mux board_mux[] __initdata = { 626static struct omap_board_mux board_mux[] __initdata = {
633 /* I2S codec port pins for McBSP block */ 627 /* I2S codec port pins for McBSP block */
@@ -689,6 +683,7 @@ static void __init n8x0_init_machine(void)
689 i2c_register_board_info(2, n810_i2c_board_info_2, 683 i2c_register_board_info(2, n810_i2c_board_info_2,
690 ARRAY_SIZE(n810_i2c_board_info_2)); 684 ARRAY_SIZE(n810_i2c_board_info_2));
691 board_serial_init(); 685 board_serial_init();
686 omap_sdrc_init(NULL, NULL);
692 gpmc_onenand_init(board_onenand_data); 687 gpmc_onenand_init(board_onenand_data);
693 n8x0_mmc_init(); 688 n8x0_mmc_init();
694 n8x0_usb_init(); 689 n8x0_usb_init();
@@ -698,7 +693,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800")
698 .boot_params = 0x80000100, 693 .boot_params = 0x80000100,
699 .reserve = omap_reserve, 694 .reserve = omap_reserve,
700 .map_io = n8x0_map_io, 695 .map_io = n8x0_map_io,
701 .init_early = n8x0_init_early, 696 .init_early = omap2420_init_early,
702 .init_irq = omap2_init_irq, 697 .init_irq = omap2_init_irq,
703 .init_machine = n8x0_init_machine, 698 .init_machine = n8x0_init_machine,
704 .timer = &omap2_timer, 699 .timer = &omap2_timer,
@@ -708,7 +703,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810")
708 .boot_params = 0x80000100, 703 .boot_params = 0x80000100,
709 .reserve = omap_reserve, 704 .reserve = omap_reserve,
710 .map_io = n8x0_map_io, 705 .map_io = n8x0_map_io,
711 .init_early = n8x0_init_early, 706 .init_early = omap2420_init_early,
712 .init_irq = omap2_init_irq, 707 .init_irq = omap2_init_irq,
713 .init_machine = n8x0_init_machine, 708 .init_machine = n8x0_init_machine,
714 .timer = &omap2_timer, 709 .timer = &omap2_timer,
@@ -718,7 +713,7 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX")
718 .boot_params = 0x80000100, 713 .boot_params = 0x80000100,
719 .reserve = omap_reserve, 714 .reserve = omap_reserve,
720 .map_io = n8x0_map_io, 715 .map_io = n8x0_map_io,
721 .init_early = n8x0_init_early, 716 .init_early = omap2420_init_early,
722 .init_irq = omap2_init_irq, 717 .init_irq = omap2_init_irq,
723 .init_machine = n8x0_init_machine, 718 .init_machine = n8x0_init_machine,
724 .timer = &omap2_timer, 719 .timer = &omap2_timer,
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 3ae16b4e3f52..ce3234d6a344 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -447,8 +447,6 @@ static struct platform_device keys_gpio = {
447static void __init omap3_beagle_init_early(void) 447static void __init omap3_beagle_init_early(void)
448{ 448{
449 omap2_init_common_infrastructure(); 449 omap2_init_common_infrastructure();
450 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
451 mt46h32m32lf6_sdrc_params);
452} 450}
453 451
454static void __init omap3_beagle_init_irq(void) 452static void __init omap3_beagle_init_irq(void)
@@ -534,6 +532,8 @@ static void __init omap3_beagle_init(void)
534 ARRAY_SIZE(omap3_beagle_devices)); 532 ARRAY_SIZE(omap3_beagle_devices));
535 omap_display_init(&beagle_dss_data); 533 omap_display_init(&beagle_dss_data);
536 omap_serial_init(); 534 omap_serial_init();
535 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
536 mt46h32m32lf6_sdrc_params);
537 537
538 omap_mux_init_gpio(170, OMAP_PIN_INPUT); 538 omap_mux_init_gpio(170, OMAP_PIN_INPUT);
539 /* REVISIT leave DVI powered down until it's needed ... */ 539 /* REVISIT leave DVI powered down until it's needed ... */
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index c452b3f3331a..a1184b347aeb 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -520,12 +520,6 @@ static int __init omap3_evm_i2c_init(void)
520static struct omap_board_config_kernel omap3_evm_config[] __initdata = { 520static struct omap_board_config_kernel omap3_evm_config[] __initdata = {
521}; 521};
522 522
523static void __init omap3_evm_init_early(void)
524{
525 omap2_init_common_infrastructure();
526 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
527}
528
529static struct usbhs_omap_board_data usbhs_bdata __initdata = { 523static struct usbhs_omap_board_data usbhs_bdata __initdata = {
530 524
531 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 525 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -640,6 +634,7 @@ static void __init omap3_evm_init(void)
640 omap_display_init(&omap3_evm_dss_data); 634 omap_display_init(&omap3_evm_dss_data);
641 635
642 omap_serial_init(); 636 omap_serial_init();
637 omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
643 638
644 /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */ 639 /* OMAP3EVM uses ISP1504 phy and so register nop transceiver */
645 usb_nop_xceiv_register(); 640 usb_nop_xceiv_register();
@@ -684,7 +679,7 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM")
684 .boot_params = 0x80000100, 679 .boot_params = 0x80000100,
685 .reserve = omap_reserve, 680 .reserve = omap_reserve,
686 .map_io = omap3_map_io, 681 .map_io = omap3_map_io,
687 .init_early = omap3_evm_init_early, 682 .init_early = omap35xx_init_early,
688 .init_irq = omap3_init_irq, 683 .init_irq = omap3_init_irq,
689 .init_machine = omap3_evm_init, 684 .init_machine = omap3_evm_init,
690 .timer = &omap3_timer, 685 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 703aeb5b8fd4..3a1dd84faca0 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -182,12 +182,6 @@ static inline void __init board_smsc911x_init(void)
182 gpmc_smsc911x_init(&board_smsc911x_data); 182 gpmc_smsc911x_init(&board_smsc911x_data);
183} 183}
184 184
185static void __init omap3logic_init_early(void)
186{
187 omap2_init_common_infrastructure();
188 omap2_init_common_devices(NULL, NULL);
189}
190
191#ifdef CONFIG_OMAP_MUX 185#ifdef CONFIG_OMAP_MUX
192static struct omap_board_mux board_mux[] __initdata = { 186static struct omap_board_mux board_mux[] __initdata = {
193 { .reg_offset = OMAP_MUX_TERMINATOR }, 187 { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -200,6 +194,7 @@ static void __init omap3logic_init(void)
200 omap3torpedo_fix_pbias_voltage(); 194 omap3torpedo_fix_pbias_voltage();
201 omap3logic_i2c_init(); 195 omap3logic_i2c_init();
202 omap_serial_init(); 196 omap_serial_init();
197 omap_sdrc_init(NULL, NULL);
203 board_mmc_init(); 198 board_mmc_init();
204 board_smsc911x_init(); 199 board_smsc911x_init();
205 200
@@ -211,7 +206,7 @@ static void __init omap3logic_init(void)
211MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") 206MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board")
212 .boot_params = 0x80000100, 207 .boot_params = 0x80000100,
213 .map_io = omap3_map_io, 208 .map_io = omap3_map_io,
214 .init_early = omap3logic_init_early, 209 .init_early = omap35xx_init_early,
215 .init_irq = omap3_init_irq, 210 .init_irq = omap3_init_irq,
216 .init_machine = omap3logic_init, 211 .init_machine = omap3logic_init,
217 .timer = &omap3_timer, 212 .timer = &omap3_timer,
@@ -220,7 +215,7 @@ MACHINE_END
220MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") 215MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board")
221 .boot_params = 0x80000100, 216 .boot_params = 0x80000100,
222 .map_io = omap3_map_io, 217 .map_io = omap3_map_io,
223 .init_early = omap3logic_init_early, 218 .init_early = omap35xx_init_early,
224 .init_irq = omap3_init_irq, 219 .init_irq = omap3_init_irq,
225 .init_machine = omap3logic_init, 220 .init_machine = omap3logic_init,
226 .timer = &omap3_timer, 221 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 080d7bd6795e..e46bf5249559 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -525,13 +525,6 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
525 } 525 }
526}; 526};
527 527
528static void __init omap3pandora_init_early(void)
529{
530 omap2_init_common_infrastructure();
531 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
532 mt46h32m32lf6_sdrc_params);
533}
534
535static void __init pandora_wl1251_init(void) 528static void __init pandora_wl1251_init(void)
536{ 529{
537 struct wl12xx_platform_data pandora_wl1251_pdata; 530 struct wl12xx_platform_data pandora_wl1251_pdata;
@@ -593,6 +586,8 @@ static void __init omap3pandora_init(void)
593 ARRAY_SIZE(omap3pandora_devices)); 586 ARRAY_SIZE(omap3pandora_devices));
594 omap_display_init(&pandora_dss_data); 587 omap_display_init(&pandora_dss_data);
595 omap_serial_init(); 588 omap_serial_init();
589 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
590 mt46h32m32lf6_sdrc_params);
596 spi_register_board_info(omap3pandora_spi_board_info, 591 spi_register_board_info(omap3pandora_spi_board_info,
597 ARRAY_SIZE(omap3pandora_spi_board_info)); 592 ARRAY_SIZE(omap3pandora_spi_board_info));
598 omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL); 593 omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
@@ -609,7 +604,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console")
609 .boot_params = 0x80000100, 604 .boot_params = 0x80000100,
610 .reserve = omap_reserve, 605 .reserve = omap_reserve,
611 .map_io = omap3_map_io, 606 .map_io = omap3_map_io,
612 .init_early = omap3pandora_init_early, 607 .init_early = omap35xx_init_early,
613 .init_irq = omap3_init_irq, 608 .init_irq = omap3_init_irq,
614 .init_machine = omap3pandora_init, 609 .init_machine = omap3pandora_init,
615 .timer = &omap3_timer, 610 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 8e104980ea26..807c27406792 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -428,12 +428,6 @@ static int __init omap3_stalker_i2c_init(void)
428static struct omap_board_config_kernel omap3_stalker_config[] __initdata = { 428static struct omap_board_config_kernel omap3_stalker_config[] __initdata = {
429}; 429};
430 430
431static void __init omap3_stalker_init_early(void)
432{
433 omap2_init_common_infrastructure();
434 omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);
435}
436
437static void __init omap3_stalker_init_irq(void) 431static void __init omap3_stalker_init_irq(void)
438{ 432{
439 omap3_init_irq(); 433 omap3_init_irq();
@@ -478,6 +472,7 @@ static void __init omap3_stalker_init(void)
478 omap_display_init(&omap3_stalker_dss_data); 472 omap_display_init(&omap3_stalker_dss_data);
479 473
480 omap_serial_init(); 474 omap_serial_init();
475 omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
481 usb_musb_init(NULL); 476 usb_musb_init(NULL);
482 usbhs_init(&usbhs_bdata); 477 usbhs_init(&usbhs_bdata);
483 omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL); 478 omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
@@ -496,7 +491,7 @@ MACHINE_START(SBC3530, "OMAP3 STALKER")
496 /* Maintainer: Jason Lam -lzg@ema-tech.com */ 491 /* Maintainer: Jason Lam -lzg@ema-tech.com */
497 .boot_params = 0x80000100, 492 .boot_params = 0x80000100,
498 .map_io = omap3_map_io, 493 .map_io = omap3_map_io,
499 .init_early = omap3_stalker_init_early, 494 .init_early = omap35xx_init_early,
500 .init_irq = omap3_stalker_init_irq, 495 .init_irq = omap3_stalker_init_irq,
501 .init_machine = omap3_stalker_init, 496 .init_machine = omap3_stalker_init,
502 .timer = &omap3_secure_timer, 497 .timer = &omap3_secure_timer,
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 852ea0464057..f7f18092f36d 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -326,13 +326,6 @@ static struct omap_board_mux board_mux[] __initdata = {
326}; 326};
327#endif 327#endif
328 328
329static void __init omap3_touchbook_init_early(void)
330{
331 omap2_init_common_infrastructure();
332 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
333 mt46h32m32lf6_sdrc_params);
334}
335
336static void __init omap3_touchbook_init_irq(void) 329static void __init omap3_touchbook_init_irq(void)
337{ 330{
338 omap3_init_irq(); 331 omap3_init_irq();
@@ -385,6 +378,8 @@ static void __init omap3_touchbook_init(void)
385 platform_add_devices(omap3_touchbook_devices, 378 platform_add_devices(omap3_touchbook_devices,
386 ARRAY_SIZE(omap3_touchbook_devices)); 379 ARRAY_SIZE(omap3_touchbook_devices));
387 omap_serial_init(); 380 omap_serial_init();
381 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
382 mt46h32m32lf6_sdrc_params);
388 383
389 omap_mux_init_gpio(170, OMAP_PIN_INPUT); 384 omap_mux_init_gpio(170, OMAP_PIN_INPUT);
390 /* REVISIT leave DVI powered down until it's needed ... */ 385 /* REVISIT leave DVI powered down until it's needed ... */
@@ -407,7 +402,7 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
407 .boot_params = 0x80000100, 402 .boot_params = 0x80000100,
408 .reserve = omap_reserve, 403 .reserve = omap_reserve,
409 .map_io = omap3_map_io, 404 .map_io = omap3_map_io,
410 .init_early = omap3_touchbook_init_early, 405 .init_early = omap3430_init_early,
411 .init_irq = omap3_touchbook_init_irq, 406 .init_irq = omap3_touchbook_init_irq,
412 .init_machine = omap3_touchbook_init, 407 .init_machine = omap3_touchbook_init,
413 .timer = &omap3_secure_timer, 408 .timer = &omap3_secure_timer,
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 9aaa96057666..1bce76589784 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -95,12 +95,6 @@ static struct platform_device *panda_devices[] __initdata = {
95 &wl1271_device, 95 &wl1271_device,
96}; 96};
97 97
98static void __init omap4_panda_init_early(void)
99{
100 omap2_init_common_infrastructure();
101 omap2_init_common_devices(NULL, NULL);
102}
103
104static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 98static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
105 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, 99 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
106 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, 100 .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
@@ -569,6 +563,7 @@ static void __init omap4_panda_init(void)
569 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices)); 563 platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
570 platform_device_register(&omap_vwlan_device); 564 platform_device_register(&omap_vwlan_device);
571 board_serial_init(); 565 board_serial_init();
566 omap_sdrc_init(NULL, NULL);
572 omap4_twl6030_hsmmc_init(mmc); 567 omap4_twl6030_hsmmc_init(mmc);
573 omap4_ehci_init(); 568 omap4_ehci_init();
574 usb_musb_init(&musb_board_data); 569 usb_musb_init(&musb_board_data);
@@ -586,7 +581,7 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board")
586 .boot_params = 0x80000100, 581 .boot_params = 0x80000100,
587 .reserve = omap_reserve, 582 .reserve = omap_reserve,
588 .map_io = omap4_panda_map_io, 583 .map_io = omap4_panda_map_io,
589 .init_early = omap4_panda_init_early, 584 .init_early = omap4430_init_early,
590 .init_irq = gic_init_irq, 585 .init_irq = gic_init_irq,
591 .init_machine = omap4_panda_init, 586 .init_machine = omap4_panda_init,
592 .timer = &omap4_timer, 587 .timer = &omap4_timer,
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index f949a9954d76..7228ae50802d 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -478,13 +478,6 @@ static int __init overo_spi_init(void)
478 return 0; 478 return 0;
479} 479}
480 480
481static void __init overo_init_early(void)
482{
483 omap2_init_common_infrastructure();
484 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
485 mt46h32m32lf6_sdrc_params);
486}
487
488static const struct usbhs_omap_board_data usbhs_bdata __initconst = { 481static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
489 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, 482 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
490 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, 483 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
@@ -514,6 +507,8 @@ static void __init overo_init(void)
514 overo_i2c_init(); 507 overo_i2c_init();
515 omap_display_init(&overo_dss_data); 508 omap_display_init(&overo_dss_data);
516 omap_serial_init(); 509 omap_serial_init();
510 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
511 mt46h32m32lf6_sdrc_params);
517 omap_nand_flash_init(0, overo_nand_partitions, 512 omap_nand_flash_init(0, overo_nand_partitions,
518 ARRAY_SIZE(overo_nand_partitions)); 513 ARRAY_SIZE(overo_nand_partitions));
519 usb_musb_init(NULL); 514 usb_musb_init(NULL);
@@ -564,7 +559,7 @@ MACHINE_START(OVERO, "Gumstix Overo")
564 .boot_params = 0x80000100, 559 .boot_params = 0x80000100,
565 .reserve = omap_reserve, 560 .reserve = omap_reserve,
566 .map_io = omap3_map_io, 561 .map_io = omap3_map_io,
567 .init_early = overo_init_early, 562 .init_early = omap35xx_init_early,
568 .init_irq = omap3_init_irq, 563 .init_irq = omap3_init_irq,
569 .init_machine = overo_init, 564 .init_machine = overo_init,
570 .timer = &omap3_timer, 565 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c
index 7dfed24ee12e..a3182e846b14 100644
--- a/arch/arm/mach-omap2/board-rm680.c
+++ b/arch/arm/mach-omap2/board-rm680.c
@@ -123,15 +123,6 @@ static void __init rm680_peripherals_init(void)
123 omap2_hsmmc_init(mmc); 123 omap2_hsmmc_init(mmc);
124} 124}
125 125
126static void __init rm680_init_early(void)
127{
128 struct omap_sdrc_params *sdrc_params;
129
130 omap2_init_common_infrastructure();
131 sdrc_params = nokia_get_sdram_timings();
132 omap2_init_common_devices(sdrc_params, sdrc_params);
133}
134
135#ifdef CONFIG_OMAP_MUX 126#ifdef CONFIG_OMAP_MUX
136static struct omap_board_mux board_mux[] __initdata = { 127static struct omap_board_mux board_mux[] __initdata = {
137 { .reg_offset = OMAP_MUX_TERMINATOR }, 128 { .reg_offset = OMAP_MUX_TERMINATOR },
@@ -140,8 +131,14 @@ static struct omap_board_mux board_mux[] __initdata = {
140 131
141static void __init rm680_init(void) 132static void __init rm680_init(void)
142{ 133{
134 struct omap_sdrc_params *sdrc_params;
135
143 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 136 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
144 omap_serial_init(); 137 omap_serial_init();
138
139 sdrc_params = nokia_get_sdram_timings();
140 omap_sdrc_init(sdrc_params, sdrc_params);
141
145 usb_musb_init(NULL); 142 usb_musb_init(NULL);
146 rm680_peripherals_init(); 143 rm680_peripherals_init();
147} 144}
@@ -156,7 +153,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board")
156 .boot_params = 0x80000100, 153 .boot_params = 0x80000100,
157 .reserve = omap_reserve, 154 .reserve = omap_reserve,
158 .map_io = rm680_map_io, 155 .map_io = rm680_map_io,
159 .init_early = rm680_init_early, 156 .init_early = omap3630_init_early,
160 .init_irq = omap3_init_irq, 157 .init_irq = omap3_init_irq,
161 .init_machine = rm680_init, 158 .init_machine = rm680_init,
162 .timer = &omap3_timer, 159 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index 5ea142f9bc97..32a79e28379c 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -102,15 +102,6 @@ static struct omap_board_config_kernel rx51_config[] = {
102 { OMAP_TAG_LCD, &rx51_lcd_config }, 102 { OMAP_TAG_LCD, &rx51_lcd_config },
103}; 103};
104 104
105static void __init rx51_init_early(void)
106{
107 struct omap_sdrc_params *sdrc_params;
108
109 omap2_init_common_infrastructure();
110 sdrc_params = nokia_get_sdram_timings();
111 omap2_init_common_devices(sdrc_params, sdrc_params);
112}
113
114extern void __init rx51_peripherals_init(void); 105extern void __init rx51_peripherals_init(void);
115 106
116#ifdef CONFIG_OMAP_MUX 107#ifdef CONFIG_OMAP_MUX
@@ -127,11 +118,17 @@ static struct omap_musb_board_data musb_board_data = {
127 118
128static void __init rx51_init(void) 119static void __init rx51_init(void)
129{ 120{
121 struct omap_sdrc_params *sdrc_params;
122
130 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 123 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
131 omap_board_config = rx51_config; 124 omap_board_config = rx51_config;
132 omap_board_config_size = ARRAY_SIZE(rx51_config); 125 omap_board_config_size = ARRAY_SIZE(rx51_config);
133 omap3_pm_init_cpuidle(rx51_cpuidle_params); 126 omap3_pm_init_cpuidle(rx51_cpuidle_params);
134 omap_serial_init(); 127 omap_serial_init();
128
129 sdrc_params = nokia_get_sdram_timings();
130 omap_sdrc_init(sdrc_params, sdrc_params);
131
135 usb_musb_init(&musb_board_data); 132 usb_musb_init(&musb_board_data);
136 rx51_peripherals_init(); 133 rx51_peripherals_init();
137 134
@@ -159,7 +156,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
159 .boot_params = 0x80000100, 156 .boot_params = 0x80000100,
160 .reserve = rx51_reserve, 157 .reserve = rx51_reserve,
161 .map_io = rx51_map_io, 158 .map_io = rx51_map_io,
162 .init_early = rx51_init_early, 159 .init_early = omap3430_init_early,
163 .init_irq = omap3_init_irq, 160 .init_irq = omap3_init_irq,
164 .init_machine = rx51_init, 161 .init_machine = rx51_init,
165 .timer = &omap3_timer, 162 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c
index a85d5b0b11da..981ca00d6e29 100644
--- a/arch/arm/mach-omap2/board-ti8168evm.c
+++ b/arch/arm/mach-omap2/board-ti8168evm.c
@@ -27,15 +27,10 @@
27static struct omap_board_config_kernel ti8168_evm_config[] __initdata = { 27static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {
28}; 28};
29 29
30static void __init ti8168_init_early(void)
31{
32 omap2_init_common_infrastructure();
33 omap2_init_common_devices(NULL, NULL);
34}
35
36static void __init ti8168_evm_init(void) 30static void __init ti8168_evm_init(void)
37{ 31{
38 omap_serial_init(); 32 omap_serial_init();
33 omap_sdrc_init(NULL, NULL);
39 omap_board_config = ti8168_evm_config; 34 omap_board_config = ti8168_evm_config;
40 omap_board_config_size = ARRAY_SIZE(ti8168_evm_config); 35 omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
41} 36}
@@ -50,7 +45,7 @@ MACHINE_START(TI8168EVM, "ti8168evm")
50 /* Maintainer: Texas Instruments */ 45 /* Maintainer: Texas Instruments */
51 .boot_params = 0x80000100, 46 .boot_params = 0x80000100,
52 .map_io = ti8168_evm_map_io, 47 .map_io = ti8168_evm_map_io,
53 .init_early = ti8168_init_early, 48 .init_early = ti816x_init_early,
54 .init_irq = ti816x_init_irq, 49 .init_irq = ti816x_init_irq,
55 .timer = &omap3_timer, 50 .timer = &omap3_timer,
56 .init_machine = ti8168_evm_init, 51 .init_machine = ti8168_evm_init,
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 8a98c3c303fc..d56c79661038 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -34,17 +34,6 @@
34 34
35#define ZOOM3_EHCI_RESET_GPIO 64 35#define ZOOM3_EHCI_RESET_GPIO 64
36 36
37static void __init omap_zoom_init_early(void)
38{
39 omap2_init_common_infrastructure();
40 if (machine_is_omap_zoom2())
41 omap2_init_common_devices(mt46h32m32lf6_sdrc_params,
42 mt46h32m32lf6_sdrc_params);
43 else if (machine_is_omap_zoom3())
44 omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,
45 h8mbx00u0mer0em_sdrc_params);
46}
47
48#ifdef CONFIG_OMAP_MUX 37#ifdef CONFIG_OMAP_MUX
49static struct omap_board_mux board_mux[] __initdata = { 38static struct omap_board_mux board_mux[] __initdata = {
50 /* WLAN IRQ - GPIO 162 */ 39 /* WLAN IRQ - GPIO 162 */
@@ -129,6 +118,14 @@ static void __init omap_zoom_init(void)
129 ZOOM_NAND_CS, NAND_BUSWIDTH_16); 118 ZOOM_NAND_CS, NAND_BUSWIDTH_16);
130 zoom_debugboard_init(); 119 zoom_debugboard_init();
131 zoom_peripherals_init(); 120 zoom_peripherals_init();
121
122 if (machine_is_omap_zoom2())
123 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
124 mt46h32m32lf6_sdrc_params);
125 else if (machine_is_omap_zoom3())
126 omap_sdrc_init(h8mbx00u0mer0em_sdrc_params,
127 h8mbx00u0mer0em_sdrc_params);
128
132 zoom_display_init(); 129 zoom_display_init();
133} 130}
134 131
@@ -136,7 +133,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board")
136 .boot_params = 0x80000100, 133 .boot_params = 0x80000100,
137 .reserve = omap_reserve, 134 .reserve = omap_reserve,
138 .map_io = omap3_map_io, 135 .map_io = omap3_map_io,
139 .init_early = omap_zoom_init_early, 136 .init_early = omap3430_init_early,
140 .init_irq = omap3_init_irq, 137 .init_irq = omap3_init_irq,
141 .init_machine = omap_zoom_init, 138 .init_machine = omap_zoom_init,
142 .timer = &omap3_timer, 139 .timer = &omap3_timer,
@@ -146,7 +143,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board")
146 .boot_params = 0x80000100, 143 .boot_params = 0x80000100,
147 .reserve = omap_reserve, 144 .reserve = omap_reserve,
148 .map_io = omap3_map_io, 145 .map_io = omap3_map_io,
149 .init_early = omap_zoom_init_early, 146 .init_early = omap3630_init_early,
150 .init_irq = omap3_init_irq, 147 .init_irq = omap3_init_irq,
151 .init_machine = omap_zoom_init, 148 .init_machine = omap_zoom_init,
152 .timer = &omap3_timer, 149 .timer = &omap3_timer,
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c
index debc040872f1..14a6277dd184 100644
--- a/arch/arm/mach-omap2/clock2420_data.c
+++ b/arch/arm/mach-omap2/clock2420_data.c
@@ -1898,6 +1898,54 @@ static struct omap_clk omap2420_clks[] = {
1898 CLK(NULL, "pka_ick", &pka_ick, CK_242X), 1898 CLK(NULL, "pka_ick", &pka_ick, CK_242X),
1899 CLK(NULL, "usb_fck", &usb_fck, CK_242X), 1899 CLK(NULL, "usb_fck", &usb_fck, CK_242X),
1900 CLK("musb-hdrc", "fck", &osc_ck, CK_242X), 1900 CLK("musb-hdrc", "fck", &osc_ck, CK_242X),
1901 CLK("omap_timer.1", "fck", &gpt1_fck, CK_242X),
1902 CLK("omap_timer.2", "fck", &gpt2_fck, CK_242X),
1903 CLK("omap_timer.3", "fck", &gpt3_fck, CK_242X),
1904 CLK("omap_timer.4", "fck", &gpt4_fck, CK_242X),
1905 CLK("omap_timer.5", "fck", &gpt5_fck, CK_242X),
1906 CLK("omap_timer.6", "fck", &gpt6_fck, CK_242X),
1907 CLK("omap_timer.7", "fck", &gpt7_fck, CK_242X),
1908 CLK("omap_timer.8", "fck", &gpt8_fck, CK_242X),
1909 CLK("omap_timer.9", "fck", &gpt9_fck, CK_242X),
1910 CLK("omap_timer.10", "fck", &gpt10_fck, CK_242X),
1911 CLK("omap_timer.11", "fck", &gpt11_fck, CK_242X),
1912 CLK("omap_timer.12", "fck", &gpt12_fck, CK_242X),
1913 CLK("omap_timer.1", "32k_ck", &func_32k_ck, CK_243X),
1914 CLK("omap_timer.2", "32k_ck", &func_32k_ck, CK_243X),
1915 CLK("omap_timer.3", "32k_ck", &func_32k_ck, CK_243X),
1916 CLK("omap_timer.4", "32k_ck", &func_32k_ck, CK_243X),
1917 CLK("omap_timer.5", "32k_ck", &func_32k_ck, CK_243X),
1918 CLK("omap_timer.6", "32k_ck", &func_32k_ck, CK_243X),
1919 CLK("omap_timer.7", "32k_ck", &func_32k_ck, CK_243X),
1920 CLK("omap_timer.8", "32k_ck", &func_32k_ck, CK_243X),
1921 CLK("omap_timer.9", "32k_ck", &func_32k_ck, CK_243X),
1922 CLK("omap_timer.10", "32k_ck", &func_32k_ck, CK_243X),
1923 CLK("omap_timer.11", "32k_ck", &func_32k_ck, CK_243X),
1924 CLK("omap_timer.12", "32k_ck", &func_32k_ck, CK_243X),
1925 CLK("omap_timer.1", "sys_ck", &sys_ck, CK_243X),
1926 CLK("omap_timer.2", "sys_ck", &sys_ck, CK_243X),
1927 CLK("omap_timer.3", "sys_ck", &sys_ck, CK_243X),
1928 CLK("omap_timer.4", "sys_ck", &sys_ck, CK_243X),
1929 CLK("omap_timer.5", "sys_ck", &sys_ck, CK_243X),
1930 CLK("omap_timer.6", "sys_ck", &sys_ck, CK_243X),
1931 CLK("omap_timer.7", "sys_ck", &sys_ck, CK_243X),
1932 CLK("omap_timer.8", "sys_ck", &sys_ck, CK_243X),
1933 CLK("omap_timer.9", "sys_ck", &sys_ck, CK_243X),
1934 CLK("omap_timer.10", "sys_ck", &sys_ck, CK_243X),
1935 CLK("omap_timer.11", "sys_ck", &sys_ck, CK_243X),
1936 CLK("omap_timer.12", "sys_ck", &sys_ck, CK_243X),
1937 CLK("omap_timer.1", "alt_ck", &alt_ck, CK_243X),
1938 CLK("omap_timer.2", "alt_ck", &alt_ck, CK_243X),
1939 CLK("omap_timer.3", "alt_ck", &alt_ck, CK_243X),
1940 CLK("omap_timer.4", "alt_ck", &alt_ck, CK_243X),
1941 CLK("omap_timer.5", "alt_ck", &alt_ck, CK_243X),
1942 CLK("omap_timer.6", "alt_ck", &alt_ck, CK_243X),
1943 CLK("omap_timer.7", "alt_ck", &alt_ck, CK_243X),
1944 CLK("omap_timer.8", "alt_ck", &alt_ck, CK_243X),
1945 CLK("omap_timer.9", "alt_ck", &alt_ck, CK_243X),
1946 CLK("omap_timer.10", "alt_ck", &alt_ck, CK_243X),
1947 CLK("omap_timer.11", "alt_ck", &alt_ck, CK_243X),
1948 CLK("omap_timer.12", "alt_ck", &alt_ck, CK_243X),
1901}; 1949};
1902 1950
1903/* 1951/*
diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c
index 96a942e42db1..ea6717cfa3c8 100644
--- a/arch/arm/mach-omap2/clock2430_data.c
+++ b/arch/arm/mach-omap2/clock2430_data.c
@@ -1998,6 +1998,54 @@ static struct omap_clk omap2430_clks[] = {
1998 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X), 1998 CLK(NULL, "mdm_intc_ick", &mdm_intc_ick, CK_243X),
1999 CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X), 1999 CLK("omap_hsmmc.0", "mmchsdb_fck", &mmchsdb1_fck, CK_243X),
2000 CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X), 2000 CLK("omap_hsmmc.1", "mmchsdb_fck", &mmchsdb2_fck, CK_243X),
2001 CLK("omap_timer.1", "fck", &gpt1_fck, CK_243X),
2002 CLK("omap_timer.2", "fck", &gpt2_fck, CK_243X),
2003 CLK("omap_timer.3", "fck", &gpt3_fck, CK_243X),
2004 CLK("omap_timer.4", "fck", &gpt4_fck, CK_243X),
2005 CLK("omap_timer.5", "fck", &gpt5_fck, CK_243X),
2006 CLK("omap_timer.6", "fck", &gpt6_fck, CK_243X),
2007 CLK("omap_timer.7", "fck", &gpt7_fck, CK_243X),
2008 CLK("omap_timer.8", "fck", &gpt8_fck, CK_243X),
2009 CLK("omap_timer.9", "fck", &gpt9_fck, CK_243X),
2010 CLK("omap_timer.10", "fck", &gpt10_fck, CK_243X),
2011 CLK("omap_timer.11", "fck", &gpt11_fck, CK_243X),
2012 CLK("omap_timer.12", "fck", &gpt12_fck, CK_243X),
2013 CLK("omap_timer.1", "32k_ck", &func_32k_ck, CK_243X),
2014 CLK("omap_timer.2", "32k_ck", &func_32k_ck, CK_243X),
2015 CLK("omap_timer.3", "32k_ck", &func_32k_ck, CK_243X),
2016 CLK("omap_timer.4", "32k_ck", &func_32k_ck, CK_243X),
2017 CLK("omap_timer.5", "32k_ck", &func_32k_ck, CK_243X),
2018 CLK("omap_timer.6", "32k_ck", &func_32k_ck, CK_243X),
2019 CLK("omap_timer.7", "32k_ck", &func_32k_ck, CK_243X),
2020 CLK("omap_timer.8", "32k_ck", &func_32k_ck, CK_243X),
2021 CLK("omap_timer.9", "32k_ck", &func_32k_ck, CK_243X),
2022 CLK("omap_timer.10", "32k_ck", &func_32k_ck, CK_243X),
2023 CLK("omap_timer.11", "32k_ck", &func_32k_ck, CK_243X),
2024 CLK("omap_timer.12", "32k_ck", &func_32k_ck, CK_243X),
2025 CLK("omap_timer.1", "sys_ck", &sys_ck, CK_243X),
2026 CLK("omap_timer.2", "sys_ck", &sys_ck, CK_243X),
2027 CLK("omap_timer.3", "sys_ck", &sys_ck, CK_243X),
2028 CLK("omap_timer.4", "sys_ck", &sys_ck, CK_243X),
2029 CLK("omap_timer.5", "sys_ck", &sys_ck, CK_243X),
2030 CLK("omap_timer.6", "sys_ck", &sys_ck, CK_243X),
2031 CLK("omap_timer.7", "sys_ck", &sys_ck, CK_243X),
2032 CLK("omap_timer.8", "sys_ck", &sys_ck, CK_243X),
2033 CLK("omap_timer.9", "sys_ck", &sys_ck, CK_243X),
2034 CLK("omap_timer.10", "sys_ck", &sys_ck, CK_243X),
2035 CLK("omap_timer.11", "sys_ck", &sys_ck, CK_243X),
2036 CLK("omap_timer.12", "sys_ck", &sys_ck, CK_243X),
2037 CLK("omap_timer.1", "alt_ck", &alt_ck, CK_243X),
2038 CLK("omap_timer.2", "alt_ck", &alt_ck, CK_243X),
2039 CLK("omap_timer.3", "alt_ck", &alt_ck, CK_243X),
2040 CLK("omap_timer.4", "alt_ck", &alt_ck, CK_243X),
2041 CLK("omap_timer.5", "alt_ck", &alt_ck, CK_243X),
2042 CLK("omap_timer.6", "alt_ck", &alt_ck, CK_243X),
2043 CLK("omap_timer.7", "alt_ck", &alt_ck, CK_243X),
2044 CLK("omap_timer.8", "alt_ck", &alt_ck, CK_243X),
2045 CLK("omap_timer.9", "alt_ck", &alt_ck, CK_243X),
2046 CLK("omap_timer.10", "alt_ck", &alt_ck, CK_243X),
2047 CLK("omap_timer.11", "alt_ck", &alt_ck, CK_243X),
2048 CLK("omap_timer.12", "alt_ck", &alt_ck, CK_243X),
2001}; 2049};
2002 2050
2003/* 2051/*
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c
index ffd55b1c4396..65dd363163bc 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3078,6 +3078,7 @@ static struct clk gpt12_fck = {
3078 .name = "gpt12_fck", 3078 .name = "gpt12_fck",
3079 .ops = &clkops_null, 3079 .ops = &clkops_null,
3080 .parent = &secure_32k_fck, 3080 .parent = &secure_32k_fck,
3081 .clkdm_name = "wkup_clkdm",
3081 .recalc = &followparent_recalc, 3082 .recalc = &followparent_recalc,
3082}; 3083};
3083 3084
@@ -3085,6 +3086,7 @@ static struct clk wdt1_fck = {
3085 .name = "wdt1_fck", 3086 .name = "wdt1_fck",
3086 .ops = &clkops_null, 3087 .ops = &clkops_null,
3087 .parent = &secure_32k_fck, 3088 .parent = &secure_32k_fck,
3089 .clkdm_name = "wkup_clkdm",
3088 .recalc = &followparent_recalc, 3090 .recalc = &followparent_recalc,
3089}; 3091};
3090 3092
@@ -3462,6 +3464,42 @@ static struct omap_clk omap3xxx_clks[] = {
3462 CLK("musb-am35x", "fck", &hsotgusb_fck_am35xx, CK_AM35XX), 3464 CLK("musb-am35x", "fck", &hsotgusb_fck_am35xx, CK_AM35XX),
3463 CLK(NULL, "hecc_ck", &hecc_ck, CK_AM35XX), 3465 CLK(NULL, "hecc_ck", &hecc_ck, CK_AM35XX),
3464 CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX), 3466 CLK(NULL, "uart4_ick", &uart4_ick_am35xx, CK_AM35XX),
3467 CLK("omap_timer.1", "fck", &gpt1_fck, CK_3XXX),
3468 CLK("omap_timer.2", "fck", &gpt2_fck, CK_3XXX),
3469 CLK("omap_timer.3", "fck", &gpt3_fck, CK_3XXX),
3470 CLK("omap_timer.4", "fck", &gpt4_fck, CK_3XXX),
3471 CLK("omap_timer.5", "fck", &gpt5_fck, CK_3XXX),
3472 CLK("omap_timer.6", "fck", &gpt6_fck, CK_3XXX),
3473 CLK("omap_timer.7", "fck", &gpt7_fck, CK_3XXX),
3474 CLK("omap_timer.8", "fck", &gpt8_fck, CK_3XXX),
3475 CLK("omap_timer.9", "fck", &gpt9_fck, CK_3XXX),
3476 CLK("omap_timer.10", "fck", &gpt10_fck, CK_3XXX),
3477 CLK("omap_timer.11", "fck", &gpt11_fck, CK_3XXX),
3478 CLK("omap_timer.12", "fck", &gpt12_fck, CK_3XXX),
3479 CLK("omap_timer.1", "32k_ck", &omap_32k_fck, CK_3XXX),
3480 CLK("omap_timer.2", "32k_ck", &omap_32k_fck, CK_3XXX),
3481 CLK("omap_timer.3", "32k_ck", &omap_32k_fck, CK_3XXX),
3482 CLK("omap_timer.4", "32k_ck", &omap_32k_fck, CK_3XXX),
3483 CLK("omap_timer.5", "32k_ck", &omap_32k_fck, CK_3XXX),
3484 CLK("omap_timer.6", "32k_ck", &omap_32k_fck, CK_3XXX),
3485 CLK("omap_timer.7", "32k_ck", &omap_32k_fck, CK_3XXX),
3486 CLK("omap_timer.8", "32k_ck", &omap_32k_fck, CK_3XXX),
3487 CLK("omap_timer.9", "32k_ck", &omap_32k_fck, CK_3XXX),
3488 CLK("omap_timer.10", "32k_ck", &omap_32k_fck, CK_3XXX),
3489 CLK("omap_timer.11", "32k_ck", &omap_32k_fck, CK_3XXX),
3490 CLK("omap_timer.12", "32k_ck", &omap_32k_fck, CK_3XXX),
3491 CLK("omap_timer.1", "sys_ck", &sys_ck, CK_3XXX),
3492 CLK("omap_timer.2", "sys_ck", &sys_ck, CK_3XXX),
3493 CLK("omap_timer.3", "sys_ck", &sys_ck, CK_3XXX),
3494 CLK("omap_timer.4", "sys_ck", &sys_ck, CK_3XXX),
3495 CLK("omap_timer.5", "sys_ck", &sys_ck, CK_3XXX),
3496 CLK("omap_timer.6", "sys_ck", &sys_ck, CK_3XXX),
3497 CLK("omap_timer.7", "sys_ck", &sys_ck, CK_3XXX),
3498 CLK("omap_timer.8", "sys_ck", &sys_ck, CK_3XXX),
3499 CLK("omap_timer.9", "sys_ck", &sys_ck, CK_3XXX),
3500 CLK("omap_timer.10", "sys_ck", &sys_ck, CK_3XXX),
3501 CLK("omap_timer.11", "sys_ck", &sys_ck, CK_3XXX),
3502 CLK("omap_timer.12", "sys_ck", &sys_ck, CK_3XXX),
3465}; 3503};
3466 3504
3467 3505
@@ -3470,7 +3508,16 @@ int __init omap3xxx_clk_init(void)
3470 struct omap_clk *c; 3508 struct omap_clk *c;
3471 u32 cpu_clkflg = 0; 3509 u32 cpu_clkflg = 0;
3472 3510
3473 if (cpu_is_omap3517()) { 3511 /*
3512 * 3505 must be tested before 3517, since 3517 returns true
3513 * for both AM3517 chips and AM3517 family chips, which
3514 * includes 3505. Unfortunately there's no obvious family
3515 * test for 3517/3505 :-(
3516 */
3517 if (cpu_is_omap3505()) {
3518 cpu_mask = RATE_IN_34XX;
3519 cpu_clkflg = CK_3505;
3520 } else if (cpu_is_omap3517()) {
3474 cpu_mask = RATE_IN_34XX; 3521 cpu_mask = RATE_IN_34XX;
3475 cpu_clkflg = CK_3517; 3522 cpu_clkflg = CK_3517;
3476 } else if (cpu_is_omap3505()) { 3523 } else if (cpu_is_omap3505()) {
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 2af0e3f00ce1..946bf04a956d 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -3363,6 +3363,39 @@ static struct omap_clk omap44xx_clks[] = {
3363 CLK("usbhs-omap.0", "usbhost_ick", &dummy_ck, CK_443X), 3363 CLK("usbhs-omap.0", "usbhost_ick", &dummy_ck, CK_443X),
3364 CLK("usbhs-omap.0", "usbtll_fck", &dummy_ck, CK_443X), 3364 CLK("usbhs-omap.0", "usbtll_fck", &dummy_ck, CK_443X),
3365 CLK("omap_wdt", "ick", &dummy_ck, CK_443X), 3365 CLK("omap_wdt", "ick", &dummy_ck, CK_443X),
3366 CLK("omap_timer.1", "fck", &timer1_fck, CK_443X),
3367 CLK("omap_timer.2", "fck", &timer2_fck, CK_443X),
3368 CLK("omap_timer.3", "fck", &timer3_fck, CK_443X),
3369 CLK("omap_timer.4", "fck", &timer4_fck, CK_443X),
3370 CLK("omap_timer.5", "fck", &timer5_fck, CK_443X),
3371 CLK("omap_timer.6", "fck", &timer6_fck, CK_443X),
3372 CLK("omap_timer.7", "fck", &timer7_fck, CK_443X),
3373 CLK("omap_timer.8", "fck", &timer8_fck, CK_443X),
3374 CLK("omap_timer.9", "fck", &timer9_fck, CK_443X),
3375 CLK("omap_timer.10", "fck", &timer10_fck, CK_443X),
3376 CLK("omap_timer.11", "fck", &timer11_fck, CK_443X),
3377 CLK("omap_timer.1", "32k_ck", &sys_32k_ck, CK_443X),
3378 CLK("omap_timer.2", "32k_ck", &sys_32k_ck, CK_443X),
3379 CLK("omap_timer.3", "32k_ck", &sys_32k_ck, CK_443X),
3380 CLK("omap_timer.4", "32k_ck", &sys_32k_ck, CK_443X),
3381 CLK("omap_timer.5", "32k_ck", &sys_32k_ck, CK_443X),
3382 CLK("omap_timer.6", "32k_ck", &sys_32k_ck, CK_443X),
3383 CLK("omap_timer.7", "32k_ck", &sys_32k_ck, CK_443X),
3384 CLK("omap_timer.8", "32k_ck", &sys_32k_ck, CK_443X),
3385 CLK("omap_timer.9", "32k_ck", &sys_32k_ck, CK_443X),
3386 CLK("omap_timer.10", "32k_ck", &sys_32k_ck, CK_443X),
3387 CLK("omap_timer.11", "32k_ck", &sys_32k_ck, CK_443X),
3388 CLK("omap_timer.1", "sys_ck", &sys_clkin_ck, CK_443X),
3389 CLK("omap_timer.2", "sys_ck", &sys_clkin_ck, CK_443X),
3390 CLK("omap_timer.3", "sys_ck", &sys_clkin_ck, CK_443X),
3391 CLK("omap_timer.4", "sys_ck", &sys_clkin_ck, CK_443X),
3392 CLK("omap_timer.9", "sys_ck", &sys_clkin_ck, CK_443X),
3393 CLK("omap_timer.10", "sys_ck", &sys_clkin_ck, CK_443X),
3394 CLK("omap_timer.11", "sys_ck", &sys_clkin_ck, CK_443X),
3395 CLK("omap_timer.5", "sys_ck", &syc_clk_div_ck, CK_443X),
3396 CLK("omap_timer.6", "sys_ck", &syc_clk_div_ck, CK_443X),
3397 CLK("omap_timer.7", "sys_ck", &syc_clk_div_ck, CK_443X),
3398 CLK("omap_timer.8", "sys_ck", &syc_clk_div_ck, CK_443X),
3366}; 3399};
3367 3400
3368int __init omap4xxx_clk_init(void) 3401int __init omap4xxx_clk_init(void)
@@ -3376,10 +3409,18 @@ int __init omap4xxx_clk_init(void)
3376 } else if (cpu_is_omap446x()) { 3409 } else if (cpu_is_omap446x()) {
3377 cpu_mask = RATE_IN_4460; 3410 cpu_mask = RATE_IN_4460;
3378 cpu_clkflg = CK_446X; 3411 cpu_clkflg = CK_446X;
3412 } else {
3413 return 0;
3379 } 3414 }
3380 3415
3381 clk_init(&omap2_clk_functions); 3416 clk_init(&omap2_clk_functions);
3382 omap2_clk_disable_clkdm_control(); 3417
3418 /*
3419 * Must stay commented until all OMAP SoC drivers are
3420 * converted to runtime PM, or drivers may start crashing
3421 *
3422 * omap2_clk_disable_clkdm_control();
3423 */
3383 3424
3384 for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks); 3425 for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks);
3385 c++) 3426 c++)
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index ab7db083f97f..8480ee4344ea 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -73,9 +73,6 @@ static int _clkdm_register(struct clockdomain *clkdm)
73 if (!clkdm || !clkdm->name) 73 if (!clkdm || !clkdm->name)
74 return -EINVAL; 74 return -EINVAL;
75 75
76 if (!omap_chip_is(clkdm->omap_chip))
77 return -EINVAL;
78
79 pwrdm = pwrdm_lookup(clkdm->pwrdm.name); 76 pwrdm = pwrdm_lookup(clkdm->pwrdm.name);
80 if (!pwrdm) { 77 if (!pwrdm) {
81 pr_err("clockdomain: %s: powerdomain %s does not exist\n", 78 pr_err("clockdomain: %s: powerdomain %s does not exist\n",
@@ -105,13 +102,10 @@ static struct clkdm_dep *_clkdm_deps_lookup(struct clockdomain *clkdm,
105{ 102{
106 struct clkdm_dep *cd; 103 struct clkdm_dep *cd;
107 104
108 if (!clkdm || !deps || !omap_chip_is(clkdm->omap_chip)) 105 if (!clkdm || !deps)
109 return ERR_PTR(-EINVAL); 106 return ERR_PTR(-EINVAL);
110 107
111 for (cd = deps; cd->clkdm_name; cd++) { 108 for (cd = deps; cd->clkdm_name; cd++) {
112 if (!omap_chip_is(cd->omap_chip))
113 continue;
114
115 if (!cd->clkdm && cd->clkdm_name) 109 if (!cd->clkdm && cd->clkdm_name)
116 cd->clkdm = _clkdm_lookup(cd->clkdm_name); 110 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
117 111
@@ -148,9 +142,6 @@ static void _autodep_lookup(struct clkdm_autodep *autodep)
148 if (!autodep) 142 if (!autodep)
149 return; 143 return;
150 144
151 if (!omap_chip_is(autodep->omap_chip))
152 return;
153
154 clkdm = clkdm_lookup(autodep->clkdm.name); 145 clkdm = clkdm_lookup(autodep->clkdm.name);
155 if (!clkdm) { 146 if (!clkdm) {
156 pr_err("clockdomain: autodeps: clockdomain %s does not exist\n", 147 pr_err("clockdomain: autodeps: clockdomain %s does not exist\n",
@@ -182,9 +173,6 @@ void _clkdm_add_autodeps(struct clockdomain *clkdm)
182 if (IS_ERR(autodep->clkdm.ptr)) 173 if (IS_ERR(autodep->clkdm.ptr))
183 continue; 174 continue;
184 175
185 if (!omap_chip_is(autodep->omap_chip))
186 continue;
187
188 pr_debug("clockdomain: adding %s sleepdep/wkdep for " 176 pr_debug("clockdomain: adding %s sleepdep/wkdep for "
189 "clkdm %s\n", autodep->clkdm.ptr->name, 177 "clkdm %s\n", autodep->clkdm.ptr->name,
190 clkdm->name); 178 clkdm->name);
@@ -216,9 +204,6 @@ void _clkdm_del_autodeps(struct clockdomain *clkdm)
216 if (IS_ERR(autodep->clkdm.ptr)) 204 if (IS_ERR(autodep->clkdm.ptr))
217 continue; 205 continue;
218 206
219 if (!omap_chip_is(autodep->omap_chip))
220 continue;
221
222 pr_debug("clockdomain: removing %s sleepdep/wkdep for " 207 pr_debug("clockdomain: removing %s sleepdep/wkdep for "
223 "clkdm %s\n", autodep->clkdm.ptr->name, 208 "clkdm %s\n", autodep->clkdm.ptr->name,
224 clkdm->name); 209 clkdm->name);
@@ -243,8 +228,6 @@ static void _resolve_clkdm_deps(struct clockdomain *clkdm,
243 struct clkdm_dep *cd; 228 struct clkdm_dep *cd;
244 229
245 for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) { 230 for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) {
246 if (!omap_chip_is(cd->omap_chip))
247 continue;
248 if (cd->clkdm) 231 if (cd->clkdm)
249 continue; 232 continue;
250 cd->clkdm = _clkdm_lookup(cd->clkdm_name); 233 cd->clkdm = _clkdm_lookup(cd->clkdm_name);
@@ -257,43 +240,113 @@ static void _resolve_clkdm_deps(struct clockdomain *clkdm,
257/* Public functions */ 240/* Public functions */
258 241
259/** 242/**
260 * clkdm_init - set up the clockdomain layer 243 * clkdm_register_platform_funcs - register clockdomain implementation fns
261 * @clkdms: optional pointer to an array of clockdomains to register 244 * @co: func pointers for arch specific implementations
262 * @init_autodeps: optional pointer to an array of autodeps to register 245 *
263 * @custom_funcs: func pointers for arch specific implementations 246 * Register the list of function pointers used to implement the
264 * 247 * clockdomain functions on different OMAP SoCs. Should be called
265 * Set up internal state. If a pointer to an array of clockdomains 248 * before any other clkdm_register*() function. Returns -EINVAL if
266 * @clkdms was supplied, loop through the list of clockdomains, 249 * @co is null, -EEXIST if platform functions have already been
267 * register all that are available on the current platform. Similarly, 250 * registered, or 0 upon success.
268 * if a pointer to an array of clockdomain autodependencies 251 */
269 * @init_autodeps was provided, register those. No return value. 252int clkdm_register_platform_funcs(struct clkdm_ops *co)
253{
254 if (!co)
255 return -EINVAL;
256
257 if (arch_clkdm)
258 return -EEXIST;
259
260 arch_clkdm = co;
261
262 return 0;
263};
264
265/**
266 * clkdm_register_clkdms - register SoC clockdomains
267 * @cs: pointer to an array of struct clockdomain to register
268 *
269 * Register the clockdomains available on a particular OMAP SoC. Must
270 * be called after clkdm_register_platform_funcs(). May be called
271 * multiple times. Returns -EACCES if called before
272 * clkdm_register_platform_funcs(); -EINVAL if the argument @cs is
273 * null; or 0 upon success.
270 */ 274 */
271void clkdm_init(struct clockdomain **clkdms, 275int clkdm_register_clkdms(struct clockdomain **cs)
272 struct clkdm_autodep *init_autodeps,
273 struct clkdm_ops *custom_funcs)
274{ 276{
275 struct clockdomain **c = NULL; 277 struct clockdomain **c = NULL;
276 struct clockdomain *clkdm;
277 struct clkdm_autodep *autodep = NULL;
278 278
279 if (!custom_funcs) 279 if (!arch_clkdm)
280 WARN(1, "No custom clkdm functions registered\n"); 280 return -EACCES;
281 else 281
282 arch_clkdm = custom_funcs; 282 if (!cs)
283 return -EINVAL;
284
285 for (c = cs; *c; c++)
286 _clkdm_register(*c);
287
288 return 0;
289}
290
291/**
292 * clkdm_register_autodeps - register autodeps (if required)
293 * @ia: pointer to a static array of struct clkdm_autodep to register
294 *
295 * Register clockdomain "automatic dependencies." These are
296 * clockdomain wakeup and sleep dependencies that are automatically
297 * added whenever the first clock inside a clockdomain is enabled, and
298 * removed whenever the last clock inside a clockdomain is disabled.
299 * These are currently only used on OMAP3 devices, and are deprecated,
300 * since they waste energy. However, until the OMAP2/3 IP block
301 * enable/disable sequence can be converted to match the OMAP4
302 * sequence, they are needed.
303 *
304 * Must be called only after all of the SoC clockdomains are
305 * registered, since the function will resolve autodep clockdomain
306 * names into clockdomain pointers.
307 *
308 * The struct clkdm_autodep @ia array must be static, as this function
309 * does not copy the array elements.
310 *
311 * Returns -EACCES if called before any clockdomains have been
312 * registered, -EINVAL if called with a null @ia argument, -EEXIST if
313 * autodeps have already been registered, or 0 upon success.
314 */
315int clkdm_register_autodeps(struct clkdm_autodep *ia)
316{
317 struct clkdm_autodep *a = NULL;
283 318
284 if (clkdms) 319 if (list_empty(&clkdm_list))
285 for (c = clkdms; *c; c++) 320 return -EACCES;
286 _clkdm_register(*c); 321
322 if (!ia)
323 return -EINVAL;
287 324
288 autodeps = init_autodeps;
289 if (autodeps) 325 if (autodeps)
290 for (autodep = autodeps; autodep->clkdm.ptr; autodep++) 326 return -EEXIST;
291 _autodep_lookup(autodep); 327
328 autodeps = ia;
329 for (a = autodeps; a->clkdm.ptr; a++)
330 _autodep_lookup(a);
331
332 return 0;
333}
334
335/**
336 * clkdm_complete_init - set up the clockdomain layer
337 *
338 * Put all clockdomains into software-supervised mode; PM code should
339 * later enable hardware-supervised mode as appropriate. Must be
340 * called after clkdm_register_clkdms(). Returns -EACCES if called
341 * before clkdm_register_clkdms(), or 0 upon success.
342 */
343int clkdm_complete_init(void)
344{
345 struct clockdomain *clkdm;
346
347 if (list_empty(&clkdm_list))
348 return -EACCES;
292 349
293 /*
294 * Put all clockdomains into software-supervised mode; PM code
295 * should later enable hardware-supervised mode as appropriate
296 */
297 list_for_each_entry(clkdm, &clkdm_list, node) { 350 list_for_each_entry(clkdm, &clkdm_list, node) {
298 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) 351 if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
299 clkdm_wakeup(clkdm); 352 clkdm_wakeup(clkdm);
@@ -306,6 +359,8 @@ void clkdm_init(struct clockdomain **clkdms,
306 _resolve_clkdm_deps(clkdm, clkdm->sleepdep_srcs); 359 _resolve_clkdm_deps(clkdm, clkdm->sleepdep_srcs);
307 clkdm_clear_all_sleepdeps(clkdm); 360 clkdm_clear_all_sleepdeps(clkdm);
308 } 361 }
362
363 return 0;
309} 364}
310 365
311/** 366/**
@@ -747,6 +802,7 @@ int clkdm_wakeup(struct clockdomain *clkdm)
747 spin_lock_irqsave(&clkdm->lock, flags); 802 spin_lock_irqsave(&clkdm->lock, flags);
748 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; 803 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED;
749 ret = arch_clkdm->clkdm_wakeup(clkdm); 804 ret = arch_clkdm->clkdm_wakeup(clkdm);
805 ret |= pwrdm_state_switch(clkdm->pwrdm.ptr);
750 spin_unlock_irqrestore(&clkdm->lock, flags); 806 spin_unlock_irqrestore(&clkdm->lock, flags);
751 return ret; 807 return ret;
752} 808}
@@ -818,6 +874,7 @@ void clkdm_deny_idle(struct clockdomain *clkdm)
818 spin_lock_irqsave(&clkdm->lock, flags); 874 spin_lock_irqsave(&clkdm->lock, flags);
819 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; 875 clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED;
820 arch_clkdm->clkdm_deny_idle(clkdm); 876 arch_clkdm->clkdm_deny_idle(clkdm);
877 pwrdm_state_switch(clkdm->pwrdm.ptr);
821 spin_unlock_irqrestore(&clkdm->lock, flags); 878 spin_unlock_irqrestore(&clkdm->lock, flags);
822} 879}
823 880
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index 1e50c88b8a07..f7b58609bad8 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -45,7 +45,6 @@
45/** 45/**
46 * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode 46 * struct clkdm_autodep - clkdm deps to add when entering/exiting hwsup mode
47 * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only 47 * @clkdm: clockdomain to add wkdep+sleepdep on - set name member only
48 * @omap_chip: OMAP chip types that this autodep is valid on
49 * 48 *
50 * A clockdomain that should have wkdeps and sleepdeps added when a 49 * A clockdomain that should have wkdeps and sleepdeps added when a
51 * clockdomain should stay active in hwsup mode; and conversely, 50 * clockdomain should stay active in hwsup mode; and conversely,
@@ -60,14 +59,12 @@ struct clkdm_autodep {
60 const char *name; 59 const char *name;
61 struct clockdomain *ptr; 60 struct clockdomain *ptr;
62 } clkdm; 61 } clkdm;
63 const struct omap_chip_id omap_chip;
64}; 62};
65 63
66/** 64/**
67 * struct clkdm_dep - encode dependencies between clockdomains 65 * struct clkdm_dep - encode dependencies between clockdomains
68 * @clkdm_name: clockdomain name 66 * @clkdm_name: clockdomain name
69 * @clkdm: pointer to the struct clockdomain of @clkdm_name 67 * @clkdm: pointer to the struct clockdomain of @clkdm_name
70 * @omap_chip: OMAP chip types that this dependency is valid on
71 * @wkdep_usecount: Number of wakeup dependencies causing this clkdm to wake 68 * @wkdep_usecount: Number of wakeup dependencies causing this clkdm to wake
72 * @sleepdep_usecount: Number of sleep deps that could prevent clkdm from idle 69 * @sleepdep_usecount: Number of sleep deps that could prevent clkdm from idle
73 * 70 *
@@ -81,7 +78,6 @@ struct clkdm_dep {
81 struct clockdomain *clkdm; 78 struct clockdomain *clkdm;
82 atomic_t wkdep_usecount; 79 atomic_t wkdep_usecount;
83 atomic_t sleepdep_usecount; 80 atomic_t sleepdep_usecount;
84 const struct omap_chip_id omap_chip;
85}; 81};
86 82
87/* Possible flags for struct clockdomain._flags */ 83/* Possible flags for struct clockdomain._flags */
@@ -101,7 +97,6 @@ struct clkdm_dep {
101 * @clkdm_offs: (OMAP4 only) CM clockdomain register offset 97 * @clkdm_offs: (OMAP4 only) CM clockdomain register offset
102 * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up 98 * @wkdep_srcs: Clockdomains that can be told to wake this powerdomain up
103 * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact 99 * @sleepdep_srcs: Clockdomains that can be told to keep this clkdm from inact
104 * @omap_chip: OMAP chip types that this clockdomain is valid on
105 * @usecount: Usecount tracking 100 * @usecount: Usecount tracking
106 * @node: list_head to link all clockdomains together 101 * @node: list_head to link all clockdomains together
107 * 102 *
@@ -126,7 +121,6 @@ struct clockdomain {
126 const u16 clkdm_offs; 121 const u16 clkdm_offs;
127 struct clkdm_dep *wkdep_srcs; 122 struct clkdm_dep *wkdep_srcs;
128 struct clkdm_dep *sleepdep_srcs; 123 struct clkdm_dep *sleepdep_srcs;
129 const struct omap_chip_id omap_chip;
130 atomic_t usecount; 124 atomic_t usecount;
131 struct list_head node; 125 struct list_head node;
132 spinlock_t lock; 126 spinlock_t lock;
@@ -166,8 +160,11 @@ struct clkdm_ops {
166 int (*clkdm_clk_disable)(struct clockdomain *clkdm); 160 int (*clkdm_clk_disable)(struct clockdomain *clkdm);
167}; 161};
168 162
169void clkdm_init(struct clockdomain **clkdms, struct clkdm_autodep *autodeps, 163int clkdm_register_platform_funcs(struct clkdm_ops *co);
170 struct clkdm_ops *custom_funcs); 164int clkdm_register_autodeps(struct clkdm_autodep *ia);
165int clkdm_register_clkdms(struct clockdomain **c);
166int clkdm_complete_init(void);
167
171struct clockdomain *clkdm_lookup(const char *name); 168struct clockdomain *clkdm_lookup(const char *name);
172 169
173int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user), 170int clkdm_for_each(int (*fn)(struct clockdomain *clkdm, void *user),
@@ -195,7 +192,8 @@ int clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk);
195int clkdm_hwmod_enable(struct clockdomain *clkdm, struct omap_hwmod *oh); 192int clkdm_hwmod_enable(struct clockdomain *clkdm, struct omap_hwmod *oh);
196int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh); 193int clkdm_hwmod_disable(struct clockdomain *clkdm, struct omap_hwmod *oh);
197 194
198extern void __init omap2xxx_clockdomains_init(void); 195extern void __init omap242x_clockdomains_init(void);
196extern void __init omap243x_clockdomains_init(void);
199extern void __init omap3xxx_clockdomains_init(void); 197extern void __init omap3xxx_clockdomains_init(void);
200extern void __init omap44xx_clockdomains_init(void); 198extern void __init omap44xx_clockdomains_init(void);
201extern void _clkdm_add_autodeps(struct clockdomain *clkdm); 199extern void _clkdm_add_autodeps(struct clockdomain *clkdm);
@@ -205,4 +203,10 @@ extern struct clkdm_ops omap2_clkdm_operations;
205extern struct clkdm_ops omap3_clkdm_operations; 203extern struct clkdm_ops omap3_clkdm_operations;
206extern struct clkdm_ops omap4_clkdm_operations; 204extern struct clkdm_ops omap4_clkdm_operations;
207 205
206extern struct clkdm_dep gfx_24xx_wkdeps[];
207extern struct clkdm_dep dsp_24xx_wkdeps[];
208extern struct clockdomain wkup_common_clkdm;
209extern struct clockdomain prm_common_clkdm;
210extern struct clockdomain cm_common_clkdm;
211
208#endif 212#endif
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
index f740edb111f4..a0d68dbecfa3 100644
--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
@@ -52,8 +52,6 @@ static int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
52 u32 mask = 0; 52 u32 mask = 0;
53 53
54 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { 54 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
55 if (!omap_chip_is(cd->omap_chip))
56 continue;
57 if (!cd->clkdm) 55 if (!cd->clkdm)
58 continue; /* only happens if data is erroneous */ 56 continue; /* only happens if data is erroneous */
59 57
@@ -98,8 +96,6 @@ static int omap3_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
98 u32 mask = 0; 96 u32 mask = 0;
99 97
100 for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) { 98 for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) {
101 if (!omap_chip_is(cd->omap_chip))
102 continue;
103 if (!cd->clkdm) 99 if (!cd->clkdm)
104 continue; /* only happens if data is erroneous */ 100 continue; /* only happens if data is erroneous */
105 101
diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c
index b43706aa08bd..935c7f03dab9 100644
--- a/arch/arm/mach-omap2/clockdomain44xx.c
+++ b/arch/arm/mach-omap2/clockdomain44xx.c
@@ -52,8 +52,6 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)
52 u32 mask = 0; 52 u32 mask = 0;
53 53
54 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { 54 for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
55 if (!omap_chip_is(cd->omap_chip))
56 continue;
57 if (!cd->clkdm) 55 if (!cd->clkdm)
58 continue; /* only happens if data is erroneous */ 56 continue; /* only happens if data is erroneous */
59 57
diff --git a/arch/arm/mach-omap2/clockdomains2420_data.c b/arch/arm/mach-omap2/clockdomains2420_data.c
new file mode 100644
index 000000000000..0ab8e46d5b2b
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomains2420_data.c
@@ -0,0 +1,154 @@
1/*
2 * OMAP2420 clockdomains
3 *
4 * Copyright (C) 2008-2011 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Paul Walmsley, Jouni Högander
8 *
9 * This file contains clockdomains and clockdomain wakeup dependencies
10 * for OMAP2420 chips. Some notes:
11 *
12 * A useful validation rule for struct clockdomain: Any clockdomain
13 * referenced by a wkdep_srcs must have a dep_bit assigned. So
14 * wkdep_srcs are really just software-controllable dependencies.
15 * Non-software-controllable dependencies do exist, but they are not
16 * encoded below (yet).
17 *
18 * 24xx does not support programmable sleep dependencies (SLEEPDEP)
19 *
20 * The overly-specific dep_bit names are due to a bit name collision
21 * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift
22 * value are the same for all powerdomains: 2
23 *
24 * XXX should dep_bit be a mask, so we can test to see if it is 0 as a
25 * sanity check?
26 * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
27 */
28
29/*
30 * To-Do List
31 * -> Port the Sleep/Wakeup dependencies for the domains
32 * from the Power domain framework
33 */
34
35#include <linux/kernel.h>
36#include <linux/io.h>
37
38#include "clockdomain.h"
39#include "prm2xxx_3xxx.h"
40#include "cm2xxx_3xxx.h"
41#include "cm-regbits-24xx.h"
42#include "prm-regbits-24xx.h"
43
44/*
45 * Clockdomain dependencies for wkdeps
46 *
47 * XXX Hardware dependencies (e.g., dependencies that cannot be
48 * changed in software) are not included here yet, but should be.
49 */
50
51/* Wakeup dependency source arrays */
52
53/* 2420-specific possible wakeup dependencies */
54
55/* 2420 PM_WKDEP_MPU: CORE, DSP, WKUP */
56static struct clkdm_dep mpu_2420_wkdeps[] = {
57 { .clkdm_name = "core_l3_clkdm" },
58 { .clkdm_name = "core_l4_clkdm" },
59 { .clkdm_name = "dsp_clkdm" },
60 { .clkdm_name = "wkup_clkdm" },
61 { NULL },
62};
63
64/* 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP */
65static struct clkdm_dep core_2420_wkdeps[] = {
66 { .clkdm_name = "dsp_clkdm" },
67 { .clkdm_name = "gfx_clkdm" },
68 { .clkdm_name = "mpu_clkdm" },
69 { .clkdm_name = "wkup_clkdm" },
70 { NULL },
71};
72
73/*
74 * 2420-only clockdomains
75 */
76
77static struct clockdomain mpu_2420_clkdm = {
78 .name = "mpu_clkdm",
79 .pwrdm = { .name = "mpu_pwrdm" },
80 .flags = CLKDM_CAN_HWSUP,
81 .wkdep_srcs = mpu_2420_wkdeps,
82 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
83};
84
85static struct clockdomain iva1_2420_clkdm = {
86 .name = "iva1_clkdm",
87 .pwrdm = { .name = "dsp_pwrdm" },
88 .flags = CLKDM_CAN_HWSUP_SWSUP,
89 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
90 .wkdep_srcs = dsp_24xx_wkdeps,
91 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
92};
93
94static struct clockdomain dsp_2420_clkdm = {
95 .name = "dsp_clkdm",
96 .pwrdm = { .name = "dsp_pwrdm" },
97 .flags = CLKDM_CAN_HWSUP_SWSUP,
98 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
99};
100
101static struct clockdomain gfx_2420_clkdm = {
102 .name = "gfx_clkdm",
103 .pwrdm = { .name = "gfx_pwrdm" },
104 .flags = CLKDM_CAN_HWSUP_SWSUP,
105 .wkdep_srcs = gfx_24xx_wkdeps,
106 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
107};
108
109static struct clockdomain core_l3_2420_clkdm = {
110 .name = "core_l3_clkdm",
111 .pwrdm = { .name = "core_pwrdm" },
112 .flags = CLKDM_CAN_HWSUP,
113 .wkdep_srcs = core_2420_wkdeps,
114 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
115};
116
117static struct clockdomain core_l4_2420_clkdm = {
118 .name = "core_l4_clkdm",
119 .pwrdm = { .name = "core_pwrdm" },
120 .flags = CLKDM_CAN_HWSUP,
121 .wkdep_srcs = core_2420_wkdeps,
122 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
123};
124
125static struct clockdomain dss_2420_clkdm = {
126 .name = "dss_clkdm",
127 .pwrdm = { .name = "core_pwrdm" },
128 .flags = CLKDM_CAN_HWSUP,
129 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
130};
131
132static struct clockdomain *clockdomains_omap242x[] __initdata = {
133 &wkup_common_clkdm,
134 &cm_common_clkdm,
135 &prm_common_clkdm,
136 &mpu_2420_clkdm,
137 &iva1_2420_clkdm,
138 &dsp_2420_clkdm,
139 &gfx_2420_clkdm,
140 &core_l3_2420_clkdm,
141 &core_l4_2420_clkdm,
142 &dss_2420_clkdm,
143 NULL,
144};
145
146void __init omap242x_clockdomains_init(void)
147{
148 if (!cpu_is_omap242x())
149 return;
150
151 clkdm_register_platform_funcs(&omap2_clkdm_operations);
152 clkdm_register_clkdms(clockdomains_omap242x);
153 clkdm_complete_init();
154}
diff --git a/arch/arm/mach-omap2/clockdomains2430_data.c b/arch/arm/mach-omap2/clockdomains2430_data.c
new file mode 100644
index 000000000000..3645ed044890
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomains2430_data.c
@@ -0,0 +1,181 @@
1/*
2 * OMAP2xxx clockdomains
3 *
4 * Copyright (C) 2008-2009 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Paul Walmsley, Jouni Högander
8 *
9 * This file contains clockdomains and clockdomain wakeup dependencies
10 * for OMAP2xxx chips. Some notes:
11 *
12 * A useful validation rule for struct clockdomain: Any clockdomain
13 * referenced by a wkdep_srcs must have a dep_bit assigned. So
14 * wkdep_srcs are really just software-controllable dependencies.
15 * Non-software-controllable dependencies do exist, but they are not
16 * encoded below (yet).
17 *
18 * 24xx does not support programmable sleep dependencies (SLEEPDEP)
19 *
20 * The overly-specific dep_bit names are due to a bit name collision
21 * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift
22 * value are the same for all powerdomains: 2
23 *
24 * XXX should dep_bit be a mask, so we can test to see if it is 0 as a
25 * sanity check?
26 * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
27 */
28
29/*
30 * To-Do List
31 * -> Port the Sleep/Wakeup dependencies for the domains
32 * from the Power domain framework
33 */
34
35#include <linux/kernel.h>
36#include <linux/io.h>
37
38#include "clockdomain.h"
39#include "prm2xxx_3xxx.h"
40#include "cm2xxx_3xxx.h"
41#include "cm-regbits-24xx.h"
42#include "prm-regbits-24xx.h"
43
44/*
45 * Clockdomain dependencies for wkdeps
46 *
47 * XXX Hardware dependencies (e.g., dependencies that cannot be
48 * changed in software) are not included here yet, but should be.
49 */
50
51/* Wakeup dependency source arrays */
52
53/* 2430-specific possible wakeup dependencies */
54
55/* 2430 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP, MDM */
56static struct clkdm_dep core_2430_wkdeps[] = {
57 { .clkdm_name = "dsp_clkdm" },
58 { .clkdm_name = "gfx_clkdm" },
59 { .clkdm_name = "mpu_clkdm" },
60 { .clkdm_name = "wkup_clkdm" },
61 { .clkdm_name = "mdm_clkdm" },
62 { NULL },
63};
64
65/* 2430 PM_WKDEP_MPU: CORE, DSP, WKUP, MDM */
66static struct clkdm_dep mpu_2430_wkdeps[] = {
67 { .clkdm_name = "core_l3_clkdm" },
68 { .clkdm_name = "core_l4_clkdm" },
69 { .clkdm_name = "dsp_clkdm" },
70 { .clkdm_name = "wkup_clkdm" },
71 { .clkdm_name = "mdm_clkdm" },
72 { NULL },
73};
74
75/* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */
76static struct clkdm_dep mdm_2430_wkdeps[] = {
77 { .clkdm_name = "core_l3_clkdm" },
78 { .clkdm_name = "core_l4_clkdm" },
79 { .clkdm_name = "mpu_clkdm" },
80 { .clkdm_name = "wkup_clkdm" },
81 { NULL },
82};
83
84/*
85 * 2430-only clockdomains
86 */
87
88static struct clockdomain mpu_2430_clkdm = {
89 .name = "mpu_clkdm",
90 .pwrdm = { .name = "mpu_pwrdm" },
91 .flags = CLKDM_CAN_HWSUP_SWSUP,
92 .wkdep_srcs = mpu_2430_wkdeps,
93 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
94};
95
96/* Another case of bit name collisions between several registers: EN_MDM */
97static struct clockdomain mdm_clkdm = {
98 .name = "mdm_clkdm",
99 .pwrdm = { .name = "mdm_pwrdm" },
100 .flags = CLKDM_CAN_HWSUP_SWSUP,
101 .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT,
102 .wkdep_srcs = mdm_2430_wkdeps,
103 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
104};
105
106static struct clockdomain dsp_2430_clkdm = {
107 .name = "dsp_clkdm",
108 .pwrdm = { .name = "dsp_pwrdm" },
109 .flags = CLKDM_CAN_HWSUP_SWSUP,
110 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
111 .wkdep_srcs = dsp_24xx_wkdeps,
112 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
113};
114
115static struct clockdomain gfx_2430_clkdm = {
116 .name = "gfx_clkdm",
117 .pwrdm = { .name = "gfx_pwrdm" },
118 .flags = CLKDM_CAN_HWSUP_SWSUP,
119 .wkdep_srcs = gfx_24xx_wkdeps,
120 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
121};
122
123/*
124 * XXX add usecounting for clkdm dependencies, otherwise the presence
125 * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
126 * could cause trouble
127 */
128static struct clockdomain core_l3_2430_clkdm = {
129 .name = "core_l3_clkdm",
130 .pwrdm = { .name = "core_pwrdm" },
131 .flags = CLKDM_CAN_HWSUP,
132 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
133 .wkdep_srcs = core_2430_wkdeps,
134 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
135};
136
137/*
138 * XXX add usecounting for clkdm dependencies, otherwise the presence
139 * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
140 * could cause trouble
141 */
142static struct clockdomain core_l4_2430_clkdm = {
143 .name = "core_l4_clkdm",
144 .pwrdm = { .name = "core_pwrdm" },
145 .flags = CLKDM_CAN_HWSUP,
146 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
147 .wkdep_srcs = core_2430_wkdeps,
148 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
149};
150
151static struct clockdomain dss_2430_clkdm = {
152 .name = "dss_clkdm",
153 .pwrdm = { .name = "core_pwrdm" },
154 .flags = CLKDM_CAN_HWSUP,
155 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
156};
157
158static struct clockdomain *clockdomains_omap243x[] __initdata = {
159 &wkup_common_clkdm,
160 &cm_common_clkdm,
161 &prm_common_clkdm,
162 &mpu_2430_clkdm,
163 &mdm_clkdm,
164 &dsp_2430_clkdm,
165 &gfx_2430_clkdm,
166 &core_l3_2430_clkdm,
167 &core_l4_2430_clkdm,
168 &dss_2430_clkdm,
169 NULL,
170};
171
172void __init omap243x_clockdomains_init(void)
173{
174 if (!cpu_is_omap243x())
175 return;
176
177 clkdm_register_platform_funcs(&omap2_clkdm_operations);
178 clkdm_register_clkdms(clockdomains_omap243x);
179 clkdm_complete_init();
180}
181
diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
index 13bde95b6790..0a6a04897d89 100644
--- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
+++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2/3 clockdomains 2 * OMAP2/3 clockdomain common data
3 * 3 *
4 * Copyright (C) 2008-2009 Texas Instruments, Inc. 4 * Copyright (C) 2008-2011 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation 5 * Copyright (C) 2008-2010 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
@@ -51,374 +51,28 @@
51 * changed in software) are not included here yet, but should be. 51 * changed in software) are not included here yet, but should be.
52 */ 52 */
53 53
54/* OMAP2/3-common wakeup dependencies */
55
56/*
57 * 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP
58 * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE
59 * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE
60 * These can share data since they will never be present simultaneously
61 * on the same device.
62 */
63static struct clkdm_dep gfx_sgx_wkdeps[] = {
64 {
65 .clkdm_name = "core_l3_clkdm",
66 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
67 },
68 {
69 .clkdm_name = "core_l4_clkdm",
70 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
71 },
72 {
73 .clkdm_name = "iva2_clkdm",
74 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
75 },
76 {
77 .clkdm_name = "mpu_clkdm",
78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
79 CHIP_IS_OMAP3430)
80 },
81 {
82 .clkdm_name = "wkup_clkdm",
83 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
84 CHIP_IS_OMAP3430)
85 },
86 { NULL },
87};
88
89
90/* 24XX-specific possible dependencies */
91
92#ifdef CONFIG_ARCH_OMAP2
93
94/* Wakeup dependency source arrays */ 54/* Wakeup dependency source arrays */
95 55
96/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */ 56/* 2xxx-specific possible dependencies */
97static struct clkdm_dep dsp_24xx_wkdeps[] = {
98 {
99 .clkdm_name = "core_l3_clkdm",
100 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
101 },
102 {
103 .clkdm_name = "core_l4_clkdm",
104 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
105 },
106 {
107 .clkdm_name = "mpu_clkdm",
108 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
109 },
110 {
111 .clkdm_name = "wkup_clkdm",
112 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
113 },
114 { NULL },
115};
116
117/*
118 * 2420 PM_WKDEP_MPU: CORE, DSP, WKUP
119 * 2430 adds MDM
120 */
121static struct clkdm_dep mpu_24xx_wkdeps[] = {
122 {
123 .clkdm_name = "core_l3_clkdm",
124 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
125 },
126 {
127 .clkdm_name = "core_l4_clkdm",
128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
129 },
130 {
131 .clkdm_name = "dsp_clkdm",
132 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
133 },
134 {
135 .clkdm_name = "wkup_clkdm",
136 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
137 },
138 {
139 .clkdm_name = "mdm_clkdm",
140 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
141 },
142 { NULL },
143};
144
145/*
146 * 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP
147 * 2430 adds MDM
148 */
149static struct clkdm_dep core_24xx_wkdeps[] = {
150 {
151 .clkdm_name = "dsp_clkdm",
152 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
153 },
154 {
155 .clkdm_name = "gfx_clkdm",
156 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
157 },
158 {
159 .clkdm_name = "mpu_clkdm",
160 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
161 },
162 {
163 .clkdm_name = "wkup_clkdm",
164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
165 },
166 {
167 .clkdm_name = "mdm_clkdm",
168 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
169 },
170 { NULL },
171};
172
173#endif /* CONFIG_ARCH_OMAP2 */
174
175/* 2430-specific possible wakeup dependencies */
176 57
177#ifdef CONFIG_SOC_OMAP2430 58/* 2xxx PM_WKDEP_GFX: CORE, MPU, WKUP */
178 59struct clkdm_dep gfx_24xx_wkdeps[] = {
179/* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */ 60 { .clkdm_name = "core_l3_clkdm" },
180static struct clkdm_dep mdm_2430_wkdeps[] = { 61 { .clkdm_name = "core_l4_clkdm" },
181 { 62 { .clkdm_name = "mpu_clkdm" },
182 .clkdm_name = "core_l3_clkdm", 63 { .clkdm_name = "wkup_clkdm" },
183 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
184 },
185 {
186 .clkdm_name = "core_l4_clkdm",
187 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
188 },
189 {
190 .clkdm_name = "mpu_clkdm",
191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
192 },
193 {
194 .clkdm_name = "wkup_clkdm",
195 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
196 },
197 { NULL },
198};
199
200#endif /* CONFIG_SOC_OMAP2430 */
201
202
203/* OMAP3-specific possible dependencies */
204
205#ifdef CONFIG_ARCH_OMAP3
206
207/* 3430: PM_WKDEP_PER: CORE, IVA2, MPU, WKUP */
208static struct clkdm_dep per_wkdeps[] = {
209 {
210 .clkdm_name = "core_l3_clkdm",
211 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
212 },
213 {
214 .clkdm_name = "core_l4_clkdm",
215 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
216 },
217 {
218 .clkdm_name = "iva2_clkdm",
219 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
220 },
221 {
222 .clkdm_name = "mpu_clkdm",
223 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
224 },
225 {
226 .clkdm_name = "wkup_clkdm",
227 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
228 },
229 { NULL },
230};
231
232/* 3430ES2: PM_WKDEP_USBHOST: CORE, IVA2, MPU, WKUP */
233static struct clkdm_dep usbhost_wkdeps[] = {
234 {
235 .clkdm_name = "core_l3_clkdm",
236 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
237 },
238 {
239 .clkdm_name = "core_l4_clkdm",
240 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
241 },
242 {
243 .clkdm_name = "iva2_clkdm",
244 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
245 },
246 {
247 .clkdm_name = "mpu_clkdm",
248 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
249 },
250 {
251 .clkdm_name = "wkup_clkdm",
252 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
253 },
254 { NULL }, 64 { NULL },
255}; 65};
256 66
257/* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER */ 67/* 2xxx PM_WKDEP_DSP: CORE, MPU, WKUP */
258static struct clkdm_dep mpu_3xxx_wkdeps[] = { 68struct clkdm_dep dsp_24xx_wkdeps[] = {
259 { 69 { .clkdm_name = "core_l3_clkdm" },
260 .clkdm_name = "core_l3_clkdm", 70 { .clkdm_name = "core_l4_clkdm" },
261 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) 71 { .clkdm_name = "mpu_clkdm" },
262 }, 72 { .clkdm_name = "wkup_clkdm" },
263 {
264 .clkdm_name = "core_l4_clkdm",
265 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
266 },
267 {
268 .clkdm_name = "iva2_clkdm",
269 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
270 },
271 {
272 .clkdm_name = "dss_clkdm",
273 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
274 },
275 {
276 .clkdm_name = "per_clkdm",
277 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
278 },
279 { NULL }, 73 { NULL },
280}; 74};
281 75
282/* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER */
283static struct clkdm_dep iva2_wkdeps[] = {
284 {
285 .clkdm_name = "core_l3_clkdm",
286 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
287 },
288 {
289 .clkdm_name = "core_l4_clkdm",
290 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
291 },
292 {
293 .clkdm_name = "mpu_clkdm",
294 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
295 },
296 {
297 .clkdm_name = "wkup_clkdm",
298 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
299 },
300 {
301 .clkdm_name = "dss_clkdm",
302 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
303 },
304 {
305 .clkdm_name = "per_clkdm",
306 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
307 },
308 { NULL },
309};
310
311
312/* 3430 PM_WKDEP_CAM: IVA2, MPU, WKUP */
313static struct clkdm_dep cam_wkdeps[] = {
314 {
315 .clkdm_name = "iva2_clkdm",
316 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
317 },
318 {
319 .clkdm_name = "mpu_clkdm",
320 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
321 },
322 {
323 .clkdm_name = "wkup_clkdm",
324 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
325 },
326 { NULL },
327};
328
329/* 3430 PM_WKDEP_DSS: IVA2, MPU, WKUP */
330static struct clkdm_dep dss_wkdeps[] = {
331 {
332 .clkdm_name = "iva2_clkdm",
333 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
334 },
335 {
336 .clkdm_name = "mpu_clkdm",
337 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
338 },
339 {
340 .clkdm_name = "wkup_clkdm",
341 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
342 },
343 { NULL },
344};
345
346/* 3430: PM_WKDEP_NEON: MPU */
347static struct clkdm_dep neon_wkdeps[] = {
348 {
349 .clkdm_name = "mpu_clkdm",
350 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
351 },
352 { NULL },
353};
354
355
356/* Sleep dependency source arrays for OMAP3-specific clkdms */
357
358/* 3430: CM_SLEEPDEP_DSS: MPU, IVA */
359static struct clkdm_dep dss_sleepdeps[] = {
360 {
361 .clkdm_name = "mpu_clkdm",
362 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
363 },
364 {
365 .clkdm_name = "iva2_clkdm",
366 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
367 },
368 { NULL },
369};
370
371/* 3430: CM_SLEEPDEP_PER: MPU, IVA */
372static struct clkdm_dep per_sleepdeps[] = {
373 {
374 .clkdm_name = "mpu_clkdm",
375 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
376 },
377 {
378 .clkdm_name = "iva2_clkdm",
379 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
380 },
381 { NULL },
382};
383
384/* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA */
385static struct clkdm_dep usbhost_sleepdeps[] = {
386 {
387 .clkdm_name = "mpu_clkdm",
388 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
389 },
390 {
391 .clkdm_name = "iva2_clkdm",
392 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
393 },
394 { NULL },
395};
396
397/* 3430: CM_SLEEPDEP_CAM: MPU */
398static struct clkdm_dep cam_sleepdeps[] = {
399 {
400 .clkdm_name = "mpu_clkdm",
401 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
402 },
403 { NULL },
404};
405
406/*
407 * 3430ES1: CM_SLEEPDEP_GFX: MPU
408 * 3430ES2: CM_SLEEPDEP_SGX: MPU
409 * These can share data since they will never be present simultaneously
410 * on the same device.
411 */
412static struct clkdm_dep gfx_sgx_sleepdeps[] = {
413 {
414 .clkdm_name = "mpu_clkdm",
415 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
416 },
417 { NULL },
418};
419
420#endif /* CONFIG_ARCH_OMAP3 */
421
422 76
423/* 77/*
424 * OMAP2/3-common clockdomains 78 * OMAP2/3-common clockdomains
@@ -430,439 +84,18 @@ static struct clkdm_dep gfx_sgx_sleepdeps[] = {
430 */ 84 */
431 85
432/* This is an implicit clockdomain - it is never defined as such in TRM */ 86/* This is an implicit clockdomain - it is never defined as such in TRM */
433static struct clockdomain wkup_clkdm = { 87struct clockdomain wkup_common_clkdm = {
434 .name = "wkup_clkdm", 88 .name = "wkup_clkdm",
435 .pwrdm = { .name = "wkup_pwrdm" }, 89 .pwrdm = { .name = "wkup_pwrdm" },
436 .dep_bit = OMAP_EN_WKUP_SHIFT, 90 .dep_bit = OMAP_EN_WKUP_SHIFT,
437 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
438}; 91};
439 92
440static struct clockdomain prm_clkdm = { 93struct clockdomain prm_common_clkdm = {
441 .name = "prm_clkdm", 94 .name = "prm_clkdm",
442 .pwrdm = { .name = "wkup_pwrdm" }, 95 .pwrdm = { .name = "wkup_pwrdm" },
443 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
444}; 96};
445 97
446static struct clockdomain cm_clkdm = { 98struct clockdomain cm_common_clkdm = {
447 .name = "cm_clkdm", 99 .name = "cm_clkdm",
448 .pwrdm = { .name = "core_pwrdm" }, 100 .pwrdm = { .name = "core_pwrdm" },
449 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
450}; 101};
451
452/*
453 * 2420-only clockdomains
454 */
455
456#if defined(CONFIG_SOC_OMAP2420)
457
458static struct clockdomain mpu_2420_clkdm = {
459 .name = "mpu_clkdm",
460 .pwrdm = { .name = "mpu_pwrdm" },
461 .flags = CLKDM_CAN_HWSUP,
462 .wkdep_srcs = mpu_24xx_wkdeps,
463 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
464 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
465};
466
467static struct clockdomain iva1_2420_clkdm = {
468 .name = "iva1_clkdm",
469 .pwrdm = { .name = "dsp_pwrdm" },
470 .flags = CLKDM_CAN_HWSUP_SWSUP,
471 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
472 .wkdep_srcs = dsp_24xx_wkdeps,
473 .clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
474 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
475};
476
477static struct clockdomain dsp_2420_clkdm = {
478 .name = "dsp_clkdm",
479 .pwrdm = { .name = "dsp_pwrdm" },
480 .flags = CLKDM_CAN_HWSUP_SWSUP,
481 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
482 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
483};
484
485static struct clockdomain gfx_2420_clkdm = {
486 .name = "gfx_clkdm",
487 .pwrdm = { .name = "gfx_pwrdm" },
488 .flags = CLKDM_CAN_HWSUP_SWSUP,
489 .wkdep_srcs = gfx_sgx_wkdeps,
490 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
491 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
492};
493
494static struct clockdomain core_l3_2420_clkdm = {
495 .name = "core_l3_clkdm",
496 .pwrdm = { .name = "core_pwrdm" },
497 .flags = CLKDM_CAN_HWSUP,
498 .wkdep_srcs = core_24xx_wkdeps,
499 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
500 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
501};
502
503static struct clockdomain core_l4_2420_clkdm = {
504 .name = "core_l4_clkdm",
505 .pwrdm = { .name = "core_pwrdm" },
506 .flags = CLKDM_CAN_HWSUP,
507 .wkdep_srcs = core_24xx_wkdeps,
508 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
509 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
510};
511
512static struct clockdomain dss_2420_clkdm = {
513 .name = "dss_clkdm",
514 .pwrdm = { .name = "core_pwrdm" },
515 .flags = CLKDM_CAN_HWSUP,
516 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
517 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
518};
519
520#endif /* CONFIG_SOC_OMAP2420 */
521
522
523/*
524 * 2430-only clockdomains
525 */
526
527#if defined(CONFIG_SOC_OMAP2430)
528
529static struct clockdomain mpu_2430_clkdm = {
530 .name = "mpu_clkdm",
531 .pwrdm = { .name = "mpu_pwrdm" },
532 .flags = CLKDM_CAN_HWSUP_SWSUP,
533 .wkdep_srcs = mpu_24xx_wkdeps,
534 .clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
535 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
536};
537
538/* Another case of bit name collisions between several registers: EN_MDM */
539static struct clockdomain mdm_clkdm = {
540 .name = "mdm_clkdm",
541 .pwrdm = { .name = "mdm_pwrdm" },
542 .flags = CLKDM_CAN_HWSUP_SWSUP,
543 .dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT,
544 .wkdep_srcs = mdm_2430_wkdeps,
545 .clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
546 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
547};
548
549static struct clockdomain dsp_2430_clkdm = {
550 .name = "dsp_clkdm",
551 .pwrdm = { .name = "dsp_pwrdm" },
552 .flags = CLKDM_CAN_HWSUP_SWSUP,
553 .dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
554 .wkdep_srcs = dsp_24xx_wkdeps,
555 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
556 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
557};
558
559static struct clockdomain gfx_2430_clkdm = {
560 .name = "gfx_clkdm",
561 .pwrdm = { .name = "gfx_pwrdm" },
562 .flags = CLKDM_CAN_HWSUP_SWSUP,
563 .wkdep_srcs = gfx_sgx_wkdeps,
564 .clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
565 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
566};
567
568/*
569 * XXX add usecounting for clkdm dependencies, otherwise the presence
570 * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
571 * could cause trouble
572 */
573static struct clockdomain core_l3_2430_clkdm = {
574 .name = "core_l3_clkdm",
575 .pwrdm = { .name = "core_pwrdm" },
576 .flags = CLKDM_CAN_HWSUP,
577 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
578 .wkdep_srcs = core_24xx_wkdeps,
579 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
580 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
581};
582
583/*
584 * XXX add usecounting for clkdm dependencies, otherwise the presence
585 * of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
586 * could cause trouble
587 */
588static struct clockdomain core_l4_2430_clkdm = {
589 .name = "core_l4_clkdm",
590 .pwrdm = { .name = "core_pwrdm" },
591 .flags = CLKDM_CAN_HWSUP,
592 .dep_bit = OMAP24XX_EN_CORE_SHIFT,
593 .wkdep_srcs = core_24xx_wkdeps,
594 .clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
595 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
596};
597
598static struct clockdomain dss_2430_clkdm = {
599 .name = "dss_clkdm",
600 .pwrdm = { .name = "core_pwrdm" },
601 .flags = CLKDM_CAN_HWSUP,
602 .clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
603 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
604};
605
606#endif /* CONFIG_SOC_OMAP2430 */
607
608
609/*
610 * OMAP3 clockdomains
611 */
612
613#if defined(CONFIG_ARCH_OMAP3)
614
615static struct clockdomain mpu_3xxx_clkdm = {
616 .name = "mpu_clkdm",
617 .pwrdm = { .name = "mpu_pwrdm" },
618 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
619 .dep_bit = OMAP3430_EN_MPU_SHIFT,
620 .wkdep_srcs = mpu_3xxx_wkdeps,
621 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
622 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
623};
624
625static struct clockdomain neon_clkdm = {
626 .name = "neon_clkdm",
627 .pwrdm = { .name = "neon_pwrdm" },
628 .flags = CLKDM_CAN_HWSUP_SWSUP,
629 .wkdep_srcs = neon_wkdeps,
630 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
631 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
632};
633
634static struct clockdomain iva2_clkdm = {
635 .name = "iva2_clkdm",
636 .pwrdm = { .name = "iva2_pwrdm" },
637 .flags = CLKDM_CAN_HWSUP_SWSUP,
638 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
639 .wkdep_srcs = iva2_wkdeps,
640 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
641 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
642};
643
644static struct clockdomain gfx_3430es1_clkdm = {
645 .name = "gfx_clkdm",
646 .pwrdm = { .name = "gfx_pwrdm" },
647 .flags = CLKDM_CAN_HWSUP_SWSUP,
648 .wkdep_srcs = gfx_sgx_wkdeps,
649 .sleepdep_srcs = gfx_sgx_sleepdeps,
650 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
651 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
652};
653
654static struct clockdomain sgx_clkdm = {
655 .name = "sgx_clkdm",
656 .pwrdm = { .name = "sgx_pwrdm" },
657 .flags = CLKDM_CAN_HWSUP_SWSUP,
658 .wkdep_srcs = gfx_sgx_wkdeps,
659 .sleepdep_srcs = gfx_sgx_sleepdeps,
660 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
661 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
662};
663
664/*
665 * The die-to-die clockdomain was documented in the 34xx ES1 TRM, but
666 * then that information was removed from the 34xx ES2+ TRM. It is
667 * unclear whether the core is still there, but the clockdomain logic
668 * is there, and must be programmed to an appropriate state if the
669 * CORE clockdomain is to become inactive.
670 */
671static struct clockdomain d2d_clkdm = {
672 .name = "d2d_clkdm",
673 .pwrdm = { .name = "core_pwrdm" },
674 .flags = CLKDM_CAN_HWSUP_SWSUP,
675 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
676 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
677};
678
679/*
680 * XXX add usecounting for clkdm dependencies, otherwise the presence
681 * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
682 * could cause trouble
683 */
684static struct clockdomain core_l3_3xxx_clkdm = {
685 .name = "core_l3_clkdm",
686 .pwrdm = { .name = "core_pwrdm" },
687 .flags = CLKDM_CAN_HWSUP,
688 .dep_bit = OMAP3430_EN_CORE_SHIFT,
689 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
690 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
691};
692
693/*
694 * XXX add usecounting for clkdm dependencies, otherwise the presence
695 * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
696 * could cause trouble
697 */
698static struct clockdomain core_l4_3xxx_clkdm = {
699 .name = "core_l4_clkdm",
700 .pwrdm = { .name = "core_pwrdm" },
701 .flags = CLKDM_CAN_HWSUP,
702 .dep_bit = OMAP3430_EN_CORE_SHIFT,
703 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
704 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
705};
706
707/* Another case of bit name collisions between several registers: EN_DSS */
708static struct clockdomain dss_3xxx_clkdm = {
709 .name = "dss_clkdm",
710 .pwrdm = { .name = "dss_pwrdm" },
711 .flags = CLKDM_CAN_HWSUP_SWSUP,
712 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT,
713 .wkdep_srcs = dss_wkdeps,
714 .sleepdep_srcs = dss_sleepdeps,
715 .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK,
716 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
717};
718
719static struct clockdomain cam_clkdm = {
720 .name = "cam_clkdm",
721 .pwrdm = { .name = "cam_pwrdm" },
722 .flags = CLKDM_CAN_HWSUP_SWSUP,
723 .wkdep_srcs = cam_wkdeps,
724 .sleepdep_srcs = cam_sleepdeps,
725 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
726 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
727};
728
729static struct clockdomain usbhost_clkdm = {
730 .name = "usbhost_clkdm",
731 .pwrdm = { .name = "usbhost_pwrdm" },
732 .flags = CLKDM_CAN_HWSUP_SWSUP,
733 .wkdep_srcs = usbhost_wkdeps,
734 .sleepdep_srcs = usbhost_sleepdeps,
735 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
736 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
737};
738
739static struct clockdomain per_clkdm = {
740 .name = "per_clkdm",
741 .pwrdm = { .name = "per_pwrdm" },
742 .flags = CLKDM_CAN_HWSUP_SWSUP,
743 .dep_bit = OMAP3430_EN_PER_SHIFT,
744 .wkdep_srcs = per_wkdeps,
745 .sleepdep_srcs = per_sleepdeps,
746 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK,
747 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
748};
749
750/*
751 * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is
752 * switched of even if sdti is in use
753 */
754static struct clockdomain emu_clkdm = {
755 .name = "emu_clkdm",
756 .pwrdm = { .name = "emu_pwrdm" },
757 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP,
758 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
759 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
760};
761
762static struct clockdomain dpll1_clkdm = {
763 .name = "dpll1_clkdm",
764 .pwrdm = { .name = "dpll1_pwrdm" },
765 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
766};
767
768static struct clockdomain dpll2_clkdm = {
769 .name = "dpll2_clkdm",
770 .pwrdm = { .name = "dpll2_pwrdm" },
771 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
772};
773
774static struct clockdomain dpll3_clkdm = {
775 .name = "dpll3_clkdm",
776 .pwrdm = { .name = "dpll3_pwrdm" },
777 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
778};
779
780static struct clockdomain dpll4_clkdm = {
781 .name = "dpll4_clkdm",
782 .pwrdm = { .name = "dpll4_pwrdm" },
783 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
784};
785
786static struct clockdomain dpll5_clkdm = {
787 .name = "dpll5_clkdm",
788 .pwrdm = { .name = "dpll5_pwrdm" },
789 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
790};
791
792#endif /* CONFIG_ARCH_OMAP3 */
793
794/*
795 * Clockdomain hwsup dependencies (OMAP3 only)
796 */
797
798static struct clkdm_autodep clkdm_autodeps[] = {
799 {
800 .clkdm = { .name = "mpu_clkdm" },
801 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
802 },
803 {
804 .clkdm = { .name = "iva2_clkdm" },
805 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
806 },
807 {
808 .clkdm = { .name = NULL },
809 }
810};
811
812static struct clockdomain *clockdomains_omap2[] __initdata = {
813 &wkup_clkdm,
814 &cm_clkdm,
815 &prm_clkdm,
816
817#ifdef CONFIG_SOC_OMAP2420
818 &mpu_2420_clkdm,
819 &iva1_2420_clkdm,
820 &dsp_2420_clkdm,
821 &gfx_2420_clkdm,
822 &core_l3_2420_clkdm,
823 &core_l4_2420_clkdm,
824 &dss_2420_clkdm,
825#endif
826
827#ifdef CONFIG_SOC_OMAP2430
828 &mpu_2430_clkdm,
829 &mdm_clkdm,
830 &dsp_2430_clkdm,
831 &gfx_2430_clkdm,
832 &core_l3_2430_clkdm,
833 &core_l4_2430_clkdm,
834 &dss_2430_clkdm,
835#endif
836
837#ifdef CONFIG_ARCH_OMAP3
838 &mpu_3xxx_clkdm,
839 &neon_clkdm,
840 &iva2_clkdm,
841 &gfx_3430es1_clkdm,
842 &sgx_clkdm,
843 &d2d_clkdm,
844 &core_l3_3xxx_clkdm,
845 &core_l4_3xxx_clkdm,
846 &dss_3xxx_clkdm,
847 &cam_clkdm,
848 &usbhost_clkdm,
849 &per_clkdm,
850 &emu_clkdm,
851 &dpll1_clkdm,
852 &dpll2_clkdm,
853 &dpll3_clkdm,
854 &dpll4_clkdm,
855 &dpll5_clkdm,
856#endif
857 NULL,
858};
859
860void __init omap2xxx_clockdomains_init(void)
861{
862 clkdm_init(clockdomains_omap2, clkdm_autodeps, &omap2_clkdm_operations);
863}
864
865void __init omap3xxx_clockdomains_init(void)
866{
867 clkdm_init(clockdomains_omap2, clkdm_autodeps, &omap3_clkdm_operations);
868}
diff --git a/arch/arm/mach-omap2/clockdomains3xxx_data.c b/arch/arm/mach-omap2/clockdomains3xxx_data.c
new file mode 100644
index 000000000000..b84e138d99c8
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomains3xxx_data.c
@@ -0,0 +1,398 @@
1/*
2 * OMAP3xxx clockdomains
3 *
4 * Copyright (C) 2008-2011 Texas Instruments, Inc.
5 * Copyright (C) 2008-2010 Nokia Corporation
6 *
7 * Paul Walmsley, Jouni Högander
8 *
9 * This file contains clockdomains and clockdomain wakeup/sleep
10 * dependencies for the OMAP3xxx chips. Some notes:
11 *
12 * A useful validation rule for struct clockdomain: Any clockdomain
13 * referenced by a wkdep_srcs or sleepdep_srcs array must have a
14 * dep_bit assigned. So wkdep_srcs/sleepdep_srcs are really just
15 * software-controllable dependencies. Non-software-controllable
16 * dependencies do exist, but they are not encoded below (yet).
17 *
18 * The overly-specific dep_bit names are due to a bit name collision
19 * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift
20 * value are the same for all powerdomains: 2
21 *
22 * XXX should dep_bit be a mask, so we can test to see if it is 0 as a
23 * sanity check?
24 * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
25 */
26
27/*
28 * To-Do List
29 * -> Port the Sleep/Wakeup dependencies for the domains
30 * from the Power domain framework
31 */
32
33#include <linux/kernel.h>
34#include <linux/io.h>
35
36#include "clockdomain.h"
37#include "prm2xxx_3xxx.h"
38#include "cm2xxx_3xxx.h"
39#include "cm-regbits-34xx.h"
40#include "prm-regbits-34xx.h"
41
42/*
43 * Clockdomain dependencies for wkdeps/sleepdeps
44 *
45 * XXX Hardware dependencies (e.g., dependencies that cannot be
46 * changed in software) are not included here yet, but should be.
47 */
48
49/* OMAP3-specific possible dependencies */
50
51/*
52 * 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE
53 * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE
54 */
55static struct clkdm_dep gfx_sgx_3xxx_wkdeps[] = {
56 { .clkdm_name = "iva2_clkdm", },
57 { .clkdm_name = "mpu_clkdm", },
58 { .clkdm_name = "wkup_clkdm", },
59 { NULL },
60};
61
62/* 3430: PM_WKDEP_PER: CORE, IVA2, MPU, WKUP */
63static struct clkdm_dep per_wkdeps[] = {
64 { .clkdm_name = "core_l3_clkdm" },
65 { .clkdm_name = "core_l4_clkdm" },
66 { .clkdm_name = "iva2_clkdm" },
67 { .clkdm_name = "mpu_clkdm" },
68 { .clkdm_name = "wkup_clkdm" },
69 { NULL },
70};
71
72/* 3430ES2: PM_WKDEP_USBHOST: CORE, IVA2, MPU, WKUP */
73static struct clkdm_dep usbhost_wkdeps[] = {
74 { .clkdm_name = "core_l3_clkdm" },
75 { .clkdm_name = "core_l4_clkdm" },
76 { .clkdm_name = "iva2_clkdm" },
77 { .clkdm_name = "mpu_clkdm" },
78 { .clkdm_name = "wkup_clkdm" },
79 { NULL },
80};
81
82/* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER */
83static struct clkdm_dep mpu_3xxx_wkdeps[] = {
84 { .clkdm_name = "core_l3_clkdm" },
85 { .clkdm_name = "core_l4_clkdm" },
86 { .clkdm_name = "iva2_clkdm" },
87 { .clkdm_name = "dss_clkdm" },
88 { .clkdm_name = "per_clkdm" },
89 { NULL },
90};
91
92/* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER */
93static struct clkdm_dep iva2_wkdeps[] = {
94 { .clkdm_name = "core_l3_clkdm" },
95 { .clkdm_name = "core_l4_clkdm" },
96 { .clkdm_name = "mpu_clkdm" },
97 { .clkdm_name = "wkup_clkdm" },
98 { .clkdm_name = "dss_clkdm" },
99 { .clkdm_name = "per_clkdm" },
100 { NULL },
101};
102
103/* 3430 PM_WKDEP_CAM: IVA2, MPU, WKUP */
104static struct clkdm_dep cam_wkdeps[] = {
105 { .clkdm_name = "iva2_clkdm" },
106 { .clkdm_name = "mpu_clkdm" },
107 { .clkdm_name = "wkup_clkdm" },
108 { NULL },
109};
110
111/* 3430 PM_WKDEP_DSS: IVA2, MPU, WKUP */
112static struct clkdm_dep dss_wkdeps[] = {
113 { .clkdm_name = "iva2_clkdm" },
114 { .clkdm_name = "mpu_clkdm" },
115 { .clkdm_name = "wkup_clkdm" },
116 { NULL },
117};
118
119/* 3430: PM_WKDEP_NEON: MPU */
120static struct clkdm_dep neon_wkdeps[] = {
121 { .clkdm_name = "mpu_clkdm" },
122 { NULL },
123};
124
125/* Sleep dependency source arrays for OMAP3-specific clkdms */
126
127/* 3430: CM_SLEEPDEP_DSS: MPU, IVA */
128static struct clkdm_dep dss_sleepdeps[] = {
129 { .clkdm_name = "mpu_clkdm" },
130 { .clkdm_name = "iva2_clkdm" },
131 { NULL },
132};
133
134/* 3430: CM_SLEEPDEP_PER: MPU, IVA */
135static struct clkdm_dep per_sleepdeps[] = {
136 { .clkdm_name = "mpu_clkdm" },
137 { .clkdm_name = "iva2_clkdm" },
138 { NULL },
139};
140
141/* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA */
142static struct clkdm_dep usbhost_sleepdeps[] = {
143 { .clkdm_name = "mpu_clkdm" },
144 { .clkdm_name = "iva2_clkdm" },
145 { NULL },
146};
147
148/* 3430: CM_SLEEPDEP_CAM: MPU */
149static struct clkdm_dep cam_sleepdeps[] = {
150 { .clkdm_name = "mpu_clkdm" },
151 { NULL },
152};
153
154/*
155 * 3430ES1: CM_SLEEPDEP_GFX: MPU
156 * 3430ES2: CM_SLEEPDEP_SGX: MPU
157 * These can share data since they will never be present simultaneously
158 * on the same device.
159 */
160static struct clkdm_dep gfx_sgx_sleepdeps[] = {
161 { .clkdm_name = "mpu_clkdm" },
162 { NULL },
163};
164
165/*
166 * OMAP3 clockdomains
167 */
168
169static struct clockdomain mpu_3xxx_clkdm = {
170 .name = "mpu_clkdm",
171 .pwrdm = { .name = "mpu_pwrdm" },
172 .flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
173 .dep_bit = OMAP3430_EN_MPU_SHIFT,
174 .wkdep_srcs = mpu_3xxx_wkdeps,
175 .clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
176};
177
178static struct clockdomain neon_clkdm = {
179 .name = "neon_clkdm",
180 .pwrdm = { .name = "neon_pwrdm" },
181 .flags = CLKDM_CAN_HWSUP_SWSUP,
182 .wkdep_srcs = neon_wkdeps,
183 .clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
184};
185
186static struct clockdomain iva2_clkdm = {
187 .name = "iva2_clkdm",
188 .pwrdm = { .name = "iva2_pwrdm" },
189 .flags = CLKDM_CAN_HWSUP_SWSUP,
190 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
191 .wkdep_srcs = iva2_wkdeps,
192 .clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
193};
194
195static struct clockdomain gfx_3430es1_clkdm = {
196 .name = "gfx_clkdm",
197 .pwrdm = { .name = "gfx_pwrdm" },
198 .flags = CLKDM_CAN_HWSUP_SWSUP,
199 .wkdep_srcs = gfx_sgx_3xxx_wkdeps,
200 .sleepdep_srcs = gfx_sgx_sleepdeps,
201 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
202};
203
204static struct clockdomain sgx_clkdm = {
205 .name = "sgx_clkdm",
206 .pwrdm = { .name = "sgx_pwrdm" },
207 .flags = CLKDM_CAN_HWSUP_SWSUP,
208 .wkdep_srcs = gfx_sgx_3xxx_wkdeps,
209 .sleepdep_srcs = gfx_sgx_sleepdeps,
210 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
211};
212
213/*
214 * The die-to-die clockdomain was documented in the 34xx ES1 TRM, but
215 * then that information was removed from the 34xx ES2+ TRM. It is
216 * unclear whether the core is still there, but the clockdomain logic
217 * is there, and must be programmed to an appropriate state if the
218 * CORE clockdomain is to become inactive.
219 */
220static struct clockdomain d2d_clkdm = {
221 .name = "d2d_clkdm",
222 .pwrdm = { .name = "core_pwrdm" },
223 .flags = CLKDM_CAN_HWSUP_SWSUP,
224 .clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
225};
226
227/*
228 * XXX add usecounting for clkdm dependencies, otherwise the presence
229 * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
230 * could cause trouble
231 */
232static struct clockdomain core_l3_3xxx_clkdm = {
233 .name = "core_l3_clkdm",
234 .pwrdm = { .name = "core_pwrdm" },
235 .flags = CLKDM_CAN_HWSUP,
236 .dep_bit = OMAP3430_EN_CORE_SHIFT,
237 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
238};
239
240/*
241 * XXX add usecounting for clkdm dependencies, otherwise the presence
242 * of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
243 * could cause trouble
244 */
245static struct clockdomain core_l4_3xxx_clkdm = {
246 .name = "core_l4_clkdm",
247 .pwrdm = { .name = "core_pwrdm" },
248 .flags = CLKDM_CAN_HWSUP,
249 .dep_bit = OMAP3430_EN_CORE_SHIFT,
250 .clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
251};
252
253/* Another case of bit name collisions between several registers: EN_DSS */
254static struct clockdomain dss_3xxx_clkdm = {
255 .name = "dss_clkdm",
256 .pwrdm = { .name = "dss_pwrdm" },
257 .flags = CLKDM_CAN_HWSUP_SWSUP,
258 .dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT,
259 .wkdep_srcs = dss_wkdeps,
260 .sleepdep_srcs = dss_sleepdeps,
261 .clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK,
262};
263
264static struct clockdomain cam_clkdm = {
265 .name = "cam_clkdm",
266 .pwrdm = { .name = "cam_pwrdm" },
267 .flags = CLKDM_CAN_HWSUP_SWSUP,
268 .wkdep_srcs = cam_wkdeps,
269 .sleepdep_srcs = cam_sleepdeps,
270 .clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
271};
272
273static struct clockdomain usbhost_clkdm = {
274 .name = "usbhost_clkdm",
275 .pwrdm = { .name = "usbhost_pwrdm" },
276 .flags = CLKDM_CAN_HWSUP_SWSUP,
277 .wkdep_srcs = usbhost_wkdeps,
278 .sleepdep_srcs = usbhost_sleepdeps,
279 .clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
280};
281
282static struct clockdomain per_clkdm = {
283 .name = "per_clkdm",
284 .pwrdm = { .name = "per_pwrdm" },
285 .flags = CLKDM_CAN_HWSUP_SWSUP,
286 .dep_bit = OMAP3430_EN_PER_SHIFT,
287 .wkdep_srcs = per_wkdeps,
288 .sleepdep_srcs = per_sleepdeps,
289 .clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK,
290};
291
292/*
293 * Disable hw supervised mode for emu_clkdm, because emu_pwrdm is
294 * switched of even if sdti is in use
295 */
296static struct clockdomain emu_clkdm = {
297 .name = "emu_clkdm",
298 .pwrdm = { .name = "emu_pwrdm" },
299 .flags = /* CLKDM_CAN_ENABLE_AUTO | */CLKDM_CAN_SWSUP,
300 .clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
301};
302
303static struct clockdomain dpll1_clkdm = {
304 .name = "dpll1_clkdm",
305 .pwrdm = { .name = "dpll1_pwrdm" },
306};
307
308static struct clockdomain dpll2_clkdm = {
309 .name = "dpll2_clkdm",
310 .pwrdm = { .name = "dpll2_pwrdm" },
311};
312
313static struct clockdomain dpll3_clkdm = {
314 .name = "dpll3_clkdm",
315 .pwrdm = { .name = "dpll3_pwrdm" },
316};
317
318static struct clockdomain dpll4_clkdm = {
319 .name = "dpll4_clkdm",
320 .pwrdm = { .name = "dpll4_pwrdm" },
321};
322
323static struct clockdomain dpll5_clkdm = {
324 .name = "dpll5_clkdm",
325 .pwrdm = { .name = "dpll5_pwrdm" },
326};
327
328/*
329 * Clockdomain hwsup dependencies
330 */
331
332static struct clkdm_autodep clkdm_autodeps[] = {
333 {
334 .clkdm = { .name = "mpu_clkdm" },
335 },
336 {
337 .clkdm = { .name = "iva2_clkdm" },
338 },
339 {
340 .clkdm = { .name = NULL },
341 }
342};
343
344/*
345 *
346 */
347
348static struct clockdomain *clockdomains_omap3430_common[] __initdata = {
349 &wkup_common_clkdm,
350 &cm_common_clkdm,
351 &prm_common_clkdm,
352 &mpu_3xxx_clkdm,
353 &neon_clkdm,
354 &iva2_clkdm,
355 &d2d_clkdm,
356 &core_l3_3xxx_clkdm,
357 &core_l4_3xxx_clkdm,
358 &dss_3xxx_clkdm,
359 &cam_clkdm,
360 &per_clkdm,
361 &emu_clkdm,
362 &dpll1_clkdm,
363 &dpll2_clkdm,
364 &dpll3_clkdm,
365 &dpll4_clkdm,
366 NULL
367};
368
369static struct clockdomain *clockdomains_omap3430es1[] __initdata = {
370 &gfx_3430es1_clkdm,
371 NULL,
372};
373
374static struct clockdomain *clockdomains_omap3430es2plus[] __initdata = {
375 &sgx_clkdm,
376 &dpll5_clkdm,
377 &usbhost_clkdm,
378 NULL,
379};
380
381void __init omap3xxx_clockdomains_init(void)
382{
383 struct clockdomain **sc;
384
385 if (!cpu_is_omap34xx())
386 return;
387
388 clkdm_register_platform_funcs(&omap3_clkdm_operations);
389 clkdm_register_clkdms(clockdomains_omap3430_common);
390
391 sc = (omap_rev() == OMAP3430_REV_ES1_0) ? clockdomains_omap3430es1 :
392 clockdomains_omap3430es2plus;
393
394 clkdm_register_clkdms(sc);
395
396 clkdm_register_autodeps(clkdm_autodeps);
397 clkdm_complete_init();
398}
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c
index dccc651fa0d0..9299ac291d28 100644
--- a/arch/arm/mach-omap2/clockdomains44xx_data.c
+++ b/arch/arm/mach-omap2/clockdomains44xx_data.c
@@ -34,350 +34,122 @@
34/* Static Dependencies for OMAP4 Clock Domains */ 34/* Static Dependencies for OMAP4 Clock Domains */
35 35
36static struct clkdm_dep d2d_wkup_sleep_deps[] = { 36static struct clkdm_dep d2d_wkup_sleep_deps[] = {
37 { 37 { .clkdm_name = "abe_clkdm" },
38 .clkdm_name = "abe_clkdm", 38 { .clkdm_name = "ivahd_clkdm" },
39 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 39 { .clkdm_name = "l3_1_clkdm" },
40 }, 40 { .clkdm_name = "l3_2_clkdm" },
41 { 41 { .clkdm_name = "l3_emif_clkdm" },
42 .clkdm_name = "ivahd_clkdm", 42 { .clkdm_name = "l3_init_clkdm" },
43 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 43 { .clkdm_name = "l4_cfg_clkdm" },
44 }, 44 { .clkdm_name = "l4_per_clkdm" },
45 {
46 .clkdm_name = "l3_1_clkdm",
47 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
48 },
49 {
50 .clkdm_name = "l3_2_clkdm",
51 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
52 },
53 {
54 .clkdm_name = "l3_emif_clkdm",
55 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
56 },
57 {
58 .clkdm_name = "l3_init_clkdm",
59 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
60 },
61 {
62 .clkdm_name = "l4_cfg_clkdm",
63 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
64 },
65 {
66 .clkdm_name = "l4_per_clkdm",
67 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
68 },
69 { NULL }, 45 { NULL },
70}; 46};
71 47
72static struct clkdm_dep ducati_wkup_sleep_deps[] = { 48static struct clkdm_dep ducati_wkup_sleep_deps[] = {
73 { 49 { .clkdm_name = "abe_clkdm" },
74 .clkdm_name = "abe_clkdm", 50 { .clkdm_name = "ivahd_clkdm" },
75 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 51 { .clkdm_name = "l3_1_clkdm" },
76 }, 52 { .clkdm_name = "l3_2_clkdm" },
77 { 53 { .clkdm_name = "l3_dss_clkdm" },
78 .clkdm_name = "ivahd_clkdm", 54 { .clkdm_name = "l3_emif_clkdm" },
79 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 55 { .clkdm_name = "l3_gfx_clkdm" },
80 }, 56 { .clkdm_name = "l3_init_clkdm" },
81 { 57 { .clkdm_name = "l4_cfg_clkdm" },
82 .clkdm_name = "l3_1_clkdm", 58 { .clkdm_name = "l4_per_clkdm" },
83 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 59 { .clkdm_name = "l4_secure_clkdm" },
84 }, 60 { .clkdm_name = "l4_wkup_clkdm" },
85 { 61 { .clkdm_name = "tesla_clkdm" },
86 .clkdm_name = "l3_2_clkdm",
87 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
88 },
89 {
90 .clkdm_name = "l3_dss_clkdm",
91 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
92 },
93 {
94 .clkdm_name = "l3_emif_clkdm",
95 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
96 },
97 {
98 .clkdm_name = "l3_gfx_clkdm",
99 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
100 },
101 {
102 .clkdm_name = "l3_init_clkdm",
103 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
104 },
105 {
106 .clkdm_name = "l4_cfg_clkdm",
107 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
108 },
109 {
110 .clkdm_name = "l4_per_clkdm",
111 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
112 },
113 {
114 .clkdm_name = "l4_secure_clkdm",
115 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
116 },
117 {
118 .clkdm_name = "l4_wkup_clkdm",
119 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
120 },
121 {
122 .clkdm_name = "tesla_clkdm",
123 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
124 },
125 { NULL }, 62 { NULL },
126}; 63};
127 64
128static struct clkdm_dep iss_wkup_sleep_deps[] = { 65static struct clkdm_dep iss_wkup_sleep_deps[] = {
129 { 66 { .clkdm_name = "ivahd_clkdm" },
130 .clkdm_name = "ivahd_clkdm", 67 { .clkdm_name = "l3_1_clkdm" },
131 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 68 { .clkdm_name = "l3_emif_clkdm" },
132 },
133 {
134 .clkdm_name = "l3_1_clkdm",
135 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
136 },
137 {
138 .clkdm_name = "l3_emif_clkdm",
139 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
140 },
141 { NULL }, 69 { NULL },
142}; 70};
143 71
144static struct clkdm_dep ivahd_wkup_sleep_deps[] = { 72static struct clkdm_dep ivahd_wkup_sleep_deps[] = {
145 { 73 { .clkdm_name = "l3_1_clkdm" },
146 .clkdm_name = "l3_1_clkdm", 74 { .clkdm_name = "l3_emif_clkdm" },
147 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
148 },
149 {
150 .clkdm_name = "l3_emif_clkdm",
151 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
152 },
153 { NULL }, 75 { NULL },
154}; 76};
155 77
156static struct clkdm_dep l3_dma_wkup_sleep_deps[] = { 78static struct clkdm_dep l3_dma_wkup_sleep_deps[] = {
157 { 79 { .clkdm_name = "abe_clkdm" },
158 .clkdm_name = "abe_clkdm", 80 { .clkdm_name = "ducati_clkdm" },
159 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 81 { .clkdm_name = "ivahd_clkdm" },
160 }, 82 { .clkdm_name = "l3_1_clkdm" },
161 { 83 { .clkdm_name = "l3_dss_clkdm" },
162 .clkdm_name = "ducati_clkdm", 84 { .clkdm_name = "l3_emif_clkdm" },
163 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 85 { .clkdm_name = "l3_init_clkdm" },
164 }, 86 { .clkdm_name = "l4_cfg_clkdm" },
165 { 87 { .clkdm_name = "l4_per_clkdm" },
166 .clkdm_name = "ivahd_clkdm", 88 { .clkdm_name = "l4_secure_clkdm" },
167 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 89 { .clkdm_name = "l4_wkup_clkdm" },
168 },
169 {
170 .clkdm_name = "l3_1_clkdm",
171 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
172 },
173 {
174 .clkdm_name = "l3_dss_clkdm",
175 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
176 },
177 {
178 .clkdm_name = "l3_emif_clkdm",
179 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
180 },
181 {
182 .clkdm_name = "l3_init_clkdm",
183 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
184 },
185 {
186 .clkdm_name = "l4_cfg_clkdm",
187 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
188 },
189 {
190 .clkdm_name = "l4_per_clkdm",
191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
192 },
193 {
194 .clkdm_name = "l4_secure_clkdm",
195 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
196 },
197 {
198 .clkdm_name = "l4_wkup_clkdm",
199 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
200 },
201 { NULL }, 90 { NULL },
202}; 91};
203 92
204static struct clkdm_dep l3_dss_wkup_sleep_deps[] = { 93static struct clkdm_dep l3_dss_wkup_sleep_deps[] = {
205 { 94 { .clkdm_name = "ivahd_clkdm" },
206 .clkdm_name = "ivahd_clkdm", 95 { .clkdm_name = "l3_2_clkdm" },
207 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 96 { .clkdm_name = "l3_emif_clkdm" },
208 },
209 {
210 .clkdm_name = "l3_2_clkdm",
211 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
212 },
213 {
214 .clkdm_name = "l3_emif_clkdm",
215 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
216 },
217 { NULL }, 97 { NULL },
218}; 98};
219 99
220static struct clkdm_dep l3_gfx_wkup_sleep_deps[] = { 100static struct clkdm_dep l3_gfx_wkup_sleep_deps[] = {
221 { 101 { .clkdm_name = "ivahd_clkdm" },
222 .clkdm_name = "ivahd_clkdm", 102 { .clkdm_name = "l3_1_clkdm" },
223 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 103 { .clkdm_name = "l3_emif_clkdm" },
224 },
225 {
226 .clkdm_name = "l3_1_clkdm",
227 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
228 },
229 {
230 .clkdm_name = "l3_emif_clkdm",
231 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
232 },
233 { NULL }, 104 { NULL },
234}; 105};
235 106
236static struct clkdm_dep l3_init_wkup_sleep_deps[] = { 107static struct clkdm_dep l3_init_wkup_sleep_deps[] = {
237 { 108 { .clkdm_name = "abe_clkdm" },
238 .clkdm_name = "abe_clkdm", 109 { .clkdm_name = "ivahd_clkdm" },
239 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 110 { .clkdm_name = "l3_emif_clkdm" },
240 }, 111 { .clkdm_name = "l4_cfg_clkdm" },
241 { 112 { .clkdm_name = "l4_per_clkdm" },
242 .clkdm_name = "ivahd_clkdm", 113 { .clkdm_name = "l4_secure_clkdm" },
243 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 114 { .clkdm_name = "l4_wkup_clkdm" },
244 },
245 {
246 .clkdm_name = "l3_emif_clkdm",
247 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
248 },
249 {
250 .clkdm_name = "l4_cfg_clkdm",
251 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
252 },
253 {
254 .clkdm_name = "l4_per_clkdm",
255 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
256 },
257 {
258 .clkdm_name = "l4_secure_clkdm",
259 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
260 },
261 {
262 .clkdm_name = "l4_wkup_clkdm",
263 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
264 },
265 { NULL }, 115 { NULL },
266}; 116};
267 117
268static struct clkdm_dep l4_secure_wkup_sleep_deps[] = { 118static struct clkdm_dep l4_secure_wkup_sleep_deps[] = {
269 { 119 { .clkdm_name = "l3_1_clkdm" },
270 .clkdm_name = "l3_1_clkdm", 120 { .clkdm_name = "l3_emif_clkdm" },
271 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 121 { .clkdm_name = "l4_per_clkdm" },
272 },
273 {
274 .clkdm_name = "l3_emif_clkdm",
275 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
276 },
277 {
278 .clkdm_name = "l4_per_clkdm",
279 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
280 },
281 { NULL }, 122 { NULL },
282}; 123};
283 124
284static struct clkdm_dep mpu_wkup_sleep_deps[] = { 125static struct clkdm_dep mpu_wkup_sleep_deps[] = {
285 { 126 { .clkdm_name = "abe_clkdm" },
286 .clkdm_name = "abe_clkdm", 127 { .clkdm_name = "ducati_clkdm" },
287 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 128 { .clkdm_name = "ivahd_clkdm" },
288 }, 129 { .clkdm_name = "l3_1_clkdm" },
289 { 130 { .clkdm_name = "l3_2_clkdm" },
290 .clkdm_name = "ducati_clkdm", 131 { .clkdm_name = "l3_dss_clkdm" },
291 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 132 { .clkdm_name = "l3_emif_clkdm" },
292 }, 133 { .clkdm_name = "l3_gfx_clkdm" },
293 { 134 { .clkdm_name = "l3_init_clkdm" },
294 .clkdm_name = "ivahd_clkdm", 135 { .clkdm_name = "l4_cfg_clkdm" },
295 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 136 { .clkdm_name = "l4_per_clkdm" },
296 }, 137 { .clkdm_name = "l4_secure_clkdm" },
297 { 138 { .clkdm_name = "l4_wkup_clkdm" },
298 .clkdm_name = "l3_1_clkdm", 139 { .clkdm_name = "tesla_clkdm" },
299 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
300 },
301 {
302 .clkdm_name = "l3_2_clkdm",
303 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
304 },
305 {
306 .clkdm_name = "l3_dss_clkdm",
307 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
308 },
309 {
310 .clkdm_name = "l3_emif_clkdm",
311 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
312 },
313 {
314 .clkdm_name = "l3_gfx_clkdm",
315 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
316 },
317 {
318 .clkdm_name = "l3_init_clkdm",
319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
320 },
321 {
322 .clkdm_name = "l4_cfg_clkdm",
323 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
324 },
325 {
326 .clkdm_name = "l4_per_clkdm",
327 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
328 },
329 {
330 .clkdm_name = "l4_secure_clkdm",
331 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
332 },
333 {
334 .clkdm_name = "l4_wkup_clkdm",
335 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
336 },
337 {
338 .clkdm_name = "tesla_clkdm",
339 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
340 },
341 { NULL }, 140 { NULL },
342}; 141};
343 142
344static struct clkdm_dep tesla_wkup_sleep_deps[] = { 143static struct clkdm_dep tesla_wkup_sleep_deps[] = {
345 { 144 { .clkdm_name = "abe_clkdm" },
346 .clkdm_name = "abe_clkdm", 145 { .clkdm_name = "ivahd_clkdm" },
347 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 146 { .clkdm_name = "l3_1_clkdm" },
348 }, 147 { .clkdm_name = "l3_2_clkdm" },
349 { 148 { .clkdm_name = "l3_emif_clkdm" },
350 .clkdm_name = "ivahd_clkdm", 149 { .clkdm_name = "l3_init_clkdm" },
351 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430) 150 { .clkdm_name = "l4_cfg_clkdm" },
352 }, 151 { .clkdm_name = "l4_per_clkdm" },
353 { 152 { .clkdm_name = "l4_wkup_clkdm" },
354 .clkdm_name = "l3_1_clkdm",
355 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
356 },
357 {
358 .clkdm_name = "l3_2_clkdm",
359 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
360 },
361 {
362 .clkdm_name = "l3_emif_clkdm",
363 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
364 },
365 {
366 .clkdm_name = "l3_init_clkdm",
367 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
368 },
369 {
370 .clkdm_name = "l4_cfg_clkdm",
371 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
372 },
373 {
374 .clkdm_name = "l4_per_clkdm",
375 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
376 },
377 {
378 .clkdm_name = "l4_wkup_clkdm",
379 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430)
380 },
381 { NULL }, 153 { NULL },
382}; 154};
383 155
@@ -388,7 +160,6 @@ static struct clockdomain l4_cefuse_44xx_clkdm = {
388 .cm_inst = OMAP4430_CM2_CEFUSE_INST, 160 .cm_inst = OMAP4430_CM2_CEFUSE_INST,
389 .clkdm_offs = OMAP4430_CM2_CEFUSE_CEFUSE_CDOFFS, 161 .clkdm_offs = OMAP4430_CM2_CEFUSE_CEFUSE_CDOFFS,
390 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 162 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
391 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
392}; 163};
393 164
394static struct clockdomain l4_cfg_44xx_clkdm = { 165static struct clockdomain l4_cfg_44xx_clkdm = {
@@ -399,7 +170,6 @@ static struct clockdomain l4_cfg_44xx_clkdm = {
399 .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS, 170 .clkdm_offs = OMAP4430_CM2_CORE_L4CFG_CDOFFS,
400 .dep_bit = OMAP4430_L4CFG_STATDEP_SHIFT, 171 .dep_bit = OMAP4430_L4CFG_STATDEP_SHIFT,
401 .flags = CLKDM_CAN_HWSUP, 172 .flags = CLKDM_CAN_HWSUP,
402 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
403}; 173};
404 174
405static struct clockdomain tesla_44xx_clkdm = { 175static struct clockdomain tesla_44xx_clkdm = {
@@ -412,7 +182,6 @@ static struct clockdomain tesla_44xx_clkdm = {
412 .wkdep_srcs = tesla_wkup_sleep_deps, 182 .wkdep_srcs = tesla_wkup_sleep_deps,
413 .sleepdep_srcs = tesla_wkup_sleep_deps, 183 .sleepdep_srcs = tesla_wkup_sleep_deps,
414 .flags = CLKDM_CAN_HWSUP_SWSUP, 184 .flags = CLKDM_CAN_HWSUP_SWSUP,
415 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
416}; 185};
417 186
418static struct clockdomain l3_gfx_44xx_clkdm = { 187static struct clockdomain l3_gfx_44xx_clkdm = {
@@ -425,7 +194,6 @@ static struct clockdomain l3_gfx_44xx_clkdm = {
425 .wkdep_srcs = l3_gfx_wkup_sleep_deps, 194 .wkdep_srcs = l3_gfx_wkup_sleep_deps,
426 .sleepdep_srcs = l3_gfx_wkup_sleep_deps, 195 .sleepdep_srcs = l3_gfx_wkup_sleep_deps,
427 .flags = CLKDM_CAN_HWSUP_SWSUP, 196 .flags = CLKDM_CAN_HWSUP_SWSUP,
428 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
429}; 197};
430 198
431static struct clockdomain ivahd_44xx_clkdm = { 199static struct clockdomain ivahd_44xx_clkdm = {
@@ -438,7 +206,6 @@ static struct clockdomain ivahd_44xx_clkdm = {
438 .wkdep_srcs = ivahd_wkup_sleep_deps, 206 .wkdep_srcs = ivahd_wkup_sleep_deps,
439 .sleepdep_srcs = ivahd_wkup_sleep_deps, 207 .sleepdep_srcs = ivahd_wkup_sleep_deps,
440 .flags = CLKDM_CAN_HWSUP_SWSUP, 208 .flags = CLKDM_CAN_HWSUP_SWSUP,
441 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
442}; 209};
443 210
444static struct clockdomain l4_secure_44xx_clkdm = { 211static struct clockdomain l4_secure_44xx_clkdm = {
@@ -451,7 +218,6 @@ static struct clockdomain l4_secure_44xx_clkdm = {
451 .wkdep_srcs = l4_secure_wkup_sleep_deps, 218 .wkdep_srcs = l4_secure_wkup_sleep_deps,
452 .sleepdep_srcs = l4_secure_wkup_sleep_deps, 219 .sleepdep_srcs = l4_secure_wkup_sleep_deps,
453 .flags = CLKDM_CAN_HWSUP_SWSUP, 220 .flags = CLKDM_CAN_HWSUP_SWSUP,
454 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
455}; 221};
456 222
457static struct clockdomain l4_per_44xx_clkdm = { 223static struct clockdomain l4_per_44xx_clkdm = {
@@ -462,7 +228,6 @@ static struct clockdomain l4_per_44xx_clkdm = {
462 .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS, 228 .clkdm_offs = OMAP4430_CM2_L4PER_L4PER_CDOFFS,
463 .dep_bit = OMAP4430_L4PER_STATDEP_SHIFT, 229 .dep_bit = OMAP4430_L4PER_STATDEP_SHIFT,
464 .flags = CLKDM_CAN_HWSUP_SWSUP, 230 .flags = CLKDM_CAN_HWSUP_SWSUP,
465 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
466}; 231};
467 232
468static struct clockdomain abe_44xx_clkdm = { 233static struct clockdomain abe_44xx_clkdm = {
@@ -473,7 +238,6 @@ static struct clockdomain abe_44xx_clkdm = {
473 .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS, 238 .clkdm_offs = OMAP4430_CM1_ABE_ABE_CDOFFS,
474 .dep_bit = OMAP4430_ABE_STATDEP_SHIFT, 239 .dep_bit = OMAP4430_ABE_STATDEP_SHIFT,
475 .flags = CLKDM_CAN_HWSUP_SWSUP, 240 .flags = CLKDM_CAN_HWSUP_SWSUP,
476 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
477}; 241};
478 242
479static struct clockdomain l3_instr_44xx_clkdm = { 243static struct clockdomain l3_instr_44xx_clkdm = {
@@ -482,7 +246,6 @@ static struct clockdomain l3_instr_44xx_clkdm = {
482 .prcm_partition = OMAP4430_CM2_PARTITION, 246 .prcm_partition = OMAP4430_CM2_PARTITION,
483 .cm_inst = OMAP4430_CM2_CORE_INST, 247 .cm_inst = OMAP4430_CM2_CORE_INST,
484 .clkdm_offs = OMAP4430_CM2_CORE_L3INSTR_CDOFFS, 248 .clkdm_offs = OMAP4430_CM2_CORE_L3INSTR_CDOFFS,
485 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
486}; 249};
487 250
488static struct clockdomain l3_init_44xx_clkdm = { 251static struct clockdomain l3_init_44xx_clkdm = {
@@ -495,7 +258,6 @@ static struct clockdomain l3_init_44xx_clkdm = {
495 .wkdep_srcs = l3_init_wkup_sleep_deps, 258 .wkdep_srcs = l3_init_wkup_sleep_deps,
496 .sleepdep_srcs = l3_init_wkup_sleep_deps, 259 .sleepdep_srcs = l3_init_wkup_sleep_deps,
497 .flags = CLKDM_CAN_HWSUP_SWSUP, 260 .flags = CLKDM_CAN_HWSUP_SWSUP,
498 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
499}; 261};
500 262
501static struct clockdomain d2d_44xx_clkdm = { 263static struct clockdomain d2d_44xx_clkdm = {
@@ -507,7 +269,6 @@ static struct clockdomain d2d_44xx_clkdm = {
507 .wkdep_srcs = d2d_wkup_sleep_deps, 269 .wkdep_srcs = d2d_wkup_sleep_deps,
508 .sleepdep_srcs = d2d_wkup_sleep_deps, 270 .sleepdep_srcs = d2d_wkup_sleep_deps,
509 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 271 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
510 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
511}; 272};
512 273
513static struct clockdomain mpu0_44xx_clkdm = { 274static struct clockdomain mpu0_44xx_clkdm = {
@@ -517,7 +278,6 @@ static struct clockdomain mpu0_44xx_clkdm = {
517 .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST, 278 .cm_inst = OMAP4430_PRCM_MPU_CPU0_INST,
518 .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS, 279 .clkdm_offs = OMAP4430_PRCM_MPU_CPU0_CPU0_CDOFFS,
519 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 280 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
520 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
521}; 281};
522 282
523static struct clockdomain mpu1_44xx_clkdm = { 283static struct clockdomain mpu1_44xx_clkdm = {
@@ -527,7 +287,6 @@ static struct clockdomain mpu1_44xx_clkdm = {
527 .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST, 287 .cm_inst = OMAP4430_PRCM_MPU_CPU1_INST,
528 .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS, 288 .clkdm_offs = OMAP4430_PRCM_MPU_CPU1_CPU1_CDOFFS,
529 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 289 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
530 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
531}; 290};
532 291
533static struct clockdomain l3_emif_44xx_clkdm = { 292static struct clockdomain l3_emif_44xx_clkdm = {
@@ -538,7 +297,6 @@ static struct clockdomain l3_emif_44xx_clkdm = {
538 .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS, 297 .clkdm_offs = OMAP4430_CM2_CORE_MEMIF_CDOFFS,
539 .dep_bit = OMAP4430_MEMIF_STATDEP_SHIFT, 298 .dep_bit = OMAP4430_MEMIF_STATDEP_SHIFT,
540 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 299 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
541 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
542}; 300};
543 301
544static struct clockdomain l4_ao_44xx_clkdm = { 302static struct clockdomain l4_ao_44xx_clkdm = {
@@ -548,7 +306,6 @@ static struct clockdomain l4_ao_44xx_clkdm = {
548 .cm_inst = OMAP4430_CM2_ALWAYS_ON_INST, 306 .cm_inst = OMAP4430_CM2_ALWAYS_ON_INST,
549 .clkdm_offs = OMAP4430_CM2_ALWAYS_ON_ALWON_CDOFFS, 307 .clkdm_offs = OMAP4430_CM2_ALWAYS_ON_ALWON_CDOFFS,
550 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 308 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
551 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
552}; 309};
553 310
554static struct clockdomain ducati_44xx_clkdm = { 311static struct clockdomain ducati_44xx_clkdm = {
@@ -561,7 +318,6 @@ static struct clockdomain ducati_44xx_clkdm = {
561 .wkdep_srcs = ducati_wkup_sleep_deps, 318 .wkdep_srcs = ducati_wkup_sleep_deps,
562 .sleepdep_srcs = ducati_wkup_sleep_deps, 319 .sleepdep_srcs = ducati_wkup_sleep_deps,
563 .flags = CLKDM_CAN_HWSUP_SWSUP, 320 .flags = CLKDM_CAN_HWSUP_SWSUP,
564 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
565}; 321};
566 322
567static struct clockdomain mpu_44xx_clkdm = { 323static struct clockdomain mpu_44xx_clkdm = {
@@ -573,7 +329,6 @@ static struct clockdomain mpu_44xx_clkdm = {
573 .wkdep_srcs = mpu_wkup_sleep_deps, 329 .wkdep_srcs = mpu_wkup_sleep_deps,
574 .sleepdep_srcs = mpu_wkup_sleep_deps, 330 .sleepdep_srcs = mpu_wkup_sleep_deps,
575 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 331 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
576 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
577}; 332};
578 333
579static struct clockdomain l3_2_44xx_clkdm = { 334static struct clockdomain l3_2_44xx_clkdm = {
@@ -584,7 +339,6 @@ static struct clockdomain l3_2_44xx_clkdm = {
584 .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS, 339 .clkdm_offs = OMAP4430_CM2_CORE_L3_2_CDOFFS,
585 .dep_bit = OMAP4430_L3_2_STATDEP_SHIFT, 340 .dep_bit = OMAP4430_L3_2_STATDEP_SHIFT,
586 .flags = CLKDM_CAN_HWSUP, 341 .flags = CLKDM_CAN_HWSUP,
587 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
588}; 342};
589 343
590static struct clockdomain l3_1_44xx_clkdm = { 344static struct clockdomain l3_1_44xx_clkdm = {
@@ -595,7 +349,6 @@ static struct clockdomain l3_1_44xx_clkdm = {
595 .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS, 349 .clkdm_offs = OMAP4430_CM2_CORE_L3_1_CDOFFS,
596 .dep_bit = OMAP4430_L3_1_STATDEP_SHIFT, 350 .dep_bit = OMAP4430_L3_1_STATDEP_SHIFT,
597 .flags = CLKDM_CAN_HWSUP, 351 .flags = CLKDM_CAN_HWSUP,
598 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
599}; 352};
600 353
601static struct clockdomain iss_44xx_clkdm = { 354static struct clockdomain iss_44xx_clkdm = {
@@ -607,7 +360,6 @@ static struct clockdomain iss_44xx_clkdm = {
607 .wkdep_srcs = iss_wkup_sleep_deps, 360 .wkdep_srcs = iss_wkup_sleep_deps,
608 .sleepdep_srcs = iss_wkup_sleep_deps, 361 .sleepdep_srcs = iss_wkup_sleep_deps,
609 .flags = CLKDM_CAN_HWSUP_SWSUP, 362 .flags = CLKDM_CAN_HWSUP_SWSUP,
610 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
611}; 363};
612 364
613static struct clockdomain l3_dss_44xx_clkdm = { 365static struct clockdomain l3_dss_44xx_clkdm = {
@@ -620,7 +372,6 @@ static struct clockdomain l3_dss_44xx_clkdm = {
620 .wkdep_srcs = l3_dss_wkup_sleep_deps, 372 .wkdep_srcs = l3_dss_wkup_sleep_deps,
621 .sleepdep_srcs = l3_dss_wkup_sleep_deps, 373 .sleepdep_srcs = l3_dss_wkup_sleep_deps,
622 .flags = CLKDM_CAN_HWSUP_SWSUP, 374 .flags = CLKDM_CAN_HWSUP_SWSUP,
623 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
624}; 375};
625 376
626static struct clockdomain l4_wkup_44xx_clkdm = { 377static struct clockdomain l4_wkup_44xx_clkdm = {
@@ -631,7 +382,6 @@ static struct clockdomain l4_wkup_44xx_clkdm = {
631 .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS, 382 .clkdm_offs = OMAP4430_PRM_WKUP_CM_WKUP_CDOFFS,
632 .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT, 383 .dep_bit = OMAP4430_L4WKUP_STATDEP_SHIFT,
633 .flags = CLKDM_CAN_HWSUP, 384 .flags = CLKDM_CAN_HWSUP,
634 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
635}; 385};
636 386
637static struct clockdomain emu_sys_44xx_clkdm = { 387static struct clockdomain emu_sys_44xx_clkdm = {
@@ -641,7 +391,6 @@ static struct clockdomain emu_sys_44xx_clkdm = {
641 .cm_inst = OMAP4430_PRM_EMU_CM_INST, 391 .cm_inst = OMAP4430_PRM_EMU_CM_INST,
642 .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, 392 .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS,
643 .flags = CLKDM_CAN_HWSUP, 393 .flags = CLKDM_CAN_HWSUP,
644 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
645}; 394};
646 395
647static struct clockdomain l3_dma_44xx_clkdm = { 396static struct clockdomain l3_dma_44xx_clkdm = {
@@ -653,7 +402,6 @@ static struct clockdomain l3_dma_44xx_clkdm = {
653 .wkdep_srcs = l3_dma_wkup_sleep_deps, 402 .wkdep_srcs = l3_dma_wkup_sleep_deps,
654 .sleepdep_srcs = l3_dma_wkup_sleep_deps, 403 .sleepdep_srcs = l3_dma_wkup_sleep_deps,
655 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP, 404 .flags = CLKDM_CAN_FORCE_WAKEUP | CLKDM_CAN_HWSUP,
656 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
657}; 405};
658 406
659/* As clockdomains are added or removed above, this list must also be changed */ 407/* As clockdomains are added or removed above, this list must also be changed */
@@ -685,7 +433,10 @@ static struct clockdomain *clockdomains_omap44xx[] __initdata = {
685 NULL 433 NULL
686}; 434};
687 435
436
688void __init omap44xx_clockdomains_init(void) 437void __init omap44xx_clockdomains_init(void)
689{ 438{
690 clkdm_init(clockdomains_omap44xx, NULL, &omap4_clkdm_operations); 439 clkdm_register_platform_funcs(&omap4_clkdm_operations);
440 clkdm_register_clkdms(clockdomains_omap44xx);
441 clkdm_complete_init();
691} 442}
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 37efb8696927..d27daf921c7e 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -28,7 +28,6 @@
28 28
29#include "control.h" 29#include "control.h"
30 30
31static struct omap_chip_id omap_chip;
32static unsigned int omap_revision; 31static unsigned int omap_revision;
33 32
34u32 omap_features; 33u32 omap_features;
@@ -39,19 +38,6 @@ unsigned int omap_rev(void)
39} 38}
40EXPORT_SYMBOL(omap_rev); 39EXPORT_SYMBOL(omap_rev);
41 40
42/**
43 * omap_chip_is - test whether currently running OMAP matches a chip type
44 * @oc: omap_chip_t to test against
45 *
46 * Test whether the currently-running OMAP chip matches the supplied
47 * chip type 'oc'. Returns 1 upon a match; 0 upon failure.
48 */
49int omap_chip_is(struct omap_chip_id oci)
50{
51 return (oci.oc & omap_chip.oc) ? 1 : 0;
52}
53EXPORT_SYMBOL(omap_chip_is);
54
55int omap_type(void) 41int omap_type(void)
56{ 42{
57 u32 val = 0; 43 u32 val = 0;
@@ -242,14 +228,12 @@ static void __init ti816x_check_features(void)
242 omap_features = OMAP3_HAS_NEON; 228 omap_features = OMAP3_HAS_NEON;
243} 229}
244 230
245static void __init omap3_check_revision(void) 231static void __init omap3_check_revision(const char **cpu_rev)
246{ 232{
247 u32 cpuid, idcode; 233 u32 cpuid, idcode;
248 u16 hawkeye; 234 u16 hawkeye;
249 u8 rev; 235 u8 rev;
250 236
251 omap_chip.oc = CHIP_IS_OMAP3430;
252
253 /* 237 /*
254 * We cannot access revision registers on ES1.0. 238 * We cannot access revision registers on ES1.0.
255 * If the processor type is Cortex-A8 and the revision is 0x0 239 * If the processor type is Cortex-A8 and the revision is 0x0
@@ -258,7 +242,7 @@ static void __init omap3_check_revision(void)
258 cpuid = read_cpuid(CPUID_ID); 242 cpuid = read_cpuid(CPUID_ID);
259 if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { 243 if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) {
260 omap_revision = OMAP3430_REV_ES1_0; 244 omap_revision = OMAP3430_REV_ES1_0;
261 omap_chip.oc |= CHIP_IS_OMAP3430ES1; 245 *cpu_rev = "1.0";
262 return; 246 return;
263 } 247 }
264 248
@@ -279,77 +263,85 @@ static void __init omap3_check_revision(void)
279 case 0: /* Take care of early samples */ 263 case 0: /* Take care of early samples */
280 case 1: 264 case 1:
281 omap_revision = OMAP3430_REV_ES2_0; 265 omap_revision = OMAP3430_REV_ES2_0;
282 omap_chip.oc |= CHIP_IS_OMAP3430ES2; 266 *cpu_rev = "2.0";
283 break; 267 break;
284 case 2: 268 case 2:
285 omap_revision = OMAP3430_REV_ES2_1; 269 omap_revision = OMAP3430_REV_ES2_1;
286 omap_chip.oc |= CHIP_IS_OMAP3430ES2; 270 *cpu_rev = "2.1";
287 break; 271 break;
288 case 3: 272 case 3:
289 omap_revision = OMAP3430_REV_ES3_0; 273 omap_revision = OMAP3430_REV_ES3_0;
290 omap_chip.oc |= CHIP_IS_OMAP3430ES3_0; 274 *cpu_rev = "3.0";
291 break; 275 break;
292 case 4: 276 case 4:
293 omap_revision = OMAP3430_REV_ES3_1; 277 omap_revision = OMAP3430_REV_ES3_1;
294 omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; 278 *cpu_rev = "3.1";
295 break; 279 break;
296 case 7: 280 case 7:
297 /* FALLTHROUGH */ 281 /* FALLTHROUGH */
298 default: 282 default:
299 /* Use the latest known revision as default */ 283 /* Use the latest known revision as default */
300 omap_revision = OMAP3430_REV_ES3_1_2; 284 omap_revision = OMAP3430_REV_ES3_1_2;
301 285 *cpu_rev = "3.1.2";
302 /* REVISIT: Add CHIP_IS_OMAP3430ES3_1_2? */
303 omap_chip.oc |= CHIP_IS_OMAP3430ES3_1;
304 } 286 }
305 break; 287 break;
306 case 0xb868: 288 case 0xb868:
307 /* Handle OMAP35xx/AM35xx devices 289 /*
290 * Handle OMAP/AM 3505/3517 devices
308 * 291 *
309 * Set the device to be OMAP3505 here. Actual device 292 * Set the device to be OMAP3517 here. Actual device
310 * is identified later based on the features. 293 * is identified later based on the features.
311 *
312 * REVISIT: AM3505/AM3517 should have their own CHIP_IS
313 */ 294 */
314 omap_revision = OMAP3505_REV(rev); 295 switch (rev) {
315 omap_chip.oc |= CHIP_IS_OMAP3430ES3_1; 296 case 0:
297 omap_revision = OMAP3517_REV_ES1_0;
298 *cpu_rev = "1.0";
299 break;
300 case 1:
301 /* FALLTHROUGH */
302 default:
303 omap_revision = OMAP3517_REV_ES1_1;
304 *cpu_rev = "1.1";
305 }
316 break; 306 break;
317 case 0xb891: 307 case 0xb891:
318 /* Handle 36xx devices */ 308 /* Handle 36xx devices */
319 omap_chip.oc |= CHIP_IS_OMAP3630ES1;
320 309
321 switch(rev) { 310 switch(rev) {
322 case 0: /* Take care of early samples */ 311 case 0: /* Take care of early samples */
323 omap_revision = OMAP3630_REV_ES1_0; 312 omap_revision = OMAP3630_REV_ES1_0;
313 *cpu_rev = "1.0";
324 break; 314 break;
325 case 1: 315 case 1:
326 omap_revision = OMAP3630_REV_ES1_1; 316 omap_revision = OMAP3630_REV_ES1_1;
327 omap_chip.oc |= CHIP_IS_OMAP3630ES1_1; 317 *cpu_rev = "1.1";
328 break; 318 break;
329 case 2: 319 case 2:
320 /* FALLTHROUGH */
330 default: 321 default:
331 omap_revision = OMAP3630_REV_ES1_2; 322 omap_revision = OMAP3630_REV_ES1_2;
332 omap_chip.oc |= CHIP_IS_OMAP3630ES1_2; 323 *cpu_rev = "1.2";
333 } 324 }
334 break; 325 break;
335 case 0xb81e: 326 case 0xb81e:
336 omap_chip.oc = CHIP_IS_TI816X;
337
338 switch (rev) { 327 switch (rev) {
339 case 0: 328 case 0:
340 omap_revision = TI8168_REV_ES1_0; 329 omap_revision = TI8168_REV_ES1_0;
330 *cpu_rev = "1.0";
341 break; 331 break;
342 case 1: 332 case 1:
333 /* FALLTHROUGH */
334 default:
343 omap_revision = TI8168_REV_ES1_1; 335 omap_revision = TI8168_REV_ES1_1;
336 *cpu_rev = "1.1";
344 break; 337 break;
345 default:
346 omap_revision = TI8168_REV_ES1_1;
347 } 338 }
348 break; 339 break;
349 default: 340 default:
350 /* Unknown default to latest silicon rev as default*/ 341 /* Unknown default to latest silicon rev as default */
351 omap_revision = OMAP3630_REV_ES1_2; 342 omap_revision = OMAP3630_REV_ES1_2;
352 omap_chip.oc |= CHIP_IS_OMAP3630ES1_2; 343 *cpu_rev = "1.2";
344 pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n");
353 } 345 }
354} 346}
355 347
@@ -382,24 +374,20 @@ static void __init omap4_check_revision(void)
382 switch (rev) { 374 switch (rev) {
383 case 0: 375 case 0:
384 omap_revision = OMAP4430_REV_ES1_0; 376 omap_revision = OMAP4430_REV_ES1_0;
385 omap_chip.oc |= CHIP_IS_OMAP4430ES1;
386 break; 377 break;
387 case 1: 378 case 1:
388 default: 379 default:
389 omap_revision = OMAP4430_REV_ES2_0; 380 omap_revision = OMAP4430_REV_ES2_0;
390 omap_chip.oc |= CHIP_IS_OMAP4430ES2;
391 } 381 }
392 break; 382 break;
393 case 0xb95c: 383 case 0xb95c:
394 switch (rev) { 384 switch (rev) {
395 case 3: 385 case 3:
396 omap_revision = OMAP4430_REV_ES2_1; 386 omap_revision = OMAP4430_REV_ES2_1;
397 omap_chip.oc |= CHIP_IS_OMAP4430ES2_1;
398 break; 387 break;
399 case 4: 388 case 4:
400 default: 389 default:
401 omap_revision = OMAP4430_REV_ES2_2; 390 omap_revision = OMAP4430_REV_ES2_2;
402 omap_chip.oc |= CHIP_IS_OMAP4430ES2_2;
403 } 391 }
404 break; 392 break;
405 case 0xb94e: 393 case 0xb94e:
@@ -407,14 +395,12 @@ static void __init omap4_check_revision(void)
407 case 0: 395 case 0:
408 default: 396 default:
409 omap_revision = OMAP4460_REV_ES1_0; 397 omap_revision = OMAP4460_REV_ES1_0;
410 omap_chip.oc |= CHIP_IS_OMAP4460ES1_0;
411 break; 398 break;
412 } 399 }
413 break; 400 break;
414 default: 401 default:
415 /* Unknown default to latest silicon rev as default */ 402 /* Unknown default to latest silicon rev as default */
416 omap_revision = OMAP4430_REV_ES2_2; 403 omap_revision = OMAP4430_REV_ES2_2;
417 omap_chip.oc |= CHIP_IS_OMAP4430ES2_2;
418 } 404 }
419 405
420 pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16, 406 pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16,
@@ -425,94 +411,33 @@ static void __init omap4_check_revision(void)
425 if (omap3_has_ ##feat()) \ 411 if (omap3_has_ ##feat()) \
426 printk(#feat" "); 412 printk(#feat" ");
427 413
428static void __init omap3_cpuinfo(void) 414static void __init omap3_cpuinfo(const char *cpu_rev)
429{ 415{
430 u8 rev = GET_OMAP_REVISION(); 416 const char *cpu_name;
431 char cpu_name[16], cpu_rev[16];
432 417
433 /* OMAP3430 and OMAP3530 are assumed to be same. 418 /*
419 * OMAP3430 and OMAP3530 are assumed to be same.
434 * 420 *
435 * OMAP3525, OMAP3515 and OMAP3503 can be detected only based 421 * OMAP3525, OMAP3515 and OMAP3503 can be detected only based
436 * on available features. Upon detection, update the CPU id 422 * on available features. Upon detection, update the CPU id
437 * and CPU class bits. 423 * and CPU class bits.
438 */ 424 */
439 if (cpu_is_omap3630()) { 425 if (cpu_is_omap3630()) {
440 strcpy(cpu_name, "OMAP3630"); 426 cpu_name = "OMAP3630";
441 } else if (cpu_is_omap3505()) { 427 } else if (cpu_is_omap3517()) {
442 /* 428 /* AM35xx devices */
443 * AM35xx devices 429 cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505";
444 */
445 if (omap3_has_sgx()) {
446 omap_revision = OMAP3517_REV(rev);
447 strcpy(cpu_name, "AM3517");
448 } else {
449 /* Already set in omap3_check_revision() */
450 strcpy(cpu_name, "AM3505");
451 }
452 } else if (cpu_is_ti816x()) { 430 } else if (cpu_is_ti816x()) {
453 strcpy(cpu_name, "TI816X"); 431 cpu_name = "TI816X";
454 } else if (omap3_has_iva() && omap3_has_sgx()) { 432 } else if (omap3_has_iva() && omap3_has_sgx()) {
455 /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */ 433 /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
456 strcpy(cpu_name, "OMAP3430/3530"); 434 cpu_name = "OMAP3430/3530";
457 } else if (omap3_has_iva()) { 435 } else if (omap3_has_iva()) {
458 omap_revision = OMAP3525_REV(rev); 436 cpu_name = "OMAP3525";
459 strcpy(cpu_name, "OMAP3525");
460 } else if (omap3_has_sgx()) { 437 } else if (omap3_has_sgx()) {
461 omap_revision = OMAP3515_REV(rev); 438 cpu_name = "OMAP3515";
462 strcpy(cpu_name, "OMAP3515");
463 } else { 439 } else {
464 omap_revision = OMAP3503_REV(rev); 440 cpu_name = "OMAP3503";
465 strcpy(cpu_name, "OMAP3503");
466 }
467
468 if (cpu_is_omap3630() || cpu_is_ti816x()) {
469 switch (rev) {
470 case OMAP_REVBITS_00:
471 strcpy(cpu_rev, "1.0");
472 break;
473 case OMAP_REVBITS_01:
474 strcpy(cpu_rev, "1.1");
475 break;
476 case OMAP_REVBITS_02:
477 /* FALLTHROUGH */
478 default:
479 /* Use the latest known revision as default */
480 strcpy(cpu_rev, "1.2");
481 }
482 } else if (cpu_is_omap3505() || cpu_is_omap3517()) {
483 switch (rev) {
484 case OMAP_REVBITS_00:
485 strcpy(cpu_rev, "1.0");
486 break;
487 case OMAP_REVBITS_01:
488 /* FALLTHROUGH */
489 default:
490 /* Use the latest known revision as default */
491 strcpy(cpu_rev, "1.1");
492 }
493 } else {
494 switch (rev) {
495 case OMAP_REVBITS_00:
496 strcpy(cpu_rev, "1.0");
497 break;
498 case OMAP_REVBITS_01:
499 strcpy(cpu_rev, "2.0");
500 break;
501 case OMAP_REVBITS_02:
502 strcpy(cpu_rev, "2.1");
503 break;
504 case OMAP_REVBITS_03:
505 strcpy(cpu_rev, "3.0");
506 break;
507 case OMAP_REVBITS_04:
508 strcpy(cpu_rev, "3.1");
509 break;
510 case OMAP_REVBITS_05:
511 /* FALLTHROUGH */
512 default:
513 /* Use the latest known revision as default */
514 strcpy(cpu_rev, "3.1.2");
515 }
516 } 441 }
517 442
518 /* Print verbose information */ 443 /* Print verbose information */
@@ -533,6 +458,8 @@ static void __init omap3_cpuinfo(void)
533 */ 458 */
534void __init omap2_check_revision(void) 459void __init omap2_check_revision(void)
535{ 460{
461 const char *cpu_rev;
462
536 /* 463 /*
537 * At this point we have an idea about the processor revision set 464 * At this point we have an idea about the processor revision set
538 * earlier with omap2_set_globals_tap(). 465 * earlier with omap2_set_globals_tap().
@@ -540,7 +467,7 @@ void __init omap2_check_revision(void)
540 if (cpu_is_omap24xx()) { 467 if (cpu_is_omap24xx()) {
541 omap24xx_check_revision(); 468 omap24xx_check_revision();
542 } else if (cpu_is_omap34xx()) { 469 } else if (cpu_is_omap34xx()) {
543 omap3_check_revision(); 470 omap3_check_revision(&cpu_rev);
544 471
545 /* TI816X doesn't have feature register */ 472 /* TI816X doesn't have feature register */
546 if (!cpu_is_ti816x()) 473 if (!cpu_is_ti816x())
@@ -548,7 +475,7 @@ void __init omap2_check_revision(void)
548 else 475 else
549 ti816x_check_features(); 476 ti816x_check_features();
550 477
551 omap3_cpuinfo(); 478 omap3_cpuinfo(cpu_rev);
552 return; 479 return;
553 } else if (cpu_is_omap44xx()) { 480 } else if (cpu_is_omap44xx()) {
554 omap4_check_revision(); 481 omap4_check_revision();
@@ -557,22 +484,6 @@ void __init omap2_check_revision(void)
557 } else { 484 } else {
558 pr_err("OMAP revision unknown, please fix!\n"); 485 pr_err("OMAP revision unknown, please fix!\n");
559 } 486 }
560
561 /*
562 * OK, now we know the exact revision. Initialize omap_chip bits
563 * for powerdowmain and clockdomain code.
564 */
565 if (cpu_is_omap243x()) {
566 /* Currently only supports 2430ES2.1 and 2430-all */
567 omap_chip.oc |= CHIP_IS_OMAP2430;
568 return;
569 } else if (cpu_is_omap242x()) {
570 /* Currently only supports 2420ES2.1.1 and 2420-all */
571 omap_chip.oc |= CHIP_IS_OMAP2420;
572 return;
573 }
574
575 pr_err("Uninitialized omap_chip, please fix!\n");
576} 487}
577 488
578/* 489/*
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 2ce1ce6fb4db..1a13b7916554 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -341,12 +341,12 @@ void __init omap2_init_common_infrastructure(void)
341 u8 postsetup_state; 341 u8 postsetup_state;
342 342
343 if (cpu_is_omap242x()) { 343 if (cpu_is_omap242x()) {
344 omap2xxx_powerdomains_init(); 344 omap242x_powerdomains_init();
345 omap2xxx_clockdomains_init(); 345 omap242x_clockdomains_init();
346 omap2420_hwmod_init(); 346 omap2420_hwmod_init();
347 } else if (cpu_is_omap243x()) { 347 } else if (cpu_is_omap243x()) {
348 omap2xxx_powerdomains_init(); 348 omap243x_powerdomains_init();
349 omap2xxx_clockdomains_init(); 349 omap243x_clockdomains_init();
350 omap2430_hwmod_init(); 350 omap2430_hwmod_init();
351 } else if (cpu_is_omap34xx()) { 351 } else if (cpu_is_omap34xx()) {
352 omap3xxx_powerdomains_init(); 352 omap3xxx_powerdomains_init();
@@ -376,7 +376,7 @@ void __init omap2_init_common_infrastructure(void)
376 * omap_hwmod_late_init(), so boards that desire full watchdog 376 * omap_hwmod_late_init(), so boards that desire full watchdog
377 * coverage of kernel initialization can reprogram the 377 * coverage of kernel initialization can reprogram the
378 * postsetup_state between the calls to 378 * postsetup_state between the calls to
379 * omap2_init_common_infra() and omap2_init_common_devices(). 379 * omap2_init_common_infra() and omap_sdrc_init().
380 * 380 *
381 * XXX ideally we could detect whether the MPU WDT was currently 381 * XXX ideally we could detect whether the MPU WDT was currently
382 * enabled here and make this conditional 382 * enabled here and make this conditional
@@ -400,7 +400,47 @@ void __init omap2_init_common_infrastructure(void)
400 pr_err("Could not init clock framework - unknown SoC\n"); 400 pr_err("Could not init clock framework - unknown SoC\n");
401} 401}
402 402
403void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, 403void __init omap2420_init_early(void)
404{
405 omap2_init_common_infrastructure();
406}
407
408void __init omap2430_init_early(void)
409{
410 omap2_init_common_infrastructure();
411}
412
413void __init omap3430_init_early(void)
414{
415 omap2_init_common_infrastructure();
416}
417
418void __init omap35xx_init_early(void)
419{
420 omap2_init_common_infrastructure();
421}
422
423void __init omap3630_init_early(void)
424{
425 omap2_init_common_infrastructure();
426}
427
428void __init am35xx_init_early(void)
429{
430 omap2_init_common_infrastructure();
431}
432
433void __init ti816x_init_early(void)
434{
435 omap2_init_common_infrastructure();
436}
437
438void __init omap4430_init_early(void)
439{
440 omap2_init_common_infrastructure();
441}
442
443void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
404 struct omap_sdrc_params *sdrc_cs1) 444 struct omap_sdrc_params *sdrc_cs1)
405{ 445{
406 if (cpu_is_omap24xx() || omap3_has_sdrc()) { 446 if (cpu_is_omap24xx() || omap3_has_sdrc()) {
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 84cc0bdda3ae..d71380705080 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1954,9 +1954,6 @@ int __init omap_hwmod_register(struct omap_hwmod **ohs)
1954 1954
1955 i = 0; 1955 i = 0;
1956 do { 1956 do {
1957 if (!omap_chip_is(ohs[i]->omap_chip))
1958 continue;
1959
1960 r = _register(ohs[i]); 1957 r = _register(ohs[i]);
1961 WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name, 1958 WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name,
1962 r); 1959 r);
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index a015c69068f6..6d7206213525 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -100,7 +100,6 @@ static struct omap_hwmod omap2420_l3_main_hwmod = {
100 .masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters), 100 .masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters),
101 .slaves = omap2420_l3_main_slaves, 101 .slaves = omap2420_l3_main_slaves,
102 .slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves), 102 .slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves),
103 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
104 .flags = HWMOD_NO_IDLEST, 103 .flags = HWMOD_NO_IDLEST,
105}; 104};
106 105
@@ -206,7 +205,6 @@ static struct omap_hwmod omap2420_l4_core_hwmod = {
206 .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters), 205 .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters),
207 .slaves = omap2420_l4_core_slaves, 206 .slaves = omap2420_l4_core_slaves,
208 .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves), 207 .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves),
209 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
210 .flags = HWMOD_NO_IDLEST, 208 .flags = HWMOD_NO_IDLEST,
211}; 209};
212 210
@@ -227,7 +225,6 @@ static struct omap_hwmod omap2420_l4_wkup_hwmod = {
227 .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters), 225 .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters),
228 .slaves = omap2420_l4_wkup_slaves, 226 .slaves = omap2420_l4_wkup_slaves,
229 .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves), 227 .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves),
230 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
231 .flags = HWMOD_NO_IDLEST, 228 .flags = HWMOD_NO_IDLEST,
232}; 229};
233 230
@@ -243,7 +240,6 @@ static struct omap_hwmod omap2420_mpu_hwmod = {
243 .main_clk = "mpu_ck", 240 .main_clk = "mpu_ck",
244 .masters = omap2420_mpu_masters, 241 .masters = omap2420_mpu_masters,
245 .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters), 242 .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters),
246 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
247}; 243};
248 244
249/* 245/*
@@ -271,7 +267,16 @@ static struct omap_hwmod omap2420_iva_hwmod = {
271 .class = &iva_hwmod_class, 267 .class = &iva_hwmod_class,
272 .masters = omap2420_iva_masters, 268 .masters = omap2420_iva_masters,
273 .masters_cnt = ARRAY_SIZE(omap2420_iva_masters), 269 .masters_cnt = ARRAY_SIZE(omap2420_iva_masters),
274 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) 270};
271
272/* always-on timers dev attribute */
273static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
274 .timer_capability = OMAP_TIMER_ALWON,
275};
276
277/* pwm timers dev attribute */
278static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
279 .timer_capability = OMAP_TIMER_HAS_PWM,
275}; 280};
276 281
277/* timer1 */ 282/* timer1 */
@@ -314,10 +319,10 @@ static struct omap_hwmod omap2420_timer1_hwmod = {
314 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT, 319 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
315 }, 320 },
316 }, 321 },
322 .dev_attr = &capability_alwon_dev_attr,
317 .slaves = omap2420_timer1_slaves, 323 .slaves = omap2420_timer1_slaves,
318 .slaves_cnt = ARRAY_SIZE(omap2420_timer1_slaves), 324 .slaves_cnt = ARRAY_SIZE(omap2420_timer1_slaves),
319 .class = &omap2xxx_timer_hwmod_class, 325 .class = &omap2xxx_timer_hwmod_class,
320 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
321}; 326};
322 327
323/* timer2 */ 328/* timer2 */
@@ -351,10 +356,10 @@ static struct omap_hwmod omap2420_timer2_hwmod = {
351 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT, 356 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
352 }, 357 },
353 }, 358 },
359 .dev_attr = &capability_alwon_dev_attr,
354 .slaves = omap2420_timer2_slaves, 360 .slaves = omap2420_timer2_slaves,
355 .slaves_cnt = ARRAY_SIZE(omap2420_timer2_slaves), 361 .slaves_cnt = ARRAY_SIZE(omap2420_timer2_slaves),
356 .class = &omap2xxx_timer_hwmod_class, 362 .class = &omap2xxx_timer_hwmod_class,
357 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
358}; 363};
359 364
360/* timer3 */ 365/* timer3 */
@@ -388,10 +393,10 @@ static struct omap_hwmod omap2420_timer3_hwmod = {
388 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT, 393 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
389 }, 394 },
390 }, 395 },
396 .dev_attr = &capability_alwon_dev_attr,
391 .slaves = omap2420_timer3_slaves, 397 .slaves = omap2420_timer3_slaves,
392 .slaves_cnt = ARRAY_SIZE(omap2420_timer3_slaves), 398 .slaves_cnt = ARRAY_SIZE(omap2420_timer3_slaves),
393 .class = &omap2xxx_timer_hwmod_class, 399 .class = &omap2xxx_timer_hwmod_class,
394 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
395}; 400};
396 401
397/* timer4 */ 402/* timer4 */
@@ -425,10 +430,10 @@ static struct omap_hwmod omap2420_timer4_hwmod = {
425 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT, 430 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
426 }, 431 },
427 }, 432 },
433 .dev_attr = &capability_alwon_dev_attr,
428 .slaves = omap2420_timer4_slaves, 434 .slaves = omap2420_timer4_slaves,
429 .slaves_cnt = ARRAY_SIZE(omap2420_timer4_slaves), 435 .slaves_cnt = ARRAY_SIZE(omap2420_timer4_slaves),
430 .class = &omap2xxx_timer_hwmod_class, 436 .class = &omap2xxx_timer_hwmod_class,
431 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
432}; 437};
433 438
434/* timer5 */ 439/* timer5 */
@@ -462,10 +467,10 @@ static struct omap_hwmod omap2420_timer5_hwmod = {
462 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, 467 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
463 }, 468 },
464 }, 469 },
470 .dev_attr = &capability_alwon_dev_attr,
465 .slaves = omap2420_timer5_slaves, 471 .slaves = omap2420_timer5_slaves,
466 .slaves_cnt = ARRAY_SIZE(omap2420_timer5_slaves), 472 .slaves_cnt = ARRAY_SIZE(omap2420_timer5_slaves),
467 .class = &omap2xxx_timer_hwmod_class, 473 .class = &omap2xxx_timer_hwmod_class,
468 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
469}; 474};
470 475
471 476
@@ -500,10 +505,10 @@ static struct omap_hwmod omap2420_timer6_hwmod = {
500 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT, 505 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
501 }, 506 },
502 }, 507 },
508 .dev_attr = &capability_alwon_dev_attr,
503 .slaves = omap2420_timer6_slaves, 509 .slaves = omap2420_timer6_slaves,
504 .slaves_cnt = ARRAY_SIZE(omap2420_timer6_slaves), 510 .slaves_cnt = ARRAY_SIZE(omap2420_timer6_slaves),
505 .class = &omap2xxx_timer_hwmod_class, 511 .class = &omap2xxx_timer_hwmod_class,
506 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
507}; 512};
508 513
509/* timer7 */ 514/* timer7 */
@@ -537,10 +542,10 @@ static struct omap_hwmod omap2420_timer7_hwmod = {
537 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, 542 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
538 }, 543 },
539 }, 544 },
545 .dev_attr = &capability_alwon_dev_attr,
540 .slaves = omap2420_timer7_slaves, 546 .slaves = omap2420_timer7_slaves,
541 .slaves_cnt = ARRAY_SIZE(omap2420_timer7_slaves), 547 .slaves_cnt = ARRAY_SIZE(omap2420_timer7_slaves),
542 .class = &omap2xxx_timer_hwmod_class, 548 .class = &omap2xxx_timer_hwmod_class,
543 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
544}; 549};
545 550
546/* timer8 */ 551/* timer8 */
@@ -574,10 +579,10 @@ static struct omap_hwmod omap2420_timer8_hwmod = {
574 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, 579 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
575 }, 580 },
576 }, 581 },
582 .dev_attr = &capability_alwon_dev_attr,
577 .slaves = omap2420_timer8_slaves, 583 .slaves = omap2420_timer8_slaves,
578 .slaves_cnt = ARRAY_SIZE(omap2420_timer8_slaves), 584 .slaves_cnt = ARRAY_SIZE(omap2420_timer8_slaves),
579 .class = &omap2xxx_timer_hwmod_class, 585 .class = &omap2xxx_timer_hwmod_class,
580 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
581}; 586};
582 587
583/* timer9 */ 588/* timer9 */
@@ -611,10 +616,10 @@ static struct omap_hwmod omap2420_timer9_hwmod = {
611 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT, 616 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
612 }, 617 },
613 }, 618 },
619 .dev_attr = &capability_pwm_dev_attr,
614 .slaves = omap2420_timer9_slaves, 620 .slaves = omap2420_timer9_slaves,
615 .slaves_cnt = ARRAY_SIZE(omap2420_timer9_slaves), 621 .slaves_cnt = ARRAY_SIZE(omap2420_timer9_slaves),
616 .class = &omap2xxx_timer_hwmod_class, 622 .class = &omap2xxx_timer_hwmod_class,
617 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
618}; 623};
619 624
620/* timer10 */ 625/* timer10 */
@@ -648,10 +653,10 @@ static struct omap_hwmod omap2420_timer10_hwmod = {
648 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT, 653 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
649 }, 654 },
650 }, 655 },
656 .dev_attr = &capability_pwm_dev_attr,
651 .slaves = omap2420_timer10_slaves, 657 .slaves = omap2420_timer10_slaves,
652 .slaves_cnt = ARRAY_SIZE(omap2420_timer10_slaves), 658 .slaves_cnt = ARRAY_SIZE(omap2420_timer10_slaves),
653 .class = &omap2xxx_timer_hwmod_class, 659 .class = &omap2xxx_timer_hwmod_class,
654 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
655}; 660};
656 661
657/* timer11 */ 662/* timer11 */
@@ -685,10 +690,10 @@ static struct omap_hwmod omap2420_timer11_hwmod = {
685 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT, 690 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
686 }, 691 },
687 }, 692 },
693 .dev_attr = &capability_pwm_dev_attr,
688 .slaves = omap2420_timer11_slaves, 694 .slaves = omap2420_timer11_slaves,
689 .slaves_cnt = ARRAY_SIZE(omap2420_timer11_slaves), 695 .slaves_cnt = ARRAY_SIZE(omap2420_timer11_slaves),
690 .class = &omap2xxx_timer_hwmod_class, 696 .class = &omap2xxx_timer_hwmod_class,
691 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
692}; 697};
693 698
694/* timer12 */ 699/* timer12 */
@@ -722,10 +727,10 @@ static struct omap_hwmod omap2420_timer12_hwmod = {
722 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT, 727 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
723 }, 728 },
724 }, 729 },
730 .dev_attr = &capability_pwm_dev_attr,
725 .slaves = omap2420_timer12_slaves, 731 .slaves = omap2420_timer12_slaves,
726 .slaves_cnt = ARRAY_SIZE(omap2420_timer12_slaves), 732 .slaves_cnt = ARRAY_SIZE(omap2420_timer12_slaves),
727 .class = &omap2xxx_timer_hwmod_class, 733 .class = &omap2xxx_timer_hwmod_class,
728 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
729}; 734};
730 735
731/* l4_wkup -> wd_timer2 */ 736/* l4_wkup -> wd_timer2 */
@@ -766,7 +771,6 @@ static struct omap_hwmod omap2420_wd_timer2_hwmod = {
766 }, 771 },
767 .slaves = omap2420_wd_timer2_slaves, 772 .slaves = omap2420_wd_timer2_slaves,
768 .slaves_cnt = ARRAY_SIZE(omap2420_wd_timer2_slaves), 773 .slaves_cnt = ARRAY_SIZE(omap2420_wd_timer2_slaves),
769 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
770}; 774};
771 775
772/* UART1 */ 776/* UART1 */
@@ -792,7 +796,6 @@ static struct omap_hwmod omap2420_uart1_hwmod = {
792 .slaves = omap2420_uart1_slaves, 796 .slaves = omap2420_uart1_slaves,
793 .slaves_cnt = ARRAY_SIZE(omap2420_uart1_slaves), 797 .slaves_cnt = ARRAY_SIZE(omap2420_uart1_slaves),
794 .class = &omap2_uart_class, 798 .class = &omap2_uart_class,
795 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
796}; 799};
797 800
798/* UART2 */ 801/* UART2 */
@@ -818,7 +821,6 @@ static struct omap_hwmod omap2420_uart2_hwmod = {
818 .slaves = omap2420_uart2_slaves, 821 .slaves = omap2420_uart2_slaves,
819 .slaves_cnt = ARRAY_SIZE(omap2420_uart2_slaves), 822 .slaves_cnt = ARRAY_SIZE(omap2420_uart2_slaves),
820 .class = &omap2_uart_class, 823 .class = &omap2_uart_class,
821 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
822}; 824};
823 825
824/* UART3 */ 826/* UART3 */
@@ -844,7 +846,6 @@ static struct omap_hwmod omap2420_uart3_hwmod = {
844 .slaves = omap2420_uart3_slaves, 846 .slaves = omap2420_uart3_slaves,
845 .slaves_cnt = ARRAY_SIZE(omap2420_uart3_slaves), 847 .slaves_cnt = ARRAY_SIZE(omap2420_uart3_slaves),
846 .class = &omap2_uart_class, 848 .class = &omap2_uart_class,
847 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
848}; 849};
849 850
850/* dss */ 851/* dss */
@@ -898,7 +899,6 @@ static struct omap_hwmod omap2420_dss_core_hwmod = {
898 .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves), 899 .slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves),
899 .masters = omap2420_dss_masters, 900 .masters = omap2420_dss_masters,
900 .masters_cnt = ARRAY_SIZE(omap2420_dss_masters), 901 .masters_cnt = ARRAY_SIZE(omap2420_dss_masters),
901 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
902 .flags = HWMOD_NO_IDLEST, 902 .flags = HWMOD_NO_IDLEST,
903}; 903};
904 904
@@ -938,7 +938,6 @@ static struct omap_hwmod omap2420_dss_dispc_hwmod = {
938 }, 938 },
939 .slaves = omap2420_dss_dispc_slaves, 939 .slaves = omap2420_dss_dispc_slaves,
940 .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves), 940 .slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves),
941 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
942 .flags = HWMOD_NO_IDLEST, 941 .flags = HWMOD_NO_IDLEST,
943}; 942};
944 943
@@ -975,7 +974,6 @@ static struct omap_hwmod omap2420_dss_rfbi_hwmod = {
975 }, 974 },
976 .slaves = omap2420_dss_rfbi_slaves, 975 .slaves = omap2420_dss_rfbi_slaves,
977 .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves), 976 .slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves),
978 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
979 .flags = HWMOD_NO_IDLEST, 977 .flags = HWMOD_NO_IDLEST,
980}; 978};
981 979
@@ -1013,7 +1011,6 @@ static struct omap_hwmod omap2420_dss_venc_hwmod = {
1013 }, 1011 },
1014 .slaves = omap2420_dss_venc_slaves, 1012 .slaves = omap2420_dss_venc_slaves,
1015 .slaves_cnt = ARRAY_SIZE(omap2420_dss_venc_slaves), 1013 .slaves_cnt = ARRAY_SIZE(omap2420_dss_venc_slaves),
1016 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1017 .flags = HWMOD_NO_IDLEST, 1014 .flags = HWMOD_NO_IDLEST,
1018}; 1015};
1019 1016
@@ -1064,7 +1061,6 @@ static struct omap_hwmod omap2420_i2c1_hwmod = {
1064 .slaves_cnt = ARRAY_SIZE(omap2420_i2c1_slaves), 1061 .slaves_cnt = ARRAY_SIZE(omap2420_i2c1_slaves),
1065 .class = &i2c_class, 1062 .class = &i2c_class,
1066 .dev_attr = &i2c_dev_attr, 1063 .dev_attr = &i2c_dev_attr,
1067 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1068 .flags = HWMOD_16BIT_REG, 1064 .flags = HWMOD_16BIT_REG,
1069}; 1065};
1070 1066
@@ -1092,7 +1088,6 @@ static struct omap_hwmod omap2420_i2c2_hwmod = {
1092 .slaves_cnt = ARRAY_SIZE(omap2420_i2c2_slaves), 1088 .slaves_cnt = ARRAY_SIZE(omap2420_i2c2_slaves),
1093 .class = &i2c_class, 1089 .class = &i2c_class,
1094 .dev_attr = &i2c_dev_attr, 1090 .dev_attr = &i2c_dev_attr,
1095 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1096 .flags = HWMOD_16BIT_REG, 1091 .flags = HWMOD_16BIT_REG,
1097}; 1092};
1098 1093
@@ -1197,7 +1192,6 @@ static struct omap_hwmod omap2420_gpio1_hwmod = {
1197 .slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves), 1192 .slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves),
1198 .class = &omap2xxx_gpio_hwmod_class, 1193 .class = &omap2xxx_gpio_hwmod_class,
1199 .dev_attr = &gpio_dev_attr, 1194 .dev_attr = &gpio_dev_attr,
1200 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1201}; 1195};
1202 1196
1203/* gpio2 */ 1197/* gpio2 */
@@ -1223,7 +1217,6 @@ static struct omap_hwmod omap2420_gpio2_hwmod = {
1223 .slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves), 1217 .slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves),
1224 .class = &omap2xxx_gpio_hwmod_class, 1218 .class = &omap2xxx_gpio_hwmod_class,
1225 .dev_attr = &gpio_dev_attr, 1219 .dev_attr = &gpio_dev_attr,
1226 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1227}; 1220};
1228 1221
1229/* gpio3 */ 1222/* gpio3 */
@@ -1249,7 +1242,6 @@ static struct omap_hwmod omap2420_gpio3_hwmod = {
1249 .slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves), 1242 .slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves),
1250 .class = &omap2xxx_gpio_hwmod_class, 1243 .class = &omap2xxx_gpio_hwmod_class,
1251 .dev_attr = &gpio_dev_attr, 1244 .dev_attr = &gpio_dev_attr,
1252 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1253}; 1245};
1254 1246
1255/* gpio4 */ 1247/* gpio4 */
@@ -1275,7 +1267,6 @@ static struct omap_hwmod omap2420_gpio4_hwmod = {
1275 .slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves), 1267 .slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves),
1276 .class = &omap2xxx_gpio_hwmod_class, 1268 .class = &omap2xxx_gpio_hwmod_class,
1277 .dev_attr = &gpio_dev_attr, 1269 .dev_attr = &gpio_dev_attr,
1278 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1279}; 1270};
1280 1271
1281/* dma attributes */ 1272/* dma attributes */
@@ -1322,7 +1313,6 @@ static struct omap_hwmod omap2420_dma_system_hwmod = {
1322 .masters = omap2420_dma_system_masters, 1313 .masters = omap2420_dma_system_masters,
1323 .masters_cnt = ARRAY_SIZE(omap2420_dma_system_masters), 1314 .masters_cnt = ARRAY_SIZE(omap2420_dma_system_masters),
1324 .dev_attr = &dma_dev_attr, 1315 .dev_attr = &dma_dev_attr,
1325 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1326 .flags = HWMOD_NO_IDLEST, 1316 .flags = HWMOD_NO_IDLEST,
1327}; 1317};
1328 1318
@@ -1363,7 +1353,6 @@ static struct omap_hwmod omap2420_mailbox_hwmod = {
1363 }, 1353 },
1364 .slaves = omap2420_mailbox_slaves, 1354 .slaves = omap2420_mailbox_slaves,
1365 .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves), 1355 .slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves),
1366 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1367}; 1356};
1368 1357
1369/* mcspi1 */ 1358/* mcspi1 */
@@ -1393,7 +1382,6 @@ static struct omap_hwmod omap2420_mcspi1_hwmod = {
1393 .slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves), 1382 .slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves),
1394 .class = &omap2xxx_mcspi_class, 1383 .class = &omap2xxx_mcspi_class,
1395 .dev_attr = &omap_mcspi1_dev_attr, 1384 .dev_attr = &omap_mcspi1_dev_attr,
1396 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1397}; 1385};
1398 1386
1399/* mcspi2 */ 1387/* mcspi2 */
@@ -1423,7 +1411,6 @@ static struct omap_hwmod omap2420_mcspi2_hwmod = {
1423 .slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves), 1411 .slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves),
1424 .class = &omap2xxx_mcspi_class, 1412 .class = &omap2xxx_mcspi_class,
1425 .dev_attr = &omap_mcspi2_dev_attr, 1413 .dev_attr = &omap_mcspi2_dev_attr,
1426 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1427}; 1414};
1428 1415
1429/* 1416/*
@@ -1473,7 +1460,6 @@ static struct omap_hwmod omap2420_mcbsp1_hwmod = {
1473 }, 1460 },
1474 .slaves = omap2420_mcbsp1_slaves, 1461 .slaves = omap2420_mcbsp1_slaves,
1475 .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp1_slaves), 1462 .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp1_slaves),
1476 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1477}; 1463};
1478 1464
1479/* mcbsp2 */ 1465/* mcbsp2 */
@@ -1514,7 +1500,6 @@ static struct omap_hwmod omap2420_mcbsp2_hwmod = {
1514 }, 1500 },
1515 .slaves = omap2420_mcbsp2_slaves, 1501 .slaves = omap2420_mcbsp2_slaves,
1516 .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp2_slaves), 1502 .slaves_cnt = ARRAY_SIZE(omap2420_mcbsp2_slaves),
1517 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
1518}; 1503};
1519 1504
1520static __initdata struct omap_hwmod *omap2420_hwmods[] = { 1505static __initdata struct omap_hwmod *omap2420_hwmods[] = {
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 16743c7d6e8e..a2580d01c3ff 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -110,7 +110,6 @@ static struct omap_hwmod omap2430_l3_main_hwmod = {
110 .masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters), 110 .masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters),
111 .slaves = omap2430_l3_main_slaves, 111 .slaves = omap2430_l3_main_slaves,
112 .slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves), 112 .slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves),
113 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
114 .flags = HWMOD_NO_IDLEST, 113 .flags = HWMOD_NO_IDLEST,
115}; 114};
116 115
@@ -192,6 +191,7 @@ static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = {
192 .pa_end = OMAP243X_HS_BASE + SZ_4K - 1, 191 .pa_end = OMAP243X_HS_BASE + SZ_4K - 1,
193 .flags = ADDR_TYPE_RT 192 .flags = ADDR_TYPE_RT
194 }, 193 },
194 { }
195}; 195};
196 196
197/* l4_core ->usbhsotg interface */ 197/* l4_core ->usbhsotg interface */
@@ -249,7 +249,6 @@ static struct omap_hwmod omap2430_l4_core_hwmod = {
249 .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters), 249 .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters),
250 .slaves = omap2430_l4_core_slaves, 250 .slaves = omap2430_l4_core_slaves,
251 .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves), 251 .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves),
252 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
253 .flags = HWMOD_NO_IDLEST, 252 .flags = HWMOD_NO_IDLEST,
254}; 253};
255 254
@@ -300,7 +299,6 @@ static struct omap_hwmod omap2430_l4_wkup_hwmod = {
300 .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters), 299 .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters),
301 .slaves = omap2430_l4_wkup_slaves, 300 .slaves = omap2430_l4_wkup_slaves,
302 .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves), 301 .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves),
303 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
304 .flags = HWMOD_NO_IDLEST, 302 .flags = HWMOD_NO_IDLEST,
305}; 303};
306 304
@@ -316,7 +314,6 @@ static struct omap_hwmod omap2430_mpu_hwmod = {
316 .main_clk = "mpu_ck", 314 .main_clk = "mpu_ck",
317 .masters = omap2430_mpu_masters, 315 .masters = omap2430_mpu_masters,
318 .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters), 316 .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters),
319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
320}; 317};
321 318
322/* 319/*
@@ -344,7 +341,16 @@ static struct omap_hwmod omap2430_iva_hwmod = {
344 .class = &iva_hwmod_class, 341 .class = &iva_hwmod_class,
345 .masters = omap2430_iva_masters, 342 .masters = omap2430_iva_masters,
346 .masters_cnt = ARRAY_SIZE(omap2430_iva_masters), 343 .masters_cnt = ARRAY_SIZE(omap2430_iva_masters),
347 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) 344};
345
346/* always-on timers dev attribute */
347static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
348 .timer_capability = OMAP_TIMER_ALWON,
349};
350
351/* pwm timers dev attribute */
352static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
353 .timer_capability = OMAP_TIMER_HAS_PWM,
348}; 354};
349 355
350/* timer1 */ 356/* timer1 */
@@ -387,10 +393,10 @@ static struct omap_hwmod omap2430_timer1_hwmod = {
387 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT, 393 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
388 }, 394 },
389 }, 395 },
396 .dev_attr = &capability_alwon_dev_attr,
390 .slaves = omap2430_timer1_slaves, 397 .slaves = omap2430_timer1_slaves,
391 .slaves_cnt = ARRAY_SIZE(omap2430_timer1_slaves), 398 .slaves_cnt = ARRAY_SIZE(omap2430_timer1_slaves),
392 .class = &omap2xxx_timer_hwmod_class, 399 .class = &omap2xxx_timer_hwmod_class,
393 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
394}; 400};
395 401
396/* timer2 */ 402/* timer2 */
@@ -424,10 +430,10 @@ static struct omap_hwmod omap2430_timer2_hwmod = {
424 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT, 430 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
425 }, 431 },
426 }, 432 },
433 .dev_attr = &capability_alwon_dev_attr,
427 .slaves = omap2430_timer2_slaves, 434 .slaves = omap2430_timer2_slaves,
428 .slaves_cnt = ARRAY_SIZE(omap2430_timer2_slaves), 435 .slaves_cnt = ARRAY_SIZE(omap2430_timer2_slaves),
429 .class = &omap2xxx_timer_hwmod_class, 436 .class = &omap2xxx_timer_hwmod_class,
430 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
431}; 437};
432 438
433/* timer3 */ 439/* timer3 */
@@ -461,10 +467,10 @@ static struct omap_hwmod omap2430_timer3_hwmod = {
461 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT, 467 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
462 }, 468 },
463 }, 469 },
470 .dev_attr = &capability_alwon_dev_attr,
464 .slaves = omap2430_timer3_slaves, 471 .slaves = omap2430_timer3_slaves,
465 .slaves_cnt = ARRAY_SIZE(omap2430_timer3_slaves), 472 .slaves_cnt = ARRAY_SIZE(omap2430_timer3_slaves),
466 .class = &omap2xxx_timer_hwmod_class, 473 .class = &omap2xxx_timer_hwmod_class,
467 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
468}; 474};
469 475
470/* timer4 */ 476/* timer4 */
@@ -498,10 +504,10 @@ static struct omap_hwmod omap2430_timer4_hwmod = {
498 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT, 504 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
499 }, 505 },
500 }, 506 },
507 .dev_attr = &capability_alwon_dev_attr,
501 .slaves = omap2430_timer4_slaves, 508 .slaves = omap2430_timer4_slaves,
502 .slaves_cnt = ARRAY_SIZE(omap2430_timer4_slaves), 509 .slaves_cnt = ARRAY_SIZE(omap2430_timer4_slaves),
503 .class = &omap2xxx_timer_hwmod_class, 510 .class = &omap2xxx_timer_hwmod_class,
504 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
505}; 511};
506 512
507/* timer5 */ 513/* timer5 */
@@ -535,10 +541,10 @@ static struct omap_hwmod omap2430_timer5_hwmod = {
535 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, 541 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
536 }, 542 },
537 }, 543 },
544 .dev_attr = &capability_alwon_dev_attr,
538 .slaves = omap2430_timer5_slaves, 545 .slaves = omap2430_timer5_slaves,
539 .slaves_cnt = ARRAY_SIZE(omap2430_timer5_slaves), 546 .slaves_cnt = ARRAY_SIZE(omap2430_timer5_slaves),
540 .class = &omap2xxx_timer_hwmod_class, 547 .class = &omap2xxx_timer_hwmod_class,
541 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
542}; 548};
543 549
544/* timer6 */ 550/* timer6 */
@@ -572,10 +578,10 @@ static struct omap_hwmod omap2430_timer6_hwmod = {
572 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT, 578 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
573 }, 579 },
574 }, 580 },
581 .dev_attr = &capability_alwon_dev_attr,
575 .slaves = omap2430_timer6_slaves, 582 .slaves = omap2430_timer6_slaves,
576 .slaves_cnt = ARRAY_SIZE(omap2430_timer6_slaves), 583 .slaves_cnt = ARRAY_SIZE(omap2430_timer6_slaves),
577 .class = &omap2xxx_timer_hwmod_class, 584 .class = &omap2xxx_timer_hwmod_class,
578 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
579}; 585};
580 586
581/* timer7 */ 587/* timer7 */
@@ -609,10 +615,10 @@ static struct omap_hwmod omap2430_timer7_hwmod = {
609 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, 615 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
610 }, 616 },
611 }, 617 },
618 .dev_attr = &capability_alwon_dev_attr,
612 .slaves = omap2430_timer7_slaves, 619 .slaves = omap2430_timer7_slaves,
613 .slaves_cnt = ARRAY_SIZE(omap2430_timer7_slaves), 620 .slaves_cnt = ARRAY_SIZE(omap2430_timer7_slaves),
614 .class = &omap2xxx_timer_hwmod_class, 621 .class = &omap2xxx_timer_hwmod_class,
615 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
616}; 622};
617 623
618/* timer8 */ 624/* timer8 */
@@ -646,10 +652,10 @@ static struct omap_hwmod omap2430_timer8_hwmod = {
646 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, 652 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
647 }, 653 },
648 }, 654 },
655 .dev_attr = &capability_alwon_dev_attr,
649 .slaves = omap2430_timer8_slaves, 656 .slaves = omap2430_timer8_slaves,
650 .slaves_cnt = ARRAY_SIZE(omap2430_timer8_slaves), 657 .slaves_cnt = ARRAY_SIZE(omap2430_timer8_slaves),
651 .class = &omap2xxx_timer_hwmod_class, 658 .class = &omap2xxx_timer_hwmod_class,
652 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
653}; 659};
654 660
655/* timer9 */ 661/* timer9 */
@@ -683,10 +689,10 @@ static struct omap_hwmod omap2430_timer9_hwmod = {
683 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT, 689 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
684 }, 690 },
685 }, 691 },
692 .dev_attr = &capability_pwm_dev_attr,
686 .slaves = omap2430_timer9_slaves, 693 .slaves = omap2430_timer9_slaves,
687 .slaves_cnt = ARRAY_SIZE(omap2430_timer9_slaves), 694 .slaves_cnt = ARRAY_SIZE(omap2430_timer9_slaves),
688 .class = &omap2xxx_timer_hwmod_class, 695 .class = &omap2xxx_timer_hwmod_class,
689 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
690}; 696};
691 697
692/* timer10 */ 698/* timer10 */
@@ -720,10 +726,10 @@ static struct omap_hwmod omap2430_timer10_hwmod = {
720 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT, 726 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
721 }, 727 },
722 }, 728 },
729 .dev_attr = &capability_pwm_dev_attr,
723 .slaves = omap2430_timer10_slaves, 730 .slaves = omap2430_timer10_slaves,
724 .slaves_cnt = ARRAY_SIZE(omap2430_timer10_slaves), 731 .slaves_cnt = ARRAY_SIZE(omap2430_timer10_slaves),
725 .class = &omap2xxx_timer_hwmod_class, 732 .class = &omap2xxx_timer_hwmod_class,
726 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
727}; 733};
728 734
729/* timer11 */ 735/* timer11 */
@@ -757,10 +763,10 @@ static struct omap_hwmod omap2430_timer11_hwmod = {
757 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT, 763 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
758 }, 764 },
759 }, 765 },
766 .dev_attr = &capability_pwm_dev_attr,
760 .slaves = omap2430_timer11_slaves, 767 .slaves = omap2430_timer11_slaves,
761 .slaves_cnt = ARRAY_SIZE(omap2430_timer11_slaves), 768 .slaves_cnt = ARRAY_SIZE(omap2430_timer11_slaves),
762 .class = &omap2xxx_timer_hwmod_class, 769 .class = &omap2xxx_timer_hwmod_class,
763 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
764}; 770};
765 771
766/* timer12 */ 772/* timer12 */
@@ -794,10 +800,10 @@ static struct omap_hwmod omap2430_timer12_hwmod = {
794 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT, 800 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
795 }, 801 },
796 }, 802 },
803 .dev_attr = &capability_pwm_dev_attr,
797 .slaves = omap2430_timer12_slaves, 804 .slaves = omap2430_timer12_slaves,
798 .slaves_cnt = ARRAY_SIZE(omap2430_timer12_slaves), 805 .slaves_cnt = ARRAY_SIZE(omap2430_timer12_slaves),
799 .class = &omap2xxx_timer_hwmod_class, 806 .class = &omap2xxx_timer_hwmod_class,
800 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
801}; 807};
802 808
803/* l4_wkup -> wd_timer2 */ 809/* l4_wkup -> wd_timer2 */
@@ -838,7 +844,6 @@ static struct omap_hwmod omap2430_wd_timer2_hwmod = {
838 }, 844 },
839 .slaves = omap2430_wd_timer2_slaves, 845 .slaves = omap2430_wd_timer2_slaves,
840 .slaves_cnt = ARRAY_SIZE(omap2430_wd_timer2_slaves), 846 .slaves_cnt = ARRAY_SIZE(omap2430_wd_timer2_slaves),
841 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
842}; 847};
843 848
844/* UART1 */ 849/* UART1 */
@@ -864,7 +869,6 @@ static struct omap_hwmod omap2430_uart1_hwmod = {
864 .slaves = omap2430_uart1_slaves, 869 .slaves = omap2430_uart1_slaves,
865 .slaves_cnt = ARRAY_SIZE(omap2430_uart1_slaves), 870 .slaves_cnt = ARRAY_SIZE(omap2430_uart1_slaves),
866 .class = &omap2_uart_class, 871 .class = &omap2_uart_class,
867 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
868}; 872};
869 873
870/* UART2 */ 874/* UART2 */
@@ -890,7 +894,6 @@ static struct omap_hwmod omap2430_uart2_hwmod = {
890 .slaves = omap2430_uart2_slaves, 894 .slaves = omap2430_uart2_slaves,
891 .slaves_cnt = ARRAY_SIZE(omap2430_uart2_slaves), 895 .slaves_cnt = ARRAY_SIZE(omap2430_uart2_slaves),
892 .class = &omap2_uart_class, 896 .class = &omap2_uart_class,
893 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
894}; 897};
895 898
896/* UART3 */ 899/* UART3 */
@@ -916,7 +919,6 @@ static struct omap_hwmod omap2430_uart3_hwmod = {
916 .slaves = omap2430_uart3_slaves, 919 .slaves = omap2430_uart3_slaves,
917 .slaves_cnt = ARRAY_SIZE(omap2430_uart3_slaves), 920 .slaves_cnt = ARRAY_SIZE(omap2430_uart3_slaves),
918 .class = &omap2_uart_class, 921 .class = &omap2_uart_class,
919 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
920}; 922};
921 923
922/* dss */ 924/* dss */
@@ -964,7 +966,6 @@ static struct omap_hwmod omap2430_dss_core_hwmod = {
964 .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves), 966 .slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves),
965 .masters = omap2430_dss_masters, 967 .masters = omap2430_dss_masters,
966 .masters_cnt = ARRAY_SIZE(omap2430_dss_masters), 968 .masters_cnt = ARRAY_SIZE(omap2430_dss_masters),
967 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
968 .flags = HWMOD_NO_IDLEST, 969 .flags = HWMOD_NO_IDLEST,
969}; 970};
970 971
@@ -998,7 +999,6 @@ static struct omap_hwmod omap2430_dss_dispc_hwmod = {
998 }, 999 },
999 .slaves = omap2430_dss_dispc_slaves, 1000 .slaves = omap2430_dss_dispc_slaves,
1000 .slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves), 1001 .slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves),
1001 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1002 .flags = HWMOD_NO_IDLEST, 1002 .flags = HWMOD_NO_IDLEST,
1003}; 1003};
1004 1004
@@ -1029,7 +1029,6 @@ static struct omap_hwmod omap2430_dss_rfbi_hwmod = {
1029 }, 1029 },
1030 .slaves = omap2430_dss_rfbi_slaves, 1030 .slaves = omap2430_dss_rfbi_slaves,
1031 .slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves), 1031 .slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves),
1032 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1033 .flags = HWMOD_NO_IDLEST, 1032 .flags = HWMOD_NO_IDLEST,
1034}; 1033};
1035 1034
@@ -1061,7 +1060,6 @@ static struct omap_hwmod omap2430_dss_venc_hwmod = {
1061 }, 1060 },
1062 .slaves = omap2430_dss_venc_slaves, 1061 .slaves = omap2430_dss_venc_slaves,
1063 .slaves_cnt = ARRAY_SIZE(omap2430_dss_venc_slaves), 1062 .slaves_cnt = ARRAY_SIZE(omap2430_dss_venc_slaves),
1064 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1065 .flags = HWMOD_NO_IDLEST, 1063 .flags = HWMOD_NO_IDLEST,
1066}; 1064};
1067 1065
@@ -1122,7 +1120,6 @@ static struct omap_hwmod omap2430_i2c1_hwmod = {
1122 .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves), 1120 .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves),
1123 .class = &i2c_class, 1121 .class = &i2c_class,
1124 .dev_attr = &i2c_dev_attr, 1122 .dev_attr = &i2c_dev_attr,
1125 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1126}; 1123};
1127 1124
1128/* I2C2 */ 1125/* I2C2 */
@@ -1150,7 +1147,6 @@ static struct omap_hwmod omap2430_i2c2_hwmod = {
1150 .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves), 1147 .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves),
1151 .class = &i2c_class, 1148 .class = &i2c_class,
1152 .dev_attr = &i2c_dev_attr, 1149 .dev_attr = &i2c_dev_attr,
1153 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1154}; 1150};
1155 1151
1156/* l4_wkup -> gpio1 */ 1152/* l4_wkup -> gpio1 */
@@ -1272,7 +1268,6 @@ static struct omap_hwmod omap2430_gpio1_hwmod = {
1272 .slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves), 1268 .slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves),
1273 .class = &omap2xxx_gpio_hwmod_class, 1269 .class = &omap2xxx_gpio_hwmod_class,
1274 .dev_attr = &gpio_dev_attr, 1270 .dev_attr = &gpio_dev_attr,
1275 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1276}; 1271};
1277 1272
1278/* gpio2 */ 1273/* gpio2 */
@@ -1298,7 +1293,6 @@ static struct omap_hwmod omap2430_gpio2_hwmod = {
1298 .slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves), 1293 .slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves),
1299 .class = &omap2xxx_gpio_hwmod_class, 1294 .class = &omap2xxx_gpio_hwmod_class,
1300 .dev_attr = &gpio_dev_attr, 1295 .dev_attr = &gpio_dev_attr,
1301 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1302}; 1296};
1303 1297
1304/* gpio3 */ 1298/* gpio3 */
@@ -1324,7 +1318,6 @@ static struct omap_hwmod omap2430_gpio3_hwmod = {
1324 .slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves), 1318 .slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves),
1325 .class = &omap2xxx_gpio_hwmod_class, 1319 .class = &omap2xxx_gpio_hwmod_class,
1326 .dev_attr = &gpio_dev_attr, 1320 .dev_attr = &gpio_dev_attr,
1327 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1328}; 1321};
1329 1322
1330/* gpio4 */ 1323/* gpio4 */
@@ -1350,7 +1343,6 @@ static struct omap_hwmod omap2430_gpio4_hwmod = {
1350 .slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves), 1343 .slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves),
1351 .class = &omap2xxx_gpio_hwmod_class, 1344 .class = &omap2xxx_gpio_hwmod_class,
1352 .dev_attr = &gpio_dev_attr, 1345 .dev_attr = &gpio_dev_attr,
1353 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1354}; 1346};
1355 1347
1356/* gpio5 */ 1348/* gpio5 */
@@ -1381,7 +1373,6 @@ static struct omap_hwmod omap2430_gpio5_hwmod = {
1381 .slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves), 1373 .slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves),
1382 .class = &omap2xxx_gpio_hwmod_class, 1374 .class = &omap2xxx_gpio_hwmod_class,
1383 .dev_attr = &gpio_dev_attr, 1375 .dev_attr = &gpio_dev_attr,
1384 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1385}; 1376};
1386 1377
1387/* dma attributes */ 1378/* dma attributes */
@@ -1428,7 +1419,6 @@ static struct omap_hwmod omap2430_dma_system_hwmod = {
1428 .masters = omap2430_dma_system_masters, 1419 .masters = omap2430_dma_system_masters,
1429 .masters_cnt = ARRAY_SIZE(omap2430_dma_system_masters), 1420 .masters_cnt = ARRAY_SIZE(omap2430_dma_system_masters),
1430 .dev_attr = &dma_dev_attr, 1421 .dev_attr = &dma_dev_attr,
1431 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1432 .flags = HWMOD_NO_IDLEST, 1422 .flags = HWMOD_NO_IDLEST,
1433}; 1423};
1434 1424
@@ -1468,7 +1458,6 @@ static struct omap_hwmod omap2430_mailbox_hwmod = {
1468 }, 1458 },
1469 .slaves = omap2430_mailbox_slaves, 1459 .slaves = omap2430_mailbox_slaves,
1470 .slaves_cnt = ARRAY_SIZE(omap2430_mailbox_slaves), 1460 .slaves_cnt = ARRAY_SIZE(omap2430_mailbox_slaves),
1471 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1472}; 1461};
1473 1462
1474/* mcspi1 */ 1463/* mcspi1 */
@@ -1498,7 +1487,6 @@ static struct omap_hwmod omap2430_mcspi1_hwmod = {
1498 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi1_slaves), 1487 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi1_slaves),
1499 .class = &omap2xxx_mcspi_class, 1488 .class = &omap2xxx_mcspi_class,
1500 .dev_attr = &omap_mcspi1_dev_attr, 1489 .dev_attr = &omap_mcspi1_dev_attr,
1501 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1502}; 1490};
1503 1491
1504/* mcspi2 */ 1492/* mcspi2 */
@@ -1528,7 +1516,6 @@ static struct omap_hwmod omap2430_mcspi2_hwmod = {
1528 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi2_slaves), 1516 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi2_slaves),
1529 .class = &omap2xxx_mcspi_class, 1517 .class = &omap2xxx_mcspi_class,
1530 .dev_attr = &omap_mcspi2_dev_attr, 1518 .dev_attr = &omap_mcspi2_dev_attr,
1531 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1532}; 1519};
1533 1520
1534/* mcspi3 */ 1521/* mcspi3 */
@@ -1571,7 +1558,6 @@ static struct omap_hwmod omap2430_mcspi3_hwmod = {
1571 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi3_slaves), 1558 .slaves_cnt = ARRAY_SIZE(omap2430_mcspi3_slaves),
1572 .class = &omap2xxx_mcspi_class, 1559 .class = &omap2xxx_mcspi_class,
1573 .dev_attr = &omap_mcspi3_dev_attr, 1560 .dev_attr = &omap_mcspi3_dev_attr,
1574 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1575}; 1561};
1576 1562
1577/* 1563/*
@@ -1627,7 +1613,6 @@ static struct omap_hwmod omap2430_usbhsotg_hwmod = {
1627 */ 1613 */
1628 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE 1614 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
1629 | HWMOD_SWSUP_MSTANDBY, 1615 | HWMOD_SWSUP_MSTANDBY,
1630 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
1631}; 1616};
1632 1617
1633/* 1618/*
@@ -1688,7 +1673,6 @@ static struct omap_hwmod omap2430_mcbsp1_hwmod = {
1688 }, 1673 },
1689 .slaves = omap2430_mcbsp1_slaves, 1674 .slaves = omap2430_mcbsp1_slaves,
1690 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp1_slaves), 1675 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp1_slaves),
1691 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1692}; 1676};
1693 1677
1694/* mcbsp2 */ 1678/* mcbsp2 */
@@ -1730,7 +1714,6 @@ static struct omap_hwmod omap2430_mcbsp2_hwmod = {
1730 }, 1714 },
1731 .slaves = omap2430_mcbsp2_slaves, 1715 .slaves = omap2430_mcbsp2_slaves,
1732 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp2_slaves), 1716 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp2_slaves),
1733 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1734}; 1717};
1735 1718
1736/* mcbsp3 */ 1719/* mcbsp3 */
@@ -1782,7 +1765,6 @@ static struct omap_hwmod omap2430_mcbsp3_hwmod = {
1782 }, 1765 },
1783 .slaves = omap2430_mcbsp3_slaves, 1766 .slaves = omap2430_mcbsp3_slaves,
1784 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp3_slaves), 1767 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp3_slaves),
1785 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1786}; 1768};
1787 1769
1788/* mcbsp4 */ 1770/* mcbsp4 */
@@ -1840,7 +1822,6 @@ static struct omap_hwmod omap2430_mcbsp4_hwmod = {
1840 }, 1822 },
1841 .slaves = omap2430_mcbsp4_slaves, 1823 .slaves = omap2430_mcbsp4_slaves,
1842 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp4_slaves), 1824 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp4_slaves),
1843 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1844}; 1825};
1845 1826
1846/* mcbsp5 */ 1827/* mcbsp5 */
@@ -1898,7 +1879,6 @@ static struct omap_hwmod omap2430_mcbsp5_hwmod = {
1898 }, 1879 },
1899 .slaves = omap2430_mcbsp5_slaves, 1880 .slaves = omap2430_mcbsp5_slaves,
1900 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp5_slaves), 1881 .slaves_cnt = ARRAY_SIZE(omap2430_mcbsp5_slaves),
1901 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1902}; 1882};
1903 1883
1904/* MMC/SD/SDIO common */ 1884/* MMC/SD/SDIO common */
@@ -1965,7 +1945,6 @@ static struct omap_hwmod omap2430_mmc1_hwmod = {
1965 .slaves = omap2430_mmc1_slaves, 1945 .slaves = omap2430_mmc1_slaves,
1966 .slaves_cnt = ARRAY_SIZE(omap2430_mmc1_slaves), 1946 .slaves_cnt = ARRAY_SIZE(omap2430_mmc1_slaves),
1967 .class = &omap2430_mmc_class, 1947 .class = &omap2430_mmc_class,
1968 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
1969}; 1948};
1970 1949
1971/* MMC/SD/SDIO2 */ 1950/* MMC/SD/SDIO2 */
@@ -2009,7 +1988,6 @@ static struct omap_hwmod omap2430_mmc2_hwmod = {
2009 .slaves = omap2430_mmc2_slaves, 1988 .slaves = omap2430_mmc2_slaves,
2010 .slaves_cnt = ARRAY_SIZE(omap2430_mmc2_slaves), 1989 .slaves_cnt = ARRAY_SIZE(omap2430_mmc2_slaves),
2011 .class = &omap2430_mmc_class, 1990 .class = &omap2430_mmc_class,
2012 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
2013}; 1991};
2014 1992
2015static __initdata struct omap_hwmod *omap2430_hwmods[] = { 1993static __initdata struct omap_hwmod *omap2430_hwmods[] = {
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 25bf43b5a4ec..2e4852d9574f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -156,7 +156,6 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod = {
156 .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters), 156 .masters_cnt = ARRAY_SIZE(omap3xxx_l3_main_masters),
157 .slaves = omap3xxx_l3_main_slaves, 157 .slaves = omap3xxx_l3_main_slaves,
158 .slaves_cnt = ARRAY_SIZE(omap3xxx_l3_main_slaves), 158 .slaves_cnt = ARRAY_SIZE(omap3xxx_l3_main_slaves),
159 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
160 .flags = HWMOD_NO_IDLEST, 159 .flags = HWMOD_NO_IDLEST,
161}; 160};
162 161
@@ -459,7 +458,6 @@ static struct omap_hwmod omap3xxx_l4_core_hwmod = {
459 .class = &l4_hwmod_class, 458 .class = &l4_hwmod_class,
460 .slaves = omap3xxx_l4_core_slaves, 459 .slaves = omap3xxx_l4_core_slaves,
461 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves), 460 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_core_slaves),
462 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
463 .flags = HWMOD_NO_IDLEST, 461 .flags = HWMOD_NO_IDLEST,
464}; 462};
465 463
@@ -474,7 +472,6 @@ static struct omap_hwmod omap3xxx_l4_per_hwmod = {
474 .class = &l4_hwmod_class, 472 .class = &l4_hwmod_class,
475 .slaves = omap3xxx_l4_per_slaves, 473 .slaves = omap3xxx_l4_per_slaves,
476 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves), 474 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_per_slaves),
477 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
478 .flags = HWMOD_NO_IDLEST, 475 .flags = HWMOD_NO_IDLEST,
479}; 476};
480 477
@@ -489,7 +486,6 @@ static struct omap_hwmod omap3xxx_l4_wkup_hwmod = {
489 .class = &l4_hwmod_class, 486 .class = &l4_hwmod_class,
490 .slaves = omap3xxx_l4_wkup_slaves, 487 .slaves = omap3xxx_l4_wkup_slaves,
491 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves), 488 .slaves_cnt = ARRAY_SIZE(omap3xxx_l4_wkup_slaves),
492 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
493 .flags = HWMOD_NO_IDLEST, 489 .flags = HWMOD_NO_IDLEST,
494}; 490};
495 491
@@ -505,7 +501,6 @@ static struct omap_hwmod omap3xxx_mpu_hwmod = {
505 .main_clk = "arm_fck", 501 .main_clk = "arm_fck",
506 .masters = omap3xxx_mpu_masters, 502 .masters = omap3xxx_mpu_masters,
507 .masters_cnt = ARRAY_SIZE(omap3xxx_mpu_masters), 503 .masters_cnt = ARRAY_SIZE(omap3xxx_mpu_masters),
508 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
509}; 504};
510 505
511/* 506/*
@@ -533,7 +528,6 @@ static struct omap_hwmod omap3xxx_iva_hwmod = {
533 .class = &iva_hwmod_class, 528 .class = &iva_hwmod_class,
534 .masters = omap3xxx_iva_masters, 529 .masters = omap3xxx_iva_masters,
535 .masters_cnt = ARRAY_SIZE(omap3xxx_iva_masters), 530 .masters_cnt = ARRAY_SIZE(omap3xxx_iva_masters),
536 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
537}; 531};
538 532
539/* timer class */ 533/* timer class */
@@ -570,6 +564,21 @@ static struct omap_hwmod_class omap3xxx_timer_hwmod_class = {
570 .rev = OMAP_TIMER_IP_VERSION_1, 564 .rev = OMAP_TIMER_IP_VERSION_1,
571}; 565};
572 566
567/* secure timers dev attribute */
568static struct omap_timer_capability_dev_attr capability_secure_dev_attr = {
569 .timer_capability = OMAP_TIMER_SECURE,
570};
571
572/* always-on timers dev attribute */
573static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
574 .timer_capability = OMAP_TIMER_ALWON,
575};
576
577/* pwm timers dev attribute */
578static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
579 .timer_capability = OMAP_TIMER_HAS_PWM,
580};
581
573/* timer1 */ 582/* timer1 */
574static struct omap_hwmod omap3xxx_timer1_hwmod; 583static struct omap_hwmod omap3xxx_timer1_hwmod;
575 584
@@ -610,10 +619,10 @@ static struct omap_hwmod omap3xxx_timer1_hwmod = {
610 .idlest_idle_bit = OMAP3430_ST_GPT1_SHIFT, 619 .idlest_idle_bit = OMAP3430_ST_GPT1_SHIFT,
611 }, 620 },
612 }, 621 },
622 .dev_attr = &capability_alwon_dev_attr,
613 .slaves = omap3xxx_timer1_slaves, 623 .slaves = omap3xxx_timer1_slaves,
614 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer1_slaves), 624 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer1_slaves),
615 .class = &omap3xxx_timer_1ms_hwmod_class, 625 .class = &omap3xxx_timer_1ms_hwmod_class,
616 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
617}; 626};
618 627
619/* timer2 */ 628/* timer2 */
@@ -656,10 +665,10 @@ static struct omap_hwmod omap3xxx_timer2_hwmod = {
656 .idlest_idle_bit = OMAP3430_ST_GPT2_SHIFT, 665 .idlest_idle_bit = OMAP3430_ST_GPT2_SHIFT,
657 }, 666 },
658 }, 667 },
668 .dev_attr = &capability_alwon_dev_attr,
659 .slaves = omap3xxx_timer2_slaves, 669 .slaves = omap3xxx_timer2_slaves,
660 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer2_slaves), 670 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer2_slaves),
661 .class = &omap3xxx_timer_1ms_hwmod_class, 671 .class = &omap3xxx_timer_1ms_hwmod_class,
662 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
663}; 672};
664 673
665/* timer3 */ 674/* timer3 */
@@ -702,10 +711,10 @@ static struct omap_hwmod omap3xxx_timer3_hwmod = {
702 .idlest_idle_bit = OMAP3430_ST_GPT3_SHIFT, 711 .idlest_idle_bit = OMAP3430_ST_GPT3_SHIFT,
703 }, 712 },
704 }, 713 },
714 .dev_attr = &capability_alwon_dev_attr,
705 .slaves = omap3xxx_timer3_slaves, 715 .slaves = omap3xxx_timer3_slaves,
706 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer3_slaves), 716 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer3_slaves),
707 .class = &omap3xxx_timer_hwmod_class, 717 .class = &omap3xxx_timer_hwmod_class,
708 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
709}; 718};
710 719
711/* timer4 */ 720/* timer4 */
@@ -748,10 +757,10 @@ static struct omap_hwmod omap3xxx_timer4_hwmod = {
748 .idlest_idle_bit = OMAP3430_ST_GPT4_SHIFT, 757 .idlest_idle_bit = OMAP3430_ST_GPT4_SHIFT,
749 }, 758 },
750 }, 759 },
760 .dev_attr = &capability_alwon_dev_attr,
751 .slaves = omap3xxx_timer4_slaves, 761 .slaves = omap3xxx_timer4_slaves,
752 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer4_slaves), 762 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer4_slaves),
753 .class = &omap3xxx_timer_hwmod_class, 763 .class = &omap3xxx_timer_hwmod_class,
754 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
755}; 764};
756 765
757/* timer5 */ 766/* timer5 */
@@ -794,10 +803,10 @@ static struct omap_hwmod omap3xxx_timer5_hwmod = {
794 .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT, 803 .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT,
795 }, 804 },
796 }, 805 },
806 .dev_attr = &capability_alwon_dev_attr,
797 .slaves = omap3xxx_timer5_slaves, 807 .slaves = omap3xxx_timer5_slaves,
798 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer5_slaves), 808 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer5_slaves),
799 .class = &omap3xxx_timer_hwmod_class, 809 .class = &omap3xxx_timer_hwmod_class,
800 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
801}; 810};
802 811
803/* timer6 */ 812/* timer6 */
@@ -840,10 +849,10 @@ static struct omap_hwmod omap3xxx_timer6_hwmod = {
840 .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT, 849 .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT,
841 }, 850 },
842 }, 851 },
852 .dev_attr = &capability_alwon_dev_attr,
843 .slaves = omap3xxx_timer6_slaves, 853 .slaves = omap3xxx_timer6_slaves,
844 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer6_slaves), 854 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer6_slaves),
845 .class = &omap3xxx_timer_hwmod_class, 855 .class = &omap3xxx_timer_hwmod_class,
846 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
847}; 856};
848 857
849/* timer7 */ 858/* timer7 */
@@ -886,10 +895,10 @@ static struct omap_hwmod omap3xxx_timer7_hwmod = {
886 .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT, 895 .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT,
887 }, 896 },
888 }, 897 },
898 .dev_attr = &capability_alwon_dev_attr,
889 .slaves = omap3xxx_timer7_slaves, 899 .slaves = omap3xxx_timer7_slaves,
890 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer7_slaves), 900 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer7_slaves),
891 .class = &omap3xxx_timer_hwmod_class, 901 .class = &omap3xxx_timer_hwmod_class,
892 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
893}; 902};
894 903
895/* timer8 */ 904/* timer8 */
@@ -932,10 +941,10 @@ static struct omap_hwmod omap3xxx_timer8_hwmod = {
932 .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT, 941 .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT,
933 }, 942 },
934 }, 943 },
944 .dev_attr = &capability_pwm_dev_attr,
935 .slaves = omap3xxx_timer8_slaves, 945 .slaves = omap3xxx_timer8_slaves,
936 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer8_slaves), 946 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer8_slaves),
937 .class = &omap3xxx_timer_hwmod_class, 947 .class = &omap3xxx_timer_hwmod_class,
938 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
939}; 948};
940 949
941/* timer9 */ 950/* timer9 */
@@ -978,10 +987,10 @@ static struct omap_hwmod omap3xxx_timer9_hwmod = {
978 .idlest_idle_bit = OMAP3430_ST_GPT9_SHIFT, 987 .idlest_idle_bit = OMAP3430_ST_GPT9_SHIFT,
979 }, 988 },
980 }, 989 },
990 .dev_attr = &capability_pwm_dev_attr,
981 .slaves = omap3xxx_timer9_slaves, 991 .slaves = omap3xxx_timer9_slaves,
982 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer9_slaves), 992 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer9_slaves),
983 .class = &omap3xxx_timer_hwmod_class, 993 .class = &omap3xxx_timer_hwmod_class,
984 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
985}; 994};
986 995
987/* timer10 */ 996/* timer10 */
@@ -1015,10 +1024,10 @@ static struct omap_hwmod omap3xxx_timer10_hwmod = {
1015 .idlest_idle_bit = OMAP3430_ST_GPT10_SHIFT, 1024 .idlest_idle_bit = OMAP3430_ST_GPT10_SHIFT,
1016 }, 1025 },
1017 }, 1026 },
1027 .dev_attr = &capability_pwm_dev_attr,
1018 .slaves = omap3xxx_timer10_slaves, 1028 .slaves = omap3xxx_timer10_slaves,
1019 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer10_slaves), 1029 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer10_slaves),
1020 .class = &omap3xxx_timer_1ms_hwmod_class, 1030 .class = &omap3xxx_timer_1ms_hwmod_class,
1021 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1022}; 1031};
1023 1032
1024/* timer11 */ 1033/* timer11 */
@@ -1052,10 +1061,10 @@ static struct omap_hwmod omap3xxx_timer11_hwmod = {
1052 .idlest_idle_bit = OMAP3430_ST_GPT11_SHIFT, 1061 .idlest_idle_bit = OMAP3430_ST_GPT11_SHIFT,
1053 }, 1062 },
1054 }, 1063 },
1064 .dev_attr = &capability_pwm_dev_attr,
1055 .slaves = omap3xxx_timer11_slaves, 1065 .slaves = omap3xxx_timer11_slaves,
1056 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer11_slaves), 1066 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer11_slaves),
1057 .class = &omap3xxx_timer_hwmod_class, 1067 .class = &omap3xxx_timer_hwmod_class,
1058 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1059}; 1068};
1060 1069
1061/* timer12*/ 1070/* timer12*/
@@ -1102,10 +1111,10 @@ static struct omap_hwmod omap3xxx_timer12_hwmod = {
1102 .idlest_idle_bit = OMAP3430_ST_GPT12_SHIFT, 1111 .idlest_idle_bit = OMAP3430_ST_GPT12_SHIFT,
1103 }, 1112 },
1104 }, 1113 },
1114 .dev_attr = &capability_secure_dev_attr,
1105 .slaves = omap3xxx_timer12_slaves, 1115 .slaves = omap3xxx_timer12_slaves,
1106 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer12_slaves), 1116 .slaves_cnt = ARRAY_SIZE(omap3xxx_timer12_slaves),
1107 .class = &omap3xxx_timer_hwmod_class, 1117 .class = &omap3xxx_timer_hwmod_class,
1108 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
1109}; 1118};
1110 1119
1111/* l4_wkup -> wd_timer2 */ 1120/* l4_wkup -> wd_timer2 */
@@ -1182,7 +1191,6 @@ static struct omap_hwmod omap3xxx_wd_timer2_hwmod = {
1182 }, 1191 },
1183 .slaves = omap3xxx_wd_timer2_slaves, 1192 .slaves = omap3xxx_wd_timer2_slaves,
1184 .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves), 1193 .slaves_cnt = ARRAY_SIZE(omap3xxx_wd_timer2_slaves),
1185 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1186 /* 1194 /*
1187 * XXX: Use software supervised mode, HW supervised smartidle seems to 1195 * XXX: Use software supervised mode, HW supervised smartidle seems to
1188 * block CORE power domain idle transitions. Maybe a HW bug in wdt2? 1196 * block CORE power domain idle transitions. Maybe a HW bug in wdt2?
@@ -1213,7 +1221,6 @@ static struct omap_hwmod omap3xxx_uart1_hwmod = {
1213 .slaves = omap3xxx_uart1_slaves, 1221 .slaves = omap3xxx_uart1_slaves,
1214 .slaves_cnt = ARRAY_SIZE(omap3xxx_uart1_slaves), 1222 .slaves_cnt = ARRAY_SIZE(omap3xxx_uart1_slaves),
1215 .class = &omap2_uart_class, 1223 .class = &omap2_uart_class,
1216 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1217}; 1224};
1218 1225
1219/* UART2 */ 1226/* UART2 */
@@ -1239,7 +1246,6 @@ static struct omap_hwmod omap3xxx_uart2_hwmod = {
1239 .slaves = omap3xxx_uart2_slaves, 1246 .slaves = omap3xxx_uart2_slaves,
1240 .slaves_cnt = ARRAY_SIZE(omap3xxx_uart2_slaves), 1247 .slaves_cnt = ARRAY_SIZE(omap3xxx_uart2_slaves),
1241 .class = &omap2_uart_class, 1248 .class = &omap2_uart_class,
1242 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1243}; 1249};
1244 1250
1245/* UART3 */ 1251/* UART3 */
@@ -1265,7 +1271,6 @@ static struct omap_hwmod omap3xxx_uart3_hwmod = {
1265 .slaves = omap3xxx_uart3_slaves, 1271 .slaves = omap3xxx_uart3_slaves,
1266 .slaves_cnt = ARRAY_SIZE(omap3xxx_uart3_slaves), 1272 .slaves_cnt = ARRAY_SIZE(omap3xxx_uart3_slaves),
1267 .class = &omap2_uart_class, 1273 .class = &omap2_uart_class,
1268 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1269}; 1274};
1270 1275
1271/* UART4 */ 1276/* UART4 */
@@ -1302,7 +1307,6 @@ static struct omap_hwmod omap3xxx_uart4_hwmod = {
1302 .slaves = omap3xxx_uart4_slaves, 1307 .slaves = omap3xxx_uart4_slaves,
1303 .slaves_cnt = ARRAY_SIZE(omap3xxx_uart4_slaves), 1308 .slaves_cnt = ARRAY_SIZE(omap3xxx_uart4_slaves),
1304 .class = &omap2_uart_class, 1309 .class = &omap2_uart_class,
1305 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
1306}; 1310};
1307 1311
1308static struct omap_hwmod_class i2c_class = { 1312static struct omap_hwmod_class i2c_class = {
@@ -1390,7 +1394,6 @@ static struct omap_hwmod omap3430es1_dss_core_hwmod = {
1390 .slaves_cnt = ARRAY_SIZE(omap3430es1_dss_slaves), 1394 .slaves_cnt = ARRAY_SIZE(omap3430es1_dss_slaves),
1391 .masters = omap3xxx_dss_masters, 1395 .masters = omap3xxx_dss_masters,
1392 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters), 1396 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters),
1393 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
1394 .flags = HWMOD_NO_IDLEST, 1397 .flags = HWMOD_NO_IDLEST,
1395}; 1398};
1396 1399
@@ -1415,8 +1418,6 @@ static struct omap_hwmod omap3xxx_dss_core_hwmod = {
1415 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_slaves), 1418 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_slaves),
1416 .masters = omap3xxx_dss_masters, 1419 .masters = omap3xxx_dss_masters,
1417 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters), 1420 .masters_cnt = ARRAY_SIZE(omap3xxx_dss_masters),
1418 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2 |
1419 CHIP_IS_OMAP3630ES1 | CHIP_GE_OMAP3630ES1_1),
1420}; 1421};
1421 1422
1422/* l4_core -> dss_dispc */ 1423/* l4_core -> dss_dispc */
@@ -1454,9 +1455,6 @@ static struct omap_hwmod omap3xxx_dss_dispc_hwmod = {
1454 }, 1455 },
1455 .slaves = omap3xxx_dss_dispc_slaves, 1456 .slaves = omap3xxx_dss_dispc_slaves,
1456 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_slaves), 1457 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dispc_slaves),
1457 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1458 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1459 CHIP_GE_OMAP3630ES1_1),
1460 .flags = HWMOD_NO_IDLEST, 1458 .flags = HWMOD_NO_IDLEST,
1461}; 1459};
1462 1460
@@ -1518,9 +1516,6 @@ static struct omap_hwmod omap3xxx_dss_dsi1_hwmod = {
1518 }, 1516 },
1519 .slaves = omap3xxx_dss_dsi1_slaves, 1517 .slaves = omap3xxx_dss_dsi1_slaves,
1520 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_slaves), 1518 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_dsi1_slaves),
1521 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1522 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1523 CHIP_GE_OMAP3630ES1_1),
1524 .flags = HWMOD_NO_IDLEST, 1519 .flags = HWMOD_NO_IDLEST,
1525}; 1520};
1526 1521
@@ -1558,9 +1553,6 @@ static struct omap_hwmod omap3xxx_dss_rfbi_hwmod = {
1558 }, 1553 },
1559 .slaves = omap3xxx_dss_rfbi_slaves, 1554 .slaves = omap3xxx_dss_rfbi_slaves,
1560 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_slaves), 1555 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_rfbi_slaves),
1561 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1562 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1563 CHIP_GE_OMAP3630ES1_1),
1564 .flags = HWMOD_NO_IDLEST, 1556 .flags = HWMOD_NO_IDLEST,
1565}; 1557};
1566 1558
@@ -1599,9 +1591,6 @@ static struct omap_hwmod omap3xxx_dss_venc_hwmod = {
1599 }, 1591 },
1600 .slaves = omap3xxx_dss_venc_slaves, 1592 .slaves = omap3xxx_dss_venc_slaves,
1601 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_venc_slaves), 1593 .slaves_cnt = ARRAY_SIZE(omap3xxx_dss_venc_slaves),
1602 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
1603 CHIP_GE_OMAP3430ES2 | CHIP_IS_OMAP3630ES1 |
1604 CHIP_GE_OMAP3630ES1_1),
1605 .flags = HWMOD_NO_IDLEST, 1594 .flags = HWMOD_NO_IDLEST,
1606}; 1595};
1607 1596
@@ -1637,7 +1626,6 @@ static struct omap_hwmod omap3xxx_i2c1_hwmod = {
1637 .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c1_slaves), 1626 .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c1_slaves),
1638 .class = &i2c_class, 1627 .class = &i2c_class,
1639 .dev_attr = &i2c1_dev_attr, 1628 .dev_attr = &i2c1_dev_attr,
1640 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1641}; 1629};
1642 1630
1643/* I2C2 */ 1631/* I2C2 */
@@ -1672,7 +1660,6 @@ static struct omap_hwmod omap3xxx_i2c2_hwmod = {
1672 .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c2_slaves), 1660 .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c2_slaves),
1673 .class = &i2c_class, 1661 .class = &i2c_class,
1674 .dev_attr = &i2c2_dev_attr, 1662 .dev_attr = &i2c2_dev_attr,
1675 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1676}; 1663};
1677 1664
1678/* I2C3 */ 1665/* I2C3 */
@@ -1718,7 +1705,6 @@ static struct omap_hwmod omap3xxx_i2c3_hwmod = {
1718 .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c3_slaves), 1705 .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c3_slaves),
1719 .class = &i2c_class, 1706 .class = &i2c_class,
1720 .dev_attr = &i2c3_dev_attr, 1707 .dev_attr = &i2c3_dev_attr,
1721 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1722}; 1708};
1723 1709
1724/* l4_wkup -> gpio1 */ 1710/* l4_wkup -> gpio1 */
@@ -1880,7 +1866,6 @@ static struct omap_hwmod omap3xxx_gpio1_hwmod = {
1880 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio1_slaves), 1866 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio1_slaves),
1881 .class = &omap3xxx_gpio_hwmod_class, 1867 .class = &omap3xxx_gpio_hwmod_class,
1882 .dev_attr = &gpio_dev_attr, 1868 .dev_attr = &gpio_dev_attr,
1883 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1884}; 1869};
1885 1870
1886/* gpio2 */ 1871/* gpio2 */
@@ -1912,7 +1897,6 @@ static struct omap_hwmod omap3xxx_gpio2_hwmod = {
1912 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio2_slaves), 1897 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio2_slaves),
1913 .class = &omap3xxx_gpio_hwmod_class, 1898 .class = &omap3xxx_gpio_hwmod_class,
1914 .dev_attr = &gpio_dev_attr, 1899 .dev_attr = &gpio_dev_attr,
1915 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1916}; 1900};
1917 1901
1918/* gpio3 */ 1902/* gpio3 */
@@ -1944,7 +1928,6 @@ static struct omap_hwmod omap3xxx_gpio3_hwmod = {
1944 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio3_slaves), 1928 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio3_slaves),
1945 .class = &omap3xxx_gpio_hwmod_class, 1929 .class = &omap3xxx_gpio_hwmod_class,
1946 .dev_attr = &gpio_dev_attr, 1930 .dev_attr = &gpio_dev_attr,
1947 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1948}; 1931};
1949 1932
1950/* gpio4 */ 1933/* gpio4 */
@@ -1976,7 +1959,6 @@ static struct omap_hwmod omap3xxx_gpio4_hwmod = {
1976 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio4_slaves), 1959 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio4_slaves),
1977 .class = &omap3xxx_gpio_hwmod_class, 1960 .class = &omap3xxx_gpio_hwmod_class,
1978 .dev_attr = &gpio_dev_attr, 1961 .dev_attr = &gpio_dev_attr,
1979 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1980}; 1962};
1981 1963
1982/* gpio5 */ 1964/* gpio5 */
@@ -2013,7 +1995,6 @@ static struct omap_hwmod omap3xxx_gpio5_hwmod = {
2013 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio5_slaves), 1995 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio5_slaves),
2014 .class = &omap3xxx_gpio_hwmod_class, 1996 .class = &omap3xxx_gpio_hwmod_class,
2015 .dev_attr = &gpio_dev_attr, 1997 .dev_attr = &gpio_dev_attr,
2016 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2017}; 1998};
2018 1999
2019/* gpio6 */ 2000/* gpio6 */
@@ -2050,7 +2031,6 @@ static struct omap_hwmod omap3xxx_gpio6_hwmod = {
2050 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio6_slaves), 2031 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio6_slaves),
2051 .class = &omap3xxx_gpio_hwmod_class, 2032 .class = &omap3xxx_gpio_hwmod_class,
2052 .dev_attr = &gpio_dev_attr, 2033 .dev_attr = &gpio_dev_attr,
2053 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2054}; 2034};
2055 2035
2056/* dma_system -> L3 */ 2036/* dma_system -> L3 */
@@ -2134,7 +2114,6 @@ static struct omap_hwmod omap3xxx_dma_system_hwmod = {
2134 .masters = omap3xxx_dma_system_masters, 2114 .masters = omap3xxx_dma_system_masters,
2135 .masters_cnt = ARRAY_SIZE(omap3xxx_dma_system_masters), 2115 .masters_cnt = ARRAY_SIZE(omap3xxx_dma_system_masters),
2136 .dev_attr = &dma_dev_attr, 2116 .dev_attr = &dma_dev_attr,
2137 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2138 .flags = HWMOD_NO_IDLEST, 2117 .flags = HWMOD_NO_IDLEST,
2139}; 2118};
2140 2119
@@ -2207,7 +2186,6 @@ static struct omap_hwmod omap3xxx_mcbsp1_hwmod = {
2207 }, 2186 },
2208 .slaves = omap3xxx_mcbsp1_slaves, 2187 .slaves = omap3xxx_mcbsp1_slaves,
2209 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_slaves), 2188 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp1_slaves),
2210 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2211}; 2189};
2212 2190
2213/* mcbsp2 */ 2191/* mcbsp2 */
@@ -2264,7 +2242,6 @@ static struct omap_hwmod omap3xxx_mcbsp2_hwmod = {
2264 .slaves = omap3xxx_mcbsp2_slaves, 2242 .slaves = omap3xxx_mcbsp2_slaves,
2265 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_slaves), 2243 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_slaves),
2266 .dev_attr = &omap34xx_mcbsp2_dev_attr, 2244 .dev_attr = &omap34xx_mcbsp2_dev_attr,
2267 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2268}; 2245};
2269 2246
2270/* mcbsp3 */ 2247/* mcbsp3 */
@@ -2321,7 +2298,6 @@ static struct omap_hwmod omap3xxx_mcbsp3_hwmod = {
2321 .slaves = omap3xxx_mcbsp3_slaves, 2298 .slaves = omap3xxx_mcbsp3_slaves,
2322 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_slaves), 2299 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_slaves),
2323 .dev_attr = &omap34xx_mcbsp3_dev_attr, 2300 .dev_attr = &omap34xx_mcbsp3_dev_attr,
2324 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2325}; 2301};
2326 2302
2327/* mcbsp4 */ 2303/* mcbsp4 */
@@ -2379,7 +2355,6 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod = {
2379 }, 2355 },
2380 .slaves = omap3xxx_mcbsp4_slaves, 2356 .slaves = omap3xxx_mcbsp4_slaves,
2381 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_slaves), 2357 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp4_slaves),
2382 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2383}; 2358};
2384 2359
2385/* mcbsp5 */ 2360/* mcbsp5 */
@@ -2437,7 +2412,6 @@ static struct omap_hwmod omap3xxx_mcbsp5_hwmod = {
2437 }, 2412 },
2438 .slaves = omap3xxx_mcbsp5_slaves, 2413 .slaves = omap3xxx_mcbsp5_slaves,
2439 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_slaves), 2414 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp5_slaves),
2440 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2441}; 2415};
2442/* 'mcbsp sidetone' class */ 2416/* 'mcbsp sidetone' class */
2443 2417
@@ -2498,7 +2472,6 @@ static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = {
2498 }, 2472 },
2499 .slaves = omap3xxx_mcbsp2_sidetone_slaves, 2473 .slaves = omap3xxx_mcbsp2_sidetone_slaves,
2500 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_slaves), 2474 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_slaves),
2501 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2502}; 2475};
2503 2476
2504/* mcbsp3_sidetone */ 2477/* mcbsp3_sidetone */
@@ -2547,7 +2520,6 @@ static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = {
2547 }, 2520 },
2548 .slaves = omap3xxx_mcbsp3_sidetone_slaves, 2521 .slaves = omap3xxx_mcbsp3_sidetone_slaves,
2549 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_slaves), 2522 .slaves_cnt = ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_slaves),
2550 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2551}; 2523};
2552 2524
2553 2525
@@ -2609,9 +2581,6 @@ static struct omap_hwmod omap34xx_sr1_hwmod = {
2609 }, 2581 },
2610 .slaves = omap3_sr1_slaves, 2582 .slaves = omap3_sr1_slaves,
2611 .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves), 2583 .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves),
2612 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
2613 CHIP_IS_OMAP3430ES3_0 |
2614 CHIP_IS_OMAP3430ES3_1),
2615 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 2584 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
2616}; 2585};
2617 2586
@@ -2631,7 +2600,6 @@ static struct omap_hwmod omap36xx_sr1_hwmod = {
2631 }, 2600 },
2632 .slaves = omap3_sr1_slaves, 2601 .slaves = omap3_sr1_slaves,
2633 .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves), 2602 .slaves_cnt = ARRAY_SIZE(omap3_sr1_slaves),
2634 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
2635}; 2603};
2636 2604
2637/* SR2 */ 2605/* SR2 */
@@ -2655,9 +2623,6 @@ static struct omap_hwmod omap34xx_sr2_hwmod = {
2655 }, 2623 },
2656 .slaves = omap3_sr2_slaves, 2624 .slaves = omap3_sr2_slaves,
2657 .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves), 2625 .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves),
2658 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2 |
2659 CHIP_IS_OMAP3430ES3_0 |
2660 CHIP_IS_OMAP3430ES3_1),
2661 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 2626 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
2662}; 2627};
2663 2628
@@ -2677,7 +2642,6 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {
2677 }, 2642 },
2678 .slaves = omap3_sr2_slaves, 2643 .slaves = omap3_sr2_slaves,
2679 .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves), 2644 .slaves_cnt = ARRAY_SIZE(omap3_sr2_slaves),
2680 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),
2681}; 2645};
2682 2646
2683/* 2647/*
@@ -2745,7 +2709,6 @@ static struct omap_hwmod omap3xxx_mailbox_hwmod = {
2745 }, 2709 },
2746 .slaves = omap3xxx_mailbox_slaves, 2710 .slaves = omap3xxx_mailbox_slaves,
2747 .slaves_cnt = ARRAY_SIZE(omap3xxx_mailbox_slaves), 2711 .slaves_cnt = ARRAY_SIZE(omap3xxx_mailbox_slaves),
2748 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2749}; 2712};
2750 2713
2751/* l4 core -> mcspi1 interface */ 2714/* l4 core -> mcspi1 interface */
@@ -2843,7 +2806,6 @@ static struct omap_hwmod omap34xx_mcspi1 = {
2843 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi1_slaves), 2806 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi1_slaves),
2844 .class = &omap34xx_mcspi_class, 2807 .class = &omap34xx_mcspi_class,
2845 .dev_attr = &omap_mcspi1_dev_attr, 2808 .dev_attr = &omap_mcspi1_dev_attr,
2846 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2847}; 2809};
2848 2810
2849/* mcspi2 */ 2811/* mcspi2 */
@@ -2873,7 +2835,6 @@ static struct omap_hwmod omap34xx_mcspi2 = {
2873 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi2_slaves), 2835 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi2_slaves),
2874 .class = &omap34xx_mcspi_class, 2836 .class = &omap34xx_mcspi_class,
2875 .dev_attr = &omap_mcspi2_dev_attr, 2837 .dev_attr = &omap_mcspi2_dev_attr,
2876 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2877}; 2838};
2878 2839
2879/* mcspi3 */ 2840/* mcspi3 */
@@ -2916,7 +2877,6 @@ static struct omap_hwmod omap34xx_mcspi3 = {
2916 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi3_slaves), 2877 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi3_slaves),
2917 .class = &omap34xx_mcspi_class, 2878 .class = &omap34xx_mcspi_class,
2918 .dev_attr = &omap_mcspi3_dev_attr, 2879 .dev_attr = &omap_mcspi3_dev_attr,
2919 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2920}; 2880};
2921 2881
2922/* SPI4 */ 2882/* SPI4 */
@@ -2957,7 +2917,6 @@ static struct omap_hwmod omap34xx_mcspi4 = {
2957 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi4_slaves), 2917 .slaves_cnt = ARRAY_SIZE(omap34xx_mcspi4_slaves),
2958 .class = &omap34xx_mcspi_class, 2918 .class = &omap34xx_mcspi_class,
2959 .dev_attr = &omap_mcspi4_dev_attr, 2919 .dev_attr = &omap_mcspi4_dev_attr,
2960 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
2961}; 2920};
2962 2921
2963/* 2922/*
@@ -3014,7 +2973,6 @@ static struct omap_hwmod omap3xxx_usbhsotg_hwmod = {
3014 */ 2973 */
3015 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE 2974 .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
3016 | HWMOD_SWSUP_MSTANDBY, 2975 | HWMOD_SWSUP_MSTANDBY,
3017 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
3018}; 2976};
3019 2977
3020/* usb_otg_hs */ 2978/* usb_otg_hs */
@@ -3042,7 +3000,6 @@ static struct omap_hwmod am35xx_usbhsotg_hwmod = {
3042 .slaves = am35xx_usbhsotg_slaves, 3000 .slaves = am35xx_usbhsotg_slaves,
3043 .slaves_cnt = ARRAY_SIZE(am35xx_usbhsotg_slaves), 3001 .slaves_cnt = ARRAY_SIZE(am35xx_usbhsotg_slaves),
3044 .class = &am35xx_usbotg_class, 3002 .class = &am35xx_usbotg_class,
3045 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1)
3046}; 3003};
3047 3004
3048/* MMC/SD/SDIO common */ 3005/* MMC/SD/SDIO common */
@@ -3108,7 +3065,6 @@ static struct omap_hwmod omap3xxx_mmc1_hwmod = {
3108 .slaves = omap3xxx_mmc1_slaves, 3065 .slaves = omap3xxx_mmc1_slaves,
3109 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves), 3066 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc1_slaves),
3110 .class = &omap34xx_mmc_class, 3067 .class = &omap34xx_mmc_class,
3111 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3112}; 3068};
3113 3069
3114/* MMC/SD/SDIO2 */ 3070/* MMC/SD/SDIO2 */
@@ -3151,7 +3107,6 @@ static struct omap_hwmod omap3xxx_mmc2_hwmod = {
3151 .slaves = omap3xxx_mmc2_slaves, 3107 .slaves = omap3xxx_mmc2_slaves,
3152 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves), 3108 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc2_slaves),
3153 .class = &omap34xx_mmc_class, 3109 .class = &omap34xx_mmc_class,
3154 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3155}; 3110};
3156 3111
3157/* MMC/SD/SDIO3 */ 3112/* MMC/SD/SDIO3 */
@@ -3193,7 +3148,6 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = {
3193 .slaves = omap3xxx_mmc3_slaves, 3148 .slaves = omap3xxx_mmc3_slaves,
3194 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc3_slaves), 3149 .slaves_cnt = ARRAY_SIZE(omap3xxx_mmc3_slaves),
3195 .class = &omap34xx_mmc_class, 3150 .class = &omap34xx_mmc_class,
3196 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
3197}; 3151};
3198 3152
3199static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { 3153static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
@@ -3224,10 +3178,7 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
3224 &omap3xxx_uart1_hwmod, 3178 &omap3xxx_uart1_hwmod,
3225 &omap3xxx_uart2_hwmod, 3179 &omap3xxx_uart2_hwmod,
3226 &omap3xxx_uart3_hwmod, 3180 &omap3xxx_uart3_hwmod,
3227 &omap3xxx_uart4_hwmod,
3228 /* dss class */ 3181 /* dss class */
3229 &omap3430es1_dss_core_hwmod,
3230 &omap3xxx_dss_core_hwmod,
3231 &omap3xxx_dss_dispc_hwmod, 3182 &omap3xxx_dss_dispc_hwmod,
3232 &omap3xxx_dss_dsi1_hwmod, 3183 &omap3xxx_dss_dsi1_hwmod,
3233 &omap3xxx_dss_rfbi_hwmod, 3184 &omap3xxx_dss_rfbi_hwmod,
@@ -3239,9 +3190,6 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
3239 &omap3xxx_i2c3_hwmod, 3190 &omap3xxx_i2c3_hwmod,
3240 &omap34xx_sr1_hwmod, 3191 &omap34xx_sr1_hwmod,
3241 &omap34xx_sr2_hwmod, 3192 &omap34xx_sr2_hwmod,
3242 &omap36xx_sr1_hwmod,
3243 &omap36xx_sr2_hwmod,
3244
3245 3193
3246 /* gpio class */ 3194 /* gpio class */
3247 &omap3xxx_gpio1_hwmod, 3195 &omap3xxx_gpio1_hwmod,
@@ -3272,16 +3220,96 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
3272 &omap34xx_mcspi3, 3220 &omap34xx_mcspi3,
3273 &omap34xx_mcspi4, 3221 &omap34xx_mcspi4,
3274 3222
3275 /* usbotg class */ 3223 NULL,
3224};
3225
3226/* 3430ES1-only hwmods */
3227static __initdata struct omap_hwmod *omap3430es1_hwmods[] = {
3228 &omap3430es1_dss_core_hwmod,
3229 NULL
3230};
3231
3232/* 3430ES2+-only hwmods */
3233static __initdata struct omap_hwmod *omap3430es2plus_hwmods[] = {
3234 &omap3xxx_dss_core_hwmod,
3276 &omap3xxx_usbhsotg_hwmod, 3235 &omap3xxx_usbhsotg_hwmod,
3236 NULL
3237};
3277 3238
3278 /* usbotg for am35x */ 3239/* 34xx-only hwmods (all ES revisions) */
3279 &am35xx_usbhsotg_hwmod, 3240static __initdata struct omap_hwmod *omap34xx_hwmods[] = {
3241 &omap34xx_sr1_hwmod,
3242 &omap34xx_sr2_hwmod,
3243 NULL
3244};
3280 3245
3281 NULL, 3246/* 36xx-only hwmods (all ES revisions) */
3247static __initdata struct omap_hwmod *omap36xx_hwmods[] = {
3248 &omap3xxx_uart4_hwmod,
3249 &omap3xxx_dss_core_hwmod,
3250 &omap36xx_sr1_hwmod,
3251 &omap36xx_sr2_hwmod,
3252 &omap3xxx_usbhsotg_hwmod,
3253 NULL
3254};
3255
3256static __initdata struct omap_hwmod *am35xx_hwmods[] = {
3257 &omap3xxx_dss_core_hwmod, /* XXX ??? */
3258 &am35xx_usbhsotg_hwmod,
3259 NULL
3282}; 3260};
3283 3261
3284int __init omap3xxx_hwmod_init(void) 3262int __init omap3xxx_hwmod_init(void)
3285{ 3263{
3286 return omap_hwmod_register(omap3xxx_hwmods); 3264 int r;
3265 struct omap_hwmod **h = NULL;
3266 unsigned int rev;
3267
3268 /* Register hwmods common to all OMAP3 */
3269 r = omap_hwmod_register(omap3xxx_hwmods);
3270 if (!r)
3271 return r;
3272
3273 rev = omap_rev();
3274
3275 /*
3276 * Register hwmods common to individual OMAP3 families, all
3277 * silicon revisions (e.g., 34xx, or AM3505/3517, or 36xx)
3278 * All possible revisions should be included in this conditional.
3279 */
3280 if (rev == OMAP3430_REV_ES1_0 || rev == OMAP3430_REV_ES2_0 ||
3281 rev == OMAP3430_REV_ES2_1 || rev == OMAP3430_REV_ES3_0 ||
3282 rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2) {
3283 h = omap34xx_hwmods;
3284 } else if (rev == OMAP3517_REV_ES1_0 || rev == OMAP3517_REV_ES1_1) {
3285 h = am35xx_hwmods;
3286 } else if (rev == OMAP3630_REV_ES1_0 || rev == OMAP3630_REV_ES1_1 ||
3287 rev == OMAP3630_REV_ES1_2) {
3288 h = omap36xx_hwmods;
3289 } else {
3290 WARN(1, "OMAP3 hwmod family init: unknown chip type\n");
3291 return -EINVAL;
3292 };
3293
3294 r = omap_hwmod_register(h);
3295 if (!r)
3296 return r;
3297
3298 /*
3299 * Register hwmods specific to certain ES levels of a
3300 * particular family of silicon (e.g., 34xx ES1.0)
3301 */
3302 h = NULL;
3303 if (rev == OMAP3430_REV_ES1_0) {
3304 h = omap3430es1_hwmods;
3305 } else if (rev == OMAP3430_REV_ES2_0 || rev == OMAP3430_REV_ES2_1 ||
3306 rev == OMAP3430_REV_ES3_0 || rev == OMAP3430_REV_ES3_1 ||
3307 rev == OMAP3430_REV_ES3_1_2) {
3308 h = omap3430es2plus_hwmods;
3309 };
3310
3311 if (h)
3312 r = omap_hwmod_register(h);
3313
3314 return r;
3287} 3315}
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 6201422c0606..393afac9caf6 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -29,6 +29,7 @@
29#include <plat/mcbsp.h> 29#include <plat/mcbsp.h>
30#include <plat/mmc.h> 30#include <plat/mmc.h>
31#include <plat/i2c.h> 31#include <plat/i2c.h>
32#include <plat/dmtimer.h>
32 33
33#include "omap_hwmod_common_data.h" 34#include "omap_hwmod_common_data.h"
34 35
@@ -133,7 +134,6 @@ static struct omap_hwmod omap44xx_dmm_hwmod = {
133 .slaves = omap44xx_dmm_slaves, 134 .slaves = omap44xx_dmm_slaves,
134 .slaves_cnt = ARRAY_SIZE(omap44xx_dmm_slaves), 135 .slaves_cnt = ARRAY_SIZE(omap44xx_dmm_slaves),
135 .mpu_irqs = omap44xx_dmm_irqs, 136 .mpu_irqs = omap44xx_dmm_irqs,
136 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
137}; 137};
138 138
139/* 139/*
@@ -189,7 +189,6 @@ static struct omap_hwmod omap44xx_emif_fw_hwmod = {
189 }, 189 },
190 .slaves = omap44xx_emif_fw_slaves, 190 .slaves = omap44xx_emif_fw_slaves,
191 .slaves_cnt = ARRAY_SIZE(omap44xx_emif_fw_slaves), 191 .slaves_cnt = ARRAY_SIZE(omap44xx_emif_fw_slaves),
192 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
193}; 192};
194 193
195/* 194/*
@@ -236,7 +235,6 @@ static struct omap_hwmod omap44xx_l3_instr_hwmod = {
236 }, 235 },
237 .slaves = omap44xx_l3_instr_slaves, 236 .slaves = omap44xx_l3_instr_slaves,
238 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_instr_slaves), 237 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_instr_slaves),
239 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
240}; 238};
241 239
242/* l3_main_1 */ 240/* l3_main_1 */
@@ -336,7 +334,6 @@ static struct omap_hwmod omap44xx_l3_main_1_hwmod = {
336 }, 334 },
337 .slaves = omap44xx_l3_main_1_slaves, 335 .slaves = omap44xx_l3_main_1_slaves,
338 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves), 336 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_1_slaves),
339 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
340}; 337};
341 338
342/* l3_main_2 */ 339/* l3_main_2 */
@@ -438,7 +435,6 @@ static struct omap_hwmod omap44xx_l3_main_2_hwmod = {
438 }, 435 },
439 .slaves = omap44xx_l3_main_2_slaves, 436 .slaves = omap44xx_l3_main_2_slaves,
440 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_2_slaves), 437 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_2_slaves),
441 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
442}; 438};
443 439
444/* l3_main_3 */ 440/* l3_main_3 */
@@ -496,7 +492,6 @@ static struct omap_hwmod omap44xx_l3_main_3_hwmod = {
496 }, 492 },
497 .slaves = omap44xx_l3_main_3_slaves, 493 .slaves = omap44xx_l3_main_3_slaves,
498 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_3_slaves), 494 .slaves_cnt = ARRAY_SIZE(omap44xx_l3_main_3_slaves),
499 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
500}; 495};
501 496
502/* 497/*
@@ -559,7 +554,6 @@ static struct omap_hwmod omap44xx_l4_abe_hwmod = {
559 }, 554 },
560 .slaves = omap44xx_l4_abe_slaves, 555 .slaves = omap44xx_l4_abe_slaves,
561 .slaves_cnt = ARRAY_SIZE(omap44xx_l4_abe_slaves), 556 .slaves_cnt = ARRAY_SIZE(omap44xx_l4_abe_slaves),
562 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
563}; 557};
564 558
565/* l4_cfg */ 559/* l4_cfg */
@@ -588,7 +582,6 @@ static struct omap_hwmod omap44xx_l4_cfg_hwmod = {
588 }, 582 },
589 .slaves = omap44xx_l4_cfg_slaves, 583 .slaves = omap44xx_l4_cfg_slaves,
590 .slaves_cnt = ARRAY_SIZE(omap44xx_l4_cfg_slaves), 584 .slaves_cnt = ARRAY_SIZE(omap44xx_l4_cfg_slaves),
591 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
592}; 585};
593 586
594/* l4_per */ 587/* l4_per */
@@ -617,7 +610,6 @@ static struct omap_hwmod omap44xx_l4_per_hwmod = {
617 }, 610 },
618 .slaves = omap44xx_l4_per_slaves, 611 .slaves = omap44xx_l4_per_slaves,
619 .slaves_cnt = ARRAY_SIZE(omap44xx_l4_per_slaves), 612 .slaves_cnt = ARRAY_SIZE(omap44xx_l4_per_slaves),
620 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
621}; 613};
622 614
623/* l4_wkup */ 615/* l4_wkup */
@@ -646,7 +638,6 @@ static struct omap_hwmod omap44xx_l4_wkup_hwmod = {
646 }, 638 },
647 .slaves = omap44xx_l4_wkup_slaves, 639 .slaves = omap44xx_l4_wkup_slaves,
648 .slaves_cnt = ARRAY_SIZE(omap44xx_l4_wkup_slaves), 640 .slaves_cnt = ARRAY_SIZE(omap44xx_l4_wkup_slaves),
649 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
650}; 641};
651 642
652/* 643/*
@@ -677,7 +668,6 @@ static struct omap_hwmod omap44xx_mpu_private_hwmod = {
677 .clkdm_name = "mpuss_clkdm", 668 .clkdm_name = "mpuss_clkdm",
678 .slaves = omap44xx_mpu_private_slaves, 669 .slaves = omap44xx_mpu_private_slaves,
679 .slaves_cnt = ARRAY_SIZE(omap44xx_mpu_private_slaves), 670 .slaves_cnt = ARRAY_SIZE(omap44xx_mpu_private_slaves),
680 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
681}; 671};
682 672
683/* 673/*
@@ -828,7 +818,6 @@ static struct omap_hwmod omap44xx_aess_hwmod = {
828 .slaves_cnt = ARRAY_SIZE(omap44xx_aess_slaves), 818 .slaves_cnt = ARRAY_SIZE(omap44xx_aess_slaves),
829 .masters = omap44xx_aess_masters, 819 .masters = omap44xx_aess_masters,
830 .masters_cnt = ARRAY_SIZE(omap44xx_aess_masters), 820 .masters_cnt = ARRAY_SIZE(omap44xx_aess_masters),
831 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
832}; 821};
833 822
834/* 823/*
@@ -856,7 +845,6 @@ static struct omap_hwmod omap44xx_bandgap_hwmod = {
856 }, 845 },
857 .opt_clks = bandgap_opt_clks, 846 .opt_clks = bandgap_opt_clks,
858 .opt_clks_cnt = ARRAY_SIZE(bandgap_opt_clks), 847 .opt_clks_cnt = ARRAY_SIZE(bandgap_opt_clks),
859 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
860}; 848};
861 849
862/* 850/*
@@ -917,7 +905,6 @@ static struct omap_hwmod omap44xx_counter_32k_hwmod = {
917 }, 905 },
918 .slaves = omap44xx_counter_32k_slaves, 906 .slaves = omap44xx_counter_32k_slaves,
919 .slaves_cnt = ARRAY_SIZE(omap44xx_counter_32k_slaves), 907 .slaves_cnt = ARRAY_SIZE(omap44xx_counter_32k_slaves),
920 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
921}; 908};
922 909
923/* 910/*
@@ -1005,7 +992,6 @@ static struct omap_hwmod omap44xx_dma_system_hwmod = {
1005 .slaves_cnt = ARRAY_SIZE(omap44xx_dma_system_slaves), 992 .slaves_cnt = ARRAY_SIZE(omap44xx_dma_system_slaves),
1006 .masters = omap44xx_dma_system_masters, 993 .masters = omap44xx_dma_system_masters,
1007 .masters_cnt = ARRAY_SIZE(omap44xx_dma_system_masters), 994 .masters_cnt = ARRAY_SIZE(omap44xx_dma_system_masters),
1008 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1009}; 995};
1010 996
1011/* 997/*
@@ -1098,7 +1084,6 @@ static struct omap_hwmod omap44xx_dmic_hwmod = {
1098 }, 1084 },
1099 .slaves = omap44xx_dmic_slaves, 1085 .slaves = omap44xx_dmic_slaves,
1100 .slaves_cnt = ARRAY_SIZE(omap44xx_dmic_slaves), 1086 .slaves_cnt = ARRAY_SIZE(omap44xx_dmic_slaves),
1101 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1102}; 1087};
1103 1088
1104/* 1089/*
@@ -1164,7 +1149,6 @@ static struct omap_hwmod omap44xx_dsp_c0_hwmod = {
1164 .rstctrl_offs = OMAP4_RM_TESLA_RSTCTRL_OFFSET, 1149 .rstctrl_offs = OMAP4_RM_TESLA_RSTCTRL_OFFSET,
1165 }, 1150 },
1166 }, 1151 },
1167 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1168}; 1152};
1169 1153
1170static struct omap_hwmod omap44xx_dsp_hwmod = { 1154static struct omap_hwmod omap44xx_dsp_hwmod = {
@@ -1187,7 +1171,6 @@ static struct omap_hwmod omap44xx_dsp_hwmod = {
1187 .slaves_cnt = ARRAY_SIZE(omap44xx_dsp_slaves), 1171 .slaves_cnt = ARRAY_SIZE(omap44xx_dsp_slaves),
1188 .masters = omap44xx_dsp_masters, 1172 .masters = omap44xx_dsp_masters,
1189 .masters_cnt = ARRAY_SIZE(omap44xx_dsp_masters), 1173 .masters_cnt = ARRAY_SIZE(omap44xx_dsp_masters),
1190 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1191}; 1174};
1192 1175
1193/* 1176/*
@@ -1278,7 +1261,6 @@ static struct omap_hwmod omap44xx_dss_hwmod = {
1278 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_slaves), 1261 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_slaves),
1279 .masters = omap44xx_dss_masters, 1262 .masters = omap44xx_dss_masters,
1280 .masters_cnt = ARRAY_SIZE(omap44xx_dss_masters), 1263 .masters_cnt = ARRAY_SIZE(omap44xx_dss_masters),
1281 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1282}; 1264};
1283 1265
1284/* 1266/*
@@ -1381,7 +1363,6 @@ static struct omap_hwmod omap44xx_dss_dispc_hwmod = {
1381 .opt_clks_cnt = ARRAY_SIZE(dss_dispc_opt_clks), 1363 .opt_clks_cnt = ARRAY_SIZE(dss_dispc_opt_clks),
1382 .slaves = omap44xx_dss_dispc_slaves, 1364 .slaves = omap44xx_dss_dispc_slaves,
1383 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dispc_slaves), 1365 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dispc_slaves),
1384 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1385}; 1366};
1386 1367
1387/* 1368/*
@@ -1480,7 +1461,6 @@ static struct omap_hwmod omap44xx_dss_dsi1_hwmod = {
1480 .opt_clks_cnt = ARRAY_SIZE(dss_dsi1_opt_clks), 1461 .opt_clks_cnt = ARRAY_SIZE(dss_dsi1_opt_clks),
1481 .slaves = omap44xx_dss_dsi1_slaves, 1462 .slaves = omap44xx_dss_dsi1_slaves,
1482 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_slaves), 1463 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi1_slaves),
1483 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1484}; 1464};
1485 1465
1486/* dss_dsi2 */ 1466/* dss_dsi2 */
@@ -1558,7 +1538,6 @@ static struct omap_hwmod omap44xx_dss_dsi2_hwmod = {
1558 .opt_clks_cnt = ARRAY_SIZE(dss_dsi2_opt_clks), 1538 .opt_clks_cnt = ARRAY_SIZE(dss_dsi2_opt_clks),
1559 .slaves = omap44xx_dss_dsi2_slaves, 1539 .slaves = omap44xx_dss_dsi2_slaves,
1560 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_slaves), 1540 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_dsi2_slaves),
1561 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1562}; 1541};
1563 1542
1564/* 1543/*
@@ -1656,7 +1635,6 @@ static struct omap_hwmod omap44xx_dss_hdmi_hwmod = {
1656 .opt_clks_cnt = ARRAY_SIZE(dss_hdmi_opt_clks), 1635 .opt_clks_cnt = ARRAY_SIZE(dss_hdmi_opt_clks),
1657 .slaves = omap44xx_dss_hdmi_slaves, 1636 .slaves = omap44xx_dss_hdmi_slaves,
1658 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_slaves), 1637 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_hdmi_slaves),
1659 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1660}; 1638};
1661 1639
1662/* 1640/*
@@ -1748,7 +1726,6 @@ static struct omap_hwmod omap44xx_dss_rfbi_hwmod = {
1748 .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks), 1726 .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
1749 .slaves = omap44xx_dss_rfbi_slaves, 1727 .slaves = omap44xx_dss_rfbi_slaves,
1750 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_slaves), 1728 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_rfbi_slaves),
1751 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1752}; 1729};
1753 1730
1754/* 1731/*
@@ -1817,7 +1794,6 @@ static struct omap_hwmod omap44xx_dss_venc_hwmod = {
1817 }, 1794 },
1818 .slaves = omap44xx_dss_venc_slaves, 1795 .slaves = omap44xx_dss_venc_slaves,
1819 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_venc_slaves), 1796 .slaves_cnt = ARRAY_SIZE(omap44xx_dss_venc_slaves),
1820 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1821}; 1797};
1822 1798
1823/* 1799/*
@@ -1901,7 +1877,6 @@ static struct omap_hwmod omap44xx_gpio1_hwmod = {
1901 .dev_attr = &gpio_dev_attr, 1877 .dev_attr = &gpio_dev_attr,
1902 .slaves = omap44xx_gpio1_slaves, 1878 .slaves = omap44xx_gpio1_slaves,
1903 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio1_slaves), 1879 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio1_slaves),
1904 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1905}; 1880};
1906 1881
1907/* gpio2 */ 1882/* gpio2 */
@@ -1957,7 +1932,6 @@ static struct omap_hwmod omap44xx_gpio2_hwmod = {
1957 .dev_attr = &gpio_dev_attr, 1932 .dev_attr = &gpio_dev_attr,
1958 .slaves = omap44xx_gpio2_slaves, 1933 .slaves = omap44xx_gpio2_slaves,
1959 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio2_slaves), 1934 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio2_slaves),
1960 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1961}; 1935};
1962 1936
1963/* gpio3 */ 1937/* gpio3 */
@@ -2013,7 +1987,6 @@ static struct omap_hwmod omap44xx_gpio3_hwmod = {
2013 .dev_attr = &gpio_dev_attr, 1987 .dev_attr = &gpio_dev_attr,
2014 .slaves = omap44xx_gpio3_slaves, 1988 .slaves = omap44xx_gpio3_slaves,
2015 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio3_slaves), 1989 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio3_slaves),
2016 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2017}; 1990};
2018 1991
2019/* gpio4 */ 1992/* gpio4 */
@@ -2069,7 +2042,6 @@ static struct omap_hwmod omap44xx_gpio4_hwmod = {
2069 .dev_attr = &gpio_dev_attr, 2042 .dev_attr = &gpio_dev_attr,
2070 .slaves = omap44xx_gpio4_slaves, 2043 .slaves = omap44xx_gpio4_slaves,
2071 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio4_slaves), 2044 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio4_slaves),
2072 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2073}; 2045};
2074 2046
2075/* gpio5 */ 2047/* gpio5 */
@@ -2125,7 +2097,6 @@ static struct omap_hwmod omap44xx_gpio5_hwmod = {
2125 .dev_attr = &gpio_dev_attr, 2097 .dev_attr = &gpio_dev_attr,
2126 .slaves = omap44xx_gpio5_slaves, 2098 .slaves = omap44xx_gpio5_slaves,
2127 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio5_slaves), 2099 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio5_slaves),
2128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2129}; 2100};
2130 2101
2131/* gpio6 */ 2102/* gpio6 */
@@ -2181,7 +2152,6 @@ static struct omap_hwmod omap44xx_gpio6_hwmod = {
2181 .dev_attr = &gpio_dev_attr, 2152 .dev_attr = &gpio_dev_attr,
2182 .slaves = omap44xx_gpio6_slaves, 2153 .slaves = omap44xx_gpio6_slaves,
2183 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio6_slaves), 2154 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio6_slaves),
2184 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2185}; 2155};
2186 2156
2187/* 2157/*
@@ -2261,7 +2231,6 @@ static struct omap_hwmod omap44xx_hsi_hwmod = {
2261 .slaves_cnt = ARRAY_SIZE(omap44xx_hsi_slaves), 2231 .slaves_cnt = ARRAY_SIZE(omap44xx_hsi_slaves),
2262 .masters = omap44xx_hsi_masters, 2232 .masters = omap44xx_hsi_masters,
2263 .masters_cnt = ARRAY_SIZE(omap44xx_hsi_masters), 2233 .masters_cnt = ARRAY_SIZE(omap44xx_hsi_masters),
2264 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2265}; 2234};
2266 2235
2267/* 2236/*
@@ -2345,7 +2314,6 @@ static struct omap_hwmod omap44xx_i2c1_hwmod = {
2345 .slaves = omap44xx_i2c1_slaves, 2314 .slaves = omap44xx_i2c1_slaves,
2346 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c1_slaves), 2315 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c1_slaves),
2347 .dev_attr = &i2c_dev_attr, 2316 .dev_attr = &i2c_dev_attr,
2348 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2349}; 2317};
2350 2318
2351/* i2c2 */ 2319/* i2c2 */
@@ -2402,7 +2370,6 @@ static struct omap_hwmod omap44xx_i2c2_hwmod = {
2402 .slaves = omap44xx_i2c2_slaves, 2370 .slaves = omap44xx_i2c2_slaves,
2403 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c2_slaves), 2371 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c2_slaves),
2404 .dev_attr = &i2c_dev_attr, 2372 .dev_attr = &i2c_dev_attr,
2405 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2406}; 2373};
2407 2374
2408/* i2c3 */ 2375/* i2c3 */
@@ -2459,7 +2426,6 @@ static struct omap_hwmod omap44xx_i2c3_hwmod = {
2459 .slaves = omap44xx_i2c3_slaves, 2426 .slaves = omap44xx_i2c3_slaves,
2460 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c3_slaves), 2427 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c3_slaves),
2461 .dev_attr = &i2c_dev_attr, 2428 .dev_attr = &i2c_dev_attr,
2462 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2463}; 2429};
2464 2430
2465/* i2c4 */ 2431/* i2c4 */
@@ -2516,7 +2482,6 @@ static struct omap_hwmod omap44xx_i2c4_hwmod = {
2516 .slaves = omap44xx_i2c4_slaves, 2482 .slaves = omap44xx_i2c4_slaves,
2517 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c4_slaves), 2483 .slaves_cnt = ARRAY_SIZE(omap44xx_i2c4_slaves),
2518 .dev_attr = &i2c_dev_attr, 2484 .dev_attr = &i2c_dev_attr,
2519 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2520}; 2485};
2521 2486
2522/* 2487/*
@@ -2577,7 +2542,6 @@ static struct omap_hwmod omap44xx_ipu_c0_hwmod = {
2577 .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET, 2542 .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET,
2578 }, 2543 },
2579 }, 2544 },
2580 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2581}; 2545};
2582 2546
2583/* Pseudo hwmod for reset control purpose only */ 2547/* Pseudo hwmod for reset control purpose only */
@@ -2593,7 +2557,6 @@ static struct omap_hwmod omap44xx_ipu_c1_hwmod = {
2593 .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET, 2557 .rstctrl_offs = OMAP4_RM_DUCATI_RSTCTRL_OFFSET,
2594 }, 2558 },
2595 }, 2559 },
2596 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2597}; 2560};
2598 2561
2599static struct omap_hwmod omap44xx_ipu_hwmod = { 2562static struct omap_hwmod omap44xx_ipu_hwmod = {
@@ -2616,7 +2579,6 @@ static struct omap_hwmod omap44xx_ipu_hwmod = {
2616 .slaves_cnt = ARRAY_SIZE(omap44xx_ipu_slaves), 2579 .slaves_cnt = ARRAY_SIZE(omap44xx_ipu_slaves),
2617 .masters = omap44xx_ipu_masters, 2580 .masters = omap44xx_ipu_masters,
2618 .masters_cnt = ARRAY_SIZE(omap44xx_ipu_masters), 2581 .masters_cnt = ARRAY_SIZE(omap44xx_ipu_masters),
2619 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2620}; 2582};
2621 2583
2622/* 2584/*
@@ -2706,7 +2668,6 @@ static struct omap_hwmod omap44xx_iss_hwmod = {
2706 .slaves_cnt = ARRAY_SIZE(omap44xx_iss_slaves), 2668 .slaves_cnt = ARRAY_SIZE(omap44xx_iss_slaves),
2707 .masters = omap44xx_iss_masters, 2669 .masters = omap44xx_iss_masters,
2708 .masters_cnt = ARRAY_SIZE(omap44xx_iss_masters), 2670 .masters_cnt = ARRAY_SIZE(omap44xx_iss_masters),
2709 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2710}; 2671};
2711 2672
2712/* 2673/*
@@ -2781,7 +2742,6 @@ static struct omap_hwmod omap44xx_iva_seq0_hwmod = {
2781 .rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET, 2742 .rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET,
2782 }, 2743 },
2783 }, 2744 },
2784 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2785}; 2745};
2786 2746
2787/* Pseudo hwmod for reset control purpose only */ 2747/* Pseudo hwmod for reset control purpose only */
@@ -2797,7 +2757,6 @@ static struct omap_hwmod omap44xx_iva_seq1_hwmod = {
2797 .rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET, 2757 .rstctrl_offs = OMAP4_RM_IVAHD_RSTCTRL_OFFSET,
2798 }, 2758 },
2799 }, 2759 },
2800 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2801}; 2760};
2802 2761
2803static struct omap_hwmod omap44xx_iva_hwmod = { 2762static struct omap_hwmod omap44xx_iva_hwmod = {
@@ -2820,7 +2779,6 @@ static struct omap_hwmod omap44xx_iva_hwmod = {
2820 .slaves_cnt = ARRAY_SIZE(omap44xx_iva_slaves), 2779 .slaves_cnt = ARRAY_SIZE(omap44xx_iva_slaves),
2821 .masters = omap44xx_iva_masters, 2780 .masters = omap44xx_iva_masters,
2822 .masters_cnt = ARRAY_SIZE(omap44xx_iva_masters), 2781 .masters_cnt = ARRAY_SIZE(omap44xx_iva_masters),
2823 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2824}; 2782};
2825 2783
2826/* 2784/*
@@ -2890,7 +2848,6 @@ static struct omap_hwmod omap44xx_kbd_hwmod = {
2890 }, 2848 },
2891 .slaves = omap44xx_kbd_slaves, 2849 .slaves = omap44xx_kbd_slaves,
2892 .slaves_cnt = ARRAY_SIZE(omap44xx_kbd_slaves), 2850 .slaves_cnt = ARRAY_SIZE(omap44xx_kbd_slaves),
2893 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2894}; 2851};
2895 2852
2896/* 2853/*
@@ -2956,7 +2913,6 @@ static struct omap_hwmod omap44xx_mailbox_hwmod = {
2956 }, 2913 },
2957 .slaves = omap44xx_mailbox_slaves, 2914 .slaves = omap44xx_mailbox_slaves,
2958 .slaves_cnt = ARRAY_SIZE(omap44xx_mailbox_slaves), 2915 .slaves_cnt = ARRAY_SIZE(omap44xx_mailbox_slaves),
2959 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
2960}; 2916};
2961 2917
2962/* 2918/*
@@ -3051,7 +3007,6 @@ static struct omap_hwmod omap44xx_mcbsp1_hwmod = {
3051 }, 3007 },
3052 .slaves = omap44xx_mcbsp1_slaves, 3008 .slaves = omap44xx_mcbsp1_slaves,
3053 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves), 3009 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves),
3054 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3055}; 3010};
3056 3011
3057/* mcbsp2 */ 3012/* mcbsp2 */
@@ -3127,7 +3082,6 @@ static struct omap_hwmod omap44xx_mcbsp2_hwmod = {
3127 }, 3082 },
3128 .slaves = omap44xx_mcbsp2_slaves, 3083 .slaves = omap44xx_mcbsp2_slaves,
3129 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves), 3084 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves),
3130 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3131}; 3085};
3132 3086
3133/* mcbsp3 */ 3087/* mcbsp3 */
@@ -3203,7 +3157,6 @@ static struct omap_hwmod omap44xx_mcbsp3_hwmod = {
3203 }, 3157 },
3204 .slaves = omap44xx_mcbsp3_slaves, 3158 .slaves = omap44xx_mcbsp3_slaves,
3205 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves), 3159 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves),
3206 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3207}; 3160};
3208 3161
3209/* mcbsp4 */ 3162/* mcbsp4 */
@@ -3258,7 +3211,6 @@ static struct omap_hwmod omap44xx_mcbsp4_hwmod = {
3258 }, 3211 },
3259 .slaves = omap44xx_mcbsp4_slaves, 3212 .slaves = omap44xx_mcbsp4_slaves,
3260 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves), 3213 .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves),
3261 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3262}; 3214};
3263 3215
3264/* 3216/*
@@ -3353,7 +3305,6 @@ static struct omap_hwmod omap44xx_mcpdm_hwmod = {
3353 }, 3305 },
3354 .slaves = omap44xx_mcpdm_slaves, 3306 .slaves = omap44xx_mcpdm_slaves,
3355 .slaves_cnt = ARRAY_SIZE(omap44xx_mcpdm_slaves), 3307 .slaves_cnt = ARRAY_SIZE(omap44xx_mcpdm_slaves),
3356 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3357}; 3308};
3358 3309
3359/* 3310/*
@@ -3442,7 +3393,6 @@ static struct omap_hwmod omap44xx_mcspi1_hwmod = {
3442 .dev_attr = &mcspi1_dev_attr, 3393 .dev_attr = &mcspi1_dev_attr,
3443 .slaves = omap44xx_mcspi1_slaves, 3394 .slaves = omap44xx_mcspi1_slaves,
3444 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi1_slaves), 3395 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi1_slaves),
3445 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3446}; 3396};
3447 3397
3448/* mcspi2 */ 3398/* mcspi2 */
@@ -3505,7 +3455,6 @@ static struct omap_hwmod omap44xx_mcspi2_hwmod = {
3505 .dev_attr = &mcspi2_dev_attr, 3455 .dev_attr = &mcspi2_dev_attr,
3506 .slaves = omap44xx_mcspi2_slaves, 3456 .slaves = omap44xx_mcspi2_slaves,
3507 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi2_slaves), 3457 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi2_slaves),
3508 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3509}; 3458};
3510 3459
3511/* mcspi3 */ 3460/* mcspi3 */
@@ -3568,7 +3517,6 @@ static struct omap_hwmod omap44xx_mcspi3_hwmod = {
3568 .dev_attr = &mcspi3_dev_attr, 3517 .dev_attr = &mcspi3_dev_attr,
3569 .slaves = omap44xx_mcspi3_slaves, 3518 .slaves = omap44xx_mcspi3_slaves,
3570 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi3_slaves), 3519 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi3_slaves),
3571 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3572}; 3520};
3573 3521
3574/* mcspi4 */ 3522/* mcspi4 */
@@ -3629,7 +3577,6 @@ static struct omap_hwmod omap44xx_mcspi4_hwmod = {
3629 .dev_attr = &mcspi4_dev_attr, 3577 .dev_attr = &mcspi4_dev_attr,
3630 .slaves = omap44xx_mcspi4_slaves, 3578 .slaves = omap44xx_mcspi4_slaves,
3631 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi4_slaves), 3579 .slaves_cnt = ARRAY_SIZE(omap44xx_mcspi4_slaves),
3632 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3633}; 3580};
3634 3581
3635/* 3582/*
@@ -3718,7 +3665,6 @@ static struct omap_hwmod omap44xx_mmc1_hwmod = {
3718 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc1_slaves), 3665 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc1_slaves),
3719 .masters = omap44xx_mmc1_masters, 3666 .masters = omap44xx_mmc1_masters,
3720 .masters_cnt = ARRAY_SIZE(omap44xx_mmc1_masters), 3667 .masters_cnt = ARRAY_SIZE(omap44xx_mmc1_masters),
3721 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3722}; 3668};
3723 3669
3724/* mmc2 */ 3670/* mmc2 */
@@ -3779,7 +3725,6 @@ static struct omap_hwmod omap44xx_mmc2_hwmod = {
3779 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc2_slaves), 3725 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc2_slaves),
3780 .masters = omap44xx_mmc2_masters, 3726 .masters = omap44xx_mmc2_masters,
3781 .masters_cnt = ARRAY_SIZE(omap44xx_mmc2_masters), 3727 .masters_cnt = ARRAY_SIZE(omap44xx_mmc2_masters),
3782 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3783}; 3728};
3784 3729
3785/* mmc3 */ 3730/* mmc3 */
@@ -3834,7 +3779,6 @@ static struct omap_hwmod omap44xx_mmc3_hwmod = {
3834 }, 3779 },
3835 .slaves = omap44xx_mmc3_slaves, 3780 .slaves = omap44xx_mmc3_slaves,
3836 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc3_slaves), 3781 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc3_slaves),
3837 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3838}; 3782};
3839 3783
3840/* mmc4 */ 3784/* mmc4 */
@@ -3890,7 +3834,6 @@ static struct omap_hwmod omap44xx_mmc4_hwmod = {
3890 }, 3834 },
3891 .slaves = omap44xx_mmc4_slaves, 3835 .slaves = omap44xx_mmc4_slaves,
3892 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc4_slaves), 3836 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc4_slaves),
3893 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3894}; 3837};
3895 3838
3896/* mmc5 */ 3839/* mmc5 */
@@ -3945,7 +3888,6 @@ static struct omap_hwmod omap44xx_mmc5_hwmod = {
3945 }, 3888 },
3946 .slaves = omap44xx_mmc5_slaves, 3889 .slaves = omap44xx_mmc5_slaves,
3947 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc5_slaves), 3890 .slaves_cnt = ARRAY_SIZE(omap44xx_mmc5_slaves),
3948 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3949}; 3891};
3950 3892
3951/* 3893/*
@@ -3987,7 +3929,6 @@ static struct omap_hwmod omap44xx_mpu_hwmod = {
3987 }, 3929 },
3988 .masters = omap44xx_mpu_masters, 3930 .masters = omap44xx_mpu_masters,
3989 .masters_cnt = ARRAY_SIZE(omap44xx_mpu_masters), 3931 .masters_cnt = ARRAY_SIZE(omap44xx_mpu_masters),
3990 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
3991}; 3932};
3992 3933
3993/* 3934/*
@@ -4063,7 +4004,6 @@ static struct omap_hwmod omap44xx_smartreflex_core_hwmod = {
4063 }, 4004 },
4064 .slaves = omap44xx_smartreflex_core_slaves, 4005 .slaves = omap44xx_smartreflex_core_slaves,
4065 .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_slaves), 4006 .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_core_slaves),
4066 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4067}; 4007};
4068 4008
4069/* smartreflex_iva */ 4009/* smartreflex_iva */
@@ -4112,7 +4052,6 @@ static struct omap_hwmod omap44xx_smartreflex_iva_hwmod = {
4112 }, 4052 },
4113 .slaves = omap44xx_smartreflex_iva_slaves, 4053 .slaves = omap44xx_smartreflex_iva_slaves,
4114 .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves), 4054 .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_iva_slaves),
4115 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4116}; 4055};
4117 4056
4118/* smartreflex_mpu */ 4057/* smartreflex_mpu */
@@ -4161,7 +4100,6 @@ static struct omap_hwmod omap44xx_smartreflex_mpu_hwmod = {
4161 }, 4100 },
4162 .slaves = omap44xx_smartreflex_mpu_slaves, 4101 .slaves = omap44xx_smartreflex_mpu_slaves,
4163 .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves), 4102 .slaves_cnt = ARRAY_SIZE(omap44xx_smartreflex_mpu_slaves),
4164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4165}; 4103};
4166 4104
4167/* 4105/*
@@ -4224,7 +4162,6 @@ static struct omap_hwmod omap44xx_spinlock_hwmod = {
4224 }, 4162 },
4225 .slaves = omap44xx_spinlock_slaves, 4163 .slaves = omap44xx_spinlock_slaves,
4226 .slaves_cnt = ARRAY_SIZE(omap44xx_spinlock_slaves), 4164 .slaves_cnt = ARRAY_SIZE(omap44xx_spinlock_slaves),
4227 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4228}; 4165};
4229 4166
4230/* 4167/*
@@ -4265,6 +4202,16 @@ static struct omap_hwmod_class omap44xx_timer_hwmod_class = {
4265 .sysc = &omap44xx_timer_sysc, 4202 .sysc = &omap44xx_timer_sysc,
4266}; 4203};
4267 4204
4205/* always-on timers dev attribute */
4206static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
4207 .timer_capability = OMAP_TIMER_ALWON,
4208};
4209
4210/* pwm timers dev attribute */
4211static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
4212 .timer_capability = OMAP_TIMER_HAS_PWM,
4213};
4214
4268/* timer1 */ 4215/* timer1 */
4269static struct omap_hwmod omap44xx_timer1_hwmod; 4216static struct omap_hwmod omap44xx_timer1_hwmod;
4270static struct omap_hwmod_irq_info omap44xx_timer1_irqs[] = { 4217static struct omap_hwmod_irq_info omap44xx_timer1_irqs[] = {
@@ -4308,9 +4255,9 @@ static struct omap_hwmod omap44xx_timer1_hwmod = {
4308 .modulemode = MODULEMODE_SWCTRL, 4255 .modulemode = MODULEMODE_SWCTRL,
4309 }, 4256 },
4310 }, 4257 },
4258 .dev_attr = &capability_alwon_dev_attr,
4311 .slaves = omap44xx_timer1_slaves, 4259 .slaves = omap44xx_timer1_slaves,
4312 .slaves_cnt = ARRAY_SIZE(omap44xx_timer1_slaves), 4260 .slaves_cnt = ARRAY_SIZE(omap44xx_timer1_slaves),
4313 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4314}; 4261};
4315 4262
4316/* timer2 */ 4263/* timer2 */
@@ -4356,9 +4303,9 @@ static struct omap_hwmod omap44xx_timer2_hwmod = {
4356 .modulemode = MODULEMODE_SWCTRL, 4303 .modulemode = MODULEMODE_SWCTRL,
4357 }, 4304 },
4358 }, 4305 },
4306 .dev_attr = &capability_alwon_dev_attr,
4359 .slaves = omap44xx_timer2_slaves, 4307 .slaves = omap44xx_timer2_slaves,
4360 .slaves_cnt = ARRAY_SIZE(omap44xx_timer2_slaves), 4308 .slaves_cnt = ARRAY_SIZE(omap44xx_timer2_slaves),
4361 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4362}; 4309};
4363 4310
4364/* timer3 */ 4311/* timer3 */
@@ -4404,9 +4351,9 @@ static struct omap_hwmod omap44xx_timer3_hwmod = {
4404 .modulemode = MODULEMODE_SWCTRL, 4351 .modulemode = MODULEMODE_SWCTRL,
4405 }, 4352 },
4406 }, 4353 },
4354 .dev_attr = &capability_alwon_dev_attr,
4407 .slaves = omap44xx_timer3_slaves, 4355 .slaves = omap44xx_timer3_slaves,
4408 .slaves_cnt = ARRAY_SIZE(omap44xx_timer3_slaves), 4356 .slaves_cnt = ARRAY_SIZE(omap44xx_timer3_slaves),
4409 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4410}; 4357};
4411 4358
4412/* timer4 */ 4359/* timer4 */
@@ -4452,9 +4399,9 @@ static struct omap_hwmod omap44xx_timer4_hwmod = {
4452 .modulemode = MODULEMODE_SWCTRL, 4399 .modulemode = MODULEMODE_SWCTRL,
4453 }, 4400 },
4454 }, 4401 },
4402 .dev_attr = &capability_alwon_dev_attr,
4455 .slaves = omap44xx_timer4_slaves, 4403 .slaves = omap44xx_timer4_slaves,
4456 .slaves_cnt = ARRAY_SIZE(omap44xx_timer4_slaves), 4404 .slaves_cnt = ARRAY_SIZE(omap44xx_timer4_slaves),
4457 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4458}; 4405};
4459 4406
4460/* timer5 */ 4407/* timer5 */
@@ -4519,9 +4466,9 @@ static struct omap_hwmod omap44xx_timer5_hwmod = {
4519 .modulemode = MODULEMODE_SWCTRL, 4466 .modulemode = MODULEMODE_SWCTRL,
4520 }, 4467 },
4521 }, 4468 },
4469 .dev_attr = &capability_alwon_dev_attr,
4522 .slaves = omap44xx_timer5_slaves, 4470 .slaves = omap44xx_timer5_slaves,
4523 .slaves_cnt = ARRAY_SIZE(omap44xx_timer5_slaves), 4471 .slaves_cnt = ARRAY_SIZE(omap44xx_timer5_slaves),
4524 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4525}; 4472};
4526 4473
4527/* timer6 */ 4474/* timer6 */
@@ -4587,9 +4534,9 @@ static struct omap_hwmod omap44xx_timer6_hwmod = {
4587 .modulemode = MODULEMODE_SWCTRL, 4534 .modulemode = MODULEMODE_SWCTRL,
4588 }, 4535 },
4589 }, 4536 },
4537 .dev_attr = &capability_alwon_dev_attr,
4590 .slaves = omap44xx_timer6_slaves, 4538 .slaves = omap44xx_timer6_slaves,
4591 .slaves_cnt = ARRAY_SIZE(omap44xx_timer6_slaves), 4539 .slaves_cnt = ARRAY_SIZE(omap44xx_timer6_slaves),
4592 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4593}; 4540};
4594 4541
4595/* timer7 */ 4542/* timer7 */
@@ -4654,9 +4601,9 @@ static struct omap_hwmod omap44xx_timer7_hwmod = {
4654 .modulemode = MODULEMODE_SWCTRL, 4601 .modulemode = MODULEMODE_SWCTRL,
4655 }, 4602 },
4656 }, 4603 },
4604 .dev_attr = &capability_alwon_dev_attr,
4657 .slaves = omap44xx_timer7_slaves, 4605 .slaves = omap44xx_timer7_slaves,
4658 .slaves_cnt = ARRAY_SIZE(omap44xx_timer7_slaves), 4606 .slaves_cnt = ARRAY_SIZE(omap44xx_timer7_slaves),
4659 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4660}; 4607};
4661 4608
4662/* timer8 */ 4609/* timer8 */
@@ -4721,9 +4668,9 @@ static struct omap_hwmod omap44xx_timer8_hwmod = {
4721 .modulemode = MODULEMODE_SWCTRL, 4668 .modulemode = MODULEMODE_SWCTRL,
4722 }, 4669 },
4723 }, 4670 },
4671 .dev_attr = &capability_pwm_dev_attr,
4724 .slaves = omap44xx_timer8_slaves, 4672 .slaves = omap44xx_timer8_slaves,
4725 .slaves_cnt = ARRAY_SIZE(omap44xx_timer8_slaves), 4673 .slaves_cnt = ARRAY_SIZE(omap44xx_timer8_slaves),
4726 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4727}; 4674};
4728 4675
4729/* timer9 */ 4676/* timer9 */
@@ -4769,9 +4716,9 @@ static struct omap_hwmod omap44xx_timer9_hwmod = {
4769 .modulemode = MODULEMODE_SWCTRL, 4716 .modulemode = MODULEMODE_SWCTRL,
4770 }, 4717 },
4771 }, 4718 },
4719 .dev_attr = &capability_pwm_dev_attr,
4772 .slaves = omap44xx_timer9_slaves, 4720 .slaves = omap44xx_timer9_slaves,
4773 .slaves_cnt = ARRAY_SIZE(omap44xx_timer9_slaves), 4721 .slaves_cnt = ARRAY_SIZE(omap44xx_timer9_slaves),
4774 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4775}; 4722};
4776 4723
4777/* timer10 */ 4724/* timer10 */
@@ -4817,9 +4764,9 @@ static struct omap_hwmod omap44xx_timer10_hwmod = {
4817 .modulemode = MODULEMODE_SWCTRL, 4764 .modulemode = MODULEMODE_SWCTRL,
4818 }, 4765 },
4819 }, 4766 },
4767 .dev_attr = &capability_pwm_dev_attr,
4820 .slaves = omap44xx_timer10_slaves, 4768 .slaves = omap44xx_timer10_slaves,
4821 .slaves_cnt = ARRAY_SIZE(omap44xx_timer10_slaves), 4769 .slaves_cnt = ARRAY_SIZE(omap44xx_timer10_slaves),
4822 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4823}; 4770};
4824 4771
4825/* timer11 */ 4772/* timer11 */
@@ -4865,9 +4812,9 @@ static struct omap_hwmod omap44xx_timer11_hwmod = {
4865 .modulemode = MODULEMODE_SWCTRL, 4812 .modulemode = MODULEMODE_SWCTRL,
4866 }, 4813 },
4867 }, 4814 },
4815 .dev_attr = &capability_pwm_dev_attr,
4868 .slaves = omap44xx_timer11_slaves, 4816 .slaves = omap44xx_timer11_slaves,
4869 .slaves_cnt = ARRAY_SIZE(omap44xx_timer11_slaves), 4817 .slaves_cnt = ARRAY_SIZE(omap44xx_timer11_slaves),
4870 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4871}; 4818};
4872 4819
4873/* 4820/*
@@ -4944,7 +4891,6 @@ static struct omap_hwmod omap44xx_uart1_hwmod = {
4944 }, 4891 },
4945 .slaves = omap44xx_uart1_slaves, 4892 .slaves = omap44xx_uart1_slaves,
4946 .slaves_cnt = ARRAY_SIZE(omap44xx_uart1_slaves), 4893 .slaves_cnt = ARRAY_SIZE(omap44xx_uart1_slaves),
4947 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
4948}; 4894};
4949 4895
4950/* uart2 */ 4896/* uart2 */
@@ -4999,7 +4945,6 @@ static struct omap_hwmod omap44xx_uart2_hwmod = {
4999 }, 4945 },
5000 .slaves = omap44xx_uart2_slaves, 4946 .slaves = omap44xx_uart2_slaves,
5001 .slaves_cnt = ARRAY_SIZE(omap44xx_uart2_slaves), 4947 .slaves_cnt = ARRAY_SIZE(omap44xx_uart2_slaves),
5002 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
5003}; 4948};
5004 4949
5005/* uart3 */ 4950/* uart3 */
@@ -5055,7 +5000,6 @@ static struct omap_hwmod omap44xx_uart3_hwmod = {
5055 }, 5000 },
5056 .slaves = omap44xx_uart3_slaves, 5001 .slaves = omap44xx_uart3_slaves,
5057 .slaves_cnt = ARRAY_SIZE(omap44xx_uart3_slaves), 5002 .slaves_cnt = ARRAY_SIZE(omap44xx_uart3_slaves),
5058 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
5059}; 5003};
5060 5004
5061/* uart4 */ 5005/* uart4 */
@@ -5110,7 +5054,6 @@ static struct omap_hwmod omap44xx_uart4_hwmod = {
5110 }, 5054 },
5111 .slaves = omap44xx_uart4_slaves, 5055 .slaves = omap44xx_uart4_slaves,
5112 .slaves_cnt = ARRAY_SIZE(omap44xx_uart4_slaves), 5056 .slaves_cnt = ARRAY_SIZE(omap44xx_uart4_slaves),
5113 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
5114}; 5057};
5115 5058
5116/* 5059/*
@@ -5195,7 +5138,6 @@ static struct omap_hwmod omap44xx_usb_otg_hs_hwmod = {
5195 .slaves_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_slaves), 5138 .slaves_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_slaves),
5196 .masters = omap44xx_usb_otg_hs_masters, 5139 .masters = omap44xx_usb_otg_hs_masters,
5197 .masters_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_masters), 5140 .masters_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_masters),
5198 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
5199}; 5141};
5200 5142
5201/* 5143/*
@@ -5266,7 +5208,6 @@ static struct omap_hwmod omap44xx_wd_timer2_hwmod = {
5266 }, 5208 },
5267 .slaves = omap44xx_wd_timer2_slaves, 5209 .slaves = omap44xx_wd_timer2_slaves,
5268 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer2_slaves), 5210 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer2_slaves),
5269 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
5270}; 5211};
5271 5212
5272/* wd_timer3 */ 5213/* wd_timer3 */
@@ -5333,7 +5274,6 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = {
5333 }, 5274 },
5334 .slaves = omap44xx_wd_timer3_slaves, 5275 .slaves = omap44xx_wd_timer3_slaves,
5335 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer3_slaves), 5276 .slaves_cnt = ARRAY_SIZE(omap44xx_wd_timer3_slaves),
5336 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
5337}; 5277};
5338 5278
5339static __initdata struct omap_hwmod *omap44xx_hwmods[] = { 5279static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 3feb35911a32..472bf22d5e84 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -130,7 +130,6 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
130 } else { 130 } else {
131 hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]); 131 hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]);
132 clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); 132 clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
133 pwrdm_wait_transition(pwrdm);
134 sleep_switch = FORCEWAKEUP_SWITCH; 133 sleep_switch = FORCEWAKEUP_SWITCH;
135 } 134 }
136 } 135 }
@@ -156,7 +155,6 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
156 return ret; 155 return ret;
157 } 156 }
158 157
159 pwrdm_wait_transition(pwrdm);
160 pwrdm_state_switch(pwrdm); 158 pwrdm_state_switch(pwrdm);
161err: 159err:
162 return ret; 160 return ret;
diff --git a/arch/arm/mach-omap2/powerdomain-common.c b/arch/arm/mach-omap2/powerdomain-common.c
index 171fccd208c7..f97afff68d6d 100644
--- a/arch/arm/mach-omap2/powerdomain-common.c
+++ b/arch/arm/mach-omap2/powerdomain-common.c
@@ -1,9 +1,8 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/powerdomain-common.c 2 * Common powerdomain framework functions
3 * Contains common powerdomain framework functions
4 * 3 *
5 * Copyright (C) 2010 Texas Instruments, Inc. 4 * Copyright (C) 2010-2011 Texas Instruments, Inc.
6 * Copyright (C) 2010 Nokia Corporation 5 * Copyright (C) 2010 Nokia Corporation
7 * 6 *
8 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley 7 * Derived from mach-omap2/powerdomain.c written by Paul Walmsley
9 * 8 *
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 9af08473bf10..896cb4c5eb1a 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP powerdomain control 2 * OMAP powerdomain control
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
5 * Copyright (C) 2007-2011 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Written by Paul Walmsley 7 * Written by Paul Walmsley
@@ -81,9 +81,6 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
81 if (!pwrdm || !pwrdm->name) 81 if (!pwrdm || !pwrdm->name)
82 return -EINVAL; 82 return -EINVAL;
83 83
84 if (!omap_chip_is(pwrdm->omap_chip))
85 return -EINVAL;
86
87 if (cpu_is_omap44xx() && 84 if (cpu_is_omap44xx() &&
88 pwrdm->prcm_partition == OMAP4430_INVALID_PRCM_PARTITION) { 85 pwrdm->prcm_partition == OMAP4430_INVALID_PRCM_PARTITION) {
89 pr_err("powerdomain: %s: missing OMAP4 PRCM partition ID\n", 86 pr_err("powerdomain: %s: missing OMAP4 PRCM partition ID\n",
@@ -194,29 +191,76 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused)
194/* Public functions */ 191/* Public functions */
195 192
196/** 193/**
197 * pwrdm_init - set up the powerdomain layer 194 * pwrdm_register_platform_funcs - register powerdomain implementation fns
198 * @pwrdm_list: array of struct powerdomain pointers to register 195 * @po: func pointers for arch specific implementations
199 * @custom_funcs: func pointers for arch specific implementations
200 * 196 *
201 * Loop through the array of powerdomains @pwrdm_list, registering all 197 * Register the list of function pointers used to implement the
202 * that are available on the current CPU. If pwrdm_list is supplied 198 * powerdomain functions on different OMAP SoCs. Should be called
203 * and not null, all of the referenced powerdomains will be 199 * before any other pwrdm_register*() function. Returns -EINVAL if
204 * registered. No return value. XXX pwrdm_list is not really a 200 * @po is null, -EEXIST if platform functions have already been
205 * "list"; it is an array. Rename appropriately. 201 * registered, or 0 upon success.
206 */ 202 */
207void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs) 203int pwrdm_register_platform_funcs(struct pwrdm_ops *po)
204{
205 if (!po)
206 return -EINVAL;
207
208 if (arch_pwrdm)
209 return -EEXIST;
210
211 arch_pwrdm = po;
212
213 return 0;
214}
215
216/**
217 * pwrdm_register_pwrdms - register SoC powerdomains
218 * @ps: pointer to an array of struct powerdomain to register
219 *
220 * Register the powerdomains available on a particular OMAP SoC. Must
221 * be called after pwrdm_register_platform_funcs(). May be called
222 * multiple times. Returns -EACCES if called before
223 * pwrdm_register_platform_funcs(); -EINVAL if the argument @ps is
224 * null; or 0 upon success.
225 */
226int pwrdm_register_pwrdms(struct powerdomain **ps)
208{ 227{
209 struct powerdomain **p = NULL; 228 struct powerdomain **p = NULL;
210 229
211 if (!custom_funcs) 230 if (!arch_pwrdm)
212 WARN(1, "powerdomain: No custom pwrdm functions registered\n"); 231 return -EEXIST;
213 else 232
214 arch_pwrdm = custom_funcs; 233 if (!ps)
234 return -EINVAL;
235
236 for (p = ps; *p; p++)
237 _pwrdm_register(*p);
215 238
216 if (pwrdm_list) { 239 return 0;
217 for (p = pwrdm_list; *p; p++) 240}
218 _pwrdm_register(*p); 241
219 } 242/**
243 * pwrdm_complete_init - set up the powerdomain layer
244 *
245 * Do whatever is necessary to initialize registered powerdomains and
246 * powerdomain code. Currently, this programs the next power state
247 * for each powerdomain to ON. This prevents powerdomains from
248 * unexpectedly losing context or entering high wakeup latency modes
249 * with non-power-management-enabled kernels. Must be called after
250 * pwrdm_register_pwrdms(). Returns -EACCES if called before
251 * pwrdm_register_pwrdms(), or 0 upon success.
252 */
253int pwrdm_complete_init(void)
254{
255 struct powerdomain *temp_p;
256
257 if (list_empty(&pwrdm_list))
258 return -EACCES;
259
260 list_for_each_entry(temp_p, &pwrdm_list, node)
261 pwrdm_set_next_pwrst(temp_p, PWRDM_POWER_ON);
262
263 return 0;
220} 264}
221 265
222/** 266/**
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index d23d979b9c34..8febd84e5e31 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -78,7 +78,6 @@ struct powerdomain;
78/** 78/**
79 * struct powerdomain - OMAP powerdomain 79 * struct powerdomain - OMAP powerdomain
80 * @name: Powerdomain name 80 * @name: Powerdomain name
81 * @omap_chip: represents the OMAP chip types containing this pwrdm
82 * @prcm_offs: the address offset from CM_BASE/PRM_BASE 81 * @prcm_offs: the address offset from CM_BASE/PRM_BASE
83 * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs 82 * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs
84 * @pwrsts: Possible powerdomain power states 83 * @pwrsts: Possible powerdomain power states
@@ -98,7 +97,6 @@ struct powerdomain;
98 */ 97 */
99struct powerdomain { 98struct powerdomain {
100 const char *name; 99 const char *name;
101 const struct omap_chip_id omap_chip;
102 const s16 prcm_offs; 100 const s16 prcm_offs;
103 const u8 pwrsts; 101 const u8 pwrsts;
104 const u8 pwrsts_logic_ret; 102 const u8 pwrsts_logic_ret;
@@ -162,7 +160,9 @@ struct pwrdm_ops {
162 int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); 160 int (*pwrdm_wait_transition)(struct powerdomain *pwrdm);
163}; 161};
164 162
165void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs); 163int pwrdm_register_platform_funcs(struct pwrdm_ops *custom_funcs);
164int pwrdm_register_pwrdms(struct powerdomain **pwrdm_list);
165int pwrdm_complete_init(void);
166 166
167struct powerdomain *pwrdm_lookup(const char *name); 167struct powerdomain *pwrdm_lookup(const char *name);
168 168
@@ -210,7 +210,8 @@ int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
210u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); 210u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
211bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); 211bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);
212 212
213extern void omap2xxx_powerdomains_init(void); 213extern void omap242x_powerdomains_init(void);
214extern void omap243x_powerdomains_init(void);
214extern void omap3xxx_powerdomains_init(void); 215extern void omap3xxx_powerdomains_init(void);
215extern void omap44xx_powerdomains_init(void); 216extern void omap44xx_powerdomains_init(void);
216 217
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
index 4210c3399769..bf30483d5cb0 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_3xxx_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2/3 common powerdomain definitions 2 * OMAP2/3 common powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
5 * Copyright (C) 2007-2011 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
@@ -12,20 +12,6 @@
12 */ 12 */
13 13
14/* 14/*
15 * To Do List
16 * -> Move the Sleep/Wakeup dependencies from Power Domain framework to
17 * Clock Domain Framework
18 */
19
20/*
21 * This file contains all of the powerdomains that have some element
22 * of software control for the OMAP24xx and OMAP34xx chips.
23 *
24 * This is not an exhaustive listing of powerdomains on the chips; only
25 * powerdomains that can be controlled in software.
26 */
27
28/*
29 * The names for the DSP/IVA2 powerdomains are confusing. 15 * The names for the DSP/IVA2 powerdomains are confusing.
30 * 16 *
31 * Most OMAP chips have an on-board DSP. 17 * Most OMAP chips have an on-board DSP.
@@ -59,8 +45,6 @@
59struct powerdomain gfx_omap2_pwrdm = { 45struct powerdomain gfx_omap2_pwrdm = {
60 .name = "gfx_pwrdm", 46 .name = "gfx_pwrdm",
61 .prcm_offs = GFX_MOD, 47 .prcm_offs = GFX_MOD,
62 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
63 CHIP_IS_OMAP3430ES1),
64 .pwrsts = PWRSTS_OFF_RET_ON, 48 .pwrsts = PWRSTS_OFF_RET_ON,
65 .pwrsts_logic_ret = PWRSTS_RET, 49 .pwrsts_logic_ret = PWRSTS_RET,
66 .banks = 1, 50 .banks = 1,
@@ -75,6 +59,5 @@ struct powerdomain gfx_omap2_pwrdm = {
75struct powerdomain wkup_omap2_pwrdm = { 59struct powerdomain wkup_omap2_pwrdm = {
76 .name = "wkup_pwrdm", 60 .name = "wkup_pwrdm",
77 .prcm_offs = WKUP_MOD, 61 .prcm_offs = WKUP_MOD,
78 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
79 .pwrsts = PWRSTS_ON, 62 .pwrsts = PWRSTS_ON,
80}; 63};
diff --git a/arch/arm/mach-omap2/powerdomains2xxx_data.c b/arch/arm/mach-omap2/powerdomains2xxx_data.c
index cc389fb2005d..bb4394e3b621 100644
--- a/arch/arm/mach-omap2/powerdomains2xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains2xxx_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP2XXX powerdomain definitions 2 * OMAP2XXX powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
5 * Copyright (C) 2007-2011 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
@@ -28,7 +28,6 @@
28static struct powerdomain dsp_pwrdm = { 28static struct powerdomain dsp_pwrdm = {
29 .name = "dsp_pwrdm", 29 .name = "dsp_pwrdm",
30 .prcm_offs = OMAP24XX_DSP_MOD, 30 .prcm_offs = OMAP24XX_DSP_MOD,
31 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
32 .pwrsts = PWRSTS_OFF_RET_ON, 31 .pwrsts = PWRSTS_OFF_RET_ON,
33 .pwrsts_logic_ret = PWRSTS_RET, 32 .pwrsts_logic_ret = PWRSTS_RET,
34 .banks = 1, 33 .banks = 1,
@@ -43,7 +42,6 @@ static struct powerdomain dsp_pwrdm = {
43static struct powerdomain mpu_24xx_pwrdm = { 42static struct powerdomain mpu_24xx_pwrdm = {
44 .name = "mpu_pwrdm", 43 .name = "mpu_pwrdm",
45 .prcm_offs = MPU_MOD, 44 .prcm_offs = MPU_MOD,
46 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
47 .pwrsts = PWRSTS_OFF_RET_ON, 45 .pwrsts = PWRSTS_OFF_RET_ON,
48 .pwrsts_logic_ret = PWRSTS_OFF_RET, 46 .pwrsts_logic_ret = PWRSTS_OFF_RET,
49 .banks = 1, 47 .banks = 1,
@@ -58,7 +56,6 @@ static struct powerdomain mpu_24xx_pwrdm = {
58static struct powerdomain core_24xx_pwrdm = { 56static struct powerdomain core_24xx_pwrdm = {
59 .name = "core_pwrdm", 57 .name = "core_pwrdm",
60 .prcm_offs = CORE_MOD, 58 .prcm_offs = CORE_MOD,
61 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
62 .pwrsts = PWRSTS_OFF_RET_ON, 59 .pwrsts = PWRSTS_OFF_RET_ON,
63 .banks = 3, 60 .banks = 3,
64 .pwrsts_mem_ret = { 61 .pwrsts_mem_ret = {
@@ -78,14 +75,11 @@ static struct powerdomain core_24xx_pwrdm = {
78 * 2430-specific powerdomains 75 * 2430-specific powerdomains
79 */ 76 */
80 77
81#ifdef CONFIG_SOC_OMAP2430
82
83/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */ 78/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */
84 79
85static struct powerdomain mdm_pwrdm = { 80static struct powerdomain mdm_pwrdm = {
86 .name = "mdm_pwrdm", 81 .name = "mdm_pwrdm",
87 .prcm_offs = OMAP2430_MDM_MOD, 82 .prcm_offs = OMAP2430_MDM_MOD,
88 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
89 .pwrsts = PWRSTS_OFF_RET_ON, 83 .pwrsts = PWRSTS_OFF_RET_ON,
90 .pwrsts_logic_ret = PWRSTS_RET, 84 .pwrsts_logic_ret = PWRSTS_RET,
91 .banks = 1, 85 .banks = 1,
@@ -97,27 +91,41 @@ static struct powerdomain mdm_pwrdm = {
97 }, 91 },
98}; 92};
99 93
100#endif /* CONFIG_SOC_OMAP2430 */ 94/*
101 95 *
102/* As powerdomains are added or removed above, this list must also be changed */ 96 */
103static struct powerdomain *powerdomains_omap2xxx[] __initdata = {
104 97
98static struct powerdomain *powerdomains_omap24xx[] __initdata = {
105 &wkup_omap2_pwrdm, 99 &wkup_omap2_pwrdm,
106 &gfx_omap2_pwrdm, 100 &gfx_omap2_pwrdm,
107
108#ifdef CONFIG_ARCH_OMAP2
109 &dsp_pwrdm, 101 &dsp_pwrdm,
110 &mpu_24xx_pwrdm, 102 &mpu_24xx_pwrdm,
111 &core_24xx_pwrdm, 103 &core_24xx_pwrdm,
112#endif 104 NULL
105};
113 106
114#ifdef CONFIG_SOC_OMAP2430 107static struct powerdomain *powerdomains_omap2430[] __initdata = {
115 &mdm_pwrdm, 108 &mdm_pwrdm,
116#endif
117 NULL 109 NULL
118}; 110};
119 111
120void __init omap2xxx_powerdomains_init(void) 112void __init omap242x_powerdomains_init(void)
113{
114 if (!cpu_is_omap2420())
115 return;
116
117 pwrdm_register_platform_funcs(&omap2_pwrdm_operations);
118 pwrdm_register_pwrdms(powerdomains_omap24xx);
119 pwrdm_complete_init();
120}
121
122void __init omap243x_powerdomains_init(void)
121{ 123{
122 pwrdm_init(powerdomains_omap2xxx, &omap2_pwrdm_operations); 124 if (!cpu_is_omap2430())
125 return;
126
127 pwrdm_register_platform_funcs(&omap2_pwrdm_operations);
128 pwrdm_register_pwrdms(powerdomains_omap24xx);
129 pwrdm_register_pwrdms(powerdomains_omap2430);
130 pwrdm_complete_init();
123} 131}
diff --git a/arch/arm/mach-omap2/powerdomains3xxx_data.c b/arch/arm/mach-omap2/powerdomains3xxx_data.c
index 469a920a74dc..e4f3a7d6ecfc 100644
--- a/arch/arm/mach-omap2/powerdomains3xxx_data.c
+++ b/arch/arm/mach-omap2/powerdomains3xxx_data.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * OMAP3 powerdomain definitions 2 * OMAP3 powerdomain definitions
3 * 3 *
4 * Copyright (C) 2007-2008 Texas Instruments, Inc. 4 * Copyright (C) 2007-2008, 2011 Texas Instruments, Inc.
5 * Copyright (C) 2007-2011 Nokia Corporation 5 * Copyright (C) 2007-2011 Nokia Corporation
6 * 6 *
7 * Paul Walmsley, Jouni Högander 7 * Paul Walmsley, Jouni Högander
@@ -14,6 +14,8 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/init.h> 15#include <linux/init.h>
16 16
17#include <plat/cpu.h>
18
17#include "powerdomain.h" 19#include "powerdomain.h"
18#include "powerdomains2xxx_3xxx_data.h" 20#include "powerdomains2xxx_3xxx_data.h"
19 21
@@ -27,8 +29,6 @@
27 * 34XX-specific powerdomains, dependencies 29 * 34XX-specific powerdomains, dependencies
28 */ 30 */
29 31
30#ifdef CONFIG_ARCH_OMAP3
31
32/* 32/*
33 * Powerdomains 33 * Powerdomains
34 */ 34 */
@@ -36,7 +36,6 @@
36static struct powerdomain iva2_pwrdm = { 36static struct powerdomain iva2_pwrdm = {
37 .name = "iva2_pwrdm", 37 .name = "iva2_pwrdm",
38 .prcm_offs = OMAP3430_IVA2_MOD, 38 .prcm_offs = OMAP3430_IVA2_MOD,
39 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
40 .pwrsts = PWRSTS_OFF_RET_ON, 39 .pwrsts = PWRSTS_OFF_RET_ON,
41 .pwrsts_logic_ret = PWRSTS_OFF_RET, 40 .pwrsts_logic_ret = PWRSTS_OFF_RET,
42 .banks = 4, 41 .banks = 4,
@@ -57,7 +56,6 @@ static struct powerdomain iva2_pwrdm = {
57static struct powerdomain mpu_3xxx_pwrdm = { 56static struct powerdomain mpu_3xxx_pwrdm = {
58 .name = "mpu_pwrdm", 57 .name = "mpu_pwrdm",
59 .prcm_offs = MPU_MOD, 58 .prcm_offs = MPU_MOD,
60 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
61 .pwrsts = PWRSTS_OFF_RET_ON, 59 .pwrsts = PWRSTS_OFF_RET_ON,
62 .pwrsts_logic_ret = PWRSTS_OFF_RET, 60 .pwrsts_logic_ret = PWRSTS_OFF_RET,
63 .flags = PWRDM_HAS_MPU_QUIRK, 61 .flags = PWRDM_HAS_MPU_QUIRK,
@@ -83,10 +81,6 @@ static struct powerdomain mpu_3xxx_pwrdm = {
83static struct powerdomain core_3xxx_pre_es3_1_pwrdm = { 81static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
84 .name = "core_pwrdm", 82 .name = "core_pwrdm",
85 .prcm_offs = CORE_MOD, 83 .prcm_offs = CORE_MOD,
86 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1 |
87 CHIP_IS_OMAP3430ES2 |
88 CHIP_IS_OMAP3430ES3_0 |
89 CHIP_IS_OMAP3630ES1),
90 .pwrsts = PWRSTS_OFF_RET_ON, 84 .pwrsts = PWRSTS_OFF_RET_ON,
91 .pwrsts_logic_ret = PWRSTS_OFF_RET, 85 .pwrsts_logic_ret = PWRSTS_OFF_RET,
92 .banks = 2, 86 .banks = 2,
@@ -103,8 +97,6 @@ static struct powerdomain core_3xxx_pre_es3_1_pwrdm = {
103static struct powerdomain core_3xxx_es3_1_pwrdm = { 97static struct powerdomain core_3xxx_es3_1_pwrdm = {
104 .name = "core_pwrdm", 98 .name = "core_pwrdm",
105 .prcm_offs = CORE_MOD, 99 .prcm_offs = CORE_MOD,
106 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES3_1 |
107 CHIP_GE_OMAP3630ES1_1),
108 .pwrsts = PWRSTS_OFF_RET_ON, 100 .pwrsts = PWRSTS_OFF_RET_ON,
109 .pwrsts_logic_ret = PWRSTS_OFF_RET, 101 .pwrsts_logic_ret = PWRSTS_OFF_RET,
110 /* 102 /*
@@ -125,7 +117,6 @@ static struct powerdomain core_3xxx_es3_1_pwrdm = {
125 117
126static struct powerdomain dss_pwrdm = { 118static struct powerdomain dss_pwrdm = {
127 .name = "dss_pwrdm", 119 .name = "dss_pwrdm",
128 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
129 .prcm_offs = OMAP3430_DSS_MOD, 120 .prcm_offs = OMAP3430_DSS_MOD,
130 .pwrsts = PWRSTS_OFF_RET_ON, 121 .pwrsts = PWRSTS_OFF_RET_ON,
131 .pwrsts_logic_ret = PWRSTS_RET, 122 .pwrsts_logic_ret = PWRSTS_RET,
@@ -146,7 +137,6 @@ static struct powerdomain dss_pwrdm = {
146static struct powerdomain sgx_pwrdm = { 137static struct powerdomain sgx_pwrdm = {
147 .name = "sgx_pwrdm", 138 .name = "sgx_pwrdm",
148 .prcm_offs = OMAP3430ES2_SGX_MOD, 139 .prcm_offs = OMAP3430ES2_SGX_MOD,
149 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
150 /* XXX This is accurate for 3430 SGX, but what about GFX? */ 140 /* XXX This is accurate for 3430 SGX, but what about GFX? */
151 .pwrsts = PWRSTS_OFF_ON, 141 .pwrsts = PWRSTS_OFF_ON,
152 .pwrsts_logic_ret = PWRSTS_RET, 142 .pwrsts_logic_ret = PWRSTS_RET,
@@ -161,7 +151,6 @@ static struct powerdomain sgx_pwrdm = {
161 151
162static struct powerdomain cam_pwrdm = { 152static struct powerdomain cam_pwrdm = {
163 .name = "cam_pwrdm", 153 .name = "cam_pwrdm",
164 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
165 .prcm_offs = OMAP3430_CAM_MOD, 154 .prcm_offs = OMAP3430_CAM_MOD,
166 .pwrsts = PWRSTS_OFF_RET_ON, 155 .pwrsts = PWRSTS_OFF_RET_ON,
167 .pwrsts_logic_ret = PWRSTS_RET, 156 .pwrsts_logic_ret = PWRSTS_RET,
@@ -177,7 +166,6 @@ static struct powerdomain cam_pwrdm = {
177static struct powerdomain per_pwrdm = { 166static struct powerdomain per_pwrdm = {
178 .name = "per_pwrdm", 167 .name = "per_pwrdm",
179 .prcm_offs = OMAP3430_PER_MOD, 168 .prcm_offs = OMAP3430_PER_MOD,
180 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
181 .pwrsts = PWRSTS_OFF_RET_ON, 169 .pwrsts = PWRSTS_OFF_RET_ON,
182 .pwrsts_logic_ret = PWRSTS_OFF_RET, 170 .pwrsts_logic_ret = PWRSTS_OFF_RET,
183 .banks = 1, 171 .banks = 1,
@@ -192,13 +180,11 @@ static struct powerdomain per_pwrdm = {
192static struct powerdomain emu_pwrdm = { 180static struct powerdomain emu_pwrdm = {
193 .name = "emu_pwrdm", 181 .name = "emu_pwrdm",
194 .prcm_offs = OMAP3430_EMU_MOD, 182 .prcm_offs = OMAP3430_EMU_MOD,
195 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
196}; 183};
197 184
198static struct powerdomain neon_pwrdm = { 185static struct powerdomain neon_pwrdm = {
199 .name = "neon_pwrdm", 186 .name = "neon_pwrdm",
200 .prcm_offs = OMAP3430_NEON_MOD, 187 .prcm_offs = OMAP3430_NEON_MOD,
201 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
202 .pwrsts = PWRSTS_OFF_RET_ON, 188 .pwrsts = PWRSTS_OFF_RET_ON,
203 .pwrsts_logic_ret = PWRSTS_RET, 189 .pwrsts_logic_ret = PWRSTS_RET,
204}; 190};
@@ -206,7 +192,6 @@ static struct powerdomain neon_pwrdm = {
206static struct powerdomain usbhost_pwrdm = { 192static struct powerdomain usbhost_pwrdm = {
207 .name = "usbhost_pwrdm", 193 .name = "usbhost_pwrdm",
208 .prcm_offs = OMAP3430ES2_USBHOST_MOD, 194 .prcm_offs = OMAP3430ES2_USBHOST_MOD,
209 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
210 .pwrsts = PWRSTS_OFF_RET_ON, 195 .pwrsts = PWRSTS_OFF_RET_ON,
211 .pwrsts_logic_ret = PWRSTS_RET, 196 .pwrsts_logic_ret = PWRSTS_RET,
212 /* 197 /*
@@ -228,60 +213,92 @@ static struct powerdomain usbhost_pwrdm = {
228static struct powerdomain dpll1_pwrdm = { 213static struct powerdomain dpll1_pwrdm = {
229 .name = "dpll1_pwrdm", 214 .name = "dpll1_pwrdm",
230 .prcm_offs = MPU_MOD, 215 .prcm_offs = MPU_MOD,
231 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
232}; 216};
233 217
234static struct powerdomain dpll2_pwrdm = { 218static struct powerdomain dpll2_pwrdm = {
235 .name = "dpll2_pwrdm", 219 .name = "dpll2_pwrdm",
236 .prcm_offs = OMAP3430_IVA2_MOD, 220 .prcm_offs = OMAP3430_IVA2_MOD,
237 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
238}; 221};
239 222
240static struct powerdomain dpll3_pwrdm = { 223static struct powerdomain dpll3_pwrdm = {
241 .name = "dpll3_pwrdm", 224 .name = "dpll3_pwrdm",
242 .prcm_offs = PLL_MOD, 225 .prcm_offs = PLL_MOD,
243 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
244}; 226};
245 227
246static struct powerdomain dpll4_pwrdm = { 228static struct powerdomain dpll4_pwrdm = {
247 .name = "dpll4_pwrdm", 229 .name = "dpll4_pwrdm",
248 .prcm_offs = PLL_MOD, 230 .prcm_offs = PLL_MOD,
249 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
250}; 231};
251 232
252static struct powerdomain dpll5_pwrdm = { 233static struct powerdomain dpll5_pwrdm = {
253 .name = "dpll5_pwrdm", 234 .name = "dpll5_pwrdm",
254 .prcm_offs = PLL_MOD, 235 .prcm_offs = PLL_MOD,
255 .omap_chip = OMAP_CHIP_INIT(CHIP_GE_OMAP3430ES2),
256}; 236};
257 237
258/* As powerdomains are added or removed above, this list must also be changed */ 238/* As powerdomains are added or removed above, this list must also be changed */
259static struct powerdomain *powerdomains_omap3xxx[] __initdata = { 239static struct powerdomain *powerdomains_omap3430_common[] __initdata = {
260
261 &wkup_omap2_pwrdm, 240 &wkup_omap2_pwrdm,
262 &gfx_omap2_pwrdm,
263 &iva2_pwrdm, 241 &iva2_pwrdm,
264 &mpu_3xxx_pwrdm, 242 &mpu_3xxx_pwrdm,
265 &neon_pwrdm, 243 &neon_pwrdm,
266 &core_3xxx_pre_es3_1_pwrdm,
267 &core_3xxx_es3_1_pwrdm,
268 &cam_pwrdm, 244 &cam_pwrdm,
269 &dss_pwrdm, 245 &dss_pwrdm,
270 &per_pwrdm, 246 &per_pwrdm,
271 &emu_pwrdm, 247 &emu_pwrdm,
272 &sgx_pwrdm,
273 &usbhost_pwrdm,
274 &dpll1_pwrdm, 248 &dpll1_pwrdm,
275 &dpll2_pwrdm, 249 &dpll2_pwrdm,
276 &dpll3_pwrdm, 250 &dpll3_pwrdm,
277 &dpll4_pwrdm, 251 &dpll4_pwrdm,
252 NULL
253};
254
255static struct powerdomain *powerdomains_omap3430es1[] __initdata = {
256 &gfx_omap2_pwrdm,
257 &core_3xxx_pre_es3_1_pwrdm,
258 NULL
259};
260
261/* also includes 3630ES1.0 */
262static struct powerdomain *powerdomains_omap3430es2_es3_0[] __initdata = {
263 &core_3xxx_pre_es3_1_pwrdm,
264 &sgx_pwrdm,
265 &usbhost_pwrdm,
278 &dpll5_pwrdm, 266 &dpll5_pwrdm,
279#endif
280 NULL 267 NULL
281}; 268};
282 269
270/* also includes 3630ES1.1+ */
271static struct powerdomain *powerdomains_omap3430es3_1plus[] __initdata = {
272 &core_3xxx_es3_1_pwrdm,
273 &sgx_pwrdm,
274 &usbhost_pwrdm,
275 &dpll5_pwrdm,
276 NULL
277};
283 278
284void __init omap3xxx_powerdomains_init(void) 279void __init omap3xxx_powerdomains_init(void)
285{ 280{
286 pwrdm_init(powerdomains_omap3xxx, &omap3_pwrdm_operations); 281 unsigned int rev;
282
283 if (!cpu_is_omap34xx())
284 return;
285
286 pwrdm_register_platform_funcs(&omap3_pwrdm_operations);
287 pwrdm_register_pwrdms(powerdomains_omap3430_common);
288
289 rev = omap_rev();
290
291 if (rev == OMAP3430_REV_ES1_0)
292 pwrdm_register_pwrdms(powerdomains_omap3430es1);
293 else if (rev == OMAP3430_REV_ES2_0 || rev == OMAP3430_REV_ES2_1 ||
294 rev == OMAP3430_REV_ES3_0 || rev == OMAP3630_REV_ES1_0)
295 pwrdm_register_pwrdms(powerdomains_omap3430es2_es3_0);
296 else if (rev == OMAP3430_REV_ES3_1 || rev == OMAP3430_REV_ES3_1_2 ||
297 rev == OMAP3517_REV_ES1_0 || rev == OMAP3517_REV_ES1_1 ||
298 rev == OMAP3630_REV_ES1_1 || rev == OMAP3630_REV_ES1_2)
299 pwrdm_register_pwrdms(powerdomains_omap3430es3_1plus);
300 else
301 WARN(1, "OMAP3 powerdomain init: unknown chip type\n");
302
303 pwrdm_complete_init();
287} 304}
diff --git a/arch/arm/mach-omap2/powerdomains44xx_data.c b/arch/arm/mach-omap2/powerdomains44xx_data.c
index 247e79495115..cbce0c9069cd 100644
--- a/arch/arm/mach-omap2/powerdomains44xx_data.c
+++ b/arch/arm/mach-omap2/powerdomains44xx_data.c
@@ -35,7 +35,6 @@ static struct powerdomain core_44xx_pwrdm = {
35 .name = "core_pwrdm", 35 .name = "core_pwrdm",
36 .prcm_offs = OMAP4430_PRM_CORE_INST, 36 .prcm_offs = OMAP4430_PRM_CORE_INST,
37 .prcm_partition = OMAP4430_PRM_PARTITION, 37 .prcm_partition = OMAP4430_PRM_PARTITION,
38 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
39 .pwrsts = PWRSTS_RET_ON, 38 .pwrsts = PWRSTS_RET_ON,
40 .pwrsts_logic_ret = PWRSTS_OFF_RET, 39 .pwrsts_logic_ret = PWRSTS_OFF_RET,
41 .banks = 5, 40 .banks = 5,
@@ -61,7 +60,6 @@ static struct powerdomain gfx_44xx_pwrdm = {
61 .name = "gfx_pwrdm", 60 .name = "gfx_pwrdm",
62 .prcm_offs = OMAP4430_PRM_GFX_INST, 61 .prcm_offs = OMAP4430_PRM_GFX_INST,
63 .prcm_partition = OMAP4430_PRM_PARTITION, 62 .prcm_partition = OMAP4430_PRM_PARTITION,
64 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
65 .pwrsts = PWRSTS_OFF_ON, 63 .pwrsts = PWRSTS_OFF_ON,
66 .banks = 1, 64 .banks = 1,
67 .pwrsts_mem_ret = { 65 .pwrsts_mem_ret = {
@@ -78,7 +76,6 @@ static struct powerdomain abe_44xx_pwrdm = {
78 .name = "abe_pwrdm", 76 .name = "abe_pwrdm",
79 .prcm_offs = OMAP4430_PRM_ABE_INST, 77 .prcm_offs = OMAP4430_PRM_ABE_INST,
80 .prcm_partition = OMAP4430_PRM_PARTITION, 78 .prcm_partition = OMAP4430_PRM_PARTITION,
81 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
82 .pwrsts = PWRSTS_OFF_RET_ON, 79 .pwrsts = PWRSTS_OFF_RET_ON,
83 .pwrsts_logic_ret = PWRSTS_OFF, 80 .pwrsts_logic_ret = PWRSTS_OFF,
84 .banks = 2, 81 .banks = 2,
@@ -98,7 +95,6 @@ static struct powerdomain dss_44xx_pwrdm = {
98 .name = "dss_pwrdm", 95 .name = "dss_pwrdm",
99 .prcm_offs = OMAP4430_PRM_DSS_INST, 96 .prcm_offs = OMAP4430_PRM_DSS_INST,
100 .prcm_partition = OMAP4430_PRM_PARTITION, 97 .prcm_partition = OMAP4430_PRM_PARTITION,
101 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
102 .pwrsts = PWRSTS_OFF_RET_ON, 98 .pwrsts = PWRSTS_OFF_RET_ON,
103 .pwrsts_logic_ret = PWRSTS_OFF, 99 .pwrsts_logic_ret = PWRSTS_OFF,
104 .banks = 1, 100 .banks = 1,
@@ -116,7 +112,6 @@ static struct powerdomain tesla_44xx_pwrdm = {
116 .name = "tesla_pwrdm", 112 .name = "tesla_pwrdm",
117 .prcm_offs = OMAP4430_PRM_TESLA_INST, 113 .prcm_offs = OMAP4430_PRM_TESLA_INST,
118 .prcm_partition = OMAP4430_PRM_PARTITION, 114 .prcm_partition = OMAP4430_PRM_PARTITION,
119 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
120 .pwrsts = PWRSTS_OFF_RET_ON, 115 .pwrsts = PWRSTS_OFF_RET_ON,
121 .pwrsts_logic_ret = PWRSTS_OFF_RET, 116 .pwrsts_logic_ret = PWRSTS_OFF_RET,
122 .banks = 3, 117 .banks = 3,
@@ -138,7 +133,6 @@ static struct powerdomain wkup_44xx_pwrdm = {
138 .name = "wkup_pwrdm", 133 .name = "wkup_pwrdm",
139 .prcm_offs = OMAP4430_PRM_WKUP_INST, 134 .prcm_offs = OMAP4430_PRM_WKUP_INST,
140 .prcm_partition = OMAP4430_PRM_PARTITION, 135 .prcm_partition = OMAP4430_PRM_PARTITION,
141 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
142 .pwrsts = PWRSTS_ON, 136 .pwrsts = PWRSTS_ON,
143 .banks = 1, 137 .banks = 1,
144 .pwrsts_mem_ret = { 138 .pwrsts_mem_ret = {
@@ -154,7 +148,6 @@ static struct powerdomain cpu0_44xx_pwrdm = {
154 .name = "cpu0_pwrdm", 148 .name = "cpu0_pwrdm",
155 .prcm_offs = OMAP4430_PRCM_MPU_CPU0_INST, 149 .prcm_offs = OMAP4430_PRCM_MPU_CPU0_INST,
156 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, 150 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
157 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
158 .pwrsts = PWRSTS_OFF_RET_ON, 151 .pwrsts = PWRSTS_OFF_RET_ON,
159 .pwrsts_logic_ret = PWRSTS_OFF_RET, 152 .pwrsts_logic_ret = PWRSTS_OFF_RET,
160 .banks = 1, 153 .banks = 1,
@@ -171,7 +164,6 @@ static struct powerdomain cpu1_44xx_pwrdm = {
171 .name = "cpu1_pwrdm", 164 .name = "cpu1_pwrdm",
172 .prcm_offs = OMAP4430_PRCM_MPU_CPU1_INST, 165 .prcm_offs = OMAP4430_PRCM_MPU_CPU1_INST,
173 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION, 166 .prcm_partition = OMAP4430_PRCM_MPU_PARTITION,
174 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
175 .pwrsts = PWRSTS_OFF_RET_ON, 167 .pwrsts = PWRSTS_OFF_RET_ON,
176 .pwrsts_logic_ret = PWRSTS_OFF_RET, 168 .pwrsts_logic_ret = PWRSTS_OFF_RET,
177 .banks = 1, 169 .banks = 1,
@@ -188,7 +180,6 @@ static struct powerdomain emu_44xx_pwrdm = {
188 .name = "emu_pwrdm", 180 .name = "emu_pwrdm",
189 .prcm_offs = OMAP4430_PRM_EMU_INST, 181 .prcm_offs = OMAP4430_PRM_EMU_INST,
190 .prcm_partition = OMAP4430_PRM_PARTITION, 182 .prcm_partition = OMAP4430_PRM_PARTITION,
191 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
192 .pwrsts = PWRSTS_OFF_ON, 183 .pwrsts = PWRSTS_OFF_ON,
193 .banks = 1, 184 .banks = 1,
194 .pwrsts_mem_ret = { 185 .pwrsts_mem_ret = {
@@ -204,7 +195,6 @@ static struct powerdomain mpu_44xx_pwrdm = {
204 .name = "mpu_pwrdm", 195 .name = "mpu_pwrdm",
205 .prcm_offs = OMAP4430_PRM_MPU_INST, 196 .prcm_offs = OMAP4430_PRM_MPU_INST,
206 .prcm_partition = OMAP4430_PRM_PARTITION, 197 .prcm_partition = OMAP4430_PRM_PARTITION,
207 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
208 .pwrsts = PWRSTS_RET_ON, 198 .pwrsts = PWRSTS_RET_ON,
209 .pwrsts_logic_ret = PWRSTS_OFF_RET, 199 .pwrsts_logic_ret = PWRSTS_OFF_RET,
210 .banks = 3, 200 .banks = 3,
@@ -225,7 +215,6 @@ static struct powerdomain ivahd_44xx_pwrdm = {
225 .name = "ivahd_pwrdm", 215 .name = "ivahd_pwrdm",
226 .prcm_offs = OMAP4430_PRM_IVAHD_INST, 216 .prcm_offs = OMAP4430_PRM_IVAHD_INST,
227 .prcm_partition = OMAP4430_PRM_PARTITION, 217 .prcm_partition = OMAP4430_PRM_PARTITION,
228 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
229 .pwrsts = PWRSTS_OFF_RET_ON, 218 .pwrsts = PWRSTS_OFF_RET_ON,
230 .pwrsts_logic_ret = PWRSTS_OFF, 219 .pwrsts_logic_ret = PWRSTS_OFF,
231 .banks = 4, 220 .banks = 4,
@@ -249,7 +238,6 @@ static struct powerdomain cam_44xx_pwrdm = {
249 .name = "cam_pwrdm", 238 .name = "cam_pwrdm",
250 .prcm_offs = OMAP4430_PRM_CAM_INST, 239 .prcm_offs = OMAP4430_PRM_CAM_INST,
251 .prcm_partition = OMAP4430_PRM_PARTITION, 240 .prcm_partition = OMAP4430_PRM_PARTITION,
252 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
253 .pwrsts = PWRSTS_OFF_ON, 241 .pwrsts = PWRSTS_OFF_ON,
254 .banks = 1, 242 .banks = 1,
255 .pwrsts_mem_ret = { 243 .pwrsts_mem_ret = {
@@ -266,7 +254,6 @@ static struct powerdomain l3init_44xx_pwrdm = {
266 .name = "l3init_pwrdm", 254 .name = "l3init_pwrdm",
267 .prcm_offs = OMAP4430_PRM_L3INIT_INST, 255 .prcm_offs = OMAP4430_PRM_L3INIT_INST,
268 .prcm_partition = OMAP4430_PRM_PARTITION, 256 .prcm_partition = OMAP4430_PRM_PARTITION,
269 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
270 .pwrsts = PWRSTS_RET_ON, 257 .pwrsts = PWRSTS_RET_ON,
271 .pwrsts_logic_ret = PWRSTS_OFF_RET, 258 .pwrsts_logic_ret = PWRSTS_OFF_RET,
272 .banks = 1, 259 .banks = 1,
@@ -284,7 +271,6 @@ static struct powerdomain l4per_44xx_pwrdm = {
284 .name = "l4per_pwrdm", 271 .name = "l4per_pwrdm",
285 .prcm_offs = OMAP4430_PRM_L4PER_INST, 272 .prcm_offs = OMAP4430_PRM_L4PER_INST,
286 .prcm_partition = OMAP4430_PRM_PARTITION, 273 .prcm_partition = OMAP4430_PRM_PARTITION,
287 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
288 .pwrsts = PWRSTS_RET_ON, 274 .pwrsts = PWRSTS_RET_ON,
289 .pwrsts_logic_ret = PWRSTS_OFF_RET, 275 .pwrsts_logic_ret = PWRSTS_OFF_RET,
290 .banks = 2, 276 .banks = 2,
@@ -307,7 +293,6 @@ static struct powerdomain always_on_core_44xx_pwrdm = {
307 .name = "always_on_core_pwrdm", 293 .name = "always_on_core_pwrdm",
308 .prcm_offs = OMAP4430_PRM_ALWAYS_ON_INST, 294 .prcm_offs = OMAP4430_PRM_ALWAYS_ON_INST,
309 .prcm_partition = OMAP4430_PRM_PARTITION, 295 .prcm_partition = OMAP4430_PRM_PARTITION,
310 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
311 .pwrsts = PWRSTS_ON, 296 .pwrsts = PWRSTS_ON,
312}; 297};
313 298
@@ -316,7 +301,6 @@ static struct powerdomain cefuse_44xx_pwrdm = {
316 .name = "cefuse_pwrdm", 301 .name = "cefuse_pwrdm",
317 .prcm_offs = OMAP4430_PRM_CEFUSE_INST, 302 .prcm_offs = OMAP4430_PRM_CEFUSE_INST,
318 .prcm_partition = OMAP4430_PRM_PARTITION, 303 .prcm_partition = OMAP4430_PRM_PARTITION,
319 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
320 .pwrsts = PWRSTS_OFF_ON, 304 .pwrsts = PWRSTS_OFF_ON,
321 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE, 305 .flags = PWRDM_HAS_LOWPOWERSTATECHANGE,
322}; 306};
@@ -352,5 +336,7 @@ static struct powerdomain *powerdomains_omap44xx[] __initdata = {
352 336
353void __init omap44xx_powerdomains_init(void) 337void __init omap44xx_powerdomains_init(void)
354{ 338{
355 pwrdm_init(powerdomains_omap44xx, &omap4_pwrdm_operations); 339 pwrdm_register_platform_funcs(&omap4_pwrdm_operations);
340 pwrdm_register_pwrdms(powerdomains_omap44xx);
341 pwrdm_complete_init();
356} 342}
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index cf1de7d2630d..1140e98c9773 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -35,6 +35,7 @@
35#include <linux/irq.h> 35#include <linux/irq.h>
36#include <linux/clocksource.h> 36#include <linux/clocksource.h>
37#include <linux/clockchips.h> 37#include <linux/clockchips.h>
38#include <linux/slab.h>
38 39
39#include <asm/mach/time.h> 40#include <asm/mach/time.h>
40#include <plat/dmtimer.h> 41#include <plat/dmtimer.h>
@@ -42,6 +43,10 @@
42#include <asm/sched_clock.h> 43#include <asm/sched_clock.h>
43#include <plat/common.h> 44#include <plat/common.h>
44#include <plat/omap_hwmod.h> 45#include <plat/omap_hwmod.h>
46#include <plat/omap_device.h>
47#include <plat/omap-pm.h>
48
49#include "powerdomain.h"
45 50
46/* Parent clocks, eventually these will come from the clock framework */ 51/* Parent clocks, eventually these will come from the clock framework */
47 52
@@ -67,7 +72,7 @@
67/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ 72/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
68#define MAX_GPTIMER_ID 12 73#define MAX_GPTIMER_ID 12
69 74
70u32 sys_timer_reserved; 75static u32 sys_timer_reserved;
71 76
72/* Clockevent code */ 77/* Clockevent code */
73 78
@@ -78,7 +83,7 @@ static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
78{ 83{
79 struct clock_event_device *evt = &clockevent_gpt; 84 struct clock_event_device *evt = &clockevent_gpt;
80 85
81 __omap_dm_timer_write_status(clkev.io_base, OMAP_TIMER_INT_OVERFLOW); 86 __omap_dm_timer_write_status(&clkev, OMAP_TIMER_INT_OVERFLOW);
82 87
83 evt->event_handler(evt); 88 evt->event_handler(evt);
84 return IRQ_HANDLED; 89 return IRQ_HANDLED;
@@ -93,7 +98,7 @@ static struct irqaction omap2_gp_timer_irq = {
93static int omap2_gp_timer_set_next_event(unsigned long cycles, 98static int omap2_gp_timer_set_next_event(unsigned long cycles,
94 struct clock_event_device *evt) 99 struct clock_event_device *evt)
95{ 100{
96 __omap_dm_timer_load_start(clkev.io_base, OMAP_TIMER_CTRL_ST, 101 __omap_dm_timer_load_start(&clkev, OMAP_TIMER_CTRL_ST,
97 0xffffffff - cycles, 1); 102 0xffffffff - cycles, 1);
98 103
99 return 0; 104 return 0;
@@ -104,16 +109,16 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode,
104{ 109{
105 u32 period; 110 u32 period;
106 111
107 __omap_dm_timer_stop(clkev.io_base, 1, clkev.rate); 112 __omap_dm_timer_stop(&clkev, 1, clkev.rate);
108 113
109 switch (mode) { 114 switch (mode) {
110 case CLOCK_EVT_MODE_PERIODIC: 115 case CLOCK_EVT_MODE_PERIODIC:
111 period = clkev.rate / HZ; 116 period = clkev.rate / HZ;
112 period -= 1; 117 period -= 1;
113 /* Looks like we need to first set the load value separately */ 118 /* Looks like we need to first set the load value separately */
114 __omap_dm_timer_write(clkev.io_base, OMAP_TIMER_LOAD_REG, 119 __omap_dm_timer_write(&clkev, OMAP_TIMER_LOAD_REG,
115 0xffffffff - period, 1); 120 0xffffffff - period, 1);
116 __omap_dm_timer_load_start(clkev.io_base, 121 __omap_dm_timer_load_start(&clkev,
117 OMAP_TIMER_CTRL_AR | OMAP_TIMER_CTRL_ST, 122 OMAP_TIMER_CTRL_AR | OMAP_TIMER_CTRL_ST,
118 0xffffffff - period, 1); 123 0xffffffff - period, 1);
119 break; 124 break;
@@ -189,7 +194,8 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
189 clk_put(src); 194 clk_put(src);
190 } 195 }
191 } 196 }
192 __omap_dm_timer_reset(timer->io_base, 1, 1); 197 __omap_dm_timer_init_regs(timer);
198 __omap_dm_timer_reset(timer, 1, 1);
193 timer->posted = 1; 199 timer->posted = 1;
194 200
195 timer->rate = clk_get_rate(timer->fclk); 201 timer->rate = clk_get_rate(timer->fclk);
@@ -210,7 +216,7 @@ static void __init omap2_gp_clockevent_init(int gptimer_id,
210 omap2_gp_timer_irq.dev_id = (void *)&clkev; 216 omap2_gp_timer_irq.dev_id = (void *)&clkev;
211 setup_irq(clkev.irq, &omap2_gp_timer_irq); 217 setup_irq(clkev.irq, &omap2_gp_timer_irq);
212 218
213 __omap_dm_timer_int_enable(clkev.io_base, OMAP_TIMER_INT_OVERFLOW); 219 __omap_dm_timer_int_enable(&clkev, OMAP_TIMER_INT_OVERFLOW);
214 220
215 clockevent_gpt.mult = div_sc(clkev.rate, NSEC_PER_SEC, 221 clockevent_gpt.mult = div_sc(clkev.rate, NSEC_PER_SEC,
216 clockevent_gpt.shift); 222 clockevent_gpt.shift);
@@ -251,7 +257,7 @@ static struct omap_dm_timer clksrc;
251static DEFINE_CLOCK_DATA(cd); 257static DEFINE_CLOCK_DATA(cd);
252static cycle_t clocksource_read_cycles(struct clocksource *cs) 258static cycle_t clocksource_read_cycles(struct clocksource *cs)
253{ 259{
254 return (cycle_t)__omap_dm_timer_read_counter(clksrc.io_base, 1); 260 return (cycle_t)__omap_dm_timer_read_counter(&clksrc, 1);
255} 261}
256 262
257static struct clocksource clocksource_gpt = { 263static struct clocksource clocksource_gpt = {
@@ -266,7 +272,7 @@ static void notrace dmtimer_update_sched_clock(void)
266{ 272{
267 u32 cyc; 273 u32 cyc;
268 274
269 cyc = __omap_dm_timer_read_counter(clksrc.io_base, 1); 275 cyc = __omap_dm_timer_read_counter(&clksrc, 1);
270 276
271 update_sched_clock(&cd, cyc, (u32)~0); 277 update_sched_clock(&cd, cyc, (u32)~0);
272} 278}
@@ -276,7 +282,7 @@ unsigned long long notrace sched_clock(void)
276 u32 cyc = 0; 282 u32 cyc = 0;
277 283
278 if (clksrc.reserved) 284 if (clksrc.reserved)
279 cyc = __omap_dm_timer_read_counter(clksrc.io_base, 1); 285 cyc = __omap_dm_timer_read_counter(&clksrc, 1);
280 286
281 return cyc_to_sched_clock(&cd, cyc, (u32)~0); 287 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
282} 288}
@@ -293,7 +299,7 @@ static void __init omap2_gp_clocksource_init(int gptimer_id,
293 pr_info("OMAP clocksource: GPTIMER%d at %lu Hz\n", 299 pr_info("OMAP clocksource: GPTIMER%d at %lu Hz\n",
294 gptimer_id, clksrc.rate); 300 gptimer_id, clksrc.rate);
295 301
296 __omap_dm_timer_load_start(clksrc.io_base, 302 __omap_dm_timer_load_start(&clksrc,
297 OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0, 1); 303 OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR, 0, 1);
298 init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate); 304 init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate);
299 305
@@ -341,3 +347,167 @@ static void __init omap4_timer_init(void)
341} 347}
342OMAP_SYS_TIMER(4) 348OMAP_SYS_TIMER(4)
343#endif 349#endif
350
351/**
352 * omap2_dm_timer_set_src - change the timer input clock source
353 * @pdev: timer platform device pointer
354 * @source: array index of parent clock source
355 */
356static int omap2_dm_timer_set_src(struct platform_device *pdev, int source)
357{
358 int ret;
359 struct dmtimer_platform_data *pdata = pdev->dev.platform_data;
360 struct clk *fclk, *parent;
361 char *parent_name = NULL;
362
363 fclk = clk_get(&pdev->dev, "fck");
364 if (IS_ERR_OR_NULL(fclk)) {
365 dev_err(&pdev->dev, "%s: %d: clk_get() FAILED\n",
366 __func__, __LINE__);
367 return -EINVAL;
368 }
369
370 switch (source) {
371 case OMAP_TIMER_SRC_SYS_CLK:
372 parent_name = "sys_ck";
373 break;
374
375 case OMAP_TIMER_SRC_32_KHZ:
376 parent_name = "32k_ck";
377 break;
378
379 case OMAP_TIMER_SRC_EXT_CLK:
380 if (pdata->timer_ip_version == OMAP_TIMER_IP_VERSION_1) {
381 parent_name = "alt_ck";
382 break;
383 }
384 dev_err(&pdev->dev, "%s: %d: invalid clk src.\n",
385 __func__, __LINE__);
386 clk_put(fclk);
387 return -EINVAL;
388 }
389
390 parent = clk_get(&pdev->dev, parent_name);
391 if (IS_ERR_OR_NULL(parent)) {
392 dev_err(&pdev->dev, "%s: %d: clk_get() %s FAILED\n",
393 __func__, __LINE__, parent_name);
394 clk_put(fclk);
395 return -EINVAL;
396 }
397
398 ret = clk_set_parent(fclk, parent);
399 if (IS_ERR_VALUE(ret)) {
400 dev_err(&pdev->dev, "%s: clk_set_parent() to %s FAILED\n",
401 __func__, parent_name);
402 ret = -EINVAL;
403 }
404
405 clk_put(parent);
406 clk_put(fclk);
407
408 return ret;
409}
410
411struct omap_device_pm_latency omap2_dmtimer_latency[] = {
412 {
413 .deactivate_func = omap_device_idle_hwmods,
414 .activate_func = omap_device_enable_hwmods,
415 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
416 },
417};
418
419/**
420 * omap_timer_init - build and register timer device with an
421 * associated timer hwmod
422 * @oh: timer hwmod pointer to be used to build timer device
423 * @user: parameter that can be passed from calling hwmod API
424 *
425 * Called by omap_hwmod_for_each_by_class to register each of the timer
426 * devices present in the system. The number of timer devices is known
427 * by parsing through the hwmod database for a given class name. At the
428 * end of function call memory is allocated for timer device and it is
429 * registered to the framework ready to be proved by the driver.
430 */
431static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
432{
433 int id;
434 int ret = 0;
435 char *name = "omap_timer";
436 struct dmtimer_platform_data *pdata;
437 struct omap_device *od;
438 struct omap_timer_capability_dev_attr *timer_dev_attr;
439 struct powerdomain *pwrdm;
440
441 pr_debug("%s: %s\n", __func__, oh->name);
442
443 /* on secure device, do not register secure timer */
444 timer_dev_attr = oh->dev_attr;
445 if (omap_type() != OMAP2_DEVICE_TYPE_GP && timer_dev_attr)
446 if (timer_dev_attr->timer_capability == OMAP_TIMER_SECURE)
447 return ret;
448
449 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
450 if (!pdata) {
451 pr_err("%s: No memory for [%s]\n", __func__, oh->name);
452 return -ENOMEM;
453 }
454
455 /*
456 * Extract the IDs from name field in hwmod database
457 * and use the same for constructing ids' for the
458 * timer devices. In a way, we are avoiding usage of
459 * static variable witin the function to do the same.
460 * CAUTION: We have to be careful and make sure the
461 * name in hwmod database does not change in which case
462 * we might either make corresponding change here or
463 * switch back static variable mechanism.
464 */
465 sscanf(oh->name, "timer%2d", &id);
466
467 pdata->set_timer_src = omap2_dm_timer_set_src;
468 pdata->timer_ip_version = oh->class->rev;
469
470 /* Mark clocksource and clockevent timers as reserved */
471 if ((sys_timer_reserved >> (id - 1)) & 0x1)
472 pdata->reserved = 1;
473
474 pwrdm = omap_hwmod_get_pwrdm(oh);
475 pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm);
476#ifdef CONFIG_PM
477 pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
478#endif
479 od = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
480 omap2_dmtimer_latency,
481 ARRAY_SIZE(omap2_dmtimer_latency),
482 0);
483
484 if (IS_ERR(od)) {
485 pr_err("%s: Can't build omap_device for %s: %s.\n",
486 __func__, name, oh->name);
487 ret = -EINVAL;
488 }
489
490 kfree(pdata);
491
492 return ret;
493}
494
495/**
496 * omap2_dm_timer_init - top level regular device initialization
497 *
498 * Uses dedicated hwmod api to parse through hwmod database for
499 * given class name and then build and register the timer device.
500 */
501static int __init omap2_dm_timer_init(void)
502{
503 int ret;
504
505 ret = omap_hwmod_for_each_by_class("timer", omap_timer_init, NULL);
506 if (unlikely(ret)) {
507 pr_err("%s: device registration failed.\n", __func__);
508 return -EINVAL;
509 }
510
511 return 0;
512}
513arch_initcall(omap2_dm_timer_init);
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index a6eddae82a0b..c105556a0ee1 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -77,7 +77,7 @@ static int __init dns323_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
77 /* 77 /*
78 * Check for devices with hard-wired IRQs. 78 * Check for devices with hard-wired IRQs.
79 */ 79 */
80 irq = orion5x_pci_map_irq(const dev, slot, pin); 80 irq = orion5x_pci_map_irq(dev, slot, pin);
81 if (irq != -1) 81 if (irq != -1)
82 return irq; 82 return irq;
83 83
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c
index 28b8760ab9fa..bc4a920e26ee 100644
--- a/arch/arm/mach-orion5x/pci.c
+++ b/arch/arm/mach-orion5x/pci.c
@@ -14,6 +14,7 @@
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/mbus.h> 16#include <linux/mbus.h>
17#include <video/vga.h>
17#include <asm/irq.h> 18#include <asm/irq.h>
18#include <asm/mach/pci.h> 19#include <asm/mach/pci.h>
19#include <plat/pcie.h> 20#include <plat/pcie.h>
diff --git a/arch/arm/mach-prima2/clock.c b/arch/arm/mach-prima2/clock.c
index f9a2aaf63f71..615a4e75ceab 100644
--- a/arch/arm/mach-prima2/clock.c
+++ b/arch/arm/mach-prima2/clock.c
@@ -481,6 +481,7 @@ static void __init sirfsoc_clk_init(void)
481 481
482static struct of_device_id clkc_ids[] = { 482static struct of_device_id clkc_ids[] = {
483 { .compatible = "sirf,prima2-clkc" }, 483 { .compatible = "sirf,prima2-clkc" },
484 {},
484}; 485};
485 486
486void __init sirfsoc_of_clk_init(void) 487void __init sirfsoc_of_clk_init(void)
diff --git a/arch/arm/mach-prima2/irq.c b/arch/arm/mach-prima2/irq.c
index c3404cbb6ff7..7af254d046ba 100644
--- a/arch/arm/mach-prima2/irq.c
+++ b/arch/arm/mach-prima2/irq.c
@@ -51,6 +51,7 @@ static __init void sirfsoc_irq_init(void)
51 51
52static struct of_device_id intc_ids[] = { 52static struct of_device_id intc_ids[] = {
53 { .compatible = "sirf,prima2-intc" }, 53 { .compatible = "sirf,prima2-intc" },
54 {},
54}; 55};
55 56
56void __init sirfsoc_of_irq_init(void) 57void __init sirfsoc_of_irq_init(void)
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index d074786e83d4..492cfa8d2610 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -19,6 +19,7 @@ static DEFINE_MUTEX(rstc_lock);
19 19
20static struct of_device_id rstc_ids[] = { 20static struct of_device_id rstc_ids[] = {
21 { .compatible = "sirf,prima2-rstc" }, 21 { .compatible = "sirf,prima2-rstc" },
22 {},
22}; 23};
23 24
24static int __init sirfsoc_of_rstc_init(void) 25static int __init sirfsoc_of_rstc_init(void)
diff --git a/arch/arm/mach-prima2/timer.c b/arch/arm/mach-prima2/timer.c
index 44027f34a88a..ed7ec48d11da 100644
--- a/arch/arm/mach-prima2/timer.c
+++ b/arch/arm/mach-prima2/timer.c
@@ -190,6 +190,7 @@ static void __init sirfsoc_timer_init(void)
190 190
191static struct of_device_id timer_ids[] = { 191static struct of_device_id timer_ids[] = {
192 { .compatible = "sirf,prima2-tick" }, 192 { .compatible = "sirf,prima2-tick" },
193 {},
193}; 194};
194 195
195static void __init sirfsoc_of_timer_map(void) 196static void __init sirfsoc_of_timer_map(void)
diff --git a/arch/arm/mach-realview/include/mach/system.h b/arch/arm/mach-realview/include/mach/system.h
index a30f2e3ec178..6657ff231161 100644
--- a/arch/arm/mach-realview/include/mach/system.h
+++ b/arch/arm/mach-realview/include/mach/system.h
@@ -44,6 +44,7 @@ static inline void arch_reset(char mode, const char *cmd)
44 */ 44 */
45 if (realview_reset) 45 if (realview_reset)
46 realview_reset(mode); 46 realview_reset(mode);
47 dsb();
47} 48}
48 49
49#endif 50#endif
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index ecbea92bf83b..a9f3183e0290 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -262,45 +262,6 @@ static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = {
262 .cols = 8, 262 .cols = 8,
263}; 263};
264 264
265static int smdk6410_backlight_init(struct device *dev)
266{
267 int ret;
268
269 ret = gpio_request(S3C64XX_GPF(15), "Backlight");
270 if (ret) {
271 printk(KERN_ERR "failed to request GPF for PWM-OUT1\n");
272 return ret;
273 }
274
275 /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */
276 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
277
278 return 0;
279}
280
281static void smdk6410_backlight_exit(struct device *dev)
282{
283 s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT);
284 gpio_free(S3C64XX_GPF(15));
285}
286
287static struct platform_pwm_backlight_data smdk6410_backlight_data = {
288 .pwm_id = 1,
289 .max_brightness = 255,
290 .dft_brightness = 255,
291 .pwm_period_ns = 78770,
292 .init = smdk6410_backlight_init,
293 .exit = smdk6410_backlight_exit,
294};
295
296static struct platform_device smdk6410_backlight_device = {
297 .name = "pwm-backlight",
298 .dev = {
299 .parent = &s3c_device_timer[1].dev,
300 .platform_data = &smdk6410_backlight_data,
301 },
302};
303
304static struct map_desc smdk6410_iodesc[] = {}; 265static struct map_desc smdk6410_iodesc[] = {};
305 266
306static struct platform_device *smdk6410_devices[] __initdata = { 267static struct platform_device *smdk6410_devices[] __initdata = {
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index 8bad64370689..055e2858b0dd 100644
--- a/arch/arm/mach-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -16,6 +16,7 @@
16#include <linux/suspend.h> 16#include <linux/suspend.h>
17#include <linux/serial_core.h> 17#include <linux/serial_core.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/gpio.h>
19 20
20#include <mach/map.h> 21#include <mach/map.h>
21#include <mach/irqs.h> 22#include <mach/irqs.h>
diff --git a/arch/arm/mach-s5p64x0/irq-eint.c b/arch/arm/mach-s5p64x0/irq-eint.c
index 69ed4545112b..fe7380f5c3cd 100644
--- a/arch/arm/mach-s5p64x0/irq-eint.c
+++ b/arch/arm/mach-s5p64x0/irq-eint.c
@@ -129,7 +129,7 @@ static int s5p64x0_alloc_gc(void)
129 } 129 }
130 130
131 ct = gc->chip_types; 131 ct = gc->chip_types;
132 ct->chip.irq_ack = irq_gc_ack; 132 ct->chip.irq_ack = irq_gc_ack_set_bit;
133 ct->chip.irq_mask = irq_gc_mask_set_bit; 133 ct->chip.irq_mask = irq_gc_mask_set_bit;
134 ct->chip.irq_unmask = irq_gc_mask_clr_bit; 134 ct->chip.irq_unmask = irq_gc_mask_clr_bit;
135 ct->chip.irq_set_type = s5p64x0_irq_eint_set_type; 135 ct->chip.irq_set_type = s5p64x0_irq_eint_set_type;
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index 309e388a8a83..f149d278377b 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -88,7 +88,7 @@ static struct sleep_save s5pv210_core_save[] = {
88 SAVE_ITEM(S3C2410_TCNTO(0)), 88 SAVE_ITEM(S3C2410_TCNTO(0)),
89}; 89};
90 90
91void s5pv210_cpu_suspend(unsigned long arg) 91static int s5pv210_cpu_suspend(unsigned long arg)
92{ 92{
93 unsigned long tmp; 93 unsigned long tmp;
94 94
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index ce5c2513c6ce..cdfdd624d21d 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -341,6 +341,7 @@ static struct platform_device mipidsi0_device = {
341static struct sh_mobile_sdhi_info sdhi0_info = { 341static struct sh_mobile_sdhi_info sdhi0_info = {
342 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 342 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
343 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 343 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
344 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
344 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 345 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
345 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, 346 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
346}; 347};
@@ -382,7 +383,7 @@ void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
382} 383}
383 384
384static struct sh_mobile_sdhi_info sh_sdhi1_info = { 385static struct sh_mobile_sdhi_info sh_sdhi1_info = {
385 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE, 386 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
386 .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ, 387 .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
387 .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 388 .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
388 .set_pwr = ag5evm_sdhi1_set_pwr, 389 .set_pwr = ag5evm_sdhi1_set_pwr,
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 0ea71f8d4b89..17c19dc25604 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -641,6 +641,8 @@ static struct usbhs_private usbhs0_private = {
641 }, 641 },
642 .driver_param = { 642 .driver_param = {
643 .buswait_bwait = 4, 643 .buswait_bwait = 4,
644 .d0_tx_id = SHDMA_SLAVE_USB0_TX,
645 .d1_rx_id = SHDMA_SLAVE_USB0_RX,
644 }, 646 },
645 }, 647 },
646}; 648};
@@ -810,6 +812,8 @@ static struct usbhs_private usbhs1_private = {
810 .buswait_bwait = 4, 812 .buswait_bwait = 4,
811 .pipe_type = usbhs1_pipe_cfg, 813 .pipe_type = usbhs1_pipe_cfg,
812 .pipe_size = ARRAY_SIZE(usbhs1_pipe_cfg), 814 .pipe_size = ARRAY_SIZE(usbhs1_pipe_cfg),
815 .d0_tx_id = SHDMA_SLAVE_USB1_TX,
816 .d1_rx_id = SHDMA_SLAVE_USB1_RX,
813 }, 817 },
814 }, 818 },
815}; 819};
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index e6e11e4e2d43..66975921e646 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -503,16 +503,17 @@ static struct clk *late_main_clks[] = {
503 &sh7372_fsidivb_clk, 503 &sh7372_fsidivb_clk,
504}; 504};
505 505
506enum { MSTP001, 506enum { MSTP001, MSTP000,
507 MSTP131, MSTP130, 507 MSTP131, MSTP130,
508 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, 508 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125,
509 MSTP118, MSTP117, MSTP116, MSTP113, 509 MSTP118, MSTP117, MSTP116, MSTP113,
510 MSTP106, MSTP101, MSTP100, 510 MSTP106, MSTP101, MSTP100,
511 MSTP223, 511 MSTP223,
512 MSTP218, MSTP217, MSTP216, 512 MSTP218, MSTP217, MSTP216, MSTP214, MSTP208, MSTP207,
513 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, 513 MSTP206, MSTP205, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
514 MSTP329, MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, 514 MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312,
515 MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP406, MSTP403, 515 MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP407, MSTP406,
516 MSTP405, MSTP404, MSTP403, MSTP400,
516 MSTP_NR }; 517 MSTP_NR };
517 518
518#define MSTP(_parent, _reg, _bit, _flags) \ 519#define MSTP(_parent, _reg, _bit, _flags) \
@@ -520,6 +521,7 @@ enum { MSTP001,
520 521
521static struct clk mstp_clks[MSTP_NR] = { 522static struct clk mstp_clks[MSTP_NR] = {
522 [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */ 523 [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */
524 [MSTP000] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 0, 0), /* MSIOF0 */
523 [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */ 525 [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */
524 [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */ 526 [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */
525 [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */ 527 [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */
@@ -538,14 +540,16 @@ static struct clk mstp_clks[MSTP_NR] = {
538 [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */ 540 [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */
539 [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ 541 [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */
540 [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ 542 [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */
543 [MSTP214] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 14, 0), /* USBDMAC */
544 [MSTP208] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 8, 0), /* MSIOF1 */
541 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ 545 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
542 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ 546 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
547 [MSTP205] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 5, 0), /* MSIOF2 */
543 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ 548 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
544 [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ 549 [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */
545 [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ 550 [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */
546 [MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */ 551 [MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */
547 [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ 552 [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
548 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
549 [MSTP328] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR3, 28, 0), /* FSI2 */ 553 [MSTP328] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR3, 28, 0), /* FSI2 */
550 [MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */ 554 [MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
551 [MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */ 555 [MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */
@@ -557,8 +561,12 @@ static struct clk mstp_clks[MSTP_NR] = {
557 [MSTP413] = MSTP(&pllc1_div2_clk, SMSTPCR4, 13, 0), /* HDMI */ 561 [MSTP413] = MSTP(&pllc1_div2_clk, SMSTPCR4, 13, 0), /* HDMI */
558 [MSTP411] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 11, 0), /* IIC3 */ 562 [MSTP411] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 11, 0), /* IIC3 */
559 [MSTP410] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 10, 0), /* IIC4 */ 563 [MSTP410] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 10, 0), /* IIC4 */
564 [MSTP407] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 7, 0), /* USB-DMAC1 */
560 [MSTP406] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 6, 0), /* USB1 */ 565 [MSTP406] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 6, 0), /* USB1 */
566 [MSTP405] = MSTP(&r_clk, SMSTPCR4, 5, 0), /* CMT4 */
567 [MSTP404] = MSTP(&r_clk, SMSTPCR4, 4, 0), /* CMT3 */
561 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ 568 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
569 [MSTP400] = MSTP(&r_clk, SMSTPCR4, 0, 0), /* CMT2 */
562}; 570};
563 571
564static struct clk_lookup lookups[] = { 572static struct clk_lookup lookups[] = {
@@ -609,6 +617,7 @@ static struct clk_lookup lookups[] = {
609 617
610 /* MSTP32 clocks */ 618 /* MSTP32 clocks */
611 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ 619 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */
620 CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[MSTP000]), /* MSIOF0 */
612 CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */ 621 CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */
613 CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */ 622 CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */
614 CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */ 623 CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */
@@ -629,14 +638,16 @@ static struct clk_lookup lookups[] = {
629 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */ 638 CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */
630 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */ 639 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */
631 CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */ 640 CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */
641 CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]), /* USB-DMAC0 */
642 CLKDEV_DEV_ID("spi_sh_msiof.1", &mstp_clks[MSTP208]), /* MSIOF1 */
632 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ 643 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
633 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ 644 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */
645 CLKDEV_DEV_ID("spi_sh_msiof.2", &mstp_clks[MSTP205]), /* MSIOF2 */
634 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ 646 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
635 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ 647 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */
636 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */ 648 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */
637 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */ 649 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */
638 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ 650 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
639 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
640 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */ 651 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */
641 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */ 652 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */
642 CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */ 653 CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */
@@ -650,10 +661,14 @@ static struct clk_lookup lookups[] = {
650 CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */ 661 CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */
651 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */ 662 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */
652 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */ 663 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */
664 CLKDEV_DEV_ID("sh-dma-engine.4", &mstp_clks[MSTP407]), /* USB-DMAC1 */
653 CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */ 665 CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */
654 CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */ 666 CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */
655 CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */ 667 CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */
668 CLKDEV_DEV_ID("sh_cmt.4", &mstp_clks[MSTP405]), /* CMT4 */
669 CLKDEV_DEV_ID("sh_cmt.3", &mstp_clks[MSTP404]), /* CMT3 */
656 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ 670 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
671 CLKDEV_DEV_ID("sh_cmt.2", &mstp_clks[MSTP400]), /* CMT2 */
657 672
658 CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1", 673 CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1",
659 &div6_reparent_clks[DIV6_HDMI]), 674 &div6_reparent_clks[DIV6_HDMI]),
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 6db2ccabc2bf..61a846bb30f2 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -365,7 +365,7 @@ void __init sh73a0_clock_init(void)
365 __raw_writel(0x108, SD2CKCR); 365 __raw_writel(0x108, SD2CKCR);
366 366
367 /* detect main clock parent */ 367 /* detect main clock parent */
368 switch ((__raw_readl(CKSCR) >> 24) & 0x03) { 368 switch ((__raw_readl(CKSCR) >> 28) & 0x03) {
369 case 0: 369 case 0:
370 main_clk.parent = &sh73a0_extal1_clk; 370 main_clk.parent = &sh73a0_extal1_clk;
371 break; 371 break;
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index ce595cee86cd..24e63a85e669 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -459,6 +459,10 @@ enum {
459 SHDMA_SLAVE_SDHI2_TX, 459 SHDMA_SLAVE_SDHI2_TX,
460 SHDMA_SLAVE_MMCIF_RX, 460 SHDMA_SLAVE_MMCIF_RX,
461 SHDMA_SLAVE_MMCIF_TX, 461 SHDMA_SLAVE_MMCIF_TX,
462 SHDMA_SLAVE_USB0_TX,
463 SHDMA_SLAVE_USB0_RX,
464 SHDMA_SLAVE_USB1_TX,
465 SHDMA_SLAVE_USB1_RX,
462}; 466};
463 467
464extern struct clk sh7372_extal1_clk; 468extern struct clk sh7372_extal1_clk;
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
index 3b28743c77eb..739315e30eb9 100644
--- a/arch/arm/mach-shmobile/intc-sh7372.c
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -379,7 +379,7 @@ enum {
379 /* BBIF2 */ 379 /* BBIF2 */
380 VPU, 380 VPU,
381 TSIF1, 381 TSIF1,
382 _3DG_SGX530, 382 /* 3DG */
383 _2DDMAC, 383 _2DDMAC,
384 IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2, 384 IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2,
385 IPMMU_IPMMUR, IPMMU_IPMMUR2, 385 IPMMU_IPMMUR, IPMMU_IPMMUR2,
@@ -436,7 +436,7 @@ static struct intc_vect intcs_vectors[] = {
436 /* BBIF2 */ 436 /* BBIF2 */
437 INTCS_VECT(VPU, 0x980), 437 INTCS_VECT(VPU, 0x980),
438 INTCS_VECT(TSIF1, 0x9a0), 438 INTCS_VECT(TSIF1, 0x9a0),
439 INTCS_VECT(_3DG_SGX530, 0x9e0), 439 /* 3DG */
440 INTCS_VECT(_2DDMAC, 0xa00), 440 INTCS_VECT(_2DDMAC, 0xa00),
441 INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0), 441 INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0),
442 INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0), 442 INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0),
@@ -521,7 +521,7 @@ static struct intc_mask_reg intcs_mask_registers[] = {
521 RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } }, 521 RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } },
522 { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */ 522 { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */
523 { 0, 0, MSIOF, 0, 523 { 0, 0, MSIOF, 0,
524 _3DG_SGX530, 0, 0, 0 } }, 524 0, 0, 0, 0 } },
525 { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */ 525 { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */
526 { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0, 526 { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0,
527 0, 0, 0, 0 } }, 527 0, 0, 0, 0 } },
@@ -561,7 +561,6 @@ static struct intc_prio_reg intcs_prio_registers[] = {
561 TMU_TUNI2, TSIF1 } }, 561 TMU_TUNI2, TSIF1 } },
562 { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } }, 562 { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } },
563 { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } }, 563 { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } },
564 { 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, _3DG_SGX530, 0, 0 } },
565 { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } }, 564 { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } },
566 { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } }, 565 { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } },
567 { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } }, 566 { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } },
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 79f0413d8725..2d9b1b1a2538 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -169,35 +169,35 @@ static struct platform_device scif6_device = {
169}; 169};
170 170
171/* CMT */ 171/* CMT */
172static struct sh_timer_config cmt10_platform_data = { 172static struct sh_timer_config cmt2_platform_data = {
173 .name = "CMT10", 173 .name = "CMT2",
174 .channel_offset = 0x10, 174 .channel_offset = 0x40,
175 .timer_bit = 0, 175 .timer_bit = 5,
176 .clockevent_rating = 125, 176 .clockevent_rating = 125,
177 .clocksource_rating = 125, 177 .clocksource_rating = 125,
178}; 178};
179 179
180static struct resource cmt10_resources[] = { 180static struct resource cmt2_resources[] = {
181 [0] = { 181 [0] = {
182 .name = "CMT10", 182 .name = "CMT2",
183 .start = 0xe6138010, 183 .start = 0xe6130040,
184 .end = 0xe613801b, 184 .end = 0xe613004b,
185 .flags = IORESOURCE_MEM, 185 .flags = IORESOURCE_MEM,
186 }, 186 },
187 [1] = { 187 [1] = {
188 .start = evt2irq(0x0b00), /* CMT1_CMT10 */ 188 .start = evt2irq(0x0b80), /* CMT2 */
189 .flags = IORESOURCE_IRQ, 189 .flags = IORESOURCE_IRQ,
190 }, 190 },
191}; 191};
192 192
193static struct platform_device cmt10_device = { 193static struct platform_device cmt2_device = {
194 .name = "sh_cmt", 194 .name = "sh_cmt",
195 .id = 10, 195 .id = 2,
196 .dev = { 196 .dev = {
197 .platform_data = &cmt10_platform_data, 197 .platform_data = &cmt2_platform_data,
198 }, 198 },
199 .resource = cmt10_resources, 199 .resource = cmt2_resources,
200 .num_resources = ARRAY_SIZE(cmt10_resources), 200 .num_resources = ARRAY_SIZE(cmt2_resources),
201}; 201};
202 202
203/* TMU */ 203/* TMU */
@@ -602,6 +602,150 @@ static struct platform_device dma2_device = {
602 }, 602 },
603}; 603};
604 604
605/*
606 * USB-DMAC
607 */
608
609unsigned int usbts_shift[] = {3, 4, 5};
610
611enum {
612 XMIT_SZ_8BYTE = 0,
613 XMIT_SZ_16BYTE = 1,
614 XMIT_SZ_32BYTE = 2,
615};
616
617#define USBTS_INDEX2VAL(i) (((i) & 3) << 6)
618
619static const struct sh_dmae_channel sh7372_usb_dmae_channels[] = {
620 {
621 .offset = 0,
622 }, {
623 .offset = 0x20,
624 },
625};
626
627/* USB DMAC0 */
628static const struct sh_dmae_slave_config sh7372_usb_dmae0_slaves[] = {
629 {
630 .slave_id = SHDMA_SLAVE_USB0_TX,
631 .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE),
632 }, {
633 .slave_id = SHDMA_SLAVE_USB0_RX,
634 .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE),
635 },
636};
637
638static struct sh_dmae_pdata usb_dma0_platform_data = {
639 .slave = sh7372_usb_dmae0_slaves,
640 .slave_num = ARRAY_SIZE(sh7372_usb_dmae0_slaves),
641 .channel = sh7372_usb_dmae_channels,
642 .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels),
643 .ts_low_shift = 6,
644 .ts_low_mask = 0xc0,
645 .ts_high_shift = 0,
646 .ts_high_mask = 0,
647 .ts_shift = usbts_shift,
648 .ts_shift_num = ARRAY_SIZE(usbts_shift),
649 .dmaor_init = DMAOR_DME,
650 .chcr_offset = 0x14,
651 .chcr_ie_bit = 1 << 5,
652 .dmaor_is_32bit = 1,
653 .needs_tend_set = 1,
654 .no_dmars = 1,
655};
656
657static struct resource sh7372_usb_dmae0_resources[] = {
658 {
659 /* Channel registers and DMAOR */
660 .start = 0xe68a0020,
661 .end = 0xe68a0064 - 1,
662 .flags = IORESOURCE_MEM,
663 },
664 {
665 /* VCR/SWR/DMICR */
666 .start = 0xe68a0000,
667 .end = 0xe68a0014 - 1,
668 .flags = IORESOURCE_MEM,
669 },
670 {
671 /* IRQ for channels */
672 .start = evt2irq(0x0a00),
673 .end = evt2irq(0x0a00),
674 .flags = IORESOURCE_IRQ,
675 },
676};
677
678static struct platform_device usb_dma0_device = {
679 .name = "sh-dma-engine",
680 .id = 3,
681 .resource = sh7372_usb_dmae0_resources,
682 .num_resources = ARRAY_SIZE(sh7372_usb_dmae0_resources),
683 .dev = {
684 .platform_data = &usb_dma0_platform_data,
685 },
686};
687
688/* USB DMAC1 */
689static const struct sh_dmae_slave_config sh7372_usb_dmae1_slaves[] = {
690 {
691 .slave_id = SHDMA_SLAVE_USB1_TX,
692 .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE),
693 }, {
694 .slave_id = SHDMA_SLAVE_USB1_RX,
695 .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE),
696 },
697};
698
699static struct sh_dmae_pdata usb_dma1_platform_data = {
700 .slave = sh7372_usb_dmae1_slaves,
701 .slave_num = ARRAY_SIZE(sh7372_usb_dmae1_slaves),
702 .channel = sh7372_usb_dmae_channels,
703 .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels),
704 .ts_low_shift = 6,
705 .ts_low_mask = 0xc0,
706 .ts_high_shift = 0,
707 .ts_high_mask = 0,
708 .ts_shift = usbts_shift,
709 .ts_shift_num = ARRAY_SIZE(usbts_shift),
710 .dmaor_init = DMAOR_DME,
711 .chcr_offset = 0x14,
712 .chcr_ie_bit = 1 << 5,
713 .dmaor_is_32bit = 1,
714 .needs_tend_set = 1,
715 .no_dmars = 1,
716};
717
718static struct resource sh7372_usb_dmae1_resources[] = {
719 {
720 /* Channel registers and DMAOR */
721 .start = 0xe68c0020,
722 .end = 0xe68c0064 - 1,
723 .flags = IORESOURCE_MEM,
724 },
725 {
726 /* VCR/SWR/DMICR */
727 .start = 0xe68c0000,
728 .end = 0xe68c0014 - 1,
729 .flags = IORESOURCE_MEM,
730 },
731 {
732 /* IRQ for channels */
733 .start = evt2irq(0x1d00),
734 .end = evt2irq(0x1d00),
735 .flags = IORESOURCE_IRQ,
736 },
737};
738
739static struct platform_device usb_dma1_device = {
740 .name = "sh-dma-engine",
741 .id = 4,
742 .resource = sh7372_usb_dmae1_resources,
743 .num_resources = ARRAY_SIZE(sh7372_usb_dmae1_resources),
744 .dev = {
745 .platform_data = &usb_dma1_platform_data,
746 },
747};
748
605/* VPU */ 749/* VPU */
606static struct uio_info vpu_platform_data = { 750static struct uio_info vpu_platform_data = {
607 .name = "VPU5HG", 751 .name = "VPU5HG",
@@ -818,7 +962,7 @@ static struct platform_device *sh7372_early_devices[] __initdata = {
818 &scif4_device, 962 &scif4_device,
819 &scif5_device, 963 &scif5_device,
820 &scif6_device, 964 &scif6_device,
821 &cmt10_device, 965 &cmt2_device,
822 &tmu00_device, 966 &tmu00_device,
823 &tmu01_device, 967 &tmu01_device,
824}; 968};
@@ -829,6 +973,8 @@ static struct platform_device *sh7372_late_devices[] __initdata = {
829 &dma0_device, 973 &dma0_device,
830 &dma1_device, 974 &dma1_device,
831 &dma2_device, 975 &dma2_device,
976 &usb_dma0_device,
977 &usb_dma1_device,
832 &vpu_device, 978 &vpu_device,
833 &veu0_device, 979 &veu0_device,
834 &veu1_device, 980 &veu1_device,
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index 9fd00a6d4248..6bd2f451c185 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5obj-y := clock.o cpu.o devices.o devices-common.o \ 5obj-y := clock.o cpu.o devices.o devices-common.o \
6 id.o usb.o 6 id.o usb.o timer.o
7obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 7obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
8obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o dma-db5500.o 8obj-$(CONFIG_UX500_SOC_DB5500) += cpu-db5500.o dma-db5500.o
9obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o 9obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index 252e8b3c5706..1405d0eb7edb 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -10,12 +10,12 @@
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/mfd/db8500-prcmu.h> 11#include <linux/mfd/db8500-prcmu.h>
12#include <linux/mfd/db5500-prcmu.h> 12#include <linux/mfd/db5500-prcmu.h>
13#include <linux/clksrc-dbx500-prcmu.h>
13 14
14#include <asm/hardware/gic.h> 15#include <asm/hardware/gic.h>
15#include <asm/mach/map.h> 16#include <asm/mach/map.h>
16#include <asm/localtimer.h> 17#include <asm/localtimer.h>
17 18
18#include <plat/mtu.h>
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <mach/setup.h> 20#include <mach/setup.h>
21#include <mach/devices.h> 21#include <mach/devices.h>
@@ -50,30 +50,3 @@ void __init ux500_init_irq(void)
50 prcmu_early_init(); 50 prcmu_early_init();
51 clk_init(); 51 clk_init();
52} 52}
53
54static void __init ux500_timer_init(void)
55{
56#ifdef CONFIG_LOCAL_TIMERS
57 /* Setup the local timer base */
58 if (cpu_is_u5500())
59 twd_base = __io_address(U5500_TWD_BASE);
60 else if (cpu_is_u8500())
61 twd_base = __io_address(U8500_TWD_BASE);
62 else
63 ux500_unknown_soc();
64#endif
65 if (cpu_is_u5500())
66 mtu_base = __io_address(U5500_MTU0_BASE);
67 else if (cpu_is_u8500ed())
68 mtu_base = __io_address(U8500_MTU0_BASE_ED);
69 else if (cpu_is_u8500())
70 mtu_base = __io_address(U8500_MTU0_BASE);
71 else
72 ux500_unknown_soc();
73
74 nmdk_timer_init();
75}
76
77struct sys_timer ux500_timer = {
78 .init = ux500_timer_init,
79};
diff --git a/arch/arm/mach-ux500/include/mach/db5500-regs.h b/arch/arm/mach-ux500/include/mach/db5500-regs.h
index 6ad983294103..994b5fe6f85a 100644
--- a/arch/arm/mach-ux500/include/mach/db5500-regs.h
+++ b/arch/arm/mach-ux500/include/mach/db5500-regs.h
@@ -61,6 +61,8 @@
61#define U5500_SCR_BASE (U5500_PER4_BASE + 0x5000) 61#define U5500_SCR_BASE (U5500_PER4_BASE + 0x5000)
62#define U5500_DMC_BASE (U5500_PER4_BASE + 0x6000) 62#define U5500_DMC_BASE (U5500_PER4_BASE + 0x6000)
63#define U5500_PRCMU_BASE (U5500_PER4_BASE + 0x7000) 63#define U5500_PRCMU_BASE (U5500_PER4_BASE + 0x7000)
64#define U5500_PRCMU_TIMER_3_BASE (U5500_PER4_BASE + 0x07338)
65#define U5500_PRCMU_TIMER_4_BASE (U5500_PER4_BASE + 0x07450)
64#define U5500_MSP1_BASE (U5500_PER4_BASE + 0x9000) 66#define U5500_MSP1_BASE (U5500_PER4_BASE + 0x9000)
65#define U5500_GPIO2_BASE (U5500_PER4_BASE + 0xA000) 67#define U5500_GPIO2_BASE (U5500_PER4_BASE + 0xA000)
66#define U5500_CDETECT_BASE (U5500_PER4_BASE + 0xF000) 68#define U5500_CDETECT_BASE (U5500_PER4_BASE + 0xF000)
diff --git a/arch/arm/mach-ux500/include/mach/db8500-regs.h b/arch/arm/mach-ux500/include/mach/db8500-regs.h
index 049997109cf9..751b0e6938d4 100644
--- a/arch/arm/mach-ux500/include/mach/db8500-regs.h
+++ b/arch/arm/mach-ux500/include/mach/db8500-regs.h
@@ -102,10 +102,13 @@
102#define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000) 102#define U8500_SCR_BASE (U8500_PER4_BASE + 0x05000)
103#define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000) 103#define U8500_DMC_BASE (U8500_PER4_BASE + 0x06000)
104#define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000) 104#define U8500_PRCMU_BASE (U8500_PER4_BASE + 0x07000)
105#define U8500_PRCMU_TIMER_3_BASE (U8500_PER4_BASE + 0x07338)
106#define U8500_PRCMU_TIMER_4_BASE (U8500_PER4_BASE + 0x07450)
105#define U8500_PRCMU_TCDM_BASE_V1 (U8500_PER4_BASE + 0x0f000) 107#define U8500_PRCMU_TCDM_BASE_V1 (U8500_PER4_BASE + 0x0f000)
106#define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000) 108#define U8500_PRCMU_TCDM_BASE (U8500_PER4_BASE + 0x68000)
107#define U8500_PRCMU_TCPM_BASE (U8500_PER4_BASE + 0x60000) 109#define U8500_PRCMU_TCPM_BASE (U8500_PER4_BASE + 0x60000)
108 110
111
109/* per3 base addresses */ 112/* per3 base addresses */
110#define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000) 113#define U8500_FSMC_BASE (U8500_PER3_BASE + 0x0000)
111#define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000) 114#define U8500_SSP0_BASE (U8500_PER3_BASE + 0x2000)
diff --git a/arch/arm/mach-ux500/timer.c b/arch/arm/mach-ux500/timer.c
new file mode 100644
index 000000000000..aea467d04ff7
--- /dev/null
+++ b/arch/arm/mach-ux500/timer.c
@@ -0,0 +1,68 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * License Terms: GNU General Public License v2
5 * Author: Mattias Wallin <mattias.wallin@stericsson.com> for ST-Ericsson
6 */
7#include <linux/io.h>
8#include <linux/errno.h>
9#include <linux/clksrc-dbx500-prcmu.h>
10
11#include <asm/localtimer.h>
12
13#include <plat/mtu.h>
14
15#include <mach/setup.h>
16#include <mach/hardware.h>
17
18static void __init ux500_timer_init(void)
19{
20 void __iomem *prcmu_timer_base;
21
22 if (cpu_is_u5500()) {
23#ifdef CONFIG_LOCAL_TIMERS
24 twd_base = __io_address(U5500_TWD_BASE);
25#endif
26 mtu_base = __io_address(U5500_MTU0_BASE);
27 prcmu_timer_base = __io_address(U5500_PRCMU_TIMER_3_BASE);
28 } else if (cpu_is_u8500()) {
29#ifdef CONFIG_LOCAL_TIMERS
30 twd_base = __io_address(U8500_TWD_BASE);
31#endif
32 mtu_base = __io_address(U8500_MTU0_BASE);
33 prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE);
34 } else {
35 ux500_unknown_soc();
36 }
37
38 /*
39 * Here we register the timerblocks active in the system.
40 * Localtimers (twd) is started when both cpu is up and running.
41 * MTU register a clocksource, clockevent and sched_clock.
42 * Since the MTU is located in the VAPE power domain
43 * it will be cleared in sleep which makes it unsuitable.
44 * We however need it as a timer tick (clockevent)
45 * during boot to calibrate delay until twd is started.
46 * RTC-RTT have problems as timer tick during boot since it is
47 * depending on delay which is not yet calibrated. RTC-RTT is in the
48 * always-on powerdomain and is used as clockevent instead of twd when
49 * sleeping.
50 * The PRCMU timer 4(3 for DB5500) register a clocksource and
51 * sched_clock with higher rating then MTU since is always-on.
52 *
53 */
54
55 nmdk_timer_init();
56 clksrc_dbx500_prcmu_init(prcmu_timer_base);
57}
58
59static void ux500_timer_reset(void)
60{
61 nmdk_clkevt_reset();
62 nmdk_clksrc_reset();
63}
64
65struct sys_timer ux500_timer = {
66 .init = ux500_timer_init,
67 .resume = ux500_timer_reset,
68};
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 9e6b93b1a043..d0d267a8d3f9 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -318,6 +318,10 @@ static struct clk v2m_sp804_clk = {
318 .rate = 1000000, 318 .rate = 1000000,
319}; 319};
320 320
321static struct clk v2m_ref_clk = {
322 .rate = 32768,
323};
324
321static struct clk dummy_apb_pclk; 325static struct clk dummy_apb_pclk;
322 326
323static struct clk_lookup v2m_lookups[] = { 327static struct clk_lookup v2m_lookups[] = {
@@ -348,6 +352,9 @@ static struct clk_lookup v2m_lookups[] = {
348 }, { /* CLCD */ 352 }, { /* CLCD */
349 .dev_id = "mb:clcd", 353 .dev_id = "mb:clcd",
350 .clk = &osc1_clk, 354 .clk = &osc1_clk,
355 }, { /* SP805 WDT */
356 .dev_id = "mb:wdt",
357 .clk = &v2m_ref_clk,
351 }, { /* SP804 timers */ 358 }, { /* SP804 timers */
352 .dev_id = "sp804", 359 .dev_id = "sp804",
353 .con_id = "v2m-timer0", 360 .con_id = "v2m-timer0",
diff --git a/arch/arm/mm/abort-macro.S b/arch/arm/mm/abort-macro.S
index 52162d59407a..2cbf68ef0e83 100644
--- a/arch/arm/mm/abort-macro.S
+++ b/arch/arm/mm/abort-macro.S
@@ -17,7 +17,7 @@
17 cmp \tmp, # 0x5600 @ Is it ldrsb? 17 cmp \tmp, # 0x5600 @ Is it ldrsb?
18 orreq \tmp, \tmp, #1 << 11 @ Set L-bit if yes 18 orreq \tmp, \tmp, #1 << 11 @ Set L-bit if yes
19 tst \tmp, #1 << 11 @ L = 0 -> write 19 tst \tmp, #1 << 11 @ L = 0 -> write
20 orreq \psr, \psr, #1 << 11 @ yes. 20 orreq \fsr, \fsr, #1 << 11 @ yes.
21 b do_DataAbort 21 b do_DataAbort
22not_thumb: 22not_thumb:
23 .endm 23 .endm
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 44c086710d2b..9ecfdb511951 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -277,6 +277,25 @@ static void l2x0_disable(void)
277 spin_unlock_irqrestore(&l2x0_lock, flags); 277 spin_unlock_irqrestore(&l2x0_lock, flags);
278} 278}
279 279
280static void __init l2x0_unlock(__u32 cache_id)
281{
282 int lockregs;
283 int i;
284
285 if (cache_id == L2X0_CACHE_ID_PART_L310)
286 lockregs = 8;
287 else
288 /* L210 and unknown types */
289 lockregs = 1;
290
291 for (i = 0; i < lockregs; i++) {
292 writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_D_BASE +
293 i * L2X0_LOCKDOWN_STRIDE);
294 writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_I_BASE +
295 i * L2X0_LOCKDOWN_STRIDE);
296 }
297}
298
280void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) 299void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
281{ 300{
282 __u32 aux; 301 __u32 aux;
@@ -328,6 +347,8 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
328 * accessing the below registers will fault. 347 * accessing the below registers will fault.
329 */ 348 */
330 if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { 349 if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) {
350 /* Make sure that I&D is not locked down when starting */
351 l2x0_unlock(cache_id);
331 352
332 /* l2x0 controller is disabled */ 353 /* l2x0 controller is disabled */
333 writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); 354 writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 91bca355cd31..cc7e2d8be9aa 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -298,7 +298,7 @@ static void __init arm_bootmem_free(unsigned long min, unsigned long max_low,
298#ifdef CONFIG_HAVE_ARCH_PFN_VALID 298#ifdef CONFIG_HAVE_ARCH_PFN_VALID
299int pfn_valid(unsigned long pfn) 299int pfn_valid(unsigned long pfn)
300{ 300{
301 return memblock_is_memory(pfn << PAGE_SHIFT); 301 return memblock_is_memory(__pfn_to_phys(pfn));
302} 302}
303EXPORT_SYMBOL(pfn_valid); 303EXPORT_SYMBOL(pfn_valid);
304#endif 304#endif
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 92bd102e3982..2e6849b41f66 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -379,7 +379,7 @@ ENTRY(cpu_arm920_set_pte_ext)
379 379
380/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ 380/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
381.globl cpu_arm920_suspend_size 381.globl cpu_arm920_suspend_size
382.equ cpu_arm920_suspend_size, 4 * 3 382.equ cpu_arm920_suspend_size, 4 * 4
383#ifdef CONFIG_PM_SLEEP 383#ifdef CONFIG_PM_SLEEP
384ENTRY(cpu_arm920_do_suspend) 384ENTRY(cpu_arm920_do_suspend)
385 stmfd sp!, {r4 - r7, lr} 385 stmfd sp!, {r4 - r7, lr}
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index 2bbcf053dffd..cd8f79c3a282 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -394,7 +394,7 @@ ENTRY(cpu_arm926_set_pte_ext)
394 394
395/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ 395/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
396.globl cpu_arm926_suspend_size 396.globl cpu_arm926_suspend_size
397.equ cpu_arm926_suspend_size, 4 * 3 397.equ cpu_arm926_suspend_size, 4 * 4
398#ifdef CONFIG_PM_SLEEP 398#ifdef CONFIG_PM_SLEEP
399ENTRY(cpu_arm926_do_suspend) 399ENTRY(cpu_arm926_do_suspend)
400 stmfd sp!, {r4 - r7, lr} 400 stmfd sp!, {r4 - r7, lr}
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index 07219c2ae114..69e7f2ef7384 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -182,11 +182,11 @@ ENDPROC(cpu_sa1100_do_suspend)
182 182
183ENTRY(cpu_sa1100_do_resume) 183ENTRY(cpu_sa1100_do_resume)
184 ldmia r0, {r4 - r7} @ load cp regs 184 ldmia r0, {r4 - r7} @ load cp regs
185 mov r1, #0 185 mov ip, #0
186 mcr p15, 0, r1, c8, c7, 0 @ flush I+D TLBs 186 mcr p15, 0, ip, c8, c7, 0 @ flush I+D TLBs
187 mcr p15, 0, r1, c7, c7, 0 @ flush I&D cache 187 mcr p15, 0, ip, c7, c7, 0 @ flush I&D cache
188 mcr p15, 0, r1, c9, c0, 0 @ invalidate RB 188 mcr p15, 0, ip, c9, c0, 0 @ invalidate RB
189 mcr p15, 0, r1, c9, c0, 5 @ allow user space to use RB 189 mcr p15, 0, ip, c9, c0, 5 @ allow user space to use RB
190 190
191 mcr p15, 0, r4, c3, c0, 0 @ domain ID 191 mcr p15, 0, r4, c3, c0, 0 @ domain ID
192 mcr p15, 0, r5, c2, c0, 0 @ translation table base addr 192 mcr p15, 0, r5, c2, c0, 0 @ translation table base addr
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 219138d2f158..a923aa0fd00d 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -223,6 +223,22 @@ __v6_setup:
223 mrc p15, 0, r0, c1, c0, 0 @ read control register 223 mrc p15, 0, r0, c1, c0, 0 @ read control register
224 bic r0, r0, r5 @ clear bits them 224 bic r0, r0, r5 @ clear bits them
225 orr r0, r0, r6 @ set them 225 orr r0, r0, r6 @ set them
226#ifdef CONFIG_ARM_ERRATA_364296
227 /*
228 * Workaround for the 364296 ARM1136 r0p2 erratum (possible cache data
229 * corruption with hit-under-miss enabled). The conditional code below
230 * (setting the undocumented bit 31 in the auxiliary control register
231 * and the FI bit in the control register) disables hit-under-miss
232 * without putting the processor into full low interrupt latency mode.
233 */
234 ldr r6, =0x4107b362 @ id for ARM1136 r0p2
235 mrc p15, 0, r5, c0, c0, 0 @ get processor id
236 teq r5, r6 @ check for the faulty core
237 mrceq p15, 0, r5, c1, c0, 1 @ load aux control reg
238 orreq r5, r5, #(1 << 31) @ set the undocumented bit 31
239 mcreq p15, 0, r5, c1, c0, 1 @ write aux control reg
240 orreq r0, r0, #(1 << 21) @ low interrupt latency configuration
241#endif
226 mov pc, lr @ return to head.S:__ret 242 mov pc, lr @ return to head.S:__ret
227 243
228 /* 244 /*
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index a30e78542ccf..9049c0764db2 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -66,6 +66,7 @@ ENDPROC(cpu_v7_proc_fin)
66ENTRY(cpu_v7_reset) 66ENTRY(cpu_v7_reset)
67 mrc p15, 0, r1, c1, c0, 0 @ ctrl register 67 mrc p15, 0, r1, c1, c0, 0 @ ctrl register
68 bic r1, r1, #0x1 @ ...............m 68 bic r1, r1, #0x1 @ ...............m
69 THUMB( bic r1, r1, #1 << 30 ) @ SCTLR.TE (Thumb exceptions)
69 mcr p15, 0, r1, c1, c0, 0 @ disable MMU 70 mcr p15, 0, r1, c1, c0, 0 @ disable MMU
70 isb 71 isb
71 mov pc, r0 72 mov pc, r0
@@ -247,13 +248,16 @@ ENTRY(cpu_v7_do_resume)
247 mcr p15, 0, r7, c2, c0, 0 @ TTB 0 248 mcr p15, 0, r7, c2, c0, 0 @ TTB 0
248 mcr p15, 0, r8, c2, c0, 1 @ TTB 1 249 mcr p15, 0, r8, c2, c0, 1 @ TTB 1
249 mcr p15, 0, ip, c2, c0, 2 @ TTB control register 250 mcr p15, 0, ip, c2, c0, 2 @ TTB control register
250 mcr p15, 0, r10, c1, c0, 1 @ Auxiliary control register 251 mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register
252 teq r4, r10 @ Is it already set?
253 mcrne p15, 0, r10, c1, c0, 1 @ No, so write it
251 mcr p15, 0, r11, c1, c0, 2 @ Co-processor access control 254 mcr p15, 0, r11, c1, c0, 2 @ Co-processor access control
252 ldr r4, =PRRR @ PRRR 255 ldr r4, =PRRR @ PRRR
253 ldr r5, =NMRR @ NMRR 256 ldr r5, =NMRR @ NMRR
254 mcr p15, 0, r4, c10, c2, 0 @ write PRRR 257 mcr p15, 0, r4, c10, c2, 0 @ write PRRR
255 mcr p15, 0, r5, c10, c2, 1 @ write NMRR 258 mcr p15, 0, r5, c10, c2, 1 @ write NMRR
256 isb 259 isb
260 dsb
257 mov r0, r9 @ control register 261 mov r0, r9 @ control register
258 mov r2, r7, lsr #14 @ get TTB0 base 262 mov r2, r7, lsr #14 @ get TTB0 base
259 mov r2, r2, lsl #14 263 mov r2, r2, lsl #14
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index 28c72a2006a1..755e1bf22681 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -406,7 +406,7 @@ ENTRY(cpu_xsc3_set_pte_ext)
406 .align 406 .align
407 407
408.globl cpu_xsc3_suspend_size 408.globl cpu_xsc3_suspend_size
409.equ cpu_xsc3_suspend_size, 4 * 8 409.equ cpu_xsc3_suspend_size, 4 * 7
410#ifdef CONFIG_PM_SLEEP 410#ifdef CONFIG_PM_SLEEP
411ENTRY(cpu_xsc3_do_suspend) 411ENTRY(cpu_xsc3_do_suspend)
412 stmfd sp!, {r4 - r10, lr} 412 stmfd sp!, {r4 - r10, lr}
@@ -418,12 +418,12 @@ ENTRY(cpu_xsc3_do_suspend)
418 mrc p15, 0, r9, c1, c0, 1 @ auxiliary control reg 418 mrc p15, 0, r9, c1, c0, 1 @ auxiliary control reg
419 mrc p15, 0, r10, c1, c0, 0 @ control reg 419 mrc p15, 0, r10, c1, c0, 0 @ control reg
420 bic r4, r4, #2 @ clear frequency change bit 420 bic r4, r4, #2 @ clear frequency change bit
421 stmia r0, {r1, r4 - r10} @ store v:p offset + cp regs 421 stmia r0, {r4 - r10} @ store cp regs
422 ldmia sp!, {r4 - r10, pc} 422 ldmia sp!, {r4 - r10, pc}
423ENDPROC(cpu_xsc3_do_suspend) 423ENDPROC(cpu_xsc3_do_suspend)
424 424
425ENTRY(cpu_xsc3_do_resume) 425ENTRY(cpu_xsc3_do_resume)
426 ldmia r0, {r1, r4 - r10} @ load v:p offset + cp regs 426 ldmia r0, {r4 - r10} @ load cp regs
427 mov ip, #0 427 mov ip, #0
428 mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB 428 mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB
429 mcr p15, 0, ip, c7, c10, 4 @ drain write (&fill) buffer 429 mcr p15, 0, ip, c7, c10, 4 @ drain write (&fill) buffer
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig
index ce659015535e..bca4914b4b9d 100644
--- a/arch/arm/plat-nomadik/Kconfig
+++ b/arch/arm/plat-nomadik/Kconfig
@@ -15,10 +15,16 @@ if PLAT_NOMADIK
15 15
16config HAS_MTU 16config HAS_MTU
17 bool 17 bool
18 select HAVE_SCHED_CLOCK
19 help 18 help
20 Support for Multi Timer Unit. MTU provides access 19 Support for Multi Timer Unit. MTU provides access
21 to multiple interrupt generating programmable 20 to multiple interrupt generating programmable
22 32-bit free running decrementing counters. 21 32-bit free running decrementing counters.
23 22
23config NOMADIK_MTU_SCHED_CLOCK
24 bool
25 depends on HAS_MTU
26 select HAVE_SCHED_CLOCK
27 help
28 Use the Multi Timer Unit as the sched_clock.
29
24endif 30endif
diff --git a/arch/arm/plat-nomadik/include/plat/mtu.h b/arch/arm/plat-nomadik/include/plat/mtu.h
index 65704a3d4241..6508e7694a4b 100644
--- a/arch/arm/plat-nomadik/include/plat/mtu.h
+++ b/arch/arm/plat-nomadik/include/plat/mtu.h
@@ -1,54 +1,11 @@
1#ifndef __PLAT_MTU_H 1#ifndef __PLAT_MTU_H
2#define __PLAT_MTU_H 2#define __PLAT_MTU_H
3 3
4/*
5 * Guaranteed runtime conversion range in seconds for
6 * the clocksource and clockevent.
7 */
8#define MTU_MIN_RANGE 4
9
10/* should be set by the platform code */ 4/* should be set by the platform code */
11extern void __iomem *mtu_base; 5extern void __iomem *mtu_base;
12 6
13/* 7void nmdk_clkevt_reset(void);
14 * The MTU device hosts four different counters, with 4 set of 8void nmdk_clksrc_reset(void);
15 * registers. These are register names.
16 */
17
18#define MTU_IMSC 0x00 /* Interrupt mask set/clear */
19#define MTU_RIS 0x04 /* Raw interrupt status */
20#define MTU_MIS 0x08 /* Masked interrupt status */
21#define MTU_ICR 0x0C /* Interrupt clear register */
22
23/* per-timer registers take 0..3 as argument */
24#define MTU_LR(x) (0x10 + 0x10 * (x) + 0x00) /* Load value */
25#define MTU_VAL(x) (0x10 + 0x10 * (x) + 0x04) /* Current value */
26#define MTU_CR(x) (0x10 + 0x10 * (x) + 0x08) /* Control reg */
27#define MTU_BGLR(x) (0x10 + 0x10 * (x) + 0x0c) /* At next overflow */
28
29/* bits for the control register */
30#define MTU_CRn_ENA 0x80
31#define MTU_CRn_PERIODIC 0x40 /* if 0 = free-running */
32#define MTU_CRn_PRESCALE_MASK 0x0c
33#define MTU_CRn_PRESCALE_1 0x00
34#define MTU_CRn_PRESCALE_16 0x04
35#define MTU_CRn_PRESCALE_256 0x08
36#define MTU_CRn_32BITS 0x02
37#define MTU_CRn_ONESHOT 0x01 /* if 0 = wraps reloading from BGLR*/
38
39/* Other registers are usual amba/primecell registers, currently not used */
40#define MTU_ITCR 0xff0
41#define MTU_ITOP 0xff4
42
43#define MTU_PERIPH_ID0 0xfe0
44#define MTU_PERIPH_ID1 0xfe4
45#define MTU_PERIPH_ID2 0xfe8
46#define MTU_PERIPH_ID3 0xfeC
47
48#define MTU_PCELL0 0xff0
49#define MTU_PCELL1 0xff4
50#define MTU_PCELL2 0xff8
51#define MTU_PCELL3 0xffC
52 9
53#endif /* __PLAT_MTU_H */ 10#endif /* __PLAT_MTU_H */
54 11
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index ef74e157a9d5..30b6433d910d 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -21,10 +21,59 @@
21#include <asm/mach/time.h> 21#include <asm/mach/time.h>
22#include <asm/sched_clock.h> 22#include <asm/sched_clock.h>
23 23
24#include <plat/mtu.h> 24/*
25 * Guaranteed runtime conversion range in seconds for
26 * the clocksource and clockevent.
27 */
28#define MTU_MIN_RANGE 4
29
30/*
31 * The MTU device hosts four different counters, with 4 set of
32 * registers. These are register names.
33 */
34
35#define MTU_IMSC 0x00 /* Interrupt mask set/clear */
36#define MTU_RIS 0x04 /* Raw interrupt status */
37#define MTU_MIS 0x08 /* Masked interrupt status */
38#define MTU_ICR 0x0C /* Interrupt clear register */
39
40/* per-timer registers take 0..3 as argument */
41#define MTU_LR(x) (0x10 + 0x10 * (x) + 0x00) /* Load value */
42#define MTU_VAL(x) (0x10 + 0x10 * (x) + 0x04) /* Current value */
43#define MTU_CR(x) (0x10 + 0x10 * (x) + 0x08) /* Control reg */
44#define MTU_BGLR(x) (0x10 + 0x10 * (x) + 0x0c) /* At next overflow */
45
46/* bits for the control register */
47#define MTU_CRn_ENA 0x80
48#define MTU_CRn_PERIODIC 0x40 /* if 0 = free-running */
49#define MTU_CRn_PRESCALE_MASK 0x0c
50#define MTU_CRn_PRESCALE_1 0x00
51#define MTU_CRn_PRESCALE_16 0x04
52#define MTU_CRn_PRESCALE_256 0x08
53#define MTU_CRn_32BITS 0x02
54#define MTU_CRn_ONESHOT 0x01 /* if 0 = wraps reloading from BGLR*/
55
56/* Other registers are usual amba/primecell registers, currently not used */
57#define MTU_ITCR 0xff0
58#define MTU_ITOP 0xff4
59
60#define MTU_PERIPH_ID0 0xfe0
61#define MTU_PERIPH_ID1 0xfe4
62#define MTU_PERIPH_ID2 0xfe8
63#define MTU_PERIPH_ID3 0xfeC
64
65#define MTU_PCELL0 0xff0
66#define MTU_PCELL1 0xff4
67#define MTU_PCELL2 0xff8
68#define MTU_PCELL3 0xffC
69
70static bool clkevt_periodic;
71static u32 clk_prescale;
72static u32 nmdk_cycle; /* write-once */
25 73
26void __iomem *mtu_base; /* Assigned by machine code */ 74void __iomem *mtu_base; /* Assigned by machine code */
27 75
76#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK
28/* 77/*
29 * Override the global weak sched_clock symbol with this 78 * Override the global weak sched_clock symbol with this
30 * local implementation which uses the clocksource to get some 79 * local implementation which uses the clocksource to get some
@@ -48,32 +97,56 @@ static void notrace nomadik_update_sched_clock(void)
48 u32 cyc = -readl(mtu_base + MTU_VAL(0)); 97 u32 cyc = -readl(mtu_base + MTU_VAL(0));
49 update_sched_clock(&cd, cyc, (u32)~0); 98 update_sched_clock(&cd, cyc, (u32)~0);
50} 99}
100#endif
51 101
52/* Clockevent device: use one-shot mode */ 102/* Clockevent device: use one-shot mode */
103static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev)
104{
105 writel(1 << 1, mtu_base + MTU_IMSC);
106 writel(evt, mtu_base + MTU_LR(1));
107 /* Load highest value, enable device, enable interrupts */
108 writel(MTU_CRn_ONESHOT | clk_prescale |
109 MTU_CRn_32BITS | MTU_CRn_ENA,
110 mtu_base + MTU_CR(1));
111
112 return 0;
113}
114
115void nmdk_clkevt_reset(void)
116{
117 if (clkevt_periodic) {
118
119 /* Timer: configure load and background-load, and fire it up */
120 writel(nmdk_cycle, mtu_base + MTU_LR(1));
121 writel(nmdk_cycle, mtu_base + MTU_BGLR(1));
122
123 writel(MTU_CRn_PERIODIC | clk_prescale |
124 MTU_CRn_32BITS | MTU_CRn_ENA,
125 mtu_base + MTU_CR(1));
126 writel(1 << 1, mtu_base + MTU_IMSC);
127 } else {
128 /* Generate an interrupt to start the clockevent again */
129 (void) nmdk_clkevt_next(nmdk_cycle, NULL);
130 }
131}
132
53static void nmdk_clkevt_mode(enum clock_event_mode mode, 133static void nmdk_clkevt_mode(enum clock_event_mode mode,
54 struct clock_event_device *dev) 134 struct clock_event_device *dev)
55{ 135{
56 u32 cr;
57 136
58 switch (mode) { 137 switch (mode) {
59 case CLOCK_EVT_MODE_PERIODIC: 138 case CLOCK_EVT_MODE_PERIODIC:
60 pr_err("%s: periodic mode not supported\n", __func__); 139 clkevt_periodic = true;
140 nmdk_clkevt_reset();
61 break; 141 break;
62 case CLOCK_EVT_MODE_ONESHOT: 142 case CLOCK_EVT_MODE_ONESHOT:
63 /* Load highest value, enable device, enable interrupts */ 143 clkevt_periodic = false;
64 cr = readl(mtu_base + MTU_CR(1));
65 writel(0, mtu_base + MTU_LR(1));
66 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(1));
67 writel(1 << 1, mtu_base + MTU_IMSC);
68 break; 144 break;
69 case CLOCK_EVT_MODE_SHUTDOWN: 145 case CLOCK_EVT_MODE_SHUTDOWN:
70 case CLOCK_EVT_MODE_UNUSED: 146 case CLOCK_EVT_MODE_UNUSED:
71 /* disable irq */
72 writel(0, mtu_base + MTU_IMSC); 147 writel(0, mtu_base + MTU_IMSC);
73 /* disable timer */ 148 /* disable timer */
74 cr = readl(mtu_base + MTU_CR(1)); 149 writel(0, mtu_base + MTU_CR(1));
75 cr &= ~MTU_CRn_ENA;
76 writel(cr, mtu_base + MTU_CR(1));
77 /* load some high default value */ 150 /* load some high default value */
78 writel(0xffffffff, mtu_base + MTU_LR(1)); 151 writel(0xffffffff, mtu_base + MTU_LR(1));
79 break; 152 break;
@@ -82,16 +155,9 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode,
82 } 155 }
83} 156}
84 157
85static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev)
86{
87 /* writing the value has immediate effect */
88 writel(evt, mtu_base + MTU_LR(1));
89 return 0;
90}
91
92static struct clock_event_device nmdk_clkevt = { 158static struct clock_event_device nmdk_clkevt = {
93 .name = "mtu_1", 159 .name = "mtu_1",
94 .features = CLOCK_EVT_FEAT_ONESHOT, 160 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
95 .rating = 200, 161 .rating = 200,
96 .set_mode = nmdk_clkevt_mode, 162 .set_mode = nmdk_clkevt_mode,
97 .set_next_event = nmdk_clkevt_next, 163 .set_next_event = nmdk_clkevt_next,
@@ -116,11 +182,23 @@ static struct irqaction nmdk_timer_irq = {
116 .dev_id = &nmdk_clkevt, 182 .dev_id = &nmdk_clkevt,
117}; 183};
118 184
185void nmdk_clksrc_reset(void)
186{
187 /* Disable */
188 writel(0, mtu_base + MTU_CR(0));
189
190 /* ClockSource: configure load and background-load, and fire it up */
191 writel(nmdk_cycle, mtu_base + MTU_LR(0));
192 writel(nmdk_cycle, mtu_base + MTU_BGLR(0));
193
194 writel(clk_prescale | MTU_CRn_32BITS | MTU_CRn_ENA,
195 mtu_base + MTU_CR(0));
196}
197
119void __init nmdk_timer_init(void) 198void __init nmdk_timer_init(void)
120{ 199{
121 unsigned long rate; 200 unsigned long rate;
122 struct clk *clk0; 201 struct clk *clk0;
123 u32 cr = MTU_CRn_32BITS;
124 202
125 clk0 = clk_get_sys("mtu0", NULL); 203 clk0 = clk_get_sys("mtu0", NULL);
126 BUG_ON(IS_ERR(clk0)); 204 BUG_ON(IS_ERR(clk0));
@@ -138,30 +216,28 @@ void __init nmdk_timer_init(void)
138 rate = clk_get_rate(clk0); 216 rate = clk_get_rate(clk0);
139 if (rate > 32000000) { 217 if (rate > 32000000) {
140 rate /= 16; 218 rate /= 16;
141 cr |= MTU_CRn_PRESCALE_16; 219 clk_prescale = MTU_CRn_PRESCALE_16;
142 } else { 220 } else {
143 cr |= MTU_CRn_PRESCALE_1; 221 clk_prescale = MTU_CRn_PRESCALE_1;
144 } 222 }
145 223
224 nmdk_cycle = (rate + HZ/2) / HZ;
225
226
146 /* Timer 0 is the free running clocksource */ 227 /* Timer 0 is the free running clocksource */
147 writel(cr, mtu_base + MTU_CR(0)); 228 nmdk_clksrc_reset();
148 writel(0, mtu_base + MTU_LR(0));
149 writel(0, mtu_base + MTU_BGLR(0));
150 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0));
151 229
152 if (clocksource_mmio_init(mtu_base + MTU_VAL(0), "mtu_0", 230 if (clocksource_mmio_init(mtu_base + MTU_VAL(0), "mtu_0",
153 rate, 200, 32, clocksource_mmio_readl_down)) 231 rate, 200, 32, clocksource_mmio_readl_down))
154 pr_err("timer: failed to initialize clock source %s\n", 232 pr_err("timer: failed to initialize clock source %s\n",
155 "mtu_0"); 233 "mtu_0");
156 234#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK
157 init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate); 235 init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate);
158 236#endif
159 /* Timer 1 is used for events */ 237 /* Timer 1 is used for events */
160 238
161 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE); 239 clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);
162 240
163 writel(cr | MTU_CRn_ONESHOT, mtu_base + MTU_CR(1)); /* off, currently */
164
165 nmdk_clkevt.max_delta_ns = 241 nmdk_clkevt.max_delta_ns =
166 clockevent_delta2ns(0xffffffff, &nmdk_clkevt); 242 clockevent_delta2ns(0xffffffff, &nmdk_clkevt);
167 nmdk_clkevt.min_delta_ns = 243 nmdk_clkevt.min_delta_ns =
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 75a847dd776a..2def4e1990ed 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -3,6 +3,12 @@
3 * 3 *
4 * OMAP Dual-Mode Timers 4 * OMAP Dual-Mode Timers
5 * 5 *
6 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
7 * Tarun Kanti DebBarma <tarun.kanti@ti.com>
8 * Thara Gopinath <thara@ti.com>
9 *
10 * dmtimer adaptation to platform_driver.
11 *
6 * Copyright (C) 2005 Nokia Corporation 12 * Copyright (C) 2005 Nokia Corporation
7 * OMAP2 support by Juha Yrjola 13 * OMAP2 support by Juha Yrjola
8 * API improvements and OMAP2 clock framework support by Timo Teras 14 * API improvements and OMAP2 clock framework support by Timo Teras
@@ -29,168 +35,80 @@
29 * 675 Mass Ave, Cambridge, MA 02139, USA. 35 * 675 Mass Ave, Cambridge, MA 02139, USA.
30 */ 36 */
31 37
32#include <linux/init.h>
33#include <linux/spinlock.h>
34#include <linux/errno.h>
35#include <linux/list.h>
36#include <linux/clk.h>
37#include <linux/delay.h>
38#include <linux/io.h> 38#include <linux/io.h>
39#include <linux/module.h> 39#include <linux/slab.h>
40#include <mach/hardware.h> 40#include <linux/err.h>
41#include <plat/dmtimer.h> 41#include <linux/pm_runtime.h>
42#include <mach/irqs.h>
43
44static int dm_timer_count;
45
46#ifdef CONFIG_ARCH_OMAP1
47static struct omap_dm_timer omap1_dm_timers[] = {
48 { .phys_base = 0xfffb1400, .irq = INT_1610_GPTIMER1 },
49 { .phys_base = 0xfffb1c00, .irq = INT_1610_GPTIMER2 },
50 { .phys_base = 0xfffb2400, .irq = INT_1610_GPTIMER3 },
51 { .phys_base = 0xfffb2c00, .irq = INT_1610_GPTIMER4 },
52 { .phys_base = 0xfffb3400, .irq = INT_1610_GPTIMER5 },
53 { .phys_base = 0xfffb3c00, .irq = INT_1610_GPTIMER6 },
54 { .phys_base = 0xfffb7400, .irq = INT_1610_GPTIMER7 },
55 { .phys_base = 0xfffbd400, .irq = INT_1610_GPTIMER8 },
56};
57
58static const int omap1_dm_timer_count = ARRAY_SIZE(omap1_dm_timers);
59
60#else
61#define omap1_dm_timers NULL
62#define omap1_dm_timer_count 0
63#endif /* CONFIG_ARCH_OMAP1 */
64
65#ifdef CONFIG_ARCH_OMAP2
66static struct omap_dm_timer omap2_dm_timers[] = {
67 { .phys_base = 0x48028000, .irq = INT_24XX_GPTIMER1 },
68 { .phys_base = 0x4802a000, .irq = INT_24XX_GPTIMER2 },
69 { .phys_base = 0x48078000, .irq = INT_24XX_GPTIMER3 },
70 { .phys_base = 0x4807a000, .irq = INT_24XX_GPTIMER4 },
71 { .phys_base = 0x4807c000, .irq = INT_24XX_GPTIMER5 },
72 { .phys_base = 0x4807e000, .irq = INT_24XX_GPTIMER6 },
73 { .phys_base = 0x48080000, .irq = INT_24XX_GPTIMER7 },
74 { .phys_base = 0x48082000, .irq = INT_24XX_GPTIMER8 },
75 { .phys_base = 0x48084000, .irq = INT_24XX_GPTIMER9 },
76 { .phys_base = 0x48086000, .irq = INT_24XX_GPTIMER10 },
77 { .phys_base = 0x48088000, .irq = INT_24XX_GPTIMER11 },
78 { .phys_base = 0x4808a000, .irq = INT_24XX_GPTIMER12 },
79};
80
81static const char *omap2_dm_source_names[] __initdata = {
82 "sys_ck",
83 "func_32k_ck",
84 "alt_ck",
85 NULL
86};
87
88static struct clk *omap2_dm_source_clocks[3];
89static const int omap2_dm_timer_count = ARRAY_SIZE(omap2_dm_timers);
90
91#else
92#define omap2_dm_timers NULL
93#define omap2_dm_timer_count 0
94#define omap2_dm_source_names NULL
95#define omap2_dm_source_clocks NULL
96#endif /* CONFIG_ARCH_OMAP2 */
97
98#ifdef CONFIG_ARCH_OMAP3
99static struct omap_dm_timer omap3_dm_timers[] = {
100 { .phys_base = 0x48318000, .irq = INT_24XX_GPTIMER1 },
101 { .phys_base = 0x49032000, .irq = INT_24XX_GPTIMER2 },
102 { .phys_base = 0x49034000, .irq = INT_24XX_GPTIMER3 },
103 { .phys_base = 0x49036000, .irq = INT_24XX_GPTIMER4 },
104 { .phys_base = 0x49038000, .irq = INT_24XX_GPTIMER5 },
105 { .phys_base = 0x4903A000, .irq = INT_24XX_GPTIMER6 },
106 { .phys_base = 0x4903C000, .irq = INT_24XX_GPTIMER7 },
107 { .phys_base = 0x4903E000, .irq = INT_24XX_GPTIMER8 },
108 { .phys_base = 0x49040000, .irq = INT_24XX_GPTIMER9 },
109 { .phys_base = 0x48086000, .irq = INT_24XX_GPTIMER10 },
110 { .phys_base = 0x48088000, .irq = INT_24XX_GPTIMER11 },
111 { .phys_base = 0x48304000, .irq = INT_34XX_GPT12_IRQ },
112};
113
114static const char *omap3_dm_source_names[] __initdata = {
115 "sys_ck",
116 "omap_32k_fck",
117 NULL
118};
119
120static struct clk *omap3_dm_source_clocks[2];
121static const int omap3_dm_timer_count = ARRAY_SIZE(omap3_dm_timers);
122 42
123#else 43#include <plat/dmtimer.h>
124#define omap3_dm_timers NULL
125#define omap3_dm_timer_count 0
126#define omap3_dm_source_names NULL
127#define omap3_dm_source_clocks NULL
128#endif /* CONFIG_ARCH_OMAP3 */
129
130#ifdef CONFIG_ARCH_OMAP4
131static struct omap_dm_timer omap4_dm_timers[] = {
132 { .phys_base = 0x4a318000, .irq = OMAP44XX_IRQ_GPT1 },
133 { .phys_base = 0x48032000, .irq = OMAP44XX_IRQ_GPT2 },
134 { .phys_base = 0x48034000, .irq = OMAP44XX_IRQ_GPT3 },
135 { .phys_base = 0x48036000, .irq = OMAP44XX_IRQ_GPT4 },
136 { .phys_base = 0x40138000, .irq = OMAP44XX_IRQ_GPT5 },
137 { .phys_base = 0x4013a000, .irq = OMAP44XX_IRQ_GPT6 },
138 { .phys_base = 0x4013a000, .irq = OMAP44XX_IRQ_GPT7 },
139 { .phys_base = 0x4013e000, .irq = OMAP44XX_IRQ_GPT8 },
140 { .phys_base = 0x4803e000, .irq = OMAP44XX_IRQ_GPT9 },
141 { .phys_base = 0x48086000, .irq = OMAP44XX_IRQ_GPT10 },
142 { .phys_base = 0x48088000, .irq = OMAP44XX_IRQ_GPT11 },
143 { .phys_base = 0x4a320000, .irq = OMAP44XX_IRQ_GPT12 },
144};
145static const char *omap4_dm_source_names[] __initdata = {
146 "sys_clkin_ck",
147 "sys_32k_ck",
148 NULL
149};
150static struct clk *omap4_dm_source_clocks[2];
151static const int omap4_dm_timer_count = ARRAY_SIZE(omap4_dm_timers);
152
153#else
154#define omap4_dm_timers NULL
155#define omap4_dm_timer_count 0
156#define omap4_dm_source_names NULL
157#define omap4_dm_source_clocks NULL
158#endif /* CONFIG_ARCH_OMAP4 */
159
160static struct omap_dm_timer *dm_timers;
161static const char **dm_source_names;
162static struct clk **dm_source_clocks;
163 44
164static spinlock_t dm_timer_lock; 45static LIST_HEAD(omap_timer_list);
46static DEFINE_SPINLOCK(dm_timer_lock);
165 47
166/* 48/**
167 * Reads timer registers in posted and non-posted mode. The posted mode bit 49 * omap_dm_timer_read_reg - read timer registers in posted and non-posted mode
168 * is encoded in reg. Note that in posted mode write pending bit must be 50 * @timer: timer pointer over which read operation to perform
169 * checked. Otherwise a read of a non completed write will produce an error. 51 * @reg: lowest byte holds the register offset
52 *
53 * The posted mode bit is encoded in reg. Note that in posted mode write
54 * pending bit must be checked. Otherwise a read of a non completed write
55 * will produce an error.
170 */ 56 */
171static inline u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, u32 reg) 57static inline u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, u32 reg)
172{ 58{
173 return __omap_dm_timer_read(timer->io_base, reg, timer->posted); 59 WARN_ON((reg & 0xff) < _OMAP_TIMER_WAKEUP_EN_OFFSET);
60 return __omap_dm_timer_read(timer, reg, timer->posted);
174} 61}
175 62
176/* 63/**
177 * Writes timer registers in posted and non-posted mode. The posted mode bit 64 * omap_dm_timer_write_reg - write timer registers in posted and non-posted mode
178 * is encoded in reg. Note that in posted mode the write pending bit must be 65 * @timer: timer pointer over which write operation is to perform
179 * checked. Otherwise a write on a register which has a pending write will be 66 * @reg: lowest byte holds the register offset
180 * lost. 67 * @value: data to write into the register
68 *
69 * The posted mode bit is encoded in reg. Note that in posted mode the write
70 * pending bit must be checked. Otherwise a write on a register which has a
71 * pending write will be lost.
181 */ 72 */
182static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg, 73static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg,
183 u32 value) 74 u32 value)
184{ 75{
185 __omap_dm_timer_write(timer->io_base, reg, value, timer->posted); 76 WARN_ON((reg & 0xff) < _OMAP_TIMER_WAKEUP_EN_OFFSET);
77 __omap_dm_timer_write(timer, reg, value, timer->posted);
78}
79
80static void omap_timer_restore_context(struct omap_dm_timer *timer)
81{
82 omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_OFFSET,
83 timer->context.tiocp_cfg);
84 if (timer->revision > 1)
85 __raw_writel(timer->context.tistat, timer->sys_stat);
86
87 __raw_writel(timer->context.tisr, timer->irq_stat);
88 omap_dm_timer_write_reg(timer, OMAP_TIMER_WAKEUP_EN_REG,
89 timer->context.twer);
90 omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG,
91 timer->context.tcrr);
92 omap_dm_timer_write_reg(timer, OMAP_TIMER_LOAD_REG,
93 timer->context.tldr);
94 omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG,
95 timer->context.tmar);
96 omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG,
97 timer->context.tsicr);
98 __raw_writel(timer->context.tier, timer->irq_ena);
99 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG,
100 timer->context.tclr);
186} 101}
187 102
188static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer) 103static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer)
189{ 104{
190 int c; 105 int c;
191 106
107 if (!timer->sys_stat)
108 return;
109
192 c = 0; 110 c = 0;
193 while (!(omap_dm_timer_read_reg(timer, OMAP_TIMER_SYS_STAT_REG) & 1)) { 111 while (!(__raw_readl(timer->sys_stat) & 1)) {
194 c++; 112 c++;
195 if (c > 100000) { 113 if (c > 100000) {
196 printk(KERN_ERR "Timer failed to reset\n"); 114 printk(KERN_ERR "Timer failed to reset\n");
@@ -201,53 +119,65 @@ static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer)
201 119
202static void omap_dm_timer_reset(struct omap_dm_timer *timer) 120static void omap_dm_timer_reset(struct omap_dm_timer *timer)
203{ 121{
204 int autoidle = 0, wakeup = 0; 122 omap_dm_timer_enable(timer);
205 123 if (timer->pdev->id != 1) {
206 if (!cpu_class_is_omap2() || timer != &dm_timers[0]) {
207 omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06); 124 omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06);
208 omap_dm_timer_wait_for_reset(timer); 125 omap_dm_timer_wait_for_reset(timer);
209 } 126 }
210 omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
211
212 /* Enable autoidle on OMAP2+ */
213 if (cpu_class_is_omap2())
214 autoidle = 1;
215
216 /*
217 * Enable wake-up on OMAP2 CPUs.
218 */
219 if (cpu_class_is_omap2())
220 wakeup = 1;
221 127
222 __omap_dm_timer_reset(timer->io_base, autoidle, wakeup); 128 __omap_dm_timer_reset(timer, 0, 0);
129 omap_dm_timer_disable(timer);
223 timer->posted = 1; 130 timer->posted = 1;
224} 131}
225 132
226void omap_dm_timer_prepare(struct omap_dm_timer *timer) 133int omap_dm_timer_prepare(struct omap_dm_timer *timer)
227{ 134{
228 omap_dm_timer_enable(timer); 135 struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
229 omap_dm_timer_reset(timer); 136 int ret;
137
138 timer->fclk = clk_get(&timer->pdev->dev, "fck");
139 if (WARN_ON_ONCE(IS_ERR_OR_NULL(timer->fclk))) {
140 timer->fclk = NULL;
141 dev_err(&timer->pdev->dev, ": No fclk handle.\n");
142 return -EINVAL;
143 }
144
145 if (pdata->needs_manual_reset)
146 omap_dm_timer_reset(timer);
147
148 ret = omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ);
149
150 timer->posted = 1;
151 return ret;
230} 152}
231 153
232struct omap_dm_timer *omap_dm_timer_request(void) 154struct omap_dm_timer *omap_dm_timer_request(void)
233{ 155{
234 struct omap_dm_timer *timer = NULL; 156 struct omap_dm_timer *timer = NULL, *t;
235 unsigned long flags; 157 unsigned long flags;
236 int i; 158 int ret = 0;
237 159
238 spin_lock_irqsave(&dm_timer_lock, flags); 160 spin_lock_irqsave(&dm_timer_lock, flags);
239 for (i = 0; i < dm_timer_count; i++) { 161 list_for_each_entry(t, &omap_timer_list, node) {
240 if (dm_timers[i].reserved) 162 if (t->reserved)
241 continue; 163 continue;
242 164
243 timer = &dm_timers[i]; 165 timer = t;
244 timer->reserved = 1; 166 timer->reserved = 1;
245 break; 167 break;
246 } 168 }
169
170 if (timer) {
171 ret = omap_dm_timer_prepare(timer);
172 if (ret) {
173 timer->reserved = 0;
174 timer = NULL;
175 }
176 }
247 spin_unlock_irqrestore(&dm_timer_lock, flags); 177 spin_unlock_irqrestore(&dm_timer_lock, flags);
248 178
249 if (timer != NULL) 179 if (!timer)
250 omap_dm_timer_prepare(timer); 180 pr_debug("%s: timer request failed!\n", __func__);
251 181
252 return timer; 182 return timer;
253} 183}
@@ -255,74 +185,65 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_request);
255 185
256struct omap_dm_timer *omap_dm_timer_request_specific(int id) 186struct omap_dm_timer *omap_dm_timer_request_specific(int id)
257{ 187{
258 struct omap_dm_timer *timer; 188 struct omap_dm_timer *timer = NULL, *t;
259 unsigned long flags; 189 unsigned long flags;
190 int ret = 0;
260 191
261 spin_lock_irqsave(&dm_timer_lock, flags); 192 spin_lock_irqsave(&dm_timer_lock, flags);
262 if (id <= 0 || id > dm_timer_count || dm_timers[id-1].reserved) { 193 list_for_each_entry(t, &omap_timer_list, node) {
263 spin_unlock_irqrestore(&dm_timer_lock, flags); 194 if (t->pdev->id == id && !t->reserved) {
264 printk("BUG: warning at %s:%d/%s(): unable to get timer %d\n", 195 timer = t;
265 __FILE__, __LINE__, __func__, id); 196 timer->reserved = 1;
266 dump_stack(); 197 break;
267 return NULL; 198 }
268 } 199 }
269 200
270 timer = &dm_timers[id-1]; 201 if (timer) {
271 timer->reserved = 1; 202 ret = omap_dm_timer_prepare(timer);
203 if (ret) {
204 timer->reserved = 0;
205 timer = NULL;
206 }
207 }
272 spin_unlock_irqrestore(&dm_timer_lock, flags); 208 spin_unlock_irqrestore(&dm_timer_lock, flags);
273 209
274 omap_dm_timer_prepare(timer); 210 if (!timer)
211 pr_debug("%s: timer%d request failed!\n", __func__, id);
275 212
276 return timer; 213 return timer;
277} 214}
278EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific); 215EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific);
279 216
280void omap_dm_timer_free(struct omap_dm_timer *timer) 217int omap_dm_timer_free(struct omap_dm_timer *timer)
281{ 218{
282 omap_dm_timer_enable(timer); 219 if (unlikely(!timer))
283 omap_dm_timer_reset(timer); 220 return -EINVAL;
284 omap_dm_timer_disable(timer); 221
222 clk_put(timer->fclk);
285 223
286 WARN_ON(!timer->reserved); 224 WARN_ON(!timer->reserved);
287 timer->reserved = 0; 225 timer->reserved = 0;
226 return 0;
288} 227}
289EXPORT_SYMBOL_GPL(omap_dm_timer_free); 228EXPORT_SYMBOL_GPL(omap_dm_timer_free);
290 229
291void omap_dm_timer_enable(struct omap_dm_timer *timer) 230void omap_dm_timer_enable(struct omap_dm_timer *timer)
292{ 231{
293 if (timer->enabled) 232 pm_runtime_get_sync(&timer->pdev->dev);
294 return;
295
296#ifdef CONFIG_ARCH_OMAP2PLUS
297 if (cpu_class_is_omap2()) {
298 clk_enable(timer->fclk);
299 clk_enable(timer->iclk);
300 }
301#endif
302
303 timer->enabled = 1;
304} 233}
305EXPORT_SYMBOL_GPL(omap_dm_timer_enable); 234EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
306 235
307void omap_dm_timer_disable(struct omap_dm_timer *timer) 236void omap_dm_timer_disable(struct omap_dm_timer *timer)
308{ 237{
309 if (!timer->enabled) 238 pm_runtime_put(&timer->pdev->dev);
310 return;
311
312#ifdef CONFIG_ARCH_OMAP2PLUS
313 if (cpu_class_is_omap2()) {
314 clk_disable(timer->iclk);
315 clk_disable(timer->fclk);
316 }
317#endif
318
319 timer->enabled = 0;
320} 239}
321EXPORT_SYMBOL_GPL(omap_dm_timer_disable); 240EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
322 241
323int omap_dm_timer_get_irq(struct omap_dm_timer *timer) 242int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
324{ 243{
325 return timer->irq; 244 if (timer)
245 return timer->irq;
246 return -EINVAL;
326} 247}
327EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq); 248EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
328 249
@@ -334,24 +255,29 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
334 */ 255 */
335__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask) 256__u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
336{ 257{
337 int i; 258 int i = 0;
259 struct omap_dm_timer *timer = NULL;
260 unsigned long flags;
338 261
339 /* If ARMXOR cannot be idled this function call is unnecessary */ 262 /* If ARMXOR cannot be idled this function call is unnecessary */
340 if (!(inputmask & (1 << 1))) 263 if (!(inputmask & (1 << 1)))
341 return inputmask; 264 return inputmask;
342 265
343 /* If any active timer is using ARMXOR return modified mask */ 266 /* If any active timer is using ARMXOR return modified mask */
344 for (i = 0; i < dm_timer_count; i++) { 267 spin_lock_irqsave(&dm_timer_lock, flags);
268 list_for_each_entry(timer, &omap_timer_list, node) {
345 u32 l; 269 u32 l;
346 270
347 l = omap_dm_timer_read_reg(&dm_timers[i], OMAP_TIMER_CTRL_REG); 271 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
348 if (l & OMAP_TIMER_CTRL_ST) { 272 if (l & OMAP_TIMER_CTRL_ST) {
349 if (((omap_readl(MOD_CONF_CTRL_1) >> (i * 2)) & 0x03) == 0) 273 if (((omap_readl(MOD_CONF_CTRL_1) >> (i * 2)) & 0x03) == 0)
350 inputmask &= ~(1 << 1); 274 inputmask &= ~(1 << 1);
351 else 275 else
352 inputmask &= ~(1 << 2); 276 inputmask &= ~(1 << 2);
353 } 277 }
278 i++;
354 } 279 }
280 spin_unlock_irqrestore(&dm_timer_lock, flags);
355 281
356 return inputmask; 282 return inputmask;
357} 283}
@@ -361,7 +287,9 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
361 287
362struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) 288struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
363{ 289{
364 return timer->fclk; 290 if (timer)
291 return timer->fclk;
292 return NULL;
365} 293}
366EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk); 294EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
367 295
@@ -375,70 +303,91 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
375 303
376#endif 304#endif
377 305
378void omap_dm_timer_trigger(struct omap_dm_timer *timer) 306int omap_dm_timer_trigger(struct omap_dm_timer *timer)
379{ 307{
308 if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) {
309 pr_err("%s: timer not available or enabled.\n", __func__);
310 return -EINVAL;
311 }
312
380 omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0); 313 omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0);
314 return 0;
381} 315}
382EXPORT_SYMBOL_GPL(omap_dm_timer_trigger); 316EXPORT_SYMBOL_GPL(omap_dm_timer_trigger);
383 317
384void omap_dm_timer_start(struct omap_dm_timer *timer) 318int omap_dm_timer_start(struct omap_dm_timer *timer)
385{ 319{
386 u32 l; 320 u32 l;
387 321
322 if (unlikely(!timer))
323 return -EINVAL;
324
325 omap_dm_timer_enable(timer);
326
327 if (timer->loses_context) {
328 u32 ctx_loss_cnt_after =
329 timer->get_context_loss_count(&timer->pdev->dev);
330 if (ctx_loss_cnt_after != timer->ctx_loss_count)
331 omap_timer_restore_context(timer);
332 }
333
388 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); 334 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
389 if (!(l & OMAP_TIMER_CTRL_ST)) { 335 if (!(l & OMAP_TIMER_CTRL_ST)) {
390 l |= OMAP_TIMER_CTRL_ST; 336 l |= OMAP_TIMER_CTRL_ST;
391 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 337 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
392 } 338 }
339
340 /* Save the context */
341 timer->context.tclr = l;
342 return 0;
393} 343}
394EXPORT_SYMBOL_GPL(omap_dm_timer_start); 344EXPORT_SYMBOL_GPL(omap_dm_timer_start);
395 345
396void omap_dm_timer_stop(struct omap_dm_timer *timer) 346int omap_dm_timer_stop(struct omap_dm_timer *timer)
397{ 347{
398 unsigned long rate = 0; 348 unsigned long rate = 0;
349 struct dmtimer_platform_data *pdata = timer->pdev->dev.platform_data;
399 350
400#ifdef CONFIG_ARCH_OMAP2PLUS 351 if (unlikely(!timer))
401 rate = clk_get_rate(timer->fclk); 352 return -EINVAL;
402#endif
403 353
404 __omap_dm_timer_stop(timer->io_base, timer->posted, rate); 354 if (!pdata->needs_manual_reset)
355 rate = clk_get_rate(timer->fclk);
356
357 __omap_dm_timer_stop(timer, timer->posted, rate);
358
359 return 0;
405} 360}
406EXPORT_SYMBOL_GPL(omap_dm_timer_stop); 361EXPORT_SYMBOL_GPL(omap_dm_timer_stop);
407 362
408#ifdef CONFIG_ARCH_OMAP1
409
410int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) 363int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
411{ 364{
412 int n = (timer - dm_timers) << 1; 365 int ret;
413 u32 l; 366 struct dmtimer_platform_data *pdata;
414
415 l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
416 l |= source << n;
417 omap_writel(l, MOD_CONF_CTRL_1);
418 367
419 return 0; 368 if (unlikely(!timer))
420} 369 return -EINVAL;
421EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
422 370
423#else 371 pdata = timer->pdev->dev.platform_data;
424 372
425int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source)
426{
427 if (source < 0 || source >= 3) 373 if (source < 0 || source >= 3)
428 return -EINVAL; 374 return -EINVAL;
429 375
430 return __omap_dm_timer_set_source(timer->fclk, 376 ret = pdata->set_timer_src(timer->pdev, source);
431 dm_source_clocks[source]); 377
378 return ret;
432} 379}
433EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); 380EXPORT_SYMBOL_GPL(omap_dm_timer_set_source);
434 381
435#endif 382int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload,
436
437void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload,
438 unsigned int load) 383 unsigned int load)
439{ 384{
440 u32 l; 385 u32 l;
441 386
387 if (unlikely(!timer))
388 return -EINVAL;
389
390 omap_dm_timer_enable(timer);
442 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); 391 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
443 if (autoreload) 392 if (autoreload)
444 l |= OMAP_TIMER_CTRL_AR; 393 l |= OMAP_TIMER_CTRL_AR;
@@ -448,15 +397,32 @@ void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload,
448 omap_dm_timer_write_reg(timer, OMAP_TIMER_LOAD_REG, load); 397 omap_dm_timer_write_reg(timer, OMAP_TIMER_LOAD_REG, load);
449 398
450 omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0); 399 omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0);
400 /* Save the context */
401 timer->context.tclr = l;
402 timer->context.tldr = load;
403 omap_dm_timer_disable(timer);
404 return 0;
451} 405}
452EXPORT_SYMBOL_GPL(omap_dm_timer_set_load); 406EXPORT_SYMBOL_GPL(omap_dm_timer_set_load);
453 407
454/* Optimized set_load which removes costly spin wait in timer_start */ 408/* Optimized set_load which removes costly spin wait in timer_start */
455void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, 409int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
456 unsigned int load) 410 unsigned int load)
457{ 411{
458 u32 l; 412 u32 l;
459 413
414 if (unlikely(!timer))
415 return -EINVAL;
416
417 omap_dm_timer_enable(timer);
418
419 if (timer->loses_context) {
420 u32 ctx_loss_cnt_after =
421 timer->get_context_loss_count(&timer->pdev->dev);
422 if (ctx_loss_cnt_after != timer->ctx_loss_count)
423 omap_timer_restore_context(timer);
424 }
425
460 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); 426 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
461 if (autoreload) { 427 if (autoreload) {
462 l |= OMAP_TIMER_CTRL_AR; 428 l |= OMAP_TIMER_CTRL_AR;
@@ -466,15 +432,25 @@ void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload,
466 } 432 }
467 l |= OMAP_TIMER_CTRL_ST; 433 l |= OMAP_TIMER_CTRL_ST;
468 434
469 __omap_dm_timer_load_start(timer->io_base, l, load, timer->posted); 435 __omap_dm_timer_load_start(timer, l, load, timer->posted);
436
437 /* Save the context */
438 timer->context.tclr = l;
439 timer->context.tldr = load;
440 timer->context.tcrr = load;
441 return 0;
470} 442}
471EXPORT_SYMBOL_GPL(omap_dm_timer_set_load_start); 443EXPORT_SYMBOL_GPL(omap_dm_timer_set_load_start);
472 444
473void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, 445int omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable,
474 unsigned int match) 446 unsigned int match)
475{ 447{
476 u32 l; 448 u32 l;
477 449
450 if (unlikely(!timer))
451 return -EINVAL;
452
453 omap_dm_timer_enable(timer);
478 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); 454 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
479 if (enable) 455 if (enable)
480 l |= OMAP_TIMER_CTRL_CE; 456 l |= OMAP_TIMER_CTRL_CE;
@@ -482,14 +458,24 @@ void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable,
482 l &= ~OMAP_TIMER_CTRL_CE; 458 l &= ~OMAP_TIMER_CTRL_CE;
483 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 459 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
484 omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG, match); 460 omap_dm_timer_write_reg(timer, OMAP_TIMER_MATCH_REG, match);
461
462 /* Save the context */
463 timer->context.tclr = l;
464 timer->context.tmar = match;
465 omap_dm_timer_disable(timer);
466 return 0;
485} 467}
486EXPORT_SYMBOL_GPL(omap_dm_timer_set_match); 468EXPORT_SYMBOL_GPL(omap_dm_timer_set_match);
487 469
488void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, 470int omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on,
489 int toggle, int trigger) 471 int toggle, int trigger)
490{ 472{
491 u32 l; 473 u32 l;
492 474
475 if (unlikely(!timer))
476 return -EINVAL;
477
478 omap_dm_timer_enable(timer);
493 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); 479 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
494 l &= ~(OMAP_TIMER_CTRL_GPOCFG | OMAP_TIMER_CTRL_SCPWM | 480 l &= ~(OMAP_TIMER_CTRL_GPOCFG | OMAP_TIMER_CTRL_SCPWM |
495 OMAP_TIMER_CTRL_PT | (0x03 << 10)); 481 OMAP_TIMER_CTRL_PT | (0x03 << 10));
@@ -499,13 +485,22 @@ void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on,
499 l |= OMAP_TIMER_CTRL_PT; 485 l |= OMAP_TIMER_CTRL_PT;
500 l |= trigger << 10; 486 l |= trigger << 10;
501 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 487 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
488
489 /* Save the context */
490 timer->context.tclr = l;
491 omap_dm_timer_disable(timer);
492 return 0;
502} 493}
503EXPORT_SYMBOL_GPL(omap_dm_timer_set_pwm); 494EXPORT_SYMBOL_GPL(omap_dm_timer_set_pwm);
504 495
505void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler) 496int omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler)
506{ 497{
507 u32 l; 498 u32 l;
508 499
500 if (unlikely(!timer))
501 return -EINVAL;
502
503 omap_dm_timer_enable(timer);
509 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); 504 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
510 l &= ~(OMAP_TIMER_CTRL_PRE | (0x07 << 2)); 505 l &= ~(OMAP_TIMER_CTRL_PRE | (0x07 << 2));
511 if (prescaler >= 0x00 && prescaler <= 0x07) { 506 if (prescaler >= 0x00 && prescaler <= 0x07) {
@@ -513,13 +508,28 @@ void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler)
513 l |= prescaler << 2; 508 l |= prescaler << 2;
514 } 509 }
515 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); 510 omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l);
511
512 /* Save the context */
513 timer->context.tclr = l;
514 omap_dm_timer_disable(timer);
515 return 0;
516} 516}
517EXPORT_SYMBOL_GPL(omap_dm_timer_set_prescaler); 517EXPORT_SYMBOL_GPL(omap_dm_timer_set_prescaler);
518 518
519void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, 519int omap_dm_timer_set_int_enable(struct omap_dm_timer *timer,
520 unsigned int value) 520 unsigned int value)
521{ 521{
522 __omap_dm_timer_int_enable(timer->io_base, value); 522 if (unlikely(!timer))
523 return -EINVAL;
524
525 omap_dm_timer_enable(timer);
526 __omap_dm_timer_int_enable(timer, value);
527
528 /* Save the context */
529 timer->context.tier = value;
530 timer->context.twer = value;
531 omap_dm_timer_disable(timer);
532 return 0;
523} 533}
524EXPORT_SYMBOL_GPL(omap_dm_timer_set_int_enable); 534EXPORT_SYMBOL_GPL(omap_dm_timer_set_int_enable);
525 535
@@ -527,40 +537,61 @@ unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer)
527{ 537{
528 unsigned int l; 538 unsigned int l;
529 539
530 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_STAT_REG); 540 if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) {
541 pr_err("%s: timer not available or enabled.\n", __func__);
542 return 0;
543 }
544
545 l = __raw_readl(timer->irq_stat);
531 546
532 return l; 547 return l;
533} 548}
534EXPORT_SYMBOL_GPL(omap_dm_timer_read_status); 549EXPORT_SYMBOL_GPL(omap_dm_timer_read_status);
535 550
536void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value) 551int omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value)
537{ 552{
538 __omap_dm_timer_write_status(timer->io_base, value); 553 if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev)))
554 return -EINVAL;
555
556 __omap_dm_timer_write_status(timer, value);
557 /* Save the context */
558 timer->context.tisr = value;
559 return 0;
539} 560}
540EXPORT_SYMBOL_GPL(omap_dm_timer_write_status); 561EXPORT_SYMBOL_GPL(omap_dm_timer_write_status);
541 562
542unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer) 563unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer)
543{ 564{
544 return __omap_dm_timer_read_counter(timer->io_base, timer->posted); 565 if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) {
566 pr_err("%s: timer not iavailable or enabled.\n", __func__);
567 return 0;
568 }
569
570 return __omap_dm_timer_read_counter(timer, timer->posted);
545} 571}
546EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter); 572EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter);
547 573
548void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value) 574int omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value)
549{ 575{
576 if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) {
577 pr_err("%s: timer not available or enabled.\n", __func__);
578 return -EINVAL;
579 }
580
550 omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value); 581 omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, value);
582
583 /* Save the context */
584 timer->context.tcrr = value;
585 return 0;
551} 586}
552EXPORT_SYMBOL_GPL(omap_dm_timer_write_counter); 587EXPORT_SYMBOL_GPL(omap_dm_timer_write_counter);
553 588
554int omap_dm_timers_active(void) 589int omap_dm_timers_active(void)
555{ 590{
556 int i; 591 struct omap_dm_timer *timer;
557
558 for (i = 0; i < dm_timer_count; i++) {
559 struct omap_dm_timer *timer;
560
561 timer = &dm_timers[i];
562 592
563 if (!timer->enabled) 593 list_for_each_entry(timer, &omap_timer_list, node) {
594 if (!timer->reserved)
564 continue; 595 continue;
565 596
566 if (omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG) & 597 if (omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG) &
@@ -572,69 +603,147 @@ int omap_dm_timers_active(void)
572} 603}
573EXPORT_SYMBOL_GPL(omap_dm_timers_active); 604EXPORT_SYMBOL_GPL(omap_dm_timers_active);
574 605
575static int __init omap_dm_timer_init(void) 606/**
607 * omap_dm_timer_probe - probe function called for every registered device
608 * @pdev: pointer to current timer platform device
609 *
610 * Called by driver framework at the end of device registration for all
611 * timer devices.
612 */
613static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
576{ 614{
615 int ret;
616 unsigned long flags;
577 struct omap_dm_timer *timer; 617 struct omap_dm_timer *timer;
578 int i, map_size = SZ_8K; /* Module 4KB + L4 4KB except on omap1 */ 618 struct resource *mem, *irq, *ioarea;
619 struct dmtimer_platform_data *pdata = pdev->dev.platform_data;
579 620
580 if (!(cpu_is_omap16xx() || cpu_class_is_omap2())) 621 if (!pdata) {
622 dev_err(&pdev->dev, "%s: no platform data.\n", __func__);
581 return -ENODEV; 623 return -ENODEV;
624 }
582 625
583 spin_lock_init(&dm_timer_lock); 626 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
584 627 if (unlikely(!irq)) {
585 if (cpu_class_is_omap1()) { 628 dev_err(&pdev->dev, "%s: no IRQ resource.\n", __func__);
586 dm_timers = omap1_dm_timers; 629 return -ENODEV;
587 dm_timer_count = omap1_dm_timer_count;
588 map_size = SZ_2K;
589 } else if (cpu_is_omap24xx()) {
590 dm_timers = omap2_dm_timers;
591 dm_timer_count = omap2_dm_timer_count;
592 dm_source_names = omap2_dm_source_names;
593 dm_source_clocks = omap2_dm_source_clocks;
594 } else if (cpu_is_omap34xx()) {
595 dm_timers = omap3_dm_timers;
596 dm_timer_count = omap3_dm_timer_count;
597 dm_source_names = omap3_dm_source_names;
598 dm_source_clocks = omap3_dm_source_clocks;
599 } else if (cpu_is_omap44xx()) {
600 dm_timers = omap4_dm_timers;
601 dm_timer_count = omap4_dm_timer_count;
602 dm_source_names = omap4_dm_source_names;
603 dm_source_clocks = omap4_dm_source_clocks;
604 } 630 }
605 631
606 if (cpu_class_is_omap2()) 632 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
607 for (i = 0; dm_source_names[i] != NULL; i++) 633 if (unlikely(!mem)) {
608 dm_source_clocks[i] = clk_get(NULL, dm_source_names[i]); 634 dev_err(&pdev->dev, "%s: no memory resource.\n", __func__);
635 return -ENODEV;
636 }
609 637
610 if (cpu_is_omap243x()) 638 ioarea = request_mem_region(mem->start, resource_size(mem),
611 dm_timers[0].phys_base = 0x49018000; 639 pdev->name);
640 if (!ioarea) {
641 dev_err(&pdev->dev, "%s: region already claimed.\n", __func__);
642 return -EBUSY;
643 }
612 644
613 for (i = 0; i < dm_timer_count; i++) { 645 timer = kzalloc(sizeof(struct omap_dm_timer), GFP_KERNEL);
614 timer = &dm_timers[i]; 646 if (!timer) {
647 dev_err(&pdev->dev, "%s: no memory for omap_dm_timer.\n",
648 __func__);
649 ret = -ENOMEM;
650 goto err_free_ioregion;
651 }
615 652
616 /* Static mapping, never released */ 653 timer->io_base = ioremap(mem->start, resource_size(mem));
617 timer->io_base = ioremap(timer->phys_base, map_size); 654 if (!timer->io_base) {
618 BUG_ON(!timer->io_base); 655 dev_err(&pdev->dev, "%s: ioremap failed.\n", __func__);
656 ret = -ENOMEM;
657 goto err_free_mem;
658 }
619 659
620#ifdef CONFIG_ARCH_OMAP2PLUS 660 timer->id = pdev->id;
621 if (cpu_class_is_omap2()) { 661 timer->irq = irq->start;
622 char clk_name[16]; 662 timer->reserved = pdata->reserved;
623 sprintf(clk_name, "gpt%d_ick", i + 1); 663 timer->pdev = pdev;
624 timer->iclk = clk_get(NULL, clk_name); 664 timer->loses_context = pdata->loses_context;
625 sprintf(clk_name, "gpt%d_fck", i + 1); 665 timer->get_context_loss_count = pdata->get_context_loss_count;
626 timer->fclk = clk_get(NULL, clk_name); 666
627 } 667 /* Skip pm_runtime_enable for OMAP1 */
668 if (!pdata->needs_manual_reset) {
669 pm_runtime_enable(&pdev->dev);
670 pm_runtime_irq_safe(&pdev->dev);
671 }
628 672
629 /* One or two timers may be set up early for sys_timer */ 673 if (!timer->reserved) {
630 if (sys_timer_reserved & (1 << i)) { 674 pm_runtime_get_sync(&pdev->dev);
631 timer->reserved = 1; 675 __omap_dm_timer_init_regs(timer);
632 timer->posted = 1; 676 pm_runtime_put(&pdev->dev);
633 }
634#endif
635 } 677 }
636 678
679 /* add the timer element to the list */
680 spin_lock_irqsave(&dm_timer_lock, flags);
681 list_add_tail(&timer->node, &omap_timer_list);
682 spin_unlock_irqrestore(&dm_timer_lock, flags);
683
684 dev_dbg(&pdev->dev, "Device Probed.\n");
685
637 return 0; 686 return 0;
687
688err_free_mem:
689 kfree(timer);
690
691err_free_ioregion:
692 release_mem_region(mem->start, resource_size(mem));
693
694 return ret;
638} 695}
639 696
640arch_initcall(omap_dm_timer_init); 697/**
698 * omap_dm_timer_remove - cleanup a registered timer device
699 * @pdev: pointer to current timer platform device
700 *
701 * Called by driver framework whenever a timer device is unregistered.
702 * In addition to freeing platform resources it also deletes the timer
703 * entry from the local list.
704 */
705static int __devexit omap_dm_timer_remove(struct platform_device *pdev)
706{
707 struct omap_dm_timer *timer;
708 unsigned long flags;
709 int ret = -EINVAL;
710
711 spin_lock_irqsave(&dm_timer_lock, flags);
712 list_for_each_entry(timer, &omap_timer_list, node)
713 if (timer->pdev->id == pdev->id) {
714 list_del(&timer->node);
715 kfree(timer);
716 ret = 0;
717 break;
718 }
719 spin_unlock_irqrestore(&dm_timer_lock, flags);
720
721 return ret;
722}
723
724static struct platform_driver omap_dm_timer_driver = {
725 .probe = omap_dm_timer_probe,
726 .remove = __devexit_p(omap_dm_timer_remove),
727 .driver = {
728 .name = "omap_timer",
729 },
730};
731
732static int __init omap_dm_timer_driver_init(void)
733{
734 return platform_driver_register(&omap_dm_timer_driver);
735}
736
737static void __exit omap_dm_timer_driver_exit(void)
738{
739 platform_driver_unregister(&omap_dm_timer_driver);
740}
741
742early_platform_init("earlytimer", &omap_dm_timer_driver);
743module_init(omap_dm_timer_driver_init);
744module_exit(omap_dm_timer_driver_exit);
745
746MODULE_DESCRIPTION("OMAP Dual-Mode Timer Driver");
747MODULE_LICENSE("GPL");
748MODULE_ALIAS("platform:" DRIVER_NAME);
749MODULE_AUTHOR("Texas Instruments Inc");
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index df4b9683f17f..197ca03c3f7d 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -80,8 +80,6 @@ struct clkops {
80 * 80 *
81 * @div is the divisor that should be applied to the parent clock's rate 81 * @div is the divisor that should be applied to the parent clock's rate
82 * to produce the current clock's rate. 82 * to produce the current clock's rate.
83 *
84 * XXX @flags probably should be replaced with an struct omap_chip.
85 */ 83 */
86struct clksel_rate { 84struct clksel_rate {
87 u32 val; 85 u32 val;
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index 4564cc697d7f..5cac97e36079 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -45,6 +45,15 @@ extern unsigned long long notrace omap_32k_sched_clock(void);
45 45
46extern void omap_reserve(void); 46extern void omap_reserve(void);
47 47
48void omap2420_init_early(void);
49void omap2430_init_early(void);
50void omap3430_init_early(void);
51void omap35xx_init_early(void);
52void omap3630_init_early(void);
53void am35xx_init_early(void);
54void ti816x_init_early(void);
55void omap4430_init_early(void);
56
48/* 57/*
49 * IO bases for various OMAP processors 58 * IO bases for various OMAP processors
50 * Except the tap base, rest all the io bases 59 * Except the tap base, rest all the io bases
diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index 67b3d75884cd..2f9026942229 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -44,13 +44,6 @@
44 44
45int omap_type(void); 45int omap_type(void);
46 46
47struct omap_chip_id {
48 u16 oc;
49 u8 type;
50};
51
52#define OMAP_CHIP_INIT(x) { .oc = x }
53
54/* 47/*
55 * omap_rev bits: 48 * omap_rev bits:
56 * CPU id bits (0730, 1510, 1710, 2422...) [31:16] 49 * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
@@ -60,19 +53,6 @@ struct omap_chip_id {
60unsigned int omap_rev(void); 53unsigned int omap_rev(void);
61 54
62/* 55/*
63 * Define CPU revision bits
64 *
65 * Verbose meaning of the revision bits may be different for a silicon
66 * family. This difference can be handled separately.
67 */
68#define OMAP_REVBITS_00 0x00
69#define OMAP_REVBITS_01 0x01
70#define OMAP_REVBITS_02 0x02
71#define OMAP_REVBITS_03 0x03
72#define OMAP_REVBITS_04 0x04
73#define OMAP_REVBITS_05 0x05
74
75/*
76 * Get the CPU revision for OMAP devices 56 * Get the CPU revision for OMAP devices
77 */ 57 */
78#define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff) 58#define GET_OMAP_REVISION() ((omap_rev() >> 8) & 0xff)
@@ -262,7 +242,7 @@ IS_OMAP_TYPE(2422, 0x2422)
262IS_OMAP_TYPE(2423, 0x2423) 242IS_OMAP_TYPE(2423, 0x2423)
263IS_OMAP_TYPE(2430, 0x2430) 243IS_OMAP_TYPE(2430, 0x2430)
264IS_OMAP_TYPE(3430, 0x3430) 244IS_OMAP_TYPE(3430, 0x3430)
265IS_OMAP_TYPE(3505, 0x3505) 245IS_OMAP_TYPE(3505, 0x3517)
266IS_OMAP_TYPE(3517, 0x3517) 246IS_OMAP_TYPE(3517, 0x3517)
267 247
268#define cpu_is_omap310() 0 248#define cpu_is_omap310() 0
@@ -354,8 +334,9 @@ IS_OMAP_TYPE(3517, 0x3517)
354 (!omap3_has_sgx()) && \ 334 (!omap3_has_sgx()) && \
355 (omap3_has_iva())) 335 (omap3_has_iva()))
356# define cpu_is_omap3530() (cpu_is_omap3430()) 336# define cpu_is_omap3530() (cpu_is_omap3430())
357# define cpu_is_omap3505() is_omap3505()
358# define cpu_is_omap3517() is_omap3517() 337# define cpu_is_omap3517() is_omap3517()
338# define cpu_is_omap3505() (cpu_is_omap3517() && \
339 !omap3_has_sgx())
359# undef cpu_is_omap3630 340# undef cpu_is_omap3630
360# define cpu_is_omap3630() is_omap363x() 341# define cpu_is_omap3630() is_omap363x()
361# define cpu_is_ti816x() is_ti816x() 342# define cpu_is_ti816x() is_ti816x()
@@ -379,35 +360,31 @@ IS_OMAP_TYPE(3517, 0x3517)
379/* Various silicon revisions for omap2 */ 360/* Various silicon revisions for omap2 */
380#define OMAP242X_CLASS 0x24200024 361#define OMAP242X_CLASS 0x24200024
381#define OMAP2420_REV_ES1_0 OMAP242X_CLASS 362#define OMAP2420_REV_ES1_0 OMAP242X_CLASS
382#define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (OMAP_REVBITS_01 << 8)) 363#define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (0x1 << 8))
383 364
384#define OMAP243X_CLASS 0x24300024 365#define OMAP243X_CLASS 0x24300024
385#define OMAP2430_REV_ES1_0 OMAP243X_CLASS 366#define OMAP2430_REV_ES1_0 OMAP243X_CLASS
386 367
387#define OMAP343X_CLASS 0x34300034 368#define OMAP343X_CLASS 0x34300034
388#define OMAP3430_REV_ES1_0 OMAP343X_CLASS 369#define OMAP3430_REV_ES1_0 OMAP343X_CLASS
389#define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (OMAP_REVBITS_01 << 8)) 370#define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (0x1 << 8))
390#define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (OMAP_REVBITS_02 << 8)) 371#define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (0x2 << 8))
391#define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (OMAP_REVBITS_03 << 8)) 372#define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (0x3 << 8))
392#define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (OMAP_REVBITS_04 << 8)) 373#define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (0x4 << 8))
393#define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (OMAP_REVBITS_05 << 8)) 374#define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (0x5 << 8))
394 375
395#define OMAP363X_CLASS 0x36300034 376#define OMAP363X_CLASS 0x36300034
396#define OMAP3630_REV_ES1_0 OMAP363X_CLASS 377#define OMAP3630_REV_ES1_0 OMAP363X_CLASS
397#define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (OMAP_REVBITS_01 << 8)) 378#define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (0x1 << 8))
398#define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (OMAP_REVBITS_02 << 8)) 379#define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (0x2 << 8))
399 380
400#define OMAP35XX_CLASS 0x35000034 381#define OMAP3517_CLASS 0x35170034
401#define OMAP3503_REV(v) (OMAP35XX_CLASS | (0x3503 << 16) | (v << 8)) 382#define OMAP3517_REV_ES1_0 OMAP3517_CLASS
402#define OMAP3515_REV(v) (OMAP35XX_CLASS | (0x3515 << 16) | (v << 8)) 383#define OMAP3517_REV_ES1_1 (OMAP3517_CLASS | (0x1 << 8))
403#define OMAP3525_REV(v) (OMAP35XX_CLASS | (0x3525 << 16) | (v << 8))
404#define OMAP3530_REV(v) (OMAP35XX_CLASS | (0x3530 << 16) | (v << 8))
405#define OMAP3505_REV(v) (OMAP35XX_CLASS | (0x3505 << 16) | (v << 8))
406#define OMAP3517_REV(v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 8))
407 384
408#define TI816X_CLASS 0x81600034 385#define TI816X_CLASS 0x81600034
409#define TI8168_REV_ES1_0 TI816X_CLASS 386#define TI8168_REV_ES1_0 TI816X_CLASS
410#define TI8168_REV_ES1_1 (TI816X_CLASS | (OMAP_REVBITS_01 << 8)) 387#define TI8168_REV_ES1_1 (TI816X_CLASS | (0x1 << 8))
411 388
412#define OMAP443X_CLASS 0x44300044 389#define OMAP443X_CLASS 0x44300044
413#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) 390#define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8))
@@ -418,61 +395,6 @@ IS_OMAP_TYPE(3517, 0x3517)
418#define OMAP446X_CLASS 0x44600044 395#define OMAP446X_CLASS 0x44600044
419#define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8)) 396#define OMAP4460_REV_ES1_0 (OMAP446X_CLASS | (0x10 << 8))
420 397
421/*
422 * omap_chip bits
423 *
424 * CHIP_IS_OMAP{2420,2430,3430} indicate that a particular structure is
425 * valid on all chips of that type. CHIP_IS_OMAP3430ES{1,2} indicates
426 * something that is only valid on that particular ES revision.
427 *
428 * These bits may be ORed together to indicate structures that are
429 * available on multiple chip types.
430 *
431 * To test whether a particular structure matches the current OMAP chip type,
432 * use omap_chip_is().
433 *
434 */
435#define CHIP_IS_OMAP2420 (1 << 0)
436#define CHIP_IS_OMAP2430 (1 << 1)
437#define CHIP_IS_OMAP3430 (1 << 2)
438#define CHIP_IS_OMAP3430ES1 (1 << 3)
439#define CHIP_IS_OMAP3430ES2 (1 << 4)
440#define CHIP_IS_OMAP3430ES3_0 (1 << 5)
441#define CHIP_IS_OMAP3430ES3_1 (1 << 6)
442#define CHIP_IS_OMAP3630ES1 (1 << 7)
443#define CHIP_IS_OMAP4430ES1 (1 << 8)
444#define CHIP_IS_OMAP3630ES1_1 (1 << 9)
445#define CHIP_IS_OMAP3630ES1_2 (1 << 10)
446#define CHIP_IS_OMAP4430ES2 (1 << 11)
447#define CHIP_IS_OMAP4430ES2_1 (1 << 12)
448#define CHIP_IS_OMAP4430ES2_2 (1 << 13)
449#define CHIP_IS_TI816X (1 << 14)
450#define CHIP_IS_OMAP4460ES1_0 (1 << 15)
451
452#define CHIP_IS_OMAP24XX (CHIP_IS_OMAP2420 | CHIP_IS_OMAP2430)
453
454#define CHIP_IS_OMAP4430 (CHIP_IS_OMAP4430ES1 | \
455 CHIP_IS_OMAP4430ES2 | \
456 CHIP_IS_OMAP4430ES2_1 | \
457 CHIP_IS_OMAP4430ES2_2 | \
458 CHIP_IS_OMAP4460ES1_0)
459
460/*
461 * "GE" here represents "greater than or equal to" in terms of ES
462 * levels. So CHIP_GE_OMAP3430ES2 is intended to match all OMAP3430
463 * chips at ES2 and beyond, but not, for example, any OMAP lines after
464 * OMAP3.
465 */
466#define CHIP_GE_OMAP3430ES2 (CHIP_IS_OMAP3430ES2 | \
467 CHIP_IS_OMAP3430ES3_0 | \
468 CHIP_GE_OMAP3430ES3_1)
469#define CHIP_GE_OMAP3430ES3_1 (CHIP_IS_OMAP3430ES3_1 | \
470 CHIP_IS_OMAP3630ES1 | \
471 CHIP_GE_OMAP3630ES1_1)
472#define CHIP_GE_OMAP3630ES1_1 (CHIP_IS_OMAP3630ES1_1 | \
473 CHIP_IS_OMAP3630ES1_2)
474
475int omap_chip_is(struct omap_chip_id oci);
476void omap2_check_revision(void); 398void omap2_check_revision(void);
477 399
478/* 400/*
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index eb5d16c60cd9..d11025e6e7a4 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/dmtimer.h 2 * arch/arm/plat-omap/include/plat/dmtimer.h
3 * 3 *
4 * OMAP Dual-Mode Timers 4 * OMAP Dual-Mode Timers
5 * 5 *
@@ -35,6 +35,7 @@
35#include <linux/clk.h> 35#include <linux/clk.h>
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/io.h> 37#include <linux/io.h>
38#include <linux/platform_device.h>
38 39
39#ifndef __ASM_ARCH_DMTIMER_H 40#ifndef __ASM_ARCH_DMTIMER_H
40#define __ASM_ARCH_DMTIMER_H 41#define __ASM_ARCH_DMTIMER_H
@@ -59,12 +60,56 @@
59 * in OMAP4 can be distinguished. 60 * in OMAP4 can be distinguished.
60 */ 61 */
61#define OMAP_TIMER_IP_VERSION_1 0x1 62#define OMAP_TIMER_IP_VERSION_1 0x1
63
64/* timer capabilities used in hwmod database */
65#define OMAP_TIMER_SECURE 0x80000000
66#define OMAP_TIMER_ALWON 0x40000000
67#define OMAP_TIMER_HAS_PWM 0x20000000
68
69struct omap_timer_capability_dev_attr {
70 u32 timer_capability;
71};
72
62struct omap_dm_timer; 73struct omap_dm_timer;
63struct clk; 74struct clk;
64 75
76struct timer_regs {
77 u32 tidr;
78 u32 tiocp_cfg;
79 u32 tistat;
80 u32 tisr;
81 u32 tier;
82 u32 twer;
83 u32 tclr;
84 u32 tcrr;
85 u32 tldr;
86 u32 ttrg;
87 u32 twps;
88 u32 tmar;
89 u32 tcar1;
90 u32 tsicr;
91 u32 tcar2;
92 u32 tpir;
93 u32 tnir;
94 u32 tcvr;
95 u32 tocr;
96 u32 towr;
97};
98
99struct dmtimer_platform_data {
100 int (*set_timer_src)(struct platform_device *pdev, int source);
101 int timer_ip_version;
102 u32 needs_manual_reset:1;
103 bool reserved;
104
105 bool loses_context;
106
107 u32 (*get_context_loss_count)(struct device *dev);
108};
109
65struct omap_dm_timer *omap_dm_timer_request(void); 110struct omap_dm_timer *omap_dm_timer_request(void);
66struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); 111struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id);
67void omap_dm_timer_free(struct omap_dm_timer *timer); 112int omap_dm_timer_free(struct omap_dm_timer *timer);
68void omap_dm_timer_enable(struct omap_dm_timer *timer); 113void omap_dm_timer_enable(struct omap_dm_timer *timer);
69void omap_dm_timer_disable(struct omap_dm_timer *timer); 114void omap_dm_timer_disable(struct omap_dm_timer *timer);
70 115
@@ -73,23 +118,23 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer);
73u32 omap_dm_timer_modify_idlect_mask(u32 inputmask); 118u32 omap_dm_timer_modify_idlect_mask(u32 inputmask);
74struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer); 119struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer);
75 120
76void omap_dm_timer_trigger(struct omap_dm_timer *timer); 121int omap_dm_timer_trigger(struct omap_dm_timer *timer);
77void omap_dm_timer_start(struct omap_dm_timer *timer); 122int omap_dm_timer_start(struct omap_dm_timer *timer);
78void omap_dm_timer_stop(struct omap_dm_timer *timer); 123int omap_dm_timer_stop(struct omap_dm_timer *timer);
79 124
80int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source); 125int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source);
81void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value); 126int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value);
82void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, unsigned int value); 127int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, unsigned int value);
83void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match); 128int omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match);
84void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, int toggle, int trigger); 129int omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, int toggle, int trigger);
85void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler); 130int omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler);
86 131
87void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value); 132int omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value);
88 133
89unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer); 134unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer);
90void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value); 135int omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value);
91unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer); 136unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer);
92void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value); 137int omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value);
93 138
94int omap_dm_timers_active(void); 139int omap_dm_timers_active(void);
95 140
@@ -98,12 +143,30 @@ int omap_dm_timers_active(void);
98 * used by dmtimer.c and sys_timer related code. 143 * used by dmtimer.c and sys_timer related code.
99 */ 144 */
100 145
101/* register offsets */ 146/*
102#define _OMAP_TIMER_ID_OFFSET 0x00 147 * The interrupt registers are different between v1 and v2 ip.
103#define _OMAP_TIMER_OCP_CFG_OFFSET 0x10 148 * These registers are offsets from timer->iobase.
104#define _OMAP_TIMER_SYS_STAT_OFFSET 0x14 149 */
105#define _OMAP_TIMER_STAT_OFFSET 0x18 150#define OMAP_TIMER_ID_OFFSET 0x00
106#define _OMAP_TIMER_INT_EN_OFFSET 0x1c 151#define OMAP_TIMER_OCP_CFG_OFFSET 0x10
152
153#define OMAP_TIMER_V1_SYS_STAT_OFFSET 0x14
154#define OMAP_TIMER_V1_STAT_OFFSET 0x18
155#define OMAP_TIMER_V1_INT_EN_OFFSET 0x1c
156
157#define OMAP_TIMER_V2_IRQSTATUS_RAW 0x24
158#define OMAP_TIMER_V2_IRQSTATUS 0x28
159#define OMAP_TIMER_V2_IRQENABLE_SET 0x2c
160#define OMAP_TIMER_V2_IRQENABLE_CLR 0x30
161
162/*
163 * The functional registers have a different base on v1 and v2 ip.
164 * These registers are offsets from timer->func_base. The func_base
165 * is samae as io_base for v1 and io_base + 0x14 for v2 ip.
166 *
167 */
168#define OMAP_TIMER_V2_FUNC_OFFSET 0x14
169
107#define _OMAP_TIMER_WAKEUP_EN_OFFSET 0x20 170#define _OMAP_TIMER_WAKEUP_EN_OFFSET 0x20
108#define _OMAP_TIMER_CTRL_OFFSET 0x24 171#define _OMAP_TIMER_CTRL_OFFSET 0x24
109#define OMAP_TIMER_CTRL_GPOCFG (1 << 14) 172#define OMAP_TIMER_CTRL_GPOCFG (1 << 14)
@@ -147,21 +210,6 @@ int omap_dm_timers_active(void);
147/* register offsets with the write pending bit encoded */ 210/* register offsets with the write pending bit encoded */
148#define WPSHIFT 16 211#define WPSHIFT 16
149 212
150#define OMAP_TIMER_ID_REG (_OMAP_TIMER_ID_OFFSET \
151 | (WP_NONE << WPSHIFT))
152
153#define OMAP_TIMER_OCP_CFG_REG (_OMAP_TIMER_OCP_CFG_OFFSET \
154 | (WP_NONE << WPSHIFT))
155
156#define OMAP_TIMER_SYS_STAT_REG (_OMAP_TIMER_SYS_STAT_OFFSET \
157 | (WP_NONE << WPSHIFT))
158
159#define OMAP_TIMER_STAT_REG (_OMAP_TIMER_STAT_OFFSET \
160 | (WP_NONE << WPSHIFT))
161
162#define OMAP_TIMER_INT_EN_REG (_OMAP_TIMER_INT_EN_OFFSET \
163 | (WP_NONE << WPSHIFT))
164
165#define OMAP_TIMER_WAKEUP_EN_REG (_OMAP_TIMER_WAKEUP_EN_OFFSET \ 213#define OMAP_TIMER_WAKEUP_EN_REG (_OMAP_TIMER_WAKEUP_EN_OFFSET \
166 | (WP_NONE << WPSHIFT)) 214 | (WP_NONE << WPSHIFT))
167 215
@@ -209,49 +257,88 @@ int omap_dm_timers_active(void);
209 257
210struct omap_dm_timer { 258struct omap_dm_timer {
211 unsigned long phys_base; 259 unsigned long phys_base;
260 int id;
212 int irq; 261 int irq;
213#ifdef CONFIG_ARCH_OMAP2PLUS
214 struct clk *iclk, *fclk; 262 struct clk *iclk, *fclk;
215#endif 263
216 void __iomem *io_base; 264 void __iomem *io_base;
265 void __iomem *sys_stat; /* TISTAT timer status */
266 void __iomem *irq_stat; /* TISR/IRQSTATUS interrupt status */
267 void __iomem *irq_ena; /* irq enable */
268 void __iomem *irq_dis; /* irq disable, only on v2 ip */
269 void __iomem *pend; /* write pending */
270 void __iomem *func_base; /* function register base */
271
217 unsigned long rate; 272 unsigned long rate;
218 unsigned reserved:1; 273 unsigned reserved:1;
219 unsigned enabled:1;
220 unsigned posted:1; 274 unsigned posted:1;
275 struct timer_regs context;
276 bool loses_context;
277 int ctx_loss_count;
278 int revision;
279 struct platform_device *pdev;
280 struct list_head node;
281
282 u32 (*get_context_loss_count)(struct device *dev);
221}; 283};
222 284
223extern u32 sys_timer_reserved; 285int omap_dm_timer_prepare(struct omap_dm_timer *timer);
224void omap_dm_timer_prepare(struct omap_dm_timer *timer);
225 286
226static inline u32 __omap_dm_timer_read(void __iomem *base, u32 reg, 287static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg,
227 int posted) 288 int posted)
228{ 289{
229 if (posted) 290 if (posted)
230 while (__raw_readl(base + (OMAP_TIMER_WRITE_PEND_REG & 0xff)) 291 while (__raw_readl(timer->pend) & (reg >> WPSHIFT))
231 & (reg >> WPSHIFT))
232 cpu_relax(); 292 cpu_relax();
233 293
234 return __raw_readl(base + (reg & 0xff)); 294 return __raw_readl(timer->func_base + (reg & 0xff));
235} 295}
236 296
237static inline void __omap_dm_timer_write(void __iomem *base, u32 reg, u32 val, 297static inline void __omap_dm_timer_write(struct omap_dm_timer *timer,
238 int posted) 298 u32 reg, u32 val, int posted)
239{ 299{
240 if (posted) 300 if (posted)
241 while (__raw_readl(base + (OMAP_TIMER_WRITE_PEND_REG & 0xff)) 301 while (__raw_readl(timer->pend) & (reg >> WPSHIFT))
242 & (reg >> WPSHIFT))
243 cpu_relax(); 302 cpu_relax();
244 303
245 __raw_writel(val, base + (reg & 0xff)); 304 __raw_writel(val, timer->func_base + (reg & 0xff));
305}
306
307static inline void __omap_dm_timer_init_regs(struct omap_dm_timer *timer)
308{
309 u32 tidr;
310
311 /* Assume v1 ip if bits [31:16] are zero */
312 tidr = __raw_readl(timer->io_base);
313 if (!(tidr >> 16)) {
314 timer->revision = 1;
315 timer->sys_stat = timer->io_base +
316 OMAP_TIMER_V1_SYS_STAT_OFFSET;
317 timer->irq_stat = timer->io_base + OMAP_TIMER_V1_STAT_OFFSET;
318 timer->irq_ena = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
319 timer->irq_dis = 0;
320 timer->pend = timer->io_base + _OMAP_TIMER_WRITE_PEND_OFFSET;
321 timer->func_base = timer->io_base;
322 } else {
323 timer->revision = 2;
324 timer->sys_stat = 0;
325 timer->irq_stat = timer->io_base + OMAP_TIMER_V2_IRQSTATUS;
326 timer->irq_ena = timer->io_base + OMAP_TIMER_V2_IRQENABLE_SET;
327 timer->irq_dis = timer->io_base + OMAP_TIMER_V2_IRQENABLE_CLR;
328 timer->pend = timer->io_base +
329 _OMAP_TIMER_WRITE_PEND_OFFSET +
330 OMAP_TIMER_V2_FUNC_OFFSET;
331 timer->func_base = timer->io_base + OMAP_TIMER_V2_FUNC_OFFSET;
332 }
246} 333}
247 334
248/* Assumes the source clock has been set by caller */ 335/* Assumes the source clock has been set by caller */
249static inline void __omap_dm_timer_reset(void __iomem *base, int autoidle, 336static inline void __omap_dm_timer_reset(struct omap_dm_timer *timer,
250 int wakeup) 337 int autoidle, int wakeup)
251{ 338{
252 u32 l; 339 u32 l;
253 340
254 l = __omap_dm_timer_read(base, OMAP_TIMER_OCP_CFG_REG, 0); 341 l = __raw_readl(timer->io_base + OMAP_TIMER_OCP_CFG_OFFSET);
255 l |= 0x02 << 3; /* Set to smart-idle mode */ 342 l |= 0x02 << 3; /* Set to smart-idle mode */
256 l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */ 343 l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */
257 344
@@ -261,10 +348,10 @@ static inline void __omap_dm_timer_reset(void __iomem *base, int autoidle,
261 if (wakeup) 348 if (wakeup)
262 l |= 1 << 2; 349 l |= 1 << 2;
263 350
264 __omap_dm_timer_write(base, OMAP_TIMER_OCP_CFG_REG, l, 0); 351 __raw_writel(l, timer->io_base + OMAP_TIMER_OCP_CFG_OFFSET);
265 352
266 /* Match hardware reset default of posted mode */ 353 /* Match hardware reset default of posted mode */
267 __omap_dm_timer_write(base, OMAP_TIMER_IF_CTRL_REG, 354 __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG,
268 OMAP_TIMER_CTRL_POSTED, 0); 355 OMAP_TIMER_CTRL_POSTED, 0);
269} 356}
270 357
@@ -286,18 +373,18 @@ static inline int __omap_dm_timer_set_source(struct clk *timer_fck,
286 return ret; 373 return ret;
287} 374}
288 375
289static inline void __omap_dm_timer_stop(void __iomem *base, int posted, 376static inline void __omap_dm_timer_stop(struct omap_dm_timer *timer,
290 unsigned long rate) 377 int posted, unsigned long rate)
291{ 378{
292 u32 l; 379 u32 l;
293 380
294 l = __omap_dm_timer_read(base, OMAP_TIMER_CTRL_REG, posted); 381 l = __omap_dm_timer_read(timer, OMAP_TIMER_CTRL_REG, posted);
295 if (l & OMAP_TIMER_CTRL_ST) { 382 if (l & OMAP_TIMER_CTRL_ST) {
296 l &= ~0x1; 383 l &= ~0x1;
297 __omap_dm_timer_write(base, OMAP_TIMER_CTRL_REG, l, posted); 384 __omap_dm_timer_write(timer, OMAP_TIMER_CTRL_REG, l, posted);
298#ifdef CONFIG_ARCH_OMAP2PLUS 385#ifdef CONFIG_ARCH_OMAP2PLUS
299 /* Readback to make sure write has completed */ 386 /* Readback to make sure write has completed */
300 __omap_dm_timer_read(base, OMAP_TIMER_CTRL_REG, posted); 387 __omap_dm_timer_read(timer, OMAP_TIMER_CTRL_REG, posted);
301 /* 388 /*
302 * Wait for functional clock period x 3.5 to make sure that 389 * Wait for functional clock period x 3.5 to make sure that
303 * timer is stopped 390 * timer is stopped
@@ -307,34 +394,34 @@ static inline void __omap_dm_timer_stop(void __iomem *base, int posted,
307 } 394 }
308 395
309 /* Ack possibly pending interrupt */ 396 /* Ack possibly pending interrupt */
310 __omap_dm_timer_write(base, OMAP_TIMER_STAT_REG, 397 __raw_writel(OMAP_TIMER_INT_OVERFLOW, timer->irq_stat);
311 OMAP_TIMER_INT_OVERFLOW, 0);
312} 398}
313 399
314static inline void __omap_dm_timer_load_start(void __iomem *base, u32 ctrl, 400static inline void __omap_dm_timer_load_start(struct omap_dm_timer *timer,
315 unsigned int load, int posted) 401 u32 ctrl, unsigned int load,
402 int posted)
316{ 403{
317 __omap_dm_timer_write(base, OMAP_TIMER_COUNTER_REG, load, posted); 404 __omap_dm_timer_write(timer, OMAP_TIMER_COUNTER_REG, load, posted);
318 __omap_dm_timer_write(base, OMAP_TIMER_CTRL_REG, ctrl, posted); 405 __omap_dm_timer_write(timer, OMAP_TIMER_CTRL_REG, ctrl, posted);
319} 406}
320 407
321static inline void __omap_dm_timer_int_enable(void __iomem *base, 408static inline void __omap_dm_timer_int_enable(struct omap_dm_timer *timer,
322 unsigned int value) 409 unsigned int value)
323{ 410{
324 __omap_dm_timer_write(base, OMAP_TIMER_INT_EN_REG, value, 0); 411 __raw_writel(value, timer->irq_ena);
325 __omap_dm_timer_write(base, OMAP_TIMER_WAKEUP_EN_REG, value, 0); 412 __omap_dm_timer_write(timer, OMAP_TIMER_WAKEUP_EN_REG, value, 0);
326} 413}
327 414
328static inline unsigned int __omap_dm_timer_read_counter(void __iomem *base, 415static inline unsigned int
329 int posted) 416__omap_dm_timer_read_counter(struct omap_dm_timer *timer, int posted)
330{ 417{
331 return __omap_dm_timer_read(base, OMAP_TIMER_COUNTER_REG, posted); 418 return __omap_dm_timer_read(timer, OMAP_TIMER_COUNTER_REG, posted);
332} 419}
333 420
334static inline void __omap_dm_timer_write_status(void __iomem *base, 421static inline void __omap_dm_timer_write_status(struct omap_dm_timer *timer,
335 unsigned int value) 422 unsigned int value)
336{ 423{
337 __omap_dm_timer_write(base, OMAP_TIMER_STAT_REG, value, 0); 424 __raw_writel(value, timer->irq_stat);
338} 425}
339 426
340#endif /* __ASM_ARCH_DMTIMER_H */ 427#endif /* __ASM_ARCH_DMTIMER_H */
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index d72ec85c97e6..75311fc9c018 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -300,7 +300,7 @@ static inline void omap44xx_map_common_io(void)
300#endif 300#endif
301 301
302extern void omap2_init_common_infrastructure(void); 302extern void omap2_init_common_infrastructure(void);
303extern void omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, 303extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
304 struct omap_sdrc_params *sdrc_cs1); 304 struct omap_sdrc_params *sdrc_cs1);
305 305
306#define __arch_ioremap omap_ioremap 306#define __arch_ioremap omap_ioremap
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 0e329ca88a70..9115aedd2124 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -496,7 +496,6 @@ struct omap_hwmod_class {
496 * @_state: internal-use hwmod state 496 * @_state: internal-use hwmod state
497 * @_postsetup_state: internal-use state to leave the hwmod in after _setup() 497 * @_postsetup_state: internal-use state to leave the hwmod in after _setup()
498 * @flags: hwmod flags (documented below) 498 * @flags: hwmod flags (documented below)
499 * @omap_chip: OMAP chips this hwmod is present on
500 * @_lock: spinlock serializing operations on this hwmod 499 * @_lock: spinlock serializing operations on this hwmod
501 * @node: list node for hwmod list (internal use) 500 * @node: list node for hwmod list (internal use)
502 * 501 *
@@ -545,7 +544,6 @@ struct omap_hwmod {
545 u8 _int_flags; 544 u8 _int_flags;
546 u8 _state; 545 u8 _state;
547 u8 _postsetup_state; 546 u8 _postsetup_state;
548 const struct omap_chip_id omap_chip;
549}; 547};
550 548
551int omap_hwmod_register(struct omap_hwmod **ohs); 549int omap_hwmod_register(struct omap_hwmod **ohs);
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 9a6a53854911..02609eee0562 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -615,6 +615,9 @@ static int _od_resume_noirq(struct device *dev)
615 615
616 return pm_generic_resume_noirq(dev); 616 return pm_generic_resume_noirq(dev);
617} 617}
618#else
619#define _od_suspend_noirq NULL
620#define _od_resume_noirq NULL
618#endif 621#endif
619 622
620static struct dev_pm_domain omap_device_pm_domain = { 623static struct dev_pm_domain omap_device_pm_domain = {
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c
index 02af235298e2..5f84a3f13ef9 100644
--- a/arch/arm/plat-s5p/clock.c
+++ b/arch/arm/plat-s5p/clock.c
@@ -192,7 +192,7 @@ unsigned long s5p_spdif_get_rate(struct clk *clk)
192 if (IS_ERR(pclk)) 192 if (IS_ERR(pclk))
193 return -EINVAL; 193 return -EINVAL;
194 194
195 rate = pclk->ops->get_rate(clk); 195 rate = pclk->ops->get_rate(pclk);
196 clk_put(pclk); 196 clk_put(pclk);
197 197
198 return rate; 198 return rate;
diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c
index 327ab9f662e8..f71078ef6bb5 100644
--- a/arch/arm/plat-s5p/irq-gpioint.c
+++ b/arch/arm/plat-s5p/irq-gpioint.c
@@ -23,6 +23,8 @@
23#include <plat/gpio-core.h> 23#include <plat/gpio-core.h>
24#include <plat/gpio-cfg.h> 24#include <plat/gpio-cfg.h>
25 25
26#include <asm/mach/irq.h>
27
26#define GPIO_BASE(chip) (((unsigned long)(chip)->base) & 0xFFFFF000u) 28#define GPIO_BASE(chip) (((unsigned long)(chip)->base) & 0xFFFFF000u)
27 29
28#define CON_OFFSET 0x700 30#define CON_OFFSET 0x700
@@ -81,6 +83,9 @@ static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
81 int group, pend_offset, mask_offset; 83 int group, pend_offset, mask_offset;
82 unsigned int pend, mask; 84 unsigned int pend, mask;
83 85
86 struct irq_chip *chip = irq_get_chip(irq);
87 chained_irq_enter(chip, desc);
88
84 for (group = 0; group < bank->nr_groups; group++) { 89 for (group = 0; group < bank->nr_groups; group++) {
85 struct s3c_gpio_chip *chip = bank->chips[group]; 90 struct s3c_gpio_chip *chip = bank->chips[group];
86 if (!chip) 91 if (!chip)
@@ -102,6 +107,7 @@ static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
102 pend &= ~BIT(offset); 107 pend &= ~BIT(offset);
103 } 108 }
104 } 109 }
110 chained_irq_exit(chip, desc);
105} 111}
106 112
107static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) 113static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip)
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index 302c42670bd1..3b4451979d1b 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -64,6 +64,17 @@ static LIST_HEAD(clocks);
64 */ 64 */
65DEFINE_SPINLOCK(clocks_lock); 65DEFINE_SPINLOCK(clocks_lock);
66 66
67/* Global watchdog clock used by arch_wtd_reset() callback */
68struct clk *s3c2410_wdtclk;
69static int __init s3c_wdt_reset_init(void)
70{
71 s3c2410_wdtclk = clk_get(NULL, "watchdog");
72 if (IS_ERR(s3c2410_wdtclk))
73 printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
74 return 0;
75}
76arch_initcall(s3c_wdt_reset_init);
77
67/* enable and disable calls for use with the clk struct */ 78/* enable and disable calls for use with the clk struct */
68 79
69static int clk_null_enable(struct clk *clk, int enable) 80static int clk_null_enable(struct clk *clk, int enable)
diff --git a/arch/arm/plat-samsung/include/plat/backlight.h b/arch/arm/plat-samsung/include/plat/backlight.h
index 51d8da846a62..ad530c78fe8c 100644
--- a/arch/arm/plat-samsung/include/plat/backlight.h
+++ b/arch/arm/plat-samsung/include/plat/backlight.h
@@ -20,7 +20,7 @@ struct samsung_bl_gpio_info {
20 int func; 20 int func;
21}; 21};
22 22
23extern void samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, 23extern void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info,
24 struct platform_pwm_backlight_data *bl_data); 24 struct platform_pwm_backlight_data *bl_data);
25 25
26#endif /* __ASM_PLAT_BACKLIGHT_H */ 26#endif /* __ASM_PLAT_BACKLIGHT_H */
diff --git a/arch/arm/plat-samsung/include/plat/clock.h b/arch/arm/plat-samsung/include/plat/clock.h
index 87d5b38a86fb..73c66d4d10fa 100644
--- a/arch/arm/plat-samsung/include/plat/clock.h
+++ b/arch/arm/plat-samsung/include/plat/clock.h
@@ -9,6 +9,9 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10*/ 10*/
11 11
12#ifndef __ASM_PLAT_CLOCK_H
13#define __ASM_PLAT_CLOCK_H __FILE__
14
12#include <linux/spinlock.h> 15#include <linux/spinlock.h>
13#include <linux/clkdev.h> 16#include <linux/clkdev.h>
14 17
@@ -121,3 +124,8 @@ extern int s3c64xx_sclk_ctrl(struct clk *clk, int enable);
121 124
122extern void s3c_pwmclk_init(void); 125extern void s3c_pwmclk_init(void);
123 126
127/* Global watchdog clock used by arch_wtd_reset() callback */
128
129extern struct clk *s3c2410_wdtclk;
130
131#endif /* __ASM_PLAT_CLOCK_H */
diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
index 54b762acb5a0..40dbb2b0ae22 100644
--- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h
+++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
@@ -10,6 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <plat/clock.h>
13#include <plat/regs-watchdog.h> 14#include <plat/regs-watchdog.h>
14#include <mach/map.h> 15#include <mach/map.h>
15 16
@@ -19,17 +20,12 @@
19 20
20static inline void arch_wdt_reset(void) 21static inline void arch_wdt_reset(void)
21{ 22{
22 struct clk *wdtclk;
23
24 printk("arch_reset: attempting watchdog reset\n"); 23 printk("arch_reset: attempting watchdog reset\n");
25 24
26 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ 25 __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */
27 26
28 wdtclk = clk_get(NULL, "watchdog"); 27 if (s3c2410_wdtclk)
29 if (!IS_ERR(wdtclk)) { 28 clk_enable(s3c2410_wdtclk);
30 clk_enable(wdtclk);
31 } else
32 printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__);
33 29
34 /* put initial values into count and data */ 30 /* put initial values into count and data */
35 __raw_writel(0x80, S3C2410_WTCNT); 31 __raw_writel(0x80, S3C2410_WTCNT);
diff --git a/arch/arm/plat-samsung/irq-vic-timer.c b/arch/arm/plat-samsung/irq-vic-timer.c
index f714d060370d..51583cd30164 100644
--- a/arch/arm/plat-samsung/irq-vic-timer.c
+++ b/arch/arm/plat-samsung/irq-vic-timer.c
@@ -22,9 +22,14 @@
22#include <plat/irq-vic-timer.h> 22#include <plat/irq-vic-timer.h>
23#include <plat/regs-timer.h> 23#include <plat/regs-timer.h>
24 24
25#include <asm/mach/irq.h>
26
25static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc) 27static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc)
26{ 28{
29 struct irq_chip *chip = irq_get_chip(irq);
30 chained_irq_enter(chip, desc);
27 generic_handle_irq((int)desc->irq_data.handler_data); 31 generic_handle_irq((int)desc->irq_data.handler_data);
32 chained_irq_exit(chip, desc);
28} 33}
29 34
30/* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */ 35/* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index fff68d0d521b..62cc8f981171 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -351,7 +351,7 @@ centro MACH_CENTRO CENTRO 1944
351nokia_rx51 MACH_NOKIA_RX51 NOKIA_RX51 1955 351nokia_rx51 MACH_NOKIA_RX51 NOKIA_RX51 1955
352omap_zoom2 MACH_OMAP_ZOOM2 OMAP_ZOOM2 1967 352omap_zoom2 MACH_OMAP_ZOOM2 OMAP_ZOOM2 1967
353cpuat9260 MACH_CPUAT9260 CPUAT9260 1973 353cpuat9260 MACH_CPUAT9260 CPUAT9260 1973
354eukrea_cpuimx27 MACH_CPUIMX27 CPUIMX27 1975 354eukrea_cpuimx27 MACH_EUKREA_CPUIMX27 EUKREA_CPUIMX27 1975
355acs5k MACH_ACS5K ACS5K 1982 355acs5k MACH_ACS5K ACS5K 1982
356snapper_9260 MACH_SNAPPER_9260 SNAPPER_9260 1987 356snapper_9260 MACH_SNAPPER_9260 SNAPPER_9260 1987
357dsm320 MACH_DSM320 DSM320 1988 357dsm320 MACH_DSM320 DSM320 1988
@@ -476,8 +476,8 @@ cns3420vb MACH_CNS3420VB CNS3420VB 2776
476omap4_panda MACH_OMAP4_PANDA OMAP4_PANDA 2791 476omap4_panda MACH_OMAP4_PANDA OMAP4_PANDA 2791
477ti8168evm MACH_TI8168EVM TI8168EVM 2800 477ti8168evm MACH_TI8168EVM TI8168EVM 2800
478teton_bga MACH_TETON_BGA TETON_BGA 2816 478teton_bga MACH_TETON_BGA TETON_BGA 2816
479eukrea_cpuimx25sd MACH_EUKREA_CPUIMX25 EUKREA_CPUIMX25 2820 479eukrea_cpuimx25sd MACH_EUKREA_CPUIMX25SD EUKREA_CPUIMX25SD 2820
480eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35 EUKREA_CPUIMX35 2821 480eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35SD EUKREA_CPUIMX35SD 2821
481eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822 481eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822
482eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823 482eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823
483smdkc210 MACH_SMDKC210 SMDKC210 2838 483smdkc210 MACH_SMDKC210 SMDKC210 2838