ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[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  * 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 "common.h"
24
25 void omap_perseus2_init_irq(void)
26 {
27         omap_init_irq();
28 }
29
30 static struct resource smc91x_resources[] = {
31         [0] = {
32                 .start  = OMAP730_FPGA_ETHR_START,      /* Physical */
33                 .end    = OMAP730_FPGA_ETHR_START + SZ_4K,
34                 .flags  = IORESOURCE_MEM,
35         },
36         [1] = {
37                 .start  = 0,
38                 .end    = 0,
39                 .flags  = INT_ETHER,
40         },
41 };
42
43 static struct platform_device smc91x_device = {
44         .name           = "smc91x",
45         .id             = 0,
46         .num_resources  = ARRAY_SIZE(smc91x_resources),
47         .resource       = smc91x_resources,
48 };
49
50 static struct platform_device *devices[] __initdata = {
51         &smc91x_device,
52 };
53
54 static void __init omap_perseus2_init(void)
55 {
56         (void) platform_add_devices(devices, ARRAY_SIZE(devices));
57 }
58
59 /* Only FPGA needs to be mapped here. All others are done with ioremap */
60 static struct map_desc omap_perseus2_io_desc[] __initdata = {
61         {OMAP730_FPGA_BASE, OMAP730_FPGA_START, OMAP730_FPGA_SIZE,
62          MT_DEVICE},
63 };
64
65 static void __init omap_perseus2_map_io(void)
66 {
67         omap_map_io();
68         iotable_init(omap_perseus2_io_desc,
69                      ARRAY_SIZE(omap_perseus2_io_desc));
70
71         /* Early, board-dependent init */
72
73         /*
74          * Hold GSM Reset until needed
75          */
76         omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL);
77
78         /*
79          * UARTs -> done automagically by 8250 driver
80          */
81
82         /*
83          * CSx timings, GPIO Mux ... setup
84          */
85
86         /* Flash: CS0 timings setup */
87         omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0);
88         omap_writel(0x00000088, OMAP730_FLASH_ACFG_0);
89
90         /*
91          * Ethernet support trough the debug board
92          * CS1 timings setup
93          */
94         omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1);
95         omap_writel(0x00000000, OMAP730_FLASH_ACFG_1);
96
97         /*
98          * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
99          * It is used as the Ethernet controller interrupt
100          */
101         omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9);
102 }
103
104 MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
105         MAINTAINER("Kevin Hilman <k-hilman@ti.com>")
106         BOOT_MEM(0x10000000, 0xe0000000, 0xe0000000)
107         BOOT_PARAMS(0x10000100)
108         MAPIO(omap_perseus2_map_io)
109         INITIRQ(omap_perseus2_init_irq)
110         INIT_MACHINE(omap_perseus2_init)
111 MACHINE_END