]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap1/board-h3.c
a4a14cd27242c53f16b3e39b0d10637e977bb7cb
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap1 / board-h3.c
1 /*
2  * linux/arch/arm/mach-omap1/board-h3.c
3  *
4  * This file contains OMAP1710 H3 specific code.
5  *
6  * Copyright (C) 2004 Texas Instruments, Inc.
7  * Copyright (C) 2002 MontaVista Software, Inc.
8  * Copyright (C) 2001 RidgeRun, Inc.
9  * Author: RidgeRun, Inc.
10  *         Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License version 2 as
14  * published by the Free Software Foundation.
15  */
16
17 #include <linux/types.h>
18 #include <linux/init.h>
19 #include <linux/major.h>
20 #include <linux/kernel.h>
21 #include <linux/platform_device.h>
22 #include <linux/errno.h>
23 #include <linux/workqueue.h>
24 #include <linux/i2c.h>
25 #include <linux/mtd/mtd.h>
26 #include <linux/mtd/nand.h>
27 #include <linux/mtd/partitions.h>
28 #include <linux/input.h>
29 #include <linux/clk.h>
30
31 #include <linux/i2c/tps65010.h>
32 #include <linux/i2c/pcf857x.h>
33
34 #include <linux/spi/spi.h>
35 #include <linux/spi/tsc210x.h>
36
37 #include <asm/setup.h>
38 #include <asm/page.h>
39 #include <mach/hardware.h>
40 #include <asm/gpio.h>
41
42 #include <asm/mach-types.h>
43 #include <asm/mach/arch.h>
44 #include <asm/mach/flash.h>
45 #include <asm/mach/map.h>
46
47 #include <media/v4l2-int-device.h>
48
49 #include <mach/gpio.h>
50 #include <mach/gpio-switch.h>
51 #include <mach/irqs.h>
52 #include <mach/mux.h>
53 #include <mach/tc.h>
54 #include <mach/nand.h>
55 #include <mach/irda.h>
56 #include <mach/usb.h>
57 #include <mach/keypad.h>
58 #include <mach/dma.h>
59 #include <mach/common.h>
60
61 #define H3_TS_GPIO      48
62
63 static int h3_keymap[] = {
64         KEY(0, 0, KEY_LEFT),
65         KEY(0, 1, KEY_RIGHT),
66         KEY(0, 2, KEY_3),
67         KEY(0, 3, KEY_F10),
68         KEY(0, 4, KEY_F5),
69         KEY(0, 5, KEY_9),
70         KEY(1, 0, KEY_DOWN),
71         KEY(1, 1, KEY_UP),
72         KEY(1, 2, KEY_2),
73         KEY(1, 3, KEY_F9),
74         KEY(1, 4, KEY_F7),
75         KEY(1, 5, KEY_0),
76         KEY(2, 0, KEY_ENTER),
77         KEY(2, 1, KEY_6),
78         KEY(2, 2, KEY_1),
79         KEY(2, 3, KEY_F2),
80         KEY(2, 4, KEY_F6),
81         KEY(2, 5, KEY_HOME),
82         KEY(3, 0, KEY_8),
83         KEY(3, 1, KEY_5),
84         KEY(3, 2, KEY_F12),
85         KEY(3, 3, KEY_F3),
86         KEY(3, 4, KEY_F8),
87         KEY(3, 5, KEY_END),
88         KEY(4, 0, KEY_7),
89         KEY(4, 1, KEY_4),
90         KEY(4, 2, KEY_F11),
91         KEY(4, 3, KEY_F1),
92         KEY(4, 4, KEY_F4),
93         KEY(4, 5, KEY_ESC),
94         KEY(5, 0, KEY_F13),
95         KEY(5, 1, KEY_F14),
96         KEY(5, 2, KEY_F15),
97         KEY(5, 3, KEY_F16),
98         KEY(5, 4, KEY_SLEEP),
99         0
100 };
101
102
103 static struct mtd_partition nor_partitions[] = {
104         /* bootloader (U-Boot, etc) in first sector */
105         {
106               .name             = "bootloader",
107               .offset           = 0,
108               .size             = SZ_128K,
109               .mask_flags       = MTD_WRITEABLE, /* force read-only */
110         },
111         /* bootloader params in the next sector */
112         {
113               .name             = "params",
114               .offset           = MTDPART_OFS_APPEND,
115               .size             = SZ_128K,
116               .mask_flags       = 0,
117         },
118         /* kernel */
119         {
120               .name             = "kernel",
121               .offset           = MTDPART_OFS_APPEND,
122               .size             = SZ_2M,
123               .mask_flags       = 0
124         },
125         /* file system */
126         {
127               .name             = "filesystem",
128               .offset           = MTDPART_OFS_APPEND,
129               .size             = MTDPART_SIZ_FULL,
130               .mask_flags       = 0
131         }
132 };
133
134 static struct flash_platform_data nor_data = {
135         .map_name       = "cfi_probe",
136         .width          = 2,
137         .parts          = nor_partitions,
138         .nr_parts       = ARRAY_SIZE(nor_partitions),
139 };
140
141 static struct resource nor_resource = {
142         /* This is on CS3, wherever it's mapped */
143         .flags          = IORESOURCE_MEM,
144 };
145
146 static struct platform_device nor_device = {
147         .name           = "omapflash",
148         .id             = 0,
149         .dev            = {
150                 .platform_data  = &nor_data,
151         },
152         .num_resources  = 1,
153         .resource       = &nor_resource,
154 };
155
156 static struct mtd_partition nand_partitions[] = {
157 #if 0
158         /* REVISIT: enable these partitions if you make NAND BOOT work */
159         {
160                 .name           = "xloader",
161                 .offset         = 0,
162                 .size           = 64 * 1024,
163                 .mask_flags     = MTD_WRITEABLE,        /* force read-only */
164         },
165         {
166                 .name           = "bootloader",
167                 .offset         = MTDPART_OFS_APPEND,
168                 .size           = 256 * 1024,
169                 .mask_flags     = MTD_WRITEABLE,        /* force read-only */
170         },
171         {
172                 .name           = "params",
173                 .offset         = MTDPART_OFS_APPEND,
174                 .size           = 192 * 1024,
175         },
176         {
177                 .name           = "kernel",
178                 .offset         = MTDPART_OFS_APPEND,
179                 .size           = 2 * SZ_1M,
180         },
181 #endif
182         {
183                 .name           = "filesystem",
184                 .size           = MTDPART_SIZ_FULL,
185                 .offset         = MTDPART_OFS_APPEND,
186         },
187 };
188
189 /* dip switches control NAND chip access:  8 bit, 16 bit, or neither */
190 static struct omap_nand_platform_data nand_data = {
191         .options        = NAND_SAMSUNG_LP_OPTIONS,
192         .parts          = nand_partitions,
193         .nr_parts       = ARRAY_SIZE(nand_partitions),
194 };
195
196 static struct resource nand_resource = {
197         .flags          = IORESOURCE_MEM,
198 };
199
200 static struct platform_device nand_device = {
201         .name           = "omapnand",
202         .id             = 0,
203         .dev            = {
204                 .platform_data  = &nand_data,
205         },
206         .num_resources  = 1,
207         .resource       = &nand_resource,
208 };
209
210 static struct resource smc91x_resources[] = {
211         [0] = {
212                 .start  = OMAP1710_ETHR_START,          /* Physical */
213                 .end    = OMAP1710_ETHR_START + 0xf,
214                 .flags  = IORESOURCE_MEM,
215         },
216         [1] = {
217                 .start  = OMAP_GPIO_IRQ(40),
218                 .end    = OMAP_GPIO_IRQ(40),
219                 .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
220         },
221 };
222
223 static struct platform_device smc91x_device = {
224         .name           = "smc91x",
225         .id             = 0,
226         .num_resources  = ARRAY_SIZE(smc91x_resources),
227         .resource       = smc91x_resources,
228 };
229
230 #define GPTIMER_BASE            0xFFFB1400
231 #define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800))
232 #define GPTIMER_REGS_SIZE       0x46
233
234 static struct resource intlat_resources[] = {
235         [0] = {
236                 .start  = GPTIMER_REGS(0),            /* Physical */
237                 .end    = GPTIMER_REGS(0) + GPTIMER_REGS_SIZE,
238                 .flags  = IORESOURCE_MEM,
239         },
240         [1] = {
241                 .start  = INT_1610_GPTIMER1,
242                 .end    = INT_1610_GPTIMER1,
243                 .flags  = IORESOURCE_IRQ,
244         },
245 };
246
247 static struct platform_device intlat_device = {
248         .name      = "omap_intlat",
249         .id          = 0,
250         .num_resources  = ARRAY_SIZE(intlat_resources),
251         .resource       = intlat_resources,
252 };
253
254 static struct resource h3_kp_resources[] = {
255         [0] = {
256                 .start  = INT_KEYBOARD,
257                 .end    = INT_KEYBOARD,
258                 .flags  = IORESOURCE_IRQ,
259         },
260 };
261
262 static struct omap_kp_platform_data h3_kp_data = {
263         .rows           = 8,
264         .cols           = 8,
265         .keymap         = h3_keymap,
266         .keymapsize     = ARRAY_SIZE(h3_keymap),
267         .rep            = 1,
268         .delay          = 9,
269         .dbounce        = 1,
270 };
271
272 static struct platform_device h3_kp_device = {
273         .name           = "omap-keypad",
274         .id             = -1,
275         .dev            = {
276                 .platform_data = &h3_kp_data,
277         },
278         .num_resources  = ARRAY_SIZE(h3_kp_resources),
279         .resource       = h3_kp_resources,
280 };
281
282
283 /* Select between the IrDA and aGPS module
284  */
285
286 static int gpio_irda_enable;
287 static int gpio_irda_x;
288 static int gpio_irda_fir;
289
290 static int h3_select_irda(struct device *dev, int state)
291 {
292         gpio_set_value_cansleep(gpio_irda_enable, state & IR_SEL);
293         return 0;
294 }
295
296 static void set_trans_mode(struct work_struct *work)
297 {
298         struct omap_irda_config *irda_config =
299                 container_of(work, struct omap_irda_config, gpio_expa.work);
300         int mode = irda_config->mode;
301
302         gpio_set_value_cansleep(gpio_irda_x, 1);
303         gpio_set_value_cansleep(gpio_irda_fir, !(mode & IR_SIRMODE));
304 }
305
306 static int h3_transceiver_mode(struct device *dev, int mode)
307 {
308         struct omap_irda_config *irda_config = dev->platform_data;
309
310         irda_config->mode = mode;
311         cancel_delayed_work(&irda_config->gpio_expa);
312         PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode);
313         schedule_delayed_work(&irda_config->gpio_expa, 0);
314
315         return 0;
316 }
317
318 static struct omap_irda_config h3_irda_data = {
319         .transceiver_cap        = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
320         .transceiver_mode       = h3_transceiver_mode,
321         .select_irda            = h3_select_irda,
322         .rx_channel             = OMAP_DMA_UART3_RX,
323         .tx_channel             = OMAP_DMA_UART3_TX,
324         .dest_start             = UART3_THR,
325         .src_start              = UART3_RHR,
326         .tx_trigger             = 0,
327         .rx_trigger             = 0,
328 };
329
330 static struct resource h3_irda_resources[] = {
331         [0] = {
332                 .start  = INT_UART3,
333                 .end    = INT_UART3,
334                 .flags  = IORESOURCE_IRQ,
335         },
336 };
337
338 static u64 irda_dmamask = 0xffffffff;
339
340 static struct platform_device h3_irda_device = {
341         .name           = "omapirda",
342         .id             = 0,
343         .dev            = {
344                 .platform_data  = &h3_irda_data,
345                 .dma_mask       = &irda_dmamask,
346         },
347         .num_resources  = ARRAY_SIZE(h3_irda_resources),
348         .resource       = h3_irda_resources,
349 };
350
351 static struct platform_device h3_lcd_device = {
352         .name           = "lcd_h3",
353         .id             = -1,
354 };
355
356 static struct tsc210x_config tsc_platform_data = {
357         .use_internal           = 1,
358         .monitor                = TSC_VBAT | TSC_TEMP,
359         .mclk                   = "mclk",
360 };
361
362 static struct spi_board_info h3_spi_board_info[] __initdata = {
363         [0] = {
364                 .modalias       = "tsc2101",
365                 .bus_num        = 2,
366                 .chip_select    = 0,
367                 .irq            = OMAP_GPIO_IRQ(H3_TS_GPIO),
368                 .max_speed_hz   = 16000000,
369                 .platform_data  = &tsc_platform_data,
370         },
371 };
372
373 static struct platform_device *devices[] __initdata = {
374         &nor_device,
375         &nand_device,
376         &smc91x_device,
377         &intlat_device,
378         &h3_kp_device,
379         &h3_lcd_device,
380 };
381
382 static struct omap_usb_config h3_usb_config __initdata = {
383         /* usb1 has a Mini-AB port and external isp1301 transceiver */
384         .otg        = 2,
385
386 #ifdef CONFIG_USB_GADGET_OMAP
387         .hmc_mode       = 19,   /* 0:host(off) 1:dev|otg 2:disabled */
388 #elif  defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
389         /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */
390         .hmc_mode       = 20,   /* 1:dev|otg(off) 1:host 2:disabled */
391 #endif
392
393         .pins[1]        = 3,
394 };
395
396 static struct omap_uart_config h3_uart_config __initdata = {
397         .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
398 };
399
400 static struct omap_lcd_config h3_lcd_config __initdata = {
401         .ctrl_name      = "internal",
402 };
403
404 static struct omap_board_config_kernel h3_config[] __initdata = {
405         { OMAP_TAG_USB,         &h3_usb_config },
406         { OMAP_TAG_UART,        &h3_uart_config },
407         { OMAP_TAG_LCD,         &h3_lcd_config },
408 };
409
410 #define H3_NAND_RB_GPIO_PIN     10
411
412 static int nand_dev_ready(struct omap_nand_platform_data *data)
413 {
414         return gpio_get_value(H3_NAND_RB_GPIO_PIN);
415 }
416
417 #if defined(CONFIG_VIDEO_OV9640) || defined(CONFIG_VIDEO_OV9640_MODULE)
418
419 #include <../drivers/media/video/ov9640.h>
420
421 /*
422  * Common OV9640 register initialization for all image sizes, pixel formats,
423  * and frame rates
424  */
425 const static struct ov9640_reg ov9640_common[] = {
426
427         { 0x12, 0x80 }, { 0x11, 0x80 }, { 0x13, 0x88 }, /* COM7, CLKRC, COM8 */
428         { 0x01, 0x58 }, { 0x02, 0x24 }, { 0x04, 0x00 }, /* BLUE, RED, COM1 */
429         { 0x0E, 0x81 }, { 0x0F, 0x4F }, { 0x14, 0xcA }, /* COM5, COM6, COM9 */
430         { 0x16, 0x02 }, { 0x1B, 0x01 }, { 0x24, 0x70 }, /* ?, PSHFT, AEW */
431         { 0x25, 0x68 }, { 0x26, 0xD3 }, { 0x27, 0x90 }, /* AEB, VPT, BBIAS */
432         { 0x2A, 0x00 }, { 0x2B, 0x00 }, { 0x32, 0x24 }, /* EXHCH, EXHCL, HREF */
433         { 0x33, 0x02 }, { 0x37, 0x02 }, { 0x38, 0x13 }, /* CHLF, ADC, ACOM */
434         { 0x39, 0xF0 }, { 0x3A, 0x00 }, { 0x3B, 0x01 }, /* OFON, TSLB, COM11 */
435         { 0x3D, 0x90 }, { 0x3E, 0x02 }, { 0x3F, 0xF2 }, /* COM13, COM14, EDGE */
436         { 0x41, 0x02 }, { 0x42, 0xC8 },         /* COM16, COM17 */
437         { 0x43, 0xF0 }, { 0x44, 0x10 }, { 0x45, 0x6C }, /* ?, ?, ? */
438         { 0x46, 0x6C }, { 0x47, 0x44 }, { 0x48, 0x44 }, /* ?, ?, ? */
439         { 0x49, 0x03 }, { 0x59, 0x49 }, { 0x5A, 0x94 }, /* ?, ?, ? */
440         { 0x5B, 0x46 }, { 0x5C, 0x84 }, { 0x5D, 0x5C }, /* ?, ?, ? */
441         { 0x5E, 0x08 }, { 0x5F, 0x00 }, { 0x60, 0x14 }, /* ?, ?, ? */
442         { 0x61, 0xCE },                                 /* ? */
443         { 0x62, 0x70 }, { 0x63, 0x00 }, { 0x64, 0x04 }, /* LCC1, LCC2, LCC3 */
444         { 0x65, 0x00 }, { 0x66, 0x00 },                 /* LCC4, LCC5 */
445         { 0x69, 0x00 }, { 0x6A, 0x3E }, { 0x6B, 0x3F }, /* HV, MBD, DBLV */
446         { 0x6C, 0x40 }, { 0x6D, 0x30 }, { 0x6E, 0x4B }, /* GSP1, GSP2, GSP3 */
447         { 0x6F, 0x60 }, { 0x70, 0x70 }, { 0x71, 0x70 }, /* GSP4, GSP5, GSP6 */
448         { 0x72, 0x70 }, { 0x73, 0x70 }, { 0x74, 0x60 }, /* GSP7, GSP8, GSP9 */
449         { 0x75, 0x60 }, { 0x76, 0x50 }, { 0x77, 0x48 }, /* GSP10,GSP11,GSP12 */
450         { 0x78, 0x3A }, { 0x79, 0x2E }, { 0x7A, 0x28 }, /* GSP13,GSP14,GSP15 */
451         { 0x7B, 0x22 }, { 0x7C, 0x04 }, { 0x7D, 0x07 }, /* GSP16,GST1, GST2 */
452         { 0x7E, 0x10 }, { 0x7F, 0x28 }, { 0x80, 0x36 }, /* GST3, GST4, GST5 */
453         { 0x81, 0x44 }, { 0x82, 0x52 }, { 0x83, 0x60 }, /* GST6, GST7, GST8 */
454         { 0x84, 0x6C }, { 0x85, 0x78 }, { 0x86, 0x8C }, /* GST9, GST10,GST11 */
455         { 0x87, 0x9E }, { 0x88, 0xBB }, { 0x89, 0xD2 }, /* GST12,GST13,GST14 */
456         { 0x8A, 0xE6 }, { 0x13, 0xaF }, { 0x15, 0x02 }, /* GST15, COM8 */
457         { 0x22, 0x8a }, /* GROS */
458         { OV9640_REG_TERM, OV9640_VAL_TERM }
459 };
460
461 static int ov9640_sensor_power_set(int power)
462 {
463         unsigned char expa;
464         int err;
465
466         /* read current state of GPIO EXPA outputs */
467         err = read_gpio_expa(&expa, 0x27);
468         if (err) {
469                 printk(KERN_ERR "Error reading GPIO EXPA\n");
470                 return err;
471         }
472         /* Clear GPIO EXPA P3 (CAMERA_MODULE_EN) to power-up/down sensor */
473         if (power)
474                 expa |= 0x08;
475         else
476                 expa &= ~0x08;
477
478         err = write_gpio_expa(expa, 0x27);
479         if (err) {
480                 printk(KERN_ERR "Error writing to GPIO EXPA\n");
481                 return err;
482         }
483
484         return err;
485 }
486
487 static struct v4l2_ifparm ifparm = {
488         .if_type = V4L2_IF_TYPE_BT656,
489         .u = {
490                 .bt656 = {
491                          .frame_start_on_rising_vs = 1,
492                          .nobt_vs_inv = 1,
493                          .mode = V4L2_IF_TYPE_BT656_MODE_NOBT_8BIT,
494                          .clock_min = OV9640_XCLK_MIN,
495                          .clock_max = OV9640_XCLK_MAX,
496                  },
497         },
498 };
499
500 static int ov9640_ifparm(struct v4l2_ifparm *p)
501 {
502         *p = ifparm;
503
504         return 0;
505 }
506
507 static struct ov9640_platform_data h3_ov9640_platform_data = {
508         .power_set      = ov9640_sensor_power_set,
509         .default_regs   = ov9640_common,
510         .ifparm         = ov9640_ifparm,
511 };
512 #endif
513
514 static int h3_pcf_setup(struct i2c_client *client, int gpio,
515                 unsigned ngpio, void *context)
516 {
517         int     status;
518
519         /* REVISIT someone with schematics should look up the rest
520          * of these signals, and configure them appropriately ...
521          * camera and audio seem to be involved, too.
522          */
523
524         /* P0 - ? */
525         gpio_irda_x = gpio + 0;
526         status = gpio_request(gpio_irda_x, "irda_x");
527         if (status < 0)
528                 goto done;
529         status = gpio_direction_output(gpio_irda_x, 0);
530         if (status < 0)
531                 goto done;
532
533         /* P1 - set if MIR/FIR */
534         gpio_irda_fir = gpio + 1;
535         status = gpio_request(gpio_irda_fir, "irda_fir");
536         if (status < 0)
537                 goto done;
538         status = gpio_direction_output(gpio_irda_fir, 0);
539         if (status < 0)
540                 goto done;
541
542         /* 'P6' enable/disable IRDA_TX and IRDA_RX ... default, off */
543         gpio_irda_enable = gpio + 6;
544         status = gpio_request(gpio_irda_enable, "irda_enable");
545         if (status < 0)
546                 goto done;
547         status = gpio_direction_output(gpio_irda_enable, 0);
548         if (status < 0)
549                 goto done;
550
551         /* register the IRDA device now that it can be operated */
552         status = platform_device_register(&h3_irda_device);
553
554 done:
555         return status;
556 }
557
558 static struct pcf857x_platform_data h3_pcf_data = {
559         /* assign these GPIO numbers right after the MPUIO lines */
560         .gpio_base      = OMAP_MAX_GPIO_LINES + 16,
561         .setup          = h3_pcf_setup,
562 };
563
564 static struct i2c_board_info __initdata h3_i2c_board_info[] = {
565        {
566                 I2C_BOARD_INFO("pcf8574", 0x27),
567                 .platform_data = &h3_pcf_data,
568        }, {
569                 I2C_BOARD_INFO("tps65013", 0x48),
570                /* .irq         = OMAP_GPIO_IRQ(??), */
571        },
572 #if defined(CONFIG_VIDEO_OV9640) || defined(CONFIG_VIDEO_OV9640_MODULE)
573         {
574                 I2C_BOARD_INFO("ov9640", 0x30),
575                 .platform_data = &h3_ov9640_platform_data,
576         },
577 #endif
578         {
579                 I2C_BOARD_INFO("isp1301_omap", 0x2d),
580                 .irq            = OMAP_GPIO_IRQ(14),
581         },
582 };
583
584 static void __init h3_init(void)
585 {
586         /* Here we assume the NOR boot config:  NOR on CS3 (possibly swapped
587          * to address 0 by a dip switch), NAND on CS2B.  The NAND driver will
588          * notice whether a NAND chip is enabled at probe time.
589          *
590          * H3 support NAND-boot, with a dip switch to put NOR on CS2B and NAND
591          * (which on H2 may be 16bit) on CS3.  Try detecting that in code here,
592          * to avoid probing every possible flash configuration...
593          */
594         nor_resource.end = nor_resource.start = omap_cs3_phys();
595         nor_resource.end += SZ_32M - 1;
596
597         nand_resource.end = nand_resource.start = OMAP_CS2B_PHYS;
598         nand_resource.end += SZ_4K - 1;
599         if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0)
600                 BUG();
601         nand_data.dev_ready = nand_dev_ready;
602
603         /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */
604         /* GPIO10 pullup/down register, Enable pullup on GPIO10 */
605         omap_cfg_reg(V2_1710_GPIO10);
606
607         /* TSC2101 */
608         omap_cfg_reg(W19_1610_GPIO48);
609         gpio_request(H3_TS_GPIO, "tsc_irq");
610         gpio_direction_input(H3_TS_GPIO);
611         omap_cfg_reg(N14_1610_UWIRE_CS0);
612
613         platform_add_devices(devices, ARRAY_SIZE(devices));
614         spi_register_board_info(h3_spi_board_info,
615                                 ARRAY_SIZE(h3_spi_board_info));
616         omap_board_config = h3_config;
617         omap_board_config_size = ARRAY_SIZE(h3_config);
618         omap_serial_init();
619         omap_register_i2c_bus(1, 100, h3_i2c_board_info,
620                               ARRAY_SIZE(h3_i2c_board_info));
621         h3_mmc_init();
622 }
623
624 static void __init h3_init_smc91x(void)
625 {
626         omap_cfg_reg(W15_1710_GPIO40);
627         if (gpio_request(40, "SMC91x irq") < 0) {
628                 printk("Error requesting gpio 40 for smc91x irq\n");
629                 return;
630         }
631 }
632
633 static void __init h3_init_irq(void)
634 {
635         omap1_init_common_hw();
636         omap_init_irq();
637         omap_gpio_init();
638         h3_init_smc91x();
639 }
640
641 static void __init h3_map_io(void)
642 {
643         omap1_map_common_io();
644 }
645
646 MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
647         /* Maintainer: Texas Instruments, Inc. */
648         .phys_io        = 0xfff00000,
649         .io_pg_offst    = ((0xfef00000) >> 18) & 0xfffc,
650         .boot_params    = 0x10000100,
651         .map_io         = h3_map_io,
652         .init_irq       = h3_init_irq,
653         .init_machine   = h3_init,
654         .timer          = &omap_timer,
655 MACHINE_END