This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / arm / mach-omap / innovator1510.c
1 /*
2  * linux/arch/arm/mach-omap/innovator1510.c
3  *
4  * Board specific inits for OMAP-1510 Innovator
5  *
6  * Copyright (C) 2001 RidgeRun, Inc.
7  * Author: Greg Lonnon <glonnon@ridgerun.com>
8  *
9  * Copyright (C) 2002 MontaVista Software, Inc.
10  *
11  * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
12  * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License version 2 as
16  * published by the Free Software Foundation.
17  */
18
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/device.h>
22
23 #include <asm/hardware.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26
27 #include <asm/arch/clocks.h>
28 #include <asm/arch/gpio.h>
29 #include <asm/arch/fpga.h>
30
31 #include "common.h"
32
33 extern int omap_gpio_init(void);
34
35 void innovator_init_irq(void)
36 {
37         omap_init_irq();
38         omap_gpio_init();
39         fpga_init_irq();
40 }
41
42 static struct resource smc91x_resources[] = {
43         [0] = {
44                 .start  = OMAP1510P1_FPGA_ETHR_START,   /* Physical */
45                 .end    = OMAP1510P1_FPGA_ETHR_START + 16,
46                 .flags  = IORESOURCE_MEM,
47         },
48         [1] = {
49                 .start  = INT_ETHER,
50                 .end    = INT_ETHER,
51                 .flags  = IORESOURCE_IRQ,
52         },
53 };
54
55 static struct platform_device smc91x_device = {
56         .name           = "smc91x",
57         .id             = 0,
58         .num_resources  = ARRAY_SIZE(smc91x_resources),
59         .resource       = smc91x_resources,
60 };
61
62 static struct platform_device *devices[] __initdata = {
63         &smc91x_device,
64 };
65
66 static void __init innovator_init(void)
67 {
68         if (!machine_is_innovator())
69                 return;
70
71         (void) platform_add_devices(devices, ARRAY_SIZE(devices));
72 }
73
74 /* Only FPGA needs to be mapped here. All others are done with ioremap */
75 static struct map_desc innovator_io_desc[] __initdata = {
76 { OMAP1510P1_FPGA_BASE, OMAP1510P1_FPGA_START, OMAP1510P1_FPGA_SIZE,
77         MT_DEVICE },
78 };
79
80 static void __init innovator_map_io(void)
81 {
82         omap_map_io();
83         iotable_init(innovator_io_desc, ARRAY_SIZE(innovator_io_desc));
84
85         /* Dump the Innovator FPGA rev early - useful info for support. */
86         printk("Innovator FPGA Rev %d.%d Board Rev %d\n",
87                fpga_read(OMAP1510P1_FPGA_REV_HIGH),
88                fpga_read(OMAP1510P1_FPGA_REV_LOW),
89                fpga_read(OMAP1510P1_FPGA_BOARD_REV));
90 }
91
92 MACHINE_START(INNOVATOR, "TI-Innovator/OMAP1510")
93         MAINTAINER("MontaVista Software, Inc.")
94         BOOT_MEM(0x10000000, 0xe0000000, 0xe0000000)
95         BOOT_PARAMS(0x10000100)
96         MAPIO(innovator_map_io)
97         INITIRQ(innovator_init_irq)
98         INIT_MACHINE(innovator_init)
99 MACHINE_END