aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 18:20:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 18:20:41 -0500
commit3298a3511f1e73255a8dc023efd909e569eea037 (patch)
tree2d8e9bdb9e398049e3876b99fbb4d51099a45cc3 /arch/arm/mach-omap2
parent5ce7aba976ebdfbf467e3cbcd3a7536ebdec4b11 (diff)
parentacb7452369e4f8749dd32d48dbda98936035a87c (diff)
Merge tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC multiplatform support from Arnd Bergmann: "Converting more ARM platforms to multiplatform support. This time, OMAP gets converted, which is a major step since this is by far the largest platform in terms of code size. The same thing happens to the vt8500 platform." * tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: net: cwdavinci_cpdma: export symbols for cpsw remoteproc: omap: depend on OMAP_MBOX_FWK [media] davinci: do not include mach/hardware.h ARM: OMAP2+: Make sure files with omap initcalls include soc.h ARM: OMAP2+: Include soc.h to drm.c to fix compiling ARM: OMAP2+: Fix warning for hwspinlock omap_postcore_initcall ARM: multi_v7_defconfig: add ARCH_ZYNQ ARM: multi_v7_defconfig: remove unnecessary CONFIG_GPIOLIB arm: vt8500: Remove remaining mach includes arm: vt8500: Convert debug-macro.S to be multiplatform friendly arm: vt8500: Remove single platform Kconfig options ARM: OMAP2+: Remove now obsolete uncompress.h and debug-macro.S ARM: OMAP2+: Add minimal support for booting vexpress ARM: OMAP2+: Enable ARCH_MULTIPLATFORM support ARM: OMAP2+: Disable code that currently does not work with multiplaform ARM: OMAP2+: Add multiplatform debug_ll support ARM: OMAP: Fix dmaengine init for multiplatform ARM: OMAP: Fix i2c cmdline initcall for multiplatform ARM: OMAP2+: Use omap initcalls ARM: OMAP2+: Limit omap initcalls to omap only on multiplatform kernels
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Kconfig25
-rw-r--r--arch/arm/mach-omap2/Makefile3
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c2
-rw-r--r--arch/arm/mach-omap2/board-rx51-video.c3
-rw-r--r--arch/arm/mach-omap2/clock2xxx.c2
-rw-r--r--arch/arm/mach-omap2/clock3xxx.c2
-rw-r--r--arch/arm/mach-omap2/devices.c6
-rw-r--r--arch/arm/mach-omap2/dma.c23
-rw-r--r--arch/arm/mach-omap2/drm.c2
-rw-r--r--arch/arm/mach-omap2/emu.c2
-rw-r--r--arch/arm/mach-omap2/fb.c4
-rw-r--r--arch/arm/mach-omap2/gpio.c5
-rw-r--r--arch/arm/mach-omap2/gpmc.c4
-rw-r--r--arch/arm/mach-omap2/hdq1w.c3
-rw-r--r--arch/arm/mach-omap2/hwspinlock.c3
-rw-r--r--arch/arm/mach-omap2/i2c.c5
-rw-r--r--arch/arm/mach-omap2/include/mach/debug-macro.S165
-rw-r--r--arch/arm/mach-omap2/include/mach/serial.h37
-rw-r--r--arch/arm/mach-omap2/include/mach/uncompress.h171
-rw-r--r--arch/arm/mach-omap2/mcbsp.c3
-rw-r--r--arch/arm/mach-omap2/omap-iommu.c3
-rw-r--r--arch/arm/mach-omap2/omap2-restart.c3
-rw-r--r--arch/arm/mach-omap2/omap4-common.c4
-rw-r--r--arch/arm/mach-omap2/omap_device.c5
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c2
-rw-r--r--arch/arm/mach-omap2/omap_phy_internal.c2
-rw-r--r--arch/arm/mach-omap2/opp3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/opp4xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/pm-debug.c2
-rw-r--r--arch/arm/mach-omap2/pm.c2
-rw-r--r--arch/arm/mach-omap2/pmu.c2
-rw-r--r--arch/arm/mach-omap2/prm3xxx.c2
-rw-r--r--arch/arm/mach-omap2/prm44xx.c2
-rw-r--r--arch/arm/mach-omap2/serial.c2
-rw-r--r--arch/arm/mach-omap2/smartreflex-class3.c3
-rw-r--r--arch/arm/mach-omap2/soc.h29
-rw-r--r--arch/arm/mach-omap2/timer.c2
-rw-r--r--arch/arm/mach-omap2/wd_timer.c2
38 files changed, 127 insertions, 414 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 41b581fd0213..c3c033f283a9 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -1,3 +1,26 @@
1config ARCH_OMAP
2 bool
3
4config ARCH_OMAP2PLUS
5 bool "TI OMAP2/3/4/5 SoCs with device tree support" if (ARCH_MULTI_V6 || ARCH_MULTI_V7)
6 select ARCH_HAS_CPUFREQ
7 select ARCH_HAS_HOLES_MEMORYMODEL
8 select ARCH_OMAP
9 select ARCH_REQUIRE_GPIOLIB
10 select CLKDEV_LOOKUP
11 select CLKSRC_MMIO
12 select GENERIC_CLOCKEVENTS
13 select GENERIC_IRQ_CHIP
14 select HAVE_CLK
15 select OMAP_DM_TIMER
16 select PINCTRL
17 select PROC_DEVICETREE if PROC_FS
18 select SPARSE_IRQ
19 select USE_OF
20 help
21 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
22
23
1if ARCH_OMAP2PLUS 24if ARCH_OMAP2PLUS
2 25
3menu "TI OMAP2/3/4 Specific Features" 26menu "TI OMAP2/3/4 Specific Features"
@@ -397,7 +420,7 @@ config OMAP3_SDRC_AC_TIMING
397 420
398config OMAP4_ERRATA_I688 421config OMAP4_ERRATA_I688
399 bool "OMAP4 errata: Async Bridge Corruption" 422 bool "OMAP4 errata: Async Bridge Corruption"
400 depends on ARCH_OMAP4 423 depends on ARCH_OMAP4 && !ARCH_MULTIPLATFORM
401 select ARCH_HAS_BARRIERS 424 select ARCH_HAS_BARRIERS
402 help 425 help
403 If a data is stalled inside asynchronous bridge because of back 426 If a data is stalled inside asynchronous bridge because of back
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 947cafe65aef..65fb6fb38caf 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -2,6 +2,9 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
6 -I$(srctree)/arch/arm/plat-omap/include
7
5# Common support 8# Common support
6obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \ 9obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
7 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \ 10 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index d07058b9c284..284500ddacdb 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -495,7 +495,7 @@ static int __init beagle_opp_init(void)
495 } 495 }
496 return 0; 496 return 0;
497} 497}
498device_initcall(beagle_opp_init); 498omap_device_initcall(beagle_opp_init);
499 499
500static void __init omap3_beagle_init(void) 500static void __init omap3_beagle_init(void)
501{ 501{
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c
index 46f4fc982766..eb667261df08 100644
--- a/arch/arm/mach-omap2/board-rx51-video.c
+++ b/arch/arm/mach-omap2/board-rx51-video.c
@@ -18,6 +18,7 @@
18#include <video/omapdss.h> 18#include <video/omapdss.h>
19#include <linux/platform_data/spi-omap2-mcspi.h> 19#include <linux/platform_data/spi-omap2-mcspi.h>
20 20
21#include "soc.h"
21#include "board-rx51.h" 22#include "board-rx51.h"
22 23
23#include "mux.h" 24#include "mux.h"
@@ -85,5 +86,5 @@ static int __init rx51_video_init(void)
85 return 0; 86 return 0;
86} 87}
87 88
88subsys_initcall(rx51_video_init); 89omap_subsys_initcall(rx51_video_init);
89#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */ 90#endif /* defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) */
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c
index 1ff646908627..b870f6a9e283 100644
--- a/arch/arm/mach-omap2/clock2xxx.c
+++ b/arch/arm/mach-omap2/clock2xxx.c
@@ -52,6 +52,6 @@ static int __init omap2xxx_clk_arch_init(void)
52 return ret; 52 return ret;
53} 53}
54 54
55arch_initcall(omap2xxx_clk_arch_init); 55omap_arch_initcall(omap2xxx_clk_arch_init);
56 56
57 57
diff --git a/arch/arm/mach-omap2/clock3xxx.c b/arch/arm/mach-omap2/clock3xxx.c
index 4eacab8f1176..0b02b4161d71 100644
--- a/arch/arm/mach-omap2/clock3xxx.c
+++ b/arch/arm/mach-omap2/clock3xxx.c
@@ -94,6 +94,6 @@ static int __init omap3xxx_clk_arch_init(void)
94 return ret; 94 return ret;
95} 95}
96 96
97arch_initcall(omap3xxx_clk_arch_init); 97omap_arch_initcall(omap3xxx_clk_arch_init);
98 98
99 99
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index b6cc233214d7..342d69399ec7 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -69,7 +69,7 @@ static int __init omap3_l3_init(void)
69 69
70 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; 70 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
71} 71}
72postcore_initcall(omap3_l3_init); 72omap_postcore_initcall(omap3_l3_init);
73 73
74static int __init omap4_l3_init(void) 74static int __init omap4_l3_init(void)
75{ 75{
@@ -104,7 +104,7 @@ static int __init omap4_l3_init(void)
104 104
105 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; 105 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
106} 106}
107postcore_initcall(omap4_l3_init); 107omap_postcore_initcall(omap4_l3_init);
108 108
109#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) 109#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
110 110
@@ -779,4 +779,4 @@ static int __init omap2_init_devices(void)
779 779
780 return 0; 780 return 0;
781} 781}
782arch_initcall(omap2_init_devices); 782omap_arch_initcall(omap2_init_devices);
diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index 612b98249873..5cd8d7668bec 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -27,7 +27,7 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/device.h> 29#include <linux/device.h>
30 30#include <linux/dma-mapping.h>
31#include <linux/omap-dma.h> 31#include <linux/omap-dma.h>
32 32
33#include "soc.h" 33#include "soc.h"
@@ -288,9 +288,26 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
288 return 0; 288 return 0;
289} 289}
290 290
291static const struct platform_device_info omap_dma_dev_info = {
292 .name = "omap-dma-engine",
293 .id = -1,
294 .dma_mask = DMA_BIT_MASK(32),
295};
296
291static int __init omap2_system_dma_init(void) 297static int __init omap2_system_dma_init(void)
292{ 298{
293 return omap_hwmod_for_each_by_class("dma", 299 struct platform_device *pdev;
300 int res;
301
302 res = omap_hwmod_for_each_by_class("dma",
294 omap2_system_dma_init_dev, NULL); 303 omap2_system_dma_init_dev, NULL);
304 if (res)
305 return res;
306
307 pdev = platform_device_register_full(&omap_dma_dev_info);
308 if (IS_ERR(pdev))
309 return PTR_ERR(pdev);
310
311 return res;
295} 312}
296arch_initcall(omap2_system_dma_init); 313omap_arch_initcall(omap2_system_dma_init);
diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
index 2a2cfa88ddbf..231ed5f2bc81 100644
--- a/arch/arm/mach-omap2/drm.c
+++ b/arch/arm/mach-omap2/drm.c
@@ -63,6 +63,6 @@ static int __init omap_init_drm(void)
63 63
64} 64}
65 65
66arch_initcall(omap_init_drm); 66omap_arch_initcall(omap_init_drm);
67 67
68#endif 68#endif
diff --git a/arch/arm/mach-omap2/emu.c b/arch/arm/mach-omap2/emu.c
index b3566f68a559..cbeaca2d7695 100644
--- a/arch/arm/mach-omap2/emu.c
+++ b/arch/arm/mach-omap2/emu.c
@@ -47,4 +47,4 @@ static int __init emu_init(void)
47 return 0; 47 return 0;
48} 48}
49 49
50subsys_initcall(emu_init); 50omap_subsys_initcall(emu_init);
diff --git a/arch/arm/mach-omap2/fb.c b/arch/arm/mach-omap2/fb.c
index d9bd965f6d07..190ae493c6ef 100644
--- a/arch/arm/mach-omap2/fb.c
+++ b/arch/arm/mach-omap2/fb.c
@@ -89,7 +89,7 @@ static int __init omap_init_vrfb(void)
89 return 0; 89 return 0;
90} 90}
91 91
92arch_initcall(omap_init_vrfb); 92omap_arch_initcall(omap_init_vrfb);
93#endif 93#endif
94 94
95#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) 95#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
@@ -113,6 +113,6 @@ static int __init omap_init_fb(void)
113 return platform_device_register(&omap_fb_device); 113 return platform_device_register(&omap_fb_device);
114} 114}
115 115
116arch_initcall(omap_init_fb); 116omap_arch_initcall(omap_init_fb);
117 117
118#endif 118#endif
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 399acabc3d0b..40950f5af1f0 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -23,6 +23,7 @@
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/platform_data/gpio-omap.h> 24#include <linux/platform_data/gpio-omap.h>
25 25
26#include "soc.h"
26#include "omap_hwmod.h" 27#include "omap_hwmod.h"
27#include "omap_device.h" 28#include "omap_device.h"
28#include "omap-pm.h" 29#include "omap-pm.h"
@@ -147,7 +148,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
147/* 148/*
148 * gpio_init needs to be done before 149 * gpio_init needs to be done before
149 * machine_init functions access gpio APIs. 150 * machine_init functions access gpio APIs.
150 * Hence gpio_init is a postcore_initcall. 151 * Hence gpio_init is a omap_postcore_initcall.
151 */ 152 */
152static int __init omap2_gpio_init(void) 153static int __init omap2_gpio_init(void)
153{ 154{
@@ -157,4 +158,4 @@ static int __init omap2_gpio_init(void)
157 158
158 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL); 159 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL);
159} 160}
160postcore_initcall(omap2_gpio_init); 161omap_postcore_initcall(omap2_gpio_init);
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 03d771349be6..7911e2824899 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1426,7 +1426,7 @@ static __exit void gpmc_exit(void)
1426 1426
1427} 1427}
1428 1428
1429postcore_initcall(gpmc_init); 1429omap_postcore_initcall(gpmc_init);
1430module_exit(gpmc_exit); 1430module_exit(gpmc_exit);
1431 1431
1432static int __init omap_gpmc_init(void) 1432static int __init omap_gpmc_init(void)
@@ -1453,7 +1453,7 @@ static int __init omap_gpmc_init(void)
1453 1453
1454 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; 1454 return IS_ERR(pdev) ? PTR_ERR(pdev) : 0;
1455} 1455}
1456postcore_initcall(omap_gpmc_init); 1456omap_postcore_initcall(omap_gpmc_init);
1457 1457
1458static irqreturn_t gpmc_handle_irq(int irq, void *dev) 1458static irqreturn_t gpmc_handle_irq(int irq, void *dev)
1459{ 1459{
diff --git a/arch/arm/mach-omap2/hdq1w.c b/arch/arm/mach-omap2/hdq1w.c
index ab7bf181a105..f6e0e7e68f9f 100644
--- a/arch/arm/mach-omap2/hdq1w.c
+++ b/arch/arm/mach-omap2/hdq1w.c
@@ -27,6 +27,7 @@
27#include <linux/err.h> 27#include <linux/err.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29 29
30#include "soc.h"
30#include "omap_hwmod.h" 31#include "omap_hwmod.h"
31#include "omap_device.h" 32#include "omap_device.h"
32#include "hdq1w.h" 33#include "hdq1w.h"
@@ -93,4 +94,4 @@ static int __init omap_init_hdq(void)
93 94
94 return 0; 95 return 0;
95} 96}
96arch_initcall(omap_init_hdq); 97omap_arch_initcall(omap_init_hdq);
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
index 1df9b5feda16..bcb357e948b7 100644
--- a/arch/arm/mach-omap2/hwspinlock.c
+++ b/arch/arm/mach-omap2/hwspinlock.c
@@ -21,6 +21,7 @@
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/hwspinlock.h> 22#include <linux/hwspinlock.h>
23 23
24#include "soc.h"
24#include "omap_hwmod.h" 25#include "omap_hwmod.h"
25#include "omap_device.h" 26#include "omap_device.h"
26 27
@@ -57,4 +58,4 @@ static int __init hwspinlocks_init(void)
57 return retval; 58 return retval;
58} 59}
59/* early board code might need to reserve specific hwspinlock instances */ 60/* early board code might need to reserve specific hwspinlock instances */
60postcore_initcall(hwspinlocks_init); 61omap_postcore_initcall(hwspinlocks_init);
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c
index b9074dde3b9c..8fd98576f4d3 100644
--- a/arch/arm/mach-omap2/i2c.c
+++ b/arch/arm/mach-omap2/i2c.c
@@ -185,3 +185,8 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
185 return PTR_RET(pdev); 185 return PTR_RET(pdev);
186} 186}
187 187
188static int __init omap_i2c_cmdline(void)
189{
190 return omap_register_i2c_bus_cmdline();
191}
192omap_subsys_initcall(omap_i2c_cmdline);
diff --git a/arch/arm/mach-omap2/include/mach/debug-macro.S b/arch/arm/mach-omap2/include/mach/debug-macro.S
deleted file mode 100644
index cfaed13d0040..000000000000
--- a/arch/arm/mach-omap2/include/mach/debug-macro.S
+++ /dev/null
@@ -1,165 +0,0 @@
1/* arch/arm/mach-omap2/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14#include <linux/serial_reg.h>
15
16#include <mach/serial.h>
17
18#define UART_OFFSET(addr) ((addr) & 0x00ffffff)
19
20 .pushsection .data
21omap_uart_phys: .word 0
22omap_uart_virt: .word 0
23omap_uart_lsr: .word 0
24 .popsection
25
26 /*
27 * Note that this code won't work if the bootloader passes
28 * a wrong machine ID number in r1. To debug, just hardcode
29 * the desired UART phys and virt addresses temporarily into
30 * the omap_uart_phys and omap_uart_virt above.
31 */
32 .macro addruart, rp, rv, tmp
33
34 /* Use omap_uart_phys/virt if already configured */
3510: adr \rp, 99f @ get effective addr of 99f
36 ldr \rv, [\rp] @ get absolute addr of 99f
37 sub \rv, \rv, \rp @ offset between the two
38 ldr \rp, [\rp, #4] @ abs addr of omap_uart_phys
39 sub \tmp, \rp, \rv @ make it effective
40 ldr \rp, [\tmp, #0] @ omap_uart_phys
41 ldr \rv, [\tmp, #4] @ omap_uart_virt
42 cmp \rp, #0 @ is port configured?
43 cmpne \rv, #0
44 bne 100f @ already configured
45
46 /* Check the debug UART configuration set in uncompress.h */
47 mov \rp, pc
48 ldr \rv, =OMAP_UART_INFO_OFS
49 and \rp, \rp, #0xff000000
50 ldr \rp, [\rp, \rv]
51
52 /* Select the UART to use based on the UART1 scratchpad value */
53 cmp \rp, #0 @ no port configured?
54 beq 21f @ if none, try to use UART1
55 cmp \rp, #OMAP2UART1 @ OMAP2/3/4UART1
56 beq 21f @ configure OMAP2/3/4UART1
57 cmp \rp, #OMAP2UART2 @ OMAP2/3/4UART2
58 beq 22f @ configure OMAP2/3/4UART2
59 cmp \rp, #OMAP2UART3 @ only on 24xx
60 beq 23f @ configure OMAP2UART3
61 cmp \rp, #OMAP3UART3 @ only on 34xx
62 beq 33f @ configure OMAP3UART3
63 cmp \rp, #OMAP4UART3 @ only on 44xx/54xx
64 beq 43f @ configure OMAP4/5UART3
65 cmp \rp, #OMAP3UART4 @ only on 36xx
66 beq 34f @ configure OMAP3UART4
67 cmp \rp, #OMAP4UART4 @ only on 44xx/54xx
68 beq 44f @ configure OMAP4/5UART4
69 cmp \rp, #TI81XXUART1 @ ti81Xx UART offsets different
70 beq 81f @ configure UART1
71 cmp \rp, #TI81XXUART2 @ ti81Xx UART offsets different
72 beq 82f @ configure UART2
73 cmp \rp, #TI81XXUART3 @ ti81Xx UART offsets different
74 beq 83f @ configure UART3
75 cmp \rp, #AM33XXUART1 @ AM33XX UART offsets different
76 beq 84f @ configure UART1
77 cmp \rp, #ZOOM_UART @ only on zoom2/3
78 beq 95f @ configure ZOOM_UART
79
80 /* Configure the UART offset from the phys/virt base */
8121: mov \rp, #UART_OFFSET(OMAP2_UART1_BASE) @ omap2/3/4
82 b 98f
8322: mov \rp, #UART_OFFSET(OMAP2_UART2_BASE) @ omap2/3/4
84 b 98f
8523: mov \rp, #UART_OFFSET(OMAP2_UART3_BASE)
86 b 98f
8733: mov \rp, #UART_OFFSET(OMAP3_UART1_BASE)
88 add \rp, \rp, #0x00fb0000
89 add \rp, \rp, #0x00006000 @ OMAP3_UART3_BASE
90 b 98f
9134: mov \rp, #UART_OFFSET(OMAP3_UART1_BASE)
92 add \rp, \rp, #0x00fb0000
93 add \rp, \rp, #0x00028000 @ OMAP3_UART4_BASE
94 b 98f
9543: mov \rp, #UART_OFFSET(OMAP4_UART3_BASE)
96 b 98f
9744: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE)
98 b 98f
9981: mov \rp, #UART_OFFSET(TI81XX_UART1_BASE)
100 b 98f
10182: mov \rp, #UART_OFFSET(TI81XX_UART2_BASE)
102 b 98f
10383: mov \rp, #UART_OFFSET(TI81XX_UART3_BASE)
104 b 98f
10584: ldr \rp, =AM33XX_UART1_BASE
106 and \rp, \rp, #0x00ffffff
107 b 97f
10895: ldr \rp, =ZOOM_UART_BASE
109 str \rp, [\tmp, #0] @ omap_uart_phys
110 ldr \rp, =ZOOM_UART_VIRT
111 str \rp, [\tmp, #4] @ omap_uart_virt
112 mov \rp, #(UART_LSR << ZOOM_PORT_SHIFT)
113 str \rp, [\tmp, #8] @ omap_uart_lsr
114 b 10b
115
116 /* AM33XX: Store both phys and virt address for the uart */
11797: add \rp, \rp, #0x44000000 @ phys base
118 str \rp, [\tmp, #0] @ omap_uart_phys
119 sub \rp, \rp, #0x44000000 @ phys base
120 add \rp, \rp, #0xf9000000 @ virt base
121 str \rp, [\tmp, #4] @ omap_uart_virt
122 mov \rp, #(UART_LSR << OMAP_PORT_SHIFT)
123 str \rp, [\tmp, #8] @ omap_uart_lsr
124
125 b 10b
126
127 /* Store both phys and virt address for the uart */
12898: add \rp, \rp, #0x48000000 @ phys base
129 str \rp, [\tmp, #0] @ omap_uart_phys
130 sub \rp, \rp, #0x48000000 @ phys base
131 add \rp, \rp, #0xfa000000 @ virt base
132 str \rp, [\tmp, #4] @ omap_uart_virt
133 mov \rp, #(UART_LSR << OMAP_PORT_SHIFT)
134 str \rp, [\tmp, #8] @ omap_uart_lsr
135
136 b 10b
137
138 .align
13999: .word .
140 .word omap_uart_phys
141 .ltorg
142
143100: /* Pass the UART_LSR reg address */
144 ldr \tmp, [\tmp, #8] @ omap_uart_lsr
145 add \rp, \rp, \tmp
146 add \rv, \rv, \tmp
147 .endm
148
149 .macro senduart,rd,rx
150 orr \rd, \rd, \rx, lsl #24 @ preserve LSR reg offset
151 bic \rx, \rx, #0xff @ get base (THR) reg address
152 strb \rd, [\rx] @ send lower byte of rd
153 orr \rx, \rx, \rd, lsr #24 @ restore original rx (LSR)
154 bic \rd, \rd, #(0xff << 24) @ restore original rd
155 .endm
156
157 .macro busyuart,rd,rx
1581001: ldrb \rd, [\rx] @ rx contains UART_LSR address
159 and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
160 teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
161 bne 1001b
162 .endm
163
164 .macro waituart,rd,rx
165 .endm
diff --git a/arch/arm/mach-omap2/include/mach/serial.h b/arch/arm/mach-omap2/include/mach/serial.h
index 70eda00db7a4..7ca1fcff453b 100644
--- a/arch/arm/mach-omap2/include/mach/serial.h
+++ b/arch/arm/mach-omap2/include/mach/serial.h
@@ -8,20 +8,6 @@
8 * GNU General Public License for more details. 8 * GNU General Public License for more details.
9 */ 9 */
10 10
11/*
12 * Memory entry used for the DEBUG_LL UART configuration, relative to
13 * start of RAM. See also uncompress.h and debug-macro.S.
14 *
15 * Note that using a memory location for storing the UART configuration
16 * has at least two limitations:
17 *
18 * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
19 * uncompress code could then partially overwrite itself
20 * 2. We assume printascii is called at least once before paging_init,
21 * and addruart has a chance to read OMAP_UART_INFO
22 */
23#define OMAP_UART_INFO_OFS 0x3ffc
24
25/* OMAP2 serial ports */ 11/* OMAP2 serial ports */
26#define OMAP2_UART1_BASE 0x4806a000 12#define OMAP2_UART1_BASE 0x4806a000
27#define OMAP2_UART2_BASE 0x4806c000 13#define OMAP2_UART2_BASE 0x4806c000
@@ -68,29 +54,6 @@
68 54
69#define OMAP24XX_BASE_BAUD (48000000/16) 55#define OMAP24XX_BASE_BAUD (48000000/16)
70 56
71/*
72 * DEBUG_LL port encoding stored into the UART1 scratchpad register by
73 * decomp_setup in uncompress.h
74 */
75#define OMAP2UART1 21
76#define OMAP2UART2 22
77#define OMAP2UART3 23
78#define OMAP3UART1 OMAP2UART1
79#define OMAP3UART2 OMAP2UART2
80#define OMAP3UART3 33
81#define OMAP3UART4 34 /* Only on 36xx */
82#define OMAP4UART1 OMAP2UART1
83#define OMAP4UART2 OMAP2UART2
84#define OMAP4UART3 43
85#define OMAP4UART4 44
86#define TI81XXUART1 81
87#define TI81XXUART2 82
88#define TI81XXUART3 83
89#define AM33XXUART1 84
90#define OMAP5UART3 OMAP4UART3
91#define OMAP5UART4 OMAP4UART4
92#define ZOOM_UART 95 /* Only on zoom2/3 */
93
94#ifndef __ASSEMBLER__ 57#ifndef __ASSEMBLER__
95 58
96struct omap_board_data; 59struct omap_board_data;
diff --git a/arch/arm/mach-omap2/include/mach/uncompress.h b/arch/arm/mach-omap2/include/mach/uncompress.h
deleted file mode 100644
index 7b360acd19c9..000000000000
--- a/arch/arm/mach-omap2/include/mach/uncompress.h
+++ /dev/null
@@ -1,171 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/uncompress.h
3 *
4 * Serial port stubs for kernel decompress status messages
5 *
6 * Initially based on:
7 * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
8 * Copyright (C) 2000 RidgeRun, Inc.
9 * Author: Greg Lonnon <glonnon@ridgerun.com>
10 *
11 * Rewritten by:
12 * Author: <source@mvista.com>
13 * 2004 (c) MontaVista Software, Inc.
14 *
15 * This file is licensed under the terms of the GNU General Public License
16 * version 2. This program is licensed "as is" without any warranty of any
17 * kind, whether express or implied.
18 */
19
20#include <linux/types.h>
21#include <linux/serial_reg.h>
22
23#include <asm/memory.h>
24#include <asm/mach-types.h>
25
26#include <mach/serial.h>
27
28#define MDR1_MODE_MASK 0x07
29
30volatile u8 *uart_base;
31int uart_shift;
32
33/*
34 * Store the DEBUG_LL uart number into memory.
35 * See also debug-macro.S, and serial.c for related code.
36 */
37static void set_omap_uart_info(unsigned char port)
38{
39 /*
40 * Get address of some.bss variable and round it down
41 * a la CONFIG_AUTO_ZRELADDR.
42 */
43 u32 ram_start = (u32)&uart_shift & 0xf8000000;
44 u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
45 *uart_info = port;
46}
47
48static void putc(int c)
49{
50 if (!uart_base)
51 return;
52
53 /* Check for UART 16x mode */
54 if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
55 return;
56
57 while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
58 barrier();
59 uart_base[UART_TX << uart_shift] = c;
60}
61
62static inline void flush(void)
63{
64}
65
66/*
67 * Macros to configure UART1 and debug UART
68 */
69#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
70 if (machine_is_##mach()) { \
71 uart_base = (volatile u8 *)(dbg_uart); \
72 uart_shift = (dbg_shft); \
73 port = (dbg_id); \
74 set_omap_uart_info(port); \
75 break; \
76 }
77
78#define DEBUG_LL_OMAP2(p, mach) \
79 _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \
80 OMAP2UART##p)
81
82#define DEBUG_LL_OMAP3(p, mach) \
83 _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \
84 OMAP3UART##p)
85
86#define DEBUG_LL_OMAP4(p, mach) \
87 _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \
88 OMAP4UART##p)
89
90#define DEBUG_LL_OMAP5(p, mach) \
91 _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT, \
92 OMAP5UART##p)
93/* Zoom2/3 shift is different for UART1 and external port */
94#define DEBUG_LL_ZOOM(mach) \
95 _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART)
96
97#define DEBUG_LL_TI81XX(p, mach) \
98 _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
99 TI81XXUART##p)
100
101#define DEBUG_LL_AM33XX(p, mach) \
102 _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT, \
103 AM33XXUART##p)
104
105static inline void arch_decomp_setup(void)
106{
107 int port = 0;
108
109 /*
110 * Initialize the port based on the machine ID from the bootloader.
111 * Note that we're using macros here instead of switch statement
112 * as machine_is functions are optimized out for the boards that
113 * are not selected.
114 */
115 do {
116 /* omap2 based boards using UART1 */
117 DEBUG_LL_OMAP2(1, omap_2430sdp);
118 DEBUG_LL_OMAP2(1, omap_apollon);
119 DEBUG_LL_OMAP2(1, omap_h4);
120
121 /* omap2 based boards using UART3 */
122 DEBUG_LL_OMAP2(3, nokia_n800);
123 DEBUG_LL_OMAP2(3, nokia_n810);
124 DEBUG_LL_OMAP2(3, nokia_n810_wimax);
125
126 /* omap3 based boards using UART1 */
127 DEBUG_LL_OMAP2(1, omap3evm);
128 DEBUG_LL_OMAP3(1, omap_3430sdp);
129 DEBUG_LL_OMAP3(1, omap_3630sdp);
130 DEBUG_LL_OMAP3(1, omap3530_lv_som);
131 DEBUG_LL_OMAP3(1, omap3_torpedo);
132
133 /* omap3 based boards using UART3 */
134 DEBUG_LL_OMAP3(3, cm_t35);
135 DEBUG_LL_OMAP3(3, cm_t3517);
136 DEBUG_LL_OMAP3(3, cm_t3730);
137 DEBUG_LL_OMAP3(3, craneboard);
138 DEBUG_LL_OMAP3(3, devkit8000);
139 DEBUG_LL_OMAP3(3, igep0020);
140 DEBUG_LL_OMAP3(3, igep0030);
141 DEBUG_LL_OMAP3(3, nokia_rm680);
142 DEBUG_LL_OMAP3(3, nokia_rm696);
143 DEBUG_LL_OMAP3(3, nokia_rx51);
144 DEBUG_LL_OMAP3(3, omap3517evm);
145 DEBUG_LL_OMAP3(3, omap3_beagle);
146 DEBUG_LL_OMAP3(3, omap3_pandora);
147 DEBUG_LL_OMAP3(3, omap_ldp);
148 DEBUG_LL_OMAP3(3, overo);
149 DEBUG_LL_OMAP3(3, touchbook);
150
151 /* omap4 based boards using UART3 */
152 DEBUG_LL_OMAP4(3, omap_4430sdp);
153 DEBUG_LL_OMAP4(3, omap4_panda);
154
155 /* omap5 based boards using UART3 */
156 DEBUG_LL_OMAP5(3, omap5_sevm);
157
158 /* zoom2/3 external uart */
159 DEBUG_LL_ZOOM(omap_zoom2);
160 DEBUG_LL_ZOOM(omap_zoom3);
161
162 /* TI8168 base boards using UART3 */
163 DEBUG_LL_TI81XX(3, ti8168evm);
164
165 /* TI8148 base boards using UART1 */
166 DEBUG_LL_TI81XX(1, ti8148evm);
167
168 /* AM33XX base boards using UART1 */
169 DEBUG_LL_AM33XX(1, am335xevm);
170 } while (0);
171}
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index df49f2a49461..1c0968db43bf 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -23,6 +23,7 @@
23 23
24#include <linux/omap-dma.h> 24#include <linux/omap-dma.h>
25 25
26#include "soc.h"
26#include "omap_device.h" 27#include "omap_device.h"
27 28
28/* 29/*
@@ -118,4 +119,4 @@ static int __init omap2_mcbsp_init(void)
118 119
119 return 0; 120 return 0;
120} 121}
121arch_initcall(omap2_mcbsp_init); 122omap_arch_initcall(omap2_mcbsp_init);
diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c
index 6da4f7ae9d7f..c20423955bf7 100644
--- a/arch/arm/mach-omap2/omap-iommu.c
+++ b/arch/arm/mach-omap2/omap-iommu.c
@@ -16,6 +16,7 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17 17
18#include <linux/platform_data/iommu-omap.h> 18#include <linux/platform_data/iommu-omap.h>
19#include "soc.h"
19#include "omap_hwmod.h" 20#include "omap_hwmod.h"
20#include "omap_device.h" 21#include "omap_device.h"
21 22
@@ -61,7 +62,7 @@ static int __init omap_iommu_init(void)
61 return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL); 62 return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL);
62} 63}
63/* must be ready before omap3isp is probed */ 64/* must be ready before omap3isp is probed */
64subsys_initcall(omap_iommu_init); 65omap_subsys_initcall(omap_iommu_init);
65 66
66static void __exit omap_iommu_exit(void) 67static void __exit omap_iommu_exit(void)
67{ 68{
diff --git a/arch/arm/mach-omap2/omap2-restart.c b/arch/arm/mach-omap2/omap2-restart.c
index be6bc89ab1e8..719b716a4494 100644
--- a/arch/arm/mach-omap2/omap2-restart.c
+++ b/arch/arm/mach-omap2/omap2-restart.c
@@ -13,6 +13,7 @@
13#include <linux/clk.h> 13#include <linux/clk.h>
14#include <linux/io.h> 14#include <linux/io.h>
15 15
16#include "soc.h"
16#include "common.h" 17#include "common.h"
17#include "prm2xxx.h" 18#include "prm2xxx.h"
18 19
@@ -62,4 +63,4 @@ static int __init omap2xxx_common_look_up_clks_for_reset(void)
62 63
63 return 0; 64 return 0;
64} 65}
65core_initcall(omap2xxx_common_look_up_clks_for_reset); 66omap_core_initcall(omap2xxx_common_look_up_clks_for_reset);
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 547094883606..708bb115a27f 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -226,7 +226,7 @@ static int __init omap_l2_cache_init(void)
226 226
227 return 0; 227 return 0;
228} 228}
229early_initcall(omap_l2_cache_init); 229omap_early_initcall(omap_l2_cache_init);
230#endif 230#endif
231 231
232void __iomem *omap4_get_sar_ram_base(void) 232void __iomem *omap4_get_sar_ram_base(void)
@@ -254,7 +254,7 @@ static int __init omap4_sar_ram_init(void)
254 254
255 return 0; 255 return 0;
256} 256}
257early_initcall(omap4_sar_ram_init); 257omap_early_initcall(omap4_sar_ram_init);
258 258
259void __init omap_gic_of_init(void) 259void __init omap_gic_of_init(void)
260{ 260{
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index e065daa537c0..d109f06785da 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -89,6 +89,7 @@
89#include <linux/of.h> 89#include <linux/of.h>
90#include <linux/notifier.h> 90#include <linux/notifier.h>
91 91
92#include "soc.h"
92#include "omap_device.h" 93#include "omap_device.h"
93#include "omap_hwmod.h" 94#include "omap_hwmod.h"
94 95
@@ -1259,7 +1260,7 @@ static int __init omap_device_init(void)
1259 bus_register_notifier(&platform_bus_type, &platform_nb); 1260 bus_register_notifier(&platform_bus_type, &platform_nb);
1260 return 0; 1261 return 0;
1261} 1262}
1262core_initcall(omap_device_init); 1263omap_core_initcall(omap_device_init);
1263 1264
1264/** 1265/**
1265 * omap_device_late_idle - idle devices without drivers 1266 * omap_device_late_idle - idle devices without drivers
@@ -1297,4 +1298,4 @@ static int __init omap_device_late_init(void)
1297 bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle); 1298 bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle);
1298 return 0; 1299 return 0;
1299} 1300}
1300late_initcall(omap_device_late_init); 1301omap_late_initcall(omap_device_late_init);
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 4653efb87a27..6e70707cbb34 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3303,7 +3303,7 @@ static int __init omap_hwmod_setup_all(void)
3303 3303
3304 return 0; 3304 return 0;
3305} 3305}
3306core_initcall(omap_hwmod_setup_all); 3306omap_core_initcall(omap_hwmod_setup_all);
3307 3307
3308/** 3308/**
3309 * omap_hwmod_enable - enable an omap_hwmod 3309 * omap_hwmod_enable - enable an omap_hwmod
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index e237602e10ea..eb8a25de67ed 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -63,7 +63,7 @@ static int __init omap4430_phy_power_down(void)
63 63
64 return 0; 64 return 0;
65} 65}
66early_initcall(omap4430_phy_power_down); 66omap_early_initcall(omap4430_phy_power_down);
67 67
68void am35x_musb_reset(void) 68void am35x_musb_reset(void)
69{ 69{
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index 62772e0e0d69..fc67add76444 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -168,4 +168,4 @@ int __init omap3_opp_init(void)
168 168
169 return r; 169 return r;
170} 170}
171device_initcall(omap3_opp_init); 171omap_device_initcall(omap3_opp_init);
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c
index d470b728e720..1ef7a3e5ce4a 100644
--- a/arch/arm/mach-omap2/opp4xxx_data.c
+++ b/arch/arm/mach-omap2/opp4xxx_data.c
@@ -177,4 +177,4 @@ int __init omap4_opp_init(void)
177 ARRAY_SIZE(omap446x_opp_def_list)); 177 ARRAY_SIZE(omap446x_opp_def_list));
178 return r; 178 return r;
179} 179}
180device_initcall(omap4_opp_init); 180omap_device_initcall(omap4_opp_init);
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index e2c291f52f92..e0ac8a31d4e0 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -279,6 +279,6 @@ static int __init pm_dbg_init(void)
279 279
280 return 0; 280 return 0;
281} 281}
282arch_initcall(pm_dbg_init); 282omap_arch_initcall(pm_dbg_init);
283 283
284#endif 284#endif
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index f4b3143a8b1d..9c65eddd97cc 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -336,7 +336,7 @@ static int __init omap2_common_pm_init(void)
336 336
337 return 0; 337 return 0;
338} 338}
339postcore_initcall(omap2_common_pm_init); 339omap_postcore_initcall(omap2_common_pm_init);
340 340
341int __init omap2_common_pm_late_init(void) 341int __init omap2_common_pm_late_init(void)
342{ 342{
diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
index eb78ae7a3464..75052b3bc943 100644
--- a/arch/arm/mach-omap2/pmu.c
+++ b/arch/arm/mach-omap2/pmu.c
@@ -89,4 +89,4 @@ static int __init omap_init_pmu(void)
89 89
90 return omap2_init_pmu(oh_num, oh_names); 90 return omap2_init_pmu(oh_num, oh_names);
91} 91}
92subsys_initcall(omap_init_pmu); 92omap_subsys_initcall(omap_init_pmu);
diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c
index e648bd55b072..7721990d2006 100644
--- a/arch/arm/mach-omap2/prm3xxx.c
+++ b/arch/arm/mach-omap2/prm3xxx.c
@@ -427,7 +427,7 @@ static int __init omap3xxx_prm_late_init(void)
427 427
428 return ret; 428 return ret;
429} 429}
430subsys_initcall(omap3xxx_prm_late_init); 430omap_subsys_initcall(omap3xxx_prm_late_init);
431 431
432static void __exit omap3xxx_prm_exit(void) 432static void __exit omap3xxx_prm_exit(void)
433{ 433{
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index c05a343d465d..d35f98aabf7a 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -665,7 +665,7 @@ static int __init omap44xx_prm_late_init(void)
665 665
666 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); 666 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
667} 667}
668subsys_initcall(omap44xx_prm_late_init); 668omap_subsys_initcall(omap44xx_prm_late_init);
669 669
670static void __exit omap44xx_prm_exit(void) 670static void __exit omap44xx_prm_exit(void)
671{ 671{
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 04fdbc4c499b..24e9ad3cb993 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -254,7 +254,7 @@ static int __init omap_serial_early_init(void)
254 254
255 return 0; 255 return 0;
256} 256}
257core_initcall(omap_serial_early_init); 257omap_core_initcall(omap_serial_early_init);
258 258
259/** 259/**
260 * omap_serial_init_port() - initialize single serial port 260 * omap_serial_init_port() - initialize single serial port
diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c
index 1da8f03c479e..aee3c8940a30 100644
--- a/arch/arm/mach-omap2/smartreflex-class3.c
+++ b/arch/arm/mach-omap2/smartreflex-class3.c
@@ -12,6 +12,7 @@
12 */ 12 */
13 13
14#include <linux/power/smartreflex.h> 14#include <linux/power/smartreflex.h>
15#include "soc.h"
15#include "voltage.h" 16#include "voltage.h"
16 17
17static int sr_class3_enable(struct omap_sr *sr) 18static int sr_class3_enable(struct omap_sr *sr)
@@ -58,4 +59,4 @@ static int __init sr_class3_init(void)
58 pr_info("SmartReflex Class3 initialized\n"); 59 pr_info("SmartReflex Class3 initialized\n");
59 return sr_register_class(&class3_data); 60 return sr_register_class(&class3_data);
60} 61}
61late_initcall(sr_class3_init); 62omap_late_initcall(sr_class3_init);
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index f31d90774de0..092aedd7ed13 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -42,6 +42,9 @@
42#undef MULTI_OMAP2 42#undef MULTI_OMAP2
43#undef OMAP_NAME 43#undef OMAP_NAME
44 44
45#ifdef CONFIG_ARCH_MULTIPLATFORM
46#define MULTI_OMAP2
47#endif
45#ifdef CONFIG_SOC_OMAP2420 48#ifdef CONFIG_SOC_OMAP2420
46# ifdef OMAP_NAME 49# ifdef OMAP_NAME
47# undef MULTI_OMAP2 50# undef MULTI_OMAP2
@@ -112,6 +115,11 @@ int omap_type(void);
112 */ 115 */
113unsigned int omap_rev(void); 116unsigned int omap_rev(void);
114 117
118static inline int soc_is_omap(void)
119{
120 return omap_rev() != 0;
121}
122
115/* 123/*
116 * Get the CPU revision for OMAP devices 124 * Get the CPU revision for OMAP devices
117 */ 125 */
@@ -465,5 +473,26 @@ static inline unsigned int omap4_has_ ##feat(void) \
465 473
466OMAP4_HAS_FEATURE(perf_silicon, PERF_SILICON) 474OMAP4_HAS_FEATURE(perf_silicon, PERF_SILICON)
467 475
476/*
477 * We need to make sure omap initcalls don't run when
478 * multiplatform kernels are booted on other SoCs.
479 */
480#define omap_initcall(level, fn) \
481static int __init __used __##fn(void) \
482{ \
483 if (!soc_is_omap()) \
484 return 0; \
485 return fn(); \
486} \
487level(__##fn);
488
489#define omap_early_initcall(fn) omap_initcall(early_initcall, fn)
490#define omap_core_initcall(fn) omap_initcall(core_initcall, fn)
491#define omap_postcore_initcall(fn) omap_initcall(postcore_initcall, fn)
492#define omap_arch_initcall(fn) omap_initcall(arch_initcall, fn)
493#define omap_subsys_initcall(fn) omap_initcall(subsys_initcall, fn)
494#define omap_device_initcall(fn) omap_initcall(device_initcall, fn)
495#define omap_late_initcall(fn) omap_initcall(late_initcall, fn)
496
468#endif /* __ASSEMBLY__ */ 497#endif /* __ASSEMBLY__ */
469 498
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 71729888ff03..72c2ca1e3f70 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -719,7 +719,7 @@ static int __init omap2_dm_timer_init(void)
719 719
720 return 0; 720 return 0;
721} 721}
722arch_initcall(omap2_dm_timer_init); 722omap_arch_initcall(omap2_dm_timer_init);
723 723
724/** 724/**
725 * omap2_override_clocksource - clocksource override with user configuration 725 * omap2_override_clocksource - clocksource override with user configuration
diff --git a/arch/arm/mach-omap2/wd_timer.c b/arch/arm/mach-omap2/wd_timer.c
index 7c2b4ed38f02..70240a54995c 100644
--- a/arch/arm/mach-omap2/wd_timer.c
+++ b/arch/arm/mach-omap2/wd_timer.c
@@ -130,4 +130,4 @@ static int __init omap_init_wdt(void)
130 dev_name, oh->name); 130 dev_name, oh->name);
131 return 0; 131 return 0;
132} 132}
133subsys_initcall(omap_init_wdt); 133omap_subsys_initcall(omap_init_wdt);