aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-11 12:44:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-11 12:44:19 -0500
commitc0f607c608ba889db5250235ba620f818aa44a4d (patch)
treeb3802cae458d0c3d413425642b8e3c90aa24a5ee /arch
parent598cace09645fc10f8150e4adc982922cbd214ed (diff)
parent27dba4bcf87494e2909f6b0035f0a9a038e80f83 (diff)
Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (26 commits) OMAP2 clock: dynamically allocate CPUFreq frequency table OMAP clock/CPUFreq: add clk_exit_cpufreq_table() OMAP2xxx OPP: clean up comments in OPP data OMAP2xxx clock: clk2xxx.c doesn't compile if CPUFREQ is enabled OMAP1 clock: remove __initdata from struct clk_functions to prevent crash OMAP1 clock: Add missing clocks for OMAP 7xx OMAP clock: remove incorrect EXPORT_SYMBOL()s OMAP3 clock: Add capability to change rate of dpll4_m5_ck OMAP3 clock: McBSP 2, 3, 4 functional clock parent is PER_96M_FCLK, not CORE_96M_FCLK OMAP3: clock: add clockdomains for UART1 & 2 OMAP2420 IO mapping: move IVA mapping virtual address out of vmalloc space OMAP2xxx IO mapping: mark DSP mappings as being 2420-only ARM: OMAP3: PM: Fix the Invalid CM_CLKSTCTRL reg access. OMAP2: remove duplicated #include omap3: EVM: Choose OMAP_PACKAGE_CBB omap3: Fix booting if package is uninitialized omap3: add missing parentheses omap3: add missing parentheses omap2/3: ZOOM: Correcting key mapping for few keys omap2/3: make serial_in_override() address the right uart port ...
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap1/clock_data.c10
-rw-r--r--arch/arm/mach-omap1/devices.c35
-rw-r--r--arch/arm/mach-omap1/mux.c8
-rw-r--r--arch/arm/mach-omap2/Kconfig1
-rwxr-xr-xarch/arm/mach-omap2/board-zoom-peripherals.c8
-rw-r--r--arch/arm/mach-omap2/clock2xxx.c57
-rw-r--r--arch/arm/mach-omap2/clock34xx.c1
-rw-r--r--arch/arm/mach-omap2/clock34xx_data.c6
-rw-r--r--arch/arm/mach-omap2/clockdomain.c4
-rw-r--r--arch/arm/mach-omap2/io.c19
-rw-r--r--arch/arm/mach-omap2/mux.c6
-rw-r--r--arch/arm/mach-omap2/opp2420_data.c38
-rw-r--r--arch/arm/mach-omap2/opp2430_data.c30
-rw-r--r--arch/arm/mach-omap2/pm34xx.c4
-rw-r--r--arch/arm/mach-omap2/serial.c12
-rw-r--r--arch/arm/plat-omap/clock.c16
-rw-r--r--arch/arm/plat-omap/cpu-omap.c1
-rw-r--r--arch/arm/plat-omap/gpio.c63
-rw-r--r--arch/arm/plat-omap/include/plat/board.h1
-rw-r--r--arch/arm/plat-omap/include/plat/clock.h2
-rw-r--r--arch/arm/plat-omap/include/plat/control.h2
-rw-r--r--arch/arm/plat-omap/include/plat/io.h36
-rw-r--r--arch/arm/plat-omap/include/plat/mux.h8
-rw-r--r--arch/arm/plat-omap/include/plat/omap7xx.h3
-rw-r--r--arch/arm/plat-omap/io.c12
-rw-r--r--arch/arm/plat-omap/iommu.c2
-rw-r--r--arch/arm/plat-omap/mcbsp.c20
27 files changed, 296 insertions, 109 deletions
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index ab995a9c606..65e7b5b85d8 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -599,7 +599,7 @@ static struct clk i2c_ick = {
599static struct omap_clk omap_clks[] = { 599static struct omap_clk omap_clks[] = {
600 /* non-ULPD clocks */ 600 /* non-ULPD clocks */
601 CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310 | CK_7XX), 601 CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310 | CK_7XX),
602 CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310), 602 CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310 | CK_7XX),
603 /* CK_GEN1 clocks */ 603 /* CK_GEN1 clocks */
604 CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX), 604 CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX),
605 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX), 605 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX),
@@ -627,7 +627,7 @@ static struct omap_clk omap_clks[] = {
627 CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX), 627 CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX),
628 CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310), 628 CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310),
629 CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX), 629 CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX),
630 CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310), 630 CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
631 CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310), 631 CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310),
632 CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX), 632 CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX),
633 CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX), 633 CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX),
@@ -658,6 +658,10 @@ static struct omap_clk omap_clks[] = {
658 CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX), 658 CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX),
659 CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX), 659 CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX),
660 CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX), 660 CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX),
661 CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX),
662 CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX),
663 CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX),
664 CLK("omap1_spi100k.2", "ick", &dummy_ck, CK_7XX),
661 CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310), 665 CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310),
662 CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX), 666 CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX),
663 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310), 667 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310),
@@ -674,7 +678,7 @@ static struct omap_clk omap_clks[] = {
674 * init 678 * init
675 */ 679 */
676 680
677static struct clk_functions omap1_clk_functions __initdata = { 681static struct clk_functions omap1_clk_functions = {
678 .clk_enable = omap1_clk_enable, 682 .clk_enable = omap1_clk_enable,
679 .clk_disable = omap1_clk_disable, 683 .clk_disable = omap1_clk_disable,
680 .clk_round_rate = omap1_clk_round_rate, 684 .clk_round_rate = omap1_clk_round_rate,
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 23ded2d4960..a2d07aa75c9 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/spi/spi.h>
17 18
18#include <mach/hardware.h> 19#include <mach/hardware.h>
19#include <asm/mach/map.h> 20#include <asm/mach/map.h>
@@ -23,6 +24,7 @@
23#include <plat/mux.h> 24#include <plat/mux.h>
24#include <mach/gpio.h> 25#include <mach/gpio.h>
25#include <plat/mmc.h> 26#include <plat/mmc.h>
27#include <plat/omap7xx.h>
26 28
27/*-------------------------------------------------------------------------*/ 29/*-------------------------------------------------------------------------*/
28 30
@@ -196,6 +198,38 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
196 198
197/*-------------------------------------------------------------------------*/ 199/*-------------------------------------------------------------------------*/
198 200
201/* OMAP7xx SPI support */
202#if defined(CONFIG_SPI_OMAP_100K) || defined(CONFIG_SPI_OMAP_100K_MODULE)
203
204struct platform_device omap_spi1 = {
205 .name = "omap1_spi100k",
206 .id = 1,
207};
208
209struct platform_device omap_spi2 = {
210 .name = "omap1_spi100k",
211 .id = 2,
212};
213
214static void omap_init_spi100k(void)
215{
216 omap_spi1.dev.platform_data = ioremap(OMAP7XX_SPI1_BASE, 0x7ff);
217 if (omap_spi1.dev.platform_data)
218 platform_device_register(&omap_spi1);
219
220 omap_spi2.dev.platform_data = ioremap(OMAP7XX_SPI2_BASE, 0x7ff);
221 if (omap_spi2.dev.platform_data)
222 platform_device_register(&omap_spi2);
223}
224
225#else
226static inline void omap_init_spi100k(void)
227{
228}
229#endif
230
231/*-------------------------------------------------------------------------*/
232
199#if defined(CONFIG_OMAP_STI) 233#if defined(CONFIG_OMAP_STI)
200 234
201#define OMAP1_STI_BASE 0xfffea000 235#define OMAP1_STI_BASE 0xfffea000
@@ -263,6 +297,7 @@ static int __init omap1_init_devices(void)
263 297
264 omap_init_mbox(); 298 omap_init_mbox();
265 omap_init_rtc(); 299 omap_init_rtc();
300 omap_init_spi100k();
266 omap_init_sti(); 301 omap_init_sti();
267 302
268 return 0; 303 return 0;
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index 07212cc621a..84341377232 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -62,6 +62,14 @@ MUX_CFG_7XX("MMC_7XX_DAT0", 2, 17, 0, 16, 1, 0)
62/* I2C interface */ 62/* I2C interface */
63MUX_CFG_7XX("I2C_7XX_SCL", 5, 1, 0, 0, 1, 0) 63MUX_CFG_7XX("I2C_7XX_SCL", 5, 1, 0, 0, 1, 0)
64MUX_CFG_7XX("I2C_7XX_SDA", 5, 5, 0, 0, 1, 0) 64MUX_CFG_7XX("I2C_7XX_SDA", 5, 5, 0, 0, 1, 0)
65
66/* SPI pins */
67MUX_CFG_7XX("SPI_7XX_1", 6, 5, 4, 4, 1, 0)
68MUX_CFG_7XX("SPI_7XX_2", 6, 9, 4, 8, 1, 0)
69MUX_CFG_7XX("SPI_7XX_3", 6, 13, 4, 12, 1, 0)
70MUX_CFG_7XX("SPI_7XX_4", 6, 17, 4, 16, 1, 0)
71MUX_CFG_7XX("SPI_7XX_5", 8, 25, 0, 24, 0, 0)
72MUX_CFG_7XX("SPI_7XX_6", 9, 5, 0, 4, 0, 0)
65}; 73};
66#define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins) 74#define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins)
67#else 75#else
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 10eafa70a90..606bf04f51b 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -80,6 +80,7 @@ config MACH_OVERO
80config MACH_OMAP3EVM 80config MACH_OMAP3EVM
81 bool "OMAP 3530 EVM board" 81 bool "OMAP 3530 EVM board"
82 depends on ARCH_OMAP3 && ARCH_OMAP34XX 82 depends on ARCH_OMAP3 && ARCH_OMAP34XX
83 select OMAP_PACKAGE_CBB
83 84
84config MACH_OMAP3517EVM 85config MACH_OMAP3517EVM
85 bool "OMAP3517/ AM3517 EVM board" 86 bool "OMAP3517/ AM3517 EVM board"
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index 8dd277c3666..1e3dfb652ac 100755
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -63,21 +63,21 @@ static int board_keymap[] = {
63 KEY(5, 1, KEY_H), 63 KEY(5, 1, KEY_H),
64 KEY(5, 2, KEY_J), 64 KEY(5, 2, KEY_J),
65 KEY(5, 3, KEY_F3), 65 KEY(5, 3, KEY_F3),
66 KEY(5, 4, KEY_UNKNOWN),
66 KEY(5, 5, KEY_VOLUMEDOWN), 67 KEY(5, 5, KEY_VOLUMEDOWN),
67 KEY(5, 6, KEY_M), 68 KEY(5, 6, KEY_M),
68 KEY(5, 7, KEY_ENTER), 69 KEY(5, 7, KEY_RIGHT),
69 KEY(6, 0, KEY_Q), 70 KEY(6, 0, KEY_Q),
70 KEY(6, 1, KEY_A), 71 KEY(6, 1, KEY_A),
71 KEY(6, 2, KEY_N), 72 KEY(6, 2, KEY_N),
72 KEY(6, 3, KEY_BACKSPACE), 73 KEY(6, 3, KEY_BACKSPACE),
73 KEY(6, 6, KEY_P), 74 KEY(6, 6, KEY_P),
74 KEY(6, 7, KEY_SELECT), 75 KEY(6, 7, KEY_UP),
75 KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */ 76 KEY(7, 0, KEY_PROG1), /*MACRO 1 <User defined> */
76 KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */ 77 KEY(7, 1, KEY_PROG2), /*MACRO 2 <User defined> */
77 KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */ 78 KEY(7, 2, KEY_PROG3), /*MACRO 3 <User defined> */
78 KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */ 79 KEY(7, 3, KEY_PROG4), /*MACRO 4 <User defined> */
79 KEY(7, 5, KEY_RIGHT), 80 KEY(7, 6, KEY_SELECT),
80 KEY(7, 6, KEY_UP),
81 KEY(7, 7, KEY_DOWN) 81 KEY(7, 7, KEY_DOWN)
82}; 82};
83 83
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c
index d0e3fb7f929..5420356eb40 100644
--- a/arch/arm/mach-omap2/clock2xxx.c
+++ b/arch/arm/mach-omap2/clock2xxx.c
@@ -449,40 +449,78 @@ int omap2_select_table_rate(struct clk *clk, unsigned long rate)
449#ifdef CONFIG_CPU_FREQ 449#ifdef CONFIG_CPU_FREQ
450/* 450/*
451 * Walk PRCM rate table and fillout cpufreq freq_table 451 * Walk PRCM rate table and fillout cpufreq freq_table
452 * XXX This should be replaced by an OPP layer in the near future
452 */ 453 */
453static struct cpufreq_frequency_table freq_table[ARRAY_SIZE(rate_table)]; 454static struct cpufreq_frequency_table *freq_table;
454 455
455void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table) 456void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
456{ 457{
457 struct prcm_config *prcm; 458 const struct prcm_config *prcm;
459 long sys_ck_rate;
458 int i = 0; 460 int i = 0;
461 int tbl_sz = 0;
462
463 sys_ck_rate = clk_get_rate(sclk);
459 464
460 for (prcm = rate_table; prcm->mpu_speed; prcm++) { 465 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
461 if (!(prcm->flags & cpu_mask)) 466 if (!(prcm->flags & cpu_mask))
462 continue; 467 continue;
463 if (prcm->xtal_speed != sys_ck.rate) 468 if (prcm->xtal_speed != sys_ck_rate)
464 continue; 469 continue;
465 470
466 /* don't put bypass rates in table */ 471 /* don't put bypass rates in table */
467 if (prcm->dpll_speed == prcm->xtal_speed) 472 if (prcm->dpll_speed == prcm->xtal_speed)
468 continue; 473 continue;
469 474
470 freq_table[i].index = i; 475 tbl_sz++;
471 freq_table[i].frequency = prcm->mpu_speed / 1000;
472 i++;
473 } 476 }
474 477
475 if (i == 0) { 478 /*
476 printk(KERN_WARNING "%s: failed to initialize frequency " 479 * XXX Ensure that we're doing what CPUFreq expects for this error
477 "table\n", __func__); 480 * case and the following one
481 */
482 if (tbl_sz == 0) {
483 pr_warning("%s: no matching entries in rate_table\n",
484 __func__);
485 return;
486 }
487
488 /* Include the CPUFREQ_TABLE_END terminator entry */
489 tbl_sz++;
490
491 freq_table = kzalloc(sizeof(struct cpufreq_frequency_table) * tbl_sz,
492 GFP_ATOMIC);
493 if (!freq_table) {
494 pr_err("%s: could not kzalloc frequency table\n", __func__);
478 return; 495 return;
479 } 496 }
480 497
498 for (prcm = rate_table; prcm->mpu_speed; prcm++) {
499 if (!(prcm->flags & cpu_mask))
500 continue;
501 if (prcm->xtal_speed != sys_ck_rate)
502 continue;
503
504 /* don't put bypass rates in table */
505 if (prcm->dpll_speed == prcm->xtal_speed)
506 continue;
507
508 freq_table[i].index = i;
509 freq_table[i].frequency = prcm->mpu_speed / 1000;
510 i++;
511 }
512
481 freq_table[i].index = i; 513 freq_table[i].index = i;
482 freq_table[i].frequency = CPUFREQ_TABLE_END; 514 freq_table[i].frequency = CPUFREQ_TABLE_END;
483 515
484 *table = &freq_table[0]; 516 *table = &freq_table[0];
485} 517}
518
519void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
520{
521 kfree(freq_table);
522}
523
486#endif 524#endif
487 525
488struct clk_functions omap2_clk_functions = { 526struct clk_functions omap2_clk_functions = {
@@ -494,6 +532,7 @@ struct clk_functions omap2_clk_functions = {
494 .clk_disable_unused = omap2_clk_disable_unused, 532 .clk_disable_unused = omap2_clk_disable_unused,
495#ifdef CONFIG_CPU_FREQ 533#ifdef CONFIG_CPU_FREQ
496 .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table, 534 .clk_init_cpufreq_table = omap2_clk_init_cpufreq_table,
535 .clk_exit_cpufreq_table = omap2_clk_exit_cpufreq_table,
497#endif 536#endif
498}; 537};
499 538
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index ded32364f32..d4217b93e10 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -34,7 +34,6 @@
34#include <asm/div64.h> 34#include <asm/div64.h>
35#include <asm/clkdev.h> 35#include <asm/clkdev.h>
36 36
37#include <plat/sdrc.h>
38#include "clock.h" 37#include "clock.h"
39#include "clock34xx.h" 38#include "clock34xx.h"
40#include "sdrc.h" 39#include "sdrc.h"
diff --git a/arch/arm/mach-omap2/clock34xx_data.c b/arch/arm/mach-omap2/clock34xx_data.c
index 8bdcc9cc7f9..c6031d74d6f 100644
--- a/arch/arm/mach-omap2/clock34xx_data.c
+++ b/arch/arm/mach-omap2/clock34xx_data.c
@@ -776,6 +776,8 @@ static struct clk dpll4_m5_ck = {
776 .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, 776 .clksel_mask = OMAP3430_CLKSEL_CAM_MASK,
777 .clksel = div16_dpll4_clksel, 777 .clksel = div16_dpll4_clksel,
778 .clkdm_name = "dpll4_clkdm", 778 .clkdm_name = "dpll4_clkdm",
779 .set_rate = &omap2_clksel_set_rate,
780 .round_rate = &omap2_clksel_round_rate,
779 .recalc = &omap2_clksel_recalc, 781 .recalc = &omap2_clksel_recalc,
780}; 782};
781 783
@@ -1500,6 +1502,7 @@ static struct clk uart2_fck = {
1500 .parent = &core_48m_fck, 1502 .parent = &core_48m_fck,
1501 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1503 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1502 .enable_bit = OMAP3430_EN_UART2_SHIFT, 1504 .enable_bit = OMAP3430_EN_UART2_SHIFT,
1505 .clkdm_name = "core_l4_clkdm",
1503 .recalc = &followparent_recalc, 1506 .recalc = &followparent_recalc,
1504}; 1507};
1505 1508
@@ -1509,6 +1512,7 @@ static struct clk uart1_fck = {
1509 .parent = &core_48m_fck, 1512 .parent = &core_48m_fck,
1510 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), 1513 .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1),
1511 .enable_bit = OMAP3430_EN_UART1_SHIFT, 1514 .enable_bit = OMAP3430_EN_UART1_SHIFT,
1515 .clkdm_name = "core_l4_clkdm",
1512 .recalc = &followparent_recalc, 1516 .recalc = &followparent_recalc,
1513}; 1517};
1514 1518
@@ -2745,7 +2749,7 @@ static struct clk mcbsp4_ick = {
2745}; 2749};
2746 2750
2747static const struct clksel mcbsp_234_clksel[] = { 2751static const struct clksel mcbsp_234_clksel[] = {
2748 { .parent = &core_96m_fck, .rates = common_mcbsp_96m_rates }, 2752 { .parent = &per_96m_fck, .rates = common_mcbsp_96m_rates },
2749 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, 2753 { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates },
2750 { .parent = NULL } 2754 { .parent = NULL }
2751}; 2755};
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 1a45ed1e8ba..dd285f00146 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -559,7 +559,7 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
559 * downstream clocks for debugging purposes? 559 * downstream clocks for debugging purposes?
560 */ 560 */
561 561
562 if (!clkdm || !clk) 562 if (!clkdm || !clk || !clkdm->clktrctrl_mask)
563 return -EINVAL; 563 return -EINVAL;
564 564
565 if (atomic_inc_return(&clkdm->usecount) > 1) 565 if (atomic_inc_return(&clkdm->usecount) > 1)
@@ -610,7 +610,7 @@ int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
610 * downstream clocks for debugging purposes? 610 * downstream clocks for debugging purposes?
611 */ 611 */
612 612
613 if (!clkdm || !clk) 613 if (!clkdm || !clk || !clkdm->clktrctrl_mask)
614 return -EINVAL; 614 return -EINVAL;
615 615
616#ifdef DEBUG 616#ifdef DEBUG
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index a8749e8017b..5a7996402c5 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -33,7 +33,6 @@
33#include <plat/sdrc.h> 33#include <plat/sdrc.h>
34#include <plat/gpmc.h> 34#include <plat/gpmc.h>
35#include <plat/serial.h> 35#include <plat/serial.h>
36#include <plat/mux.h>
37#include <plat/vram.h> 36#include <plat/vram.h>
38 37
39#include "clock.h" 38#include "clock.h"
@@ -73,21 +72,21 @@ static struct map_desc omap24xx_io_desc[] __initdata = {
73#ifdef CONFIG_ARCH_OMAP2420 72#ifdef CONFIG_ARCH_OMAP2420
74static struct map_desc omap242x_io_desc[] __initdata = { 73static struct map_desc omap242x_io_desc[] __initdata = {
75 { 74 {
76 .virtual = DSP_MEM_24XX_VIRT, 75 .virtual = DSP_MEM_2420_VIRT,
77 .pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS), 76 .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS),
78 .length = DSP_MEM_24XX_SIZE, 77 .length = DSP_MEM_2420_SIZE,
79 .type = MT_DEVICE 78 .type = MT_DEVICE
80 }, 79 },
81 { 80 {
82 .virtual = DSP_IPI_24XX_VIRT, 81 .virtual = DSP_IPI_2420_VIRT,
83 .pfn = __phys_to_pfn(DSP_IPI_24XX_PHYS), 82 .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS),
84 .length = DSP_IPI_24XX_SIZE, 83 .length = DSP_IPI_2420_SIZE,
85 .type = MT_DEVICE 84 .type = MT_DEVICE
86 }, 85 },
87 { 86 {
88 .virtual = DSP_MMU_24XX_VIRT, 87 .virtual = DSP_MMU_2420_VIRT,
89 .pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS), 88 .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS),
90 .length = DSP_MMU_24XX_SIZE, 89 .length = DSP_MMU_2420_SIZE,
91 .type = MT_DEVICE 90 .type = MT_DEVICE
92 }, 91 },
93}; 92};
diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index e071b3fd187..459ef23ab8a 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
@@ -994,8 +994,10 @@ int __init omap_mux_init(u32 mux_pbase, u32 mux_size,
994 } 994 }
995 995
996#ifdef CONFIG_OMAP_MUX 996#ifdef CONFIG_OMAP_MUX
997 omap_mux_package_fixup(package_subset, superset); 997 if (package_subset)
998 omap_mux_package_init_balls(package_balls, superset); 998 omap_mux_package_fixup(package_subset, superset);
999 if (package_balls)
1000 omap_mux_package_init_balls(package_balls, superset);
999 omap_mux_set_cmdline_signals(); 1001 omap_mux_set_cmdline_signals();
1000 omap_mux_set_board_signals(board_mux); 1002 omap_mux_set_board_signals(board_mux);
1001#endif 1003#endif
diff --git a/arch/arm/mach-omap2/opp2420_data.c b/arch/arm/mach-omap2/opp2420_data.c
index 126a9396b3a..e6dda694fd5 100644
--- a/arch/arm/mach-omap2/opp2420_data.c
+++ b/arch/arm/mach-omap2/opp2420_data.c
@@ -9,45 +9,47 @@
9 * The OMAP2 processor can be run at several discrete 'PRCM configurations'. 9 * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
10 * These configurations are characterized by voltage and speed for clocks. 10 * These configurations are characterized by voltage and speed for clocks.
11 * The device is only validated for certain combinations. One way to express 11 * The device is only validated for certain combinations. One way to express
12 * these combinations is via the 'ratio's' which the clocks operate with 12 * these combinations is via the 'ratios' which the clocks operate with
13 * respect to each other. These ratio sets are for a given voltage/DPLL 13 * respect to each other. These ratio sets are for a given voltage/DPLL
14 * setting. All configurations can be described by a DPLL setting and a ratio 14 * setting. All configurations can be described by a DPLL setting and a ratio.
15 * There are 3 ratio sets for the 2430 and X ratio sets for 2420.
16 *
17 * 2430 differs from 2420 in that there are no more phase synchronizers used.
18 * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
19 * 2430 (iva2.1, NOdsp, mdm)
20 * 15 *
21 * XXX Missing voltage data. 16 * XXX Missing voltage data.
17 * XXX Missing 19.2MHz sys_clk rate sets (needed for N800/N810)
22 * 18 *
23 * THe format described in this file is deprecated. Once a reasonable 19 * THe format described in this file is deprecated. Once a reasonable
24 * OPP API exists, the data in this file should be converted to use it. 20 * OPP API exists, the data in this file should be converted to use it.
25 * 21 *
26 * This is technically part of the OMAP2xxx clock code. 22 * This is technically part of the OMAP2xxx clock code.
23 *
24 * Considerable work is still needed to fully support dynamic frequency
25 * changes on OMAP2xxx-series chips. Readers interested in such a
26 * project are encouraged to review the Maemo Diablo RX-34 and RX-44
27 * kernel source at:
28 * http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/
27 */ 29 */
28 30
29#include "opp2xxx.h" 31#include "opp2xxx.h"
30#include "sdrc.h" 32#include "sdrc.h"
31#include "clock.h" 33#include "clock.h"
32 34
33/*------------------------------------------------------------------------- 35/*
34 * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 36 * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated.
35 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, 37 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
36 * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, 38 * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
37 * CM_CLKSEL2_PLL, CM_CLKSEL_MDM 39 * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
38 * 40 *
39 * Filling in table based on H4 boards and 2430-SDPs variants available. 41 * Filling in table based on H4 boards available. There are quite a
40 * There are quite a few more rates combinations which could be defined. 42 * few more rate combinations which could be defined.
41 * 43 *
42 * When multiple values are defined the start up will try and choose the 44 * When multiple values are defined the start up will try and choose
43 * fastest one. If a 'fast' value is defined, then automatically, the /2 45 * the fastest one. If a 'fast' value is defined, then automatically,
44 * one should be included as it can be used. Generally having more that 46 * the /2 one should be included as it can be used. Generally having
45 * one fast set does not make sense, as static timings need to be changed 47 * more than one fast set does not make sense, as static timings need
46 * to change the set. The exception is the bypass setting which is 48 * to be changed to change the set. The exception is the bypass
47 * availble for low power bypass. 49 * setting which is available for low power bypass.
48 * 50 *
49 * Note: This table needs to be sorted, fastest to slowest. 51 * Note: This table needs to be sorted, fastest to slowest.
50 *-------------------------------------------------------------------------*/ 52 **/
51const struct prcm_config omap2420_rate_table[] = { 53const struct prcm_config omap2420_rate_table[] = {
52 /* PRCM I - FAST */ 54 /* PRCM I - FAST */
53 {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */ 55 {S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL, /* 330MHz ARM */
diff --git a/arch/arm/mach-omap2/opp2430_data.c b/arch/arm/mach-omap2/opp2430_data.c
index edb81672c84..1b9596ae201 100644
--- a/arch/arm/mach-omap2/opp2430_data.c
+++ b/arch/arm/mach-omap2/opp2430_data.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * opp2420_data.c - old-style "OPP" table for OMAP2420 2 * opp2430_data.c - old-style "OPP" table for OMAP2430
3 * 3 *
4 * Copyright (C) 2005-2009 Texas Instruments, Inc. 4 * Copyright (C) 2005-2009 Texas Instruments, Inc.
5 * Copyright (C) 2004-2009 Nokia Corporation 5 * Copyright (C) 2004-2009 Nokia Corporation
@@ -9,16 +9,16 @@
9 * The OMAP2 processor can be run at several discrete 'PRCM configurations'. 9 * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
10 * These configurations are characterized by voltage and speed for clocks. 10 * These configurations are characterized by voltage and speed for clocks.
11 * The device is only validated for certain combinations. One way to express 11 * The device is only validated for certain combinations. One way to express
12 * these combinations is via the 'ratio's' which the clocks operate with 12 * these combinations is via the 'ratios' which the clocks operate with
13 * respect to each other. These ratio sets are for a given voltage/DPLL 13 * respect to each other. These ratio sets are for a given voltage/DPLL
14 * setting. All configurations can be described by a DPLL setting and a ratio 14 * setting. All configurations can be described by a DPLL setting and a ratio.
15 * There are 3 ratio sets for the 2430 and X ratio sets for 2420.
16 * 15 *
17 * 2430 differs from 2420 in that there are no more phase synchronizers used. 16 * 2430 differs from 2420 in that there are no more phase synchronizers used.
18 * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs 17 * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
19 * 2430 (iva2.1, NOdsp, mdm) 18 * 2430 (iva2.1, NOdsp, mdm)
20 * 19 *
21 * XXX Missing voltage data. 20 * XXX Missing voltage data.
21 * XXX Missing 19.2MHz sys_clk rate sets.
22 * 22 *
23 * THe format described in this file is deprecated. Once a reasonable 23 * THe format described in this file is deprecated. Once a reasonable
24 * OPP API exists, the data in this file should be converted to use it. 24 * OPP API exists, the data in this file should be converted to use it.
@@ -30,24 +30,24 @@
30#include "sdrc.h" 30#include "sdrc.h"
31#include "clock.h" 31#include "clock.h"
32 32
33/*------------------------------------------------------------------------- 33/*
34 * Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. 34 * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated.
35 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU, 35 * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
36 * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL, 36 * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
37 * CM_CLKSEL2_PLL, CM_CLKSEL_MDM 37 * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
38 * 38 *
39 * Filling in table based on H4 boards and 2430-SDPs variants available. 39 * Filling in table based on 2430-SDPs variants available. There are
40 * There are quite a few more rates combinations which could be defined. 40 * quite a few more rate combinations which could be defined.
41 * 41 *
42 * When multiple values are defined the start up will try and choose the 42 * When multiple values are defined the start up will try and choose
43 * fastest one. If a 'fast' value is defined, then automatically, the /2 43 * the fastest one. If a 'fast' value is defined, then automatically,
44 * one should be included as it can be used. Generally having more that 44 * the /2 one should be included as it can be used. Generally having
45 * one fast set does not make sense, as static timings need to be changed 45 * more than one fast set does not make sense, as static timings need
46 * to change the set. The exception is the bypass setting which is 46 * to be changed to change the set. The exception is the bypass
47 * availble for low power bypass. 47 * setting which is available for low power bypass.
48 * 48 *
49 * Note: This table needs to be sorted, fastest to slowest. 49 * Note: This table needs to be sorted, fastest to slowest.
50 *-------------------------------------------------------------------------*/ 50 */
51const struct prcm_config omap2430_rate_table[] = { 51const struct prcm_config omap2430_rate_table[] = {
52 /* PRCM #4 - ratio2 (ES2.1) - FAST */ 52 /* PRCM #4 - ratio2 (ES2.1) - FAST */
53 {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* 399MHz ARM */ 53 {S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* 399MHz ARM */
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 81ed252a0f8..c6cc809afb7 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -124,8 +124,8 @@ static void omap3_core_save_context(void)
124 control_padconf_off |= START_PADCONF_SAVE; 124 control_padconf_off |= START_PADCONF_SAVE;
125 omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF); 125 omap_ctrl_writel(control_padconf_off, OMAP343X_CONTROL_PADCONF_OFF);
126 /* wait for the save to complete */ 126 /* wait for the save to complete */
127 while (!omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS) 127 while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
128 & PADCONF_SAVE_DONE) 128 & PADCONF_SAVE_DONE))
129 ; 129 ;
130 /* Save the Interrupt controller context */ 130 /* Save the Interrupt controller context */
131 omap_intc_save_context(); 131 omap_intc_save_context();
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 19805a7de06..8c964bec815 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -125,6 +125,13 @@ static struct plat_serial8250_port serial_platform_data3[] = {
125 } 125 }
126}; 126};
127#endif 127#endif
128static inline unsigned int __serial_read_reg(struct uart_port *up,
129 int offset)
130{
131 offset <<= up->regshift;
132 return (unsigned int)__raw_readb(up->membase + offset);
133}
134
128static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, 135static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
129 int offset) 136 int offset)
130{ 137{
@@ -583,11 +590,12 @@ static unsigned int serial_in_override(struct uart_port *up, int offset)
583{ 590{
584 if (UART_RX == offset) { 591 if (UART_RX == offset) {
585 unsigned int lsr; 592 unsigned int lsr;
586 lsr = serial_read_reg(omap_uart[up->line].p, UART_LSR); 593 lsr = __serial_read_reg(up, UART_LSR);
587 if (!(lsr & UART_LSR_DR)) 594 if (!(lsr & UART_LSR_DR))
588 return -EPERM; 595 return -EPERM;
589 } 596 }
590 return serial_read_reg(omap_uart[up->line].p, offset); 597
598 return __serial_read_reg(up, offset);
591} 599}
592 600
593void __init omap_serial_early_init(void) 601void __init omap_serial_early_init(void)
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 89cafc93724..d9f8c844c38 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -36,10 +36,6 @@ static struct clk_functions *arch_clock;
36 * Standard clock functions defined in include/linux/clk.h 36 * Standard clock functions defined in include/linux/clk.h
37 *-------------------------------------------------------------------------*/ 37 *-------------------------------------------------------------------------*/
38 38
39/* This functions is moved to arch/arm/common/clkdev.c. For OMAP4 since
40 * clock framework is not up , it is defined here to avoid rework in
41 * every driver. Also dummy prcm reset function is added */
42
43int clk_enable(struct clk *clk) 39int clk_enable(struct clk *clk)
44{ 40{
45 unsigned long flags; 41 unsigned long flags;
@@ -305,7 +301,6 @@ void clk_enable_init_clocks(void)
305 clk_enable(clkp); 301 clk_enable(clkp);
306 } 302 }
307} 303}
308EXPORT_SYMBOL(clk_enable_init_clocks);
309 304
310/* 305/*
311 * Low level helpers 306 * Low level helpers
@@ -334,7 +329,16 @@ void clk_init_cpufreq_table(struct cpufreq_frequency_table **table)
334 arch_clock->clk_init_cpufreq_table(table); 329 arch_clock->clk_init_cpufreq_table(table);
335 spin_unlock_irqrestore(&clockfw_lock, flags); 330 spin_unlock_irqrestore(&clockfw_lock, flags);
336} 331}
337EXPORT_SYMBOL(clk_init_cpufreq_table); 332
333void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
334{
335 unsigned long flags;
336
337 spin_lock_irqsave(&clockfw_lock, flags);
338 if (arch_clock->clk_exit_cpufreq_table)
339 arch_clock->clk_exit_cpufreq_table(table);
340 spin_unlock_irqrestore(&clockfw_lock, flags);
341}
338#endif 342#endif
339 343
340/*-------------------------------------------------------------------------*/ 344/*-------------------------------------------------------------------------*/
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index f8ddbdd8b07..6d3d3336005 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -134,6 +134,7 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy)
134 134
135static int omap_cpu_exit(struct cpufreq_policy *policy) 135static int omap_cpu_exit(struct cpufreq_policy *policy)
136{ 136{
137 clk_exit_cpufreq_table(&freq_table);
137 clk_put(mpu_clk); 138 clk_put(mpu_clk);
138 return 0; 139 return 0;
139} 140}
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 04846811d0a..d17620c50c2 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -192,6 +192,7 @@ struct gpio_bank {
192 u32 saved_risingdetect; 192 u32 saved_risingdetect;
193#endif 193#endif
194 u32 level_mask; 194 u32 level_mask;
195 u32 toggle_mask;
195 spinlock_t lock; 196 spinlock_t lock;
196 struct gpio_chip chip; 197 struct gpio_chip chip;
197 struct clk *dbck; 198 struct clk *dbck;
@@ -749,6 +750,44 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
749} 750}
750#endif 751#endif
751 752
753/*
754 * This only applies to chips that can't do both rising and falling edge
755 * detection at once. For all other chips, this function is a noop.
756 */
757static void _toggle_gpio_edge_triggering(struct gpio_bank *bank, int gpio)
758{
759 void __iomem *reg = bank->base;
760 u32 l = 0;
761
762 switch (bank->method) {
763#ifdef CONFIG_ARCH_OMAP1
764 case METHOD_MPUIO:
765 reg += OMAP_MPUIO_GPIO_INT_EDGE;
766 break;
767#endif
768#ifdef CONFIG_ARCH_OMAP15XX
769 case METHOD_GPIO_1510:
770 reg += OMAP1510_GPIO_INT_CONTROL;
771 break;
772#endif
773#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
774 case METHOD_GPIO_7XX:
775 reg += OMAP7XX_GPIO_INT_CONTROL;
776 break;
777#endif
778 default:
779 return;
780 }
781
782 l = __raw_readl(reg);
783 if ((l >> gpio) & 1)
784 l &= ~(1 << gpio);
785 else
786 l |= 1 << gpio;
787
788 __raw_writel(l, reg);
789}
790
752static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger) 791static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
753{ 792{
754 void __iomem *reg = bank->base; 793 void __iomem *reg = bank->base;
@@ -759,6 +798,8 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
759 case METHOD_MPUIO: 798 case METHOD_MPUIO:
760 reg += OMAP_MPUIO_GPIO_INT_EDGE; 799 reg += OMAP_MPUIO_GPIO_INT_EDGE;
761 l = __raw_readl(reg); 800 l = __raw_readl(reg);
801 if (trigger & IRQ_TYPE_EDGE_BOTH)
802 bank->toggle_mask |= 1 << gpio;
762 if (trigger & IRQ_TYPE_EDGE_RISING) 803 if (trigger & IRQ_TYPE_EDGE_RISING)
763 l |= 1 << gpio; 804 l |= 1 << gpio;
764 else if (trigger & IRQ_TYPE_EDGE_FALLING) 805 else if (trigger & IRQ_TYPE_EDGE_FALLING)
@@ -771,6 +812,8 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
771 case METHOD_GPIO_1510: 812 case METHOD_GPIO_1510:
772 reg += OMAP1510_GPIO_INT_CONTROL; 813 reg += OMAP1510_GPIO_INT_CONTROL;
773 l = __raw_readl(reg); 814 l = __raw_readl(reg);
815 if (trigger & IRQ_TYPE_EDGE_BOTH)
816 bank->toggle_mask |= 1 << gpio;
774 if (trigger & IRQ_TYPE_EDGE_RISING) 817 if (trigger & IRQ_TYPE_EDGE_RISING)
775 l |= 1 << gpio; 818 l |= 1 << gpio;
776 else if (trigger & IRQ_TYPE_EDGE_FALLING) 819 else if (trigger & IRQ_TYPE_EDGE_FALLING)
@@ -803,6 +846,8 @@ static int _set_gpio_triggering(struct gpio_bank *bank, int gpio, int trigger)
803 case METHOD_GPIO_7XX: 846 case METHOD_GPIO_7XX:
804 reg += OMAP7XX_GPIO_INT_CONTROL; 847 reg += OMAP7XX_GPIO_INT_CONTROL;
805 l = __raw_readl(reg); 848 l = __raw_readl(reg);
849 if (trigger & IRQ_TYPE_EDGE_BOTH)
850 bank->toggle_mask |= 1 << gpio;
806 if (trigger & IRQ_TYPE_EDGE_RISING) 851 if (trigger & IRQ_TYPE_EDGE_RISING)
807 l |= 1 << gpio; 852 l |= 1 << gpio;
808 else if (trigger & IRQ_TYPE_EDGE_FALLING) 853 else if (trigger & IRQ_TYPE_EDGE_FALLING)
@@ -1072,7 +1117,7 @@ static inline void _set_gpio_irqenable(struct gpio_bank *bank, int gpio, int ena
1072 */ 1117 */
1073static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable) 1118static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
1074{ 1119{
1075 unsigned long flags; 1120 unsigned long uninitialized_var(flags);
1076 1121
1077 switch (bank->method) { 1122 switch (bank->method) {
1078#ifdef CONFIG_ARCH_OMAP16XX 1123#ifdef CONFIG_ARCH_OMAP16XX
@@ -1217,7 +1262,7 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1217{ 1262{
1218 void __iomem *isr_reg = NULL; 1263 void __iomem *isr_reg = NULL;
1219 u32 isr; 1264 u32 isr;
1220 unsigned int gpio_irq; 1265 unsigned int gpio_irq, gpio_index;
1221 struct gpio_bank *bank; 1266 struct gpio_bank *bank;
1222 u32 retrigger = 0; 1267 u32 retrigger = 0;
1223 int unmasked = 0; 1268 int unmasked = 0;
@@ -1284,9 +1329,23 @@ static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
1284 1329
1285 gpio_irq = bank->virtual_irq_start; 1330 gpio_irq = bank->virtual_irq_start;
1286 for (; isr != 0; isr >>= 1, gpio_irq++) { 1331 for (; isr != 0; isr >>= 1, gpio_irq++) {
1332 gpio_index = get_gpio_index(irq_to_gpio(gpio_irq));
1333
1287 if (!(isr & 1)) 1334 if (!(isr & 1))
1288 continue; 1335 continue;
1289 1336
1337#ifdef CONFIG_ARCH_OMAP1
1338 /*
1339 * Some chips can't respond to both rising and falling
1340 * at the same time. If this irq was requested with
1341 * both flags, we need to flip the ICR data for the IRQ
1342 * to respond to the IRQ for the opposite direction.
1343 * This will be indicated in the bank toggle_mask.
1344 */
1345 if (bank->toggle_mask & (1 << gpio_index))
1346 _toggle_gpio_edge_triggering(bank, gpio_index);
1347#endif
1348
1290 generic_handle_irq(gpio_irq); 1349 generic_handle_irq(gpio_irq);
1291 } 1350 }
1292 } 1351 }
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index 376ce18216f..5cd622039da 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -99,7 +99,6 @@ struct fb_info;
99struct omap_backlight_config { 99struct omap_backlight_config {
100 int default_intensity; 100 int default_intensity;
101 int (*set_power)(struct device *dev, int state); 101 int (*set_power)(struct device *dev, int state);
102 int (*check_fb)(struct fb_info *fb);
103}; 102};
104 103
105struct omap_fbmem_config { 104struct omap_fbmem_config {
diff --git a/arch/arm/plat-omap/include/plat/clock.h b/arch/arm/plat-omap/include/plat/clock.h
index 309b6d1dccd..94fe2a0ce40 100644
--- a/arch/arm/plat-omap/include/plat/clock.h
+++ b/arch/arm/plat-omap/include/plat/clock.h
@@ -119,6 +119,7 @@ struct clk_functions {
119 void (*clk_disable_unused)(struct clk *clk); 119 void (*clk_disable_unused)(struct clk *clk);
120#ifdef CONFIG_CPU_FREQ 120#ifdef CONFIG_CPU_FREQ
121 void (*clk_init_cpufreq_table)(struct cpufreq_frequency_table **); 121 void (*clk_init_cpufreq_table)(struct cpufreq_frequency_table **);
122 void (*clk_exit_cpufreq_table)(struct cpufreq_frequency_table **);
122#endif 123#endif
123}; 124};
124 125
@@ -135,6 +136,7 @@ extern unsigned long followparent_recalc(struct clk *clk);
135extern void clk_enable_init_clocks(void); 136extern void clk_enable_init_clocks(void);
136#ifdef CONFIG_CPU_FREQ 137#ifdef CONFIG_CPU_FREQ
137extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); 138extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
139extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
138#endif 140#endif
139 141
140extern const struct clkops clkops_null; 142extern const struct clkops clkops_null;
diff --git a/arch/arm/plat-omap/include/plat/control.h b/arch/arm/plat-omap/include/plat/control.h
index 2ae88437863..a745d62fad0 100644
--- a/arch/arm/plat-omap/include/plat/control.h
+++ b/arch/arm/plat-omap/include/plat/control.h
@@ -147,7 +147,7 @@
147#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190) 147#define OMAP343X_CONTROL_IVA2_BOOTADDR (OMAP2_CONTROL_GENERAL + 0x0190)
148#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194) 148#define OMAP343X_CONTROL_IVA2_BOOTMOD (OMAP2_CONTROL_GENERAL + 0x0194)
149#define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \ 149#define OMAP343X_CONTROL_DEBOBS(i) (OMAP2_CONTROL_GENERAL + 0x01B0 \
150 + ((i) >> 1) * 4 + (!(i) & 1) * 2) 150 + ((i) >> 1) * 4 + (!((i) & 1)) * 2)
151#define OMAP343X_CONTROL_PROG_IO0 (OMAP2_CONTROL_GENERAL + 0x01D4) 151#define OMAP343X_CONTROL_PROG_IO0 (OMAP2_CONTROL_GENERAL + 0x01D4)
152#define OMAP343X_CONTROL_PROG_IO1 (OMAP2_CONTROL_GENERAL + 0x01D8) 152#define OMAP343X_CONTROL_PROG_IO1 (OMAP2_CONTROL_GENERAL + 0x01D8)
153#define OMAP343X_CONTROL_DSS_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E0) 153#define OMAP343X_CONTROL_DSS_DPLL_SPREADING (OMAP2_CONTROL_GENERAL + 0x01E0)
diff --git a/arch/arm/plat-omap/include/plat/io.h b/arch/arm/plat-omap/include/plat/io.h
index 7e5319f907d..a3e7b471bcb 100644
--- a/arch/arm/plat-omap/include/plat/io.h
+++ b/arch/arm/plat-omap/include/plat/io.h
@@ -122,16 +122,21 @@
122#define OMAP243X_SMS_VIRT (OMAP243X_SMS_PHYS + OMAP2_L3_IO_OFFSET) 122#define OMAP243X_SMS_VIRT (OMAP243X_SMS_PHYS + OMAP2_L3_IO_OFFSET)
123#define OMAP243X_SMS_SIZE SZ_1M 123#define OMAP243X_SMS_SIZE SZ_1M
124 124
125/* DSP */ 125/* 2420 IVA */
126#define DSP_MEM_24XX_PHYS OMAP2420_DSP_MEM_BASE /* 0x58000000 */ 126#define DSP_MEM_2420_PHYS OMAP2420_DSP_MEM_BASE
127#define DSP_MEM_24XX_VIRT 0xe0000000 127 /* 0x58000000 --> 0xfc100000 */
128#define DSP_MEM_24XX_SIZE 0x28000 128#define DSP_MEM_2420_VIRT 0xfc100000
129#define DSP_IPI_24XX_PHYS OMAP2420_DSP_IPI_BASE /* 0x59000000 */ 129#define DSP_MEM_2420_SIZE 0x28000
130#define DSP_IPI_24XX_VIRT 0xe1000000 130#define DSP_IPI_2420_PHYS OMAP2420_DSP_IPI_BASE
131#define DSP_IPI_24XX_SIZE SZ_4K 131 /* 0x59000000 --> 0xfc128000 */
132#define DSP_MMU_24XX_PHYS OMAP2420_DSP_MMU_BASE /* 0x5a000000 */ 132#define DSP_IPI_2420_VIRT 0xfc128000
133#define DSP_MMU_24XX_VIRT 0xe2000000 133#define DSP_IPI_2420_SIZE SZ_4K
134#define DSP_MMU_24XX_SIZE SZ_4K 134#define DSP_MMU_2420_PHYS OMAP2420_DSP_MMU_BASE
135 /* 0x5a000000 --> 0xfc129000 */
136#define DSP_MMU_2420_VIRT 0xfc129000
137#define DSP_MMU_2420_SIZE SZ_4K
138
139/* 2430 IVA2.1 - currently unmapped */
135 140
136/* 141/*
137 * ---------------------------------------------------------------------------- 142 * ----------------------------------------------------------------------------
@@ -182,16 +187,7 @@
182#define OMAP343X_SDRC_VIRT (OMAP343X_SDRC_PHYS + OMAP2_L3_IO_OFFSET) 187#define OMAP343X_SDRC_VIRT (OMAP343X_SDRC_PHYS + OMAP2_L3_IO_OFFSET)
183#define OMAP343X_SDRC_SIZE SZ_1M 188#define OMAP343X_SDRC_SIZE SZ_1M
184 189
185/* DSP */ 190/* 3430 IVA - currently unmapped */
186#define DSP_MEM_34XX_PHYS OMAP34XX_DSP_MEM_BASE /* 0x58000000 */
187#define DSP_MEM_34XX_VIRT 0xe0000000
188#define DSP_MEM_34XX_SIZE 0x28000
189#define DSP_IPI_34XX_PHYS OMAP34XX_DSP_IPI_BASE /* 0x59000000 */
190#define DSP_IPI_34XX_VIRT 0xe1000000
191#define DSP_IPI_34XX_SIZE SZ_4K
192#define DSP_MMU_34XX_PHYS OMAP34XX_DSP_MMU_BASE /* 0x5a000000 */
193#define DSP_MMU_34XX_VIRT 0xe2000000
194#define DSP_MMU_34XX_SIZE SZ_4K
195 191
196/* 192/*
197 * ---------------------------------------------------------------------------- 193 * ----------------------------------------------------------------------------
diff --git a/arch/arm/plat-omap/include/plat/mux.h b/arch/arm/plat-omap/include/plat/mux.h
index 8f069cc8035..692c90e89ac 100644
--- a/arch/arm/plat-omap/include/plat/mux.h
+++ b/arch/arm/plat-omap/include/plat/mux.h
@@ -183,6 +183,14 @@ enum omap7xx_index {
183 /* I2C */ 183 /* I2C */
184 I2C_7XX_SCL, 184 I2C_7XX_SCL,
185 I2C_7XX_SDA, 185 I2C_7XX_SDA,
186
187 /* SPI */
188 SPI_7XX_1,
189 SPI_7XX_2,
190 SPI_7XX_3,
191 SPI_7XX_4,
192 SPI_7XX_5,
193 SPI_7XX_6,
186}; 194};
187 195
188enum omap1xxx_index { 196enum omap1xxx_index {
diff --git a/arch/arm/plat-omap/include/plat/omap7xx.h b/arch/arm/plat-omap/include/plat/omap7xx.h
index 53f52414b0e..48e4757e1e3 100644
--- a/arch/arm/plat-omap/include/plat/omap7xx.h
+++ b/arch/arm/plat-omap/include/plat/omap7xx.h
@@ -46,6 +46,9 @@
46#define OMAP7XX_DSPREG_SIZE SZ_128K 46#define OMAP7XX_DSPREG_SIZE SZ_128K
47#define OMAP7XX_DSPREG_START 0xE1000000 47#define OMAP7XX_DSPREG_START 0xE1000000
48 48
49#define OMAP7XX_SPI1_BASE 0xfffc0800
50#define OMAP7XX_SPI2_BASE 0xfffc1000
51
49/* 52/*
50 * ---------------------------------------------------------------------------- 53 * ----------------------------------------------------------------------------
51 * OMAP7XX specific configuration registers 54 * OMAP7XX specific configuration registers
diff --git a/arch/arm/plat-omap/io.c b/arch/arm/plat-omap/io.c
index 11f5d7961c7..0cfd54f519c 100644
--- a/arch/arm/plat-omap/io.c
+++ b/arch/arm/plat-omap/io.c
@@ -66,12 +66,12 @@ void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
66 return XLATE(p, L4_24XX_PHYS, L4_24XX_VIRT); 66 return XLATE(p, L4_24XX_PHYS, L4_24XX_VIRT);
67 } 67 }
68 if (cpu_is_omap2420()) { 68 if (cpu_is_omap2420()) {
69 if (BETWEEN(p, DSP_MEM_24XX_PHYS, DSP_MEM_24XX_SIZE)) 69 if (BETWEEN(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_SIZE))
70 return XLATE(p, DSP_MEM_24XX_PHYS, DSP_MEM_24XX_VIRT); 70 return XLATE(p, DSP_MEM_2420_PHYS, DSP_MEM_2420_VIRT);
71 if (BETWEEN(p, DSP_IPI_24XX_PHYS, DSP_IPI_24XX_SIZE)) 71 if (BETWEEN(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE))
72 return XLATE(p, DSP_IPI_24XX_PHYS, DSP_IPI_24XX_SIZE); 72 return XLATE(p, DSP_IPI_2420_PHYS, DSP_IPI_2420_SIZE);
73 if (BETWEEN(p, DSP_MMU_24XX_PHYS, DSP_MMU_24XX_SIZE)) 73 if (BETWEEN(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_SIZE))
74 return XLATE(p, DSP_MMU_24XX_PHYS, DSP_MMU_24XX_VIRT); 74 return XLATE(p, DSP_MMU_2420_PHYS, DSP_MMU_2420_VIRT);
75 } 75 }
76 if (cpu_is_omap2430()) { 76 if (cpu_is_omap2430()) {
77 if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE)) 77 if (BETWEEN(p, L4_WK_243X_PHYS, L4_WK_243X_SIZE))
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index c0ff1e39d89..463d6386aff 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -827,7 +827,7 @@ EXPORT_SYMBOL_GPL(iommu_get);
827 **/ 827 **/
828void iommu_put(struct iommu *obj) 828void iommu_put(struct iommu *obj)
829{ 829{
830 if (!obj && IS_ERR(obj)) 830 if (!obj || IS_ERR(obj))
831 return; 831 return;
832 832
833 mutex_lock(&obj->iommu_lock); 833 mutex_lock(&obj->iommu_lock);
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 2cc1cc328ba..f75767278fc 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -436,7 +436,7 @@ int omap_mcbsp_request(unsigned int id)
436 dev_err(mcbsp->dev, "Unable to request TX IRQ %d " 436 dev_err(mcbsp->dev, "Unable to request TX IRQ %d "
437 "for McBSP%d\n", mcbsp->tx_irq, 437 "for McBSP%d\n", mcbsp->tx_irq,
438 mcbsp->id); 438 mcbsp->id);
439 return err; 439 goto error;
440 } 440 }
441 441
442 init_completion(&mcbsp->rx_irq_completion); 442 init_completion(&mcbsp->rx_irq_completion);
@@ -446,12 +446,26 @@ int omap_mcbsp_request(unsigned int id)
446 dev_err(mcbsp->dev, "Unable to request RX IRQ %d " 446 dev_err(mcbsp->dev, "Unable to request RX IRQ %d "
447 "for McBSP%d\n", mcbsp->rx_irq, 447 "for McBSP%d\n", mcbsp->rx_irq,
448 mcbsp->id); 448 mcbsp->id);
449 free_irq(mcbsp->tx_irq, (void *)mcbsp); 449 goto tx_irq;
450 return err;
451 } 450 }
452 } 451 }
453 452
454 return 0; 453 return 0;
454tx_irq:
455 free_irq(mcbsp->tx_irq, (void *)mcbsp);
456error:
457 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free)
458 mcbsp->pdata->ops->free(id);
459
460 /* Do procedure specific to omap34xx arch, if applicable */
461 omap34xx_mcbsp_free(mcbsp);
462
463 clk_disable(mcbsp->fclk);
464 clk_disable(mcbsp->iclk);
465
466 mcbsp->free = 1;
467
468 return err;
455} 469}
456EXPORT_SYMBOL(omap_mcbsp_request); 470EXPORT_SYMBOL(omap_mcbsp_request);
457 471