aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-06 22:13:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-06 22:13:58 -0500
commit01539ba2a706ab7d35fc0667dff919ade7f87d63 (patch)
tree5a4bd0cf78007d06690fe4ac06bbd49a5a70bc47 /arch/arm/mach-omap1
parent9e9bc9736756f25d6c47b4eba0ebf25b20a6f153 (diff)
parentdc69d1af9e8d9cbbabff88bb35a6782187a22229 (diff)
Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (243 commits) omap2: Make OMAP2PLUS select OMAP_DM_TIMER OMAP4: hwmod data: Fix alignment and end of line in structurefields OMAP4: hwmod data: Move the DMA structures OMAP4: hwmod data: Move the smartreflex structures OMAP4: hwmod data: Fix missing SIDLE_SMART_WKUP in smartreflexsysc arm: omap: tusb6010: add name for MUSB IRQ arm: omap: craneboard: Add USB EHCI support omap2+: Initialize serial port for dynamic remuxing for n8x0 omap2+: Add struct omap_board_data and use it for platform level serial init omap2+: Allow hwmod state changes to mux pads based on the state changes omap2+: Add support for hwmod specific muxing of devices omap2+: Add omap_mux_get_by_name OMAP2: PM: fix compile error when !CONFIG_SUSPEND MAINTAINERS: OMAP: hwmod: update hwmod code, data maintainership OMAP4: Smartreflex framework extensions OMAP4: hwmod: Add inital data for smartreflex modules. OMAP4: PM: Program correct init voltages for scalable VDDs OMAP4: Adding voltage driver support OMAP4: Register voltage PMIC parameters with the voltage layer OMAP3: PM: Program correct init voltages for VDD1 and VDD2 ... Fix up trivial conflict in arch/arm/plat-omap/Kconfig
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/Kconfig11
-rw-r--r--arch/arm/mach-omap1/Makefile12
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c137
-rw-r--r--arch/arm/mach-omap1/board-fsample.c89
-rw-r--r--arch/arm/mach-omap1/board-h2.c79
-rw-r--r--arch/arm/mach-omap1/board-h3.c97
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c102
-rw-r--r--arch/arm/mach-omap1/board-innovator.c32
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c30
-rw-r--r--arch/arm/mach-omap1/board-osk.c27
-rw-r--r--arch/arm/mach-omap1/board-palmte.c29
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c28
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c31
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c91
-rw-r--r--arch/arm/mach-omap1/board-sx1.c58
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c7
-rw-r--r--arch/arm/mach-omap1/clock_data.c27
-rw-r--r--arch/arm/mach-omap1/devices.c4
-rw-r--r--arch/arm/mach-omap1/dma.c390
-rw-r--r--arch/arm/mach-omap1/flash.c1
-rw-r--r--arch/arm/mach-omap1/fpga.c10
-rw-r--r--arch/arm/mach-omap1/gpio15xx.c99
-rw-r--r--arch/arm/mach-omap1/gpio16xx.c200
-rw-r--r--arch/arm/mach-omap1/gpio7xx.c262
-rw-r--r--arch/arm/mach-omap1/include/mach/entry-macro.S27
-rw-r--r--arch/arm/mach-omap1/io.c39
-rw-r--r--arch/arm/mach-omap1/irq.c5
-rw-r--r--arch/arm/mach-omap1/lcd_dma.c3
-rw-r--r--arch/arm/mach-omap1/leds.c3
-rw-r--r--arch/arm/mach-omap1/mailbox.c5
-rw-r--r--arch/arm/mach-omap1/mcbsp.c5
-rw-r--r--arch/arm/mach-omap1/mux.c2
-rw-r--r--arch/arm/mach-omap1/pm.c3
-rw-r--r--arch/arm/mach-omap1/pm_bus.c4
-rw-r--r--arch/arm/mach-omap1/serial.c11
-rw-r--r--arch/arm/mach-omap1/time.c1
36 files changed, 1510 insertions, 451 deletions
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 5f6496375404..8d2f2daba0c0 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -152,20 +152,11 @@ config MACH_NOKIA770
152config MACH_AMS_DELTA 152config MACH_AMS_DELTA
153 bool "Amstrad E3 (Delta)" 153 bool "Amstrad E3 (Delta)"
154 depends on ARCH_OMAP1 && ARCH_OMAP15XX 154 depends on ARCH_OMAP1 && ARCH_OMAP15XX
155 select FIQ
155 help 156 help
156 Support for the Amstrad E3 (codename Delta) videophone. Say Y here 157 Support for the Amstrad E3 (codename Delta) videophone. Say Y here
157 if you have such a device. 158 if you have such a device.
158 159
159config AMS_DELTA_FIQ
160 bool "Fast Interrupt Request (FIQ) support for the E3"
161 depends on MACH_AMS_DELTA
162 select FIQ
163 help
164 Provide a FIQ handler for the E3.
165 This allows for fast handling of interrupts generated
166 by the clock line of the E3 mailboard (or a PS/2 keyboard)
167 connected to the GPIO based external keyboard port.
168
169config MACH_OMAP_GENERIC 160config MACH_OMAP_GENERIC
170 bool "Generic OMAP board" 161 bool "Generic OMAP board"
171 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX) 162 depends on ARCH_OMAP1 && (ARCH_OMAP15XX || ARCH_OMAP16XX)
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 9a304d854e33..6ee19504845f 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o 6obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o dma.o
7obj-y += clock.o clock_data.o opp_data.o 7obj-y += clock.o clock_data.o opp_data.o
8 8
9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
@@ -39,8 +39,8 @@ obj-$(CONFIG_MACH_OMAP_PALMTE) += board-palmte.o
39obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o 39obj-$(CONFIG_MACH_OMAP_PALMZ71) += board-palmz71.o
40obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o 40obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
41obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o 41obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o
42obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o 42obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o ams-delta-fiq.o \
43obj-$(CONFIG_AMS_DELTA_FIQ) += ams-delta-fiq.o ams-delta-fiq-handler.o 43 ams-delta-fiq-handler.o
44obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o 44obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o
45obj-$(CONFIG_MACH_HERALD) += board-htcherald.o 45obj-$(CONFIG_MACH_HERALD) += board-htcherald.o
46 46
@@ -49,6 +49,12 @@ ifeq ($(CONFIG_ARCH_OMAP15XX),y)
49obj-$(CONFIG_MACH_OMAP_INNOVATOR) += fpga.o 49obj-$(CONFIG_MACH_OMAP_INNOVATOR) += fpga.o
50endif 50endif
51 51
52# GPIO
53obj-$(CONFIG_ARCH_OMAP730) += gpio7xx.o
54obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o
55obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o
56obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o
57
52# LEDs support 58# LEDs support
53led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o 59led-$(CONFIG_MACH_OMAP_H2) += leds-h2p2-debug.o
54led-$(CONFIG_MACH_OMAP_H3) += leds-h2p2-debug.o 60led-$(CONFIG_MACH_OMAP_H3) += leds-h2p2-debug.o
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 1d4163b9f0b7..bd0495a9ac3b 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -28,6 +28,7 @@
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30 30
31#include <plat/io.h>
31#include <plat/board-ams-delta.h> 32#include <plat/board-ams-delta.h>
32#include <mach/gpio.h> 33#include <mach/gpio.h>
33#include <plat/keypad.h> 34#include <plat/keypad.h>
@@ -42,84 +43,82 @@
42static u8 ams_delta_latch1_reg; 43static u8 ams_delta_latch1_reg;
43static u16 ams_delta_latch2_reg; 44static u16 ams_delta_latch2_reg;
44 45
45static int ams_delta_keymap[] = { 46static const unsigned int ams_delta_keymap[] = {
46 KEY(0, 0, KEY_F1), /* Advert */ 47 KEY(0, 0, KEY_F1), /* Advert */
47 48
48 KEY(3, 0, KEY_COFFEE), /* Games */ 49 KEY(0, 3, KEY_COFFEE), /* Games */
49 KEY(2, 0, KEY_QUESTION), /* Directory */ 50 KEY(0, 2, KEY_QUESTION), /* Directory */
50 KEY(3, 2, KEY_CONNECT), /* Internet */ 51 KEY(2, 3, KEY_CONNECT), /* Internet */
51 KEY(2, 1, KEY_SHOP), /* Services */ 52 KEY(1, 2, KEY_SHOP), /* Services */
52 KEY(1, 1, KEY_PHONE), /* VoiceMail */ 53 KEY(1, 1, KEY_PHONE), /* VoiceMail */
53 54
54 KEY(1, 0, KEY_DELETE), /* Delete */ 55 KEY(0, 1, KEY_DELETE), /* Delete */
55 KEY(2, 2, KEY_PLAY), /* Play */ 56 KEY(2, 2, KEY_PLAY), /* Play */
56 KEY(0, 1, KEY_PAGEUP), /* Up */ 57 KEY(1, 0, KEY_PAGEUP), /* Up */
57 KEY(3, 1, KEY_PAGEDOWN), /* Down */ 58 KEY(1, 3, KEY_PAGEDOWN), /* Down */
58 KEY(0, 2, KEY_EMAIL), /* ReadEmail */ 59 KEY(2, 0, KEY_EMAIL), /* ReadEmail */
59 KEY(1, 2, KEY_STOP), /* Stop */ 60 KEY(2, 1, KEY_STOP), /* Stop */
60 61
61 /* Numeric keypad portion */ 62 /* Numeric keypad portion */
62 KEY(7, 0, KEY_KP1), 63 KEY(0, 7, KEY_KP1),
63 KEY(6, 0, KEY_KP2), 64 KEY(0, 6, KEY_KP2),
64 KEY(5, 0, KEY_KP3), 65 KEY(0, 5, KEY_KP3),
65 KEY(7, 1, KEY_KP4), 66 KEY(1, 7, KEY_KP4),
66 KEY(6, 1, KEY_KP5), 67 KEY(1, 6, KEY_KP5),
67 KEY(5, 1, KEY_KP6), 68 KEY(1, 5, KEY_KP6),
68 KEY(7, 2, KEY_KP7), 69 KEY(2, 7, KEY_KP7),
69 KEY(6, 2, KEY_KP8), 70 KEY(2, 6, KEY_KP8),
70 KEY(5, 2, KEY_KP9), 71 KEY(2, 5, KEY_KP9),
71 KEY(6, 3, KEY_KP0), 72 KEY(3, 6, KEY_KP0),
72 KEY(7, 3, KEY_KPASTERISK), 73 KEY(3, 7, KEY_KPASTERISK),
73 KEY(5, 3, KEY_KPDOT), /* # key */ 74 KEY(3, 5, KEY_KPDOT), /* # key */
74 KEY(2, 7, KEY_NUMLOCK), /* Mute */ 75 KEY(7, 2, KEY_NUMLOCK), /* Mute */
75 KEY(1, 7, KEY_KPMINUS), /* Recall */ 76 KEY(7, 1, KEY_KPMINUS), /* Recall */
76 KEY(1, 6, KEY_KPPLUS), /* Redial */ 77 KEY(6, 1, KEY_KPPLUS), /* Redial */
77 KEY(6, 7, KEY_KPSLASH), /* Handsfree */ 78 KEY(7, 6, KEY_KPSLASH), /* Handsfree */
78 KEY(0, 6, KEY_ENTER), /* Video */ 79 KEY(6, 0, KEY_ENTER), /* Video */
79 80
80 KEY(4, 7, KEY_CAMERA), /* Photo */ 81 KEY(7, 4, KEY_CAMERA), /* Photo */
81 82
82 KEY(4, 0, KEY_F2), /* Home */ 83 KEY(0, 4, KEY_F2), /* Home */
83 KEY(4, 1, KEY_F3), /* Office */ 84 KEY(1, 4, KEY_F3), /* Office */
84 KEY(4, 2, KEY_F4), /* Mobile */ 85 KEY(2, 4, KEY_F4), /* Mobile */
85 KEY(7, 7, KEY_F5), /* SMS */ 86 KEY(7, 7, KEY_F5), /* SMS */
86 KEY(5, 7, KEY_F6), /* Email */ 87 KEY(7, 5, KEY_F6), /* Email */
87 88
88 /* QWERTY portion of keypad */ 89 /* QWERTY portion of keypad */
89 KEY(4, 3, KEY_Q), 90 KEY(3, 4, KEY_Q),
90 KEY(3, 3, KEY_W), 91 KEY(3, 3, KEY_W),
91 KEY(2, 3, KEY_E), 92 KEY(3, 2, KEY_E),
92 KEY(1, 3, KEY_R), 93 KEY(3, 1, KEY_R),
93 KEY(0, 3, KEY_T), 94 KEY(3, 0, KEY_T),
94 KEY(7, 4, KEY_Y), 95 KEY(4, 7, KEY_Y),
95 KEY(6, 4, KEY_U), 96 KEY(4, 6, KEY_U),
96 KEY(5, 4, KEY_I), 97 KEY(4, 5, KEY_I),
97 KEY(4, 4, KEY_O), 98 KEY(4, 4, KEY_O),
98 KEY(3, 4, KEY_P), 99 KEY(4, 3, KEY_P),
99 100
100 KEY(2, 4, KEY_A), 101 KEY(4, 2, KEY_A),
101 KEY(1, 4, KEY_S), 102 KEY(4, 1, KEY_S),
102 KEY(0, 4, KEY_D), 103 KEY(4, 0, KEY_D),
103 KEY(7, 5, KEY_F), 104 KEY(5, 7, KEY_F),
104 KEY(6, 5, KEY_G), 105 KEY(5, 6, KEY_G),
105 KEY(5, 5, KEY_H), 106 KEY(5, 5, KEY_H),
106 KEY(4, 5, KEY_J), 107 KEY(5, 4, KEY_J),
107 KEY(3, 5, KEY_K), 108 KEY(5, 3, KEY_K),
108 KEY(2, 5, KEY_L), 109 KEY(5, 2, KEY_L),
109 110
110 KEY(1, 5, KEY_Z), 111 KEY(5, 1, KEY_Z),
111 KEY(0, 5, KEY_X), 112 KEY(5, 0, KEY_X),
112 KEY(7, 6, KEY_C), 113 KEY(6, 7, KEY_C),
113 KEY(6, 6, KEY_V), 114 KEY(6, 6, KEY_V),
114 KEY(5, 6, KEY_B), 115 KEY(6, 5, KEY_B),
115 KEY(4, 6, KEY_N), 116 KEY(6, 4, KEY_N),
116 KEY(3, 6, KEY_M), 117 KEY(6, 3, KEY_M),
117 KEY(2, 6, KEY_SPACE), 118 KEY(6, 2, KEY_SPACE),
118 119
119 KEY(0, 7, KEY_LEFTSHIFT), /* Vol up */ 120 KEY(7, 0, KEY_LEFTSHIFT), /* Vol up */
120 KEY(3, 7, KEY_LEFTCTRL), /* Vol down */ 121 KEY(7, 3, KEY_LEFTCTRL), /* Vol down */
121
122 0
123}; 122};
124 123
125void ams_delta_latch1_write(u8 mask, u8 value) 124void ams_delta_latch1_write(u8 mask, u8 value)
@@ -140,7 +139,6 @@ static void __init ams_delta_init_irq(void)
140{ 139{
141 omap1_init_common_hw(); 140 omap1_init_common_hw();
142 omap_init_irq(); 141 omap_init_irq();
143 omap_gpio_init();
144} 142}
145 143
146static struct map_desc ams_delta_io_desc[] __initdata = { 144static struct map_desc ams_delta_io_desc[] __initdata = {
@@ -189,11 +187,15 @@ static struct resource ams_delta_kp_resources[] = {
189 }, 187 },
190}; 188};
191 189
190static const struct matrix_keymap_data ams_delta_keymap_data = {
191 .keymap = ams_delta_keymap,
192 .keymap_size = ARRAY_SIZE(ams_delta_keymap),
193};
194
192static struct omap_kp_platform_data ams_delta_kp_data = { 195static struct omap_kp_platform_data ams_delta_kp_data = {
193 .rows = 8, 196 .rows = 8,
194 .cols = 8, 197 .cols = 8,
195 .keymap = ams_delta_keymap, 198 .keymap_data = &ams_delta_keymap_data,
196 .keymapsize = ARRAY_SIZE(ams_delta_keymap),
197 .delay = 9, 199 .delay = 9,
198}; 200};
199 201
@@ -307,16 +309,14 @@ static void __init ams_delta_init(void)
307#endif 309#endif
308 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices)); 310 platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
309 311
310#ifdef CONFIG_AMS_DELTA_FIQ
311 ams_delta_init_fiq(); 312 ams_delta_init_fiq();
312#endif
313 313
314 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1); 314 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1);
315} 315}
316 316
317static struct plat_serial8250_port ams_delta_modem_ports[] = { 317static struct plat_serial8250_port ams_delta_modem_ports[] = {
318 { 318 {
319 .membase = (void *) AMS_DELTA_MODEM_VIRT, 319 .membase = IOMEM(AMS_DELTA_MODEM_VIRT),
320 .mapbase = AMS_DELTA_MODEM_PHYS, 320 .mapbase = AMS_DELTA_MODEM_PHYS,
321 .irq = -EINVAL, /* changed later */ 321 .irq = -EINVAL, /* changed later */
322 .flags = UPF_BOOT_AUTOCONF, 322 .flags = UPF_BOOT_AUTOCONF,
@@ -340,6 +340,9 @@ static int __init ams_delta_modem_init(void)
340{ 340{
341 int err; 341 int err;
342 342
343 if (!machine_is_ams_delta())
344 return -ENODEV;
345
343 omap_cfg_reg(M14_1510_GPIO2); 346 omap_cfg_reg(M14_1510_GPIO2);
344 ams_delta_modem_ports[0].irq = 347 ams_delta_modem_ports[0].irq =
345 gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ); 348 gpio_to_irq(AMS_DELTA_GPIO_PIN_MODEM_IRQ);
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 149fdd32e127..0efb9dbae44c 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -69,36 +69,35 @@
69#define fsample_cpld_clear(bit) \ 69#define fsample_cpld_clear(bit) \
70 fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR) 70 fsample_cpld_write(0xf0 | ((bit) & 15), FSAMPLE_CPLD_SET_CLR)
71 71
72static int fsample_keymap[] = { 72static const unsigned int fsample_keymap[] = {
73 KEY(0,0,KEY_UP), 73 KEY(0, 0, KEY_UP),
74 KEY(0,1,KEY_RIGHT), 74 KEY(1, 0, KEY_RIGHT),
75 KEY(0,2,KEY_LEFT), 75 KEY(2, 0, KEY_LEFT),
76 KEY(0,3,KEY_DOWN), 76 KEY(3, 0, KEY_DOWN),
77 KEY(0,4,KEY_ENTER), 77 KEY(4, 0, KEY_ENTER),
78 KEY(1,0,KEY_F10), 78 KEY(0, 1, KEY_F10),
79 KEY(1,1,KEY_SEND), 79 KEY(1, 1, KEY_SEND),
80 KEY(1,2,KEY_END), 80 KEY(2, 1, KEY_END),
81 KEY(1,3,KEY_VOLUMEDOWN), 81 KEY(3, 1, KEY_VOLUMEDOWN),
82 KEY(1,4,KEY_VOLUMEUP), 82 KEY(4, 1, KEY_VOLUMEUP),
83 KEY(1,5,KEY_RECORD), 83 KEY(5, 1, KEY_RECORD),
84 KEY(2,0,KEY_F9), 84 KEY(0, 2, KEY_F9),
85 KEY(2,1,KEY_3), 85 KEY(1, 2, KEY_3),
86 KEY(2,2,KEY_6), 86 KEY(2, 2, KEY_6),
87 KEY(2,3,KEY_9), 87 KEY(3, 2, KEY_9),
88 KEY(2,4,KEY_KPDOT), 88 KEY(4, 2, KEY_KPDOT),
89 KEY(3,0,KEY_BACK), 89 KEY(0, 3, KEY_BACK),
90 KEY(3,1,KEY_2), 90 KEY(1, 3, KEY_2),
91 KEY(3,2,KEY_5), 91 KEY(2, 3, KEY_5),
92 KEY(3,3,KEY_8), 92 KEY(3, 3, KEY_8),
93 KEY(3,4,KEY_0), 93 KEY(4, 3, KEY_0),
94 KEY(3,5,KEY_KPSLASH), 94 KEY(5, 3, KEY_KPSLASH),
95 KEY(4,0,KEY_HOME), 95 KEY(0, 4, KEY_HOME),
96 KEY(4,1,KEY_1), 96 KEY(1, 4, KEY_1),
97 KEY(4,2,KEY_4), 97 KEY(2, 4, KEY_4),
98 KEY(4,3,KEY_7), 98 KEY(3, 4, KEY_7),
99 KEY(4,4,KEY_KPASTERISK), 99 KEY(4, 4, KEY_KPASTERISK),
100 KEY(4,5,KEY_POWER), 100 KEY(5, 4, KEY_POWER),
101 0
102}; 101};
103 102
104static struct smc91x_platdata smc91x_info = { 103static struct smc91x_platdata smc91x_info = {
@@ -120,6 +119,15 @@ static struct resource smc91x_resources[] = {
120 }, 119 },
121}; 120};
122 121
122static void __init fsample_init_smc91x(void)
123{
124 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
125 mdelay(50);
126 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
127 H2P2_DBG_FPGA_LAN_RESET);
128 mdelay(50);
129}
130
123static struct mtd_partition nor_partitions[] = { 131static struct mtd_partition nor_partitions[] = {
124 /* bootloader (U-Boot, etc) in first sector */ 132 /* bootloader (U-Boot, etc) in first sector */
125 { 133 {
@@ -244,11 +252,15 @@ static struct resource kp_resources[] = {
244 }, 252 },
245}; 253};
246 254
255static const struct matrix_keymap_data fsample_keymap_data = {
256 .keymap = fsample_keymap,
257 .keymap_size = ARRAY_SIZE(fsample_keymap),
258};
259
247static struct omap_kp_platform_data kp_data = { 260static struct omap_kp_platform_data kp_data = {
248 .rows = 8, 261 .rows = 8,
249 .cols = 8, 262 .cols = 8,
250 .keymap = fsample_keymap, 263 .keymap_data = &fsample_keymap_data,
251 .keymapsize = ARRAY_SIZE(fsample_keymap),
252 .delay = 4, 264 .delay = 4,
253}; 265};
254 266
@@ -285,6 +297,8 @@ static struct omap_board_config_kernel fsample_config[] = {
285 297
286static void __init omap_fsample_init(void) 298static void __init omap_fsample_init(void)
287{ 299{
300 fsample_init_smc91x();
301
288 if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) 302 if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0)
289 BUG(); 303 BUG();
290 gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); 304 gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN);
@@ -312,21 +326,10 @@ static void __init omap_fsample_init(void)
312 omap_register_i2c_bus(1, 100, NULL, 0); 326 omap_register_i2c_bus(1, 100, NULL, 0);
313} 327}
314 328
315static void __init fsample_init_smc91x(void)
316{
317 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
318 mdelay(50);
319 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
320 H2P2_DBG_FPGA_LAN_RESET);
321 mdelay(50);
322}
323
324static void __init omap_fsample_init_irq(void) 329static void __init omap_fsample_init_irq(void)
325{ 330{
326 omap1_init_common_hw(); 331 omap1_init_common_hw();
327 omap_init_irq(); 332 omap_init_irq();
328 omap_gpio_init();
329 fsample_init_smc91x();
330} 333}
331 334
332/* Only FPGA needs to be mapped here. All others are done with ioremap */ 335/* Only FPGA needs to be mapped here. All others are done with ioremap */
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 197adb49dc5a..28b84aa9bdba 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -52,43 +52,42 @@
52/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 52/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
53#define OMAP1610_ETHR_START 0x04000300 53#define OMAP1610_ETHR_START 0x04000300
54 54
55static int h2_keymap[] = { 55static const unsigned int h2_keymap[] = {
56 KEY(0, 0, KEY_LEFT), 56 KEY(0, 0, KEY_LEFT),
57 KEY(0, 1, KEY_RIGHT), 57 KEY(1, 0, KEY_RIGHT),
58 KEY(0, 2, KEY_3), 58 KEY(2, 0, KEY_3),
59 KEY(0, 3, KEY_F10), 59 KEY(3, 0, KEY_F10),
60 KEY(0, 4, KEY_F5), 60 KEY(4, 0, KEY_F5),
61 KEY(0, 5, KEY_9), 61 KEY(5, 0, KEY_9),
62 KEY(1, 0, KEY_DOWN), 62 KEY(0, 1, KEY_DOWN),
63 KEY(1, 1, KEY_UP), 63 KEY(1, 1, KEY_UP),
64 KEY(1, 2, KEY_2), 64 KEY(2, 1, KEY_2),
65 KEY(1, 3, KEY_F9), 65 KEY(3, 1, KEY_F9),
66 KEY(1, 4, KEY_F7), 66 KEY(4, 1, KEY_F7),
67 KEY(1, 5, KEY_0), 67 KEY(5, 1, KEY_0),
68 KEY(2, 0, KEY_ENTER), 68 KEY(0, 2, KEY_ENTER),
69 KEY(2, 1, KEY_6), 69 KEY(1, 2, KEY_6),
70 KEY(2, 2, KEY_1), 70 KEY(2, 2, KEY_1),
71 KEY(2, 3, KEY_F2), 71 KEY(3, 2, KEY_F2),
72 KEY(2, 4, KEY_F6), 72 KEY(4, 2, KEY_F6),
73 KEY(2, 5, KEY_HOME), 73 KEY(5, 2, KEY_HOME),
74 KEY(3, 0, KEY_8), 74 KEY(0, 3, KEY_8),
75 KEY(3, 1, KEY_5), 75 KEY(1, 3, KEY_5),
76 KEY(3, 2, KEY_F12), 76 KEY(2, 3, KEY_F12),
77 KEY(3, 3, KEY_F3), 77 KEY(3, 3, KEY_F3),
78 KEY(3, 4, KEY_F8), 78 KEY(4, 3, KEY_F8),
79 KEY(3, 5, KEY_END), 79 KEY(5, 3, KEY_END),
80 KEY(4, 0, KEY_7), 80 KEY(0, 4, KEY_7),
81 KEY(4, 1, KEY_4), 81 KEY(1, 4, KEY_4),
82 KEY(4, 2, KEY_F11), 82 KEY(2, 4, KEY_F11),
83 KEY(4, 3, KEY_F1), 83 KEY(3, 4, KEY_F1),
84 KEY(4, 4, KEY_F4), 84 KEY(4, 4, KEY_F4),
85 KEY(4, 5, KEY_ESC), 85 KEY(5, 4, KEY_ESC),
86 KEY(5, 0, KEY_F13), 86 KEY(0, 5, KEY_F13),
87 KEY(5, 1, KEY_F14), 87 KEY(1, 5, KEY_F14),
88 KEY(5, 2, KEY_F15), 88 KEY(2, 5, KEY_F15),
89 KEY(5, 3, KEY_F16), 89 KEY(3, 5, KEY_F16),
90 KEY(5, 4, KEY_SLEEP), 90 KEY(4, 5, KEY_SLEEP),
91 0
92}; 91};
93 92
94static struct mtd_partition h2_nor_partitions[] = { 93static struct mtd_partition h2_nor_partitions[] = {
@@ -270,14 +269,18 @@ static struct resource h2_kp_resources[] = {
270 }, 269 },
271}; 270};
272 271
272static const struct matrix_keymap_data h2_keymap_data = {
273 .keymap = h2_keymap,
274 .keymap_size = ARRAY_SIZE(h2_keymap),
275};
276
273static struct omap_kp_platform_data h2_kp_data = { 277static struct omap_kp_platform_data h2_kp_data = {
274 .rows = 8, 278 .rows = 8,
275 .cols = 8, 279 .cols = 8,
276 .keymap = h2_keymap, 280 .keymap_data = &h2_keymap_data,
277 .keymapsize = ARRAY_SIZE(h2_keymap), 281 .rep = true,
278 .rep = 1,
279 .delay = 9, 282 .delay = 9,
280 .dbounce = 1, 283 .dbounce = true,
281}; 284};
282 285
283static struct platform_device h2_kp_device = { 286static struct platform_device h2_kp_device = {
@@ -374,8 +377,6 @@ static void __init h2_init_irq(void)
374{ 377{
375 omap1_init_common_hw(); 378 omap1_init_common_hw();
376 omap_init_irq(); 379 omap_init_irq();
377 omap_gpio_init();
378 h2_init_smc91x();
379} 380}
380 381
381static struct omap_usb_config h2_usb_config __initdata = { 382static struct omap_usb_config h2_usb_config __initdata = {
@@ -403,6 +404,8 @@ static struct omap_board_config_kernel h2_config[] __initdata = {
403 404
404static void __init h2_init(void) 405static void __init h2_init(void)
405{ 406{
407 h2_init_smc91x();
408
406 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 409 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
407 * to address 0 by a dip switch), NAND on CS2B. The NAND driver will 410 * to address 0 by a dip switch), NAND on CS2B. The NAND driver will
408 * notice whether a NAND chip is enabled at probe time. 411 * notice whether a NAND chip is enabled at probe time.
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 9126e3e37b4a..dbc8b8d882ba 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -56,43 +56,42 @@
56 56
57#define H3_TS_GPIO 48 57#define H3_TS_GPIO 48
58 58
59static int h3_keymap[] = { 59static const unsigned int h3_keymap[] = {
60 KEY(0, 0, KEY_LEFT), 60 KEY(0, 0, KEY_LEFT),
61 KEY(0, 1, KEY_RIGHT), 61 KEY(1, 0, KEY_RIGHT),
62 KEY(0, 2, KEY_3), 62 KEY(2, 0, KEY_3),
63 KEY(0, 3, KEY_F10), 63 KEY(3, 0, KEY_F10),
64 KEY(0, 4, KEY_F5), 64 KEY(4, 0, KEY_F5),
65 KEY(0, 5, KEY_9), 65 KEY(5, 0, KEY_9),
66 KEY(1, 0, KEY_DOWN), 66 KEY(0, 1, KEY_DOWN),
67 KEY(1, 1, KEY_UP), 67 KEY(1, 1, KEY_UP),
68 KEY(1, 2, KEY_2), 68 KEY(2, 1, KEY_2),
69 KEY(1, 3, KEY_F9), 69 KEY(3, 1, KEY_F9),
70 KEY(1, 4, KEY_F7), 70 KEY(4, 1, KEY_F7),
71 KEY(1, 5, KEY_0), 71 KEY(5, 1, KEY_0),
72 KEY(2, 0, KEY_ENTER), 72 KEY(0, 2, KEY_ENTER),
73 KEY(2, 1, KEY_6), 73 KEY(1, 2, KEY_6),
74 KEY(2, 2, KEY_1), 74 KEY(2, 2, KEY_1),
75 KEY(2, 3, KEY_F2), 75 KEY(3, 2, KEY_F2),
76 KEY(2, 4, KEY_F6), 76 KEY(4, 2, KEY_F6),
77 KEY(2, 5, KEY_HOME), 77 KEY(5, 2, KEY_HOME),
78 KEY(3, 0, KEY_8), 78 KEY(0, 3, KEY_8),
79 KEY(3, 1, KEY_5), 79 KEY(1, 3, KEY_5),
80 KEY(3, 2, KEY_F12), 80 KEY(2, 3, KEY_F12),
81 KEY(3, 3, KEY_F3), 81 KEY(3, 3, KEY_F3),
82 KEY(3, 4, KEY_F8), 82 KEY(4, 3, KEY_F8),
83 KEY(3, 5, KEY_END), 83 KEY(5, 3, KEY_END),
84 KEY(4, 0, KEY_7), 84 KEY(0, 4, KEY_7),
85 KEY(4, 1, KEY_4), 85 KEY(1, 4, KEY_4),
86 KEY(4, 2, KEY_F11), 86 KEY(2, 4, KEY_F11),
87 KEY(4, 3, KEY_F1), 87 KEY(3, 4, KEY_F1),
88 KEY(4, 4, KEY_F4), 88 KEY(4, 4, KEY_F4),
89 KEY(4, 5, KEY_ESC), 89 KEY(5, 4, KEY_ESC),
90 KEY(5, 0, KEY_F13), 90 KEY(0, 5, KEY_F13),
91 KEY(5, 1, KEY_F14), 91 KEY(1, 5, KEY_F14),
92 KEY(5, 2, KEY_F15), 92 KEY(2, 5, KEY_F15),
93 KEY(5, 3, KEY_F16), 93 KEY(3, 5, KEY_F16),
94 KEY(5, 4, KEY_SLEEP), 94 KEY(4, 5, KEY_SLEEP),
95 0
96}; 95};
97 96
98 97
@@ -264,6 +263,15 @@ static struct platform_device smc91x_device = {
264 .resource = smc91x_resources, 263 .resource = smc91x_resources,
265}; 264};
266 265
266static void __init h3_init_smc91x(void)
267{
268 omap_cfg_reg(W15_1710_GPIO40);
269 if (gpio_request(40, "SMC91x irq") < 0) {
270 printk("Error requesting gpio 40 for smc91x irq\n");
271 return;
272 }
273}
274
267#define GPTIMER_BASE 0xFFFB1400 275#define GPTIMER_BASE 0xFFFB1400
268#define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800)) 276#define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800))
269#define GPTIMER_REGS_SIZE 0x46 277#define GPTIMER_REGS_SIZE 0x46
@@ -296,14 +304,18 @@ static struct resource h3_kp_resources[] = {
296 }, 304 },
297}; 305};
298 306
307static const struct matrix_keymap_data h3_keymap_data = {
308 .keymap = h3_keymap,
309 .keymap_size = ARRAY_SIZE(h3_keymap),
310};
311
299static struct omap_kp_platform_data h3_kp_data = { 312static struct omap_kp_platform_data h3_kp_data = {
300 .rows = 8, 313 .rows = 8,
301 .cols = 8, 314 .cols = 8,
302 .keymap = h3_keymap, 315 .keymap_data = &h3_keymap_data,
303 .keymapsize = ARRAY_SIZE(h3_keymap), 316 .rep = true,
304 .rep = 1,
305 .delay = 9, 317 .delay = 9,
306 .dbounce = 1, 318 .dbounce = true,
307}; 319};
308 320
309static struct platform_device h3_kp_device = { 321static struct platform_device h3_kp_device = {
@@ -376,6 +388,8 @@ static struct i2c_board_info __initdata h3_i2c_board_info[] = {
376 388
377static void __init h3_init(void) 389static void __init h3_init(void)
378{ 390{
391 h3_init_smc91x();
392
379 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 393 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
380 * to address 0 by a dip switch), NAND on CS2B. The NAND driver will 394 * to address 0 by a dip switch), NAND on CS2B. The NAND driver will
381 * notice whether a NAND chip is enabled at probe time. 395 * notice whether a NAND chip is enabled at probe time.
@@ -422,21 +436,10 @@ static void __init h3_init(void)
422 h3_mmc_init(); 436 h3_mmc_init();
423} 437}
424 438
425static void __init h3_init_smc91x(void)
426{
427 omap_cfg_reg(W15_1710_GPIO40);
428 if (gpio_request(40, "SMC91x irq") < 0) {
429 printk("Error requesting gpio 40 for smc91x irq\n");
430 return;
431 }
432}
433
434static void __init h3_init_irq(void) 439static void __init h3_init_irq(void)
435{ 440{
436 omap1_init_common_hw(); 441 omap1_init_common_hw();
437 omap_init_irq(); 442 omap_init_irq();
438 omap_gpio_init();
439 h3_init_smc91x();
440} 443}
441 444
442static void __init h3_map_io(void) 445static void __init h3_map_io(void)
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 071af3e47789..f2c5c585bc83 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -180,64 +180,68 @@
180 180
181/* Keyboard definition */ 181/* Keyboard definition */
182 182
183static int htc_herald_keymap[] = { 183static const unsigned int htc_herald_keymap[] = {
184 KEY(0, 0, KEY_RECORD), /* Mail button */ 184 KEY(0, 0, KEY_RECORD), /* Mail button */
185 KEY(0, 1, KEY_CAMERA), /* Camera */ 185 KEY(1, 0, KEY_CAMERA), /* Camera */
186 KEY(0, 2, KEY_PHONE), /* Send key */ 186 KEY(2, 0, KEY_PHONE), /* Send key */
187 KEY(0, 3, KEY_VOLUMEUP), /* Volume up */ 187 KEY(3, 0, KEY_VOLUMEUP), /* Volume up */
188 KEY(0, 4, KEY_F2), /* Right bar (landscape) */ 188 KEY(4, 0, KEY_F2), /* Right bar (landscape) */
189 KEY(0, 5, KEY_MAIL), /* Win key (portrait) */ 189 KEY(5, 0, KEY_MAIL), /* Win key (portrait) */
190 KEY(0, 6, KEY_DIRECTORY), /* Right bar (protrait) */ 190 KEY(6, 0, KEY_DIRECTORY), /* Right bar (protrait) */
191 KEY(1, 0, KEY_LEFTCTRL), /* Windows key */ 191 KEY(0, 1, KEY_LEFTCTRL), /* Windows key */
192 KEY(1, 1, KEY_COMMA), 192 KEY(1, 1, KEY_COMMA),
193 KEY(1, 2, KEY_M), 193 KEY(2, 1, KEY_M),
194 KEY(1, 3, KEY_K), 194 KEY(3, 1, KEY_K),
195 KEY(1, 4, KEY_SLASH), /* OK key */ 195 KEY(4, 1, KEY_SLASH), /* OK key */
196 KEY(1, 5, KEY_I), 196 KEY(5, 1, KEY_I),
197 KEY(1, 6, KEY_U), 197 KEY(6, 1, KEY_U),
198 KEY(2, 0, KEY_LEFTALT), 198 KEY(0, 2, KEY_LEFTALT),
199 KEY(2, 1, KEY_TAB), 199 KEY(1, 2, KEY_TAB),
200 KEY(2, 2, KEY_N), 200 KEY(2, 2, KEY_N),
201 KEY(2, 3, KEY_J), 201 KEY(3, 2, KEY_J),
202 KEY(2, 4, KEY_ENTER), 202 KEY(4, 2, KEY_ENTER),
203 KEY(2, 5, KEY_H), 203 KEY(5, 2, KEY_H),
204 KEY(2, 6, KEY_Y), 204 KEY(6, 2, KEY_Y),
205 KEY(3, 0, KEY_SPACE), 205 KEY(0, 3, KEY_SPACE),
206 KEY(3, 1, KEY_L), 206 KEY(1, 3, KEY_L),
207 KEY(3, 2, KEY_B), 207 KEY(2, 3, KEY_B),
208 KEY(3, 3, KEY_V), 208 KEY(3, 3, KEY_V),
209 KEY(3, 4, KEY_BACKSPACE), 209 KEY(4, 3, KEY_BACKSPACE),
210 KEY(3, 5, KEY_G), 210 KEY(5, 3, KEY_G),
211 KEY(3, 6, KEY_T), 211 KEY(6, 3, KEY_T),
212 KEY(4, 0, KEY_CAPSLOCK), /* Shift */ 212 KEY(0, 4, KEY_CAPSLOCK), /* Shift */
213 KEY(4, 1, KEY_C), 213 KEY(1, 4, KEY_C),
214 KEY(4, 2, KEY_F), 214 KEY(2, 4, KEY_F),
215 KEY(4, 3, KEY_R), 215 KEY(3, 4, KEY_R),
216 KEY(4, 4, KEY_O), 216 KEY(4, 4, KEY_O),
217 KEY(4, 5, KEY_E), 217 KEY(5, 4, KEY_E),
218 KEY(4, 6, KEY_D), 218 KEY(6, 4, KEY_D),
219 KEY(5, 0, KEY_X), 219 KEY(0, 5, KEY_X),
220 KEY(5, 1, KEY_Z), 220 KEY(1, 5, KEY_Z),
221 KEY(5, 2, KEY_S), 221 KEY(2, 5, KEY_S),
222 KEY(5, 3, KEY_W), 222 KEY(3, 5, KEY_W),
223 KEY(5, 4, KEY_P), 223 KEY(4, 5, KEY_P),
224 KEY(5, 5, KEY_Q), 224 KEY(5, 5, KEY_Q),
225 KEY(5, 6, KEY_A), 225 KEY(6, 5, KEY_A),
226 KEY(6, 0, KEY_CONNECT), /* Voice button */ 226 KEY(0, 6, KEY_CONNECT), /* Voice button */
227 KEY(6, 2, KEY_CANCEL), /* End key */ 227 KEY(2, 6, KEY_CANCEL), /* End key */
228 KEY(6, 3, KEY_VOLUMEDOWN), /* Volume down */ 228 KEY(3, 6, KEY_VOLUMEDOWN), /* Volume down */
229 KEY(6, 4, KEY_F1), /* Left bar (landscape) */ 229 KEY(4, 6, KEY_F1), /* Left bar (landscape) */
230 KEY(6, 5, KEY_WWW), /* OK button (portrait) */ 230 KEY(5, 6, KEY_WWW), /* OK button (portrait) */
231 KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */ 231 KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */
232 0
233}; 232};
234 233
235struct omap_kp_platform_data htcherald_kp_data = { 234static const struct matrix_keymap_data htc_herald_keymap_data = {
235 .keymap = htc_herald_keymap,
236 .keymap_size = ARRAY_SIZE(htc_herald_keymap),
237};
238
239static struct omap_kp_platform_data htcherald_kp_data = {
236 .rows = 7, 240 .rows = 7,
237 .cols = 7, 241 .cols = 7,
238 .delay = 20, 242 .delay = 20,
239 .rep = 1, 243 .rep = true,
240 .keymap = htc_herald_keymap, 244 .keymap_data = &htc_herald_keymap_data,
241}; 245};
242 246
243static struct resource kp_resources[] = { 247static struct resource kp_resources[] = {
@@ -278,7 +282,7 @@ static struct gpio_keys_button herald_gpio_keys_table[] = {
278static struct gpio_keys_platform_data herald_gpio_keys_data = { 282static struct gpio_keys_platform_data herald_gpio_keys_data = {
279 .buttons = herald_gpio_keys_table, 283 .buttons = herald_gpio_keys_table,
280 .nbuttons = ARRAY_SIZE(herald_gpio_keys_table), 284 .nbuttons = ARRAY_SIZE(herald_gpio_keys_table),
281 .rep = 1, 285 .rep = true,
282}; 286};
283 287
284static struct platform_device herald_gpiokeys_device = { 288static struct platform_device herald_gpiokeys_device = {
@@ -439,7 +443,7 @@ static const struct ads7846_platform_data htcherald_ts_platform_data = {
439 .keep_vref_on = 1, 443 .keep_vref_on = 1,
440 .x_plate_ohms = 496, 444 .x_plate_ohms = 496,
441 .gpio_pendown = HTCHERALD_GPIO_TS, 445 .gpio_pendown = HTCHERALD_GPIO_TS,
442 .pressure_max = 100000, 446 .pressure_max = 10000,
443 .pressure_min = 5000, 447 .pressure_min = 5000,
444 .x_min = 528, 448 .x_min = 528,
445 .x_max = 3760, 449 .x_max = 3760,
@@ -577,8 +581,6 @@ static void __init htcherald_init(void)
577 printk(KERN_INFO "HTC Herald init.\n"); 581 printk(KERN_INFO "HTC Herald init.\n");
578 582
579 /* Do board initialization before we register all the devices */ 583 /* Do board initialization before we register all the devices */
580 omap_gpio_init();
581
582 omap_board_config = htcherald_config; 584 omap_board_config = htcherald_config;
583 omap_board_config_size = ARRAY_SIZE(htcherald_config); 585 omap_board_config_size = ARRAY_SIZE(htcherald_config);
584 platform_add_devices(devices, ARRAY_SIZE(devices)); 586 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index dc2b86fd66c1..a36e6742bf9b 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -44,17 +44,16 @@
44/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 44/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
45#define INNOVATOR1610_ETHR_START 0x04000300 45#define INNOVATOR1610_ETHR_START 0x04000300
46 46
47static int innovator_keymap[] = { 47static const unsigned int innovator_keymap[] = {
48 KEY(0, 0, KEY_F1), 48 KEY(0, 0, KEY_F1),
49 KEY(0, 3, KEY_DOWN), 49 KEY(3, 0, KEY_DOWN),
50 KEY(1, 1, KEY_F2), 50 KEY(1, 1, KEY_F2),
51 KEY(1, 2, KEY_RIGHT), 51 KEY(2, 1, KEY_RIGHT),
52 KEY(2, 0, KEY_F3), 52 KEY(0, 2, KEY_F3),
53 KEY(2, 1, KEY_F4), 53 KEY(1, 2, KEY_F4),
54 KEY(2, 2, KEY_UP), 54 KEY(2, 2, KEY_UP),
55 KEY(3, 2, KEY_ENTER), 55 KEY(2, 3, KEY_ENTER),
56 KEY(3, 3, KEY_LEFT), 56 KEY(3, 3, KEY_LEFT),
57 0
58}; 57};
59 58
60static struct mtd_partition innovator_partitions[] = { 59static struct mtd_partition innovator_partitions[] = {
@@ -126,11 +125,15 @@ static struct resource innovator_kp_resources[] = {
126 }, 125 },
127}; 126};
128 127
128static const struct matrix_keymap_data innovator_keymap_data = {
129 .keymap = innovator_keymap,
130 .keymap_size = ARRAY_SIZE(innovator_keymap),
131};
132
129static struct omap_kp_platform_data innovator_kp_data = { 133static struct omap_kp_platform_data innovator_kp_data = {
130 .rows = 8, 134 .rows = 8,
131 .cols = 8, 135 .cols = 8,
132 .keymap = innovator_keymap, 136 .keymap_data = &innovator_keymap_data,
133 .keymapsize = ARRAY_SIZE(innovator_keymap),
134 .delay = 4, 137 .delay = 4,
135}; 138};
136 139
@@ -290,13 +293,6 @@ static void __init innovator_init_irq(void)
290{ 293{
291 omap1_init_common_hw(); 294 omap1_init_common_hw();
292 omap_init_irq(); 295 omap_init_irq();
293 omap_gpio_init();
294#ifdef CONFIG_ARCH_OMAP15XX
295 if (cpu_is_omap1510()) {
296 omap1510_fpga_init_irq();
297 }
298#endif
299 innovator_init_smc91x();
300} 296}
301 297
302#ifdef CONFIG_ARCH_OMAP15XX 298#ifdef CONFIG_ARCH_OMAP15XX
@@ -387,6 +383,10 @@ static struct omap_board_config_kernel innovator_config[] = {
387 383
388static void __init innovator_init(void) 384static void __init innovator_init(void)
389{ 385{
386 if (cpu_is_omap1510())
387 omap1510_fpga_init_irq();
388 innovator_init_smc91x();
389
390#ifdef CONFIG_ARCH_OMAP15XX 390#ifdef CONFIG_ARCH_OMAP15XX
391 if (cpu_is_omap1510()) { 391 if (cpu_is_omap1510()) {
392 unsigned char reg; 392 unsigned char reg;
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index aa8375b2a0a3..d21f09dc78f4 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -54,19 +54,18 @@ static void __init omap_nokia770_init_irq(void)
54 omap_init_irq(); 54 omap_init_irq();
55} 55}
56 56
57static int nokia770_keymap[] = { 57static const unsigned int nokia770_keymap[] = {
58 KEY(0, 1, GROUP_0 | KEY_UP), 58 KEY(1, 0, GROUP_0 | KEY_UP),
59 KEY(0, 2, GROUP_1 | KEY_F5), 59 KEY(2, 0, GROUP_1 | KEY_F5),
60 KEY(1, 0, GROUP_0 | KEY_LEFT), 60 KEY(0, 1, GROUP_0 | KEY_LEFT),
61 KEY(1, 1, GROUP_0 | KEY_ENTER), 61 KEY(1, 1, GROUP_0 | KEY_ENTER),
62 KEY(1, 2, GROUP_0 | KEY_RIGHT), 62 KEY(2, 1, GROUP_0 | KEY_RIGHT),
63 KEY(2, 0, GROUP_1 | KEY_ESC), 63 KEY(0, 2, GROUP_1 | KEY_ESC),
64 KEY(2, 1, GROUP_0 | KEY_DOWN), 64 KEY(1, 2, GROUP_0 | KEY_DOWN),
65 KEY(2, 2, GROUP_1 | KEY_F4), 65 KEY(2, 2, GROUP_1 | KEY_F4),
66 KEY(3, 0, GROUP_2 | KEY_F7), 66 KEY(0, 3, GROUP_2 | KEY_F7),
67 KEY(3, 1, GROUP_2 | KEY_F8), 67 KEY(1, 3, GROUP_2 | KEY_F8),
68 KEY(3, 2, GROUP_2 | KEY_F6), 68 KEY(2, 3, GROUP_2 | KEY_F6),
69 0
70}; 69};
71 70
72static struct resource nokia770_kp_resources[] = { 71static struct resource nokia770_kp_resources[] = {
@@ -77,11 +76,15 @@ static struct resource nokia770_kp_resources[] = {
77 }, 76 },
78}; 77};
79 78
79static const struct matrix_keymap_data nokia770_keymap_data = {
80 .keymap = nokia770_keymap,
81 .keymap_size = ARRAY_SIZE(nokia770_keymap),
82};
83
80static struct omap_kp_platform_data nokia770_kp_data = { 84static struct omap_kp_platform_data nokia770_kp_data = {
81 .rows = 8, 85 .rows = 8,
82 .cols = 8, 86 .cols = 8,
83 .keymap = nokia770_keymap, 87 .keymap_data = &nokia770_keymap_data,
84 .keymapsize = ARRAY_SIZE(nokia770_keymap),
85 .delay = 4, 88 .delay = 4,
86}; 89};
87 90
@@ -246,7 +249,6 @@ static void __init omap_nokia770_init(void)
246 platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); 249 platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
247 spi_register_board_info(nokia770_spi_board_info, 250 spi_register_board_info(nokia770_spi_board_info,
248 ARRAY_SIZE(nokia770_spi_board_info)); 251 ARRAY_SIZE(nokia770_spi_board_info));
249 omap_gpio_init();
250 omap_serial_init(); 252 omap_serial_init();
251 omap_register_i2c_bus(1, 100, NULL, 0); 253 omap_register_i2c_bus(1, 100, NULL, 0);
252 hwa742_dev_init(); 254 hwa742_dev_init();
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index e9dd79149a8e..7c5e2112c776 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -283,9 +283,6 @@ static void __init osk_init_irq(void)
283{ 283{
284 omap1_init_common_hw(); 284 omap1_init_common_hw();
285 omap_init_irq(); 285 omap_init_irq();
286 omap_gpio_init();
287 osk_init_smc91x();
288 osk_init_cf();
289} 286}
290 287
291static struct omap_usb_config osk_usb_config __initdata = { 288static struct omap_usb_config osk_usb_config __initdata = {
@@ -341,25 +338,28 @@ static struct i2c_board_info __initdata mistral_i2c_board_info[] = {
341 */ 338 */
342}; 339};
343 340
344static const int osk_keymap[] = { 341static const unsigned int osk_keymap[] = {
345 /* KEY(col, row, code) */ 342 /* KEY(col, row, code) */
346 KEY(0, 0, KEY_F1), /* SW4 */ 343 KEY(0, 0, KEY_F1), /* SW4 */
347 KEY(0, 3, KEY_UP), /* (sw2/up) */ 344 KEY(3, 0, KEY_UP), /* (sw2/up) */
348 KEY(1, 1, KEY_LEFTCTRL), /* SW5 */ 345 KEY(1, 1, KEY_LEFTCTRL), /* SW5 */
349 KEY(1, 2, KEY_LEFT), /* (sw2/left) */ 346 KEY(2, 1, KEY_LEFT), /* (sw2/left) */
350 KEY(2, 0, KEY_SPACE), /* SW3 */ 347 KEY(0, 2, KEY_SPACE), /* SW3 */
351 KEY(2, 1, KEY_ESC), /* SW6 */ 348 KEY(1, 2, KEY_ESC), /* SW6 */
352 KEY(2, 2, KEY_DOWN), /* (sw2/down) */ 349 KEY(2, 2, KEY_DOWN), /* (sw2/down) */
353 KEY(3, 2, KEY_ENTER), /* (sw2/select) */ 350 KEY(2, 3, KEY_ENTER), /* (sw2/select) */
354 KEY(3, 3, KEY_RIGHT), /* (sw2/right) */ 351 KEY(3, 3, KEY_RIGHT), /* (sw2/right) */
355 0 352};
353
354static const struct matrix_keymap_data osk_keymap_data = {
355 .keymap = osk_keymap,
356 .keymap_size = ARRAY_SIZE(osk_keymap),
356}; 357};
357 358
358static struct omap_kp_platform_data osk_kp_data = { 359static struct omap_kp_platform_data osk_kp_data = {
359 .rows = 8, 360 .rows = 8,
360 .cols = 8, 361 .cols = 8,
361 .keymap = (int *) osk_keymap, 362 .keymap_data = &osk_keymap_data,
362 .keymapsize = ARRAY_SIZE(osk_keymap),
363 .delay = 9, 363 .delay = 9,
364}; 364};
365 365
@@ -541,6 +541,9 @@ static void __init osk_init(void)
541{ 541{
542 u32 l; 542 u32 l;
543 543
544 osk_init_smc91x();
545 osk_init_cf();
546
544 /* Workaround for wrong CS3 (NOR flash) timing 547 /* Workaround for wrong CS3 (NOR flash) timing
545 * There are some U-Boot versions out there which configure 548 * There are some U-Boot versions out there which configure
546 * wrong CS3 memory timings. This mainly leads to CRC 549 * wrong CS3 memory timings. This mainly leads to CRC
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index f32738b1eb6b..fb51ce6123d8 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -63,28 +63,31 @@ static void __init omap_palmte_init_irq(void)
63{ 63{
64 omap1_init_common_hw(); 64 omap1_init_common_hw();
65 omap_init_irq(); 65 omap_init_irq();
66 omap_gpio_init();
67} 66}
68 67
69static const int palmte_keymap[] = { 68static const unsigned int palmte_keymap[] = {
70 KEY(0, 0, KEY_F1), /* Calendar */ 69 KEY(0, 0, KEY_F1), /* Calendar */
71 KEY(0, 1, KEY_F2), /* Contacts */ 70 KEY(1, 0, KEY_F2), /* Contacts */
72 KEY(0, 2, KEY_F3), /* Tasks List */ 71 KEY(2, 0, KEY_F3), /* Tasks List */
73 KEY(0, 3, KEY_F4), /* Note Pad */ 72 KEY(3, 0, KEY_F4), /* Note Pad */
74 KEY(0, 4, KEY_POWER), 73 KEY(4, 0, KEY_POWER),
75 KEY(1, 0, KEY_LEFT), 74 KEY(0, 1, KEY_LEFT),
76 KEY(1, 1, KEY_DOWN), 75 KEY(1, 1, KEY_DOWN),
77 KEY(1, 2, KEY_UP), 76 KEY(2, 1, KEY_UP),
78 KEY(1, 3, KEY_RIGHT), 77 KEY(3, 1, KEY_RIGHT),
79 KEY(1, 4, KEY_ENTER), 78 KEY(4, 1, KEY_ENTER),
80 0, 79};
80
81static const struct matrix_keymap_data palmte_keymap_data = {
82 .keymap = palmte_keymap,
83 .keymap_size = ARRAY_SIZE(palmte_keymap),
81}; 84};
82 85
83static struct omap_kp_platform_data palmte_kp_data = { 86static struct omap_kp_platform_data palmte_kp_data = {
84 .rows = 8, 87 .rows = 8,
85 .cols = 8, 88 .cols = 8,
86 .keymap = (int *) palmte_keymap, 89 .keymap_data = &palmte_keymap_data,
87 .rep = 1, 90 .rep = true,
88 .delay = 12, 91 .delay = 12,
89}; 92};
90 93
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index ed1400a67f75..f04f2d36e7d3 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -51,19 +51,18 @@
51#define PALMTT_MMC_WP_GPIO 8 51#define PALMTT_MMC_WP_GPIO 8
52#define PALMTT_HDQ_GPIO 11 52#define PALMTT_HDQ_GPIO 11
53 53
54static int palmtt_keymap[] = { 54static const unsigned int palmtt_keymap[] = {
55 KEY(0, 0, KEY_ESC), 55 KEY(0, 0, KEY_ESC),
56 KEY(0, 1, KEY_SPACE), 56 KEY(1, 0, KEY_SPACE),
57 KEY(0, 2, KEY_LEFTCTRL), 57 KEY(2, 0, KEY_LEFTCTRL),
58 KEY(0, 3, KEY_TAB), 58 KEY(3, 0, KEY_TAB),
59 KEY(0, 4, KEY_ENTER), 59 KEY(4, 0, KEY_ENTER),
60 KEY(1, 0, KEY_LEFT), 60 KEY(0, 1, KEY_LEFT),
61 KEY(1, 1, KEY_DOWN), 61 KEY(1, 1, KEY_DOWN),
62 KEY(1, 2, KEY_UP), 62 KEY(2, 1, KEY_UP),
63 KEY(1, 3, KEY_RIGHT), 63 KEY(3, 1, KEY_RIGHT),
64 KEY(2, 0, KEY_SLEEP), 64 KEY(0, 2, KEY_SLEEP),
65 KEY(2, 4, KEY_Y), 65 KEY(4, 2, KEY_Y),
66 0
67}; 66};
68 67
69static struct mtd_partition palmtt_partitions[] = { 68static struct mtd_partition palmtt_partitions[] = {
@@ -136,10 +135,15 @@ static struct resource palmtt_kp_resources[] = {
136 }, 135 },
137}; 136};
138 137
138static const struct matrix_keymap_data palmtt_keymap_data = {
139 .keymap = palmtt_keymap,
140 .keymap_size = ARRAY_SIZE(palmtt_keymap),
141};
142
139static struct omap_kp_platform_data palmtt_kp_data = { 143static struct omap_kp_platform_data palmtt_kp_data = {
140 .rows = 6, 144 .rows = 6,
141 .cols = 3, 145 .cols = 3,
142 .keymap = palmtt_keymap, 146 .keymap_data = &palmtt_keymap_data,
143}; 147};
144 148
145static struct platform_device palmtt_kp_device = { 149static struct platform_device palmtt_kp_device = {
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index d7a245cef9a4..d7bbbe721a75 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -62,29 +62,32 @@ omap_palmz71_init_irq(void)
62{ 62{
63 omap1_init_common_hw(); 63 omap1_init_common_hw();
64 omap_init_irq(); 64 omap_init_irq();
65 omap_gpio_init();
66} 65}
67 66
68static int palmz71_keymap[] = { 67static const unsigned int palmz71_keymap[] = {
69 KEY(0, 0, KEY_F1), 68 KEY(0, 0, KEY_F1),
70 KEY(0, 1, KEY_F2), 69 KEY(1, 0, KEY_F2),
71 KEY(0, 2, KEY_F3), 70 KEY(2, 0, KEY_F3),
72 KEY(0, 3, KEY_F4), 71 KEY(3, 0, KEY_F4),
73 KEY(0, 4, KEY_POWER), 72 KEY(4, 0, KEY_POWER),
74 KEY(1, 0, KEY_LEFT), 73 KEY(0, 1, KEY_LEFT),
75 KEY(1, 1, KEY_DOWN), 74 KEY(1, 1, KEY_DOWN),
76 KEY(1, 2, KEY_UP), 75 KEY(2, 1, KEY_UP),
77 KEY(1, 3, KEY_RIGHT), 76 KEY(3, 1, KEY_RIGHT),
78 KEY(1, 4, KEY_ENTER), 77 KEY(4, 1, KEY_ENTER),
79 KEY(2, 0, KEY_CAMERA), 78 KEY(0, 2, KEY_CAMERA),
80 0, 79};
80
81static const struct matrix_keymap_data palmz71_keymap_data = {
82 .keymap = palmz71_keymap,
83 .keymap_size = ARRAY_SIZE(palmz71_keymap),
81}; 84};
82 85
83static struct omap_kp_platform_data palmz71_kp_data = { 86static struct omap_kp_platform_data palmz71_kp_data = {
84 .rows = 8, 87 .rows = 8,
85 .cols = 8, 88 .cols = 8,
86 .keymap = palmz71_keymap, 89 .keymap_data = &palmz71_keymap_data,
87 .rep = 1, 90 .rep = true,
88 .delay = 80, 91 .delay = 80,
89}; 92};
90 93
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index a8d16a255c18..3c8ee8489458 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -36,36 +36,35 @@
36#include <plat/common.h> 36#include <plat/common.h>
37#include <plat/board.h> 37#include <plat/board.h>
38 38
39static int p2_keymap[] = { 39static const unsigned int p2_keymap[] = {
40 KEY(0,0,KEY_UP), 40 KEY(0, 0, KEY_UP),
41 KEY(0,1,KEY_RIGHT), 41 KEY(1, 0, KEY_RIGHT),
42 KEY(0,2,KEY_LEFT), 42 KEY(2, 0, KEY_LEFT),
43 KEY(0,3,KEY_DOWN), 43 KEY(3, 0, KEY_DOWN),
44 KEY(0,4,KEY_ENTER), 44 KEY(4, 0, KEY_ENTER),
45 KEY(1,0,KEY_F10), 45 KEY(0, 1, KEY_F10),
46 KEY(1,1,KEY_SEND), 46 KEY(1, 1, KEY_SEND),
47 KEY(1,2,KEY_END), 47 KEY(2, 1, KEY_END),
48 KEY(1,3,KEY_VOLUMEDOWN), 48 KEY(3, 1, KEY_VOLUMEDOWN),
49 KEY(1,4,KEY_VOLUMEUP), 49 KEY(4, 1, KEY_VOLUMEUP),
50 KEY(1,5,KEY_RECORD), 50 KEY(5, 1, KEY_RECORD),
51 KEY(2,0,KEY_F9), 51 KEY(0, 2, KEY_F9),
52 KEY(2,1,KEY_3), 52 KEY(1, 2, KEY_3),
53 KEY(2,2,KEY_6), 53 KEY(2, 2, KEY_6),
54 KEY(2,3,KEY_9), 54 KEY(3, 2, KEY_9),
55 KEY(2,4,KEY_KPDOT), 55 KEY(4, 2, KEY_KPDOT),
56 KEY(3,0,KEY_BACK), 56 KEY(0, 3, KEY_BACK),
57 KEY(3,1,KEY_2), 57 KEY(1, 3, KEY_2),
58 KEY(3,2,KEY_5), 58 KEY(2, 3, KEY_5),
59 KEY(3,3,KEY_8), 59 KEY(3, 3, KEY_8),
60 KEY(3,4,KEY_0), 60 KEY(4, 3, KEY_0),
61 KEY(3,5,KEY_KPSLASH), 61 KEY(5, 3, KEY_KPSLASH),
62 KEY(4,0,KEY_HOME), 62 KEY(0, 4, KEY_HOME),
63 KEY(4,1,KEY_1), 63 KEY(1, 4, KEY_1),
64 KEY(4,2,KEY_4), 64 KEY(2, 4, KEY_4),
65 KEY(4,3,KEY_7), 65 KEY(3, 4, KEY_7),
66 KEY(4,4,KEY_KPASTERISK), 66 KEY(4, 4, KEY_KPASTERISK),
67 KEY(4,5,KEY_POWER), 67 KEY(5, 4, KEY_POWER),
68 0
69}; 68};
70 69
71static struct smc91x_platdata smc91x_info = { 70static struct smc91x_platdata smc91x_info = {
@@ -211,13 +210,17 @@ static struct resource kp_resources[] = {
211 }, 210 },
212}; 211};
213 212
213static const struct matrix_keymap_data p2_keymap_data = {
214 .keymap = p2_keymap,
215 .keymap_size = ARRAY_SIZE(p2_keymap),
216};
217
214static struct omap_kp_platform_data kp_data = { 218static struct omap_kp_platform_data kp_data = {
215 .rows = 8, 219 .rows = 8,
216 .cols = 8, 220 .cols = 8,
217 .keymap = p2_keymap, 221 .keymap_data = &p2_keymap_data,
218 .keymapsize = ARRAY_SIZE(p2_keymap),
219 .delay = 4, 222 .delay = 4,
220 .dbounce = 1, 223 .dbounce = true,
221}; 224};
222 225
223static struct platform_device kp_device = { 226static struct platform_device kp_device = {
@@ -251,8 +254,19 @@ static struct omap_board_config_kernel perseus2_config[] __initdata = {
251 { OMAP_TAG_LCD, &perseus2_lcd_config }, 254 { OMAP_TAG_LCD, &perseus2_lcd_config },
252}; 255};
253 256
257static void __init perseus2_init_smc91x(void)
258{
259 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
260 mdelay(50);
261 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
262 H2P2_DBG_FPGA_LAN_RESET);
263 mdelay(50);
264}
265
254static void __init omap_perseus2_init(void) 266static void __init omap_perseus2_init(void)
255{ 267{
268 perseus2_init_smc91x();
269
256 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) 270 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0)
257 BUG(); 271 BUG();
258 gpio_direction_input(P2_NAND_RB_GPIO_PIN); 272 gpio_direction_input(P2_NAND_RB_GPIO_PIN);
@@ -280,21 +294,10 @@ static void __init omap_perseus2_init(void)
280 omap_register_i2c_bus(1, 100, NULL, 0); 294 omap_register_i2c_bus(1, 100, NULL, 0);
281} 295}
282 296
283static void __init perseus2_init_smc91x(void)
284{
285 fpga_write(1, H2P2_DBG_FPGA_LAN_RESET);
286 mdelay(50);
287 fpga_write(fpga_read(H2P2_DBG_FPGA_LAN_RESET) & ~1,
288 H2P2_DBG_FPGA_LAN_RESET);
289 mdelay(50);
290}
291
292static void __init omap_perseus2_init_irq(void) 297static void __init omap_perseus2_init_irq(void)
293{ 298{
294 omap1_init_common_hw(); 299 omap1_init_common_hw();
295 omap_init_irq(); 300 omap_init_irq();
296 omap_gpio_init();
297 perseus2_init_smc91x();
298} 301}
299/* Only FPGA needs to be mapped here. All others are done with ioremap */ 302/* Only FPGA needs to be mapped here. All others are done with ioremap */
300static struct map_desc omap_perseus2_io_desc[] __initdata = { 303static struct map_desc omap_perseus2_io_desc[] __initdata = {
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index d25f59e5a773..d41fe2d0616a 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -164,36 +164,35 @@ EXPORT_SYMBOL(sx1_setusbpower);
164 164
165/*----------- Keypad -------------------------*/ 165/*----------- Keypad -------------------------*/
166 166
167static int sx1_keymap[] = { 167static const unsigned int sx1_keymap[] = {
168 KEY(5, 3, GROUP_0 | 117), /* camera Qt::Key_F17 */ 168 KEY(3, 5, GROUP_0 | 117), /* camera Qt::Key_F17 */
169 KEY(0, 4, GROUP_0 | 114), /* voice memo Qt::Key_F14 */ 169 KEY(4, 0, GROUP_0 | 114), /* voice memo Qt::Key_F14 */
170 KEY(1, 4, GROUP_2 | 114), /* voice memo */ 170 KEY(4, 1, GROUP_2 | 114), /* voice memo */
171 KEY(2, 4, GROUP_3 | 114), /* voice memo */ 171 KEY(4, 2, GROUP_3 | 114), /* voice memo */
172 KEY(0, 0, GROUP_1 | KEY_F12), /* red button Qt::Key_Hangup */ 172 KEY(0, 0, GROUP_1 | KEY_F12), /* red button Qt::Key_Hangup */
173 KEY(4, 3, GROUP_1 | KEY_LEFT), 173 KEY(3, 4, GROUP_1 | KEY_LEFT),
174 KEY(2, 3, GROUP_1 | KEY_DOWN), 174 KEY(3, 2, GROUP_1 | KEY_DOWN),
175 KEY(1, 3, GROUP_1 | KEY_RIGHT), 175 KEY(3, 1, GROUP_1 | KEY_RIGHT),
176 KEY(0, 3, GROUP_1 | KEY_UP), 176 KEY(3, 0, GROUP_1 | KEY_UP),
177 KEY(3, 3, GROUP_1 | KEY_POWER), /* joystick press or Qt::Key_Select */ 177 KEY(3, 3, GROUP_1 | KEY_POWER), /* joystick press or Qt::Key_Select */
178 KEY(5, 0, GROUP_1 | KEY_1), 178 KEY(0, 5, GROUP_1 | KEY_1),
179 KEY(4, 0, GROUP_1 | KEY_2), 179 KEY(0, 4, GROUP_1 | KEY_2),
180 KEY(3, 0, GROUP_1 | KEY_3), 180 KEY(0, 3, GROUP_1 | KEY_3),
181 KEY(3, 4, GROUP_1 | KEY_4), 181 KEY(4, 3, GROUP_1 | KEY_4),
182 KEY(4, 4, GROUP_1 | KEY_5), 182 KEY(4, 4, GROUP_1 | KEY_5),
183 KEY(5, 4, GROUP_1 | KEY_KPASTERISK),/* "*" */ 183 KEY(4, 5, GROUP_1 | KEY_KPASTERISK),/* "*" */
184 KEY(4, 1, GROUP_1 | KEY_6), 184 KEY(1, 4, GROUP_1 | KEY_6),
185 KEY(5, 1, GROUP_1 | KEY_7), 185 KEY(1, 5, GROUP_1 | KEY_7),
186 KEY(3, 1, GROUP_1 | KEY_8), 186 KEY(1, 3, GROUP_1 | KEY_8),
187 KEY(3, 2, GROUP_1 | KEY_9), 187 KEY(2, 3, GROUP_1 | KEY_9),
188 KEY(5, 2, GROUP_1 | KEY_0), 188 KEY(2, 5, GROUP_1 | KEY_0),
189 KEY(4, 2, GROUP_1 | 113), /* # F13 Toggle input method Qt::Key_F13 */ 189 KEY(2, 4, GROUP_1 | 113), /* # F13 Toggle input method Qt::Key_F13 */
190 KEY(0, 1, GROUP_1 | KEY_F11), /* green button Qt::Key_Call */ 190 KEY(1, 0, GROUP_1 | KEY_F11), /* green button Qt::Key_Call */
191 KEY(1, 2, GROUP_1 | KEY_YEN), /* left soft Qt::Key_Context1 */ 191 KEY(2, 1, GROUP_1 | KEY_YEN), /* left soft Qt::Key_Context1 */
192 KEY(2, 2, GROUP_1 | KEY_F8), /* right soft Qt::Key_Back */ 192 KEY(2, 2, GROUP_1 | KEY_F8), /* right soft Qt::Key_Back */
193 KEY(2, 1, GROUP_1 | KEY_LEFTSHIFT), /* shift */ 193 KEY(1, 2, GROUP_1 | KEY_LEFTSHIFT), /* shift */
194 KEY(1, 1, GROUP_1 | KEY_BACKSPACE), /* C (clear) */ 194 KEY(1, 1, GROUP_1 | KEY_BACKSPACE), /* C (clear) */
195 KEY(0, 2, GROUP_1 | KEY_F7), /* menu Qt::Key_Menu */ 195 KEY(2, 0, GROUP_1 | KEY_F7), /* menu Qt::Key_Menu */
196 0
197}; 196};
198 197
199static struct resource sx1_kp_resources[] = { 198static struct resource sx1_kp_resources[] = {
@@ -204,11 +203,15 @@ static struct resource sx1_kp_resources[] = {
204 }, 203 },
205}; 204};
206 205
206static const struct matrix_keymap_data sx1_keymap_data = {
207 .keymap = sx1_keymap,
208 .keymap_size = ARRAY_SIZE(sx1_keymap),
209};
210
207static struct omap_kp_platform_data sx1_kp_data = { 211static struct omap_kp_platform_data sx1_kp_data = {
208 .rows = 6, 212 .rows = 6,
209 .cols = 6, 213 .cols = 6,
210 .keymap = sx1_keymap, 214 .keymap_data = &sx1_keymap_data,
211 .keymapsize = ARRAY_SIZE(sx1_keymap),
212 .delay = 80, 215 .delay = 80,
213}; 216};
214 217
@@ -409,7 +412,6 @@ static void __init omap_sx1_init_irq(void)
409{ 412{
410 omap1_init_common_hw(); 413 omap1_init_common_hw();
411 omap_init_irq(); 414 omap_init_irq();
412 omap_gpio_init();
413} 415}
414/*----------------------------------------*/ 416/*----------------------------------------*/
415 417
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index f5992c239bcd..815a69ce821d 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -83,6 +83,9 @@ static struct platform_device serial_device = {
83 83
84static int __init ext_uart_init(void) 84static int __init ext_uart_init(void)
85{ 85{
86 if (!machine_is_voiceblue())
87 return -ENODEV;
88
86 return platform_device_register(&serial_device); 89 return platform_device_register(&serial_device);
87} 90}
88arch_initcall(ext_uart_init); 91arch_initcall(ext_uart_init);
@@ -158,7 +161,6 @@ static void __init voiceblue_init_irq(void)
158{ 161{
159 omap1_init_common_hw(); 162 omap1_init_common_hw();
160 omap_init_irq(); 163 omap_init_irq();
161 omap_gpio_init();
162} 164}
163 165
164static void __init voiceblue_init(void) 166static void __init voiceblue_init(void)
@@ -236,6 +238,9 @@ static struct notifier_block panic_block = {
236 238
237static int __init voiceblue_setup(void) 239static int __init voiceblue_setup(void)
238{ 240{
241 if (!machine_is_voiceblue())
242 return -ENODEV;
243
239 /* Setup panic notifier */ 244 /* Setup panic notifier */
240 atomic_notifier_chain_register(&panic_notifier_list, &panic_block); 245 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
241 246
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index af54114b8f08..92400b9eb69f 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -143,7 +143,7 @@ static struct arm_idlect1_clk armper_ck = {
143 * activation. [ GPIO code for 1510 ] 143 * activation. [ GPIO code for 1510 ]
144 */ 144 */
145static struct clk arm_gpio_ck = { 145static struct clk arm_gpio_ck = {
146 .name = "arm_gpio_ck", 146 .name = "ick",
147 .ops = &clkops_generic, 147 .ops = &clkops_generic,
148 .parent = &ck_dpll1, 148 .parent = &ck_dpll1,
149 .flags = ENABLE_ON_INIT, 149 .flags = ENABLE_ON_INIT,
@@ -684,7 +684,7 @@ static struct omap_clk omap_clks[] = {
684 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX), 684 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX),
685 CLK(NULL, "arm_ck", &arm_ck, CK_16XX | CK_1510 | CK_310), 685 CLK(NULL, "arm_ck", &arm_ck, CK_16XX | CK_1510 | CK_310),
686 CLK(NULL, "armper_ck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310), 686 CLK(NULL, "armper_ck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
687 CLK(NULL, "arm_gpio_ck", &arm_gpio_ck, CK_1510 | CK_310), 687 CLK("omap_gpio.0", "ick", &arm_gpio_ck, CK_1510 | CK_310),
688 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX), 688 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
689 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310), 689 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310),
690 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310), 690 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310),
@@ -736,9 +736,9 @@ static struct omap_clk omap_clks[] = {
736 CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX), 736 CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX),
737 /* Virtual clocks */ 737 /* Virtual clocks */
738 CLK(NULL, "mpu", &virtual_ck_mpu, CK_16XX | CK_1510 | CK_310), 738 CLK(NULL, "mpu", &virtual_ck_mpu, CK_16XX | CK_1510 | CK_310),
739 CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX), 739 CLK("omap_i2c.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX),
740 CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX), 740 CLK("omap_i2c.1", "ick", &i2c_ick, CK_16XX),
741 CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX), 741 CLK("omap_i2c.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX),
742 CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX), 742 CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX),
743 CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX), 743 CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX),
744 CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX), 744 CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX),
@@ -823,12 +823,10 @@ int __init omap1_clk_init(void)
823 crystal_type = info->system_clock_type; 823 crystal_type = info->system_clock_type;
824 } 824 }
825 825
826#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 826 if (cpu_is_omap7xx())
827 ck_ref.rate = 13000000; 827 ck_ref.rate = 13000000;
828#elif defined(CONFIG_ARCH_OMAP16XX) 828 if (cpu_is_omap16xx() && crystal_type == 2)
829 if (crystal_type == 2)
830 ck_ref.rate = 19200000; 829 ck_ref.rate = 19200000;
831#endif
832 830
833 pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: " 831 pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: "
834 "0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL), 832 "0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL),
@@ -883,10 +881,11 @@ int __init omap1_clk_init(void)
883 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10, 881 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
884 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); 882 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
885 883
886#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE) 884 if (machine_is_omap_perseus2() || machine_is_omap_fsample()) {
887 /* Select slicer output as OMAP input clock */ 885 /* Select slicer output as OMAP input clock */
888 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1, OMAP7XX_PCC_UPLD_CTRL); 886 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1,
889#endif 887 OMAP7XX_PCC_UPLD_CTRL);
888 }
890 889
891 /* Amstrad Delta wants BCLK high when inactive */ 890 /* Amstrad Delta wants BCLK high when inactive */
892 if (machine_is_ams_delta()) 891 if (machine_is_ams_delta())
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index e7f9ee63dce5..b0f4c231595f 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -17,6 +17,7 @@
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/spi/spi.h> 18#include <linux/spi/spi.h>
19 19
20#include <mach/camera.h>
20#include <mach/hardware.h> 21#include <mach/hardware.h>
21#include <asm/mach/map.h> 22#include <asm/mach/map.h>
22 23
@@ -287,6 +288,9 @@ static inline void omap_init_audio(void) {}
287 */ 288 */
288static int __init omap1_init_devices(void) 289static int __init omap1_init_devices(void)
289{ 290{
291 if (!cpu_class_is_omap1())
292 return -ENODEV;
293
290 /* please keep these calls, and their implementations above, 294 /* please keep these calls, and their implementations above,
291 * in alphabetical order so they're easier to sort through. 295 * in alphabetical order so they're easier to sort through.
292 */ 296 */
diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c
new file mode 100644
index 000000000000..d8559344c6e2
--- /dev/null
+++ b/arch/arm/mach-omap1/dma.c
@@ -0,0 +1,390 @@
1/*
2 * OMAP1/OMAP7xx - specific DMA driver
3 *
4 * Copyright (C) 2003 - 2008 Nokia Corporation
5 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
6 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
7 * Graphics DMA and LCD DMA graphics tranformations
8 * by Imre Deak <imre.deak@nokia.com>
9 * OMAP2/3 support Copyright (C) 2004-2007 Texas Instruments, Inc.
10 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
11 *
12 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
13 * Converted DMA library into platform driver
14 * - G, Manjunath Kondaiah <manjugk@ti.com>
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation.
19 */
20
21#include <linux/err.h>
22#include <linux/io.h>
23#include <linux/slab.h>
24#include <linux/module.h>
25#include <linux/init.h>
26#include <linux/device.h>
27
28#include <plat/dma.h>
29#include <plat/tc.h>
30#include <plat/irqs.h>
31
32#define OMAP1_DMA_BASE (0xfffed800)
33#define OMAP1_LOGICAL_DMA_CH_COUNT 17
34#define OMAP1_DMA_STRIDE 0x40
35
36static u32 errata;
37static u32 enable_1510_mode;
38static u8 dma_stride;
39static enum omap_reg_offsets dma_common_ch_start, dma_common_ch_end;
40
41static u16 reg_map[] = {
42 [GCR] = 0x400,
43 [GSCR] = 0x404,
44 [GRST1] = 0x408,
45 [HW_ID] = 0x442,
46 [PCH2_ID] = 0x444,
47 [PCH0_ID] = 0x446,
48 [PCH1_ID] = 0x448,
49 [PCHG_ID] = 0x44a,
50 [PCHD_ID] = 0x44c,
51 [CAPS_0] = 0x44e,
52 [CAPS_1] = 0x452,
53 [CAPS_2] = 0x456,
54 [CAPS_3] = 0x458,
55 [CAPS_4] = 0x45a,
56 [PCH2_SR] = 0x460,
57 [PCH0_SR] = 0x480,
58 [PCH1_SR] = 0x482,
59 [PCHD_SR] = 0x4c0,
60
61 /* Common Registers */
62 [CSDP] = 0x00,
63 [CCR] = 0x02,
64 [CICR] = 0x04,
65 [CSR] = 0x06,
66 [CEN] = 0x10,
67 [CFN] = 0x12,
68 [CSFI] = 0x14,
69 [CSEI] = 0x16,
70 [CPC] = 0x18, /* 15xx only */
71 [CSAC] = 0x18,
72 [CDAC] = 0x1a,
73 [CDEI] = 0x1c,
74 [CDFI] = 0x1e,
75 [CLNK_CTRL] = 0x28,
76
77 /* Channel specific register offsets */
78 [CSSA] = 0x08,
79 [CDSA] = 0x0c,
80 [COLOR] = 0x20,
81 [CCR2] = 0x24,
82 [LCH_CTRL] = 0x2a,
83};
84
85static struct resource res[] __initdata = {
86 [0] = {
87 .start = OMAP1_DMA_BASE,
88 .end = OMAP1_DMA_BASE + SZ_2K - 1,
89 .flags = IORESOURCE_MEM,
90 },
91 [1] = {
92 .name = "0",
93 .start = INT_DMA_CH0_6,
94 .flags = IORESOURCE_IRQ,
95 },
96 [2] = {
97 .name = "1",
98 .start = INT_DMA_CH1_7,
99 .flags = IORESOURCE_IRQ,
100 },
101 [3] = {
102 .name = "2",
103 .start = INT_DMA_CH2_8,
104 .flags = IORESOURCE_IRQ,
105 },
106 [4] = {
107 .name = "3",
108 .start = INT_DMA_CH3,
109 .flags = IORESOURCE_IRQ,
110 },
111 [5] = {
112 .name = "4",
113 .start = INT_DMA_CH4,
114 .flags = IORESOURCE_IRQ,
115 },
116 [6] = {
117 .name = "5",
118 .start = INT_DMA_CH5,
119 .flags = IORESOURCE_IRQ,
120 },
121 /* Handled in lcd_dma.c */
122 [7] = {
123 .name = "6",
124 .start = INT_1610_DMA_CH6,
125 .flags = IORESOURCE_IRQ,
126 },
127 /* irq's for omap16xx and omap7xx */
128 [8] = {
129 .name = "7",
130 .start = INT_1610_DMA_CH7,
131 .flags = IORESOURCE_IRQ,
132 },
133 [9] = {
134 .name = "8",
135 .start = INT_1610_DMA_CH8,
136 .flags = IORESOURCE_IRQ,
137 },
138 [10] = {
139 .name = "9",
140 .start = INT_1610_DMA_CH9,
141 .flags = IORESOURCE_IRQ,
142 },
143 [11] = {
144 .name = "10",
145 .start = INT_1610_DMA_CH10,
146 .flags = IORESOURCE_IRQ,
147 },
148 [12] = {
149 .name = "11",
150 .start = INT_1610_DMA_CH11,
151 .flags = IORESOURCE_IRQ,
152 },
153 [13] = {
154 .name = "12",
155 .start = INT_1610_DMA_CH12,
156 .flags = IORESOURCE_IRQ,
157 },
158 [14] = {
159 .name = "13",
160 .start = INT_1610_DMA_CH13,
161 .flags = IORESOURCE_IRQ,
162 },
163 [15] = {
164 .name = "14",
165 .start = INT_1610_DMA_CH14,
166 .flags = IORESOURCE_IRQ,
167 },
168 [16] = {
169 .name = "15",
170 .start = INT_1610_DMA_CH15,
171 .flags = IORESOURCE_IRQ,
172 },
173 [17] = {
174 .name = "16",
175 .start = INT_DMA_LCD,
176 .flags = IORESOURCE_IRQ,
177 },
178};
179
180static void __iomem *dma_base;
181static inline void dma_write(u32 val, int reg, int lch)
182{
183 u8 stride;
184 u32 offset;
185
186 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
187 offset = reg_map[reg] + (stride * lch);
188
189 __raw_writew(val, dma_base + offset);
190 if ((reg > CLNK_CTRL && reg < CCEN) ||
191 (reg > PCHD_ID && reg < CAPS_2)) {
192 u32 offset2 = reg_map[reg] + 2 + (stride * lch);
193 __raw_writew(val >> 16, dma_base + offset2);
194 }
195}
196
197static inline u32 dma_read(int reg, int lch)
198{
199 u8 stride;
200 u32 offset, val;
201
202 stride = (reg >= dma_common_ch_start) ? dma_stride : 0;
203 offset = reg_map[reg] + (stride * lch);
204
205 val = __raw_readw(dma_base + offset);
206 if ((reg > CLNK_CTRL && reg < CCEN) ||
207 (reg > PCHD_ID && reg < CAPS_2)) {
208 u16 upper;
209 u32 offset2 = reg_map[reg] + 2 + (stride * lch);
210 upper = __raw_readw(dma_base + offset2);
211 val |= (upper << 16);
212 }
213 return val;
214}
215
216static void omap1_clear_lch_regs(int lch)
217{
218 int i = dma_common_ch_start;
219
220 for (; i <= dma_common_ch_end; i += 1)
221 dma_write(0, i, lch);
222}
223
224static void omap1_clear_dma(int lch)
225{
226 u32 l;
227
228 l = dma_read(CCR, lch);
229 l &= ~OMAP_DMA_CCR_EN;
230 dma_write(l, CCR, lch);
231
232 /* Clear pending interrupts */
233 l = dma_read(CSR, lch);
234}
235
236static void omap1_show_dma_caps(void)
237{
238 if (enable_1510_mode) {
239 printk(KERN_INFO "DMA support for OMAP15xx initialized\n");
240 } else {
241 u16 w;
242 printk(KERN_INFO "OMAP DMA hardware version %d\n",
243 dma_read(HW_ID, 0));
244 printk(KERN_INFO "DMA capabilities: %08x:%08x:%04x:%04x:%04x\n",
245 dma_read(CAPS_0, 0), dma_read(CAPS_1, 0),
246 dma_read(CAPS_2, 0), dma_read(CAPS_3, 0),
247 dma_read(CAPS_4, 0));
248
249 /* Disable OMAP 3.0/3.1 compatibility mode. */
250 w = dma_read(GSCR, 0);
251 w |= 1 << 3;
252 dma_write(w, GSCR, 0);
253 }
254 return;
255}
256
257static u32 configure_dma_errata(void)
258{
259
260 /*
261 * Erratum 3.2/3.3: sometimes 0 is returned if CSAC/CDAC is
262 * read before the DMA controller finished disabling the channel.
263 */
264 if (!cpu_is_omap15xx())
265 SET_DMA_ERRATA(DMA_ERRATA_3_3);
266
267 return errata;
268}
269
270static int __init omap1_system_dma_init(void)
271{
272 struct omap_system_dma_plat_info *p;
273 struct omap_dma_dev_attr *d;
274 struct platform_device *pdev;
275 int ret;
276
277 pdev = platform_device_alloc("omap_dma_system", 0);
278 if (!pdev) {
279 pr_err("%s: Unable to device alloc for dma\n",
280 __func__);
281 return -ENOMEM;
282 }
283
284 dma_base = ioremap(res[0].start, resource_size(&res[0]));
285 if (!dma_base) {
286 pr_err("%s: Unable to ioremap\n", __func__);
287 return -ENODEV;
288 }
289
290 ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
291 if (ret) {
292 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
293 __func__, pdev->name, pdev->id);
294 goto exit_device_del;
295 }
296
297 p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL);
298 if (!p) {
299 dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n",
300 __func__, pdev->name);
301 ret = -ENOMEM;
302 goto exit_device_put;
303 }
304
305 d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL);
306 if (!d) {
307 dev_err(&pdev->dev, "%s: Unable to allocate 'd' for %s\n",
308 __func__, pdev->name);
309 ret = -ENOMEM;
310 goto exit_release_p;
311 }
312
313 d->lch_count = OMAP1_LOGICAL_DMA_CH_COUNT;
314
315 /* Valid attributes for omap1 plus processors */
316 if (cpu_is_omap15xx())
317 d->dev_caps = ENABLE_1510_MODE;
318 enable_1510_mode = d->dev_caps & ENABLE_1510_MODE;
319
320 d->dev_caps |= SRC_PORT;
321 d->dev_caps |= DST_PORT;
322 d->dev_caps |= SRC_INDEX;
323 d->dev_caps |= DST_INDEX;
324 d->dev_caps |= IS_BURST_ONLY4;
325 d->dev_caps |= CLEAR_CSR_ON_READ;
326 d->dev_caps |= IS_WORD_16;
327
328
329 d->chan = kzalloc(sizeof(struct omap_dma_lch) *
330 (d->lch_count), GFP_KERNEL);
331 if (!d->chan) {
332 dev_err(&pdev->dev, "%s: Memory allocation failed"
333 "for d->chan!!!\n", __func__);
334 goto exit_release_d;
335 }
336
337 if (cpu_is_omap15xx())
338 d->chan_count = 9;
339 else if (cpu_is_omap16xx() || cpu_is_omap7xx()) {
340 if (!(d->dev_caps & ENABLE_1510_MODE))
341 d->chan_count = 16;
342 else
343 d->chan_count = 9;
344 }
345
346 p->dma_attr = d;
347
348 p->show_dma_caps = omap1_show_dma_caps;
349 p->clear_lch_regs = omap1_clear_lch_regs;
350 p->clear_dma = omap1_clear_dma;
351 p->dma_write = dma_write;
352 p->dma_read = dma_read;
353 p->disable_irq_lch = NULL;
354
355 p->errata = configure_dma_errata();
356
357 ret = platform_device_add_data(pdev, p, sizeof(*p));
358 if (ret) {
359 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
360 __func__, pdev->name, pdev->id);
361 goto exit_release_chan;
362 }
363
364 ret = platform_device_add(pdev);
365 if (ret) {
366 dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n",
367 __func__, pdev->name, pdev->id);
368 goto exit_release_chan;
369 }
370
371 dma_stride = OMAP1_DMA_STRIDE;
372 dma_common_ch_start = CPC;
373 dma_common_ch_end = COLOR;
374
375 return ret;
376
377exit_release_chan:
378 kfree(d->chan);
379exit_release_d:
380 kfree(d);
381exit_release_p:
382 kfree(p);
383exit_device_put:
384 platform_device_put(pdev);
385exit_device_del:
386 platform_device_del(pdev);
387
388 return ret;
389}
390arch_initcall(omap1_system_dma_init);
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
index 0b07a78eeaa7..acd161666408 100644
--- a/arch/arm/mach-omap1/flash.c
+++ b/arch/arm/mach-omap1/flash.c
@@ -11,6 +11,7 @@
11 11
12#include <plat/io.h> 12#include <plat/io.h>
13#include <plat/tc.h> 13#include <plat/tc.h>
14#include <plat/flash.h>
14 15
15void omap1_set_vpp(struct map_info *map, int enable) 16void omap1_set_vpp(struct map_info *map, int enable)
16{ 17{
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 5cfce1636da0..8780e75cdc3d 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -143,7 +143,7 @@ static struct irq_chip omap_fpga_irq = {
143 */ 143 */
144void omap1510_fpga_init_irq(void) 144void omap1510_fpga_init_irq(void)
145{ 145{
146 int i; 146 int i, res;
147 147
148 __raw_writeb(0, OMAP1510_FPGA_IMR_LO); 148 __raw_writeb(0, OMAP1510_FPGA_IMR_LO);
149 __raw_writeb(0, OMAP1510_FPGA_IMR_HI); 149 __raw_writeb(0, OMAP1510_FPGA_IMR_HI);
@@ -177,10 +177,12 @@ void omap1510_fpga_init_irq(void)
177 * NOTE: For general GPIO/MPUIO access and interrupts, please see 177 * NOTE: For general GPIO/MPUIO access and interrupts, please see
178 * gpio.[ch] 178 * gpio.[ch]
179 */ 179 */
180 gpio_request(13, "FPGA irq"); 180 res = gpio_request(13, "FPGA irq");
181 if (res) {
182 pr_err("%s failed to get gpio\n", __func__);
183 return;
184 }
181 gpio_direction_input(13); 185 gpio_direction_input(13);
182 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING); 186 set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING);
183 set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); 187 set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux);
184} 188}
185
186EXPORT_SYMBOL(omap1510_fpga_init_irq);
diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
new file mode 100644
index 000000000000..04c4b04cf54e
--- /dev/null
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -0,0 +1,99 @@
1/*
2 * OMAP15xx specific gpio init
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Author:
7 * Charulatha V <charu@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/gpio.h>
20
21#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
22#define OMAP1510_GPIO_BASE 0xFFFCE000
23
24/* gpio1 */
25static struct __initdata resource omap15xx_mpu_gpio_resources[] = {
26 {
27 .start = OMAP1_MPUIO_VBASE,
28 .end = OMAP1_MPUIO_VBASE + SZ_2K - 1,
29 .flags = IORESOURCE_MEM,
30 },
31 {
32 .start = INT_MPUIO,
33 .flags = IORESOURCE_IRQ,
34 },
35};
36
37static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
38 .virtual_irq_start = IH_MPUIO_BASE,
39 .bank_type = METHOD_MPUIO,
40 .bank_width = 16,
41 .bank_stride = 1,
42};
43
44static struct __initdata platform_device omap15xx_mpu_gpio = {
45 .name = "omap_gpio",
46 .id = 0,
47 .dev = {
48 .platform_data = &omap15xx_mpu_gpio_config,
49 },
50 .num_resources = ARRAY_SIZE(omap15xx_mpu_gpio_resources),
51 .resource = omap15xx_mpu_gpio_resources,
52};
53
54/* gpio2 */
55static struct __initdata resource omap15xx_gpio_resources[] = {
56 {
57 .start = OMAP1510_GPIO_BASE,
58 .end = OMAP1510_GPIO_BASE + SZ_2K - 1,
59 .flags = IORESOURCE_MEM,
60 },
61 {
62 .start = INT_GPIO_BANK1,
63 .flags = IORESOURCE_IRQ,
64 },
65};
66
67static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
68 .virtual_irq_start = IH_GPIO_BASE,
69 .bank_type = METHOD_GPIO_1510,
70 .bank_width = 16,
71};
72
73static struct __initdata platform_device omap15xx_gpio = {
74 .name = "omap_gpio",
75 .id = 1,
76 .dev = {
77 .platform_data = &omap15xx_gpio_config,
78 },
79 .num_resources = ARRAY_SIZE(omap15xx_gpio_resources),
80 .resource = omap15xx_gpio_resources,
81};
82
83/*
84 * omap15xx_gpio_init needs to be done before
85 * machine_init functions access gpio APIs.
86 * Hence omap15xx_gpio_init is a postcore_initcall.
87 */
88static int __init omap15xx_gpio_init(void)
89{
90 if (!cpu_is_omap15xx())
91 return -EINVAL;
92
93 platform_device_register(&omap15xx_mpu_gpio);
94 platform_device_register(&omap15xx_gpio);
95
96 gpio_bank_count = 2;
97 return 0;
98}
99postcore_initcall(omap15xx_gpio_init);
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
new file mode 100644
index 000000000000..5dd0d4c82b24
--- /dev/null
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -0,0 +1,200 @@
1/*
2 * OMAP16xx specific gpio init
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Author:
7 * Charulatha V <charu@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/gpio.h>
20
21#define OMAP1610_GPIO1_BASE 0xfffbe400
22#define OMAP1610_GPIO2_BASE 0xfffbec00
23#define OMAP1610_GPIO3_BASE 0xfffbb400
24#define OMAP1610_GPIO4_BASE 0xfffbbc00
25#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
26
27/* mpu gpio */
28static struct __initdata resource omap16xx_mpu_gpio_resources[] = {
29 {
30 .start = OMAP1_MPUIO_VBASE,
31 .end = OMAP1_MPUIO_VBASE + SZ_2K - 1,
32 .flags = IORESOURCE_MEM,
33 },
34 {
35 .start = INT_MPUIO,
36 .flags = IORESOURCE_IRQ,
37 },
38};
39
40static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
41 .virtual_irq_start = IH_MPUIO_BASE,
42 .bank_type = METHOD_MPUIO,
43 .bank_width = 16,
44 .bank_stride = 1,
45};
46
47static struct __initdata platform_device omap16xx_mpu_gpio = {
48 .name = "omap_gpio",
49 .id = 0,
50 .dev = {
51 .platform_data = &omap16xx_mpu_gpio_config,
52 },
53 .num_resources = ARRAY_SIZE(omap16xx_mpu_gpio_resources),
54 .resource = omap16xx_mpu_gpio_resources,
55};
56
57/* gpio1 */
58static struct __initdata resource omap16xx_gpio1_resources[] = {
59 {
60 .start = OMAP1610_GPIO1_BASE,
61 .end = OMAP1610_GPIO1_BASE + SZ_2K - 1,
62 .flags = IORESOURCE_MEM,
63 },
64 {
65 .start = INT_GPIO_BANK1,
66 .flags = IORESOURCE_IRQ,
67 },
68};
69
70static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = {
71 .virtual_irq_start = IH_GPIO_BASE,
72 .bank_type = METHOD_GPIO_1610,
73 .bank_width = 16,
74};
75
76static struct __initdata platform_device omap16xx_gpio1 = {
77 .name = "omap_gpio",
78 .id = 1,
79 .dev = {
80 .platform_data = &omap16xx_gpio1_config,
81 },
82 .num_resources = ARRAY_SIZE(omap16xx_gpio1_resources),
83 .resource = omap16xx_gpio1_resources,
84};
85
86/* gpio2 */
87static struct __initdata resource omap16xx_gpio2_resources[] = {
88 {
89 .start = OMAP1610_GPIO2_BASE,
90 .end = OMAP1610_GPIO2_BASE + SZ_2K - 1,
91 .flags = IORESOURCE_MEM,
92 },
93 {
94 .start = INT_1610_GPIO_BANK2,
95 .flags = IORESOURCE_IRQ,
96 },
97};
98
99static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = {
100 .virtual_irq_start = IH_GPIO_BASE + 16,
101 .bank_type = METHOD_GPIO_1610,
102 .bank_width = 16,
103};
104
105static struct __initdata platform_device omap16xx_gpio2 = {
106 .name = "omap_gpio",
107 .id = 2,
108 .dev = {
109 .platform_data = &omap16xx_gpio2_config,
110 },
111 .num_resources = ARRAY_SIZE(omap16xx_gpio2_resources),
112 .resource = omap16xx_gpio2_resources,
113};
114
115/* gpio3 */
116static struct __initdata resource omap16xx_gpio3_resources[] = {
117 {
118 .start = OMAP1610_GPIO3_BASE,
119 .end = OMAP1610_GPIO3_BASE + SZ_2K - 1,
120 .flags = IORESOURCE_MEM,
121 },
122 {
123 .start = INT_1610_GPIO_BANK3,
124 .flags = IORESOURCE_IRQ,
125 },
126};
127
128static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = {
129 .virtual_irq_start = IH_GPIO_BASE + 32,
130 .bank_type = METHOD_GPIO_1610,
131 .bank_width = 16,
132};
133
134static struct __initdata platform_device omap16xx_gpio3 = {
135 .name = "omap_gpio",
136 .id = 3,
137 .dev = {
138 .platform_data = &omap16xx_gpio3_config,
139 },
140 .num_resources = ARRAY_SIZE(omap16xx_gpio3_resources),
141 .resource = omap16xx_gpio3_resources,
142};
143
144/* gpio4 */
145static struct __initdata resource omap16xx_gpio4_resources[] = {
146 {
147 .start = OMAP1610_GPIO4_BASE,
148 .end = OMAP1610_GPIO4_BASE + SZ_2K - 1,
149 .flags = IORESOURCE_MEM,
150 },
151 {
152 .start = INT_1610_GPIO_BANK4,
153 .flags = IORESOURCE_IRQ,
154 },
155};
156
157static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = {
158 .virtual_irq_start = IH_GPIO_BASE + 48,
159 .bank_type = METHOD_GPIO_1610,
160 .bank_width = 16,
161};
162
163static struct __initdata platform_device omap16xx_gpio4 = {
164 .name = "omap_gpio",
165 .id = 4,
166 .dev = {
167 .platform_data = &omap16xx_gpio4_config,
168 },
169 .num_resources = ARRAY_SIZE(omap16xx_gpio4_resources),
170 .resource = omap16xx_gpio4_resources,
171};
172
173static struct __initdata platform_device * omap16xx_gpio_dev[] = {
174 &omap16xx_mpu_gpio,
175 &omap16xx_gpio1,
176 &omap16xx_gpio2,
177 &omap16xx_gpio3,
178 &omap16xx_gpio4,
179};
180
181/*
182 * omap16xx_gpio_init needs to be done before
183 * machine_init functions access gpio APIs.
184 * Hence omap16xx_gpio_init is a postcore_initcall.
185 */
186static int __init omap16xx_gpio_init(void)
187{
188 int i;
189
190 if (!cpu_is_omap16xx())
191 return -EINVAL;
192
193 for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++)
194 platform_device_register(omap16xx_gpio_dev[i]);
195
196 gpio_bank_count = ARRAY_SIZE(omap16xx_gpio_dev);
197
198 return 0;
199}
200postcore_initcall(omap16xx_gpio_init);
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
new file mode 100644
index 000000000000..1204c8b871af
--- /dev/null
+++ b/arch/arm/mach-omap1/gpio7xx.c
@@ -0,0 +1,262 @@
1/*
2 * OMAP7xx specific gpio init
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Author:
7 * Charulatha V <charu@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/gpio.h>
20
21#define OMAP7XX_GPIO1_BASE 0xfffbc000
22#define OMAP7XX_GPIO2_BASE 0xfffbc800
23#define OMAP7XX_GPIO3_BASE 0xfffbd000
24#define OMAP7XX_GPIO4_BASE 0xfffbd800
25#define OMAP7XX_GPIO5_BASE 0xfffbe000
26#define OMAP7XX_GPIO6_BASE 0xfffbe800
27#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
28
29/* mpu gpio */
30static struct __initdata resource omap7xx_mpu_gpio_resources[] = {
31 {
32 .start = OMAP1_MPUIO_VBASE,
33 .end = OMAP1_MPUIO_VBASE + SZ_2K - 1,
34 .flags = IORESOURCE_MEM,
35 },
36 {
37 .start = INT_7XX_MPUIO,
38 .flags = IORESOURCE_IRQ,
39 },
40};
41
42static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
43 .virtual_irq_start = IH_MPUIO_BASE,
44 .bank_type = METHOD_MPUIO,
45 .bank_width = 32,
46 .bank_stride = 2,
47};
48
49static struct __initdata platform_device omap7xx_mpu_gpio = {
50 .name = "omap_gpio",
51 .id = 0,
52 .dev = {
53 .platform_data = &omap7xx_mpu_gpio_config,
54 },
55 .num_resources = ARRAY_SIZE(omap7xx_mpu_gpio_resources),
56 .resource = omap7xx_mpu_gpio_resources,
57};
58
59/* gpio1 */
60static struct __initdata resource omap7xx_gpio1_resources[] = {
61 {
62 .start = OMAP7XX_GPIO1_BASE,
63 .end = OMAP7XX_GPIO1_BASE + SZ_2K - 1,
64 .flags = IORESOURCE_MEM,
65 },
66 {
67 .start = INT_7XX_GPIO_BANK1,
68 .flags = IORESOURCE_IRQ,
69 },
70};
71
72static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
73 .virtual_irq_start = IH_GPIO_BASE,
74 .bank_type = METHOD_GPIO_7XX,
75 .bank_width = 32,
76};
77
78static struct __initdata platform_device omap7xx_gpio1 = {
79 .name = "omap_gpio",
80 .id = 1,
81 .dev = {
82 .platform_data = &omap7xx_gpio1_config,
83 },
84 .num_resources = ARRAY_SIZE(omap7xx_gpio1_resources),
85 .resource = omap7xx_gpio1_resources,
86};
87
88/* gpio2 */
89static struct __initdata resource omap7xx_gpio2_resources[] = {
90 {
91 .start = OMAP7XX_GPIO2_BASE,
92 .end = OMAP7XX_GPIO2_BASE + SZ_2K - 1,
93 .flags = IORESOURCE_MEM,
94 },
95 {
96 .start = INT_7XX_GPIO_BANK2,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
101static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = {
102 .virtual_irq_start = IH_GPIO_BASE + 32,
103 .bank_type = METHOD_GPIO_7XX,
104 .bank_width = 32,
105};
106
107static struct __initdata platform_device omap7xx_gpio2 = {
108 .name = "omap_gpio",
109 .id = 2,
110 .dev = {
111 .platform_data = &omap7xx_gpio2_config,
112 },
113 .num_resources = ARRAY_SIZE(omap7xx_gpio2_resources),
114 .resource = omap7xx_gpio2_resources,
115};
116
117/* gpio3 */
118static struct __initdata resource omap7xx_gpio3_resources[] = {
119 {
120 .start = OMAP7XX_GPIO3_BASE,
121 .end = OMAP7XX_GPIO3_BASE + SZ_2K - 1,
122 .flags = IORESOURCE_MEM,
123 },
124 {
125 .start = INT_7XX_GPIO_BANK3,
126 .flags = IORESOURCE_IRQ,
127 },
128};
129
130static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = {
131 .virtual_irq_start = IH_GPIO_BASE + 64,
132 .bank_type = METHOD_GPIO_7XX,
133 .bank_width = 32,
134};
135
136static struct __initdata platform_device omap7xx_gpio3 = {
137 .name = "omap_gpio",
138 .id = 3,
139 .dev = {
140 .platform_data = &omap7xx_gpio3_config,
141 },
142 .num_resources = ARRAY_SIZE(omap7xx_gpio3_resources),
143 .resource = omap7xx_gpio3_resources,
144};
145
146/* gpio4 */
147static struct __initdata resource omap7xx_gpio4_resources[] = {
148 {
149 .start = OMAP7XX_GPIO4_BASE,
150 .end = OMAP7XX_GPIO4_BASE + SZ_2K - 1,
151 .flags = IORESOURCE_MEM,
152 },
153 {
154 .start = INT_7XX_GPIO_BANK4,
155 .flags = IORESOURCE_IRQ,
156 },
157};
158
159static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = {
160 .virtual_irq_start = IH_GPIO_BASE + 96,
161 .bank_type = METHOD_GPIO_7XX,
162 .bank_width = 32,
163};
164
165static struct __initdata platform_device omap7xx_gpio4 = {
166 .name = "omap_gpio",
167 .id = 4,
168 .dev = {
169 .platform_data = &omap7xx_gpio4_config,
170 },
171 .num_resources = ARRAY_SIZE(omap7xx_gpio4_resources),
172 .resource = omap7xx_gpio4_resources,
173};
174
175/* gpio5 */
176static struct __initdata resource omap7xx_gpio5_resources[] = {
177 {
178 .start = OMAP7XX_GPIO5_BASE,
179 .end = OMAP7XX_GPIO5_BASE + SZ_2K - 1,
180 .flags = IORESOURCE_MEM,
181 },
182 {
183 .start = INT_7XX_GPIO_BANK5,
184 .flags = IORESOURCE_IRQ,
185 },
186};
187
188static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = {
189 .virtual_irq_start = IH_GPIO_BASE + 128,
190 .bank_type = METHOD_GPIO_7XX,
191 .bank_width = 32,
192};
193
194static struct __initdata platform_device omap7xx_gpio5 = {
195 .name = "omap_gpio",
196 .id = 5,
197 .dev = {
198 .platform_data = &omap7xx_gpio5_config,
199 },
200 .num_resources = ARRAY_SIZE(omap7xx_gpio5_resources),
201 .resource = omap7xx_gpio5_resources,
202};
203
204/* gpio6 */
205static struct __initdata resource omap7xx_gpio6_resources[] = {
206 {
207 .start = OMAP7XX_GPIO6_BASE,
208 .end = OMAP7XX_GPIO6_BASE + SZ_2K - 1,
209 .flags = IORESOURCE_MEM,
210 },
211 {
212 .start = INT_7XX_GPIO_BANK6,
213 .flags = IORESOURCE_IRQ,
214 },
215};
216
217static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = {
218 .virtual_irq_start = IH_GPIO_BASE + 160,
219 .bank_type = METHOD_GPIO_7XX,
220 .bank_width = 32,
221};
222
223static struct __initdata platform_device omap7xx_gpio6 = {
224 .name = "omap_gpio",
225 .id = 6,
226 .dev = {
227 .platform_data = &omap7xx_gpio6_config,
228 },
229 .num_resources = ARRAY_SIZE(omap7xx_gpio6_resources),
230 .resource = omap7xx_gpio6_resources,
231};
232
233static struct __initdata platform_device * omap7xx_gpio_dev[] = {
234 &omap7xx_mpu_gpio,
235 &omap7xx_gpio1,
236 &omap7xx_gpio2,
237 &omap7xx_gpio3,
238 &omap7xx_gpio4,
239 &omap7xx_gpio5,
240 &omap7xx_gpio6,
241};
242
243/*
244 * omap7xx_gpio_init needs to be done before
245 * machine_init functions access gpio APIs.
246 * Hence omap7xx_gpio_init is a postcore_initcall.
247 */
248static int __init omap7xx_gpio_init(void)
249{
250 int i;
251
252 if (!cpu_is_omap7xx())
253 return -EINVAL;
254
255 for (i = 0; i < ARRAY_SIZE(omap7xx_gpio_dev); i++)
256 platform_device_register(omap7xx_gpio_dev[i]);
257
258 gpio_bank_count = ARRAY_SIZE(omap7xx_gpio_dev);
259
260 return 0;
261}
262postcore_initcall(omap7xx_gpio_init);
diff --git a/arch/arm/mach-omap1/include/mach/entry-macro.S b/arch/arm/mach-omap1/include/mach/entry-macro.S
index df9060edda28..c9be6d4d83e2 100644
--- a/arch/arm/mach-omap1/include/mach/entry-macro.S
+++ b/arch/arm/mach-omap1/include/mach/entry-macro.S
@@ -14,18 +14,17 @@
14#include <mach/irqs.h> 14#include <mach/irqs.h>
15#include <asm/hardware/gic.h> 15#include <asm/hardware/gic.h>
16 16
17#if (defined(CONFIG_ARCH_OMAP730)||defined(CONFIG_ARCH_OMAP850)) && \ 17/*
18 (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)) 18 * We use __glue to avoid errors with multiple definitions of
19#error "FIXME: OMAP7XX doesn't support multiple-OMAP" 19 * .globl omap_irq_flags as it's included from entry-armv.S but not
20#elif defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 20 * from entry-common.S.
21#define INT_IH2_IRQ INT_7XX_IH2_IRQ 21 */
22#elif defined(CONFIG_ARCH_OMAP15XX) 22#ifdef __glue
23#define INT_IH2_IRQ INT_1510_IH2_IRQ 23 .pushsection .data
24#elif defined(CONFIG_ARCH_OMAP16XX) 24 .globl omap_irq_flags
25#define INT_IH2_IRQ INT_1610_IH2_IRQ 25omap_irq_flags:
26#else 26 .word 0
27#warning "IH2 IRQ defaulted" 27 .popsection
28#define INT_IH2_IRQ INT_1510_IH2_IRQ
29#endif 28#endif
30 29
31 .macro disable_fiq 30 .macro disable_fiq
@@ -47,9 +46,11 @@
47 beq 1510f 46 beq 1510f
48 47
49 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET] 48 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
49 ldr \tmp, =omap_irq_flags @ irq flags address
50 ldr \tmp, [\tmp, #0] @ irq flags value
50 cmp \irqnr, #0 51 cmp \irqnr, #0
51 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] 52 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
52 cmpeq \irqnr, #INT_IH2_IRQ 53 cmpeq \irqnr, \tmp
53 ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE) 54 ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE)
54 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET] 55 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
55 addeqs \irqnr, \irqnr, #32 56 addeqs \irqnr, \irqnr, #32
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 0ce3fec2d257..870886a29594 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -142,3 +142,42 @@ void __init omap1_init_common_hw(void)
142 omap1_mux_init(); 142 omap1_mux_init();
143} 143}
144 144
145/*
146 * NOTE: Please use ioremap + __raw_read/write where possible instead of these
147 */
148
149u8 omap_readb(u32 pa)
150{
151 return __raw_readb(OMAP1_IO_ADDRESS(pa));
152}
153EXPORT_SYMBOL(omap_readb);
154
155u16 omap_readw(u32 pa)
156{
157 return __raw_readw(OMAP1_IO_ADDRESS(pa));
158}
159EXPORT_SYMBOL(omap_readw);
160
161u32 omap_readl(u32 pa)
162{
163 return __raw_readl(OMAP1_IO_ADDRESS(pa));
164}
165EXPORT_SYMBOL(omap_readl);
166
167void omap_writeb(u8 v, u32 pa)
168{
169 __raw_writeb(v, OMAP1_IO_ADDRESS(pa));
170}
171EXPORT_SYMBOL(omap_writeb);
172
173void omap_writew(u16 v, u32 pa)
174{
175 __raw_writew(v, OMAP1_IO_ADDRESS(pa));
176}
177EXPORT_SYMBOL(omap_writew);
178
179void omap_writel(u32 v, u32 pa)
180{
181 __raw_writel(v, OMAP1_IO_ADDRESS(pa));
182}
183EXPORT_SYMBOL(omap_writel);
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index db913c34d1fe..6bddbc869f4c 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -176,26 +176,31 @@ static struct irq_chip omap_irq_chip = {
176 176
177void __init omap_init_irq(void) 177void __init omap_init_irq(void)
178{ 178{
179 extern unsigned int omap_irq_flags;
179 int i, j; 180 int i, j;
180 181
181#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 182#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
182 if (cpu_is_omap7xx()) { 183 if (cpu_is_omap7xx()) {
184 omap_irq_flags = INT_7XX_IH2_IRQ;
183 irq_banks = omap7xx_irq_banks; 185 irq_banks = omap7xx_irq_banks;
184 irq_bank_count = ARRAY_SIZE(omap7xx_irq_banks); 186 irq_bank_count = ARRAY_SIZE(omap7xx_irq_banks);
185 } 187 }
186#endif 188#endif
187#ifdef CONFIG_ARCH_OMAP15XX 189#ifdef CONFIG_ARCH_OMAP15XX
188 if (cpu_is_omap1510()) { 190 if (cpu_is_omap1510()) {
191 omap_irq_flags = INT_1510_IH2_IRQ;
189 irq_banks = omap1510_irq_banks; 192 irq_banks = omap1510_irq_banks;
190 irq_bank_count = ARRAY_SIZE(omap1510_irq_banks); 193 irq_bank_count = ARRAY_SIZE(omap1510_irq_banks);
191 } 194 }
192 if (cpu_is_omap310()) { 195 if (cpu_is_omap310()) {
196 omap_irq_flags = INT_1510_IH2_IRQ;
193 irq_banks = omap310_irq_banks; 197 irq_banks = omap310_irq_banks;
194 irq_bank_count = ARRAY_SIZE(omap310_irq_banks); 198 irq_bank_count = ARRAY_SIZE(omap310_irq_banks);
195 } 199 }
196#endif 200#endif
197#if defined(CONFIG_ARCH_OMAP16XX) 201#if defined(CONFIG_ARCH_OMAP16XX)
198 if (cpu_is_omap16xx()) { 202 if (cpu_is_omap16xx()) {
203 omap_irq_flags = INT_1510_IH2_IRQ;
199 irq_banks = omap1610_irq_banks; 204 irq_banks = omap1610_irq_banks;
200 irq_bank_count = ARRAY_SIZE(omap1610_irq_banks); 205 irq_bank_count = ARRAY_SIZE(omap1610_irq_banks);
201 } 206 }
diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c
index 3be11af687bb..c9088d85da04 100644
--- a/arch/arm/mach-omap1/lcd_dma.c
+++ b/arch/arm/mach-omap1/lcd_dma.c
@@ -424,6 +424,9 @@ static int __init omap_init_lcd_dma(void)
424{ 424{
425 int r; 425 int r;
426 426
427 if (!cpu_class_is_omap1())
428 return -ENODEV;
429
427 if (cpu_is_omap16xx()) { 430 if (cpu_is_omap16xx()) {
428 u16 w; 431 u16 w;
429 432
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c
index 277f356d4cd0..22eb11dde9e7 100644
--- a/arch/arm/mach-omap1/leds.c
+++ b/arch/arm/mach-omap1/leds.c
@@ -17,6 +17,9 @@
17static int __init 17static int __init
18omap_leds_init(void) 18omap_leds_init(void)
19{ 19{
20 if (!cpu_class_is_omap1())
21 return -ENODEV;
22
20 if (machine_is_omap_innovator()) 23 if (machine_is_omap_innovator())
21 leds_event = innovator_leds_event; 24 leds_event = innovator_leds_event;
22 25
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 1a85a421007f..c0e1f48aa119 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -133,19 +133,18 @@ static struct omap_mbox1_priv omap1_mbox_dsp_priv = {
133 }, 133 },
134}; 134};
135 135
136struct omap_mbox mbox_dsp_info = { 136static struct omap_mbox mbox_dsp_info = {
137 .name = "dsp", 137 .name = "dsp",
138 .ops = &omap1_mbox_ops, 138 .ops = &omap1_mbox_ops,
139 .priv = &omap1_mbox_dsp_priv, 139 .priv = &omap1_mbox_dsp_priv,
140}; 140};
141 141
142struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL }; 142static struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
143 143
144static int __devinit omap1_mbox_probe(struct platform_device *pdev) 144static int __devinit omap1_mbox_probe(struct platform_device *pdev)
145{ 145{
146 struct resource *mem; 146 struct resource *mem;
147 int ret; 147 int ret;
148 int i;
149 struct omap_mbox **list; 148 struct omap_mbox **list;
150 149
151 list = omap1_mboxes; 150 list = omap1_mboxes;
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index b3a796a6da03..820973666f34 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -174,8 +174,11 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
174#define OMAP16XX_MCBSP_REG_NUM 0 174#define OMAP16XX_MCBSP_REG_NUM 0
175#endif 175#endif
176 176
177int __init omap1_mcbsp_init(void) 177static int __init omap1_mcbsp_init(void)
178{ 178{
179 if (!cpu_class_is_omap1())
180 return -ENODEV;
181
179 if (cpu_is_omap7xx()) { 182 if (cpu_is_omap7xx()) {
180 omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ; 183 omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ;
181 omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16); 184 omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16);
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index 7835add00344..5fdef7a34828 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -343,7 +343,7 @@ MUX_CFG("Y14_1610_CCP_DATAM", 9, 21, 6, 2, 3, 1, 2, 0, 0)
343#define OMAP1XXX_PINS_SZ 0 343#define OMAP1XXX_PINS_SZ 0
344#endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */ 344#endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */
345 345
346int __init_or_module omap1_cfg_reg(const struct pin_config *cfg) 346static int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
347{ 347{
348 static DEFINE_SPINLOCK(mux_spin_lock); 348 static DEFINE_SPINLOCK(mux_spin_lock);
349 unsigned long flags; 349 unsigned long flags;
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index b1d3f9fade23..0cca23a85175 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -661,6 +661,9 @@ static int __init omap_pm_init(void)
661 int error; 661 int error;
662#endif 662#endif
663 663
664 if (!cpu_class_is_omap1())
665 return -ENODEV;
666
664 printk("Power Management for TI OMAP.\n"); 667 printk("Power Management for TI OMAP.\n");
665 668
666 /* 669 /*
diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index 8b66392be745..6588c22b8a64 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -48,7 +48,6 @@ static int omap1_pm_runtime_suspend(struct device *dev)
48 48
49static int omap1_pm_runtime_resume(struct device *dev) 49static int omap1_pm_runtime_resume(struct device *dev)
50{ 50{
51 int ret = 0;
52 struct clk *iclk, *fclk; 51 struct clk *iclk, *fclk;
53 52
54 dev_dbg(dev, "%s\n", __func__); 53 dev_dbg(dev, "%s\n", __func__);
@@ -73,6 +72,9 @@ static int __init omap1_pm_runtime_init(void)
73 const struct dev_pm_ops *pm; 72 const struct dev_pm_ops *pm;
74 struct dev_pm_ops *omap_pm; 73 struct dev_pm_ops *omap_pm;
75 74
75 if (!cpu_class_is_omap1())
76 return -ENODEV;
77
76 pm = platform_bus_get_pm_ops(); 78 pm = platform_bus_get_pm_ops();
77 if (!pm) { 79 if (!pm) {
78 pr_err("%s: unable to get dev_pm_ops from platform_bus\n", 80 pr_err("%s: unable to get dev_pm_ops from platform_bus\n",
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index b78d0749f13d..550ca9d9991d 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -27,6 +27,8 @@
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <plat/fpga.h> 28#include <plat/fpga.h>
29 29
30#include "pm.h"
31
30static struct clk * uart1_ck; 32static struct clk * uart1_ck;
31static struct clk * uart2_ck; 33static struct clk * uart2_ck;
32static struct clk * uart3_ck; 34static struct clk * uart3_ck;
@@ -52,9 +54,11 @@ static inline void omap_serial_outp(struct plat_serial8250_port *p, int offset,
52 */ 54 */
53static void __init omap_serial_reset(struct plat_serial8250_port *p) 55static void __init omap_serial_reset(struct plat_serial8250_port *p)
54{ 56{
55 omap_serial_outp(p, UART_OMAP_MDR1, 0x07); /* disable UART */ 57 omap_serial_outp(p, UART_OMAP_MDR1,
58 UART_OMAP_MDR1_DISABLE); /* disable UART */
56 omap_serial_outp(p, UART_OMAP_SCR, 0x08); /* TX watermark */ 59 omap_serial_outp(p, UART_OMAP_SCR, 0x08); /* TX watermark */
57 omap_serial_outp(p, UART_OMAP_MDR1, 0x00); /* enable UART */ 60 omap_serial_outp(p, UART_OMAP_MDR1,
61 UART_OMAP_MDR1_16X_MODE); /* enable UART */
58 62
59 if (!cpu_is_omap15xx()) { 63 if (!cpu_is_omap15xx()) {
60 omap_serial_outp(p, UART_OMAP_SYSC, 0x01); 64 omap_serial_outp(p, UART_OMAP_SYSC, 0x01);
@@ -254,6 +258,9 @@ late_initcall(omap_serial_wakeup_init);
254 258
255static int __init omap_init(void) 259static int __init omap_init(void)
256{ 260{
261 if (!cpu_class_is_omap1())
262 return -ENODEV;
263
257 return platform_device_register(&serial_device); 264 return platform_device_register(&serial_device);
258} 265}
259arch_initcall(omap_init); 266arch_initcall(omap_init);
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index abb34ff2041b..ed7a61ff916a 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -52,6 +52,7 @@
52#include <asm/mach/irq.h> 52#include <asm/mach/irq.h>
53#include <asm/mach/time.h> 53#include <asm/mach/time.h>
54 54
55#include <plat/common.h>
55 56
56#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE 57#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE
57#define OMAP_MPU_TIMER_OFFSET 0x100 58#define OMAP_MPU_TIMER_OFFSET 0x100