This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / arm / mach-omap / omap-perseus2.c
1 /*
2  * linux/arch/arm/mach-omap/omap-perseus2.c
3  *
4  * Modified from omap-generic.c
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 version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/device.h>
14
15 #include <asm/hardware.h>
16 #include <asm/mach/arch.h>
17 #include <asm/mach/map.h>
18
19 #include <asm/arch/clocks.h>
20 #include <asm/arch/gpio.h>
21 #include <asm/arch/mux.h>
22
23 #include <asm/arch/omap-perseus2.h>
24
25 #include "common.h"
26
27 void omap_perseus2_init_irq(void)
28 {
29         omap_init_irq();
30 }
31
32 static struct resource smc91x_resources[] = {
33         [0] = {
34                 .start  = OMAP730_FPGA_ETHR_START,      /* Physical */
35                 .end    = OMAP730_FPGA_ETHR_START + SZ_4K,
36                 .flags  = IORESOURCE_MEM,
37         },
38         [1] = {
39                 .start  = 0,
40                 .end    = 0,
41                 .flags  = INT_ETHER,
42         },
43 };
44
45 static struct platform_device smc91x_device = {
46         .name           = "smc91x",
47         .id             = 0,
48         .num_resources  = ARRAY_SIZE(smc91x_resources),
49         .resource       = smc91x_resources,
50 };
51
52 static struct platform_device *devices[] __initdata = {
53         &smc91x_device,
54 };
55
56 static void __init omap_perseus2_init(void)
57 {
58         if (!machine_is_omap_perseus2())
59                 return;
60
61         (void) platform_add_devices(devices, ARRAY_SIZE(devices));
62 }
63
64 /* Only FPGA needs to be mapped here. All others are done with ioremap */
65 static struct map_desc omap_perseus2_io_desc[] __initdata = {
66         {OMAP730_FPGA_BASE, OMAP730_FPGA_START, OMAP730_FPGA_SIZE,
67          MT_DEVICE},
68 };
69
70 static void __init omap_perseus2_map_io(void)
71 {
72         omap_map_io();
73         iotable_init(omap_perseus2_io_desc,
74                      ARRAY_SIZE(omap_perseus2_io_desc));
75
76         /* Early, board-dependent init */
77
78         /*
79          * Hold GSM Reset until needed
80          */
81         *DSP_M_CTL &= ~1;
82
83         /*
84          * UARTs -> done automagically by 8250 driver
85          */
86
87         /*
88          * CSx timings, GPIO Mux ... setup
89          */
90
91         /* Flash: CS0 timings setup */
92         *((volatile __u32 *) OMAP_FLASH_CFG_0) = 0x0000fff3;
93         *((volatile __u32 *) OMAP_FLASH_ACFG_0) = 0x00000088;
94
95         /*
96          * Ethernet support trough the debug board
97          * CS1 timings setup
98          */
99         *((volatile __u32 *) OMAP_FLASH_CFG_1) = 0x0000fff3;
100         *((volatile __u32 *) OMAP_FLASH_ACFG_1) = 0x00000000;
101
102         /*
103          * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
104          * It is used as the Ethernet controller interrupt
105          */
106         *((volatile __u32 *) PERSEUS2_IO_CONF_9) &= 0x1FFFFFFF;
107 }
108
109 MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
110         MAINTAINER("Kevin Hilman <k-hilman@ti.com>")
111         BOOT_MEM(0x10000000, 0xe0000000, 0xe0000000)
112         BOOT_PARAMS(0x10000100)
113         MAPIO(omap_perseus2_map_io)
114         INITIRQ(omap_perseus2_init_irq)
115         INIT_MACHINE(omap_perseus2_init)
116 MACHINE_END