diff options
Diffstat (limited to 'arch/arm/mach-omap2')
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 @@ +config ARCH_OMAP + bool + +config ARCH_OMAP2PLUS + bool "TI OMAP2/3/4/5 SoCs with device tree support" if (ARCH_MULTI_V6 || ARCH_MULTI_V7) + select ARCH_HAS_CPUFREQ + select ARCH_HAS_HOLES_MEMORYMODEL + select ARCH_OMAP + select ARCH_REQUIRE_GPIOLIB + select CLKDEV_LOOKUP + select CLKSRC_MMIO + select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_CHIP + select HAVE_CLK + select OMAP_DM_TIMER + select PINCTRL + select PROC_DEVICETREE if PROC_FS + select SPARSE_IRQ + select USE_OF + help + Systems based on OMAP2, OMAP3, OMAP4 or OMAP5 + + if ARCH_OMAP2PLUS menu "TI OMAP2/3/4 Specific Features" @@ -397,7 +420,7 @@ config OMAP3_SDRC_AC_TIMING config OMAP4_ERRATA_I688 bool "OMAP4 errata: Async Bridge Corruption" - depends on ARCH_OMAP4 + depends on ARCH_OMAP4 && !ARCH_MULTIPLATFORM select ARCH_HAS_BARRIERS help 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 @@ # Makefile for the linux kernel. # +ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ + -I$(srctree)/arch/arm/plat-omap/include + # Common support obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \ 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) } return 0; } -device_initcall(beagle_opp_init); +omap_device_initcall(beagle_opp_init); static void __init omap3_beagle_init(void) { 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 @@ #include <video/omapdss.h> #include <linux/platform_data/spi-omap2-mcspi.h> +#include "soc.h" #include "board-rx51.h" #include "mux.h" @@ -85,5 +86,5 @@ static int __init rx51_video_init(void) return 0; } -subsys_initcall(rx51_video_init); +omap_subsys_initcall(rx51_video_init); #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) return ret; } -arch_initcall(omap2xxx_clk_arch_init); +omap_arch_initcall(omap2xxx_clk_arch_init); 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) return ret; } -arch_initcall(omap3xxx_clk_arch_init); +omap_arch_initcall(omap3xxx_clk_arch_init); 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) return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; } -postcore_initcall(omap3_l3_init); +omap_postcore_initcall(omap3_l3_init); static int __init omap4_l3_init(void) { @@ -104,7 +104,7 @@ static int __init omap4_l3_init(void) return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; } -postcore_initcall(omap4_l3_init); +omap_postcore_initcall(omap4_l3_init); #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) @@ -779,4 +779,4 @@ static int __init omap2_init_devices(void) return 0; } -arch_initcall(omap2_init_devices); +omap_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 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/device.h> - +#include <linux/dma-mapping.h> #include <linux/omap-dma.h> #include "soc.h" @@ -288,9 +288,26 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused) return 0; } +static const struct platform_device_info omap_dma_dev_info = { + .name = "omap-dma-engine", + .id = -1, + .dma_mask = DMA_BIT_MASK(32), +}; + static int __init omap2_system_dma_init(void) { - return omap_hwmod_for_each_by_class("dma", + struct platform_device *pdev; + int res; + + res = omap_hwmod_for_each_by_class("dma", omap2_system_dma_init_dev, NULL); + if (res) + return res; + + pdev = platform_device_register_full(&omap_dma_dev_info); + if (IS_ERR(pdev)) + return PTR_ERR(pdev); + + return res; } -arch_initcall(omap2_system_dma_init); +omap_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) } -arch_initcall(omap_init_drm); +omap_arch_initcall(omap_init_drm); #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) return 0; } -subsys_initcall(emu_init); +omap_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) return 0; } -arch_initcall(omap_init_vrfb); +omap_arch_initcall(omap_init_vrfb); #endif #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) @@ -113,6 +113,6 @@ static int __init omap_init_fb(void) return platform_device_register(&omap_fb_device); } -arch_initcall(omap_init_fb); +omap_arch_initcall(omap_init_fb); #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 @@ #include <linux/of.h> #include <linux/platform_data/gpio-omap.h> +#include "soc.h" #include "omap_hwmod.h" #include "omap_device.h" #include "omap-pm.h" @@ -147,7 +148,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) /* * gpio_init needs to be done before * machine_init functions access gpio APIs. - * Hence gpio_init is a postcore_initcall. + * Hence gpio_init is a omap_postcore_initcall. */ static int __init omap2_gpio_init(void) { @@ -157,4 +158,4 @@ static int __init omap2_gpio_init(void) return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init, NULL); } -postcore_initcall(omap2_gpio_init); +omap_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) } -postcore_initcall(gpmc_init); +omap_postcore_initcall(gpmc_init); module_exit(gpmc_exit); static int __init omap_gpmc_init(void) @@ -1453,7 +1453,7 @@ static int __init omap_gpmc_init(void) return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; } -postcore_initcall(omap_gpmc_init); +omap_postcore_initcall(omap_gpmc_init); static irqreturn_t gpmc_handle_irq(int irq, void *dev) { 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 @@ #include <linux/err.h> #include <linux/platform_device.h> +#include "soc.h" #include "omap_hwmod.h" #include "omap_device.h" #include "hdq1w.h" @@ -93,4 +94,4 @@ static int __init omap_init_hdq(void) return 0; } -arch_initcall(omap_init_hdq); +omap_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 @@ #include <linux/err.h> #include <linux/hwspinlock.h> +#include "soc.h" #include "omap_hwmod.h" #include "omap_device.h" @@ -57,4 +58,4 @@ static int __init hwspinlocks_init(void) return retval; } /* early board code might need to reserve specific hwspinlock instances */ -postcore_initcall(hwspinlocks_init); +omap_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, return PTR_RET(pdev); } +static int __init omap_i2c_cmdline(void) +{ + return omap_register_i2c_bus_cmdline(); +} +omap_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 @@ -/* arch/arm/mach-omap2/include/mach/debug-macro.S - * - * Debugging macro include header - * - * Copyright (C) 1994-1999 Russell King - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * -*/ - -#include <linux/serial_reg.h> - -#include <mach/serial.h> - -#define UART_OFFSET(addr) ((addr) & 0x00ffffff) - - .pushsection .data -omap_uart_phys: .word 0 -omap_uart_virt: .word 0 -omap_uart_lsr: .word 0 - .popsection - - /* - * Note that this code won't work if the bootloader passes - * a wrong machine ID number in r1. To debug, just hardcode - * the desired UART phys and virt addresses temporarily into - * the omap_uart_phys and omap_uart_virt above. - */ - .macro addruart, rp, rv, tmp - - /* Use omap_uart_phys/virt if already configured */ -10: adr \rp, 99f @ get effective addr of 99f - ldr \rv, [\rp] @ get absolute addr of 99f - sub \rv, \rv, \rp @ offset between the two - ldr \rp, [\rp, #4] @ abs addr of omap_uart_phys - sub \tmp, \rp, \rv @ make it effective - ldr \rp, [\tmp, #0] @ omap_uart_phys - ldr \rv, [\tmp, #4] @ omap_uart_virt - cmp \rp, #0 @ is port configured? - cmpne \rv, #0 - bne 100f @ already configured - - /* Check the debug UART configuration set in uncompress.h */ - mov \rp, pc - ldr \rv, =OMAP_UART_INFO_OFS - and \rp, \rp, #0xff000000 - ldr \rp, [\rp, \rv] - - /* Select the UART to use based on the UART1 scratchpad value */ - cmp \rp, #0 @ no port configured? - beq 21f @ if none, try to use UART1 - cmp \rp, #OMAP2UART1 @ OMAP2/3/4UART1 - beq 21f @ configure OMAP2/3/4UART1 - cmp \rp, #OMAP2UART2 @ OMAP2/3/4UART2 - beq 22f @ configure OMAP2/3/4UART2 - cmp \rp, #OMAP2UART3 @ only on 24xx - beq 23f @ configure OMAP2UART3 - cmp \rp, #OMAP3UART3 @ only on 34xx - beq 33f @ configure OMAP3UART3 - cmp \rp, #OMAP4UART3 @ only on 44xx/54xx - beq 43f @ configure OMAP4/5UART3 - cmp \rp, #OMAP3UART4 @ only on 36xx - beq 34f @ configure OMAP3UART4 - cmp \rp, #OMAP4UART4 @ only on 44xx/54xx - beq 44f @ configure OMAP4/5UART4 - cmp \rp, #TI81XXUART1 @ ti81Xx UART offsets different - beq 81f @ configure UART1 - cmp \rp, #TI81XXUART2 @ ti81Xx UART offsets different - beq 82f @ configure UART2 - cmp \rp, #TI81XXUART3 @ ti81Xx UART offsets different - beq 83f @ configure UART3 - cmp \rp, #AM33XXUART1 @ AM33XX UART offsets different - beq 84f @ configure UART1 - cmp \rp, #ZOOM_UART @ only on zoom2/3 - beq 95f @ configure ZOOM_UART - - /* Configure the UART offset from the phys/virt base */ -21: mov \rp, #UART_OFFSET(OMAP2_UART1_BASE) @ omap2/3/4 - b 98f -22: mov \rp, #UART_OFFSET(OMAP2_UART2_BASE) @ omap2/3/4 - b 98f -23: mov \rp, #UART_OFFSET(OMAP2_UART3_BASE) - b 98f -33: mov \rp, #UART_OFFSET(OMAP3_UART1_BASE) - add \rp, \rp, #0x00fb0000 - add \rp, \rp, #0x00006000 @ OMAP3_UART3_BASE - b 98f -34: mov \rp, #UART_OFFSET(OMAP3_UART1_BASE) - add \rp, \rp, #0x00fb0000 - add \rp, \rp, #0x00028000 @ OMAP3_UART4_BASE - b 98f -43: mov \rp, #UART_OFFSET(OMAP4_UART3_BASE) - b 98f -44: mov \rp, #UART_OFFSET(OMAP4_UART4_BASE) - b 98f -81: mov \rp, #UART_OFFSET(TI81XX_UART1_BASE) - b 98f -82: mov \rp, #UART_OFFSET(TI81XX_UART2_BASE) - b 98f -83: mov \rp, #UART_OFFSET(TI81XX_UART3_BASE) - b 98f -84: ldr \rp, =AM33XX_UART1_BASE - and \rp, \rp, #0x00ffffff - b 97f -95: ldr \rp, =ZOOM_UART_BASE - str \rp, [\tmp, #0] @ omap_uart_phys - ldr \rp, =ZOOM_UART_VIRT - str \rp, [\tmp, #4] @ omap_uart_virt - mov \rp, #(UART_LSR << ZOOM_PORT_SHIFT) - str \rp, [\tmp, #8] @ omap_uart_lsr - b 10b - - /* AM33XX: Store both phys and virt address for the uart */ -97: add \rp, \rp, #0x44000000 @ phys base - str \rp, [\tmp, #0] @ omap_uart_phys - sub \rp, \rp, #0x44000000 @ phys base - add \rp, \rp, #0xf9000000 @ virt base - str \rp, [\tmp, #4] @ omap_uart_virt - mov \rp, #(UART_LSR << OMAP_PORT_SHIFT) - str \rp, [\tmp, #8] @ omap_uart_lsr - - b 10b - - /* Store both phys and virt address for the uart */ -98: add \rp, \rp, #0x48000000 @ phys base - str \rp, [\tmp, #0] @ omap_uart_phys - sub \rp, \rp, #0x48000000 @ phys base - add \rp, \rp, #0xfa000000 @ virt base - str \rp, [\tmp, #4] @ omap_uart_virt - mov \rp, #(UART_LSR << OMAP_PORT_SHIFT) - str \rp, [\tmp, #8] @ omap_uart_lsr - - b 10b - - .align -99: .word . - .word omap_uart_phys - .ltorg - -100: /* Pass the UART_LSR reg address */ - ldr \tmp, [\tmp, #8] @ omap_uart_lsr - add \rp, \rp, \tmp - add \rv, \rv, \tmp - .endm - - .macro senduart,rd,rx - orr \rd, \rd, \rx, lsl #24 @ preserve LSR reg offset - bic \rx, \rx, #0xff @ get base (THR) reg address - strb \rd, [\rx] @ send lower byte of rd - orr \rx, \rx, \rd, lsr #24 @ restore original rx (LSR) - bic \rd, \rd, #(0xff << 24) @ restore original rd - .endm - - .macro busyuart,rd,rx -1001: ldrb \rd, [\rx] @ rx contains UART_LSR address - and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE) - teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE) - bne 1001b - .endm - - .macro waituart,rd,rx - .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 @@ * GNU General Public License for more details. */ -/* - * Memory entry used for the DEBUG_LL UART configuration, relative to - * start of RAM. See also uncompress.h and debug-macro.S. - * - * Note that using a memory location for storing the UART configuration - * has at least two limitations: - * - * 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the - * uncompress code could then partially overwrite itself - * 2. We assume printascii is called at least once before paging_init, - * and addruart has a chance to read OMAP_UART_INFO - */ -#define OMAP_UART_INFO_OFS 0x3ffc - /* OMAP2 serial ports */ #define OMAP2_UART1_BASE 0x4806a000 #define OMAP2_UART2_BASE 0x4806c000 @@ -68,29 +54,6 @@ #define OMAP24XX_BASE_BAUD (48000000/16) -/* - * DEBUG_LL port encoding stored into the UART1 scratchpad register by - * decomp_setup in uncompress.h - */ -#define OMAP2UART1 21 -#define OMAP2UART2 22 -#define OMAP2UART3 23 -#define OMAP3UART1 OMAP2UART1 -#define OMAP3UART2 OMAP2UART2 -#define OMAP3UART3 33 -#define OMAP3UART4 34 /* Only on 36xx */ -#define OMAP4UART1 OMAP2UART1 -#define OMAP4UART2 OMAP2UART2 -#define OMAP4UART3 43 -#define OMAP4UART4 44 -#define TI81XXUART1 81 -#define TI81XXUART2 82 -#define TI81XXUART3 83 -#define AM33XXUART1 84 -#define OMAP5UART3 OMAP4UART3 -#define OMAP5UART4 OMAP4UART4 -#define ZOOM_UART 95 /* Only on zoom2/3 */ - #ifndef __ASSEMBLER__ struct 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 @@ -/* - * arch/arm/plat-omap/include/mach/uncompress.h - * - * Serial port stubs for kernel decompress status messages - * - * Initially based on: - * linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h - * Copyright (C) 2000 RidgeRun, Inc. - * Author: Greg Lonnon <glonnon@ridgerun.com> - * - * Rewritten by: - * Author: <source@mvista.com> - * 2004 (c) MontaVista Software, Inc. - * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. - */ - -#include <linux/types.h> -#include <linux/serial_reg.h> - -#include <asm/memory.h> -#include <asm/mach-types.h> - -#include <mach/serial.h> - -#define MDR1_MODE_MASK 0x07 - -volatile u8 *uart_base; -int uart_shift; - -/* - * Store the DEBUG_LL uart number into memory. - * See also debug-macro.S, and serial.c for related code. - */ -static void set_omap_uart_info(unsigned char port) -{ - /* - * Get address of some.bss variable and round it down - * a la CONFIG_AUTO_ZRELADDR. - */ - u32 ram_start = (u32)&uart_shift & 0xf8000000; - u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS); - *uart_info = port; -} - -static void putc(int c) -{ - if (!uart_base) - return; - - /* Check for UART 16x mode */ - if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0) - return; - - while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE)) - barrier(); - uart_base[UART_TX << uart_shift] = c; -} - -static inline void flush(void) -{ -} - -/* - * Macros to configure UART1 and debug UART - */ -#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \ - if (machine_is_##mach()) { \ - uart_base = (volatile u8 *)(dbg_uart); \ - uart_shift = (dbg_shft); \ - port = (dbg_id); \ - set_omap_uart_info(port); \ - break; \ - } - -#define DEBUG_LL_OMAP2(p, mach) \ - _DEBUG_LL_ENTRY(mach, OMAP2_UART##p##_BASE, OMAP_PORT_SHIFT, \ - OMAP2UART##p) - -#define DEBUG_LL_OMAP3(p, mach) \ - _DEBUG_LL_ENTRY(mach, OMAP3_UART##p##_BASE, OMAP_PORT_SHIFT, \ - OMAP3UART##p) - -#define DEBUG_LL_OMAP4(p, mach) \ - _DEBUG_LL_ENTRY(mach, OMAP4_UART##p##_BASE, OMAP_PORT_SHIFT, \ - OMAP4UART##p) - -#define DEBUG_LL_OMAP5(p, mach) \ - _DEBUG_LL_ENTRY(mach, OMAP5_UART##p##_BASE, OMAP_PORT_SHIFT, \ - OMAP5UART##p) -/* Zoom2/3 shift is different for UART1 and external port */ -#define DEBUG_LL_ZOOM(mach) \ - _DEBUG_LL_ENTRY(mach, ZOOM_UART_BASE, ZOOM_PORT_SHIFT, ZOOM_UART) - -#define DEBUG_LL_TI81XX(p, mach) \ - _DEBUG_LL_ENTRY(mach, TI81XX_UART##p##_BASE, OMAP_PORT_SHIFT, \ - TI81XXUART##p) - -#define DEBUG_LL_AM33XX(p, mach) \ - _DEBUG_LL_ENTRY(mach, AM33XX_UART##p##_BASE, OMAP_PORT_SHIFT, \ - AM33XXUART##p) - -static inline void arch_decomp_setup(void) -{ - int port = 0; - - /* - * Initialize the port based on the machine ID from the bootloader. - * Note that we're using macros here instead of switch statement - * as machine_is functions are optimized out for the boards that - * are not selected. - */ - do { - /* omap2 based boards using UART1 */ - DEBUG_LL_OMAP2(1, omap_2430sdp); - DEBUG_LL_OMAP2(1, omap_apollon); - DEBUG_LL_OMAP2(1, omap_h4); - - /* omap2 based boards using UART3 */ - DEBUG_LL_OMAP2(3, nokia_n800); - DEBUG_LL_OMAP2(3, nokia_n810); - DEBUG_LL_OMAP2(3, nokia_n810_wimax); - - /* omap3 based boards using UART1 */ - DEBUG_LL_OMAP2(1, omap3evm); - DEBUG_LL_OMAP3(1, omap_3430sdp); - DEBUG_LL_OMAP3(1, omap_3630sdp); - DEBUG_LL_OMAP3(1, omap3530_lv_som); - DEBUG_LL_OMAP3(1, omap3_torpedo); - - /* omap3 based boards using UART3 */ - DEBUG_LL_OMAP3(3, cm_t35); - DEBUG_LL_OMAP3(3, cm_t3517); - DEBUG_LL_OMAP3(3, cm_t3730); - DEBUG_LL_OMAP3(3, craneboard); - DEBUG_LL_OMAP3(3, devkit8000); - DEBUG_LL_OMAP3(3, igep0020); - DEBUG_LL_OMAP3(3, igep0030); - DEBUG_LL_OMAP3(3, nokia_rm680); - DEBUG_LL_OMAP3(3, nokia_rm696); - DEBUG_LL_OMAP3(3, nokia_rx51); - DEBUG_LL_OMAP3(3, omap3517evm); - DEBUG_LL_OMAP3(3, omap3_beagle); - DEBUG_LL_OMAP3(3, omap3_pandora); - DEBUG_LL_OMAP3(3, omap_ldp); - DEBUG_LL_OMAP3(3, overo); - DEBUG_LL_OMAP3(3, touchbook); - - /* omap4 based boards using UART3 */ - DEBUG_LL_OMAP4(3, omap_4430sdp); - DEBUG_LL_OMAP4(3, omap4_panda); - - /* omap5 based boards using UART3 */ - DEBUG_LL_OMAP5(3, omap5_sevm); - - /* zoom2/3 external uart */ - DEBUG_LL_ZOOM(omap_zoom2); - DEBUG_LL_ZOOM(omap_zoom3); - - /* TI8168 base boards using UART3 */ - DEBUG_LL_TI81XX(3, ti8168evm); - - /* TI8148 base boards using UART1 */ - DEBUG_LL_TI81XX(1, ti8148evm); - - /* AM33XX base boards using UART1 */ - DEBUG_LL_AM33XX(1, am335xevm); - } while (0); -} 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 @@ #include <linux/omap-dma.h> +#include "soc.h" #include "omap_device.h" /* @@ -118,4 +119,4 @@ static int __init omap2_mcbsp_init(void) return 0; } -arch_initcall(omap2_mcbsp_init); +omap_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 @@ #include <linux/slab.h> #include <linux/platform_data/iommu-omap.h> +#include "soc.h" #include "omap_hwmod.h" #include "omap_device.h" @@ -61,7 +62,7 @@ static int __init omap_iommu_init(void) return omap_hwmod_for_each_by_class("mmu", omap_iommu_dev_init, NULL); } /* must be ready before omap3isp is probed */ -subsys_initcall(omap_iommu_init); +omap_subsys_initcall(omap_iommu_init); static void __exit omap_iommu_exit(void) { 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 @@ #include <linux/clk.h> #include <linux/io.h> +#include "soc.h" #include "common.h" #include "prm2xxx.h" @@ -62,4 +63,4 @@ static int __init omap2xxx_common_look_up_clks_for_reset(void) return 0; } -core_initcall(omap2xxx_common_look_up_clks_for_reset); +omap_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) return 0; } -early_initcall(omap_l2_cache_init); +omap_early_initcall(omap_l2_cache_init); #endif void __iomem *omap4_get_sar_ram_base(void) @@ -254,7 +254,7 @@ static int __init omap4_sar_ram_init(void) return 0; } -early_initcall(omap4_sar_ram_init); +omap_early_initcall(omap4_sar_ram_init); void __init omap_gic_of_init(void) { 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 @@ #include <linux/of.h> #include <linux/notifier.h> +#include "soc.h" #include "omap_device.h" #include "omap_hwmod.h" @@ -1259,7 +1260,7 @@ static int __init omap_device_init(void) bus_register_notifier(&platform_bus_type, &platform_nb); return 0; } -core_initcall(omap_device_init); +omap_core_initcall(omap_device_init); /** * omap_device_late_idle - idle devices without drivers @@ -1297,4 +1298,4 @@ static int __init omap_device_late_init(void) bus_for_each_dev(&platform_bus_type, NULL, NULL, omap_device_late_idle); return 0; } -late_initcall(omap_device_late_init); +omap_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) return 0; } -core_initcall(omap_hwmod_setup_all); +omap_core_initcall(omap_hwmod_setup_all); /** * 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) return 0; } -early_initcall(omap4430_phy_power_down); +omap_early_initcall(omap4430_phy_power_down); void am35x_musb_reset(void) { 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) return r; } -device_initcall(omap3_opp_init); +omap_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) ARRAY_SIZE(omap446x_opp_def_list)); return r; } -device_initcall(omap4_opp_init); +omap_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) return 0; } -arch_initcall(pm_dbg_init); +omap_arch_initcall(pm_dbg_init); #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) return 0; } -postcore_initcall(omap2_common_pm_init); +omap_postcore_initcall(omap2_common_pm_init); int __init omap2_common_pm_late_init(void) { 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) return omap2_init_pmu(oh_num, oh_names); } -subsys_initcall(omap_init_pmu); +omap_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) return ret; } -subsys_initcall(omap3xxx_prm_late_init); +omap_subsys_initcall(omap3xxx_prm_late_init); static void __exit omap3xxx_prm_exit(void) { 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) return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); } -subsys_initcall(omap44xx_prm_late_init); +omap_subsys_initcall(omap44xx_prm_late_init); static void __exit omap44xx_prm_exit(void) { 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) return 0; } -core_initcall(omap_serial_early_init); +omap_core_initcall(omap_serial_early_init); /** * 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 @@ */ #include <linux/power/smartreflex.h> +#include "soc.h" #include "voltage.h" static int sr_class3_enable(struct omap_sr *sr) @@ -58,4 +59,4 @@ static int __init sr_class3_init(void) pr_info("SmartReflex Class3 initialized\n"); return sr_register_class(&class3_data); } -late_initcall(sr_class3_init); +omap_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 @@ #undef MULTI_OMAP2 #undef OMAP_NAME +#ifdef CONFIG_ARCH_MULTIPLATFORM +#define MULTI_OMAP2 +#endif #ifdef CONFIG_SOC_OMAP2420 # ifdef OMAP_NAME # undef MULTI_OMAP2 @@ -112,6 +115,11 @@ int omap_type(void); */ unsigned int omap_rev(void); +static inline int soc_is_omap(void) +{ + return omap_rev() != 0; +} + /* * Get the CPU revision for OMAP devices */ @@ -465,5 +473,26 @@ static inline unsigned int omap4_has_ ##feat(void) \ OMAP4_HAS_FEATURE(perf_silicon, PERF_SILICON) +/* + * We need to make sure omap initcalls don't run when + * multiplatform kernels are booted on other SoCs. + */ +#define omap_initcall(level, fn) \ +static int __init __used __##fn(void) \ +{ \ + if (!soc_is_omap()) \ + return 0; \ + return fn(); \ +} \ +level(__##fn); + +#define omap_early_initcall(fn) omap_initcall(early_initcall, fn) +#define omap_core_initcall(fn) omap_initcall(core_initcall, fn) +#define omap_postcore_initcall(fn) omap_initcall(postcore_initcall, fn) +#define omap_arch_initcall(fn) omap_initcall(arch_initcall, fn) +#define omap_subsys_initcall(fn) omap_initcall(subsys_initcall, fn) +#define omap_device_initcall(fn) omap_initcall(device_initcall, fn) +#define omap_late_initcall(fn) omap_initcall(late_initcall, fn) + #endif /* __ASSEMBLY__ */ 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) return 0; } -arch_initcall(omap2_dm_timer_init); +omap_arch_initcall(omap2_dm_timer_init); /** * 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) dev_name, oh->name); return 0; } -subsys_initcall(omap_init_wdt); +omap_subsys_initcall(omap_init_wdt); |