From dffc9daeec5e7e2a5bfcb7cbb5abf3a9dc64ffe1 Mon Sep 17 00:00:00 2001 From: Tarun Kanti DebBarma Date: Mon, 5 Mar 2012 16:11:00 -0800 Subject: [PATCH 01/18] ARM: OMAP: dmtimer: fix missing content/correction in low-power mode support Since omap_dm_timer_write_reg/__omap_dm_timer_write is now modified to use timer->func_base OCP_CFG should not use this wrapper anymore. Instead use __raw_writel() directly and use timer->io_base instead to write to OCP_CFG. The timer->sys_stat is valid only if timer->revision is 1. In the context restore function make this correction. Save the contexts and loss count when timer is stopped. Also, disable the clock. Else, clock usecount would become imbalanced. Signed-off-by: Tarun Kanti DebBarma Tested-by: Omar Ramirez Luna Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/dmtimer.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index af3b92be8459..0b77fe87e010 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c @@ -80,9 +80,9 @@ static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg, static void omap_timer_restore_context(struct omap_dm_timer *timer) { - omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_OFFSET, - timer->context.tiocp_cfg); - if (timer->revision > 1) + __raw_writel(timer->context.tiocp_cfg, + timer->io_base + OMAP_TIMER_OCP_CFG_OFFSET); + if (timer->revision == 1) __raw_writel(timer->context.tistat, timer->sys_stat); __raw_writel(timer->context.tisr, timer->irq_stat); @@ -357,6 +357,19 @@ int omap_dm_timer_stop(struct omap_dm_timer *timer) __omap_dm_timer_stop(timer, timer->posted, rate); + if (timer->loses_context && timer->get_context_loss_count) + timer->ctx_loss_count = + timer->get_context_loss_count(&timer->pdev->dev); + + /* + * Since the register values are computed and written within + * __omap_dm_timer_stop, we need to use read to retrieve the + * context. + */ + timer->context.tclr = + omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); + timer->context.tisr = __raw_readl(timer->irq_stat); + omap_dm_timer_disable(timer); return 0; } EXPORT_SYMBOL_GPL(omap_dm_timer_stop); From f611b020e74a41fb6460a5d5ca085d0c361b8b2f Mon Sep 17 00:00:00 2001 From: Bernhard Walle Date: Mon, 5 Mar 2012 16:11:01 -0800 Subject: [PATCH 02/18] ARM: OMAP2+: GPMC: Export gpmc_enable_hwecc and gpmc_calculate_ecc To be able to compile kernel/drivers/mtd/nand/omap2.ko as module, that two symbols need to be exported. Otherwise, I get following error message ERROR: "gpmc_calculate_ecc" [drivers/mtd/nand/omap2.ko] undefined! ERROR: "gpmc_enable_hwecc" [drivers/mtd/nand/omap2.ko] undefined! Signed-off-by: Bernhard Walle Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/gpmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index dfffbbf4c009..00d510858e28 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -888,6 +888,7 @@ int gpmc_enable_hwecc(int cs, int mode, int dev_width, int ecc_size) gpmc_write_reg(GPMC_ECC_CONFIG, val); return 0; } +EXPORT_SYMBOL_GPL(gpmc_enable_hwecc); /** * gpmc_calculate_ecc - generate non-inverted ecc bytes @@ -918,3 +919,4 @@ int gpmc_calculate_ecc(int cs, const u_char *dat, u_char *ecc_code) gpmc_ecc_used = -EINVAL; return 0; } +EXPORT_SYMBOL_GPL(gpmc_calculate_ecc); From fb3cfb1ff9745e0c3aab92cc141c1b353839b0ab Mon Sep 17 00:00:00 2001 From: Afzal Mohammed Date: Mon, 5 Mar 2012 16:11:01 -0800 Subject: [PATCH 03/18] ARM: OMAP2+: id: Add am33xx SoC type detection Determine SoC type, i.e. whether GP or HS Note: cpu_is_34xx() is true for am33xx also. Doing cpu_is_am33xx() check after cpu_is_34xx() will not achieve what we want due to the above reason. Hence cpu_is_am33xx() is done before cpu_is_34xx() Signed-off-by: Afzal Mohammed Signed-off-by: Vaibhav Hiremath Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/control.h | 5 +++++ arch/arm/mach-omap2/id.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index 0ba68d3764bc..96c4bcc0a75c 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h @@ -338,6 +338,11 @@ #define AM35XX_HECC_SW_RST BIT(3) #define AM35XX_VPFE_PCLK_SW_RST BIT(4) +/* + * CONTROL AM33XX STATUS register + */ +#define AM33XX_CONTROL_STATUS 0x040 + /* * CONTROL OMAP STATUS register to identify OMAP3 features */ diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 6c5826605eae..134739751107 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -44,6 +44,8 @@ int omap_type(void) if (cpu_is_omap24xx()) { val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); + } else if (cpu_is_am33xx()) { + val = omap_ctrl_readl(AM33XX_CONTROL_STATUS); } else if (cpu_is_omap34xx()) { val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); } else if (cpu_is_omap44xx()) { From b4c0a8a73b6a767550617339fb9129fbbebf82e3 Mon Sep 17 00:00:00 2001 From: Vaibhav Bedia Date: Mon, 5 Mar 2012 16:11:01 -0800 Subject: [PATCH 04/18] ARM: OMAP: sram: Add am33xx SRAM support (minimal) Update SRAM start & size for am33xx SoC's. Note: cpu_is_34xx() is true for am33xx also. Doing cpu_is_am33xx() check after cpu_is_34xx() will not achieve what we want due to the above reason. Hence cpu_is_am33xx() is done before cpu_is_34xx() Signed-off-by: Vaibhav Bedia Signed-off-by: Afzal Mohammed Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/include/plat/sram.h | 1 + arch/arm/plat-omap/sram.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h index 75aa1b2bef51..227ae2657554 100644 --- a/arch/arm/plat-omap/include/plat/sram.h +++ b/arch/arm/plat-omap/include/plat/sram.h @@ -101,4 +101,5 @@ static inline void omap_push_sram_idle(void) {} #else #define OMAP4_SRAM_PA 0x40300000 #endif +#define AM33XX_SRAM_PA 0x40300000 #endif diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 4243bdcc87bc..596f2224e15a 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c @@ -86,7 +86,7 @@ static int is_sram_locked(void) __raw_writel(0xCFDE, OMAP24XX_VA_READPERM0); /* all i-read */ __raw_writel(0xCFDE, OMAP24XX_VA_WRITEPERM0); /* all i-write */ } - if (cpu_is_omap34xx()) { + if (cpu_is_omap34xx() && !cpu_is_am33xx()) { __raw_writel(0xFFFF, OMAP34XX_VA_REQINFOPERM0); /* all q-vects */ __raw_writel(0xFFFF, OMAP34XX_VA_READPERM0); /* all i-read */ __raw_writel(0xFFFF, OMAP34XX_VA_WRITEPERM0); /* all i-write */ @@ -124,7 +124,10 @@ static void __init omap_detect_sram(void) omap_sram_size = 0x800; /* 2K */ } } else { - if (cpu_is_omap34xx()) { + if (cpu_is_am33xx()) { + omap_sram_start = AM33XX_SRAM_PA; + omap_sram_size = 0x10000; /* 64K */ + } else if (cpu_is_omap34xx()) { omap_sram_start = OMAP3_SRAM_PA; omap_sram_size = 0x10000; /* 64K */ } else if (cpu_is_omap44xx()) { @@ -368,6 +371,11 @@ static inline int omap34xx_sram_init(void) return 0; } +static inline int am33xx_sram_init(void) +{ + return 0; +} + int __init omap_sram_init(void) { omap_detect_sram(); @@ -379,6 +387,8 @@ int __init omap_sram_init(void) omap242x_sram_init(); else if (cpu_is_omap2430()) omap243x_sram_init(); + else if (cpu_is_am33xx()) + am33xx_sram_init(); else if (cpu_is_omap34xx()) omap34xx_sram_init(); From 17e22caccfcefc3f45ab5eaafe7279ada3b3fbd6 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Mon, 5 Mar 2012 16:11:02 -0800 Subject: [PATCH 05/18] ARM: omap: pandora: fix usbhs platform data It turned out wrong OMAP HSUSB port was configured on pandora, but still managed to work somehow. This was noticed after enabling in-kernel mux, where USB muxing was causing other devices not to work, because hsusb1 pins (instead of hsusb2) were wrongly remuxed, which are used for other things on pandora. Signed-off-by: Grazvydas Ignotas Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-omap3pandora.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 1644b73017fc..2224b5d873cd 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -343,7 +343,7 @@ static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = { }; static struct regulator_consumer_supply pandora_usb_phy_supply[] = { - REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"), + REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"), }; /* ads7846 on SPI and 2 nub controllers on I2C */ @@ -561,13 +561,13 @@ static struct platform_device *omap3pandora_devices[] __initdata = { static const struct usbhs_omap_board_data usbhs_bdata __initconst = { - .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, - .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, + .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, + .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, .phy_reset = true, - .reset_gpio_port[0] = 16, - .reset_gpio_port[1] = -EINVAL, + .reset_gpio_port[0] = -EINVAL, + .reset_gpio_port[1] = 16, .reset_gpio_port[2] = -EINVAL }; From 7db74d5e327197289f2eb83c13f8d1b565a21467 Mon Sep 17 00:00:00 2001 From: Ilya Yanok Date: Mon, 5 Mar 2012 16:11:02 -0800 Subject: [PATCH 06/18] ARM: OMAP2+: ads7846_init: put gpio_pendown into pdata if it's provided If platform data is provided by the caller gpio_pendown is put into unused static ads7846_config structure and effectively has no effect. Of course caller can set gpio_pendown field in platform data himself but it seems natural to do this in ads7846_init to remove duplication. Signed-off-by: Igor Grinberg Signed-off-by: Ilya Yanok Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/common-board-devices.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c index bcb0c5817167..799a617ade30 100644 --- a/arch/arm/mach-omap2/common-board-devices.c +++ b/arch/arm/mach-omap2/common-board-devices.c @@ -76,13 +76,15 @@ void __init omap_ads7846_init(int bus_num, int gpio_pendown, int gpio_debounce, gpio_set_debounce(gpio_pendown, gpio_debounce); } - ads7846_config.gpio_pendown = gpio_pendown; - spi_bi->bus_num = bus_num; spi_bi->irq = OMAP_GPIO_IRQ(gpio_pendown); - if (board_pdata) + if (board_pdata) { + board_pdata->gpio_pendown = gpio_pendown; spi_bi->platform_data = board_pdata; + } else { + ads7846_config.gpio_pendown = gpio_pendown; + } spi_register_board_info(&ads7846_spi_board_info, 1); } From be89cd9db41d7e39e8bebc71aee86938ee675f9c Mon Sep 17 00:00:00 2001 From: Ohad Ben-Cohen Date: Mon, 5 Mar 2012 16:11:02 -0800 Subject: [PATCH 07/18] ARM: OMAP: don't build hwspinlock in vain Cleanup: don't build mach-omap2/hwspinlock.c if the OMAP hwspinlock driver isn't configured. This will both shorten build time and avoid registering a device which isn't needed. Signed-off-by: Ohad Ben-Cohen Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index bd76394ccaf8..caca7d460e13 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -268,6 +268,8 @@ obj-y += $(smc91x-m) $(smc91x-y) smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o obj-y += $(smsc911x-m) $(smsc911x-y) -obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o +ifneq ($(CONFIG_HWSPINLOCK_OMAP),) +obj-y += hwspinlock.o +endif obj-y += common-board-devices.o twl-common.o From 7bb8308588e59c4d5f1a31fd588d8b7854d08f80 Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Mon, 5 Mar 2012 16:11:03 -0800 Subject: [PATCH 08/18] ARM: OMAP: clock.c: included linux/debugfs.h twice arch/arm/plat-omap/clock.c: included 'linux/debugfs.h' twice, remove the duplicate. Signed-off-by: Danny Kukawka Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/clock.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 567e4b54f245..56b6f8b7053e 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include From 31fc80a7a1c1df28ffb73a73b1e2c7f9d664435e Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Mon, 5 Mar 2012 16:11:03 -0800 Subject: [PATCH 09/18] ARM: OMAP2+: included some headers twice arch/arm/mach-omap2/: included some headers tiwce: - arch/arm/mach-omap2/board-ldp.c: 'linux/gpio.h' - arch/arm/mach-omap2/io.c: 'common.h' - arch/arm/mach-omap2/omap_hwmod_44xx_data.c: 'plat/i2c.h' Remove the duplicates. Signed-off-by: Danny Kukawka Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-ldp.c | 1 - arch/arm/mach-omap2/io.c | 1 - arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 1 - 3 files changed, 3 deletions(-) diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 2d2a61f7dcbf..ac42ebeb184b 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index eb50c29fb644..9bd07f33eea7 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -43,7 +43,6 @@ #include "clockdomain.h" #include #include -#include "common.h" /* * The machine specific code may provide the extra mapping besides the diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index ef0524c10a84..acb561ea7c11 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include From a90180d193ad56a3c4fb9cd39067f60d7503a4bf Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 5 Mar 2012 16:11:03 -0800 Subject: [PATCH 10/18] ARM: OMAP: Remove definition cpu_is_omap4430() The definition cpu_is_omap4430() always returns 0 even when CONFIG_ARCH_OMAP4 is enabled. This macro should be removed and the macro cpu_is_omap443x() should be used where needed for OMAP4430 devices. Signed-off-by: Jon Hunter Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/include/plat/cpu.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h index 6b51086fce18..4f18eaed4511 100644 --- a/arch/arm/plat-omap/include/plat/cpu.h +++ b/arch/arm/plat-omap/include/plat/cpu.h @@ -250,7 +250,6 @@ IS_AM_SUBCLASS(335x, 0x335) * cpu_is_omap2423(): True for OMAP2423 * cpu_is_omap2430(): True for OMAP2430 * cpu_is_omap3430(): True for OMAP3430 - * cpu_is_omap4430(): True for OMAP4430 * cpu_is_omap3505(): True for OMAP3505 * cpu_is_omap3517(): True for OMAP3517 */ @@ -299,7 +298,6 @@ IS_OMAP_TYPE(3517, 0x3517) #define cpu_is_omap3505() 0 #define cpu_is_omap3517() 0 #define cpu_is_omap3430() 0 -#define cpu_is_omap4430() 0 #define cpu_is_omap3630() 0 /* From 44c568a8bb3cd59f27d5cca1b9c6977a002c1913 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 5 Mar 2012 16:11:03 -0800 Subject: [PATCH 11/18] ARM: OMAP: mailbox: trivial whitespace fix Trivial whitespace fix Signed-off-by: Felipe Contreras Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/mailbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c index ad80112c2275..ad32621aa52e 100644 --- a/arch/arm/plat-omap/mailbox.c +++ b/arch/arm/plat-omap/mailbox.c @@ -307,7 +307,7 @@ static void omap_mbox_fini(struct omap_mbox *mbox) if (!--mbox->use_count) { free_irq(mbox->irq, mbox); tasklet_kill(&mbox->txq->tasklet); - flush_work_sync(&mbox->rxq->work); + flush_work_sync(&mbox->rxq->work); mbox_queue_free(mbox->txq); mbox_queue_free(mbox->rxq); } From 33c3f71cf7033ffd108cbab7a75665a5e66a1be0 Mon Sep 17 00:00:00 2001 From: Masanari Iida Date: Mon, 5 Mar 2012 16:11:04 -0800 Subject: [PATCH 12/18] ARM: OMAP1: Fix typo in lcd_dma.c Correct spelling "resulotion" to "resolution" in arch/arm/mach-omap1/lcd_dma.c Signed-off-by: Masanari Iida Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/lcd_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c index 453809359ba6..4c5ce7d829c2 100644 --- a/arch/arm/mach-omap1/lcd_dma.c +++ b/arch/arm/mach-omap1/lcd_dma.c @@ -117,7 +117,7 @@ EXPORT_SYMBOL(omap_set_lcd_dma_b1_mirror); void omap_set_lcd_dma_b1_vxres(unsigned long vxres) { if (cpu_is_omap15xx()) { - printk(KERN_ERR "DMA virtual resulotion is not supported " + printk(KERN_ERR "DMA virtual resolution is not supported " "in 1510 mode\n"); BUG(); } From 8eaa7bb0b363707db6d1323e4fbc0783bc55d22d Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 5 Mar 2012 16:11:04 -0800 Subject: [PATCH 13/18] ARM: OMAP1: Fix section mismatch for omap1_init_early() Fix the following warning: WARNING: vmlinux.o(.text+0x1286c): Section mismatch in reference from the function omap1_init_early() to the function .init.text:omap1_clk_init() The function omap1_init_early() references the function __init omap1_clk_init(). This is often because omap1_init_early lacks a __init annotation or the annotation of omap1_clk_init is wrong. Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c index 8e55b6fb3478..55a8f582d04c 100644 --- a/arch/arm/mach-omap1/io.c +++ b/arch/arm/mach-omap1/io.c @@ -118,7 +118,7 @@ void __init omap16xx_map_io(void) /* * Common low-level hardware init for omap1. */ -void omap1_init_early(void) +void __init omap1_init_early(void) { omap_check_revision(); From e48f814e6366d36a0495f6aa2838a064304f6406 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Tue, 6 Mar 2012 11:49:22 -0800 Subject: [PATCH 14/18] ARM: OMAP2+: Fix omap24xx_io_desc warning if SoC subtypes are not selected Otherwise we get the following warning: arch/arm/mach-omap2/io.c:53:24: warning: 'omap24xx_io_desc' defined but not used [-Wunused-variable] Reported-by: Russell King Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 9bd07f33eea7..3fbb0c0b84a4 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -49,7 +49,7 @@ * default mapping provided here. */ -#ifdef CONFIG_ARCH_OMAP2 +#if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430) static struct map_desc omap24xx_io_desc[] __initdata = { { .virtual = L3_24XX_VIRT, From 49b87c6db100cf9802be22a1b83a72cbcadaa76c Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Tue, 6 Mar 2012 11:49:28 -0800 Subject: [PATCH 15/18] ARM: OMAP2: Fix section warning for n8x0 when CONFIG_MMC_OMAP is not set Otherwise we get: arch/arm/mach-omap2/board-n8x0.c:39:12: warning: 'slot1_cover_open' defined but not used [-Wunused-variable] arch/arm/mach-omap2/board-n8x0.c:40:12: warning: 'slot2_cover_open' defined but not used [-Wunused-variable] arch/arm/mach-omap2/board-n8x0.c:41:23: warning: 'mmc_device' defined but not used [-Wunused-variable] Reported-by: Russell King Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-n8x0.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 42a4d11fad23..6bb67461a11c 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c @@ -36,10 +36,6 @@ #include "mux.h" -static int slot1_cover_open; -static int slot2_cover_open; -static struct device *mmc_device; - #define TUSB6010_ASYNC_CS 1 #define TUSB6010_SYNC_CS 4 #define TUSB6010_GPIO_INT 58 @@ -211,6 +207,10 @@ static struct omap_onenand_platform_data board_onenand_data[] = { #define N810_EMMC_VSD_GPIO 23 #define N810_EMMC_VIO_GPIO 9 +static int slot1_cover_open; +static int slot2_cover_open; +static struct device *mmc_device; + static int n8x0_mmc_switch_slot(struct device *dev, int slot) { #ifdef CONFIG_MMC_DEBUG From 1f3b372b3c1018fad960015cbfdf8de9251d14db Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Tue, 6 Mar 2012 11:38:01 -0800 Subject: [PATCH 16/18] ARM: OMAP2+: PM: fix section mismatch with omap2_init_processor_devices() Fix the below warning by making omap2_init_processor_devices() __init. It is called by an __init function and calls only __init functions, so it should also be init. WARNING: arch/arm/mach-omap2/built-in.o(.text+0x183c): Section mismatch in reference from the function omap2_init_processor_devices() to the function .init.text:_init_omap_device() The function omap2_init_processor_devices() references the function __init _init_omap_device(). This is often because omap2_init_processor_devices lacks a __init annotation or the annotation of _init_omap_device is wrong. Reported-by: Russell King Signed-off-by: Kevin Hilman Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 1881fe915149..d00c39eefb1e 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -49,7 +49,7 @@ static int _init_omap_device(char *name) /* * Build omap_devices for processors and bus. */ -static void omap2_init_processor_devices(void) +static void __init omap2_init_processor_devices(void) { _init_omap_device("mpu"); if (omap3_has_iva()) From bb1dbe7cfd62e35f6f25e94729458b9047e3f555 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Tue, 6 Mar 2012 12:00:25 -0800 Subject: [PATCH 17/18] ARM: OMAP2+: PM: fix wakeupgen warning when hotplug disabled When CONFIG_HOTPLUG_CPU=n, there are unused functions in wakeupgen: arch/arm/mach-omap2/omap-wakeupgen.c:181: warning: 'wakeupgen_irqmask_all' defined but not used Fix this by moving all the functions only used when CONFIG_HOTPLUG_CPU=y together and wrapping in an #ifdef. No functional changes. Reported-by: Russell King Signed-off-by: Kevin Hilman Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/omap-wakeupgen.c | 53 +++++++++++++++------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c index d3d8971d7f30..42cd7fb52414 100644 --- a/arch/arm/mach-omap2/omap-wakeupgen.c +++ b/arch/arm/mach-omap2/omap-wakeupgen.c @@ -43,7 +43,6 @@ static void __iomem *wakeupgen_base; static void __iomem *sar_base; -static DEFINE_PER_CPU(u32 [NR_REG_BANKS], irqmasks); static DEFINE_SPINLOCK(wakeupgen_lock); static unsigned int irq_target_cpu[NR_IRQS]; @@ -67,14 +66,6 @@ static inline void sar_writel(u32 val, u32 offset, u8 idx) __raw_writel(val, sar_base + offset + (idx * 4)); } -static void _wakeupgen_set_all(unsigned int cpu, unsigned int reg) -{ - u8 i; - - for (i = 0; i < NR_REG_BANKS; i++) - wakeupgen_writel(reg, i, cpu); -} - static inline int _wakeupgen_get_irq_info(u32 irq, u32 *bit_posn, u8 *reg_index) { unsigned int spi_irq; @@ -130,22 +121,6 @@ static void _wakeupgen_set(unsigned int irq, unsigned int cpu) wakeupgen_writel(val, i, cpu); } -static void _wakeupgen_save_masks(unsigned int cpu) -{ - u8 i; - - for (i = 0; i < NR_REG_BANKS; i++) - per_cpu(irqmasks, cpu)[i] = wakeupgen_readl(i, cpu); -} - -static void _wakeupgen_restore_masks(unsigned int cpu) -{ - u8 i; - - for (i = 0; i < NR_REG_BANKS; i++) - wakeupgen_writel(per_cpu(irqmasks, cpu)[i], i, cpu); -} - /* * Architecture specific Mask extension */ @@ -170,6 +145,33 @@ static void wakeupgen_unmask(struct irq_data *d) spin_unlock_irqrestore(&wakeupgen_lock, flags); } +#ifdef CONFIG_HOTPLUG_CPU +static DEFINE_PER_CPU(u32 [NR_REG_BANKS], irqmasks); + +static void _wakeupgen_save_masks(unsigned int cpu) +{ + u8 i; + + for (i = 0; i < NR_REG_BANKS; i++) + per_cpu(irqmasks, cpu)[i] = wakeupgen_readl(i, cpu); +} + +static void _wakeupgen_restore_masks(unsigned int cpu) +{ + u8 i; + + for (i = 0; i < NR_REG_BANKS; i++) + wakeupgen_writel(per_cpu(irqmasks, cpu)[i], i, cpu); +} + +static void _wakeupgen_set_all(unsigned int cpu, unsigned int reg) +{ + u8 i; + + for (i = 0; i < NR_REG_BANKS; i++) + wakeupgen_writel(reg, i, cpu); +} + /* * Mask or unmask all interrupts on given CPU. * 0 = Mask all interrupts on the 'cpu' @@ -191,6 +193,7 @@ static void wakeupgen_irqmask_all(unsigned int cpu, unsigned int set) } spin_unlock_irqrestore(&wakeupgen_lock, flags); } +#endif #ifdef CONFIG_CPU_PM /* From 3223d007a3f9ddbd68424adf628e740dd87c564f Mon Sep 17 00:00:00 2001 From: Yuan Jiangli Date: Tue, 6 Mar 2012 12:51:12 -0600 Subject: [PATCH 18/18] ARM: OMAP3+: PM: VP: fix integer truncation error commit 2f34ce81b8c05c900e45bd88595cc154f7bb5957 (OMAP3: PM: Adding voltage driver support.) introduced runtime computation of waittime to handle all potential sys clocks available. In the voltage processor, the SPMSUpdateWait is calculated based on the slew rate and the voltage step (SMPSUpdateWait = slew rate * Voltage Step). After the voltage processor receives the SMPS_Ack signal, the Voltage Controller will wait for SMPSUpdateWait clock cycles for the voltage to settle to the new value. For all practical purposes, the waittime parameter is the OMAP hardware translation of what the slew rate on the PMIC is. As an example, with TPS62361 on OMAP4460, step_size = 10000 slew_rate = 32000 sys_clk_rate = 38400 Our current computation results in the following: = ((step_size / slew_rate) * sys_clk_rate) / 1000 = ((10000 / 32000) * 38400 / 1000 = 0 Fix the same using DIV_ROUND_UP as an extra wait clock cycle is better than lesser clock cycle. For the above example, this translates to: = (10000 * 38400) / (1000 * 32000) = 12 Acked-by: Jon Hunter [nm@ti.com: slightly better implementation] Signed-off-by: Nishanth Menon Signed-off-by: Yuan Jiangli Acked-by: Kevin Hilman Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/vp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c index 0df88820978d..f95c1bad9dc6 100644 --- a/arch/arm/mach-omap2/vp.c +++ b/arch/arm/mach-omap2/vp.c @@ -61,8 +61,8 @@ void __init omap_vp_init(struct voltagedomain *voltdm) vddmin = voltdm->pmic->vp_vddmin; vddmax = voltdm->pmic->vp_vddmax; - waittime = ((voltdm->pmic->step_size / voltdm->pmic->slew_rate) * - sys_clk_rate) / 1000; + waittime = DIV_ROUND_UP(voltdm->pmic->step_size * sys_clk_rate, + 1000 * voltdm->pmic->slew_rate); vstepmin = voltdm->pmic->vp_vstepmin; vstepmax = voltdm->pmic->vp_vstepmax;