vserver 1.9.5.x5
[linux-2.6.git] / arch / arm / mach-omap / board-h3.c
1 /*
2  * linux/arch/arm/mach-omap/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/config.h>
18 #include <linux/types.h>
19 #include <linux/init.h>
20 #include <linux/major.h>
21 #include <linux/kernel.h>
22 #include <linux/device.h>
23 #include <linux/errno.h>
24
25 #include <asm/setup.h>
26 #include <asm/page.h>
27 #include <asm/hardware.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/map.h>
30 #include <asm/arch/irqs.h>
31 #include <asm/arch/mux.h>
32 #include <asm/arch/gpio.h>
33 #include <asm/mach-types.h>
34
35 #include "common.h"
36
37 extern int omap_gpio_init(void);
38
39 static int __initdata h3_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
40
41 static struct resource smc91x_resources[] = {
42         [0] = {
43                 .start  = OMAP1710_ETHR_START,          /* Physical */
44                 .end    = OMAP1710_ETHR_START + OMAP1710_ETHR_SIZE,
45                 .flags  = IORESOURCE_MEM,
46         },
47         [1] = {
48                 .start  = OMAP_GPIO_IRQ(40),
49                 .end    = OMAP_GPIO_IRQ(40),
50                 .flags  = IORESOURCE_IRQ,
51         },
52 };
53
54 static struct platform_device smc91x_device = {
55         .name           = "smc91x",
56         .id             = 0,
57         .num_resources  = ARRAY_SIZE(smc91x_resources),
58         .resource       = smc91x_resources,
59 };
60
61 static struct platform_device *devices[] __initdata = {
62         &smc91x_device,
63 };
64
65 static void __init h3_init(void)
66 {
67         (void) platform_add_devices(devices, ARRAY_SIZE(devices));
68 }
69
70 static void __init h3_init_smc91x(void)
71 {
72         omap_cfg_reg(W15_1710_GPIO40);
73         if (omap_request_gpio(40) < 0) {
74                 printk("Error requesting gpio 40 for smc91x irq\n");
75                 return;
76         }
77         omap_set_gpio_edge_ctrl(40, OMAP_GPIO_FALLING_EDGE);
78 }
79
80 void h3_init_irq(void)
81 {
82         omap_init_irq();
83         omap_gpio_init();
84         h3_init_smc91x();
85 }
86
87 static void __init h3_map_io(void)
88 {
89         omap_map_io();
90         omap_serial_init(h3_serial_ports);
91 }
92
93 MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
94         MAINTAINER("Texas Instruments, Inc.")
95         BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
96         BOOT_PARAMS(0x10000100)
97         MAPIO(h3_map_io)
98         INITIRQ(h3_init_irq)
99         INIT_MACHINE(h3_init)
100         .timer          = &omap_timer,
101 MACHINE_END