aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /arch/arm/mach-omap1
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/Kconfig7
-rw-r--r--arch/arm/mach-omap1/Makefile11
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c12
-rw-r--r--arch/arm/mach-omap1/board-fsample.c99
-rw-r--r--arch/arm/mach-omap1/board-generic.c8
-rw-r--r--arch/arm/mach-omap1/board-h2-mmc.c2
-rw-r--r--arch/arm/mach-omap1/board-h2.c82
-rw-r--r--arch/arm/mach-omap1/board-h3-mmc.c2
-rw-r--r--arch/arm/mach-omap1/board-h3.c87
-rw-r--r--arch/arm/mach-omap1/board-htcherald.c311
-rw-r--r--arch/arm/mach-omap1/board-innovator.c35
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c22
-rw-r--r--arch/arm/mach-omap1/board-osk.c29
-rw-r--r--arch/arm/mach-omap1/board-palmte.c25
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c27
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c28
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c97
-rw-r--r--arch/arm/mach-omap1/board-sx1-mmc.c4
-rw-r--r--arch/arm/mach-omap1/board-sx1.c29
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c27
-rw-r--r--arch/arm/mach-omap1/clock.c508
-rw-r--r--arch/arm/mach-omap1/clock.h630
-rw-r--r--arch/arm/mach-omap1/clock_data.c831
-rw-r--r--arch/arm/mach-omap1/devices.c60
-rw-r--r--arch/arm/mach-omap1/flash.c33
-rw-r--r--arch/arm/mach-omap1/fpga.c2
-rw-r--r--arch/arm/mach-omap1/i2c.c35
-rw-r--r--arch/arm/mach-omap1/id.c2
-rw-r--r--arch/arm/mach-omap1/include/mach/clkdev.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/debug-macro.S107
-rw-r--r--arch/arm/mach-omap1/include/mach/entry-macro.S58
-rw-r--r--arch/arm/mach-omap1/include/mach/gpio.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/hardware.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/io.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/irqs.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/lcd_dma.h78
-rw-r--r--arch/arm/mach-omap1/include/mach/lcdc.h57
-rw-r--r--arch/arm/mach-omap1/include/mach/memory.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/mtd-xip.h61
-rw-r--r--arch/arm/mach-omap1/include/mach/smp.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/system.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/timex.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/uncompress.h5
-rw-r--r--arch/arm/mach-omap1/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-omap1/io.c52
-rw-r--r--arch/arm/mach-omap1/irq.c34
-rw-r--r--arch/arm/mach-omap1/lcd_dma.c448
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c2
-rw-r--r--arch/arm/mach-omap1/leds.c2
-rw-r--r--arch/arm/mach-omap1/mailbox.c11
-rw-r--r--arch/arm/mach-omap1/mcbsp.c57
-rw-r--r--arch/arm/mach-omap1/mux.c91
-rw-r--r--arch/arm/mach-omap1/opp.h28
-rw-r--r--arch/arm/mach-omap1/opp_data.c59
-rw-r--r--arch/arm/mach-omap1/pm.c114
-rw-r--r--arch/arm/mach-omap1/pm.h53
-rw-r--r--arch/arm/mach-omap1/serial.c38
-rw-r--r--arch/arm/mach-omap1/sleep.S22
-rw-r--r--arch/arm/mach-omap1/timer32k.c17
59 files changed, 3012 insertions, 1492 deletions
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig
index 55ecc01ea206..27f489747bbd 100644
--- a/arch/arm/mach-omap1/Kconfig
+++ b/arch/arm/mach-omap1/Kconfig
@@ -11,6 +11,7 @@ config ARCH_OMAP850
11 depends on ARCH_OMAP1 11 depends on ARCH_OMAP1
12 bool "OMAP850 Based System" 12 bool "OMAP850 Based System"
13 select CPU_ARM926T 13 select CPU_ARM926T
14 select ARCH_OMAP_OTG
14 15
15config ARCH_OMAP15XX 16config ARCH_OMAP15XX
16 depends on ARCH_OMAP1 17 depends on ARCH_OMAP1
@@ -56,6 +57,12 @@ config MACH_OMAP_HTCWIZARD
56 help 57 help
57 HTC Wizard smartphone support (AKA QTEK 9100, ...) 58 HTC Wizard smartphone support (AKA QTEK 9100, ...)
58 59
60config MACH_HERALD
61 bool "HTC Herald"
62 depends on ARCH_OMAP850
63 help
64 HTC Herald smartphone support (AKA T-Mobile Wing, ...)
65
59config MACH_OMAP_OSK 66config MACH_OMAP_OSK
60 bool "TI OSK Support" 67 bool "TI OSK Support"
61 depends on ARCH_OMAP1 && ARCH_OMAP16XX 68 depends on ARCH_OMAP1 && ARCH_OMAP16XX
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 6867cd3ad0b4..b6a537c875b8 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -3,7 +3,8 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := io.o id.o sram.o clock.o irq.o mux.o serial.o devices.o 6obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o
7obj-y += clock.o clock_data.o opp_data.o
7 8
8obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o 9obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
9 10
@@ -17,6 +18,9 @@ obj-$(CONFIG_PM) += pm.o sleep.o
17obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o 18obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
18mailbox_mach-objs := mailbox.o 19mailbox_mach-objs := mailbox.o
19 20
21i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
22obj-y += $(i2c-omap-m) $(i2c-omap-y)
23
20led-y := leds.o 24led-y := leds.o
21 25
22# Specific board support 26# Specific board support
@@ -34,6 +38,7 @@ obj-$(CONFIG_MACH_OMAP_PALMTT) += board-palmtt.o
34obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o 38obj-$(CONFIG_MACH_NOKIA770) += board-nokia770.o
35obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o 39obj-$(CONFIG_MACH_AMS_DELTA) += board-ams-delta.o
36obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o 40obj-$(CONFIG_MACH_SX1) += board-sx1.o board-sx1-mmc.o
41obj-$(CONFIG_MACH_HERALD) += board-htcherald.o
37 42
38ifeq ($(CONFIG_ARCH_OMAP15XX),y) 43ifeq ($(CONFIG_ARCH_OMAP15XX),y)
39# Innovator-1510 FPGA 44# Innovator-1510 FPGA
@@ -47,3 +52,7 @@ led-$(CONFIG_MACH_OMAP_INNOVATOR) += leds-innovator.o
47led-$(CONFIG_MACH_OMAP_PERSEUS2) += leds-h2p2-debug.o 52led-$(CONFIG_MACH_OMAP_PERSEUS2) += leds-h2p2-debug.o
48led-$(CONFIG_MACH_OMAP_OSK) += leds-osk.o 53led-$(CONFIG_MACH_OMAP_OSK) += leds-osk.o
49obj-$(CONFIG_LEDS) += $(led-y) 54obj-$(CONFIG_LEDS) += $(led-y)
55
56ifneq ($(CONFIG_FB_OMAP),)
57obj-y += lcd_dma.o
58endif
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 8ad5cc3e83e3..7fc11c34b696 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -25,13 +25,13 @@
25#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28#include <mach/board-ams-delta.h> 28#include <plat/board-ams-delta.h>
29#include <mach/gpio.h> 29#include <mach/gpio.h>
30#include <mach/keypad.h> 30#include <plat/keypad.h>
31#include <mach/mux.h> 31#include <plat/mux.h>
32#include <mach/usb.h> 32#include <plat/usb.h>
33#include <mach/board.h> 33#include <plat/board.h>
34#include <mach/common.h> 34#include <plat/common.h>
35 35
36static u8 ams_delta_latch1_reg; 36static u8 ams_delta_latch1_reg;
37static u16 ams_delta_latch2_reg; 37static u16 ams_delta_latch2_reg;
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index a7ead1b93226..096f2ed102cb 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -18,22 +18,23 @@
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/nand.h> 19#include <linux/mtd/nand.h>
20#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
21#include <linux/mtd/physmap.h>
21#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/smc91x.h>
22 24
23#include <mach/hardware.h> 25#include <mach/hardware.h>
24#include <asm/mach-types.h> 26#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
26#include <asm/mach/flash.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
28 29
29#include <mach/tc.h> 30#include <plat/tc.h>
30#include <mach/gpio.h> 31#include <mach/gpio.h>
31#include <mach/mux.h> 32#include <plat/mux.h>
32#include <mach/fpga.h> 33#include <plat/flash.h>
33#include <mach/nand.h> 34#include <plat/fpga.h>
34#include <mach/keypad.h> 35#include <plat/keypad.h>
35#include <mach/common.h> 36#include <plat/common.h>
36#include <mach/board.h> 37#include <plat/board.h>
37 38
38/* fsample is pretty close to p2-sample */ 39/* fsample is pretty close to p2-sample */
39 40
@@ -100,6 +101,12 @@ static int fsample_keymap[] = {
100 0 101 0
101}; 102};
102 103
104static struct smc91x_platdata smc91x_info = {
105 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
106 .leda = RPC_LED_100_10,
107 .ledb = RPC_LED_TX_RX,
108};
109
103static struct resource smc91x_resources[] = { 110static struct resource smc91x_resources[] = {
104 [0] = { 111 [0] = {
105 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ 112 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */
@@ -107,7 +114,7 @@ static struct resource smc91x_resources[] = {
107 .flags = IORESOURCE_MEM, 114 .flags = IORESOURCE_MEM,
108 }, 115 },
109 [1] = { 116 [1] = {
110 .start = INT_730_MPU_EXT_NIRQ, 117 .start = INT_7XX_MPU_EXT_NIRQ,
111 .end = 0, 118 .end = 0,
112 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 119 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
113 }, 120 },
@@ -144,9 +151,9 @@ static struct mtd_partition nor_partitions[] = {
144 }, 151 },
145}; 152};
146 153
147static struct flash_platform_data nor_data = { 154static struct physmap_flash_data nor_data = {
148 .map_name = "cfi_probe",
149 .width = 2, 155 .width = 2,
156 .set_vpp = omap1_set_vpp,
150 .parts = nor_partitions, 157 .parts = nor_partitions,
151 .nr_parts = ARRAY_SIZE(nor_partitions), 158 .nr_parts = ARRAY_SIZE(nor_partitions),
152}; 159};
@@ -158,7 +165,7 @@ static struct resource nor_resource = {
158}; 165};
159 166
160static struct platform_device nor_device = { 167static struct platform_device nor_device = {
161 .name = "omapflash", 168 .name = "physmap-flash",
162 .id = 0, 169 .id = 0,
163 .dev = { 170 .dev = {
164 .platform_data = &nor_data, 171 .platform_data = &nor_data,
@@ -167,8 +174,40 @@ static struct platform_device nor_device = {
167 .resource = &nor_resource, 174 .resource = &nor_resource,
168}; 175};
169 176
170static struct omap_nand_platform_data nand_data = { 177static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
171 .options = NAND_SAMSUNG_LP_OPTIONS, 178{
179 struct nand_chip *this = mtd->priv;
180 unsigned long mask;
181
182 if (cmd == NAND_CMD_NONE)
183 return;
184
185 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
186 if (ctrl & NAND_ALE)
187 mask |= 0x04;
188 writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
189}
190
191#define FSAMPLE_NAND_RB_GPIO_PIN 62
192
193static int nand_dev_ready(struct mtd_info *mtd)
194{
195 return gpio_get_value(FSAMPLE_NAND_RB_GPIO_PIN);
196}
197
198static const char *part_probes[] = { "cmdlinepart", NULL };
199
200static struct platform_nand_data nand_data = {
201 .chip = {
202 .nr_chips = 1,
203 .chip_offset = 0,
204 .options = NAND_SAMSUNG_LP_OPTIONS,
205 .part_probe_types = part_probes,
206 },
207 .ctrl = {
208 .cmd_ctrl = nand_cmd_ctl,
209 .dev_ready = nand_dev_ready,
210 },
172}; 211};
173 212
174static struct resource nand_resource = { 213static struct resource nand_resource = {
@@ -178,7 +217,7 @@ static struct resource nand_resource = {
178}; 217};
179 218
180static struct platform_device nand_device = { 219static struct platform_device nand_device = {
181 .name = "omapnand", 220 .name = "gen_nand",
182 .id = 0, 221 .id = 0,
183 .dev = { 222 .dev = {
184 .platform_data = &nand_data, 223 .platform_data = &nand_data,
@@ -190,14 +229,17 @@ static struct platform_device nand_device = {
190static struct platform_device smc91x_device = { 229static struct platform_device smc91x_device = {
191 .name = "smc91x", 230 .name = "smc91x",
192 .id = 0, 231 .id = 0,
232 .dev = {
233 .platform_data = &smc91x_info,
234 },
193 .num_resources = ARRAY_SIZE(smc91x_resources), 235 .num_resources = ARRAY_SIZE(smc91x_resources),
194 .resource = smc91x_resources, 236 .resource = smc91x_resources,
195}; 237};
196 238
197static struct resource kp_resources[] = { 239static struct resource kp_resources[] = {
198 [0] = { 240 [0] = {
199 .start = INT_730_MPUIO_KEYPAD, 241 .start = INT_7XX_MPUIO_KEYPAD,
200 .end = INT_730_MPUIO_KEYPAD, 242 .end = INT_7XX_MPUIO_KEYPAD,
201 .flags = IORESOURCE_IRQ, 243 .flags = IORESOURCE_IRQ,
202 }, 244 },
203}; 245};
@@ -233,13 +275,6 @@ static struct platform_device *devices[] __initdata = {
233 &lcd_device, 275 &lcd_device,
234}; 276};
235 277
236#define P2_NAND_RB_GPIO_PIN 62
237
238static int nand_dev_ready(struct omap_nand_platform_data *data)
239{
240 return gpio_get_value(P2_NAND_RB_GPIO_PIN);
241}
242
243static struct omap_lcd_config fsample_lcd_config __initdata = { 278static struct omap_lcd_config fsample_lcd_config __initdata = {
244 .ctrl_name = "internal", 279 .ctrl_name = "internal",
245}; 280};
@@ -250,9 +285,9 @@ static struct omap_board_config_kernel fsample_config[] = {
250 285
251static void __init omap_fsample_init(void) 286static void __init omap_fsample_init(void)
252{ 287{
253 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) 288 if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0)
254 BUG(); 289 BUG();
255 nand_data.dev_ready = nand_dev_ready; 290 gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN);
256 291
257 omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 292 omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
258 omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 293 omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
@@ -309,7 +344,7 @@ static void __init omap_fsample_map_io(void)
309 /* 344 /*
310 * Hold GSM Reset until needed 345 * Hold GSM Reset until needed
311 */ 346 */
312 omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL); 347 omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
313 348
314 /* 349 /*
315 * UARTs -> done automagically by 8250 driver 350 * UARTs -> done automagically by 8250 driver
@@ -320,21 +355,21 @@ static void __init omap_fsample_map_io(void)
320 */ 355 */
321 356
322 /* Flash: CS0 timings setup */ 357 /* Flash: CS0 timings setup */
323 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0); 358 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
324 omap_writel(0x00000088, OMAP730_FLASH_ACFG_0); 359 omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
325 360
326 /* 361 /*
327 * Ethernet support through the debug board 362 * Ethernet support through the debug board
328 * CS1 timings setup 363 * CS1 timings setup
329 */ 364 */
330 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1); 365 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
331 omap_writel(0x00000000, OMAP730_FLASH_ACFG_1); 366 omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
332 367
333 /* 368 /*
334 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, 369 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
335 * It is used as the Ethernet controller interrupt 370 * It is used as the Ethernet controller interrupt
336 */ 371 */
337 omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9); 372 omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, OMAP7XX_IO_CONF_9);
338} 373}
339 374
340MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample") 375MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c
index 6c8a41f20e51..e1195a3467b8 100644
--- a/arch/arm/mach-omap1/board-generic.c
+++ b/arch/arm/mach-omap1/board-generic.c
@@ -23,10 +23,10 @@
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24 24
25#include <mach/gpio.h> 25#include <mach/gpio.h>
26#include <mach/mux.h> 26#include <plat/mux.h>
27#include <mach/usb.h> 27#include <plat/usb.h>
28#include <mach/board.h> 28#include <plat/board.h>
29#include <mach/common.h> 29#include <plat/common.h>
30 30
31static void __init omap_generic_init_irq(void) 31static void __init omap_generic_init_irq(void)
32{ 32{
diff --git a/arch/arm/mach-omap1/board-h2-mmc.c b/arch/arm/mach-omap1/board-h2-mmc.c
index 46098f546824..b30c4990744d 100644
--- a/arch/arm/mach-omap1/board-h2-mmc.c
+++ b/arch/arm/mach-omap1/board-h2-mmc.c
@@ -16,7 +16,7 @@
16 16
17#include <linux/i2c/tps65010.h> 17#include <linux/i2c/tps65010.h>
18 18
19#include <mach/mmc.h> 19#include <plat/mmc.h>
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21 21
22#include "board-h2.h" 22#include "board-h2.h"
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index aab860307dca..d1100e4f65ac 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -26,25 +26,26 @@
26#include <linux/mtd/mtd.h> 26#include <linux/mtd/mtd.h>
27#include <linux/mtd/nand.h> 27#include <linux/mtd/nand.h>
28#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
29#include <linux/mtd/physmap.h>
29#include <linux/input.h> 30#include <linux/input.h>
30#include <linux/i2c/tps65010.h> 31#include <linux/i2c/tps65010.h>
32#include <linux/smc91x.h>
31 33
32#include <mach/hardware.h> 34#include <mach/hardware.h>
33#include <asm/gpio.h> 35#include <asm/gpio.h>
34 36
35#include <asm/mach-types.h> 37#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
37#include <asm/mach/flash.h>
38#include <asm/mach/map.h> 39#include <asm/mach/map.h>
39 40
40#include <mach/mux.h> 41#include <plat/mux.h>
41#include <mach/dma.h> 42#include <plat/dma.h>
42#include <mach/tc.h> 43#include <plat/tc.h>
43#include <mach/nand.h> 44#include <plat/irda.h>
44#include <mach/irda.h> 45#include <plat/usb.h>
45#include <mach/usb.h> 46#include <plat/keypad.h>
46#include <mach/keypad.h> 47#include <plat/common.h>
47#include <mach/common.h> 48#include <plat/flash.h>
48 49
49#include "board-h2.h" 50#include "board-h2.h"
50 51
@@ -121,9 +122,9 @@ static struct mtd_partition h2_nor_partitions[] = {
121 } 122 }
122}; 123};
123 124
124static struct flash_platform_data h2_nor_data = { 125static struct physmap_flash_data h2_nor_data = {
125 .map_name = "cfi_probe",
126 .width = 2, 126 .width = 2,
127 .set_vpp = omap1_set_vpp,
127 .parts = h2_nor_partitions, 128 .parts = h2_nor_partitions,
128 .nr_parts = ARRAY_SIZE(h2_nor_partitions), 129 .nr_parts = ARRAY_SIZE(h2_nor_partitions),
129}; 130};
@@ -134,7 +135,7 @@ static struct resource h2_nor_resource = {
134}; 135};
135 136
136static struct platform_device h2_nor_device = { 137static struct platform_device h2_nor_device = {
137 .name = "omapflash", 138 .name = "physmap-flash",
138 .id = 0, 139 .id = 0,
139 .dev = { 140 .dev = {
140 .platform_data = &h2_nor_data, 141 .platform_data = &h2_nor_data,
@@ -179,11 +180,43 @@ static struct mtd_partition h2_nand_partitions[] = {
179 }, 180 },
180}; 181};
181 182
182/* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 183static void h2_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
183static struct omap_nand_platform_data h2_nand_data = { 184{
184 .options = NAND_SAMSUNG_LP_OPTIONS, 185 struct nand_chip *this = mtd->priv;
185 .parts = h2_nand_partitions, 186 unsigned long mask;
186 .nr_parts = ARRAY_SIZE(h2_nand_partitions), 187
188 if (cmd == NAND_CMD_NONE)
189 return;
190
191 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
192 if (ctrl & NAND_ALE)
193 mask |= 0x04;
194 writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
195}
196
197#define H2_NAND_RB_GPIO_PIN 62
198
199static int h2_nand_dev_ready(struct mtd_info *mtd)
200{
201 return gpio_get_value(H2_NAND_RB_GPIO_PIN);
202}
203
204static const char *h2_part_probes[] = { "cmdlinepart", NULL };
205
206struct platform_nand_data h2_nand_platdata = {
207 .chip = {
208 .nr_chips = 1,
209 .chip_offset = 0,
210 .nr_partitions = ARRAY_SIZE(h2_nand_partitions),
211 .partitions = h2_nand_partitions,
212 .options = NAND_SAMSUNG_LP_OPTIONS,
213 .part_probe_types = h2_part_probes,
214 },
215 .ctrl = {
216 .cmd_ctrl = h2_nand_cmd_ctl,
217 .dev_ready = h2_nand_dev_ready,
218
219 },
187}; 220};
188 221
189static struct resource h2_nand_resource = { 222static struct resource h2_nand_resource = {
@@ -191,15 +224,21 @@ static struct resource h2_nand_resource = {
191}; 224};
192 225
193static struct platform_device h2_nand_device = { 226static struct platform_device h2_nand_device = {
194 .name = "omapnand", 227 .name = "gen_nand",
195 .id = 0, 228 .id = 0,
196 .dev = { 229 .dev = {
197 .platform_data = &h2_nand_data, 230 .platform_data = &h2_nand_platdata,
198 }, 231 },
199 .num_resources = 1, 232 .num_resources = 1,
200 .resource = &h2_nand_resource, 233 .resource = &h2_nand_resource,
201}; 234};
202 235
236static struct smc91x_platdata h2_smc91x_info = {
237 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
238 .leda = RPC_LED_100_10,
239 .ledb = RPC_LED_TX_RX,
240};
241
203static struct resource h2_smc91x_resources[] = { 242static struct resource h2_smc91x_resources[] = {
204 [0] = { 243 [0] = {
205 .start = OMAP1610_ETHR_START, /* Physical */ 244 .start = OMAP1610_ETHR_START, /* Physical */
@@ -216,6 +255,9 @@ static struct resource h2_smc91x_resources[] = {
216static struct platform_device h2_smc91x_device = { 255static struct platform_device h2_smc91x_device = {
217 .name = "smc91x", 256 .name = "smc91x",
218 .id = 0, 257 .id = 0,
258 .dev = {
259 .platform_data = &h2_smc91x_info,
260 },
219 .num_resources = ARRAY_SIZE(h2_smc91x_resources), 261 .num_resources = ARRAY_SIZE(h2_smc91x_resources),
220 .resource = h2_smc91x_resources, 262 .resource = h2_smc91x_resources,
221}; 263};
@@ -368,8 +410,6 @@ static struct omap_board_config_kernel h2_config[] __initdata = {
368 { OMAP_TAG_LCD, &h2_lcd_config }, 410 { OMAP_TAG_LCD, &h2_lcd_config },
369}; 411};
370 412
371#define H2_NAND_RB_GPIO_PIN 62
372
373static void __init h2_init(void) 413static void __init h2_init(void)
374{ 414{
375 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 415 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
diff --git a/arch/arm/mach-omap1/board-h3-mmc.c b/arch/arm/mach-omap1/board-h3-mmc.c
index 5e8877ce35e0..54b0f063e263 100644
--- a/arch/arm/mach-omap1/board-h3-mmc.c
+++ b/arch/arm/mach-omap1/board-h3-mmc.c
@@ -16,7 +16,7 @@
16 16
17#include <linux/i2c/tps65010.h> 17#include <linux/i2c/tps65010.h>
18 18
19#include <mach/mmc.h> 19#include <plat/mmc.h>
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21 21
22#include "board-h3.h" 22#include "board-h3.h"
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 89586b80b8d5..a53ab8297d25 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -25,9 +25,11 @@
25#include <linux/mtd/mtd.h> 25#include <linux/mtd/mtd.h>
26#include <linux/mtd/nand.h> 26#include <linux/mtd/nand.h>
27#include <linux/mtd/partitions.h> 27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
28#include <linux/input.h> 29#include <linux/input.h>
29#include <linux/spi/spi.h> 30#include <linux/spi/spi.h>
30#include <linux/i2c/tps65010.h> 31#include <linux/i2c/tps65010.h>
32#include <linux/smc91x.h>
31 33
32#include <asm/setup.h> 34#include <asm/setup.h>
33#include <asm/page.h> 35#include <asm/page.h>
@@ -36,17 +38,16 @@
36 38
37#include <asm/mach-types.h> 39#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
39#include <asm/mach/flash.h>
40#include <asm/mach/map.h> 41#include <asm/mach/map.h>
41 42
42#include <mach/irqs.h> 43#include <mach/irqs.h>
43#include <mach/mux.h> 44#include <plat/mux.h>
44#include <mach/tc.h> 45#include <plat/tc.h>
45#include <mach/nand.h> 46#include <plat/usb.h>
46#include <mach/usb.h> 47#include <plat/keypad.h>
47#include <mach/keypad.h> 48#include <plat/dma.h>
48#include <mach/dma.h> 49#include <plat/common.h>
49#include <mach/common.h> 50#include <plat/flash.h>
50 51
51#include "board-h3.h" 52#include "board-h3.h"
52 53
@@ -126,9 +127,9 @@ static struct mtd_partition nor_partitions[] = {
126 } 127 }
127}; 128};
128 129
129static struct flash_platform_data nor_data = { 130static struct physmap_flash_data nor_data = {
130 .map_name = "cfi_probe",
131 .width = 2, 131 .width = 2,
132 .set_vpp = omap1_set_vpp,
132 .parts = nor_partitions, 133 .parts = nor_partitions,
133 .nr_parts = ARRAY_SIZE(nor_partitions), 134 .nr_parts = ARRAY_SIZE(nor_partitions),
134}; 135};
@@ -139,7 +140,7 @@ static struct resource nor_resource = {
139}; 140};
140 141
141static struct platform_device nor_device = { 142static struct platform_device nor_device = {
142 .name = "omapflash", 143 .name = "physmap-flash",
143 .id = 0, 144 .id = 0,
144 .dev = { 145 .dev = {
145 .platform_data = &nor_data, 146 .platform_data = &nor_data,
@@ -181,11 +182,43 @@ static struct mtd_partition nand_partitions[] = {
181 }, 182 },
182}; 183};
183 184
184/* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 185static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
185static struct omap_nand_platform_data nand_data = { 186{
186 .options = NAND_SAMSUNG_LP_OPTIONS, 187 struct nand_chip *this = mtd->priv;
187 .parts = nand_partitions, 188 unsigned long mask;
188 .nr_parts = ARRAY_SIZE(nand_partitions), 189
190 if (cmd == NAND_CMD_NONE)
191 return;
192
193 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
194 if (ctrl & NAND_ALE)
195 mask |= 0x04;
196 writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
197}
198
199#define H3_NAND_RB_GPIO_PIN 10
200
201static int nand_dev_ready(struct mtd_info *mtd)
202{
203 return gpio_get_value(H3_NAND_RB_GPIO_PIN);
204}
205
206static const char *part_probes[] = { "cmdlinepart", NULL };
207
208struct platform_nand_data nand_platdata = {
209 .chip = {
210 .nr_chips = 1,
211 .chip_offset = 0,
212 .nr_partitions = ARRAY_SIZE(nand_partitions),
213 .partitions = nand_partitions,
214 .options = NAND_SAMSUNG_LP_OPTIONS,
215 .part_probe_types = part_probes,
216 },
217 .ctrl = {
218 .cmd_ctrl = nand_cmd_ctl,
219 .dev_ready = nand_dev_ready,
220
221 },
189}; 222};
190 223
191static struct resource nand_resource = { 224static struct resource nand_resource = {
@@ -193,15 +226,21 @@ static struct resource nand_resource = {
193}; 226};
194 227
195static struct platform_device nand_device = { 228static struct platform_device nand_device = {
196 .name = "omapnand", 229 .name = "gen_nand",
197 .id = 0, 230 .id = 0,
198 .dev = { 231 .dev = {
199 .platform_data = &nand_data, 232 .platform_data = &nand_platdata,
200 }, 233 },
201 .num_resources = 1, 234 .num_resources = 1,
202 .resource = &nand_resource, 235 .resource = &nand_resource,
203}; 236};
204 237
238static struct smc91x_platdata smc91x_info = {
239 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
240 .leda = RPC_LED_100_10,
241 .ledb = RPC_LED_TX_RX,
242};
243
205static struct resource smc91x_resources[] = { 244static struct resource smc91x_resources[] = {
206 [0] = { 245 [0] = {
207 .start = OMAP1710_ETHR_START, /* Physical */ 246 .start = OMAP1710_ETHR_START, /* Physical */
@@ -218,6 +257,9 @@ static struct resource smc91x_resources[] = {
218static struct platform_device smc91x_device = { 257static struct platform_device smc91x_device = {
219 .name = "smc91x", 258 .name = "smc91x",
220 .id = 0, 259 .id = 0,
260 .dev = {
261 .platform_data = &smc91x_info,
262 },
221 .num_resources = ARRAY_SIZE(smc91x_resources), 263 .num_resources = ARRAY_SIZE(smc91x_resources),
222 .resource = smc91x_resources, 264 .resource = smc91x_resources,
223}; 265};
@@ -332,13 +374,6 @@ static struct i2c_board_info __initdata h3_i2c_board_info[] = {
332 }, 374 },
333}; 375};
334 376
335#define H3_NAND_RB_GPIO_PIN 10
336
337static int nand_dev_ready(struct omap_nand_platform_data *data)
338{
339 return gpio_get_value(H3_NAND_RB_GPIO_PIN);
340}
341
342static void __init h3_init(void) 377static void __init h3_init(void)
343{ 378{
344 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 379 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
@@ -356,7 +391,7 @@ static void __init h3_init(void)
356 nand_resource.end += SZ_4K - 1; 391 nand_resource.end += SZ_4K - 1;
357 if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0) 392 if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0)
358 BUG(); 393 BUG();
359 nand_data.dev_ready = nand_dev_ready; 394 gpio_direction_input(H3_NAND_RB_GPIO_PIN);
360 395
361 /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ 396 /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */
362 /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ 397 /* GPIO10 pullup/down register, Enable pullup on GPIO10 */
diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
new file mode 100644
index 000000000000..e36639f66150
--- /dev/null
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -0,0 +1,311 @@
1/*
2 * HTC Herald board configuration
3 * Copyright (C) 2009 Cory Maccarrone <darkstar6262@gmail.com>
4 * Copyright (C) 2009 Wing Linux
5 *
6 * Based on the board-htcwizard.c file from the linwizard project:
7 * Copyright (C) 2006 Unai Uribarri
8 * Copyright (C) 2008 linwizard.sourceforge.net
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * 02110-1301, USA.
24 *
25 */
26
27#include <linux/kernel.h>
28#include <linux/init.h>
29#include <linux/platform_device.h>
30#include <linux/input.h>
31#include <linux/bootmem.h>
32#include <linux/io.h>
33#include <linux/gpio.h>
34
35#include <asm/mach-types.h>
36#include <asm/mach/arch.h>
37
38#include <plat/omap7xx.h>
39#include <plat/common.h>
40#include <plat/board.h>
41#include <plat/keypad.h>
42#include <plat/usb.h>
43
44#include <mach/irqs.h>
45
46#include <linux/delay.h>
47
48/* LCD register definition */
49#define OMAP_LCDC_CONTROL (0xfffec000 + 0x00)
50#define OMAP_LCDC_STATUS (0xfffec000 + 0x10)
51#define OMAP_DMA_LCD_CCR (0xfffee300 + 0xc2)
52#define OMAP_DMA_LCD_CTRL (0xfffee300 + 0xc4)
53#define OMAP_LCDC_CTRL_LCD_EN (1 << 0)
54#define OMAP_LCDC_STAT_DONE (1 << 0)
55
56static struct omap_lcd_config htcherald_lcd_config __initdata = {
57 .ctrl_name = "internal",
58};
59
60static struct omap_board_config_kernel htcherald_config[] __initdata = {
61 { OMAP_TAG_LCD, &htcherald_lcd_config },
62};
63
64/* Keyboard definition */
65
66static int htc_herald_keymap[] = {
67 KEY(0, 0, KEY_RECORD), /* Mail button */
68 KEY(0, 1, KEY_CAMERA), /* Camera */
69 KEY(0, 2, KEY_PHONE), /* Send key */
70 KEY(0, 3, KEY_VOLUMEUP), /* Volume up */
71 KEY(0, 4, KEY_F2), /* Right bar (landscape) */
72 KEY(0, 5, KEY_MAIL), /* Win key (portrait) */
73 KEY(0, 6, KEY_DIRECTORY), /* Right bar (protrait) */
74 KEY(1, 0, KEY_LEFTCTRL), /* Windows key */
75 KEY(1, 1, KEY_COMMA),
76 KEY(1, 2, KEY_M),
77 KEY(1, 3, KEY_K),
78 KEY(1, 4, KEY_SLASH), /* OK key */
79 KEY(1, 5, KEY_I),
80 KEY(1, 6, KEY_U),
81 KEY(2, 0, KEY_LEFTALT),
82 KEY(2, 1, KEY_TAB),
83 KEY(2, 2, KEY_N),
84 KEY(2, 3, KEY_J),
85 KEY(2, 4, KEY_ENTER),
86 KEY(2, 5, KEY_H),
87 KEY(2, 6, KEY_Y),
88 KEY(3, 0, KEY_SPACE),
89 KEY(3, 1, KEY_L),
90 KEY(3, 2, KEY_B),
91 KEY(3, 3, KEY_V),
92 KEY(3, 4, KEY_BACKSPACE),
93 KEY(3, 5, KEY_G),
94 KEY(3, 6, KEY_T),
95 KEY(4, 0, KEY_CAPSLOCK), /* Shift */
96 KEY(4, 1, KEY_C),
97 KEY(4, 2, KEY_F),
98 KEY(4, 3, KEY_R),
99 KEY(4, 4, KEY_O),
100 KEY(4, 5, KEY_E),
101 KEY(4, 6, KEY_D),
102 KEY(5, 0, KEY_X),
103 KEY(5, 1, KEY_Z),
104 KEY(5, 2, KEY_S),
105 KEY(5, 3, KEY_W),
106 KEY(5, 4, KEY_P),
107 KEY(5, 5, KEY_Q),
108 KEY(5, 6, KEY_A),
109 KEY(6, 0, KEY_CONNECT), /* Voice button */
110 KEY(6, 2, KEY_CANCEL), /* End key */
111 KEY(6, 3, KEY_VOLUMEDOWN), /* Volume down */
112 KEY(6, 4, KEY_F1), /* Left bar (landscape) */
113 KEY(6, 5, KEY_WWW), /* OK button (portrait) */
114 KEY(6, 6, KEY_CALENDAR), /* Left bar (portrait) */
115 0
116};
117
118struct omap_kp_platform_data htcherald_kp_data = {
119 .rows = 7,
120 .cols = 7,
121 .delay = 20,
122 .rep = 1,
123 .keymap = htc_herald_keymap,
124};
125
126static struct resource kp_resources[] = {
127 [0] = {
128 .start = INT_7XX_MPUIO_KEYPAD,
129 .end = INT_7XX_MPUIO_KEYPAD,
130 .flags = IORESOURCE_IRQ,
131 },
132};
133
134static struct platform_device kp_device = {
135 .name = "omap-keypad",
136 .id = -1,
137 .dev = {
138 .platform_data = &htcherald_kp_data,
139 },
140 .num_resources = ARRAY_SIZE(kp_resources),
141 .resource = kp_resources,
142};
143
144/* USB Device */
145static struct omap_usb_config htcherald_usb_config __initdata = {
146 .otg = 0,
147 .register_host = 0,
148 .register_dev = 1,
149 .hmc_mode = 4,
150 .pins[0] = 2,
151};
152
153/* LCD Device resources */
154static struct platform_device lcd_device = {
155 .name = "lcd_htcherald",
156 .id = -1,
157};
158
159static struct platform_device *devices[] __initdata = {
160 &kp_device,
161 &lcd_device,
162};
163
164/*
165 * Init functions from here on
166 */
167
168static void __init htcherald_lcd_init(void)
169{
170 u32 reg;
171 unsigned int tries = 200;
172
173 /* disable controller if active */
174 reg = omap_readl(OMAP_LCDC_CONTROL);
175 if (reg & OMAP_LCDC_CTRL_LCD_EN) {
176 reg &= ~OMAP_LCDC_CTRL_LCD_EN;
177 omap_writel(reg, OMAP_LCDC_CONTROL);
178
179 /* wait for end of frame */
180 while (!(omap_readl(OMAP_LCDC_STATUS) & OMAP_LCDC_STAT_DONE)) {
181 tries--;
182 if (!tries)
183 break;
184 }
185 if (!tries)
186 printk(KERN_WARNING "Timeout waiting for end of frame "
187 "-- LCD may not be available\n");
188
189 /* turn off DMA */
190 reg = omap_readw(OMAP_DMA_LCD_CCR);
191 reg &= ~(1 << 7);
192 omap_writew(reg, OMAP_DMA_LCD_CCR);
193
194 reg = omap_readw(OMAP_DMA_LCD_CTRL);
195 reg &= ~(1 << 8);
196 omap_writew(reg, OMAP_DMA_LCD_CTRL);
197 }
198}
199
200static void __init htcherald_map_io(void)
201{
202 omap1_map_common_io();
203
204 /*
205 * The LCD panel must be disabled and DMA turned off here, as doing
206 * it later causes the LCD never to reinitialize.
207 */
208 htcherald_lcd_init();
209
210 printk(KERN_INFO "htcherald_map_io done.\n");
211}
212
213static void __init htcherald_disable_watchdog(void)
214{
215 /* Disable watchdog if running */
216 if (omap_readl(OMAP_WDT_TIMER_MODE) & 0x8000) {
217 /*
218 * disable a potentially running watchdog timer before
219 * it kills us.
220 */
221 printk(KERN_WARNING "OMAP850 Watchdog seems to be activated, disabling it for now.\n");
222 omap_writel(0xF5, OMAP_WDT_TIMER_MODE);
223 omap_writel(0xA0, OMAP_WDT_TIMER_MODE);
224 }
225}
226
227#define HTCHERALD_GPIO_USB_EN1 33
228#define HTCHERALD_GPIO_USB_EN2 73
229#define HTCHERALD_GPIO_USB_DM 35
230#define HTCHERALD_GPIO_USB_DP 36
231
232static void __init htcherald_usb_enable(void)
233{
234 unsigned int tries = 20;
235 unsigned int value = 0;
236
237 /* Request the GPIOs we need to control here */
238 if (gpio_request(HTCHERALD_GPIO_USB_EN1, "herald_usb") < 0)
239 goto err1;
240
241 if (gpio_request(HTCHERALD_GPIO_USB_EN2, "herald_usb") < 0)
242 goto err2;
243
244 if (gpio_request(HTCHERALD_GPIO_USB_DM, "herald_usb") < 0)
245 goto err3;
246
247 if (gpio_request(HTCHERALD_GPIO_USB_DP, "herald_usb") < 0)
248 goto err4;
249
250 /* force USB_EN GPIO to 0 */
251 do {
252 /* output low */
253 gpio_direction_output(HTCHERALD_GPIO_USB_EN1, 0);
254 } while ((value = gpio_get_value(HTCHERALD_GPIO_USB_EN1)) == 1 &&
255 --tries);
256
257 if (value == 1)
258 printk(KERN_WARNING "Unable to reset USB, trying to continue\n");
259
260 gpio_direction_output(HTCHERALD_GPIO_USB_EN2, 0); /* output low */
261 gpio_direction_input(HTCHERALD_GPIO_USB_DM); /* input */
262 gpio_direction_input(HTCHERALD_GPIO_USB_DP); /* input */
263
264 goto done;
265
266err4:
267 gpio_free(HTCHERALD_GPIO_USB_DM);
268err3:
269 gpio_free(HTCHERALD_GPIO_USB_EN2);
270err2:
271 gpio_free(HTCHERALD_GPIO_USB_EN1);
272err1:
273 printk(KERN_ERR "Unabled to request GPIO for USB\n");
274done:
275 printk(KERN_INFO "USB setup complete.\n");
276}
277
278static void __init htcherald_init(void)
279{
280 printk(KERN_INFO "HTC Herald init.\n");
281
282 omap_gpio_init();
283
284 omap_board_config = htcherald_config;
285 omap_board_config_size = ARRAY_SIZE(htcherald_config);
286 platform_add_devices(devices, ARRAY_SIZE(devices));
287
288 htcherald_disable_watchdog();
289
290 htcherald_usb_enable();
291 omap_usb_init(&htcherald_usb_config);
292}
293
294static void __init htcherald_init_irq(void)
295{
296 printk(KERN_INFO "htcherald_init_irq.\n");
297 omap1_init_common_hw();
298 omap_init_irq();
299}
300
301MACHINE_START(HERALD, "HTC Herald")
302 /* Maintainer: Cory Maccarrone <darkstar6262@gmail.com> */
303 /* Maintainer: wing-linux.sourceforge.net */
304 .phys_io = 0xfff00000,
305 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
306 .boot_params = 0x10000100,
307 .map_io = htcherald_map_io,
308 .init_irq = htcherald_init_irq,
309 .init_machine = htcherald_init,
310 .timer = &omap_timer,
311MACHINE_END
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index cd6c39514826..5d12fd35681b 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -22,22 +22,24 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/mtd/mtd.h> 23#include <linux/mtd/mtd.h>
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/mtd/physmap.h>
25#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/smc91x.h>
26 28
27#include <mach/hardware.h> 29#include <mach/hardware.h>
28#include <asm/mach-types.h> 30#include <asm/mach-types.h>
29#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
30#include <asm/mach/flash.h>
31#include <asm/mach/map.h> 32#include <asm/mach/map.h>
32 33
33#include <mach/mux.h> 34#include <plat/mux.h>
34#include <mach/fpga.h> 35#include <plat/flash.h>
36#include <plat/fpga.h>
35#include <mach/gpio.h> 37#include <mach/gpio.h>
36#include <mach/tc.h> 38#include <plat/tc.h>
37#include <mach/usb.h> 39#include <plat/usb.h>
38#include <mach/keypad.h> 40#include <plat/keypad.h>
39#include <mach/common.h> 41#include <plat/common.h>
40#include <mach/mmc.h> 42#include <plat/mmc.h>
41 43
42/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 44/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
43#define INNOVATOR1610_ETHR_START 0x04000300 45#define INNOVATOR1610_ETHR_START 0x04000300
@@ -93,9 +95,9 @@ static struct mtd_partition innovator_partitions[] = {
93 } 95 }
94}; 96};
95 97
96static struct flash_platform_data innovator_flash_data = { 98static struct physmap_flash_data innovator_flash_data = {
97 .map_name = "cfi_probe",
98 .width = 2, 99 .width = 2,
100 .set_vpp = omap1_set_vpp,
99 .parts = innovator_partitions, 101 .parts = innovator_partitions,
100 .nr_parts = ARRAY_SIZE(innovator_partitions), 102 .nr_parts = ARRAY_SIZE(innovator_partitions),
101}; 103};
@@ -107,7 +109,7 @@ static struct resource innovator_flash_resource = {
107}; 109};
108 110
109static struct platform_device innovator_flash_device = { 111static struct platform_device innovator_flash_device = {
110 .name = "omapflash", 112 .name = "physmap-flash",
111 .id = 0, 113 .id = 0,
112 .dev = { 114 .dev = {
113 .platform_data = &innovator_flash_data, 115 .platform_data = &innovator_flash_data,
@@ -142,6 +144,11 @@ static struct platform_device innovator_kp_device = {
142 .resource = innovator_kp_resources, 144 .resource = innovator_kp_resources,
143}; 145};
144 146
147static struct smc91x_platdata innovator_smc91x_info = {
148 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
149 .leda = RPC_LED_100_10,
150 .ledb = RPC_LED_TX_RX,
151};
145 152
146#ifdef CONFIG_ARCH_OMAP15XX 153#ifdef CONFIG_ARCH_OMAP15XX
147 154
@@ -175,6 +182,9 @@ static struct resource innovator1510_smc91x_resources[] = {
175static struct platform_device innovator1510_smc91x_device = { 182static struct platform_device innovator1510_smc91x_device = {
176 .name = "smc91x", 183 .name = "smc91x",
177 .id = 0, 184 .id = 0,
185 .dev = {
186 .platform_data = &innovator_smc91x_info,
187 },
178 .num_resources = ARRAY_SIZE(innovator1510_smc91x_resources), 188 .num_resources = ARRAY_SIZE(innovator1510_smc91x_resources),
179 .resource = innovator1510_smc91x_resources, 189 .resource = innovator1510_smc91x_resources,
180}; 190};
@@ -241,6 +251,9 @@ static struct resource innovator1610_smc91x_resources[] = {
241static struct platform_device innovator1610_smc91x_device = { 251static struct platform_device innovator1610_smc91x_device = {
242 .name = "smc91x", 252 .name = "smc91x",
243 .id = 0, 253 .id = 0,
254 .dev = {
255 .platform_data = &innovator_smc91x_info,
256 },
244 .num_resources = ARRAY_SIZE(innovator1610_smc91x_resources), 257 .num_resources = ARRAY_SIZE(innovator1610_smc91x_resources),
245 .resource = innovator1610_smc91x_resources, 258 .resource = innovator1610_smc91x_resources,
246}; 259};
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index ed2a48a9ce74..71e1a3fad0ea 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -14,6 +14,7 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/input.h> 15#include <linux/input.h>
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/omapfb.h>
17 18
18#include <linux/spi/spi.h> 19#include <linux/spi/spi.h>
19#include <linux/spi/ads7846.h> 20#include <linux/spi/ads7846.h>
@@ -26,17 +27,16 @@
26#include <asm/mach/map.h> 27#include <asm/mach/map.h>
27 28
28#include <mach/gpio.h> 29#include <mach/gpio.h>
29#include <mach/mux.h> 30#include <plat/mux.h>
30#include <mach/usb.h> 31#include <plat/usb.h>
31#include <mach/board.h> 32#include <plat/board.h>
32#include <mach/keypad.h> 33#include <plat/keypad.h>
33#include <mach/common.h> 34#include <plat/common.h>
34#include <mach/dsp_common.h> 35#include <plat/dsp_common.h>
35#include <mach/omapfb.h> 36#include <plat/hwa742.h>
36#include <mach/hwa742.h> 37#include <plat/lcd_mipid.h>
37#include <mach/lcd_mipid.h> 38#include <plat/mmc.h>
38#include <mach/mmc.h> 39#include <plat/clock.h>
39#include <mach/clock.h>
40 40
41#define ADS7846_PENDOWN_GPIO 15 41#define ADS7846_PENDOWN_GPIO 15
42 42
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index ed891b8a6b15..80d862001def 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -33,9 +33,11 @@
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/i2c.h> 34#include <linux/i2c.h>
35#include <linux/leds.h> 35#include <linux/leds.h>
36#include <linux/smc91x.h>
36 37
37#include <linux/mtd/mtd.h> 38#include <linux/mtd/mtd.h>
38#include <linux/mtd/partitions.h> 39#include <linux/mtd/partitions.h>
40#include <linux/mtd/physmap.h>
39 41
40#include <linux/i2c/tps65010.h> 42#include <linux/i2c/tps65010.h>
41 43
@@ -45,12 +47,12 @@
45#include <asm/mach-types.h> 47#include <asm/mach-types.h>
46#include <asm/mach/arch.h> 48#include <asm/mach/arch.h>
47#include <asm/mach/map.h> 49#include <asm/mach/map.h>
48#include <asm/mach/flash.h>
49 50
50#include <mach/usb.h> 51#include <plat/flash.h>
51#include <mach/mux.h> 52#include <plat/usb.h>
52#include <mach/tc.h> 53#include <plat/mux.h>
53#include <mach/common.h> 54#include <plat/tc.h>
55#include <plat/common.h>
54 56
55/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */ 57/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
56#define OMAP_OSK_ETHR_START 0x04800300 58#define OMAP_OSK_ETHR_START 0x04800300
@@ -93,9 +95,9 @@ static struct mtd_partition osk_partitions[] = {
93 } 95 }
94}; 96};
95 97
96static struct flash_platform_data osk_flash_data = { 98static struct physmap_flash_data osk_flash_data = {
97 .map_name = "cfi_probe",
98 .width = 2, 99 .width = 2,
100 .set_vpp = omap1_set_vpp,
99 .parts = osk_partitions, 101 .parts = osk_partitions,
100 .nr_parts = ARRAY_SIZE(osk_partitions), 102 .nr_parts = ARRAY_SIZE(osk_partitions),
101}; 103};
@@ -106,7 +108,7 @@ static struct resource osk_flash_resource = {
106}; 108};
107 109
108static struct platform_device osk5912_flash_device = { 110static struct platform_device osk5912_flash_device = {
109 .name = "omapflash", 111 .name = "physmap-flash",
110 .id = 0, 112 .id = 0,
111 .dev = { 113 .dev = {
112 .platform_data = &osk_flash_data, 114 .platform_data = &osk_flash_data,
@@ -115,6 +117,12 @@ static struct platform_device osk5912_flash_device = {
115 .resource = &osk_flash_resource, 117 .resource = &osk_flash_resource,
116}; 118};
117 119
120static struct smc91x_platdata osk5912_smc91x_info = {
121 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
122 .leda = RPC_LED_100_10,
123 .ledb = RPC_LED_TX_RX,
124};
125
118static struct resource osk5912_smc91x_resources[] = { 126static struct resource osk5912_smc91x_resources[] = {
119 [0] = { 127 [0] = {
120 .start = OMAP_OSK_ETHR_START, /* Physical */ 128 .start = OMAP_OSK_ETHR_START, /* Physical */
@@ -131,6 +139,9 @@ static struct resource osk5912_smc91x_resources[] = {
131static struct platform_device osk5912_smc91x_device = { 139static struct platform_device osk5912_smc91x_device = {
132 .name = "smc91x", 140 .name = "smc91x",
133 .id = -1, 141 .id = -1,
142 .dev = {
143 .platform_data = &osk5912_smc91x_info,
144 },
134 .num_resources = ARRAY_SIZE(osk5912_smc91x_resources), 145 .num_resources = ARRAY_SIZE(osk5912_smc91x_resources),
135 .resource = osk5912_smc91x_resources, 146 .resource = osk5912_smc91x_resources,
136}; 147};
@@ -312,7 +323,7 @@ static struct omap_board_config_kernel osk_config[] __initdata = {
312#include <linux/spi/spi.h> 323#include <linux/spi/spi.h>
313#include <linux/spi/ads7846.h> 324#include <linux/spi/ads7846.h>
314 325
315#include <mach/keypad.h> 326#include <plat/keypad.h>
316 327
317static struct at24_platform_data at24c04 = { 328static struct at24_platform_data at24c04 = {
318 .byte_len = SZ_4K / 8, 329 .byte_len = SZ_4K / 8,
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 4de258420f39..569b4c9085cd 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -23,6 +23,7 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/mtd/mtd.h> 24#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
26#include <linux/mtd/physmap.h>
26#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
27#include <linux/interrupt.h> 28#include <linux/interrupt.h>
28#include <linux/apm-emulation.h> 29#include <linux/apm-emulation.h>
@@ -31,17 +32,17 @@
31#include <asm/mach-types.h> 32#include <asm/mach-types.h>
32#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
33#include <asm/mach/map.h> 34#include <asm/mach/map.h>
34#include <asm/mach/flash.h>
35 35
36#include <mach/gpio.h> 36#include <mach/gpio.h>
37#include <mach/mux.h> 37#include <plat/flash.h>
38#include <mach/usb.h> 38#include <plat/mux.h>
39#include <mach/tc.h> 39#include <plat/usb.h>
40#include <mach/dma.h> 40#include <plat/tc.h>
41#include <mach/board.h> 41#include <plat/dma.h>
42#include <mach/irda.h> 42#include <plat/board.h>
43#include <mach/keypad.h> 43#include <plat/irda.h>
44#include <mach/common.h> 44#include <plat/keypad.h>
45#include <plat/common.h>
45 46
46#define PALMTE_USBDETECT_GPIO 0 47#define PALMTE_USBDETECT_GPIO 0
47#define PALMTE_USB_OR_DC_GPIO 1 48#define PALMTE_USB_OR_DC_GPIO 1
@@ -126,9 +127,9 @@ static struct mtd_partition palmte_rom_partitions[] = {
126 }, 127 },
127}; 128};
128 129
129static struct flash_platform_data palmte_rom_data = { 130static struct physmap_flash_data palmte_rom_data = {
130 .map_name = "map_rom",
131 .width = 2, 131 .width = 2,
132 .set_vpp = omap1_set_vpp,
132 .parts = palmte_rom_partitions, 133 .parts = palmte_rom_partitions,
133 .nr_parts = ARRAY_SIZE(palmte_rom_partitions), 134 .nr_parts = ARRAY_SIZE(palmte_rom_partitions),
134}; 135};
@@ -140,7 +141,7 @@ static struct resource palmte_rom_resource = {
140}; 141};
141 142
142static struct platform_device palmte_rom_device = { 143static struct platform_device palmte_rom_device = {
143 .name = "omapflash", 144 .name = "physmap-flash",
144 .id = -1, 145 .id = -1,
145 .dev = { 146 .dev = {
146 .platform_data = &palmte_rom_data, 147 .platform_data = &palmte_rom_data,
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index d972cf941b76..6ad49a2cc1a0 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -21,24 +21,25 @@
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/mtd/mtd.h> 22#include <linux/mtd/mtd.h>
23#include <linux/mtd/partitions.h> 23#include <linux/mtd/partitions.h>
24#include <linux/mtd/physmap.h>
24#include <linux/leds.h> 25#include <linux/leds.h>
25 26
26#include <mach/hardware.h> 27#include <mach/hardware.h>
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
29#include <asm/mach/map.h> 30#include <asm/mach/map.h>
30#include <asm/mach/flash.h>
31 31
32#include <mach/led.h> 32#include <plat/led.h>
33#include <mach/gpio.h> 33#include <mach/gpio.h>
34#include <mach/mux.h> 34#include <plat/flash.h>
35#include <mach/usb.h> 35#include <plat/mux.h>
36#include <mach/dma.h> 36#include <plat/usb.h>
37#include <mach/tc.h> 37#include <plat/dma.h>
38#include <mach/board.h> 38#include <plat/tc.h>
39#include <mach/irda.h> 39#include <plat/board.h>
40#include <mach/keypad.h> 40#include <plat/irda.h>
41#include <mach/common.h> 41#include <plat/keypad.h>
42#include <plat/common.h>
42 43
43#include <linux/spi/spi.h> 44#include <linux/spi/spi.h>
44#include <linux/spi/ads7846.h> 45#include <linux/spi/ads7846.h>
@@ -104,9 +105,9 @@ static struct mtd_partition palmtt_partitions[] = {
104 } 105 }
105}; 106};
106 107
107static struct flash_platform_data palmtt_flash_data = { 108static struct physmap_flash_data palmtt_flash_data = {
108 .map_name = "cfi_probe",
109 .width = 2, 109 .width = 2,
110 .set_vpp = omap1_set_vpp,
110 .parts = palmtt_partitions, 111 .parts = palmtt_partitions,
111 .nr_parts = ARRAY_SIZE(palmtt_partitions), 112 .nr_parts = ARRAY_SIZE(palmtt_partitions),
112}; 113};
@@ -118,7 +119,7 @@ static struct resource palmtt_flash_resource = {
118}; 119};
119 120
120static struct platform_device palmtt_flash_device = { 121static struct platform_device palmtt_flash_device = {
121 .name = "omapflash", 122 .name = "physmap-flash",
122 .id = 0, 123 .id = 0,
123 .dev = { 124 .dev = {
124 .platform_data = &palmtt_flash_data, 125 .platform_data = &palmtt_flash_data,
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 986bd4df0e97..6641de9257ef 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -25,23 +25,24 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/mtd/mtd.h> 26#include <linux/mtd/mtd.h>
27#include <linux/mtd/partitions.h> 27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
28 29
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 33#include <asm/mach/map.h>
33#include <asm/mach/flash.h>
34 34
35#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <mach/mux.h> 36#include <plat/flash.h>
37#include <mach/usb.h> 37#include <plat/mux.h>
38#include <mach/dma.h> 38#include <plat/usb.h>
39#include <mach/tc.h> 39#include <plat/dma.h>
40#include <mach/board.h> 40#include <plat/tc.h>
41#include <mach/irda.h> 41#include <plat/board.h>
42#include <mach/keypad.h> 42#include <plat/irda.h>
43#include <mach/common.h> 43#include <plat/keypad.h>
44#include <mach/omap-alsa.h> 44#include <plat/common.h>
45#include <plat/omap-alsa.h>
45 46
46#include <linux/spi/spi.h> 47#include <linux/spi/spi.h>
47#include <linux/spi/ads7846.h> 48#include <linux/spi/ads7846.h>
@@ -126,10 +127,9 @@ static struct mtd_partition palmz71_rom_partitions[] = {
126 }, 127 },
127}; 128};
128 129
129static struct flash_platform_data palmz71_rom_data = { 130static struct physmap_flash_data palmz71_rom_data = {
130 .map_name = "map_rom",
131 .name = "onboardrom",
132 .width = 2, 131 .width = 2,
132 .set_vpp = omap1_set_vpp,
133 .parts = palmz71_rom_partitions, 133 .parts = palmz71_rom_partitions,
134 .nr_parts = ARRAY_SIZE(palmz71_rom_partitions), 134 .nr_parts = ARRAY_SIZE(palmz71_rom_partitions),
135}; 135};
@@ -141,7 +141,7 @@ static struct resource palmz71_rom_resource = {
141}; 141};
142 142
143static struct platform_device palmz71_rom_device = { 143static struct platform_device palmz71_rom_device = {
144 .name = "omapflash", 144 .name = "physmap-flash",
145 .id = -1, 145 .id = -1,
146 .dev = { 146 .dev = {
147 .platform_data = &palmz71_rom_data, 147 .platform_data = &palmz71_rom_data,
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 83406699f310..e854d5741c88 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -18,22 +18,23 @@
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
19#include <linux/mtd/nand.h> 19#include <linux/mtd/nand.h>
20#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
21#include <linux/mtd/physmap.h>
21#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/smc91x.h>
22 24
23#include <mach/hardware.h> 25#include <mach/hardware.h>
24#include <asm/mach-types.h> 26#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
26#include <asm/mach/flash.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
28 29
29#include <mach/tc.h> 30#include <plat/tc.h>
30#include <mach/gpio.h> 31#include <mach/gpio.h>
31#include <mach/mux.h> 32#include <plat/mux.h>
32#include <mach/fpga.h> 33#include <plat/fpga.h>
33#include <mach/nand.h> 34#include <plat/flash.h>
34#include <mach/keypad.h> 35#include <plat/keypad.h>
35#include <mach/common.h> 36#include <plat/common.h>
36#include <mach/board.h> 37#include <plat/board.h>
37 38
38static int p2_keymap[] = { 39static int p2_keymap[] = {
39 KEY(0,0,KEY_UP), 40 KEY(0,0,KEY_UP),
@@ -67,6 +68,12 @@ static int p2_keymap[] = {
67 0 68 0
68}; 69};
69 70
71static struct smc91x_platdata smc91x_info = {
72 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
73 .leda = RPC_LED_100_10,
74 .ledb = RPC_LED_TX_RX,
75};
76
70static struct resource smc91x_resources[] = { 77static struct resource smc91x_resources[] = {
71 [0] = { 78 [0] = {
72 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ 79 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */
@@ -74,7 +81,7 @@ static struct resource smc91x_resources[] = {
74 .flags = IORESOURCE_MEM, 81 .flags = IORESOURCE_MEM,
75 }, 82 },
76 [1] = { 83 [1] = {
77 .start = INT_730_MPU_EXT_NIRQ, 84 .start = INT_7XX_MPU_EXT_NIRQ,
78 .end = 0, 85 .end = 0,
79 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 86 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
80 }, 87 },
@@ -111,9 +118,9 @@ static struct mtd_partition nor_partitions[] = {
111 }, 118 },
112}; 119};
113 120
114static struct flash_platform_data nor_data = { 121static struct physmap_flash_data nor_data = {
115 .map_name = "cfi_probe",
116 .width = 2, 122 .width = 2,
123 .set_vpp = omap1_set_vpp,
117 .parts = nor_partitions, 124 .parts = nor_partitions,
118 .nr_parts = ARRAY_SIZE(nor_partitions), 125 .nr_parts = ARRAY_SIZE(nor_partitions),
119}; 126};
@@ -125,7 +132,7 @@ static struct resource nor_resource = {
125}; 132};
126 133
127static struct platform_device nor_device = { 134static struct platform_device nor_device = {
128 .name = "omapflash", 135 .name = "physmap-flash",
129 .id = 0, 136 .id = 0,
130 .dev = { 137 .dev = {
131 .platform_data = &nor_data, 138 .platform_data = &nor_data,
@@ -134,8 +141,40 @@ static struct platform_device nor_device = {
134 .resource = &nor_resource, 141 .resource = &nor_resource,
135}; 142};
136 143
137static struct omap_nand_platform_data nand_data = { 144static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
138 .options = NAND_SAMSUNG_LP_OPTIONS, 145{
146 struct nand_chip *this = mtd->priv;
147 unsigned long mask;
148
149 if (cmd == NAND_CMD_NONE)
150 return;
151
152 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
153 if (ctrl & NAND_ALE)
154 mask |= 0x04;
155 writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
156}
157
158#define P2_NAND_RB_GPIO_PIN 62
159
160static int nand_dev_ready(struct mtd_info *mtd)
161{
162 return gpio_get_value(P2_NAND_RB_GPIO_PIN);
163}
164
165static const char *part_probes[] = { "cmdlinepart", NULL };
166
167static struct platform_nand_data nand_data = {
168 .chip = {
169 .nr_chips = 1,
170 .chip_offset = 0,
171 .options = NAND_SAMSUNG_LP_OPTIONS,
172 .part_probe_types = part_probes,
173 },
174 .ctrl = {
175 .cmd_ctrl = nand_cmd_ctl,
176 .dev_ready = nand_dev_ready,
177 },
139}; 178};
140 179
141static struct resource nand_resource = { 180static struct resource nand_resource = {
@@ -145,7 +184,7 @@ static struct resource nand_resource = {
145}; 184};
146 185
147static struct platform_device nand_device = { 186static struct platform_device nand_device = {
148 .name = "omapnand", 187 .name = "gen_nand",
149 .id = 0, 188 .id = 0,
150 .dev = { 189 .dev = {
151 .platform_data = &nand_data, 190 .platform_data = &nand_data,
@@ -157,14 +196,17 @@ static struct platform_device nand_device = {
157static struct platform_device smc91x_device = { 196static struct platform_device smc91x_device = {
158 .name = "smc91x", 197 .name = "smc91x",
159 .id = 0, 198 .id = 0,
199 .dev = {
200 .platform_data = &smc91x_info,
201 },
160 .num_resources = ARRAY_SIZE(smc91x_resources), 202 .num_resources = ARRAY_SIZE(smc91x_resources),
161 .resource = smc91x_resources, 203 .resource = smc91x_resources,
162}; 204};
163 205
164static struct resource kp_resources[] = { 206static struct resource kp_resources[] = {
165 [0] = { 207 [0] = {
166 .start = INT_730_MPUIO_KEYPAD, 208 .start = INT_7XX_MPUIO_KEYPAD,
167 .end = INT_730_MPUIO_KEYPAD, 209 .end = INT_7XX_MPUIO_KEYPAD,
168 .flags = IORESOURCE_IRQ, 210 .flags = IORESOURCE_IRQ,
169 }, 211 },
170}; 212};
@@ -201,13 +243,6 @@ static struct platform_device *devices[] __initdata = {
201 &lcd_device, 243 &lcd_device,
202}; 244};
203 245
204#define P2_NAND_RB_GPIO_PIN 62
205
206static int nand_dev_ready(struct omap_nand_platform_data *data)
207{
208 return gpio_get_value(P2_NAND_RB_GPIO_PIN);
209}
210
211static struct omap_lcd_config perseus2_lcd_config __initdata = { 246static struct omap_lcd_config perseus2_lcd_config __initdata = {
212 .ctrl_name = "internal", 247 .ctrl_name = "internal",
213}; 248};
@@ -220,7 +255,7 @@ static void __init omap_perseus2_init(void)
220{ 255{
221 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) 256 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0)
222 BUG(); 257 BUG();
223 nand_data.dev_ready = nand_dev_ready; 258 gpio_direction_input(P2_NAND_RB_GPIO_PIN);
224 259
225 omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 260 omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
226 omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 261 omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
@@ -270,7 +305,7 @@ static void __init omap_perseus2_map_io(void)
270 /* 305 /*
271 * Hold GSM Reset until needed 306 * Hold GSM Reset until needed
272 */ 307 */
273 omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL); 308 omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
274 309
275 /* 310 /*
276 * UARTs -> done automagically by 8250 driver 311 * UARTs -> done automagically by 8250 driver
@@ -281,21 +316,21 @@ static void __init omap_perseus2_map_io(void)
281 */ 316 */
282 317
283 /* Flash: CS0 timings setup */ 318 /* Flash: CS0 timings setup */
284 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0); 319 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
285 omap_writel(0x00000088, OMAP730_FLASH_ACFG_0); 320 omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
286 321
287 /* 322 /*
288 * Ethernet support through the debug board 323 * Ethernet support through the debug board
289 * CS1 timings setup 324 * CS1 timings setup
290 */ 325 */
291 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1); 326 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
292 omap_writel(0x00000000, OMAP730_FLASH_ACFG_1); 327 omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
293 328
294 /* 329 /*
295 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, 330 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
296 * It is used as the Ethernet controller interrupt 331 * It is used as the Ethernet controller interrupt
297 */ 332 */
298 omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9); 333 omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, OMAP7XX_IO_CONF_9);
299} 334}
300 335
301MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") 336MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c
index 58a46e4e45c3..5b33ae8141bc 100644
--- a/arch/arm/mach-omap1/board-sx1-mmc.c
+++ b/arch/arm/mach-omap1/board-sx1-mmc.c
@@ -15,9 +15,9 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16 16
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/mmc.h> 18#include <plat/mmc.h>
19#include <mach/gpio.h> 19#include <mach/gpio.h>
20#include <mach/board-sx1.h> 20#include <plat/board-sx1.h>
21 21
22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) 22#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
23 23
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 056ae64e0f55..2fb1e5f8e2ec 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -22,6 +22,7 @@
22#include <linux/notifier.h> 22#include <linux/notifier.h>
23#include <linux/mtd/mtd.h> 23#include <linux/mtd/mtd.h>
24#include <linux/mtd/partitions.h> 24#include <linux/mtd/partitions.h>
25#include <linux/mtd/physmap.h>
25#include <linux/types.h> 26#include <linux/types.h>
26#include <linux/i2c.h> 27#include <linux/i2c.h>
27#include <linux/errno.h> 28#include <linux/errno.h>
@@ -29,19 +30,19 @@
29#include <mach/hardware.h> 30#include <mach/hardware.h>
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
32#include <asm/mach/flash.h>
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34 34
35#include <mach/gpio.h> 35#include <mach/gpio.h>
36#include <mach/mux.h> 36#include <plat/flash.h>
37#include <mach/dma.h> 37#include <plat/mux.h>
38#include <mach/irda.h> 38#include <plat/dma.h>
39#include <mach/usb.h> 39#include <plat/irda.h>
40#include <mach/tc.h> 40#include <plat/usb.h>
41#include <mach/board.h> 41#include <plat/tc.h>
42#include <mach/common.h> 42#include <plat/board.h>
43#include <mach/keypad.h> 43#include <plat/common.h>
44#include <mach/board-sx1.h> 44#include <plat/keypad.h>
45#include <plat/board-sx1.h>
45 46
46/* Write to I2C device */ 47/* Write to I2C device */
47int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) 48int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
@@ -287,9 +288,9 @@ static struct mtd_partition sx1_partitions[] = {
287 } 288 }
288}; 289};
289 290
290static struct flash_platform_data sx1_flash_data = { 291static struct physmap_flash_data sx1_flash_data = {
291 .map_name = "cfi_probe",
292 .width = 2, 292 .width = 2,
293 .set_vpp = omap1_set_vpp,
293 .parts = sx1_partitions, 294 .parts = sx1_partitions,
294 .nr_parts = ARRAY_SIZE(sx1_partitions), 295 .nr_parts = ARRAY_SIZE(sx1_partitions),
295}; 296};
@@ -310,7 +311,7 @@ static struct resource sx1_old_flash_resource[] = {
310}; 311};
311 312
312static struct platform_device sx1_flash_device = { 313static struct platform_device sx1_flash_device = {
313 .name = "omapflash", 314 .name = "physmap-flash",
314 .id = 0, 315 .id = 0,
315 .dev = { 316 .dev = {
316 .platform_data = &sx1_flash_data, 317 .platform_data = &sx1_flash_data,
@@ -327,7 +328,7 @@ static struct resource sx1_new_flash_resource = {
327}; 328};
328 329
329static struct platform_device sx1_flash_device = { 330static struct platform_device sx1_flash_device = {
330 .name = "omapflash", 331 .name = "physmap-flash",
331 .id = 0, 332 .id = 0,
332 .dev = { 333 .dev = {
333 .platform_data = &sx1_flash_data, 334 .platform_data = &sx1_flash_data,
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index 07b07522d5bf..87b9436fe7c0 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -18,22 +18,24 @@
18#include <linux/irq.h> 18#include <linux/irq.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/mtd/physmap.h>
21#include <linux/notifier.h> 22#include <linux/notifier.h>
22#include <linux/reboot.h> 23#include <linux/reboot.h>
23#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
24#include <linux/serial_reg.h> 25#include <linux/serial_reg.h>
26#include <linux/smc91x.h>
25 27
26#include <mach/hardware.h> 28#include <mach/hardware.h>
27#include <asm/mach-types.h> 29#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
29#include <asm/mach/flash.h>
30#include <asm/mach/map.h> 31#include <asm/mach/map.h>
31 32
32#include <mach/common.h> 33#include <plat/common.h>
33#include <mach/gpio.h> 34#include <mach/gpio.h>
34#include <mach/mux.h> 35#include <plat/flash.h>
35#include <mach/tc.h> 36#include <plat/mux.h>
36#include <mach/usb.h> 37#include <plat/tc.h>
38#include <plat/usb.h>
37 39
38static struct plat_serial8250_port voiceblue_ports[] = { 40static struct plat_serial8250_port voiceblue_ports[] = {
39 { 41 {
@@ -85,9 +87,9 @@ static int __init ext_uart_init(void)
85} 87}
86arch_initcall(ext_uart_init); 88arch_initcall(ext_uart_init);
87 89
88static struct flash_platform_data voiceblue_flash_data = { 90static struct physmap_flash_data voiceblue_flash_data = {
89 .map_name = "cfi_probe",
90 .width = 2, 91 .width = 2,
92 .set_vpp = omap1_set_vpp,
91}; 93};
92 94
93static struct resource voiceblue_flash_resource = { 95static struct resource voiceblue_flash_resource = {
@@ -97,7 +99,7 @@ static struct resource voiceblue_flash_resource = {
97}; 99};
98 100
99static struct platform_device voiceblue_flash_device = { 101static struct platform_device voiceblue_flash_device = {
100 .name = "omapflash", 102 .name = "physmap-flash",
101 .id = 0, 103 .id = 0,
102 .dev = { 104 .dev = {
103 .platform_data = &voiceblue_flash_data, 105 .platform_data = &voiceblue_flash_data,
@@ -106,6 +108,12 @@ static struct platform_device voiceblue_flash_device = {
106 .resource = &voiceblue_flash_resource, 108 .resource = &voiceblue_flash_resource,
107}; 109};
108 110
111static struct smc91x_platdata voiceblue_smc91x_info = {
112 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
113 .leda = RPC_LED_100_10,
114 .ledb = RPC_LED_TX_RX,
115};
116
109static struct resource voiceblue_smc91x_resources[] = { 117static struct resource voiceblue_smc91x_resources[] = {
110 [0] = { 118 [0] = {
111 .start = OMAP_CS2_PHYS + 0x300, 119 .start = OMAP_CS2_PHYS + 0x300,
@@ -122,6 +130,9 @@ static struct resource voiceblue_smc91x_resources[] = {
122static struct platform_device voiceblue_smc91x_device = { 130static struct platform_device voiceblue_smc91x_device = {
123 .name = "smc91x", 131 .name = "smc91x",
124 .id = 0, 132 .id = 0,
133 .dev = {
134 .platform_data = &voiceblue_smc91x_info,
135 },
125 .num_resources = ARRAY_SIZE(voiceblue_smc91x_resources), 136 .num_resources = ARRAY_SIZE(voiceblue_smc91x_resources),
126 .resource = voiceblue_smc91x_resources, 137 .resource = voiceblue_smc91x_resources,
127}; 138};
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 436eed22801b..e0aec1007a0d 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/mach-omap1/clock.c 2 * linux/arch/arm/mach-omap1/clock.c
3 * 3 *
4 * Copyright (C) 2004 - 2005 Nokia corporation 4 * Copyright (C) 2004 - 2005, 2009-2010 Nokia Corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> 5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * 6 *
7 * Modified to use omap shared clock framework by 7 * Modified to use omap shared clock framework by
@@ -22,152 +22,29 @@
22#include <asm/mach-types.h> 22#include <asm/mach-types.h>
23#include <asm/clkdev.h> 23#include <asm/clkdev.h>
24 24
25#include <mach/cpu.h> 25#include <plat/cpu.h>
26#include <mach/usb.h> 26#include <plat/usb.h>
27#include <mach/clock.h> 27#include <plat/clock.h>
28#include <mach/sram.h> 28#include <plat/sram.h>
29 29#include <plat/clkdev_omap.h>
30static const struct clkops clkops_generic;
31static const struct clkops clkops_uart;
32static const struct clkops clkops_dspck;
33 30
34#include "clock.h" 31#include "clock.h"
35 32#include "opp.h"
36static int clk_omap1_dummy_enable(struct clk *clk)
37{
38 return 0;
39}
40
41static void clk_omap1_dummy_disable(struct clk *clk)
42{
43}
44
45static const struct clkops clkops_dummy = {
46 .enable = clk_omap1_dummy_enable,
47 .disable = clk_omap1_dummy_disable,
48};
49
50static struct clk dummy_ck = {
51 .name = "dummy",
52 .ops = &clkops_dummy,
53 .flags = RATE_FIXED,
54};
55
56struct omap_clk {
57 u32 cpu;
58 struct clk_lookup lk;
59};
60
61#define CLK(dev, con, ck, cp) \
62 { \
63 .cpu = cp, \
64 .lk = { \
65 .dev_id = dev, \
66 .con_id = con, \
67 .clk = ck, \
68 }, \
69 }
70
71#define CK_310 (1 << 0)
72#define CK_730 (1 << 1)
73#define CK_1510 (1 << 2)
74#define CK_16XX (1 << 3)
75
76static struct omap_clk omap_clks[] = {
77 /* non-ULPD clocks */
78 CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310),
79 CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310),
80 /* CK_GEN1 clocks */
81 CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX),
82 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX),
83 CLK(NULL, "arm_ck", &arm_ck, CK_16XX | CK_1510 | CK_310),
84 CLK(NULL, "armper_ck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
85 CLK(NULL, "arm_gpio_ck", &arm_gpio_ck, CK_1510 | CK_310),
86 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310),
87 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310),
88 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310),
89 CLK("omap_wdt", "ick", &armper_ck.clk, CK_16XX),
90 CLK("omap_wdt", "ick", &dummy_ck, CK_1510 | CK_310),
91 CLK(NULL, "arminth_ck", &arminth_ck1510, CK_1510 | CK_310),
92 CLK(NULL, "arminth_ck", &arminth_ck16xx, CK_16XX),
93 /* CK_GEN2 clocks */
94 CLK(NULL, "dsp_ck", &dsp_ck, CK_16XX | CK_1510 | CK_310),
95 CLK(NULL, "dspmmu_ck", &dspmmu_ck, CK_16XX | CK_1510 | CK_310),
96 CLK(NULL, "dspper_ck", &dspper_ck, CK_16XX | CK_1510 | CK_310),
97 CLK(NULL, "dspxor_ck", &dspxor_ck, CK_16XX | CK_1510 | CK_310),
98 CLK(NULL, "dsptim_ck", &dsptim_ck, CK_16XX | CK_1510 | CK_310),
99 /* CK_GEN3 clocks */
100 CLK(NULL, "tc_ck", &tc_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_730),
101 CLK(NULL, "tipb_ck", &tipb_ck, CK_1510 | CK_310),
102 CLK(NULL, "l3_ocpi_ck", &l3_ocpi_ck, CK_16XX),
103 CLK(NULL, "tc1_ck", &tc1_ck, CK_16XX),
104 CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX),
105 CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310),
106 CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX),
107 CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310),
108 CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310),
109 CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX),
110 CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX),
111 CLK(NULL, "lcd_ck", &lcd_ck_16xx, CK_16XX | CK_730),
112 CLK(NULL, "lcd_ck", &lcd_ck_1510.clk, CK_1510 | CK_310),
113 /* ULPD clocks */
114 CLK(NULL, "uart1_ck", &uart1_1510, CK_1510 | CK_310),
115 CLK(NULL, "uart1_ck", &uart1_16xx.clk, CK_16XX),
116 CLK(NULL, "uart2_ck", &uart2_ck, CK_16XX | CK_1510 | CK_310),
117 CLK(NULL, "uart3_ck", &uart3_1510, CK_1510 | CK_310),
118 CLK(NULL, "uart3_ck", &uart3_16xx.clk, CK_16XX),
119 CLK(NULL, "usb_clko", &usb_clko, CK_16XX | CK_1510 | CK_310),
120 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck1510, CK_1510 | CK_310),
121 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck16xx, CK_16XX),
122 CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX),
123 CLK(NULL, "mclk", &mclk_1510, CK_1510 | CK_310),
124 CLK(NULL, "mclk", &mclk_16xx, CK_16XX),
125 CLK(NULL, "bclk", &bclk_1510, CK_1510 | CK_310),
126 CLK(NULL, "bclk", &bclk_16xx, CK_16XX),
127 CLK("mmci-omap.0", "fck", &mmc1_ck, CK_16XX | CK_1510 | CK_310),
128 CLK("mmci-omap.0", "ick", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
129 CLK("mmci-omap.1", "fck", &mmc2_ck, CK_16XX),
130 CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX),
131 /* Virtual clocks */
132 CLK(NULL, "mpu", &virtual_ck_mpu, CK_16XX | CK_1510 | CK_310),
133 CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310),
134 CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX),
135 CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310),
136 CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310),
137 CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX),
138 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310),
139 CLK("omap-mcbsp.2", "ick", &armper_ck.clk, CK_16XX),
140 CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_1510 | CK_310),
141 CLK("omap-mcbsp.3", "ick", &dspper_ck, CK_16XX),
142 CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_1510 | CK_310),
143 CLK("omap-mcbsp.1", "fck", &dspxor_ck, CK_16XX | CK_1510 | CK_310),
144 CLK("omap-mcbsp.2", "fck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
145 CLK("omap-mcbsp.3", "fck", &dspxor_ck, CK_16XX | CK_1510 | CK_310),
146};
147
148static int omap1_clk_enable_generic(struct clk * clk);
149static int omap1_clk_enable(struct clk *clk);
150static void omap1_clk_disable_generic(struct clk * clk);
151static void omap1_clk_disable(struct clk *clk);
152 33
153__u32 arm_idlect1_mask; 34__u32 arm_idlect1_mask;
35struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
154 36
155/*------------------------------------------------------------------------- 37/*-------------------------------------------------------------------------
156 * Omap1 specific clock functions 38 * Omap1 specific clock functions
157 *-------------------------------------------------------------------------*/ 39 *-------------------------------------------------------------------------*/
158 40
159static unsigned long omap1_watchdog_recalc(struct clk *clk) 41unsigned long omap1_uart_recalc(struct clk *clk)
160{
161 return clk->parent->rate / 14;
162}
163
164static unsigned long omap1_uart_recalc(struct clk *clk)
165{ 42{
166 unsigned int val = __raw_readl(clk->enable_reg); 43 unsigned int val = __raw_readl(clk->enable_reg);
167 return val & clk->enable_bit ? 48000000 : 12000000; 44 return val & clk->enable_bit ? 48000000 : 12000000;
168} 45}
169 46
170static unsigned long omap1_sossi_recalc(struct clk *clk) 47unsigned long omap1_sossi_recalc(struct clk *clk)
171{ 48{
172 u32 div = omap_readl(MOD_CONF_CTRL_1); 49 u32 div = omap_readl(MOD_CONF_CTRL_1);
173 50
@@ -177,64 +54,6 @@ static unsigned long omap1_sossi_recalc(struct clk *clk)
177 return clk->parent->rate / div; 54 return clk->parent->rate / div;
178} 55}
179 56
180static int omap1_clk_enable_dsp_domain(struct clk *clk)
181{
182 int retval;
183
184 retval = omap1_clk_enable(&api_ck.clk);
185 if (!retval) {
186 retval = omap1_clk_enable_generic(clk);
187 omap1_clk_disable(&api_ck.clk);
188 }
189
190 return retval;
191}
192
193static void omap1_clk_disable_dsp_domain(struct clk *clk)
194{
195 if (omap1_clk_enable(&api_ck.clk) == 0) {
196 omap1_clk_disable_generic(clk);
197 omap1_clk_disable(&api_ck.clk);
198 }
199}
200
201static const struct clkops clkops_dspck = {
202 .enable = &omap1_clk_enable_dsp_domain,
203 .disable = &omap1_clk_disable_dsp_domain,
204};
205
206static int omap1_clk_enable_uart_functional(struct clk *clk)
207{
208 int ret;
209 struct uart_clk *uclk;
210
211 ret = omap1_clk_enable_generic(clk);
212 if (ret == 0) {
213 /* Set smart idle acknowledgement mode */
214 uclk = (struct uart_clk *)clk;
215 omap_writeb((omap_readb(uclk->sysc_addr) & ~0x10) | 8,
216 uclk->sysc_addr);
217 }
218
219 return ret;
220}
221
222static void omap1_clk_disable_uart_functional(struct clk *clk)
223{
224 struct uart_clk *uclk;
225
226 /* Set force idle acknowledgement mode */
227 uclk = (struct uart_clk *)clk;
228 omap_writeb((omap_readb(uclk->sysc_addr) & ~0x18), uclk->sysc_addr);
229
230 omap1_clk_disable_generic(clk);
231}
232
233static const struct clkops clkops_uart = {
234 .enable = &omap1_clk_enable_uart_functional,
235 .disable = &omap1_clk_disable_uart_functional,
236};
237
238static void omap1_clk_allow_idle(struct clk *clk) 57static void omap1_clk_allow_idle(struct clk *clk)
239{ 58{
240 struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk; 59 struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk;
@@ -342,7 +161,7 @@ static int calc_dsor_exp(struct clk *clk, unsigned long rate)
342 return dsor_exp; 161 return dsor_exp;
343} 162}
344 163
345static unsigned long omap1_ckctl_recalc(struct clk *clk) 164unsigned long omap1_ckctl_recalc(struct clk *clk)
346{ 165{
347 /* Calculate divisor encoded as 2-bit exponent */ 166 /* Calculate divisor encoded as 2-bit exponent */
348 int dsor = 1 << (3 & (omap_readw(ARM_CKCTL) >> clk->rate_offset)); 167 int dsor = 1 << (3 & (omap_readw(ARM_CKCTL) >> clk->rate_offset));
@@ -350,7 +169,7 @@ static unsigned long omap1_ckctl_recalc(struct clk *clk)
350 return clk->parent->rate / dsor; 169 return clk->parent->rate / dsor;
351} 170}
352 171
353static unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk) 172unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk)
354{ 173{
355 int dsor; 174 int dsor;
356 175
@@ -361,28 +180,29 @@ static unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk)
361 * Note that DSP_CKCTL virt addr = phys addr, so 180 * Note that DSP_CKCTL virt addr = phys addr, so
362 * we must use __raw_readw() instead of omap_readw(). 181 * we must use __raw_readw() instead of omap_readw().
363 */ 182 */
364 omap1_clk_enable(&api_ck.clk); 183 omap1_clk_enable(api_ck_p);
365 dsor = 1 << (3 & (__raw_readw(DSP_CKCTL) >> clk->rate_offset)); 184 dsor = 1 << (3 & (__raw_readw(DSP_CKCTL) >> clk->rate_offset));
366 omap1_clk_disable(&api_ck.clk); 185 omap1_clk_disable(api_ck_p);
367 186
368 return clk->parent->rate / dsor; 187 return clk->parent->rate / dsor;
369} 188}
370 189
371/* MPU virtual clock functions */ 190/* MPU virtual clock functions */
372static int omap1_select_table_rate(struct clk * clk, unsigned long rate) 191int omap1_select_table_rate(struct clk *clk, unsigned long rate)
373{ 192{
374 /* Find the highest supported frequency <= rate and switch to it */ 193 /* Find the highest supported frequency <= rate and switch to it */
375 struct mpu_rate * ptr; 194 struct mpu_rate * ptr;
195 unsigned long dpll1_rate, ref_rate;
376 196
377 if (clk != &virtual_ck_mpu) 197 dpll1_rate = ck_dpll1_p->rate;
378 return -EINVAL; 198 ref_rate = ck_ref_p->rate;
379 199
380 for (ptr = rate_table; ptr->rate; ptr++) { 200 for (ptr = omap1_rate_table; ptr->rate; ptr++) {
381 if (ptr->xtal != ck_ref.rate) 201 if (ptr->xtal != ref_rate)
382 continue; 202 continue;
383 203
384 /* DPLL1 cannot be reprogrammed without risking system crash */ 204 /* DPLL1 cannot be reprogrammed without risking system crash */
385 if (likely(ck_dpll1.rate!=0) && ptr->pll_rate != ck_dpll1.rate) 205 if (likely(dpll1_rate != 0) && ptr->pll_rate != dpll1_rate)
386 continue; 206 continue;
387 207
388 /* Can check only after xtal frequency check */ 208 /* Can check only after xtal frequency check */
@@ -398,16 +218,18 @@ static int omap1_select_table_rate(struct clk * clk, unsigned long rate)
398 * Reprogramming the DPLL is tricky, it must be done from SRAM. 218 * Reprogramming the DPLL is tricky, it must be done from SRAM.
399 * (on 730, bit 13 must always be 1) 219 * (on 730, bit 13 must always be 1)
400 */ 220 */
401 if (cpu_is_omap730()) 221 if (cpu_is_omap7xx())
402 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val | 0x2000); 222 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val | 0x2000);
403 else 223 else
404 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val); 224 omap_sram_reprogram_clock(ptr->dpllctl_val, ptr->ckctl_val);
405 225
406 ck_dpll1.rate = ptr->pll_rate; 226 /* XXX Do we need to recalculate the tree below DPLL1 at this point? */
227 ck_dpll1_p->rate = ptr->pll_rate;
228
407 return 0; 229 return 0;
408} 230}
409 231
410static int omap1_clk_set_rate_dsp_domain(struct clk *clk, unsigned long rate) 232int omap1_clk_set_rate_dsp_domain(struct clk *clk, unsigned long rate)
411{ 233{
412 int dsor_exp; 234 int dsor_exp;
413 u16 regval; 235 u16 regval;
@@ -427,7 +249,7 @@ static int omap1_clk_set_rate_dsp_domain(struct clk *clk, unsigned long rate)
427 return 0; 249 return 0;
428} 250}
429 251
430static long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate) 252long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate)
431{ 253{
432 int dsor_exp = calc_dsor_exp(clk, rate); 254 int dsor_exp = calc_dsor_exp(clk, rate);
433 if (dsor_exp < 0) 255 if (dsor_exp < 0)
@@ -437,7 +259,7 @@ static long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate)
437 return clk->parent->rate / (1 << dsor_exp); 259 return clk->parent->rate / (1 << dsor_exp);
438} 260}
439 261
440static int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate) 262int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate)
441{ 263{
442 int dsor_exp; 264 int dsor_exp;
443 u16 regval; 265 u16 regval;
@@ -457,19 +279,19 @@ static int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate)
457 return 0; 279 return 0;
458} 280}
459 281
460static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate) 282long omap1_round_to_table_rate(struct clk *clk, unsigned long rate)
461{ 283{
462 /* Find the highest supported frequency <= rate */ 284 /* Find the highest supported frequency <= rate */
463 struct mpu_rate * ptr; 285 struct mpu_rate * ptr;
464 long highest_rate; 286 long highest_rate;
287 unsigned long ref_rate;
465 288
466 if (clk != &virtual_ck_mpu) 289 ref_rate = ck_ref_p->rate;
467 return -EINVAL;
468 290
469 highest_rate = -EINVAL; 291 highest_rate = -EINVAL;
470 292
471 for (ptr = rate_table; ptr->rate; ptr++) { 293 for (ptr = omap1_rate_table; ptr->rate; ptr++) {
472 if (ptr->xtal != ck_ref.rate) 294 if (ptr->xtal != ref_rate)
473 continue; 295 continue;
474 296
475 highest_rate = ptr->rate; 297 highest_rate = ptr->rate;
@@ -504,8 +326,8 @@ static unsigned calc_ext_dsor(unsigned long rate)
504 return dsor; 326 return dsor;
505} 327}
506 328
507/* Only needed on 1510 */ 329/* XXX Only needed on 1510 */
508static int omap1_set_uart_rate(struct clk * clk, unsigned long rate) 330int omap1_set_uart_rate(struct clk *clk, unsigned long rate)
509{ 331{
510 unsigned int val; 332 unsigned int val;
511 333
@@ -523,7 +345,7 @@ static int omap1_set_uart_rate(struct clk * clk, unsigned long rate)
523} 345}
524 346
525/* External clock (MCLK & BCLK) functions */ 347/* External clock (MCLK & BCLK) functions */
526static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate) 348int omap1_set_ext_clk_rate(struct clk *clk, unsigned long rate)
527{ 349{
528 unsigned dsor; 350 unsigned dsor;
529 __u16 ratio_bits; 351 __u16 ratio_bits;
@@ -541,7 +363,7 @@ static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate)
541 return 0; 363 return 0;
542} 364}
543 365
544static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate) 366int omap1_set_sossi_rate(struct clk *clk, unsigned long rate)
545{ 367{
546 u32 l; 368 u32 l;
547 int div; 369 int div;
@@ -564,12 +386,12 @@ static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate)
564 return 0; 386 return 0;
565} 387}
566 388
567static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate) 389long omap1_round_ext_clk_rate(struct clk *clk, unsigned long rate)
568{ 390{
569 return 96000000 / calc_ext_dsor(rate); 391 return 96000000 / calc_ext_dsor(rate);
570} 392}
571 393
572static void omap1_init_ext_clk(struct clk * clk) 394void omap1_init_ext_clk(struct clk *clk)
573{ 395{
574 unsigned dsor; 396 unsigned dsor;
575 __u16 ratio_bits; 397 __u16 ratio_bits;
@@ -587,7 +409,7 @@ static void omap1_init_ext_clk(struct clk * clk)
587 clk-> rate = 96000000 / dsor; 409 clk-> rate = 96000000 / dsor;
588} 410}
589 411
590static int omap1_clk_enable(struct clk *clk) 412int omap1_clk_enable(struct clk *clk)
591{ 413{
592 int ret = 0; 414 int ret = 0;
593 415
@@ -615,7 +437,7 @@ err:
615 return ret; 437 return ret;
616} 438}
617 439
618static void omap1_clk_disable(struct clk *clk) 440void omap1_clk_disable(struct clk *clk)
619{ 441{
620 if (clk->usecount > 0 && !(--clk->usecount)) { 442 if (clk->usecount > 0 && !(--clk->usecount)) {
621 clk->ops->disable(clk); 443 clk->ops->disable(clk);
@@ -670,23 +492,78 @@ static void omap1_clk_disable_generic(struct clk *clk)
670 } 492 }
671} 493}
672 494
673static const struct clkops clkops_generic = { 495const struct clkops clkops_generic = {
674 .enable = &omap1_clk_enable_generic, 496 .enable = omap1_clk_enable_generic,
675 .disable = &omap1_clk_disable_generic, 497 .disable = omap1_clk_disable_generic,
498};
499
500static int omap1_clk_enable_dsp_domain(struct clk *clk)
501{
502 int retval;
503
504 retval = omap1_clk_enable(api_ck_p);
505 if (!retval) {
506 retval = omap1_clk_enable_generic(clk);
507 omap1_clk_disable(api_ck_p);
508 }
509
510 return retval;
511}
512
513static void omap1_clk_disable_dsp_domain(struct clk *clk)
514{
515 if (omap1_clk_enable(api_ck_p) == 0) {
516 omap1_clk_disable_generic(clk);
517 omap1_clk_disable(api_ck_p);
518 }
519}
520
521const struct clkops clkops_dspck = {
522 .enable = omap1_clk_enable_dsp_domain,
523 .disable = omap1_clk_disable_dsp_domain,
676}; 524};
677 525
678static long omap1_clk_round_rate(struct clk *clk, unsigned long rate) 526static int omap1_clk_enable_uart_functional(struct clk *clk)
527{
528 int ret;
529 struct uart_clk *uclk;
530
531 ret = omap1_clk_enable_generic(clk);
532 if (ret == 0) {
533 /* Set smart idle acknowledgement mode */
534 uclk = (struct uart_clk *)clk;
535 omap_writeb((omap_readb(uclk->sysc_addr) & ~0x10) | 8,
536 uclk->sysc_addr);
537 }
538
539 return ret;
540}
541
542static void omap1_clk_disable_uart_functional(struct clk *clk)
679{ 543{
680 if (clk->flags & RATE_FIXED) 544 struct uart_clk *uclk;
681 return clk->rate; 545
546 /* Set force idle acknowledgement mode */
547 uclk = (struct uart_clk *)clk;
548 omap_writeb((omap_readb(uclk->sysc_addr) & ~0x18), uclk->sysc_addr);
549
550 omap1_clk_disable_generic(clk);
551}
552
553const struct clkops clkops_uart = {
554 .enable = omap1_clk_enable_uart_functional,
555 .disable = omap1_clk_disable_uart_functional,
556};
682 557
558long omap1_clk_round_rate(struct clk *clk, unsigned long rate)
559{
683 if (clk->round_rate != NULL) 560 if (clk->round_rate != NULL)
684 return clk->round_rate(clk, rate); 561 return clk->round_rate(clk, rate);
685 562
686 return clk->rate; 563 return clk->rate;
687} 564}
688 565
689static int omap1_clk_set_rate(struct clk *clk, unsigned long rate) 566int omap1_clk_set_rate(struct clk *clk, unsigned long rate)
690{ 567{
691 int ret = -EINVAL; 568 int ret = -EINVAL;
692 569
@@ -701,7 +578,7 @@ static int omap1_clk_set_rate(struct clk *clk, unsigned long rate)
701 578
702#ifdef CONFIG_OMAP_RESET_CLOCKS 579#ifdef CONFIG_OMAP_RESET_CLOCKS
703 580
704static void __init omap1_clk_disable_unused(struct clk *clk) 581void __init omap1_clk_disable_unused(struct clk *clk)
705{ 582{
706 __u32 regval32; 583 __u32 regval32;
707 584
@@ -722,184 +599,9 @@ static void __init omap1_clk_disable_unused(struct clk *clk)
722 if ((regval32 & (1 << clk->enable_bit)) == 0) 599 if ((regval32 & (1 << clk->enable_bit)) == 0)
723 return; 600 return;
724 601
725 /* FIXME: This clock seems to be necessary but no-one
726 * has asked for its activation. */
727 if (clk == &tc2_ck /* FIX: pm.c (SRAM), CCP, Camera */
728 || clk == &ck_dpll1out.clk /* FIX: SoSSI, SSR */
729 || clk == &arm_gpio_ck /* FIX: GPIO code for 1510 */
730 ) {
731 printk(KERN_INFO "FIXME: Clock \"%s\" seems unused\n",
732 clk->name);
733 return;
734 }
735
736 printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name); 602 printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name);
737 clk->ops->disable(clk); 603 clk->ops->disable(clk);
738 printk(" done\n"); 604 printk(" done\n");
739} 605}
740 606
741#else
742#define omap1_clk_disable_unused NULL
743#endif
744
745static struct clk_functions omap1_clk_functions = {
746 .clk_enable = omap1_clk_enable,
747 .clk_disable = omap1_clk_disable,
748 .clk_round_rate = omap1_clk_round_rate,
749 .clk_set_rate = omap1_clk_set_rate,
750 .clk_disable_unused = omap1_clk_disable_unused,
751};
752
753int __init omap1_clk_init(void)
754{
755 struct omap_clk *c;
756 const struct omap_clock_config *info;
757 int crystal_type = 0; /* Default 12 MHz */
758 u32 reg, cpu_mask;
759
760#ifdef CONFIG_DEBUG_LL
761 /* Resets some clocks that may be left on from bootloader,
762 * but leaves serial clocks on.
763 */
764 omap_writel(0x3 << 29, MOD_CONF_CTRL_0);
765#endif
766
767 /* USB_REQ_EN will be disabled later if necessary (usb_dc_ck) */
768 reg = omap_readw(SOFT_REQ_REG) & (1 << 4);
769 omap_writew(reg, SOFT_REQ_REG);
770 if (!cpu_is_omap15xx())
771 omap_writew(0, SOFT_REQ_REG2);
772
773 clk_init(&omap1_clk_functions);
774
775 /* By default all idlect1 clocks are allowed to idle */
776 arm_idlect1_mask = ~0;
777
778 for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++)
779 clk_preinit(c->lk.clk);
780
781 cpu_mask = 0;
782 if (cpu_is_omap16xx())
783 cpu_mask |= CK_16XX;
784 if (cpu_is_omap1510())
785 cpu_mask |= CK_1510;
786 if (cpu_is_omap730())
787 cpu_mask |= CK_730;
788 if (cpu_is_omap310())
789 cpu_mask |= CK_310;
790
791 for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++)
792 if (c->cpu & cpu_mask) {
793 clkdev_add(&c->lk);
794 clk_register(c->lk.clk);
795 }
796
797 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config);
798 if (info != NULL) {
799 if (!cpu_is_omap15xx())
800 crystal_type = info->system_clock_type;
801 }
802
803#if defined(CONFIG_ARCH_OMAP730)
804 ck_ref.rate = 13000000;
805#elif defined(CONFIG_ARCH_OMAP16XX)
806 if (crystal_type == 2)
807 ck_ref.rate = 19200000;
808#endif 607#endif
809
810 printk("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: 0x%04x\n",
811 omap_readw(ARM_SYSST), omap_readw(DPLL_CTL),
812 omap_readw(ARM_CKCTL));
813
814 /* We want to be in syncronous scalable mode */
815 omap_writew(0x1000, ARM_SYSST);
816
817#ifdef CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER
818 /* Use values set by bootloader. Determine PLL rate and recalculate
819 * dependent clocks as if kernel had changed PLL or divisors.
820 */
821 {
822 unsigned pll_ctl_val = omap_readw(DPLL_CTL);
823
824 ck_dpll1.rate = ck_ref.rate; /* Base xtal rate */
825 if (pll_ctl_val & 0x10) {
826 /* PLL enabled, apply multiplier and divisor */
827 if (pll_ctl_val & 0xf80)
828 ck_dpll1.rate *= (pll_ctl_val & 0xf80) >> 7;
829 ck_dpll1.rate /= ((pll_ctl_val & 0x60) >> 5) + 1;
830 } else {
831 /* PLL disabled, apply bypass divisor */
832 switch (pll_ctl_val & 0xc) {
833 case 0:
834 break;
835 case 0x4:
836 ck_dpll1.rate /= 2;
837 break;
838 default:
839 ck_dpll1.rate /= 4;
840 break;
841 }
842 }
843 }
844#else
845 /* Find the highest supported frequency and enable it */
846 if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
847 printk(KERN_ERR "System frequencies not set. Check your config.\n");
848 /* Guess sane values (60MHz) */
849 omap_writew(0x2290, DPLL_CTL);
850 omap_writew(cpu_is_omap730() ? 0x3005 : 0x1005, ARM_CKCTL);
851 ck_dpll1.rate = 60000000;
852 }
853#endif
854 propagate_rate(&ck_dpll1);
855 /* Cache rates for clocks connected to ck_ref (not dpll1) */
856 propagate_rate(&ck_ref);
857 printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): "
858 "%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n",
859 ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10,
860 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
861 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
862
863#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE)
864 /* Select slicer output as OMAP input clock */
865 omap_writew(omap_readw(OMAP730_PCC_UPLD_CTRL) & ~0x1, OMAP730_PCC_UPLD_CTRL);
866#endif
867
868 /* Amstrad Delta wants BCLK high when inactive */
869 if (machine_is_ams_delta())
870 omap_writel(omap_readl(ULPD_CLOCK_CTRL) |
871 (1 << SDW_MCLK_INV_BIT),
872 ULPD_CLOCK_CTRL);
873
874 /* Turn off DSP and ARM_TIMXO. Make sure ARM_INTHCK is not divided */
875 /* (on 730, bit 13 must not be cleared) */
876 if (cpu_is_omap730())
877 omap_writew(omap_readw(ARM_CKCTL) & 0x2fff, ARM_CKCTL);
878 else
879 omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL);
880
881 /* Put DSP/MPUI into reset until needed */
882 omap_writew(0, ARM_RSTCT1);
883 omap_writew(1, ARM_RSTCT2);
884 omap_writew(0x400, ARM_IDLECT1);
885
886 /*
887 * According to OMAP5910 Erratum SYS_DMA_1, bit DMACK_REQ (bit 8)
888 * of the ARM_IDLECT2 register must be set to zero. The power-on
889 * default value of this bit is one.
890 */
891 omap_writew(0x0000, ARM_IDLECT2); /* Turn LCD clock off also */
892
893 /*
894 * Only enable those clocks we will need, let the drivers
895 * enable other clocks as necessary
896 */
897 clk_enable(&armper_ck.clk);
898 clk_enable(&armxor_ck.clk);
899 clk_enable(&armtim_ck.clk); /* This should be done by timer code */
900
901 if (cpu_is_omap15xx())
902 clk_enable(&arm_gpio_ck);
903
904 return 0;
905}
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index 17f874271255..a4190afb8614 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/mach-omap1/clock.h 2 * linux/arch/arm/mach-omap1/clock.h
3 * 3 *
4 * Copyright (C) 2004 - 2005 Nokia corporation 4 * Copyright (C) 2004 - 2005, 2009 Nokia corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> 5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc 6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7 * 7 *
@@ -13,30 +13,36 @@
13#ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H 13#ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H
14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H 14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H
15 15
16static unsigned long omap1_ckctl_recalc(struct clk *clk); 16#include <linux/clk.h>
17static unsigned long omap1_watchdog_recalc(struct clk *clk); 17
18static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate); 18#include <plat/clock.h>
19static unsigned long omap1_sossi_recalc(struct clk *clk); 19
20static unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk); 20extern int __init omap1_clk_init(void);
21static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate); 21extern int omap1_clk_enable(struct clk *clk);
22static int omap1_set_uart_rate(struct clk * clk, unsigned long rate); 22extern void omap1_clk_disable(struct clk *clk);
23static unsigned long omap1_uart_recalc(struct clk *clk); 23extern long omap1_clk_round_rate(struct clk *clk, unsigned long rate);
24static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate); 24extern int omap1_clk_set_rate(struct clk *clk, unsigned long rate);
25static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate); 25extern unsigned long omap1_ckctl_recalc(struct clk *clk);
26static void omap1_init_ext_clk(struct clk * clk); 26extern int omap1_set_sossi_rate(struct clk *clk, unsigned long rate);
27static int omap1_select_table_rate(struct clk * clk, unsigned long rate); 27extern unsigned long omap1_sossi_recalc(struct clk *clk);
28static long omap1_round_to_table_rate(struct clk * clk, unsigned long rate); 28extern unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk);
29 29extern int omap1_clk_set_rate_dsp_domain(struct clk *clk, unsigned long rate);
30static int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate); 30extern int omap1_set_uart_rate(struct clk *clk, unsigned long rate);
31static long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate); 31extern unsigned long omap1_uart_recalc(struct clk *clk);
32 32extern int omap1_set_ext_clk_rate(struct clk *clk, unsigned long rate);
33struct mpu_rate { 33extern long omap1_round_ext_clk_rate(struct clk *clk, unsigned long rate);
34 unsigned long rate; 34extern void omap1_init_ext_clk(struct clk *clk);
35 unsigned long xtal; 35extern int omap1_select_table_rate(struct clk *clk, unsigned long rate);
36 unsigned long pll_rate; 36extern long omap1_round_to_table_rate(struct clk *clk, unsigned long rate);
37 __u16 ckctl_val; 37extern int omap1_clk_set_rate_ckctl_arm(struct clk *clk, unsigned long rate);
38 __u16 dpllctl_val; 38extern long omap1_clk_round_rate_ckctl_arm(struct clk *clk, unsigned long rate);
39}; 39extern unsigned long omap1_watchdog_recalc(struct clk *clk);
40
41#ifdef CONFIG_OMAP_RESET_CLOCKS
42extern void __init omap1_clk_disable_unused(struct clk *clk);
43#else
44#define omap1_clk_disable_unused NULL
45#endif
40 46
41struct uart_clk { 47struct uart_clk {
42 struct clk clk; 48 struct clk clk;
@@ -96,574 +102,12 @@ struct arm_idlect1_clk {
96#define SOFT_REQ_REG 0xfffe0834 102#define SOFT_REQ_REG 0xfffe0834
97#define SOFT_REQ_REG2 0xfffe0880 103#define SOFT_REQ_REG2 0xfffe0880
98 104
99/*------------------------------------------------------------------------- 105extern __u32 arm_idlect1_mask;
100 * Omap1 MPU rate table 106extern struct clk *api_ck_p, *ck_dpll1_p, *ck_ref_p;
101 *-------------------------------------------------------------------------*/
102static struct mpu_rate rate_table[] = {
103 /* MPU MHz, xtal MHz, dpll1 MHz, CKCTL, DPLL_CTL
104 * NOTE: Comment order here is different from bits in CKCTL value:
105 * armdiv, dspdiv, dspmmu, tcdiv, perdiv, lcddiv
106 */
107#if defined(CONFIG_OMAP_ARM_216MHZ)
108 { 216000000, 12000000, 216000000, 0x050d, 0x2910 }, /* 1/1/2/2/2/8 */
109#endif
110#if defined(CONFIG_OMAP_ARM_195MHZ)
111 { 195000000, 13000000, 195000000, 0x050e, 0x2790 }, /* 1/1/2/2/4/8 */
112#endif
113#if defined(CONFIG_OMAP_ARM_192MHZ)
114 { 192000000, 19200000, 192000000, 0x050f, 0x2510 }, /* 1/1/2/2/8/8 */
115 { 192000000, 12000000, 192000000, 0x050f, 0x2810 }, /* 1/1/2/2/8/8 */
116 { 96000000, 12000000, 192000000, 0x055f, 0x2810 }, /* 2/2/2/2/8/8 */
117 { 48000000, 12000000, 192000000, 0x0baf, 0x2810 }, /* 4/4/4/8/8/8 */
118 { 24000000, 12000000, 192000000, 0x0fff, 0x2810 }, /* 8/8/8/8/8/8 */
119#endif
120#if defined(CONFIG_OMAP_ARM_182MHZ)
121 { 182000000, 13000000, 182000000, 0x050e, 0x2710 }, /* 1/1/2/2/4/8 */
122#endif
123#if defined(CONFIG_OMAP_ARM_168MHZ)
124 { 168000000, 12000000, 168000000, 0x010f, 0x2710 }, /* 1/1/1/2/8/8 */
125#endif
126#if defined(CONFIG_OMAP_ARM_150MHZ)
127 { 150000000, 12000000, 150000000, 0x010a, 0x2cb0 }, /* 1/1/1/2/4/4 */
128#endif
129#if defined(CONFIG_OMAP_ARM_120MHZ)
130 { 120000000, 12000000, 120000000, 0x010a, 0x2510 }, /* 1/1/1/2/4/4 */
131#endif
132#if defined(CONFIG_OMAP_ARM_96MHZ)
133 { 96000000, 12000000, 96000000, 0x0005, 0x2410 }, /* 1/1/1/1/2/2 */
134#endif
135#if defined(CONFIG_OMAP_ARM_60MHZ)
136 { 60000000, 12000000, 60000000, 0x0005, 0x2290 }, /* 1/1/1/1/2/2 */
137#endif
138#if defined(CONFIG_OMAP_ARM_30MHZ)
139 { 30000000, 12000000, 60000000, 0x0555, 0x2290 }, /* 2/2/2/2/2/2 */
140#endif
141 { 0, 0, 0, 0, 0 },
142};
143
144/*-------------------------------------------------------------------------
145 * Omap1 clocks
146 *-------------------------------------------------------------------------*/
147
148static struct clk ck_ref = {
149 .name = "ck_ref",
150 .ops = &clkops_null,
151 .rate = 12000000,
152};
153
154static struct clk ck_dpll1 = {
155 .name = "ck_dpll1",
156 .ops = &clkops_null,
157 .parent = &ck_ref,
158};
159
160static struct arm_idlect1_clk ck_dpll1out = {
161 .clk = {
162 .name = "ck_dpll1out",
163 .ops = &clkops_generic,
164 .parent = &ck_dpll1,
165 .flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT,
166 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
167 .enable_bit = EN_CKOUT_ARM,
168 .recalc = &followparent_recalc,
169 },
170 .idlect_shift = 12,
171};
172
173static struct clk sossi_ck = {
174 .name = "ck_sossi",
175 .ops = &clkops_generic,
176 .parent = &ck_dpll1out.clk,
177 .flags = CLOCK_NO_IDLE_PARENT | ENABLE_REG_32BIT,
178 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_1),
179 .enable_bit = 16,
180 .recalc = &omap1_sossi_recalc,
181 .set_rate = &omap1_set_sossi_rate,
182};
183
184static struct clk arm_ck = {
185 .name = "arm_ck",
186 .ops = &clkops_null,
187 .parent = &ck_dpll1,
188 .rate_offset = CKCTL_ARMDIV_OFFSET,
189 .recalc = &omap1_ckctl_recalc,
190 .round_rate = omap1_clk_round_rate_ckctl_arm,
191 .set_rate = omap1_clk_set_rate_ckctl_arm,
192};
193
194static struct arm_idlect1_clk armper_ck = {
195 .clk = {
196 .name = "armper_ck",
197 .ops = &clkops_generic,
198 .parent = &ck_dpll1,
199 .flags = CLOCK_IDLE_CONTROL,
200 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
201 .enable_bit = EN_PERCK,
202 .rate_offset = CKCTL_PERDIV_OFFSET,
203 .recalc = &omap1_ckctl_recalc,
204 .round_rate = omap1_clk_round_rate_ckctl_arm,
205 .set_rate = omap1_clk_set_rate_ckctl_arm,
206 },
207 .idlect_shift = 2,
208};
209
210static struct clk arm_gpio_ck = {
211 .name = "arm_gpio_ck",
212 .ops = &clkops_generic,
213 .parent = &ck_dpll1,
214 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
215 .enable_bit = EN_GPIOCK,
216 .recalc = &followparent_recalc,
217};
218
219static struct arm_idlect1_clk armxor_ck = {
220 .clk = {
221 .name = "armxor_ck",
222 .ops = &clkops_generic,
223 .parent = &ck_ref,
224 .flags = CLOCK_IDLE_CONTROL,
225 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
226 .enable_bit = EN_XORPCK,
227 .recalc = &followparent_recalc,
228 },
229 .idlect_shift = 1,
230};
231
232static struct arm_idlect1_clk armtim_ck = {
233 .clk = {
234 .name = "armtim_ck",
235 .ops = &clkops_generic,
236 .parent = &ck_ref,
237 .flags = CLOCK_IDLE_CONTROL,
238 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
239 .enable_bit = EN_TIMCK,
240 .recalc = &followparent_recalc,
241 },
242 .idlect_shift = 9,
243};
244
245static struct arm_idlect1_clk armwdt_ck = {
246 .clk = {
247 .name = "armwdt_ck",
248 .ops = &clkops_generic,
249 .parent = &ck_ref,
250 .flags = CLOCK_IDLE_CONTROL,
251 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
252 .enable_bit = EN_WDTCK,
253 .recalc = &omap1_watchdog_recalc,
254 },
255 .idlect_shift = 0,
256};
257
258static struct clk arminth_ck16xx = {
259 .name = "arminth_ck",
260 .ops = &clkops_null,
261 .parent = &arm_ck,
262 .recalc = &followparent_recalc,
263 /* Note: On 16xx the frequency can be divided by 2 by programming
264 * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1
265 *
266 * 1510 version is in TC clocks.
267 */
268};
269
270static struct clk dsp_ck = {
271 .name = "dsp_ck",
272 .ops = &clkops_generic,
273 .parent = &ck_dpll1,
274 .enable_reg = OMAP1_IO_ADDRESS(ARM_CKCTL),
275 .enable_bit = EN_DSPCK,
276 .rate_offset = CKCTL_DSPDIV_OFFSET,
277 .recalc = &omap1_ckctl_recalc,
278 .round_rate = omap1_clk_round_rate_ckctl_arm,
279 .set_rate = omap1_clk_set_rate_ckctl_arm,
280};
281
282static struct clk dspmmu_ck = {
283 .name = "dspmmu_ck",
284 .ops = &clkops_null,
285 .parent = &ck_dpll1,
286 .rate_offset = CKCTL_DSPMMUDIV_OFFSET,
287 .recalc = &omap1_ckctl_recalc,
288 .round_rate = omap1_clk_round_rate_ckctl_arm,
289 .set_rate = omap1_clk_set_rate_ckctl_arm,
290};
291
292static struct clk dspper_ck = {
293 .name = "dspper_ck",
294 .ops = &clkops_dspck,
295 .parent = &ck_dpll1,
296 .enable_reg = DSP_IDLECT2,
297 .enable_bit = EN_PERCK,
298 .rate_offset = CKCTL_PERDIV_OFFSET,
299 .recalc = &omap1_ckctl_recalc_dsp_domain,
300 .round_rate = omap1_clk_round_rate_ckctl_arm,
301 .set_rate = &omap1_clk_set_rate_dsp_domain,
302};
303
304static struct clk dspxor_ck = {
305 .name = "dspxor_ck",
306 .ops = &clkops_dspck,
307 .parent = &ck_ref,
308 .enable_reg = DSP_IDLECT2,
309 .enable_bit = EN_XORPCK,
310 .recalc = &followparent_recalc,
311};
312
313static struct clk dsptim_ck = {
314 .name = "dsptim_ck",
315 .ops = &clkops_dspck,
316 .parent = &ck_ref,
317 .enable_reg = DSP_IDLECT2,
318 .enable_bit = EN_DSPTIMCK,
319 .recalc = &followparent_recalc,
320};
321
322/* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */
323static struct arm_idlect1_clk tc_ck = {
324 .clk = {
325 .name = "tc_ck",
326 .ops = &clkops_null,
327 .parent = &ck_dpll1,
328 .flags = CLOCK_IDLE_CONTROL,
329 .rate_offset = CKCTL_TCDIV_OFFSET,
330 .recalc = &omap1_ckctl_recalc,
331 .round_rate = omap1_clk_round_rate_ckctl_arm,
332 .set_rate = omap1_clk_set_rate_ckctl_arm,
333 },
334 .idlect_shift = 6,
335};
336
337static struct clk arminth_ck1510 = {
338 .name = "arminth_ck",
339 .ops = &clkops_null,
340 .parent = &tc_ck.clk,
341 .recalc = &followparent_recalc,
342 /* Note: On 1510 the frequency follows TC_CK
343 *
344 * 16xx version is in MPU clocks.
345 */
346};
347
348static struct clk tipb_ck = {
349 /* No-idle controlled by "tc_ck" */
350 .name = "tipb_ck",
351 .ops = &clkops_null,
352 .parent = &tc_ck.clk,
353 .recalc = &followparent_recalc,
354};
355
356static struct clk l3_ocpi_ck = {
357 /* No-idle controlled by "tc_ck" */
358 .name = "l3_ocpi_ck",
359 .ops = &clkops_generic,
360 .parent = &tc_ck.clk,
361 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
362 .enable_bit = EN_OCPI_CK,
363 .recalc = &followparent_recalc,
364};
365 107
366static struct clk tc1_ck = { 108extern const struct clkops clkops_dspck;
367 .name = "tc1_ck", 109extern const struct clkops clkops_dummy;
368 .ops = &clkops_generic, 110extern const struct clkops clkops_uart;
369 .parent = &tc_ck.clk, 111extern const struct clkops clkops_generic;
370 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
371 .enable_bit = EN_TC1_CK,
372 .recalc = &followparent_recalc,
373};
374
375static struct clk tc2_ck = {
376 .name = "tc2_ck",
377 .ops = &clkops_generic,
378 .parent = &tc_ck.clk,
379 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
380 .enable_bit = EN_TC2_CK,
381 .recalc = &followparent_recalc,
382};
383
384static struct clk dma_ck = {
385 /* No-idle controlled by "tc_ck" */
386 .name = "dma_ck",
387 .ops = &clkops_null,
388 .parent = &tc_ck.clk,
389 .recalc = &followparent_recalc,
390};
391
392static struct clk dma_lcdfree_ck = {
393 .name = "dma_lcdfree_ck",
394 .ops = &clkops_null,
395 .parent = &tc_ck.clk,
396 .recalc = &followparent_recalc,
397};
398
399static struct arm_idlect1_clk api_ck = {
400 .clk = {
401 .name = "api_ck",
402 .ops = &clkops_generic,
403 .parent = &tc_ck.clk,
404 .flags = CLOCK_IDLE_CONTROL,
405 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
406 .enable_bit = EN_APICK,
407 .recalc = &followparent_recalc,
408 },
409 .idlect_shift = 8,
410};
411
412static struct arm_idlect1_clk lb_ck = {
413 .clk = {
414 .name = "lb_ck",
415 .ops = &clkops_generic,
416 .parent = &tc_ck.clk,
417 .flags = CLOCK_IDLE_CONTROL,
418 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
419 .enable_bit = EN_LBCK,
420 .recalc = &followparent_recalc,
421 },
422 .idlect_shift = 4,
423};
424
425static struct clk rhea1_ck = {
426 .name = "rhea1_ck",
427 .ops = &clkops_null,
428 .parent = &tc_ck.clk,
429 .recalc = &followparent_recalc,
430};
431
432static struct clk rhea2_ck = {
433 .name = "rhea2_ck",
434 .ops = &clkops_null,
435 .parent = &tc_ck.clk,
436 .recalc = &followparent_recalc,
437};
438
439static struct clk lcd_ck_16xx = {
440 .name = "lcd_ck",
441 .ops = &clkops_generic,
442 .parent = &ck_dpll1,
443 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
444 .enable_bit = EN_LCDCK,
445 .rate_offset = CKCTL_LCDDIV_OFFSET,
446 .recalc = &omap1_ckctl_recalc,
447 .round_rate = omap1_clk_round_rate_ckctl_arm,
448 .set_rate = omap1_clk_set_rate_ckctl_arm,
449};
450
451static struct arm_idlect1_clk lcd_ck_1510 = {
452 .clk = {
453 .name = "lcd_ck",
454 .ops = &clkops_generic,
455 .parent = &ck_dpll1,
456 .flags = CLOCK_IDLE_CONTROL,
457 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
458 .enable_bit = EN_LCDCK,
459 .rate_offset = CKCTL_LCDDIV_OFFSET,
460 .recalc = &omap1_ckctl_recalc,
461 .round_rate = omap1_clk_round_rate_ckctl_arm,
462 .set_rate = omap1_clk_set_rate_ckctl_arm,
463 },
464 .idlect_shift = 3,
465};
466
467static struct clk uart1_1510 = {
468 .name = "uart1_ck",
469 .ops = &clkops_null,
470 /* Direct from ULPD, no real parent */
471 .parent = &armper_ck.clk,
472 .rate = 12000000,
473 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
474 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
475 .enable_bit = 29, /* Chooses between 12MHz and 48MHz */
476 .set_rate = &omap1_set_uart_rate,
477 .recalc = &omap1_uart_recalc,
478};
479
480static struct uart_clk uart1_16xx = {
481 .clk = {
482 .name = "uart1_ck",
483 .ops = &clkops_uart,
484 /* Direct from ULPD, no real parent */
485 .parent = &armper_ck.clk,
486 .rate = 48000000,
487 .flags = RATE_FIXED | ENABLE_REG_32BIT |
488 CLOCK_NO_IDLE_PARENT,
489 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
490 .enable_bit = 29,
491 },
492 .sysc_addr = 0xfffb0054,
493};
494
495static struct clk uart2_ck = {
496 .name = "uart2_ck",
497 .ops = &clkops_null,
498 /* Direct from ULPD, no real parent */
499 .parent = &armper_ck.clk,
500 .rate = 12000000,
501 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
502 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
503 .enable_bit = 30, /* Chooses between 12MHz and 48MHz */
504 .set_rate = &omap1_set_uart_rate,
505 .recalc = &omap1_uart_recalc,
506};
507
508static struct clk uart3_1510 = {
509 .name = "uart3_ck",
510 .ops = &clkops_null,
511 /* Direct from ULPD, no real parent */
512 .parent = &armper_ck.clk,
513 .rate = 12000000,
514 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
515 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
516 .enable_bit = 31, /* Chooses between 12MHz and 48MHz */
517 .set_rate = &omap1_set_uart_rate,
518 .recalc = &omap1_uart_recalc,
519};
520
521static struct uart_clk uart3_16xx = {
522 .clk = {
523 .name = "uart3_ck",
524 .ops = &clkops_uart,
525 /* Direct from ULPD, no real parent */
526 .parent = &armper_ck.clk,
527 .rate = 48000000,
528 .flags = RATE_FIXED | ENABLE_REG_32BIT |
529 CLOCK_NO_IDLE_PARENT,
530 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
531 .enable_bit = 31,
532 },
533 .sysc_addr = 0xfffb9854,
534};
535
536static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */
537 .name = "usb_clko",
538 .ops = &clkops_generic,
539 /* Direct from ULPD, no parent */
540 .rate = 6000000,
541 .flags = RATE_FIXED | ENABLE_REG_32BIT,
542 .enable_reg = OMAP1_IO_ADDRESS(ULPD_CLOCK_CTRL),
543 .enable_bit = USB_MCLK_EN_BIT,
544};
545
546static struct clk usb_hhc_ck1510 = {
547 .name = "usb_hhc_ck",
548 .ops = &clkops_generic,
549 /* Direct from ULPD, no parent */
550 .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */
551 .flags = RATE_FIXED | ENABLE_REG_32BIT,
552 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
553 .enable_bit = USB_HOST_HHC_UHOST_EN,
554};
555
556static struct clk usb_hhc_ck16xx = {
557 .name = "usb_hhc_ck",
558 .ops = &clkops_generic,
559 /* Direct from ULPD, no parent */
560 .rate = 48000000,
561 /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */
562 .flags = RATE_FIXED | ENABLE_REG_32BIT,
563 .enable_reg = OMAP1_IO_ADDRESS(OTG_BASE + 0x08), /* OTG_SYSCON_2 */
564 .enable_bit = 8 /* UHOST_EN */,
565};
566
567static struct clk usb_dc_ck = {
568 .name = "usb_dc_ck",
569 .ops = &clkops_generic,
570 /* Direct from ULPD, no parent */
571 .rate = 48000000,
572 .flags = RATE_FIXED,
573 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
574 .enable_bit = 4,
575};
576
577static struct clk mclk_1510 = {
578 .name = "mclk",
579 .ops = &clkops_generic,
580 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
581 .rate = 12000000,
582 .flags = RATE_FIXED,
583 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
584 .enable_bit = 6,
585};
586
587static struct clk mclk_16xx = {
588 .name = "mclk",
589 .ops = &clkops_generic,
590 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
591 .enable_reg = OMAP1_IO_ADDRESS(COM_CLK_DIV_CTRL_SEL),
592 .enable_bit = COM_ULPD_PLL_CLK_REQ,
593 .set_rate = &omap1_set_ext_clk_rate,
594 .round_rate = &omap1_round_ext_clk_rate,
595 .init = &omap1_init_ext_clk,
596};
597
598static struct clk bclk_1510 = {
599 .name = "bclk",
600 .ops = &clkops_generic,
601 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
602 .rate = 12000000,
603 .flags = RATE_FIXED,
604};
605
606static struct clk bclk_16xx = {
607 .name = "bclk",
608 .ops = &clkops_generic,
609 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
610 .enable_reg = OMAP1_IO_ADDRESS(SWD_CLK_DIV_CTRL_SEL),
611 .enable_bit = SWD_ULPD_PLL_CLK_REQ,
612 .set_rate = &omap1_set_ext_clk_rate,
613 .round_rate = &omap1_round_ext_clk_rate,
614 .init = &omap1_init_ext_clk,
615};
616
617static struct clk mmc1_ck = {
618 .name = "mmc_ck",
619 .ops = &clkops_generic,
620 /* Functional clock is direct from ULPD, interface clock is ARMPER */
621 .parent = &armper_ck.clk,
622 .rate = 48000000,
623 .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
624 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
625 .enable_bit = 23,
626};
627
628static struct clk mmc2_ck = {
629 .name = "mmc_ck",
630 .id = 1,
631 .ops = &clkops_generic,
632 /* Functional clock is direct from ULPD, interface clock is ARMPER */
633 .parent = &armper_ck.clk,
634 .rate = 48000000,
635 .flags = RATE_FIXED | ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
636 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
637 .enable_bit = 20,
638};
639
640static struct clk virtual_ck_mpu = {
641 .name = "mpu",
642 .ops = &clkops_null,
643 .parent = &arm_ck, /* Is smarter alias for */
644 .recalc = &followparent_recalc,
645 .set_rate = &omap1_select_table_rate,
646 .round_rate = &omap1_round_to_table_rate,
647};
648
649/* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK
650remains active during MPU idle whenever this is enabled */
651static struct clk i2c_fck = {
652 .name = "i2c_fck",
653 .id = 1,
654 .ops = &clkops_null,
655 .flags = CLOCK_NO_IDLE_PARENT,
656 .parent = &armxor_ck.clk,
657 .recalc = &followparent_recalc,
658};
659
660static struct clk i2c_ick = {
661 .name = "i2c_ick",
662 .id = 1,
663 .ops = &clkops_null,
664 .flags = CLOCK_NO_IDLE_PARENT,
665 .parent = &armper_ck.clk,
666 .recalc = &followparent_recalc,
667};
668 112
669#endif 113#endif
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
new file mode 100644
index 000000000000..aa8558adbf1c
--- /dev/null
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -0,0 +1,831 @@
1/*
2 * linux/arch/arm/mach-omap1/clock_data.c
3 *
4 * Copyright (C) 2004 - 2005, 2009-2010 Nokia Corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/clk.h>
15#include <linux/io.h>
16
17#include <asm/mach-types.h> /* for machine_is_* */
18
19#include <plat/clock.h>
20#include <plat/cpu.h>
21#include <plat/clkdev_omap.h>
22#include <plat/usb.h> /* for OTG_BASE */
23
24#include "clock.h"
25
26/*------------------------------------------------------------------------
27 * Omap1 clocks
28 *-------------------------------------------------------------------------*/
29
30static struct clk ck_ref = {
31 .name = "ck_ref",
32 .ops = &clkops_null,
33 .rate = 12000000,
34};
35
36static struct clk ck_dpll1 = {
37 .name = "ck_dpll1",
38 .ops = &clkops_null,
39 .parent = &ck_ref,
40};
41
42/*
43 * FIXME: This clock seems to be necessary but no-one has asked for its
44 * activation. [ FIX: SoSSI, SSR ]
45 */
46static struct arm_idlect1_clk ck_dpll1out = {
47 .clk = {
48 .name = "ck_dpll1out",
49 .ops = &clkops_generic,
50 .parent = &ck_dpll1,
51 .flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT |
52 ENABLE_ON_INIT,
53 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
54 .enable_bit = EN_CKOUT_ARM,
55 .recalc = &followparent_recalc,
56 },
57 .idlect_shift = 12,
58};
59
60static struct clk sossi_ck = {
61 .name = "ck_sossi",
62 .ops = &clkops_generic,
63 .parent = &ck_dpll1out.clk,
64 .flags = CLOCK_NO_IDLE_PARENT | ENABLE_REG_32BIT,
65 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_1),
66 .enable_bit = 16,
67 .recalc = &omap1_sossi_recalc,
68 .set_rate = &omap1_set_sossi_rate,
69};
70
71static struct clk arm_ck = {
72 .name = "arm_ck",
73 .ops = &clkops_null,
74 .parent = &ck_dpll1,
75 .rate_offset = CKCTL_ARMDIV_OFFSET,
76 .recalc = &omap1_ckctl_recalc,
77 .round_rate = omap1_clk_round_rate_ckctl_arm,
78 .set_rate = omap1_clk_set_rate_ckctl_arm,
79};
80
81static struct arm_idlect1_clk armper_ck = {
82 .clk = {
83 .name = "armper_ck",
84 .ops = &clkops_generic,
85 .parent = &ck_dpll1,
86 .flags = CLOCK_IDLE_CONTROL,
87 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
88 .enable_bit = EN_PERCK,
89 .rate_offset = CKCTL_PERDIV_OFFSET,
90 .recalc = &omap1_ckctl_recalc,
91 .round_rate = omap1_clk_round_rate_ckctl_arm,
92 .set_rate = omap1_clk_set_rate_ckctl_arm,
93 },
94 .idlect_shift = 2,
95};
96
97/*
98 * FIXME: This clock seems to be necessary but no-one has asked for its
99 * activation. [ GPIO code for 1510 ]
100 */
101static struct clk arm_gpio_ck = {
102 .name = "arm_gpio_ck",
103 .ops = &clkops_generic,
104 .parent = &ck_dpll1,
105 .flags = ENABLE_ON_INIT,
106 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
107 .enable_bit = EN_GPIOCK,
108 .recalc = &followparent_recalc,
109};
110
111static struct arm_idlect1_clk armxor_ck = {
112 .clk = {
113 .name = "armxor_ck",
114 .ops = &clkops_generic,
115 .parent = &ck_ref,
116 .flags = CLOCK_IDLE_CONTROL,
117 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
118 .enable_bit = EN_XORPCK,
119 .recalc = &followparent_recalc,
120 },
121 .idlect_shift = 1,
122};
123
124static struct arm_idlect1_clk armtim_ck = {
125 .clk = {
126 .name = "armtim_ck",
127 .ops = &clkops_generic,
128 .parent = &ck_ref,
129 .flags = CLOCK_IDLE_CONTROL,
130 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
131 .enable_bit = EN_TIMCK,
132 .recalc = &followparent_recalc,
133 },
134 .idlect_shift = 9,
135};
136
137static struct arm_idlect1_clk armwdt_ck = {
138 .clk = {
139 .name = "armwdt_ck",
140 .ops = &clkops_generic,
141 .parent = &ck_ref,
142 .flags = CLOCK_IDLE_CONTROL,
143 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
144 .enable_bit = EN_WDTCK,
145 .fixed_div = 14,
146 .recalc = &omap_fixed_divisor_recalc,
147 },
148 .idlect_shift = 0,
149};
150
151static struct clk arminth_ck16xx = {
152 .name = "arminth_ck",
153 .ops = &clkops_null,
154 .parent = &arm_ck,
155 .recalc = &followparent_recalc,
156 /* Note: On 16xx the frequency can be divided by 2 by programming
157 * ARM_CKCTL:ARM_INTHCK_SEL(14) to 1
158 *
159 * 1510 version is in TC clocks.
160 */
161};
162
163static struct clk dsp_ck = {
164 .name = "dsp_ck",
165 .ops = &clkops_generic,
166 .parent = &ck_dpll1,
167 .enable_reg = OMAP1_IO_ADDRESS(ARM_CKCTL),
168 .enable_bit = EN_DSPCK,
169 .rate_offset = CKCTL_DSPDIV_OFFSET,
170 .recalc = &omap1_ckctl_recalc,
171 .round_rate = omap1_clk_round_rate_ckctl_arm,
172 .set_rate = omap1_clk_set_rate_ckctl_arm,
173};
174
175static struct clk dspmmu_ck = {
176 .name = "dspmmu_ck",
177 .ops = &clkops_null,
178 .parent = &ck_dpll1,
179 .rate_offset = CKCTL_DSPMMUDIV_OFFSET,
180 .recalc = &omap1_ckctl_recalc,
181 .round_rate = omap1_clk_round_rate_ckctl_arm,
182 .set_rate = omap1_clk_set_rate_ckctl_arm,
183};
184
185static struct clk dspper_ck = {
186 .name = "dspper_ck",
187 .ops = &clkops_dspck,
188 .parent = &ck_dpll1,
189 .enable_reg = DSP_IDLECT2,
190 .enable_bit = EN_PERCK,
191 .rate_offset = CKCTL_PERDIV_OFFSET,
192 .recalc = &omap1_ckctl_recalc_dsp_domain,
193 .round_rate = omap1_clk_round_rate_ckctl_arm,
194 .set_rate = &omap1_clk_set_rate_dsp_domain,
195};
196
197static struct clk dspxor_ck = {
198 .name = "dspxor_ck",
199 .ops = &clkops_dspck,
200 .parent = &ck_ref,
201 .enable_reg = DSP_IDLECT2,
202 .enable_bit = EN_XORPCK,
203 .recalc = &followparent_recalc,
204};
205
206static struct clk dsptim_ck = {
207 .name = "dsptim_ck",
208 .ops = &clkops_dspck,
209 .parent = &ck_ref,
210 .enable_reg = DSP_IDLECT2,
211 .enable_bit = EN_DSPTIMCK,
212 .recalc = &followparent_recalc,
213};
214
215/* Tie ARM_IDLECT1:IDLIF_ARM to this logical clock structure */
216static struct arm_idlect1_clk tc_ck = {
217 .clk = {
218 .name = "tc_ck",
219 .ops = &clkops_null,
220 .parent = &ck_dpll1,
221 .flags = CLOCK_IDLE_CONTROL,
222 .rate_offset = CKCTL_TCDIV_OFFSET,
223 .recalc = &omap1_ckctl_recalc,
224 .round_rate = omap1_clk_round_rate_ckctl_arm,
225 .set_rate = omap1_clk_set_rate_ckctl_arm,
226 },
227 .idlect_shift = 6,
228};
229
230static struct clk arminth_ck1510 = {
231 .name = "arminth_ck",
232 .ops = &clkops_null,
233 .parent = &tc_ck.clk,
234 .recalc = &followparent_recalc,
235 /* Note: On 1510 the frequency follows TC_CK
236 *
237 * 16xx version is in MPU clocks.
238 */
239};
240
241static struct clk tipb_ck = {
242 /* No-idle controlled by "tc_ck" */
243 .name = "tipb_ck",
244 .ops = &clkops_null,
245 .parent = &tc_ck.clk,
246 .recalc = &followparent_recalc,
247};
248
249static struct clk l3_ocpi_ck = {
250 /* No-idle controlled by "tc_ck" */
251 .name = "l3_ocpi_ck",
252 .ops = &clkops_generic,
253 .parent = &tc_ck.clk,
254 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
255 .enable_bit = EN_OCPI_CK,
256 .recalc = &followparent_recalc,
257};
258
259static struct clk tc1_ck = {
260 .name = "tc1_ck",
261 .ops = &clkops_generic,
262 .parent = &tc_ck.clk,
263 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
264 .enable_bit = EN_TC1_CK,
265 .recalc = &followparent_recalc,
266};
267
268/*
269 * FIXME: This clock seems to be necessary but no-one has asked for its
270 * activation. [ pm.c (SRAM), CCP, Camera ]
271 */
272static struct clk tc2_ck = {
273 .name = "tc2_ck",
274 .ops = &clkops_generic,
275 .parent = &tc_ck.clk,
276 .flags = ENABLE_ON_INIT,
277 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3),
278 .enable_bit = EN_TC2_CK,
279 .recalc = &followparent_recalc,
280};
281
282static struct clk dma_ck = {
283 /* No-idle controlled by "tc_ck" */
284 .name = "dma_ck",
285 .ops = &clkops_null,
286 .parent = &tc_ck.clk,
287 .recalc = &followparent_recalc,
288};
289
290static struct clk dma_lcdfree_ck = {
291 .name = "dma_lcdfree_ck",
292 .ops = &clkops_null,
293 .parent = &tc_ck.clk,
294 .recalc = &followparent_recalc,
295};
296
297static struct arm_idlect1_clk api_ck = {
298 .clk = {
299 .name = "api_ck",
300 .ops = &clkops_generic,
301 .parent = &tc_ck.clk,
302 .flags = CLOCK_IDLE_CONTROL,
303 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
304 .enable_bit = EN_APICK,
305 .recalc = &followparent_recalc,
306 },
307 .idlect_shift = 8,
308};
309
310static struct arm_idlect1_clk lb_ck = {
311 .clk = {
312 .name = "lb_ck",
313 .ops = &clkops_generic,
314 .parent = &tc_ck.clk,
315 .flags = CLOCK_IDLE_CONTROL,
316 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
317 .enable_bit = EN_LBCK,
318 .recalc = &followparent_recalc,
319 },
320 .idlect_shift = 4,
321};
322
323static struct clk rhea1_ck = {
324 .name = "rhea1_ck",
325 .ops = &clkops_null,
326 .parent = &tc_ck.clk,
327 .recalc = &followparent_recalc,
328};
329
330static struct clk rhea2_ck = {
331 .name = "rhea2_ck",
332 .ops = &clkops_null,
333 .parent = &tc_ck.clk,
334 .recalc = &followparent_recalc,
335};
336
337static struct clk lcd_ck_16xx = {
338 .name = "lcd_ck",
339 .ops = &clkops_generic,
340 .parent = &ck_dpll1,
341 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
342 .enable_bit = EN_LCDCK,
343 .rate_offset = CKCTL_LCDDIV_OFFSET,
344 .recalc = &omap1_ckctl_recalc,
345 .round_rate = omap1_clk_round_rate_ckctl_arm,
346 .set_rate = omap1_clk_set_rate_ckctl_arm,
347};
348
349static struct arm_idlect1_clk lcd_ck_1510 = {
350 .clk = {
351 .name = "lcd_ck",
352 .ops = &clkops_generic,
353 .parent = &ck_dpll1,
354 .flags = CLOCK_IDLE_CONTROL,
355 .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2),
356 .enable_bit = EN_LCDCK,
357 .rate_offset = CKCTL_LCDDIV_OFFSET,
358 .recalc = &omap1_ckctl_recalc,
359 .round_rate = omap1_clk_round_rate_ckctl_arm,
360 .set_rate = omap1_clk_set_rate_ckctl_arm,
361 },
362 .idlect_shift = 3,
363};
364
365static struct clk uart1_1510 = {
366 .name = "uart1_ck",
367 .ops = &clkops_null,
368 /* Direct from ULPD, no real parent */
369 .parent = &armper_ck.clk,
370 .rate = 12000000,
371 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
372 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
373 .enable_bit = 29, /* Chooses between 12MHz and 48MHz */
374 .set_rate = &omap1_set_uart_rate,
375 .recalc = &omap1_uart_recalc,
376};
377
378static struct uart_clk uart1_16xx = {
379 .clk = {
380 .name = "uart1_ck",
381 .ops = &clkops_uart,
382 /* Direct from ULPD, no real parent */
383 .parent = &armper_ck.clk,
384 .rate = 48000000,
385 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
386 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
387 .enable_bit = 29,
388 },
389 .sysc_addr = 0xfffb0054,
390};
391
392static struct clk uart2_ck = {
393 .name = "uart2_ck",
394 .ops = &clkops_null,
395 /* Direct from ULPD, no real parent */
396 .parent = &armper_ck.clk,
397 .rate = 12000000,
398 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
399 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
400 .enable_bit = 30, /* Chooses between 12MHz and 48MHz */
401 .set_rate = &omap1_set_uart_rate,
402 .recalc = &omap1_uart_recalc,
403};
404
405static struct clk uart3_1510 = {
406 .name = "uart3_ck",
407 .ops = &clkops_null,
408 /* Direct from ULPD, no real parent */
409 .parent = &armper_ck.clk,
410 .rate = 12000000,
411 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
412 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
413 .enable_bit = 31, /* Chooses between 12MHz and 48MHz */
414 .set_rate = &omap1_set_uart_rate,
415 .recalc = &omap1_uart_recalc,
416};
417
418static struct uart_clk uart3_16xx = {
419 .clk = {
420 .name = "uart3_ck",
421 .ops = &clkops_uart,
422 /* Direct from ULPD, no real parent */
423 .parent = &armper_ck.clk,
424 .rate = 48000000,
425 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
426 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
427 .enable_bit = 31,
428 },
429 .sysc_addr = 0xfffb9854,
430};
431
432static struct clk usb_clko = { /* 6 MHz output on W4_USB_CLKO */
433 .name = "usb_clko",
434 .ops = &clkops_generic,
435 /* Direct from ULPD, no parent */
436 .rate = 6000000,
437 .flags = ENABLE_REG_32BIT,
438 .enable_reg = OMAP1_IO_ADDRESS(ULPD_CLOCK_CTRL),
439 .enable_bit = USB_MCLK_EN_BIT,
440};
441
442static struct clk usb_hhc_ck1510 = {
443 .name = "usb_hhc_ck",
444 .ops = &clkops_generic,
445 /* Direct from ULPD, no parent */
446 .rate = 48000000, /* Actually 2 clocks, 12MHz and 48MHz */
447 .flags = ENABLE_REG_32BIT,
448 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
449 .enable_bit = USB_HOST_HHC_UHOST_EN,
450};
451
452static struct clk usb_hhc_ck16xx = {
453 .name = "usb_hhc_ck",
454 .ops = &clkops_generic,
455 /* Direct from ULPD, no parent */
456 .rate = 48000000,
457 /* OTG_SYSCON_2.OTG_PADEN == 0 (not 1510-compatible) */
458 .flags = ENABLE_REG_32BIT,
459 .enable_reg = OMAP1_IO_ADDRESS(OTG_BASE + 0x08), /* OTG_SYSCON_2 */
460 .enable_bit = 8 /* UHOST_EN */,
461};
462
463static struct clk usb_dc_ck = {
464 .name = "usb_dc_ck",
465 .ops = &clkops_generic,
466 /* Direct from ULPD, no parent */
467 .rate = 48000000,
468 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
469 .enable_bit = 4,
470};
471
472static struct clk usb_dc_ck7xx = {
473 .name = "usb_dc_ck",
474 .ops = &clkops_generic,
475 /* Direct from ULPD, no parent */
476 .rate = 48000000,
477 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
478 .enable_bit = 8,
479};
480
481static struct clk mclk_1510 = {
482 .name = "mclk",
483 .ops = &clkops_generic,
484 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
485 .rate = 12000000,
486 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
487 .enable_bit = 6,
488};
489
490static struct clk mclk_16xx = {
491 .name = "mclk",
492 .ops = &clkops_generic,
493 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
494 .enable_reg = OMAP1_IO_ADDRESS(COM_CLK_DIV_CTRL_SEL),
495 .enable_bit = COM_ULPD_PLL_CLK_REQ,
496 .set_rate = &omap1_set_ext_clk_rate,
497 .round_rate = &omap1_round_ext_clk_rate,
498 .init = &omap1_init_ext_clk,
499};
500
501static struct clk bclk_1510 = {
502 .name = "bclk",
503 .ops = &clkops_generic,
504 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
505 .rate = 12000000,
506};
507
508static struct clk bclk_16xx = {
509 .name = "bclk",
510 .ops = &clkops_generic,
511 /* Direct from ULPD, no parent. May be enabled by ext hardware. */
512 .enable_reg = OMAP1_IO_ADDRESS(SWD_CLK_DIV_CTRL_SEL),
513 .enable_bit = SWD_ULPD_PLL_CLK_REQ,
514 .set_rate = &omap1_set_ext_clk_rate,
515 .round_rate = &omap1_round_ext_clk_rate,
516 .init = &omap1_init_ext_clk,
517};
518
519static struct clk mmc1_ck = {
520 .name = "mmc1_ck",
521 .ops = &clkops_generic,
522 /* Functional clock is direct from ULPD, interface clock is ARMPER */
523 .parent = &armper_ck.clk,
524 .rate = 48000000,
525 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
526 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
527 .enable_bit = 23,
528};
529
530static struct clk mmc2_ck = {
531 .name = "mmc2_ck",
532 .ops = &clkops_generic,
533 /* Functional clock is direct from ULPD, interface clock is ARMPER */
534 .parent = &armper_ck.clk,
535 .rate = 48000000,
536 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
537 .enable_reg = OMAP1_IO_ADDRESS(MOD_CONF_CTRL_0),
538 .enable_bit = 20,
539};
540
541static struct clk mmc3_ck = {
542 .name = "mmc3_ck",
543 .ops = &clkops_generic,
544 /* Functional clock is direct from ULPD, interface clock is ARMPER */
545 .parent = &armper_ck.clk,
546 .rate = 48000000,
547 .flags = ENABLE_REG_32BIT | CLOCK_NO_IDLE_PARENT,
548 .enable_reg = OMAP1_IO_ADDRESS(SOFT_REQ_REG),
549 .enable_bit = 12,
550};
551
552static struct clk virtual_ck_mpu = {
553 .name = "mpu",
554 .ops = &clkops_null,
555 .parent = &arm_ck, /* Is smarter alias for */
556 .recalc = &followparent_recalc,
557 .set_rate = &omap1_select_table_rate,
558 .round_rate = &omap1_round_to_table_rate,
559};
560
561/* virtual functional clock domain for I2C. Just for making sure that ARMXOR_CK
562remains active during MPU idle whenever this is enabled */
563static struct clk i2c_fck = {
564 .name = "i2c_fck",
565 .ops = &clkops_null,
566 .flags = CLOCK_NO_IDLE_PARENT,
567 .parent = &armxor_ck.clk,
568 .recalc = &followparent_recalc,
569};
570
571static struct clk i2c_ick = {
572 .name = "i2c_ick",
573 .ops = &clkops_null,
574 .flags = CLOCK_NO_IDLE_PARENT,
575 .parent = &armper_ck.clk,
576 .recalc = &followparent_recalc,
577};
578
579/*
580 * clkdev integration
581 */
582
583static struct omap_clk omap_clks[] = {
584 /* non-ULPD clocks */
585 CLK(NULL, "ck_ref", &ck_ref, CK_16XX | CK_1510 | CK_310 | CK_7XX),
586 CLK(NULL, "ck_dpll1", &ck_dpll1, CK_16XX | CK_1510 | CK_310 | CK_7XX),
587 /* CK_GEN1 clocks */
588 CLK(NULL, "ck_dpll1out", &ck_dpll1out.clk, CK_16XX),
589 CLK(NULL, "ck_sossi", &sossi_ck, CK_16XX),
590 CLK(NULL, "arm_ck", &arm_ck, CK_16XX | CK_1510 | CK_310),
591 CLK(NULL, "armper_ck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
592 CLK(NULL, "arm_gpio_ck", &arm_gpio_ck, CK_1510 | CK_310),
593 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
594 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310),
595 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310),
596 CLK("omap_wdt", "ick", &armper_ck.clk, CK_16XX),
597 CLK("omap_wdt", "ick", &dummy_ck, CK_1510 | CK_310),
598 CLK(NULL, "arminth_ck", &arminth_ck1510, CK_1510 | CK_310),
599 CLK(NULL, "arminth_ck", &arminth_ck16xx, CK_16XX),
600 /* CK_GEN2 clocks */
601 CLK(NULL, "dsp_ck", &dsp_ck, CK_16XX | CK_1510 | CK_310),
602 CLK(NULL, "dspmmu_ck", &dspmmu_ck, CK_16XX | CK_1510 | CK_310),
603 CLK(NULL, "dspper_ck", &dspper_ck, CK_16XX | CK_1510 | CK_310),
604 CLK(NULL, "dspxor_ck", &dspxor_ck, CK_16XX | CK_1510 | CK_310),
605 CLK(NULL, "dsptim_ck", &dsptim_ck, CK_16XX | CK_1510 | CK_310),
606 /* CK_GEN3 clocks */
607 CLK(NULL, "tc_ck", &tc_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
608 CLK(NULL, "tipb_ck", &tipb_ck, CK_1510 | CK_310),
609 CLK(NULL, "l3_ocpi_ck", &l3_ocpi_ck, CK_16XX | CK_7XX),
610 CLK(NULL, "tc1_ck", &tc1_ck, CK_16XX),
611 CLK(NULL, "tc2_ck", &tc2_ck, CK_16XX),
612 CLK(NULL, "dma_ck", &dma_ck, CK_16XX | CK_1510 | CK_310),
613 CLK(NULL, "dma_lcdfree_ck", &dma_lcdfree_ck, CK_16XX),
614 CLK(NULL, "api_ck", &api_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
615 CLK(NULL, "lb_ck", &lb_ck.clk, CK_1510 | CK_310),
616 CLK(NULL, "rhea1_ck", &rhea1_ck, CK_16XX),
617 CLK(NULL, "rhea2_ck", &rhea2_ck, CK_16XX),
618 CLK(NULL, "lcd_ck", &lcd_ck_16xx, CK_16XX | CK_7XX),
619 CLK(NULL, "lcd_ck", &lcd_ck_1510.clk, CK_1510 | CK_310),
620 /* ULPD clocks */
621 CLK(NULL, "uart1_ck", &uart1_1510, CK_1510 | CK_310),
622 CLK(NULL, "uart1_ck", &uart1_16xx.clk, CK_16XX),
623 CLK(NULL, "uart2_ck", &uart2_ck, CK_16XX | CK_1510 | CK_310),
624 CLK(NULL, "uart3_ck", &uart3_1510, CK_1510 | CK_310),
625 CLK(NULL, "uart3_ck", &uart3_16xx.clk, CK_16XX),
626 CLK(NULL, "usb_clko", &usb_clko, CK_16XX | CK_1510 | CK_310),
627 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck1510, CK_1510 | CK_310),
628 CLK(NULL, "usb_hhc_ck", &usb_hhc_ck16xx, CK_16XX),
629 CLK(NULL, "usb_dc_ck", &usb_dc_ck, CK_16XX),
630 CLK(NULL, "usb_dc_ck", &usb_dc_ck7xx, CK_7XX),
631 CLK(NULL, "mclk", &mclk_1510, CK_1510 | CK_310),
632 CLK(NULL, "mclk", &mclk_16xx, CK_16XX),
633 CLK(NULL, "bclk", &bclk_1510, CK_1510 | CK_310),
634 CLK(NULL, "bclk", &bclk_16xx, CK_16XX),
635 CLK("mmci-omap.0", "fck", &mmc1_ck, CK_16XX | CK_1510 | CK_310),
636 CLK("mmci-omap.0", "fck", &mmc3_ck, CK_7XX),
637 CLK("mmci-omap.0", "ick", &armper_ck.clk, CK_16XX | CK_1510 | CK_310 | CK_7XX),
638 CLK("mmci-omap.1", "fck", &mmc2_ck, CK_16XX),
639 CLK("mmci-omap.1", "ick", &armper_ck.clk, CK_16XX),
640 /* Virtual clocks */
641 CLK(NULL, "mpu", &virtual_ck_mpu, CK_16XX | CK_1510 | CK_310),
642 CLK("i2c_omap.1", "fck", &i2c_fck, CK_16XX | CK_1510 | CK_310 | CK_7XX),
643 CLK("i2c_omap.1", "ick", &i2c_ick, CK_16XX),
644 CLK("i2c_omap.1", "ick", &dummy_ck, CK_1510 | CK_310 | CK_7XX),
645 CLK("omap1_spi100k.1", "fck", &dummy_ck, CK_7XX),
646 CLK("omap1_spi100k.1", "ick", &dummy_ck, CK_7XX),
647 CLK("omap1_spi100k.2", "fck", &dummy_ck, CK_7XX),
648 CLK("omap1_spi100k.2", "ick", &dummy_ck, CK_7XX),
649 CLK("omap_uwire", "fck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310),
650 CLK("omap-mcbsp.1", "ick", &dspper_ck, CK_16XX),
651 CLK("omap-mcbsp.1", "ick", &dummy_ck, CK_1510 | CK_310),
652 CLK("omap-mcbsp.2", "ick", &armper_ck.clk, CK_16XX),
653 CLK("omap-mcbsp.2", "ick", &dummy_ck, CK_1510 | CK_310),
654 CLK("omap-mcbsp.3", "ick", &dspper_ck, CK_16XX),
655 CLK("omap-mcbsp.3", "ick", &dummy_ck, CK_1510 | CK_310),
656 CLK("omap-mcbsp.1", "fck", &dspxor_ck, CK_16XX | CK_1510 | CK_310),
657 CLK("omap-mcbsp.2", "fck", &armper_ck.clk, CK_16XX | CK_1510 | CK_310),
658 CLK("omap-mcbsp.3", "fck", &dspxor_ck, CK_16XX | CK_1510 | CK_310),
659};
660
661/*
662 * init
663 */
664
665static struct clk_functions omap1_clk_functions = {
666 .clk_enable = omap1_clk_enable,
667 .clk_disable = omap1_clk_disable,
668 .clk_round_rate = omap1_clk_round_rate,
669 .clk_set_rate = omap1_clk_set_rate,
670 .clk_disable_unused = omap1_clk_disable_unused,
671};
672
673int __init omap1_clk_init(void)
674{
675 struct omap_clk *c;
676 const struct omap_clock_config *info;
677 int crystal_type = 0; /* Default 12 MHz */
678 u32 reg, cpu_mask;
679
680#ifdef CONFIG_DEBUG_LL
681 /*
682 * Resets some clocks that may be left on from bootloader,
683 * but leaves serial clocks on.
684 */
685 omap_writel(0x3 << 29, MOD_CONF_CTRL_0);
686#endif
687
688 /* USB_REQ_EN will be disabled later if necessary (usb_dc_ck) */
689 reg = omap_readw(SOFT_REQ_REG) & (1 << 4);
690 omap_writew(reg, SOFT_REQ_REG);
691 if (!cpu_is_omap15xx())
692 omap_writew(0, SOFT_REQ_REG2);
693
694 clk_init(&omap1_clk_functions);
695
696 /* By default all idlect1 clocks are allowed to idle */
697 arm_idlect1_mask = ~0;
698
699 for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++)
700 clk_preinit(c->lk.clk);
701
702 cpu_mask = 0;
703 if (cpu_is_omap16xx())
704 cpu_mask |= CK_16XX;
705 if (cpu_is_omap1510())
706 cpu_mask |= CK_1510;
707 if (cpu_is_omap7xx())
708 cpu_mask |= CK_7XX;
709 if (cpu_is_omap310())
710 cpu_mask |= CK_310;
711
712 for (c = omap_clks; c < omap_clks + ARRAY_SIZE(omap_clks); c++)
713 if (c->cpu & cpu_mask) {
714 clkdev_add(&c->lk);
715 clk_register(c->lk.clk);
716 }
717
718 /* Pointers to these clocks are needed by code in clock.c */
719 api_ck_p = clk_get(NULL, "api_ck");
720 ck_dpll1_p = clk_get(NULL, "ck_dpll1");
721 ck_ref_p = clk_get(NULL, "ck_ref");
722
723 info = omap_get_config(OMAP_TAG_CLOCK, struct omap_clock_config);
724 if (info != NULL) {
725 if (!cpu_is_omap15xx())
726 crystal_type = info->system_clock_type;
727 }
728
729#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
730 ck_ref.rate = 13000000;
731#elif defined(CONFIG_ARCH_OMAP16XX)
732 if (crystal_type == 2)
733 ck_ref.rate = 19200000;
734#endif
735
736 pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: "
737 "0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL),
738 omap_readw(ARM_CKCTL));
739
740 /* We want to be in syncronous scalable mode */
741 omap_writew(0x1000, ARM_SYSST);
742
743#ifdef CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER
744 /* Use values set by bootloader. Determine PLL rate and recalculate
745 * dependent clocks as if kernel had changed PLL or divisors.
746 */
747 {
748 unsigned pll_ctl_val = omap_readw(DPLL_CTL);
749
750 ck_dpll1.rate = ck_ref.rate; /* Base xtal rate */
751 if (pll_ctl_val & 0x10) {
752 /* PLL enabled, apply multiplier and divisor */
753 if (pll_ctl_val & 0xf80)
754 ck_dpll1.rate *= (pll_ctl_val & 0xf80) >> 7;
755 ck_dpll1.rate /= ((pll_ctl_val & 0x60) >> 5) + 1;
756 } else {
757 /* PLL disabled, apply bypass divisor */
758 switch (pll_ctl_val & 0xc) {
759 case 0:
760 break;
761 case 0x4:
762 ck_dpll1.rate /= 2;
763 break;
764 default:
765 ck_dpll1.rate /= 4;
766 break;
767 }
768 }
769 }
770#else
771 /* Find the highest supported frequency and enable it */
772 if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
773 printk(KERN_ERR "System frequencies not set. Check your config.\n");
774 /* Guess sane values (60MHz) */
775 omap_writew(0x2290, DPLL_CTL);
776 omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL);
777 ck_dpll1.rate = 60000000;
778 }
779#endif
780 propagate_rate(&ck_dpll1);
781 /* Cache rates for clocks connected to ck_ref (not dpll1) */
782 propagate_rate(&ck_ref);
783 printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): "
784 "%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n",
785 ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10,
786 ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10,
787 arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10);
788
789#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE)
790 /* Select slicer output as OMAP input clock */
791 omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1, OMAP7XX_PCC_UPLD_CTRL);
792#endif
793
794 /* Amstrad Delta wants BCLK high when inactive */
795 if (machine_is_ams_delta())
796 omap_writel(omap_readl(ULPD_CLOCK_CTRL) |
797 (1 << SDW_MCLK_INV_BIT),
798 ULPD_CLOCK_CTRL);
799
800 /* Turn off DSP and ARM_TIMXO. Make sure ARM_INTHCK is not divided */
801 /* (on 730, bit 13 must not be cleared) */
802 if (cpu_is_omap7xx())
803 omap_writew(omap_readw(ARM_CKCTL) & 0x2fff, ARM_CKCTL);
804 else
805 omap_writew(omap_readw(ARM_CKCTL) & 0x0fff, ARM_CKCTL);
806
807 /* Put DSP/MPUI into reset until needed */
808 omap_writew(0, ARM_RSTCT1);
809 omap_writew(1, ARM_RSTCT2);
810 omap_writew(0x400, ARM_IDLECT1);
811
812 /*
813 * According to OMAP5910 Erratum SYS_DMA_1, bit DMACK_REQ (bit 8)
814 * of the ARM_IDLECT2 register must be set to zero. The power-on
815 * default value of this bit is one.
816 */
817 omap_writew(0x0000, ARM_IDLECT2); /* Turn LCD clock off also */
818
819 /*
820 * Only enable those clocks we will need, let the drivers
821 * enable other clocks as necessary
822 */
823 clk_enable(&armper_ck.clk);
824 clk_enable(&armxor_ck.clk);
825 clk_enable(&armtim_ck.clk); /* This should be done by timer code */
826
827 if (cpu_is_omap15xx())
828 clk_enable(&arm_gpio_ck);
829
830 return 0;
831}
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 06808434ea04..379100c17639 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -14,15 +14,17 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/spi/spi.h>
17 18
18#include <mach/hardware.h> 19#include <mach/hardware.h>
19#include <asm/mach/map.h> 20#include <asm/mach/map.h>
20 21
21#include <mach/tc.h> 22#include <plat/tc.h>
22#include <mach/board.h> 23#include <plat/board.h>
23#include <mach/mux.h> 24#include <plat/mux.h>
24#include <mach/gpio.h> 25#include <mach/gpio.h>
25#include <mach/mmc.h> 26#include <plat/mmc.h>
27#include <plat/omap7xx.h>
26 28
27/*-------------------------------------------------------------------------*/ 29/*-------------------------------------------------------------------------*/
28 30
@@ -71,7 +73,7 @@ static inline void omap_init_rtc(void) {}
71# define INT_DSP_MAILBOX1 INT_1610_DSP_MAILBOX1 73# define INT_DSP_MAILBOX1 INT_1610_DSP_MAILBOX1
72#endif 74#endif
73 75
74#define OMAP1_MBOX_BASE OMAP1_IO_ADDRESS(OMAP16XX_MAILBOX_BASE) 76#define OMAP1_MBOX_BASE OMAP16XX_MAILBOX_BASE
75 77
76static struct resource mbox_resources[] = { 78static struct resource mbox_resources[] = {
77 { 79 {
@@ -108,15 +110,22 @@ static inline void omap1_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
108 int controller_nr) 110 int controller_nr)
109{ 111{
110 if (controller_nr == 0) { 112 if (controller_nr == 0) {
111 omap_cfg_reg(MMC_CMD); 113 if (cpu_is_omap7xx()) {
112 omap_cfg_reg(MMC_CLK); 114 omap_cfg_reg(MMC_7XX_CMD);
113 omap_cfg_reg(MMC_DAT0); 115 omap_cfg_reg(MMC_7XX_CLK);
116 omap_cfg_reg(MMC_7XX_DAT0);
117 } else {
118 omap_cfg_reg(MMC_CMD);
119 omap_cfg_reg(MMC_CLK);
120 omap_cfg_reg(MMC_DAT0);
121 }
122
114 if (cpu_is_omap1710()) { 123 if (cpu_is_omap1710()) {
115 omap_cfg_reg(M15_1710_MMC_CLKI); 124 omap_cfg_reg(M15_1710_MMC_CLKI);
116 omap_cfg_reg(P19_1710_MMC_CMDDIR); 125 omap_cfg_reg(P19_1710_MMC_CMDDIR);
117 omap_cfg_reg(P20_1710_MMC_DATDIR0); 126 omap_cfg_reg(P20_1710_MMC_DATDIR0);
118 } 127 }
119 if (mmc_controller->slots[0].wires == 4) { 128 if (mmc_controller->slots[0].wires == 4 && !cpu_is_omap7xx()) {
120 omap_cfg_reg(MMC_DAT1); 129 omap_cfg_reg(MMC_DAT1);
121 /* NOTE: DAT2 can be on W10 (here) or M15 */ 130 /* NOTE: DAT2 can be on W10 (here) or M15 */
122 if (!mmc_controller->slots[0].nomux) 131 if (!mmc_controller->slots[0].nomux)
@@ -189,6 +198,38 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
189 198
190/*-------------------------------------------------------------------------*/ 199/*-------------------------------------------------------------------------*/
191 200
201/* OMAP7xx SPI support */
202#if defined(CONFIG_SPI_OMAP_100K) || defined(CONFIG_SPI_OMAP_100K_MODULE)
203
204struct platform_device omap_spi1 = {
205 .name = "omap1_spi100k",
206 .id = 1,
207};
208
209struct platform_device omap_spi2 = {
210 .name = "omap1_spi100k",
211 .id = 2,
212};
213
214static void omap_init_spi100k(void)
215{
216 omap_spi1.dev.platform_data = ioremap(OMAP7XX_SPI1_BASE, 0x7ff);
217 if (omap_spi1.dev.platform_data)
218 platform_device_register(&omap_spi1);
219
220 omap_spi2.dev.platform_data = ioremap(OMAP7XX_SPI2_BASE, 0x7ff);
221 if (omap_spi2.dev.platform_data)
222 platform_device_register(&omap_spi2);
223}
224
225#else
226static inline void omap_init_spi100k(void)
227{
228}
229#endif
230
231/*-------------------------------------------------------------------------*/
232
192#if defined(CONFIG_OMAP_STI) 233#if defined(CONFIG_OMAP_STI)
193 234
194#define OMAP1_STI_BASE 0xfffea000 235#define OMAP1_STI_BASE 0xfffea000
@@ -256,6 +297,7 @@ static int __init omap1_init_devices(void)
256 297
257 omap_init_mbox(); 298 omap_init_mbox();
258 omap_init_rtc(); 299 omap_init_rtc();
300 omap_init_spi100k();
259 omap_init_sti(); 301 omap_init_sti();
260 302
261 return 0; 303 return 0;
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
new file mode 100644
index 000000000000..0b07a78eeaa7
--- /dev/null
+++ b/arch/arm/mach-omap1/flash.c
@@ -0,0 +1,33 @@
1/*
2 * Flash support for OMAP1
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/mtd/mtd.h>
10#include <linux/mtd/map.h>
11
12#include <plat/io.h>
13#include <plat/tc.h>
14
15void omap1_set_vpp(struct map_info *map, int enable)
16{
17 static int count;
18 u32 l;
19
20 if (enable) {
21 if (count++ == 0) {
22 l = omap_readl(EMIFS_CONFIG);
23 l |= OMAP_EMIFS_CONFIG_WP;
24 omap_writel(l, EMIFS_CONFIG);
25 }
26 } else {
27 if (count && (--count == 0)) {
28 l = omap_readl(EMIFS_CONFIG);
29 l &= ~OMAP_EMIFS_CONFIG_WP;
30 omap_writel(l, EMIFS_CONFIG);
31 }
32 }
33}
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 4f2b8a7adb19..5cfce1636da0 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -27,7 +27,7 @@
27#include <asm/irq.h> 27#include <asm/irq.h>
28#include <asm/mach/irq.h> 28#include <asm/mach/irq.h>
29 29
30#include <mach/fpga.h> 30#include <plat/fpga.h>
31#include <mach/gpio.h> 31#include <mach/gpio.h>
32 32
33static void fpga_mask_irq(unsigned int irq) 33static void fpga_mask_irq(unsigned int irq)
diff --git a/arch/arm/mach-omap1/i2c.c b/arch/arm/mach-omap1/i2c.c
new file mode 100644
index 000000000000..5446c9912641
--- /dev/null
+++ b/arch/arm/mach-omap1/i2c.c
@@ -0,0 +1,35 @@
1/*
2 * Helper module for board specific I2C bus registration
3 *
4 * Copyright (C) 2009 Nokia Corporation.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#include <plat/i2c.h>
23#include <plat/mux.h>
24#include <plat/cpu.h>
25
26void __init omap1_i2c_mux_pins(int bus_id)
27{
28 if (cpu_is_omap7xx()) {
29 omap_cfg_reg(I2C_7XX_SDA);
30 omap_cfg_reg(I2C_7XX_SCL);
31 } else {
32 omap_cfg_reg(I2C_SDA);
33 omap_cfg_reg(I2C_SCL);
34 }
35}
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index e5dcdf764c91..a0e3560b39db 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -15,7 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <mach/cpu.h> 18#include <plat/cpu.h>
19 19
20#define OMAP_DIE_ID_0 0xfffe1800 20#define OMAP_DIE_ID_0 0xfffe1800
21#define OMAP_DIE_ID_1 0xfffe1804 21#define OMAP_DIE_ID_1 0xfffe1804
diff --git a/arch/arm/mach-omap1/include/mach/clkdev.h b/arch/arm/mach-omap1/include/mach/clkdev.h
new file mode 100644
index 000000000000..ea8640e4603e
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/clkdev.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/clkdev.h
3 */
4
5#include <plat/clkdev.h>
diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
new file mode 100644
index 000000000000..b6d9584544b4
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/debug-macro.S
@@ -0,0 +1,107 @@
1/* arch/arm/mach-omap1/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14#include <linux/serial_reg.h>
15
16#include <plat/serial.h>
17
18 .pushsection .data
19omap_uart_phys: .word 0x0
20omap_uart_virt: .word 0x0
21 .popsection
22
23 /*
24 * Note that this code won't work if the bootloader passes
25 * a wrong machine ID number in r1. To debug, just hardcode
26 * the desired UART phys and virt addresses temporarily into
27 * the omap_uart_phys and omap_uart_virt above.
28 */
29 .macro addruart, rx, tmp
30
31 /* Use omap_uart_phys/virt if already configured */
329: mrc p15, 0, \rx, c1, c0
33 tst \rx, #1 @ MMU enabled?
34 ldreq \rx, =omap_uart_phys @ physical base address
35 ldrne \rx, =omap_uart_virt @ virtual base
36 ldr \rx, [\rx, #0]
37 cmp \rx, #0 @ is port configured?
38 bne 99f @ already configured
39
40 /* Check 7XX UART1 scratchpad register for uart to use */
41 mrc p15, 0, \rx, c1, c0
42 tst \rx, #1 @ MMU enabled?
43 moveq \rx, #0xff000000 @ physical base address
44 movne \rx, #0xfe000000 @ virtual base
45 orr \rx, \rx, #0x00fb0000 @ OMAP1UART1
46 ldrb \rx, [\rx, #(UART_SCR << OMAP7XX_PORT_SHIFT)]
47 cmp \rx, #0 @ anything in 7XX scratchpad?
48 bne 10f @ found 7XX uart
49
50 /* Check 15xx/16xx UART1 scratchpad register for uart to use */
51 mrc p15, 0, \rx, c1, c0
52 tst \rx, #1 @ MMU enabled?
53 moveq \rx, #0xff000000 @ physical base address
54 movne \rx, #0xfe000000 @ virtual base
55 orr \rx, \rx, #0x00fb0000 @ OMAP1UART1
56 ldrb \rx, [\rx, #(UART_SCR << OMAP_PORT_SHIFT)]
57
58 /* Select the UART to use based on the UART1 scratchpad value */
5910: cmp \rx, #0 @ no port configured?
60 beq 11f @ if none, try to use UART1
61 cmp \rx, #OMAP1UART1
62 beq 11f @ configure OMAP1UART1
63 cmp \rx, #OMAP1UART2
64 beq 12f @ configure OMAP1UART2
65 cmp \rx, #OMAP1UART3
66 beq 13f @ configure OMAP2UART3
67
68 /* Configure the UART offset from the phys/virt base */
6911: mov \rx, #0x00fb0000 @ OMAP1UART1
70 b 98f
7112: mov \rx, #0x00fb0000 @ OMAP1UART1
72 orr \rx, \rx, #0x00000800 @ OMAP1UART2
73 b 98f
7413: mov \rx, #0x00fb0000 @ OMAP1UART1
75 orr \rx, \rx, #0x00000800 @ OMAP1UART2
76 orr \rx, \rx, #0x00009000 @ OMAP1UART3
77
78 /* Store both phys and virt address for the uart */
7998: add \rx, \rx, #0xff000000 @ phys base
80 ldr \tmp, =omap_uart_phys
81 str \rx, [\tmp, #0]
82 sub \rx, \rx, #0xff000000 @ phys base
83 add \rx, \rx, #0xfe000000 @ virt base
84 ldr \tmp, =omap_uart_virt
85 str \rx, [\tmp, #0]
86 b 9b
8799:
88 .endm
89
90 .macro senduart,rd,rx
91 strb \rd, [\rx]
92 .endm
93
94 .macro busyuart,rd,rx
951001: ldrb \rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
96 and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
97 teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
98 beq 1002f
99 ldrb \rd, [\rx, #(UART_LSR << OMAP7XX_PORT_SHIFT)]
100 and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
101 teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
102 bne 1001b
1031002:
104 .endm
105
106 .macro waituart,rd,rx
107 .endm
diff --git a/arch/arm/mach-omap1/include/mach/entry-macro.S b/arch/arm/mach-omap1/include/mach/entry-macro.S
new file mode 100644
index 000000000000..df9060edda28
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/entry-macro.S
@@ -0,0 +1,58 @@
1/*
2 * arch/arm/mach-omap1/include/mach/entry-macro.S
3 *
4 * Low-level IRQ helper macros for OMAP-based platforms
5 *
6 * Copyright (C) 2009 Texas Instruments
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12#include <mach/hardware.h>
13#include <mach/io.h>
14#include <mach/irqs.h>
15#include <asm/hardware/gic.h>
16
17#if (defined(CONFIG_ARCH_OMAP730)||defined(CONFIG_ARCH_OMAP850)) && \
18 (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX))
19#error "FIXME: OMAP7XX doesn't support multiple-OMAP"
20#elif defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
21#define INT_IH2_IRQ INT_7XX_IH2_IRQ
22#elif defined(CONFIG_ARCH_OMAP15XX)
23#define INT_IH2_IRQ INT_1510_IH2_IRQ
24#elif defined(CONFIG_ARCH_OMAP16XX)
25#define INT_IH2_IRQ INT_1610_IH2_IRQ
26#else
27#warning "IH2 IRQ defaulted"
28#define INT_IH2_IRQ INT_1510_IH2_IRQ
29#endif
30
31 .macro disable_fiq
32 .endm
33
34 .macro get_irqnr_preamble, base, tmp
35 .endm
36
37 .macro arch_ret_to_user, tmp1, tmp2
38 .endm
39
40 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
41 ldr \base, =OMAP1_IO_ADDRESS(OMAP_IH1_BASE)
42 ldr \irqnr, [\base, #IRQ_ITR_REG_OFFSET]
43 ldr \tmp, [\base, #IRQ_MIR_REG_OFFSET]
44 mov \irqstat, #0xffffffff
45 bic \tmp, \irqstat, \tmp
46 tst \irqnr, \tmp
47 beq 1510f
48
49 ldr \irqnr, [\base, #IRQ_SIR_FIQ_REG_OFFSET]
50 cmp \irqnr, #0
51 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
52 cmpeq \irqnr, #INT_IH2_IRQ
53 ldreq \base, =OMAP1_IO_ADDRESS(OMAP_IH2_BASE)
54 ldreq \irqnr, [\base, #IRQ_SIR_IRQ_REG_OFFSET]
55 addeqs \irqnr, \irqnr, #32
561510:
57 .endm
58
diff --git a/arch/arm/mach-omap1/include/mach/gpio.h b/arch/arm/mach-omap1/include/mach/gpio.h
new file mode 100644
index 000000000000..e737706a8fe1
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/gpio.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/gpio.h
3 */
4
5#include <plat/gpio.h>
diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h
new file mode 100644
index 000000000000..a3f6287b2007
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/hardware.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/hardware.h
3 */
4
5#include <plat/hardware.h>
diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h
new file mode 100644
index 000000000000..57bdf74a3e64
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/io.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/io.h
3 */
4
5#include <plat/io.h>
diff --git a/arch/arm/mach-omap1/include/mach/irqs.h b/arch/arm/mach-omap1/include/mach/irqs.h
new file mode 100644
index 000000000000..9292fdc1cb0b
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/irqs.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/irqs.h
3 */
4
5#include <plat/irqs.h>
diff --git a/arch/arm/mach-omap1/include/mach/lcd_dma.h b/arch/arm/mach-omap1/include/mach/lcd_dma.h
new file mode 100644
index 000000000000..d7a457bbcb7f
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/lcd_dma.h
@@ -0,0 +1,78 @@
1/*
2 * arch/arm/mach-omap1/include/mach/lcd_dma.h
3 *
4 * Extracted from arch/arm/plat-omap/include/plat/dma.h
5 * Copyright (C) 2003 Nokia Corporation
6 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22#ifndef __MACH_OMAP1_LCD_DMA_H__
23#define __MACH_OMAP1_LCD_DMA_H__
24
25/* Hardware registers for LCD DMA */
26#define OMAP1510_DMA_LCD_BASE (0xfffedb00)
27#define OMAP1510_DMA_LCD_CTRL (OMAP1510_DMA_LCD_BASE + 0x00)
28#define OMAP1510_DMA_LCD_TOP_F1_L (OMAP1510_DMA_LCD_BASE + 0x02)
29#define OMAP1510_DMA_LCD_TOP_F1_U (OMAP1510_DMA_LCD_BASE + 0x04)
30#define OMAP1510_DMA_LCD_BOT_F1_L (OMAP1510_DMA_LCD_BASE + 0x06)
31#define OMAP1510_DMA_LCD_BOT_F1_U (OMAP1510_DMA_LCD_BASE + 0x08)
32
33#define OMAP1610_DMA_LCD_BASE (0xfffee300)
34#define OMAP1610_DMA_LCD_CSDP (OMAP1610_DMA_LCD_BASE + 0xc0)
35#define OMAP1610_DMA_LCD_CCR (OMAP1610_DMA_LCD_BASE + 0xc2)
36#define OMAP1610_DMA_LCD_CTRL (OMAP1610_DMA_LCD_BASE + 0xc4)
37#define OMAP1610_DMA_LCD_TOP_B1_L (OMAP1610_DMA_LCD_BASE + 0xc8)
38#define OMAP1610_DMA_LCD_TOP_B1_U (OMAP1610_DMA_LCD_BASE + 0xca)
39#define OMAP1610_DMA_LCD_BOT_B1_L (OMAP1610_DMA_LCD_BASE + 0xcc)
40#define OMAP1610_DMA_LCD_BOT_B1_U (OMAP1610_DMA_LCD_BASE + 0xce)
41#define OMAP1610_DMA_LCD_TOP_B2_L (OMAP1610_DMA_LCD_BASE + 0xd0)
42#define OMAP1610_DMA_LCD_TOP_B2_U (OMAP1610_DMA_LCD_BASE + 0xd2)
43#define OMAP1610_DMA_LCD_BOT_B2_L (OMAP1610_DMA_LCD_BASE + 0xd4)
44#define OMAP1610_DMA_LCD_BOT_B2_U (OMAP1610_DMA_LCD_BASE + 0xd6)
45#define OMAP1610_DMA_LCD_SRC_EI_B1 (OMAP1610_DMA_LCD_BASE + 0xd8)
46#define OMAP1610_DMA_LCD_SRC_FI_B1_L (OMAP1610_DMA_LCD_BASE + 0xda)
47#define OMAP1610_DMA_LCD_SRC_EN_B1 (OMAP1610_DMA_LCD_BASE + 0xe0)
48#define OMAP1610_DMA_LCD_SRC_FN_B1 (OMAP1610_DMA_LCD_BASE + 0xe4)
49#define OMAP1610_DMA_LCD_LCH_CTRL (OMAP1610_DMA_LCD_BASE + 0xea)
50#define OMAP1610_DMA_LCD_SRC_FI_B1_U (OMAP1610_DMA_LCD_BASE + 0xf4)
51
52/* LCD DMA block numbers */
53enum {
54 OMAP_LCD_DMA_B1_TOP,
55 OMAP_LCD_DMA_B1_BOTTOM,
56 OMAP_LCD_DMA_B2_TOP,
57 OMAP_LCD_DMA_B2_BOTTOM
58};
59
60/* LCD DMA functions */
61extern int omap_request_lcd_dma(void (*callback)(u16 status, void *data),
62 void *data);
63extern void omap_free_lcd_dma(void);
64extern void omap_setup_lcd_dma(void);
65extern void omap_enable_lcd_dma(void);
66extern void omap_stop_lcd_dma(void);
67extern void omap_set_lcd_dma_ext_controller(int external);
68extern void omap_set_lcd_dma_single_transfer(int single);
69extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
70 int data_type);
71extern void omap_set_lcd_dma_b1_rotation(int rotate);
72extern void omap_set_lcd_dma_b1_vxres(unsigned long vxres);
73extern void omap_set_lcd_dma_b1_mirror(int mirror);
74extern void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale);
75
76extern int omap_lcd_dma_running(void);
77
78#endif /* __MACH_OMAP1_LCD_DMA_H__ */
diff --git a/arch/arm/mach-omap1/include/mach/lcdc.h b/arch/arm/mach-omap1/include/mach/lcdc.h
new file mode 100644
index 000000000000..89bd703adaf6
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/lcdc.h
@@ -0,0 +1,57 @@
1/*
2 * arch/arm/mach-omap1/include/mach/lcdc.h
3 *
4 * Extracted from drivers/video/omap/lcdc.c
5 * Copyright (C) 2004 Nokia Corporation
6 * Author: Imre Deak <imre.deak@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22#ifndef __MACH_LCDC_H__
23#define __MACH_LCDC_H__
24
25#define OMAP_LCDC_BASE 0xfffec000
26#define OMAP_LCDC_SIZE 256
27#define OMAP_LCDC_IRQ INT_LCD_CTRL
28
29#define OMAP_LCDC_CONTROL (OMAP_LCDC_BASE + 0x00)
30#define OMAP_LCDC_TIMING0 (OMAP_LCDC_BASE + 0x04)
31#define OMAP_LCDC_TIMING1 (OMAP_LCDC_BASE + 0x08)
32#define OMAP_LCDC_TIMING2 (OMAP_LCDC_BASE + 0x0c)
33#define OMAP_LCDC_STATUS (OMAP_LCDC_BASE + 0x10)
34#define OMAP_LCDC_SUBPANEL (OMAP_LCDC_BASE + 0x14)
35#define OMAP_LCDC_LINE_INT (OMAP_LCDC_BASE + 0x18)
36#define OMAP_LCDC_DISPLAY_STATUS (OMAP_LCDC_BASE + 0x1c)
37
38#define OMAP_LCDC_STAT_DONE (1 << 0)
39#define OMAP_LCDC_STAT_VSYNC (1 << 1)
40#define OMAP_LCDC_STAT_SYNC_LOST (1 << 2)
41#define OMAP_LCDC_STAT_ABC (1 << 3)
42#define OMAP_LCDC_STAT_LINE_INT (1 << 4)
43#define OMAP_LCDC_STAT_FUF (1 << 5)
44#define OMAP_LCDC_STAT_LOADED_PALETTE (1 << 6)
45
46#define OMAP_LCDC_CTRL_LCD_EN (1 << 0)
47#define OMAP_LCDC_CTRL_LCD_TFT (1 << 7)
48#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL (1 << 10)
49
50#define OMAP_LCDC_IRQ_VSYNC (1 << 2)
51#define OMAP_LCDC_IRQ_DONE (1 << 3)
52#define OMAP_LCDC_IRQ_LOADED_PALETTE (1 << 4)
53#define OMAP_LCDC_IRQ_LINE_NIRQ (1 << 5)
54#define OMAP_LCDC_IRQ_LINE (1 << 6)
55#define OMAP_LCDC_IRQ_MASK (((1 << 5) - 1) << 2)
56
57#endif /* __MACH_LCDC_H__ */
diff --git a/arch/arm/mach-omap1/include/mach/memory.h b/arch/arm/mach-omap1/include/mach/memory.h
new file mode 100644
index 000000000000..e9b600c113ef
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/memory.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/memory.h
3 */
4
5#include <plat/memory.h>
diff --git a/arch/arm/mach-omap1/include/mach/mtd-xip.h b/arch/arm/mach-omap1/include/mach/mtd-xip.h
new file mode 100644
index 000000000000..f82a8dcaad94
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/mtd-xip.h
@@ -0,0 +1,61 @@
1/*
2 * MTD primitives for XIP support. Architecture specific functions.
3 *
4 * Do not include this file directly. It's included from linux/mtd/xip.h
5 *
6 * Author: Vladimir Barinov <vbarinov@embeddedalley.com>
7 *
8 * (c) 2005 MontaVista Software, Inc. This file is licensed under the
9 * terms of the GNU General Public License version 2. This program is
10 * licensed "as is" without any warranty of any kind, whether express or
11 * implied.
12 */
13
14#ifndef __ARCH_OMAP_MTD_XIP_H__
15#define __ARCH_OMAP_MTD_XIP_H__
16
17#include <mach/hardware.h>
18#define OMAP_MPU_TIMER_BASE (0xfffec500)
19#define OMAP_MPU_TIMER_OFFSET 0x100
20
21typedef struct {
22 u32 cntl; /* CNTL_TIMER, R/W */
23 u32 load_tim; /* LOAD_TIM, W */
24 u32 read_tim; /* READ_TIM, R */
25} xip_omap_mpu_timer_regs_t;
26
27#define xip_omap_mpu_timer_base(n) \
28((volatile xip_omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \
29 (n)*OMAP_MPU_TIMER_OFFSET))
30
31static inline unsigned long xip_omap_mpu_timer_read(int nr)
32{
33 volatile xip_omap_mpu_timer_regs_t* timer = xip_omap_mpu_timer_base(nr);
34 return timer->read_tim;
35}
36
37#define xip_irqpending() \
38 (omap_readl(OMAP_IH1_ITR) & ~omap_readl(OMAP_IH1_MIR))
39#define xip_currtime() (~xip_omap_mpu_timer_read(0))
40
41/*
42 * It's permitted to do approxmation for xip_elapsed_since macro
43 * (see linux/mtd/xip.h)
44 */
45
46#ifdef CONFIG_MACH_OMAP_PERSEUS2
47#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 7)
48#else
49#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 6)
50#endif
51
52/*
53 * xip_cpu_idle() is used when waiting for a delay equal or larger than
54 * the system timer tick period. This should put the CPU into idle mode
55 * to save power and to be woken up only when some interrupts are pending.
56 * As above, this should not rely upon standard kernel code.
57 */
58
59#define xip_cpu_idle() asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (1))
60
61#endif /* __ARCH_OMAP_MTD_XIP_H__ */
diff --git a/arch/arm/mach-omap1/include/mach/smp.h b/arch/arm/mach-omap1/include/mach/smp.h
new file mode 100644
index 000000000000..80a371c06e59
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/smp.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/smp.h
3 */
4
5#include <plat/smp.h>
diff --git a/arch/arm/mach-omap1/include/mach/system.h b/arch/arm/mach-omap1/include/mach/system.h
new file mode 100644
index 000000000000..a6c1b3a16dfc
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/system.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/system.h
3 */
4
5#include <plat/system.h>
diff --git a/arch/arm/mach-omap1/include/mach/timex.h b/arch/arm/mach-omap1/include/mach/timex.h
new file mode 100644
index 000000000000..4793790d53cc
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/timex.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/timex.h
3 */
4
5#include <plat/timex.h>
diff --git a/arch/arm/mach-omap1/include/mach/uncompress.h b/arch/arm/mach-omap1/include/mach/uncompress.h
new file mode 100644
index 000000000000..0ff22dc075c7
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/uncompress.h
@@ -0,0 +1,5 @@
1/*
2 * arch/arm/mach-omap1/include/mach/uncompress.h
3 */
4
5#include <plat/uncompress.h>
diff --git a/arch/arm/mach-omap1/include/mach/vmalloc.h b/arch/arm/mach-omap1/include/mach/vmalloc.h
new file mode 100644
index 000000000000..1b2af14df151
--- /dev/null
+++ b/arch/arm/mach-omap1/include/mach/vmalloc.h
@@ -0,0 +1,20 @@
1/*
2 * arch/arm/mach-omap1/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2000 Russell King.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#define VMALLOC_END (PAGE_OFFSET + 0x18000000)
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index 7030f9281ea1..d9b8d82530ae 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -15,10 +15,11 @@
15 15
16#include <asm/tlb.h> 16#include <asm/tlb.h>
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18#include <mach/mux.h> 18#include <plat/mux.h>
19#include <mach/tc.h> 19#include <plat/tc.h>
20
21#include "clock.h"
20 22
21extern int omap1_clk_init(void);
22extern void omap_check_revision(void); 23extern void omap_check_revision(void);
23extern void omap_sram_init(void); 24extern void omap_sram_init(void);
24extern void omapfb_reserve_sdram(void); 25extern void omapfb_reserve_sdram(void);
@@ -36,33 +37,17 @@ static struct map_desc omap_io_desc[] __initdata = {
36 } 37 }
37}; 38};
38 39
39#ifdef CONFIG_ARCH_OMAP730 40#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
40static struct map_desc omap730_io_desc[] __initdata = { 41static struct map_desc omap7xx_io_desc[] __initdata = {
41 { 42 {
42 .virtual = OMAP730_DSP_BASE, 43 .virtual = OMAP7XX_DSP_BASE,
43 .pfn = __phys_to_pfn(OMAP730_DSP_START), 44 .pfn = __phys_to_pfn(OMAP7XX_DSP_START),
44 .length = OMAP730_DSP_SIZE, 45 .length = OMAP7XX_DSP_SIZE,
45 .type = MT_DEVICE 46 .type = MT_DEVICE
46 }, { 47 }, {
47 .virtual = OMAP730_DSPREG_BASE, 48 .virtual = OMAP7XX_DSPREG_BASE,
48 .pfn = __phys_to_pfn(OMAP730_DSPREG_START), 49 .pfn = __phys_to_pfn(OMAP7XX_DSPREG_START),
49 .length = OMAP730_DSPREG_SIZE, 50 .length = OMAP7XX_DSPREG_SIZE,
50 .type = MT_DEVICE
51 }
52};
53#endif
54
55#ifdef CONFIG_ARCH_OMAP850
56static struct map_desc omap850_io_desc[] __initdata = {
57 {
58 .virtual = OMAP850_DSP_BASE,
59 .pfn = __phys_to_pfn(OMAP850_DSP_START),
60 .length = OMAP850_DSP_SIZE,
61 .type = MT_DEVICE
62 }, {
63 .virtual = OMAP850_DSPREG_BASE,
64 .pfn = __phys_to_pfn(OMAP850_DSPREG_START),
65 .length = OMAP850_DSPREG_SIZE,
66 .type = MT_DEVICE 51 .type = MT_DEVICE
67 } 52 }
68}; 53};
@@ -120,18 +105,11 @@ void __init omap1_map_common_io(void)
120 */ 105 */
121 omap_check_revision(); 106 omap_check_revision();
122 107
123#ifdef CONFIG_ARCH_OMAP730 108#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
124 if (cpu_is_omap730()) { 109 if (cpu_is_omap7xx()) {
125 iotable_init(omap730_io_desc, ARRAY_SIZE(omap730_io_desc)); 110 iotable_init(omap7xx_io_desc, ARRAY_SIZE(omap7xx_io_desc));
126 }
127#endif
128
129#ifdef CONFIG_ARCH_OMAP850
130 if (cpu_is_omap850()) {
131 iotable_init(omap850_io_desc, ARRAY_SIZE(omap850_io_desc));
132 } 111 }
133#endif 112#endif
134
135#ifdef CONFIG_ARCH_OMAP15XX 113#ifdef CONFIG_ARCH_OMAP15XX
136 if (cpu_is_omap15xx()) { 114 if (cpu_is_omap15xx()) {
137 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); 115 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc));
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index de03c8448994..db913c34d1fe 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -46,7 +46,7 @@
46#include <asm/irq.h> 46#include <asm/irq.h>
47#include <asm/mach/irq.h> 47#include <asm/mach/irq.h>
48#include <mach/gpio.h> 48#include <mach/gpio.h>
49#include <mach/cpu.h> 49#include <plat/cpu.h>
50 50
51#define IRQ_BANK(irq) ((irq) >> 5) 51#define IRQ_BANK(irq) ((irq) >> 5)
52#define IRQ_BIT(irq) ((irq) & 0x1f) 52#define IRQ_BIT(irq) ((irq) & 0x1f)
@@ -137,16 +137,8 @@ static void omap_irq_set_cfg(int irq, int fiq, int priority, int trigger)
137 irq_bank_writel(val, bank, offset); 137 irq_bank_writel(val, bank, offset);
138} 138}
139 139
140#ifdef CONFIG_ARCH_OMAP730 140#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
141static struct omap_irq_bank omap730_irq_banks[] = { 141static struct omap_irq_bank omap7xx_irq_banks[] = {
142 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f },
143 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 },
144 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 },
145};
146#endif
147
148#ifdef CONFIG_ARCH_OMAP850
149static struct omap_irq_bank omap850_irq_banks[] = {
150 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f }, 142 { .base_reg = OMAP_IH1_BASE, .trigger_map = 0xb3f8e22f },
151 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 }, 143 { .base_reg = OMAP_IH2_BASE, .trigger_map = 0xfdb9c1f2 },
152 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 }, 144 { .base_reg = OMAP_IH2_BASE + 0x100, .trigger_map = 0x800040f3 },
@@ -186,16 +178,10 @@ void __init omap_init_irq(void)
186{ 178{
187 int i, j; 179 int i, j;
188 180
189#ifdef CONFIG_ARCH_OMAP730 181#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
190 if (cpu_is_omap730()) { 182 if (cpu_is_omap7xx()) {
191 irq_banks = omap730_irq_banks; 183 irq_banks = omap7xx_irq_banks;
192 irq_bank_count = ARRAY_SIZE(omap730_irq_banks); 184 irq_bank_count = ARRAY_SIZE(omap7xx_irq_banks);
193 }
194#endif
195#ifdef CONFIG_ARCH_OMAP850
196 if (cpu_is_omap850()) {
197 irq_banks = omap850_irq_banks;
198 irq_bank_count = ARRAY_SIZE(omap850_irq_banks);
199 } 185 }
200#endif 186#endif
201#ifdef CONFIG_ARCH_OMAP15XX 187#ifdef CONFIG_ARCH_OMAP15XX
@@ -247,10 +233,8 @@ void __init omap_init_irq(void)
247 233
248 /* Unmask level 2 handler */ 234 /* Unmask level 2 handler */
249 235
250 if (cpu_is_omap730()) 236 if (cpu_is_omap7xx())
251 omap_unmask_irq(INT_730_IH2_IRQ); 237 omap_unmask_irq(INT_7XX_IH2_IRQ);
252 else if (cpu_is_omap850())
253 omap_unmask_irq(INT_850_IH2_IRQ);
254 else if (cpu_is_omap15xx()) 238 else if (cpu_is_omap15xx())
255 omap_unmask_irq(INT_1510_IH2_IRQ); 239 omap_unmask_irq(INT_1510_IH2_IRQ);
256 else if (cpu_is_omap16xx()) 240 else if (cpu_is_omap16xx())
diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c
new file mode 100644
index 000000000000..3be11af687bb
--- /dev/null
+++ b/arch/arm/mach-omap1/lcd_dma.c
@@ -0,0 +1,448 @@
1/*
2 * linux/arch/arm/mach-omap1/lcd_dma.c
3 *
4 * Extracted from arch/arm/plat-omap/dma.c
5 * Copyright (C) 2003 - 2008 Nokia Corporation
6 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
7 * DMA channel linking for 1610 by Samuel Ortiz <samuel.ortiz@nokia.com>
8 * Graphics DMA and LCD DMA graphics tranformations
9 * by Imre Deak <imre.deak@nokia.com>
10 * OMAP2/3 support Copyright (C) 2004-2007 Texas Instruments, Inc.
11 * Merged to support both OMAP1 and OMAP2 by Tony Lindgren <tony@atomide.com>
12 * Some functions based on earlier dma-omap.c Copyright (C) 2001 RidgeRun, Inc.
13 *
14 * Copyright (C) 2009 Texas Instruments
15 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
16 *
17 * Support functions for the OMAP internal DMA channels.
18 *
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License version 2 as
21 * published by the Free Software Foundation.
22 *
23 */
24
25#include <linux/module.h>
26#include <linux/spinlock.h>
27#include <linux/interrupt.h>
28#include <linux/io.h>
29
30#include <mach/hardware.h>
31#include <mach/lcdc.h>
32#include <plat/dma.h>
33
34int omap_lcd_dma_running(void)
35{
36 /*
37 * On OMAP1510, internal LCD controller will start the transfer
38 * when it gets enabled, so assume DMA running if LCD enabled.
39 */
40 if (cpu_is_omap1510())
41 if (omap_readw(OMAP_LCDC_CONTROL) & OMAP_LCDC_CTRL_LCD_EN)
42 return 1;
43
44 /* Check if LCD DMA is running */
45 if (cpu_is_omap16xx())
46 if (omap_readw(OMAP1610_DMA_LCD_CCR) & OMAP_DMA_CCR_EN)
47 return 1;
48
49 return 0;
50}
51
52static struct lcd_dma_info {
53 spinlock_t lock;
54 int reserved;
55 void (*callback)(u16 status, void *data);
56 void *cb_data;
57
58 int active;
59 unsigned long addr, size;
60 int rotate, data_type, xres, yres;
61 int vxres;
62 int mirror;
63 int xscale, yscale;
64 int ext_ctrl;
65 int src_port;
66 int single_transfer;
67} lcd_dma;
68
69void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
70 int data_type)
71{
72 lcd_dma.addr = addr;
73 lcd_dma.data_type = data_type;
74 lcd_dma.xres = fb_xres;
75 lcd_dma.yres = fb_yres;
76}
77EXPORT_SYMBOL(omap_set_lcd_dma_b1);
78
79void omap_set_lcd_dma_src_port(int port)
80{
81 lcd_dma.src_port = port;
82}
83
84void omap_set_lcd_dma_ext_controller(int external)
85{
86 lcd_dma.ext_ctrl = external;
87}
88EXPORT_SYMBOL(omap_set_lcd_dma_ext_controller);
89
90void omap_set_lcd_dma_single_transfer(int single)
91{
92 lcd_dma.single_transfer = single;
93}
94EXPORT_SYMBOL(omap_set_lcd_dma_single_transfer);
95
96void omap_set_lcd_dma_b1_rotation(int rotate)
97{
98 if (cpu_is_omap1510()) {
99 printk(KERN_ERR "DMA rotation is not supported in 1510 mode\n");
100 BUG();
101 return;
102 }
103 lcd_dma.rotate = rotate;
104}
105EXPORT_SYMBOL(omap_set_lcd_dma_b1_rotation);
106
107void omap_set_lcd_dma_b1_mirror(int mirror)
108{
109 if (cpu_is_omap1510()) {
110 printk(KERN_ERR "DMA mirror is not supported in 1510 mode\n");
111 BUG();
112 }
113 lcd_dma.mirror = mirror;
114}
115EXPORT_SYMBOL(omap_set_lcd_dma_b1_mirror);
116
117void omap_set_lcd_dma_b1_vxres(unsigned long vxres)
118{
119 if (cpu_is_omap1510()) {
120 printk(KERN_ERR "DMA virtual resulotion is not supported "
121 "in 1510 mode\n");
122 BUG();
123 }
124 lcd_dma.vxres = vxres;
125}
126EXPORT_SYMBOL(omap_set_lcd_dma_b1_vxres);
127
128void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale)
129{
130 if (cpu_is_omap1510()) {
131 printk(KERN_ERR "DMA scale is not supported in 1510 mode\n");
132 BUG();
133 }
134 lcd_dma.xscale = xscale;
135 lcd_dma.yscale = yscale;
136}
137EXPORT_SYMBOL(omap_set_lcd_dma_b1_scale);
138
139static void set_b1_regs(void)
140{
141 unsigned long top, bottom;
142 int es;
143 u16 w;
144 unsigned long en, fn;
145 long ei, fi;
146 unsigned long vxres;
147 unsigned int xscale, yscale;
148
149 switch (lcd_dma.data_type) {
150 case OMAP_DMA_DATA_TYPE_S8:
151 es = 1;
152 break;
153 case OMAP_DMA_DATA_TYPE_S16:
154 es = 2;
155 break;
156 case OMAP_DMA_DATA_TYPE_S32:
157 es = 4;
158 break;
159 default:
160 BUG();
161 return;
162 }
163
164 vxres = lcd_dma.vxres ? lcd_dma.vxres : lcd_dma.xres;
165 xscale = lcd_dma.xscale ? lcd_dma.xscale : 1;
166 yscale = lcd_dma.yscale ? lcd_dma.yscale : 1;
167 BUG_ON(vxres < lcd_dma.xres);
168
169#define PIXADDR(x, y) (lcd_dma.addr + \
170 ((y) * vxres * yscale + (x) * xscale) * es)
171#define PIXSTEP(sx, sy, dx, dy) (PIXADDR(dx, dy) - PIXADDR(sx, sy) - es + 1)
172
173 switch (lcd_dma.rotate) {
174 case 0:
175 if (!lcd_dma.mirror) {
176 top = PIXADDR(0, 0);
177 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
178 /* 1510 DMA requires the bottom address to be 2 more
179 * than the actual last memory access location. */
180 if (cpu_is_omap1510() &&
181 lcd_dma.data_type == OMAP_DMA_DATA_TYPE_S32)
182 bottom += 2;
183 ei = PIXSTEP(0, 0, 1, 0);
184 fi = PIXSTEP(lcd_dma.xres - 1, 0, 0, 1);
185 } else {
186 top = PIXADDR(lcd_dma.xres - 1, 0);
187 bottom = PIXADDR(0, lcd_dma.yres - 1);
188 ei = PIXSTEP(1, 0, 0, 0);
189 fi = PIXSTEP(0, 0, lcd_dma.xres - 1, 1);
190 }
191 en = lcd_dma.xres;
192 fn = lcd_dma.yres;
193 break;
194 case 90:
195 if (!lcd_dma.mirror) {
196 top = PIXADDR(0, lcd_dma.yres - 1);
197 bottom = PIXADDR(lcd_dma.xres - 1, 0);
198 ei = PIXSTEP(0, 1, 0, 0);
199 fi = PIXSTEP(0, 0, 1, lcd_dma.yres - 1);
200 } else {
201 top = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
202 bottom = PIXADDR(0, 0);
203 ei = PIXSTEP(0, 1, 0, 0);
204 fi = PIXSTEP(1, 0, 0, lcd_dma.yres - 1);
205 }
206 en = lcd_dma.yres;
207 fn = lcd_dma.xres;
208 break;
209 case 180:
210 if (!lcd_dma.mirror) {
211 top = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
212 bottom = PIXADDR(0, 0);
213 ei = PIXSTEP(1, 0, 0, 0);
214 fi = PIXSTEP(0, 1, lcd_dma.xres - 1, 0);
215 } else {
216 top = PIXADDR(0, lcd_dma.yres - 1);
217 bottom = PIXADDR(lcd_dma.xres - 1, 0);
218 ei = PIXSTEP(0, 0, 1, 0);
219 fi = PIXSTEP(lcd_dma.xres - 1, 1, 0, 0);
220 }
221 en = lcd_dma.xres;
222 fn = lcd_dma.yres;
223 break;
224 case 270:
225 if (!lcd_dma.mirror) {
226 top = PIXADDR(lcd_dma.xres - 1, 0);
227 bottom = PIXADDR(0, lcd_dma.yres - 1);
228 ei = PIXSTEP(0, 0, 0, 1);
229 fi = PIXSTEP(1, lcd_dma.yres - 1, 0, 0);
230 } else {
231 top = PIXADDR(0, 0);
232 bottom = PIXADDR(lcd_dma.xres - 1, lcd_dma.yres - 1);
233 ei = PIXSTEP(0, 0, 0, 1);
234 fi = PIXSTEP(0, lcd_dma.yres - 1, 1, 0);
235 }
236 en = lcd_dma.yres;
237 fn = lcd_dma.xres;
238 break;
239 default:
240 BUG();
241 return; /* Suppress warning about uninitialized vars */
242 }
243
244 if (cpu_is_omap1510()) {
245 omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U);
246 omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L);
247 omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U);
248 omap_writew(bottom, OMAP1510_DMA_LCD_BOT_F1_L);
249
250 return;
251 }
252
253 /* 1610 regs */
254 omap_writew(top >> 16, OMAP1610_DMA_LCD_TOP_B1_U);
255 omap_writew(top, OMAP1610_DMA_LCD_TOP_B1_L);
256 omap_writew(bottom >> 16, OMAP1610_DMA_LCD_BOT_B1_U);
257 omap_writew(bottom, OMAP1610_DMA_LCD_BOT_B1_L);
258
259 omap_writew(en, OMAP1610_DMA_LCD_SRC_EN_B1);
260 omap_writew(fn, OMAP1610_DMA_LCD_SRC_FN_B1);
261
262 w = omap_readw(OMAP1610_DMA_LCD_CSDP);
263 w &= ~0x03;
264 w |= lcd_dma.data_type;
265 omap_writew(w, OMAP1610_DMA_LCD_CSDP);
266
267 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
268 /* Always set the source port as SDRAM for now*/
269 w &= ~(0x03 << 6);
270 if (lcd_dma.callback != NULL)
271 w |= 1 << 1; /* Block interrupt enable */
272 else
273 w &= ~(1 << 1);
274 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
275
276 if (!(lcd_dma.rotate || lcd_dma.mirror ||
277 lcd_dma.vxres || lcd_dma.xscale || lcd_dma.yscale))
278 return;
279
280 w = omap_readw(OMAP1610_DMA_LCD_CCR);
281 /* Set the double-indexed addressing mode */
282 w |= (0x03 << 12);
283 omap_writew(w, OMAP1610_DMA_LCD_CCR);
284
285 omap_writew(ei, OMAP1610_DMA_LCD_SRC_EI_B1);
286 omap_writew(fi >> 16, OMAP1610_DMA_LCD_SRC_FI_B1_U);
287 omap_writew(fi, OMAP1610_DMA_LCD_SRC_FI_B1_L);
288}
289
290static irqreturn_t lcd_dma_irq_handler(int irq, void *dev_id)
291{
292 u16 w;
293
294 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
295 if (unlikely(!(w & (1 << 3)))) {
296 printk(KERN_WARNING "Spurious LCD DMA IRQ\n");
297 return IRQ_NONE;
298 }
299 /* Ack the IRQ */
300 w |= (1 << 3);
301 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
302 lcd_dma.active = 0;
303 if (lcd_dma.callback != NULL)
304 lcd_dma.callback(w, lcd_dma.cb_data);
305
306 return IRQ_HANDLED;
307}
308
309int omap_request_lcd_dma(void (*callback)(u16 status, void *data),
310 void *data)
311{
312 spin_lock_irq(&lcd_dma.lock);
313 if (lcd_dma.reserved) {
314 spin_unlock_irq(&lcd_dma.lock);
315 printk(KERN_ERR "LCD DMA channel already reserved\n");
316 BUG();
317 return -EBUSY;
318 }
319 lcd_dma.reserved = 1;
320 spin_unlock_irq(&lcd_dma.lock);
321 lcd_dma.callback = callback;
322 lcd_dma.cb_data = data;
323 lcd_dma.active = 0;
324 lcd_dma.single_transfer = 0;
325 lcd_dma.rotate = 0;
326 lcd_dma.vxres = 0;
327 lcd_dma.mirror = 0;
328 lcd_dma.xscale = 0;
329 lcd_dma.yscale = 0;
330 lcd_dma.ext_ctrl = 0;
331 lcd_dma.src_port = 0;
332
333 return 0;
334}
335EXPORT_SYMBOL(omap_request_lcd_dma);
336
337void omap_free_lcd_dma(void)
338{
339 spin_lock(&lcd_dma.lock);
340 if (!lcd_dma.reserved) {
341 spin_unlock(&lcd_dma.lock);
342 printk(KERN_ERR "LCD DMA is not reserved\n");
343 BUG();
344 return;
345 }
346 if (!cpu_is_omap1510())
347 omap_writew(omap_readw(OMAP1610_DMA_LCD_CCR) & ~1,
348 OMAP1610_DMA_LCD_CCR);
349 lcd_dma.reserved = 0;
350 spin_unlock(&lcd_dma.lock);
351}
352EXPORT_SYMBOL(omap_free_lcd_dma);
353
354void omap_enable_lcd_dma(void)
355{
356 u16 w;
357
358 /*
359 * Set the Enable bit only if an external controller is
360 * connected. Otherwise the OMAP internal controller will
361 * start the transfer when it gets enabled.
362 */
363 if (cpu_is_omap1510() || !lcd_dma.ext_ctrl)
364 return;
365
366 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
367 w |= 1 << 8;
368 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
369
370 lcd_dma.active = 1;
371
372 w = omap_readw(OMAP1610_DMA_LCD_CCR);
373 w |= 1 << 7;
374 omap_writew(w, OMAP1610_DMA_LCD_CCR);
375}
376EXPORT_SYMBOL(omap_enable_lcd_dma);
377
378void omap_setup_lcd_dma(void)
379{
380 BUG_ON(lcd_dma.active);
381 if (!cpu_is_omap1510()) {
382 /* Set some reasonable defaults */
383 omap_writew(0x5440, OMAP1610_DMA_LCD_CCR);
384 omap_writew(0x9102, OMAP1610_DMA_LCD_CSDP);
385 omap_writew(0x0004, OMAP1610_DMA_LCD_LCH_CTRL);
386 }
387 set_b1_regs();
388 if (!cpu_is_omap1510()) {
389 u16 w;
390
391 w = omap_readw(OMAP1610_DMA_LCD_CCR);
392 /*
393 * If DMA was already active set the end_prog bit to have
394 * the programmed register set loaded into the active
395 * register set.
396 */
397 w |= 1 << 11; /* End_prog */
398 if (!lcd_dma.single_transfer)
399 w |= (3 << 8); /* Auto_init, repeat */
400 omap_writew(w, OMAP1610_DMA_LCD_CCR);
401 }
402}
403EXPORT_SYMBOL(omap_setup_lcd_dma);
404
405void omap_stop_lcd_dma(void)
406{
407 u16 w;
408
409 lcd_dma.active = 0;
410 if (cpu_is_omap1510() || !lcd_dma.ext_ctrl)
411 return;
412
413 w = omap_readw(OMAP1610_DMA_LCD_CCR);
414 w &= ~(1 << 7);
415 omap_writew(w, OMAP1610_DMA_LCD_CCR);
416
417 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
418 w &= ~(1 << 8);
419 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
420}
421EXPORT_SYMBOL(omap_stop_lcd_dma);
422
423static int __init omap_init_lcd_dma(void)
424{
425 int r;
426
427 if (cpu_is_omap16xx()) {
428 u16 w;
429
430 /* this would prevent OMAP sleep */
431 w = omap_readw(OMAP1610_DMA_LCD_CTRL);
432 w &= ~(1 << 8);
433 omap_writew(w, OMAP1610_DMA_LCD_CTRL);
434 }
435
436 spin_lock_init(&lcd_dma.lock);
437
438 r = request_irq(INT_DMA_LCD, lcd_dma_irq_handler, 0,
439 "LCD DMA", NULL);
440 if (r != 0)
441 printk(KERN_ERR "unable to request IRQ for LCD DMA "
442 "(error %d)\n", r);
443
444 return r;
445}
446
447arch_initcall(omap_init_lcd_dma);
448
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c
index 17c9d0e04216..b4f9be52e1e8 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -19,7 +19,7 @@
19#include <asm/system.h> 19#include <asm/system.h>
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21 21
22#include <mach/fpga.h> 22#include <plat/fpga.h>
23#include <mach/gpio.h> 23#include <mach/gpio.h>
24 24
25#include "leds.h" 25#include "leds.h"
diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c
index 8cbf2562dcaa..277f356d4cd0 100644
--- a/arch/arm/mach-omap1/leds.c
+++ b/arch/arm/mach-omap1/leds.c
@@ -10,7 +10,7 @@
10#include <asm/mach-types.h> 10#include <asm/mach-types.h>
11 11
12#include <mach/gpio.h> 12#include <mach/gpio.h>
13#include <mach/mux.h> 13#include <plat/mux.h>
14 14
15#include "leds.h" 15#include "leds.h"
16 16
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index 6810b4aeb02c..4f5b3da3d559 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -14,7 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <mach/mailbox.h> 17#include <plat/mailbox.h>
18#include <mach/irqs.h> 18#include <mach/irqs.h>
19 19
20#define MAILBOX_ARM2DSP1 0x00 20#define MAILBOX_ARM2DSP1 0x00
@@ -146,7 +146,6 @@ EXPORT_SYMBOL(mbox_dsp_info);
146static int __devinit omap1_mbox_probe(struct platform_device *pdev) 146static int __devinit omap1_mbox_probe(struct platform_device *pdev)
147{ 147{
148 struct resource *res; 148 struct resource *res;
149 int ret = 0;
150 149
151 if (pdev->num_resources != 2) { 150 if (pdev->num_resources != 2) {
152 dev_err(&pdev->dev, "invalid number of resources: %d\n", 151 dev_err(&pdev->dev, "invalid number of resources: %d\n",
@@ -160,12 +159,18 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev)
160 dev_err(&pdev->dev, "invalid mem resource\n"); 159 dev_err(&pdev->dev, "invalid mem resource\n");
161 return -ENODEV; 160 return -ENODEV;
162 } 161 }
163 mbox_base = res->start; 162
163 mbox_base = ioremap(res->start, resource_size(res));
164 if (!mbox_base) {
165 dev_err(&pdev->dev, "ioremap failed\n");
166 return -ENODEV;
167 }
164 168
165 /* DSP IRQ */ 169 /* DSP IRQ */
166 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 170 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
167 if (unlikely(!res)) { 171 if (unlikely(!res)) {
168 dev_err(&pdev->dev, "invalid irq resource\n"); 172 dev_err(&pdev->dev, "invalid irq resource\n");
173 iounmap(mbox_base);
169 return -ENODEV; 174 return -ENODEV;
170 } 175 }
171 mbox_dsp_info.irq = res->start; 176 mbox_dsp_info.irq = res->start;
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index 505d98cfe508..e9bdff192f82 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -16,13 +16,14 @@
16#include <linux/err.h> 16#include <linux/err.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/slab.h>
19 20
20#include <mach/irqs.h> 21#include <mach/irqs.h>
21#include <mach/dma.h> 22#include <plat/dma.h>
22#include <mach/mux.h> 23#include <plat/mux.h>
23#include <mach/cpu.h> 24#include <plat/cpu.h>
24#include <mach/mcbsp.h> 25#include <plat/mcbsp.h>
25#include <mach/dsp_common.h> 26#include <plat/dsp_common.h>
26 27
27#define DPS_RSTCT2_PER_EN (1 << 0) 28#define DPS_RSTCT2_PER_EN (1 << 0)
28#define DSP_RSTCT2_WD_PER_EN (1 << 1) 29#define DSP_RSTCT2_WD_PER_EN (1 << 1)
@@ -79,29 +80,31 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = {
79 .free = omap1_mcbsp_free, 80 .free = omap1_mcbsp_free,
80}; 81};
81 82
82#ifdef CONFIG_ARCH_OMAP730 83#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
83static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { 84static struct omap_mcbsp_platform_data omap7xx_mcbsp_pdata[] = {
84 { 85 {
85 .phys_base = OMAP730_MCBSP1_BASE, 86 .phys_base = OMAP7XX_MCBSP1_BASE,
86 .dma_rx_sync = OMAP_DMA_MCBSP1_RX, 87 .dma_rx_sync = OMAP_DMA_MCBSP1_RX,
87 .dma_tx_sync = OMAP_DMA_MCBSP1_TX, 88 .dma_tx_sync = OMAP_DMA_MCBSP1_TX,
88 .rx_irq = INT_730_McBSP1RX, 89 .rx_irq = INT_7XX_McBSP1RX,
89 .tx_irq = INT_730_McBSP1TX, 90 .tx_irq = INT_7XX_McBSP1TX,
90 .ops = &omap1_mcbsp_ops, 91 .ops = &omap1_mcbsp_ops,
91 }, 92 },
92 { 93 {
93 .phys_base = OMAP730_MCBSP2_BASE, 94 .phys_base = OMAP7XX_MCBSP2_BASE,
94 .dma_rx_sync = OMAP_DMA_MCBSP3_RX, 95 .dma_rx_sync = OMAP_DMA_MCBSP3_RX,
95 .dma_tx_sync = OMAP_DMA_MCBSP3_TX, 96 .dma_tx_sync = OMAP_DMA_MCBSP3_TX,
96 .rx_irq = INT_730_McBSP2RX, 97 .rx_irq = INT_7XX_McBSP2RX,
97 .tx_irq = INT_730_McBSP2TX, 98 .tx_irq = INT_7XX_McBSP2TX,
98 .ops = &omap1_mcbsp_ops, 99 .ops = &omap1_mcbsp_ops,
99 }, 100 },
100}; 101};
101#define OMAP730_MCBSP_PDATA_SZ ARRAY_SIZE(omap730_mcbsp_pdata) 102#define OMAP7XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap7xx_mcbsp_pdata)
103#define OMAP7XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1)
102#else 104#else
103#define omap730_mcbsp_pdata NULL 105#define omap7xx_mcbsp_pdata NULL
104#define OMAP730_MCBSP_PDATA_SZ 0 106#define OMAP7XX_MCBSP_PDATA_SZ 0
107#define OMAP7XX_MCBSP_REG_NUM 0
105#endif 108#endif
106 109
107#ifdef CONFIG_ARCH_OMAP15XX 110#ifdef CONFIG_ARCH_OMAP15XX
@@ -132,9 +135,11 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
132 }, 135 },
133}; 136};
134#define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) 137#define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata)
138#define OMAP15XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1)
135#else 139#else
136#define omap15xx_mcbsp_pdata NULL 140#define omap15xx_mcbsp_pdata NULL
137#define OMAP15XX_MCBSP_PDATA_SZ 0 141#define OMAP15XX_MCBSP_PDATA_SZ 0
142#define OMAP15XX_MCBSP_REG_NUM 0
138#endif 143#endif
139 144
140#ifdef CONFIG_ARCH_OMAP16XX 145#ifdef CONFIG_ARCH_OMAP16XX
@@ -165,28 +170,34 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
165 }, 170 },
166}; 171};
167#define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) 172#define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata)
173#define OMAP16XX_MCBSP_REG_NUM (OMAP_MCBSP_REG_XCERH / sizeof(u16) + 1)
168#else 174#else
169#define omap16xx_mcbsp_pdata NULL 175#define omap16xx_mcbsp_pdata NULL
170#define OMAP16XX_MCBSP_PDATA_SZ 0 176#define OMAP16XX_MCBSP_PDATA_SZ 0
177#define OMAP16XX_MCBSP_REG_NUM 0
171#endif 178#endif
172 179
173int __init omap1_mcbsp_init(void) 180int __init omap1_mcbsp_init(void)
174{ 181{
175 if (cpu_is_omap730()) 182 if (cpu_is_omap7xx()) {
176 omap_mcbsp_count = OMAP730_MCBSP_PDATA_SZ; 183 omap_mcbsp_count = OMAP7XX_MCBSP_PDATA_SZ;
177 if (cpu_is_omap15xx()) 184 omap_mcbsp_cache_size = OMAP7XX_MCBSP_REG_NUM * sizeof(u16);
185 } else if (cpu_is_omap15xx()) {
178 omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ; 186 omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ;
179 if (cpu_is_omap16xx()) 187 omap_mcbsp_cache_size = OMAP15XX_MCBSP_REG_NUM * sizeof(u16);
188 } else if (cpu_is_omap16xx()) {
180 omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ; 189 omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ;
190 omap_mcbsp_cache_size = OMAP16XX_MCBSP_REG_NUM * sizeof(u16);
191 }
181 192
182 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), 193 mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
183 GFP_KERNEL); 194 GFP_KERNEL);
184 if (!mcbsp_ptr) 195 if (!mcbsp_ptr)
185 return -ENOMEM; 196 return -ENOMEM;
186 197
187 if (cpu_is_omap730()) 198 if (cpu_is_omap7xx())
188 omap_mcbsp_register_board_cfg(omap730_mcbsp_pdata, 199 omap_mcbsp_register_board_cfg(omap7xx_mcbsp_pdata,
189 OMAP730_MCBSP_PDATA_SZ); 200 OMAP7XX_MCBSP_PDATA_SZ);
190 201
191 if (cpu_is_omap15xx()) 202 if (cpu_is_omap15xx())
192 omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, 203 omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata,
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index 721e0d9d8b1d..84341377232d 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -29,53 +29,53 @@
29 29
30#include <asm/system.h> 30#include <asm/system.h>
31 31
32#include <mach/mux.h> 32#include <plat/mux.h>
33 33
34#ifdef CONFIG_OMAP_MUX 34#ifdef CONFIG_OMAP_MUX
35 35
36static struct omap_mux_cfg arch_mux_cfg; 36static struct omap_mux_cfg arch_mux_cfg;
37 37
38#ifdef CONFIG_ARCH_OMAP730 38#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
39static struct pin_config __initdata_or_module omap730_pins[] = { 39static struct pin_config __initdata_or_module omap7xx_pins[] = {
40MUX_CFG_730("E2_730_KBR0", 12, 21, 0, 20, 1, 0) 40MUX_CFG_7XX("E2_7XX_KBR0", 12, 21, 0, 20, 1, 0)
41MUX_CFG_730("J7_730_KBR1", 12, 25, 0, 24, 1, 0) 41MUX_CFG_7XX("J7_7XX_KBR1", 12, 25, 0, 24, 1, 0)
42MUX_CFG_730("E1_730_KBR2", 12, 29, 0, 28, 1, 0) 42MUX_CFG_7XX("E1_7XX_KBR2", 12, 29, 0, 28, 1, 0)
43MUX_CFG_730("F3_730_KBR3", 13, 1, 0, 0, 1, 0) 43MUX_CFG_7XX("F3_7XX_KBR3", 13, 1, 0, 0, 1, 0)
44MUX_CFG_730("D2_730_KBR4", 13, 5, 0, 4, 1, 0) 44MUX_CFG_7XX("D2_7XX_KBR4", 13, 5, 0, 4, 1, 0)
45MUX_CFG_730("C2_730_KBC0", 13, 9, 0, 8, 1, 0) 45MUX_CFG_7XX("C2_7XX_KBC0", 13, 9, 0, 8, 1, 0)
46MUX_CFG_730("D3_730_KBC1", 13, 13, 0, 12, 1, 0) 46MUX_CFG_7XX("D3_7XX_KBC1", 13, 13, 0, 12, 1, 0)
47MUX_CFG_730("E4_730_KBC2", 13, 17, 0, 16, 1, 0) 47MUX_CFG_7XX("E4_7XX_KBC2", 13, 17, 0, 16, 1, 0)
48MUX_CFG_730("F4_730_KBC3", 13, 21, 0, 20, 1, 0) 48MUX_CFG_7XX("F4_7XX_KBC3", 13, 21, 0, 20, 1, 0)
49MUX_CFG_730("E3_730_KBC4", 13, 25, 0, 24, 1, 0) 49MUX_CFG_7XX("E3_7XX_KBC4", 13, 25, 0, 24, 1, 0)
50 50
51MUX_CFG_730("AA17_730_USB_DM", 2, 21, 0, 20, 0, 0) 51MUX_CFG_7XX("AA17_7XX_USB_DM", 2, 21, 0, 20, 0, 0)
52MUX_CFG_730("W16_730_USB_PU_EN", 2, 25, 0, 24, 0, 0) 52MUX_CFG_7XX("W16_7XX_USB_PU_EN", 2, 25, 0, 24, 0, 0)
53MUX_CFG_730("W17_730_USB_VBUSI", 2, 29, 0, 28, 0, 0) 53MUX_CFG_7XX("W17_7XX_USB_VBUSI", 2, 29, 6, 28, 1, 0)
54MUX_CFG_7XX("W18_7XX_USB_DMCK_OUT",3, 3, 1, 2, 0, 0)
55MUX_CFG_7XX("W19_7XX_USB_DCRST", 3, 7, 1, 6, 0, 0)
56
57/* MMC Pins */
58MUX_CFG_7XX("MMC_7XX_CMD", 2, 9, 0, 8, 1, 0)
59MUX_CFG_7XX("MMC_7XX_CLK", 2, 13, 0, 12, 1, 0)
60MUX_CFG_7XX("MMC_7XX_DAT0", 2, 17, 0, 16, 1, 0)
61
62/* I2C interface */
63MUX_CFG_7XX("I2C_7XX_SCL", 5, 1, 0, 0, 1, 0)
64MUX_CFG_7XX("I2C_7XX_SDA", 5, 5, 0, 0, 1, 0)
65
66/* SPI pins */
67MUX_CFG_7XX("SPI_7XX_1", 6, 5, 4, 4, 1, 0)
68MUX_CFG_7XX("SPI_7XX_2", 6, 9, 4, 8, 1, 0)
69MUX_CFG_7XX("SPI_7XX_3", 6, 13, 4, 12, 1, 0)
70MUX_CFG_7XX("SPI_7XX_4", 6, 17, 4, 16, 1, 0)
71MUX_CFG_7XX("SPI_7XX_5", 8, 25, 0, 24, 0, 0)
72MUX_CFG_7XX("SPI_7XX_6", 9, 5, 0, 4, 0, 0)
54}; 73};
55#define OMAP730_PINS_SZ ARRAY_SIZE(omap730_pins) 74#define OMAP7XX_PINS_SZ ARRAY_SIZE(omap7xx_pins)
56#else 75#else
57#define omap730_pins NULL 76#define omap7xx_pins NULL
58#define OMAP730_PINS_SZ 0 77#define OMAP7XX_PINS_SZ 0
59#endif /* CONFIG_ARCH_OMAP730 */ 78#endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
60
61#ifdef CONFIG_ARCH_OMAP850
62struct pin_config __initdata_or_module omap850_pins[] = {
63MUX_CFG_850("E2_850_KBR0", 12, 21, 0, 20, 1, 0)
64MUX_CFG_850("J7_850_KBR1", 12, 25, 0, 24, 1, 0)
65MUX_CFG_850("E1_850_KBR2", 12, 29, 0, 28, 1, 0)
66MUX_CFG_850("F3_850_KBR3", 13, 1, 0, 0, 1, 0)
67MUX_CFG_850("D2_850_KBR4", 13, 5, 0, 4, 1, 0)
68MUX_CFG_850("C2_850_KBC0", 13, 9, 0, 8, 1, 0)
69MUX_CFG_850("D3_850_KBC1", 13, 13, 0, 12, 1, 0)
70MUX_CFG_850("E4_850_KBC2", 13, 17, 0, 16, 1, 0)
71MUX_CFG_850("F4_850_KBC3", 13, 21, 0, 20, 1, 0)
72MUX_CFG_850("E3_850_KBC4", 13, 25, 0, 24, 1, 0)
73
74MUX_CFG_850("AA17_850_USB_DM", 2, 21, 0, 20, 0, 0)
75MUX_CFG_850("W16_850_USB_PU_EN", 2, 25, 0, 24, 0, 0)
76MUX_CFG_850("W17_850_USB_VBUSI", 2, 29, 0, 28, 0, 0)
77};
78#endif
79 79
80#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) 80#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
81static struct pin_config __initdata_or_module omap1xxx_pins[] = { 81static struct pin_config __initdata_or_module omap1xxx_pins[] = {
@@ -438,11 +438,6 @@ int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
438 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n", 438 printk(" %s (0x%08x) = 0x%08x -> 0x%08x\n",
439 cfg->pull_name, cfg->pull_reg, pull_orig, pull); 439 cfg->pull_name, cfg->pull_reg, pull_orig, pull);
440 } 440 }
441
442#ifdef CONFIG_ARCH_OMAP850
443 omap_mux_register(omap850_pins, ARRAY_SIZE(omap850_pins));
444#endif
445
446#endif 441#endif
447 442
448#ifdef CONFIG_OMAP_MUX_ERRORS 443#ifdef CONFIG_OMAP_MUX_ERRORS
@@ -454,9 +449,9 @@ int __init_or_module omap1_cfg_reg(const struct pin_config *cfg)
454 449
455int __init omap1_mux_init(void) 450int __init omap1_mux_init(void)
456{ 451{
457 if (cpu_is_omap730()) { 452 if (cpu_is_omap7xx()) {
458 arch_mux_cfg.pins = omap730_pins; 453 arch_mux_cfg.pins = omap7xx_pins;
459 arch_mux_cfg.size = OMAP730_PINS_SZ; 454 arch_mux_cfg.size = OMAP7XX_PINS_SZ;
460 arch_mux_cfg.cfg_reg = omap1_cfg_reg; 455 arch_mux_cfg.cfg_reg = omap1_cfg_reg;
461 } 456 }
462 457
diff --git a/arch/arm/mach-omap1/opp.h b/arch/arm/mach-omap1/opp.h
new file mode 100644
index 000000000000..07074d79adce
--- /dev/null
+++ b/arch/arm/mach-omap1/opp.h
@@ -0,0 +1,28 @@
1/*
2 * linux/arch/arm/mach-omap1/opp.h
3 *
4 * Copyright (C) 2004 - 2005 Nokia corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ARCH_ARM_MACH_OMAP1_OPP_H
14#define __ARCH_ARM_MACH_OMAP1_OPP_H
15
16#include <linux/types.h>
17
18struct mpu_rate {
19 unsigned long rate;
20 unsigned long xtal;
21 unsigned long pll_rate;
22 __u16 ckctl_val;
23 __u16 dpllctl_val;
24};
25
26extern struct mpu_rate omap1_rate_table[];
27
28#endif
diff --git a/arch/arm/mach-omap1/opp_data.c b/arch/arm/mach-omap1/opp_data.c
new file mode 100644
index 000000000000..75a546514994
--- /dev/null
+++ b/arch/arm/mach-omap1/opp_data.c
@@ -0,0 +1,59 @@
1/*
2 * linux/arch/arm/mach-omap1/opp_data.c
3 *
4 * Copyright (C) 2004 - 2005 Nokia corporation
5 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com>
6 * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include "opp.h"
14
15/*-------------------------------------------------------------------------
16 * Omap1 MPU rate table
17 *-------------------------------------------------------------------------*/
18struct mpu_rate omap1_rate_table[] = {
19 /* MPU MHz, xtal MHz, dpll1 MHz, CKCTL, DPLL_CTL
20 * NOTE: Comment order here is different from bits in CKCTL value:
21 * armdiv, dspdiv, dspmmu, tcdiv, perdiv, lcddiv
22 */
23#if defined(CONFIG_OMAP_ARM_216MHZ)
24 { 216000000, 12000000, 216000000, 0x050d, 0x2910 }, /* 1/1/2/2/2/8 */
25#endif
26#if defined(CONFIG_OMAP_ARM_195MHZ)
27 { 195000000, 13000000, 195000000, 0x050e, 0x2790 }, /* 1/1/2/2/4/8 */
28#endif
29#if defined(CONFIG_OMAP_ARM_192MHZ)
30 { 192000000, 19200000, 192000000, 0x050f, 0x2510 }, /* 1/1/2/2/8/8 */
31 { 192000000, 12000000, 192000000, 0x050f, 0x2810 }, /* 1/1/2/2/8/8 */
32 { 96000000, 12000000, 192000000, 0x055f, 0x2810 }, /* 2/2/2/2/8/8 */
33 { 48000000, 12000000, 192000000, 0x0baf, 0x2810 }, /* 4/4/4/8/8/8 */
34 { 24000000, 12000000, 192000000, 0x0fff, 0x2810 }, /* 8/8/8/8/8/8 */
35#endif
36#if defined(CONFIG_OMAP_ARM_182MHZ)
37 { 182000000, 13000000, 182000000, 0x050e, 0x2710 }, /* 1/1/2/2/4/8 */
38#endif
39#if defined(CONFIG_OMAP_ARM_168MHZ)
40 { 168000000, 12000000, 168000000, 0x010f, 0x2710 }, /* 1/1/1/2/8/8 */
41#endif
42#if defined(CONFIG_OMAP_ARM_150MHZ)
43 { 150000000, 12000000, 150000000, 0x010a, 0x2cb0 }, /* 1/1/1/2/4/4 */
44#endif
45#if defined(CONFIG_OMAP_ARM_120MHZ)
46 { 120000000, 12000000, 120000000, 0x010a, 0x2510 }, /* 1/1/1/2/4/4 */
47#endif
48#if defined(CONFIG_OMAP_ARM_96MHZ)
49 { 96000000, 12000000, 96000000, 0x0005, 0x2410 }, /* 1/1/1/1/2/2 */
50#endif
51#if defined(CONFIG_OMAP_ARM_60MHZ)
52 { 60000000, 12000000, 60000000, 0x0005, 0x2290 }, /* 1/1/1/1/2/2 */
53#endif
54#if defined(CONFIG_OMAP_ARM_30MHZ)
55 { 30000000, 12000000, 60000000, 0x0555, 0x2290 }, /* 2/2/2/2/2/2 */
56#endif
57 { 0, 0, 0, 0, 0 },
58};
59
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 5218943c91c0..b1d3f9fade23 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -48,21 +48,21 @@
48#include <asm/mach/time.h> 48#include <asm/mach/time.h>
49#include <asm/mach/irq.h> 49#include <asm/mach/irq.h>
50 50
51#include <mach/cpu.h> 51#include <plat/cpu.h>
52#include <mach/irqs.h> 52#include <mach/irqs.h>
53#include <mach/clock.h> 53#include <plat/clock.h>
54#include <mach/sram.h> 54#include <plat/sram.h>
55#include <mach/tc.h> 55#include <plat/tc.h>
56#include <mach/mux.h> 56#include <plat/mux.h>
57#include <mach/dma.h> 57#include <plat/dma.h>
58#include <mach/dmtimer.h> 58#include <plat/dmtimer.h>
59 59
60#include "pm.h" 60#include "pm.h"
61 61
62static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 62static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];
63static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; 63static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE];
64static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE]; 64static unsigned short ulpd_sleep_save[ULPD_SLEEP_SAVE_SIZE];
65static unsigned int mpui730_sleep_save[MPUI730_SLEEP_SAVE_SIZE]; 65static unsigned int mpui7xx_sleep_save[MPUI7XX_SLEEP_SAVE_SIZE];
66static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE]; 66static unsigned int mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_SIZE];
67static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE]; 67static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];
68 68
@@ -183,9 +183,9 @@ static void omap_pm_wakeup_setup(void)
183 * drivers must still separately call omap_set_gpio_wakeup() to 183 * drivers must still separately call omap_set_gpio_wakeup() to
184 * wake up to a GPIO interrupt. 184 * wake up to a GPIO interrupt.
185 */ 185 */
186 if (cpu_is_omap730()) 186 if (cpu_is_omap7xx())
187 level1_wake = OMAP_IRQ_BIT(INT_730_GPIO_BANK1) | 187 level1_wake = OMAP_IRQ_BIT(INT_7XX_GPIO_BANK1) |
188 OMAP_IRQ_BIT(INT_730_IH2_IRQ); 188 OMAP_IRQ_BIT(INT_7XX_IH2_IRQ);
189 else if (cpu_is_omap15xx()) 189 else if (cpu_is_omap15xx())
190 level1_wake = OMAP_IRQ_BIT(INT_GPIO_BANK1) | 190 level1_wake = OMAP_IRQ_BIT(INT_GPIO_BANK1) |
191 OMAP_IRQ_BIT(INT_1510_IH2_IRQ); 191 OMAP_IRQ_BIT(INT_1510_IH2_IRQ);
@@ -195,10 +195,10 @@ static void omap_pm_wakeup_setup(void)
195 195
196 omap_writel(~level1_wake, OMAP_IH1_MIR); 196 omap_writel(~level1_wake, OMAP_IH1_MIR);
197 197
198 if (cpu_is_omap730()) { 198 if (cpu_is_omap7xx()) {
199 omap_writel(~level2_wake, OMAP_IH2_0_MIR); 199 omap_writel(~level2_wake, OMAP_IH2_0_MIR);
200 omap_writel(~(OMAP_IRQ_BIT(INT_730_WAKE_UP_REQ) | 200 omap_writel(~(OMAP_IRQ_BIT(INT_7XX_WAKE_UP_REQ) |
201 OMAP_IRQ_BIT(INT_730_MPUIO_KEYPAD)), 201 OMAP_IRQ_BIT(INT_7XX_MPUIO_KEYPAD)),
202 OMAP_IH2_1_MIR); 202 OMAP_IH2_1_MIR);
203 } else if (cpu_is_omap15xx()) { 203 } else if (cpu_is_omap15xx()) {
204 level2_wake |= OMAP_IRQ_BIT(INT_KEYBOARD); 204 level2_wake |= OMAP_IRQ_BIT(INT_KEYBOARD);
@@ -253,15 +253,15 @@ void omap1_pm_suspend(void)
253 * Save interrupt, MPUI, ARM and UPLD control registers. 253 * Save interrupt, MPUI, ARM and UPLD control registers.
254 */ 254 */
255 255
256 if (cpu_is_omap730()) { 256 if (cpu_is_omap7xx()) {
257 MPUI730_SAVE(OMAP_IH1_MIR); 257 MPUI7XX_SAVE(OMAP_IH1_MIR);
258 MPUI730_SAVE(OMAP_IH2_0_MIR); 258 MPUI7XX_SAVE(OMAP_IH2_0_MIR);
259 MPUI730_SAVE(OMAP_IH2_1_MIR); 259 MPUI7XX_SAVE(OMAP_IH2_1_MIR);
260 MPUI730_SAVE(MPUI_CTRL); 260 MPUI7XX_SAVE(MPUI_CTRL);
261 MPUI730_SAVE(MPUI_DSP_BOOT_CONFIG); 261 MPUI7XX_SAVE(MPUI_DSP_BOOT_CONFIG);
262 MPUI730_SAVE(MPUI_DSP_API_CONFIG); 262 MPUI7XX_SAVE(MPUI_DSP_API_CONFIG);
263 MPUI730_SAVE(EMIFS_CONFIG); 263 MPUI7XX_SAVE(EMIFS_CONFIG);
264 MPUI730_SAVE(EMIFF_SDRAM_CONFIG); 264 MPUI7XX_SAVE(EMIFF_SDRAM_CONFIG);
265 265
266 } else if (cpu_is_omap15xx()) { 266 } else if (cpu_is_omap15xx()) {
267 MPUI1510_SAVE(OMAP_IH1_MIR); 267 MPUI1510_SAVE(OMAP_IH1_MIR);
@@ -306,7 +306,7 @@ void omap1_pm_suspend(void)
306 omap_writew(omap_readw(ARM_RSTCT1) & ~(1 << DSP_EN), ARM_RSTCT1); 306 omap_writew(omap_readw(ARM_RSTCT1) & ~(1 << DSP_EN), ARM_RSTCT1);
307 307
308 /* shut down dsp_ck */ 308 /* shut down dsp_ck */
309 if (!cpu_is_omap730()) 309 if (!cpu_is_omap7xx())
310 omap_writew(omap_readw(ARM_CKCTL) & ~(1 << EN_DSPCK), ARM_CKCTL); 310 omap_writew(omap_readw(ARM_CKCTL) & ~(1 << EN_DSPCK), ARM_CKCTL);
311 311
312 /* temporarily enabling api_ck to access DSP registers */ 312 /* temporarily enabling api_ck to access DSP registers */
@@ -383,12 +383,12 @@ void omap1_pm_suspend(void)
383 ULPD_RESTORE(ULPD_CLOCK_CTRL); 383 ULPD_RESTORE(ULPD_CLOCK_CTRL);
384 ULPD_RESTORE(ULPD_STATUS_REQ); 384 ULPD_RESTORE(ULPD_STATUS_REQ);
385 385
386 if (cpu_is_omap730()) { 386 if (cpu_is_omap7xx()) {
387 MPUI730_RESTORE(EMIFS_CONFIG); 387 MPUI7XX_RESTORE(EMIFS_CONFIG);
388 MPUI730_RESTORE(EMIFF_SDRAM_CONFIG); 388 MPUI7XX_RESTORE(EMIFF_SDRAM_CONFIG);
389 MPUI730_RESTORE(OMAP_IH1_MIR); 389 MPUI7XX_RESTORE(OMAP_IH1_MIR);
390 MPUI730_RESTORE(OMAP_IH2_0_MIR); 390 MPUI7XX_RESTORE(OMAP_IH2_0_MIR);
391 MPUI730_RESTORE(OMAP_IH2_1_MIR); 391 MPUI7XX_RESTORE(OMAP_IH2_1_MIR);
392 } else if (cpu_is_omap15xx()) { 392 } else if (cpu_is_omap15xx()) {
393 MPUI1510_RESTORE(MPUI_CTRL); 393 MPUI1510_RESTORE(MPUI_CTRL);
394 MPUI1510_RESTORE(MPUI_DSP_BOOT_CONFIG); 394 MPUI1510_RESTORE(MPUI_DSP_BOOT_CONFIG);
@@ -461,13 +461,13 @@ static int omap_pm_read_proc(
461 ULPD_SAVE(ULPD_DPLL_CTRL); 461 ULPD_SAVE(ULPD_DPLL_CTRL);
462 ULPD_SAVE(ULPD_POWER_CTRL); 462 ULPD_SAVE(ULPD_POWER_CTRL);
463 463
464 if (cpu_is_omap730()) { 464 if (cpu_is_omap7xx()) {
465 MPUI730_SAVE(MPUI_CTRL); 465 MPUI7XX_SAVE(MPUI_CTRL);
466 MPUI730_SAVE(MPUI_DSP_STATUS); 466 MPUI7XX_SAVE(MPUI_DSP_STATUS);
467 MPUI730_SAVE(MPUI_DSP_BOOT_CONFIG); 467 MPUI7XX_SAVE(MPUI_DSP_BOOT_CONFIG);
468 MPUI730_SAVE(MPUI_DSP_API_CONFIG); 468 MPUI7XX_SAVE(MPUI_DSP_API_CONFIG);
469 MPUI730_SAVE(EMIFF_SDRAM_CONFIG); 469 MPUI7XX_SAVE(EMIFF_SDRAM_CONFIG);
470 MPUI730_SAVE(EMIFS_CONFIG); 470 MPUI7XX_SAVE(EMIFS_CONFIG);
471 } else if (cpu_is_omap15xx()) { 471 } else if (cpu_is_omap15xx()) {
472 MPUI1510_SAVE(MPUI_CTRL); 472 MPUI1510_SAVE(MPUI_CTRL);
473 MPUI1510_SAVE(MPUI_DSP_STATUS); 473 MPUI1510_SAVE(MPUI_DSP_STATUS);
@@ -517,20 +517,20 @@ static int omap_pm_read_proc(
517 ULPD_SHOW(ULPD_STATUS_REQ), 517 ULPD_SHOW(ULPD_STATUS_REQ),
518 ULPD_SHOW(ULPD_POWER_CTRL)); 518 ULPD_SHOW(ULPD_POWER_CTRL));
519 519
520 if (cpu_is_omap730()) { 520 if (cpu_is_omap7xx()) {
521 my_buffer_offset += sprintf(my_base + my_buffer_offset, 521 my_buffer_offset += sprintf(my_base + my_buffer_offset,
522 "MPUI730_CTRL_REG 0x%-8x \n" 522 "MPUI7XX_CTRL_REG 0x%-8x \n"
523 "MPUI730_DSP_STATUS_REG: 0x%-8x \n" 523 "MPUI7XX_DSP_STATUS_REG: 0x%-8x \n"
524 "MPUI730_DSP_BOOT_CONFIG_REG: 0x%-8x \n" 524 "MPUI7XX_DSP_BOOT_CONFIG_REG: 0x%-8x \n"
525 "MPUI730_DSP_API_CONFIG_REG: 0x%-8x \n" 525 "MPUI7XX_DSP_API_CONFIG_REG: 0x%-8x \n"
526 "MPUI730_SDRAM_CONFIG_REG: 0x%-8x \n" 526 "MPUI7XX_SDRAM_CONFIG_REG: 0x%-8x \n"
527 "MPUI730_EMIFS_CONFIG_REG: 0x%-8x \n", 527 "MPUI7XX_EMIFS_CONFIG_REG: 0x%-8x \n",
528 MPUI730_SHOW(MPUI_CTRL), 528 MPUI7XX_SHOW(MPUI_CTRL),
529 MPUI730_SHOW(MPUI_DSP_STATUS), 529 MPUI7XX_SHOW(MPUI_DSP_STATUS),
530 MPUI730_SHOW(MPUI_DSP_BOOT_CONFIG), 530 MPUI7XX_SHOW(MPUI_DSP_BOOT_CONFIG),
531 MPUI730_SHOW(MPUI_DSP_API_CONFIG), 531 MPUI7XX_SHOW(MPUI_DSP_API_CONFIG),
532 MPUI730_SHOW(EMIFF_SDRAM_CONFIG), 532 MPUI7XX_SHOW(EMIFF_SDRAM_CONFIG),
533 MPUI730_SHOW(EMIFS_CONFIG)); 533 MPUI7XX_SHOW(EMIFS_CONFIG));
534 } else if (cpu_is_omap15xx()) { 534 } else if (cpu_is_omap15xx()) {
535 my_buffer_offset += sprintf(my_base + my_buffer_offset, 535 my_buffer_offset += sprintf(my_base + my_buffer_offset,
536 "MPUI1510_CTRL_REG 0x%-8x \n" 536 "MPUI1510_CTRL_REG 0x%-8x \n"
@@ -668,9 +668,9 @@ static int __init omap_pm_init(void)
668 * These routines need to be in SRAM as that's the only 668 * These routines need to be in SRAM as that's the only
669 * memory the MPU can see when it wakes up. 669 * memory the MPU can see when it wakes up.
670 */ 670 */
671 if (cpu_is_omap730()) { 671 if (cpu_is_omap7xx()) {
672 omap_sram_suspend = omap_sram_push(omap730_cpu_suspend, 672 omap_sram_suspend = omap_sram_push(omap7xx_cpu_suspend,
673 omap730_cpu_suspend_sz); 673 omap7xx_cpu_suspend_sz);
674 } else if (cpu_is_omap15xx()) { 674 } else if (cpu_is_omap15xx()) {
675 omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend, 675 omap_sram_suspend = omap_sram_push(omap1510_cpu_suspend,
676 omap1510_cpu_suspend_sz); 676 omap1510_cpu_suspend_sz);
@@ -686,8 +686,8 @@ static int __init omap_pm_init(void)
686 686
687 pm_idle = omap1_pm_idle; 687 pm_idle = omap1_pm_idle;
688 688
689 if (cpu_is_omap730()) 689 if (cpu_is_omap7xx())
690 setup_irq(INT_730_WAKE_UP_REQ, &omap_wakeup_irq); 690 setup_irq(INT_7XX_WAKE_UP_REQ, &omap_wakeup_irq);
691 else if (cpu_is_omap16xx()) 691 else if (cpu_is_omap16xx())
692 setup_irq(INT_1610_WAKE_UP_REQ, &omap_wakeup_irq); 692 setup_irq(INT_1610_WAKE_UP_REQ, &omap_wakeup_irq);
693 693
@@ -700,8 +700,8 @@ static int __init omap_pm_init(void)
700 omap_writew(ULPD_POWER_CTRL_REG_VAL, ULPD_POWER_CTRL); 700 omap_writew(ULPD_POWER_CTRL_REG_VAL, ULPD_POWER_CTRL);
701 701
702 /* Configure IDLECT3 */ 702 /* Configure IDLECT3 */
703 if (cpu_is_omap730()) 703 if (cpu_is_omap7xx())
704 omap_writel(OMAP730_IDLECT3_VAL, OMAP730_IDLECT3); 704 omap_writel(OMAP7XX_IDLECT3_VAL, OMAP7XX_IDLECT3);
705 else if (cpu_is_omap16xx()) 705 else if (cpu_is_omap16xx())
706 omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3); 706 omap_writel(OMAP1610_IDLECT3_VAL, OMAP1610_IDLECT3);
707 707
diff --git a/arch/arm/mach-omap1/pm.h b/arch/arm/mach-omap1/pm.h
index c4f05bdcf8a6..56a647986ae9 100644
--- a/arch/arm/mach-omap1/pm.h
+++ b/arch/arm/mach-omap1/pm.h
@@ -98,13 +98,14 @@
98#define OMAP1610_IDLECT3 0xfffece24 98#define OMAP1610_IDLECT3 0xfffece24
99#define OMAP1610_IDLE_LOOP_REQUEST 0x0400 99#define OMAP1610_IDLE_LOOP_REQUEST 0x0400
100 100
101#define OMAP730_IDLECT1_SLEEP_VAL 0x16c7 101#define OMAP7XX_IDLECT1_SLEEP_VAL 0x16c7
102#define OMAP730_IDLECT2_SLEEP_VAL 0x09c7 102#define OMAP7XX_IDLECT2_SLEEP_VAL 0x09c7
103#define OMAP730_IDLECT3_VAL 0x3f 103#define OMAP7XX_IDLECT3_VAL 0x3f
104#define OMAP730_IDLECT3 0xfffece24 104#define OMAP7XX_IDLECT3 0xfffece24
105#define OMAP730_IDLE_LOOP_REQUEST 0x0C00 105#define OMAP7XX_IDLE_LOOP_REQUEST 0x0C00
106 106
107#if !defined(CONFIG_ARCH_OMAP730) && \ 107#if !defined(CONFIG_ARCH_OMAP730) && \
108 !defined(CONFIG_ARCH_OMAP850) && \
108 !defined(CONFIG_ARCH_OMAP15XX) && \ 109 !defined(CONFIG_ARCH_OMAP15XX) && \
109 !defined(CONFIG_ARCH_OMAP16XX) 110 !defined(CONFIG_ARCH_OMAP16XX)
110#warning "Power management for this processor not implemented yet" 111#warning "Power management for this processor not implemented yet"
@@ -122,17 +123,17 @@ extern void allow_idle_sleep(void);
122extern void omap1_pm_idle(void); 123extern void omap1_pm_idle(void);
123extern void omap1_pm_suspend(void); 124extern void omap1_pm_suspend(void);
124 125
125extern void omap730_cpu_suspend(unsigned short, unsigned short); 126extern void omap7xx_cpu_suspend(unsigned short, unsigned short);
126extern void omap1510_cpu_suspend(unsigned short, unsigned short); 127extern void omap1510_cpu_suspend(unsigned short, unsigned short);
127extern void omap1610_cpu_suspend(unsigned short, unsigned short); 128extern void omap1610_cpu_suspend(unsigned short, unsigned short);
128extern void omap730_idle_loop_suspend(void); 129extern void omap7xx_idle_loop_suspend(void);
129extern void omap1510_idle_loop_suspend(void); 130extern void omap1510_idle_loop_suspend(void);
130extern void omap1610_idle_loop_suspend(void); 131extern void omap1610_idle_loop_suspend(void);
131 132
132extern unsigned int omap730_cpu_suspend_sz; 133extern unsigned int omap7xx_cpu_suspend_sz;
133extern unsigned int omap1510_cpu_suspend_sz; 134extern unsigned int omap1510_cpu_suspend_sz;
134extern unsigned int omap1610_cpu_suspend_sz; 135extern unsigned int omap1610_cpu_suspend_sz;
135extern unsigned int omap730_idle_loop_suspend_sz; 136extern unsigned int omap7xx_idle_loop_suspend_sz;
136extern unsigned int omap1510_idle_loop_suspend_sz; 137extern unsigned int omap1510_idle_loop_suspend_sz;
137extern unsigned int omap1610_idle_loop_suspend_sz; 138extern unsigned int omap1610_idle_loop_suspend_sz;
138 139
@@ -155,9 +156,9 @@ extern void omap_serial_wake_trigger(int enable);
155#define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) 156#define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x))
156#define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] 157#define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]
157 158
158#define MPUI730_SAVE(x) mpui730_sleep_save[MPUI730_SLEEP_SAVE_##x] = omap_readl(x) 159#define MPUI7XX_SAVE(x) mpui7xx_sleep_save[MPUI7XX_SLEEP_SAVE_##x] = omap_readl(x)
159#define MPUI730_RESTORE(x) omap_writel((mpui730_sleep_save[MPUI730_SLEEP_SAVE_##x]), (x)) 160#define MPUI7XX_RESTORE(x) omap_writel((mpui7xx_sleep_save[MPUI7XX_SLEEP_SAVE_##x]), (x))
160#define MPUI730_SHOW(x) mpui730_sleep_save[MPUI730_SLEEP_SAVE_##x] 161#define MPUI7XX_SHOW(x) mpui7xx_sleep_save[MPUI7XX_SLEEP_SAVE_##x]
161 162
162#define MPUI1510_SAVE(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x] = omap_readl(x) 163#define MPUI1510_SAVE(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x] = omap_readl(x)
163#define MPUI1510_RESTORE(x) omap_writel((mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x]), (x)) 164#define MPUI1510_RESTORE(x) omap_writel((mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x]), (x))
@@ -232,24 +233,24 @@ enum mpui1510_save_state {
232#endif 233#endif
233}; 234};
234 235
235enum mpui730_save_state { 236enum mpui7xx_save_state {
236 MPUI730_SLEEP_SAVE_START = 0, 237 MPUI7XX_SLEEP_SAVE_START = 0,
237 /* 238 /*
238 * MPUI registers 32 bits 239 * MPUI registers 32 bits
239 */ 240 */
240 MPUI730_SLEEP_SAVE_MPUI_CTRL, 241 MPUI7XX_SLEEP_SAVE_MPUI_CTRL,
241 MPUI730_SLEEP_SAVE_MPUI_DSP_BOOT_CONFIG, 242 MPUI7XX_SLEEP_SAVE_MPUI_DSP_BOOT_CONFIG,
242 MPUI730_SLEEP_SAVE_MPUI_DSP_API_CONFIG, 243 MPUI7XX_SLEEP_SAVE_MPUI_DSP_API_CONFIG,
243 MPUI730_SLEEP_SAVE_MPUI_DSP_STATUS, 244 MPUI7XX_SLEEP_SAVE_MPUI_DSP_STATUS,
244 MPUI730_SLEEP_SAVE_EMIFF_SDRAM_CONFIG, 245 MPUI7XX_SLEEP_SAVE_EMIFF_SDRAM_CONFIG,
245 MPUI730_SLEEP_SAVE_EMIFS_CONFIG, 246 MPUI7XX_SLEEP_SAVE_EMIFS_CONFIG,
246 MPUI730_SLEEP_SAVE_OMAP_IH1_MIR, 247 MPUI7XX_SLEEP_SAVE_OMAP_IH1_MIR,
247 MPUI730_SLEEP_SAVE_OMAP_IH2_0_MIR, 248 MPUI7XX_SLEEP_SAVE_OMAP_IH2_0_MIR,
248 MPUI730_SLEEP_SAVE_OMAP_IH2_1_MIR, 249 MPUI7XX_SLEEP_SAVE_OMAP_IH2_1_MIR,
249#if defined(CONFIG_ARCH_OMAP730) 250#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
250 MPUI730_SLEEP_SAVE_SIZE 251 MPUI7XX_SLEEP_SAVE_SIZE
251#else 252#else
252 MPUI730_SLEEP_SAVE_SIZE = 0 253 MPUI7XX_SLEEP_SAVE_SIZE = 0
253#endif 254#endif
254}; 255};
255 256
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c
index d23979bc0fd5..349de90194e3 100644
--- a/arch/arm/mach-omap1/serial.c
+++ b/arch/arm/mach-omap1/serial.c
@@ -22,10 +22,10 @@
22 22
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24 24
25#include <mach/board.h> 25#include <plat/board.h>
26#include <mach/mux.h> 26#include <plat/mux.h>
27#include <mach/gpio.h> 27#include <mach/gpio.h>
28#include <mach/fpga.h> 28#include <plat/fpga.h>
29 29
30static struct clk * uart1_ck; 30static struct clk * uart1_ck;
31static struct clk * uart2_ck; 31static struct clk * uart2_ck;
@@ -64,8 +64,7 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
64 64
65static struct plat_serial8250_port serial_platform_data[] = { 65static struct plat_serial8250_port serial_platform_data[] = {
66 { 66 {
67 .membase = OMAP1_IO_ADDRESS(OMAP_UART1_BASE), 67 .mapbase = OMAP1_UART1_BASE,
68 .mapbase = OMAP_UART1_BASE,
69 .irq = INT_UART1, 68 .irq = INT_UART1,
70 .flags = UPF_BOOT_AUTOCONF, 69 .flags = UPF_BOOT_AUTOCONF,
71 .iotype = UPIO_MEM, 70 .iotype = UPIO_MEM,
@@ -73,8 +72,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
73 .uartclk = OMAP16XX_BASE_BAUD * 16, 72 .uartclk = OMAP16XX_BASE_BAUD * 16,
74 }, 73 },
75 { 74 {
76 .membase = OMAP1_IO_ADDRESS(OMAP_UART2_BASE), 75 .mapbase = OMAP1_UART2_BASE,
77 .mapbase = OMAP_UART2_BASE,
78 .irq = INT_UART2, 76 .irq = INT_UART2,
79 .flags = UPF_BOOT_AUTOCONF, 77 .flags = UPF_BOOT_AUTOCONF,
80 .iotype = UPIO_MEM, 78 .iotype = UPIO_MEM,
@@ -82,8 +80,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
82 .uartclk = OMAP16XX_BASE_BAUD * 16, 80 .uartclk = OMAP16XX_BASE_BAUD * 16,
83 }, 81 },
84 { 82 {
85 .membase = OMAP1_IO_ADDRESS(OMAP_UART3_BASE), 83 .mapbase = OMAP1_UART3_BASE,
86 .mapbase = OMAP_UART3_BASE,
87 .irq = INT_UART3, 84 .irq = INT_UART3,
88 .flags = UPF_BOOT_AUTOCONF, 85 .flags = UPF_BOOT_AUTOCONF,
89 .iotype = UPIO_MEM, 86 .iotype = UPIO_MEM,
@@ -110,18 +107,11 @@ void __init omap_serial_init(void)
110{ 107{
111 int i; 108 int i;
112 109
113 if (cpu_is_omap730()) { 110 if (cpu_is_omap7xx()) {
114 serial_platform_data[0].regshift = 0; 111 serial_platform_data[0].regshift = 0;
115 serial_platform_data[1].regshift = 0; 112 serial_platform_data[1].regshift = 0;
116 serial_platform_data[0].irq = INT_730_UART_MODEM_1; 113 serial_platform_data[0].irq = INT_7XX_UART_MODEM_1;
117 serial_platform_data[1].irq = INT_730_UART_MODEM_IRDA_2; 114 serial_platform_data[1].irq = INT_7XX_UART_MODEM_IRDA_2;
118 }
119
120 if (cpu_is_omap850()) {
121 serial_platform_data[0].regshift = 0;
122 serial_platform_data[1].regshift = 0;
123 serial_platform_data[0].irq = INT_850_UART_MODEM_1;
124 serial_platform_data[1].irq = INT_850_UART_MODEM_IRDA_2;
125 } 115 }
126 116
127 if (cpu_is_omap15xx()) { 117 if (cpu_is_omap15xx()) {
@@ -130,7 +120,15 @@ void __init omap_serial_init(void)
130 serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16; 120 serial_platform_data[2].uartclk = OMAP1510_BASE_BAUD * 16;
131 } 121 }
132 122
133 for (i = 0; i < OMAP_MAX_NR_PORTS; i++) { 123 for (i = 0; i < ARRAY_SIZE(serial_platform_data) - 1; i++) {
124
125 /* Static mapping, never released */
126 serial_platform_data[i].membase =
127 ioremap(serial_platform_data[i].mapbase, SZ_2K);
128 if (!serial_platform_data[i].membase) {
129 printk(KERN_ERR "Could not ioremap uart%i\n", i);
130 continue;
131 }
134 switch (i) { 132 switch (i) {
135 case 0: 133 case 0:
136 uart1_ck = clk_get(NULL, "uart1_ck"); 134 uart1_ck = clk_get(NULL, "uart1_ck");
diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S
index 22e8568339b0..ef771ce8b030 100644
--- a/arch/arm/mach-omap1/sleep.S
+++ b/arch/arm/mach-omap1/sleep.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/mach-omap1/sleep.S 2 * linux/arch/arm/mach-omap1/sleep.S
3 * 3 *
4 * Low-level OMAP730/1510/1610 sleep/wakeUp support 4 * Low-level OMAP7XX/1510/1610 sleep/wakeUp support
5 * 5 *
6 * Initial SA1110 code: 6 * Initial SA1110 code:
7 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com> 7 * Copyright (c) 2001 Cliff Brake <cbrake@accelent.com>
@@ -57,8 +57,8 @@
57 * 57 *
58 */ 58 */
59 59
60#if defined(CONFIG_ARCH_OMAP730) 60#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
61ENTRY(omap730_cpu_suspend) 61ENTRY(omap7xx_cpu_suspend)
62 62
63 @ save registers on stack 63 @ save registers on stack
64 stmfd sp!, {r0 - r12, lr} 64 stmfd sp!, {r0 - r12, lr}
@@ -91,13 +91,13 @@ ENTRY(omap730_cpu_suspend)
91 91
92 @ turn off clock domains 92 @ turn off clock domains
93 @ do not disable PERCK (0x04) 93 @ do not disable PERCK (0x04)
94 mov r5, #OMAP730_IDLECT2_SLEEP_VAL & 0xff 94 mov r5, #OMAP7XX_IDLECT2_SLEEP_VAL & 0xff
95 orr r5, r5, #OMAP730_IDLECT2_SLEEP_VAL & 0xff00 95 orr r5, r5, #OMAP7XX_IDLECT2_SLEEP_VAL & 0xff00
96 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff] 96 strh r5, [r4, #ARM_IDLECT2_ASM_OFFSET & 0xff]
97 97
98 @ request ARM idle 98 @ request ARM idle
99 mov r3, #OMAP730_IDLECT1_SLEEP_VAL & 0xff 99 mov r3, #OMAP7XX_IDLECT1_SLEEP_VAL & 0xff
100 orr r3, r3, #OMAP730_IDLECT1_SLEEP_VAL & 0xff00 100 orr r3, r3, #OMAP7XX_IDLECT1_SLEEP_VAL & 0xff00
101 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff] 101 strh r3, [r4, #ARM_IDLECT1_ASM_OFFSET & 0xff]
102 102
103 @ disable instruction cache 103 @ disable instruction cache
@@ -113,7 +113,7 @@ ENTRY(omap730_cpu_suspend)
113 mov r2, #0 113 mov r2, #0
114 mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt 114 mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt
115/* 115/*
116 * omap730_cpu_suspend()'s resume point. 116 * omap7xx_cpu_suspend()'s resume point.
117 * 117 *
118 * It will just start executing here, so we'll restore stuff from the 118 * It will just start executing here, so we'll restore stuff from the
119 * stack. 119 * stack.
@@ -132,9 +132,9 @@ ENTRY(omap730_cpu_suspend)
132 @ restore regs and return 132 @ restore regs and return
133 ldmfd sp!, {r0 - r12, pc} 133 ldmfd sp!, {r0 - r12, pc}
134 134
135ENTRY(omap730_cpu_suspend_sz) 135ENTRY(omap7xx_cpu_suspend_sz)
136 .word . - omap730_cpu_suspend 136 .word . - omap7xx_cpu_suspend
137#endif /* CONFIG_ARCH_OMAP730 */ 137#endif /* CONFIG_ARCH_OMAP730 || CONFIG_ARCH_OMAP850 */
138 138
139#ifdef CONFIG_ARCH_OMAP15XX 139#ifdef CONFIG_ARCH_OMAP15XX
140ENTRY(omap1510_cpu_suspend) 140ENTRY(omap1510_cpu_suspend)
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index fd3f7396e162..20cfbcc6c60c 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -52,7 +52,7 @@
52#include <asm/irq.h> 52#include <asm/irq.h>
53#include <asm/mach/irq.h> 53#include <asm/mach/irq.h>
54#include <asm/mach/time.h> 54#include <asm/mach/time.h>
55#include <mach/dmtimer.h> 55#include <plat/dmtimer.h>
56 56
57struct sys_timer omap_timer; 57struct sys_timer omap_timer;
58 58
@@ -68,12 +68,6 @@ struct sys_timer omap_timer;
68 * --------------------------------------------------------------------------- 68 * ---------------------------------------------------------------------------
69 */ 69 */
70 70
71#if defined(CONFIG_ARCH_OMAP16XX)
72#define TIMER_32K_SYNCHRONIZED 0xfffbc410
73#else
74#error OMAP 32KHz timer does not currently work on 15XX!
75#endif
76
77/* 16xx specific defines */ 71/* 16xx specific defines */
78#define OMAP1_32K_TIMER_BASE 0xfffb9000 72#define OMAP1_32K_TIMER_BASE 0xfffb9000
79#define OMAP1_32K_TIMER_CR 0x08 73#define OMAP1_32K_TIMER_CR 0x08
@@ -150,15 +144,6 @@ static struct clock_event_device clockevent_32k_timer = {
150 .set_mode = omap_32k_timer_set_mode, 144 .set_mode = omap_32k_timer_set_mode,
151}; 145};
152 146
153/*
154 * The 32KHz synchronized timer is an additional timer on 16xx.
155 * It is always running.
156 */
157static inline unsigned long omap_32k_sync_timer_read(void)
158{
159 return omap_readl(TIMER_32K_SYNCHRONIZED);
160}
161
162static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id) 147static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id)
163{ 148{
164 struct clock_event_device *evt = &clockevent_32k_timer; 149 struct clock_event_device *evt = &clockevent_32k_timer;