vserver 1.9.3
[linux-2.6.git] / arch / arm / mach-omap / board-perseus2.c
1 /*
2  * linux/arch/arm/mach-omap/board-perseus2.c
3  *
4  * Modified from board-generic.c
5  *
6  * Original OMAP730 support by Jean Pihet <j-pihet@ti.com>
7  * Updated for 2.6 by Kevin Hilman <kjh@hilman.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  */
13
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/device.h>
17
18 #include <asm/hardware.h>
19 #include <asm/mach-types.h>
20 #include <asm/mach/arch.h>
21 #include <asm/mach/map.h>
22
23 #include <asm/arch/clocks.h>
24 #include <asm/arch/gpio.h>
25 #include <asm/arch/mux.h>
26 #include <asm/arch/fpga.h>
27
28 #include "common.h"
29
30 extern void __init omap_init_time(void);
31
32 void omap_perseus2_init_irq(void)
33 {
34         omap_init_irq();
35 }
36
37 static struct resource smc91x_resources[] = {
38         [0] = {
39                 .start  = H2P2_DBG_FPGA_ETHR_START,     /* Physical */
40                 .end    = H2P2_DBG_FPGA_ETHR_START + SZ_4K,
41                 .flags  = IORESOURCE_MEM,
42         },
43         [1] = {
44                 .start  = INT_730_MPU_EXT_NIRQ,
45                 .end    = 0,
46                 .flags  = IORESOURCE_IRQ,
47         },
48 };
49
50 static struct platform_device smc91x_device = {
51         .name           = "smc91x",
52         .id             = 0,
53         .num_resources  = ARRAY_SIZE(smc91x_resources),
54         .resource       = smc91x_resources,
55 };
56
57 static struct platform_device *devices[] __initdata = {
58         &smc91x_device,
59 };
60
61 static void __init omap_perseus2_init(void)
62 {
63         (void) platform_add_devices(devices, ARRAY_SIZE(devices));
64 }
65
66 /* Only FPGA needs to be mapped here. All others are done with ioremap */
67 static struct map_desc omap_perseus2_io_desc[] __initdata = {
68         {H2P2_DBG_FPGA_BASE, H2P2_DBG_FPGA_START, H2P2_DBG_FPGA_SIZE,
69          MT_DEVICE},
70 };
71
72 static void __init omap_perseus2_map_io(void)
73 {
74         omap_map_io();
75         iotable_init(omap_perseus2_io_desc,
76                      ARRAY_SIZE(omap_perseus2_io_desc));
77
78         /* Early, board-dependent init */
79
80         /*
81          * Hold GSM Reset until needed
82          */
83         omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL);
84
85         /*
86          * UARTs -> done automagically by 8250 driver
87          */
88
89         /*
90          * CSx timings, GPIO Mux ... setup
91          */
92
93         /* Flash: CS0 timings setup */
94         omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0);
95         omap_writel(0x00000088, OMAP730_FLASH_ACFG_0);
96
97         /*
98          * Ethernet support trough the debug board
99          * CS1 timings setup
100          */
101         omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1);
102         omap_writel(0x00000000, OMAP730_FLASH_ACFG_1);
103
104         /*
105          * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
106          * It is used as the Ethernet controller interrupt
107          */
108         omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9);
109 }
110
111 MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
112         MAINTAINER("Kevin Hilman <kjh@hilman.org>")
113         BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000)
114         BOOT_PARAMS(0x10000100)
115         MAPIO(omap_perseus2_map_io)
116         INITIRQ(omap_perseus2_init_irq)
117         INIT_MACHINE(omap_perseus2_init)
118         INITTIME(omap_init_time)
119 MACHINE_END