ARM: at91: at91 based machines specify their own irq handler at run time
[deliverable/linux.git] / arch / arm / mach-at91 / board-ecbat91.c
CommitLineData
2f036ac6
AV
1/*
2 * linux/arch/arm/mach-at91rm9200/board-ecbat91.c
3 * Copyright (C) 2007 emQbit.com.
4 *
5 * We started from board-dk.c, which is Copyright (C) 2005 SAN People.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#include <linux/types.h>
2f8163ba 23#include <linux/gpio.h>
2f036ac6
AV
24#include <linux/init.h>
25#include <linux/mm.h>
26#include <linux/module.h>
27#include <linux/platform_device.h>
28#include <linux/spi/spi.h>
29#include <linux/spi/flash.h>
30
a09e64fb 31#include <mach/hardware.h>
2f036ac6
AV
32#include <asm/setup.h>
33#include <asm/mach-types.h>
34#include <asm/irq.h>
35
36#include <asm/mach/arch.h>
37#include <asm/mach/map.h>
38#include <asm/mach/irq.h>
39
a09e64fb 40#include <mach/board.h>
e57556e3 41#include <mach/cpu.h>
3e135466 42#include <mach/at91_aic.h>
2f036ac6
AV
43
44#include "generic.h"
45
46
1b021a3b 47static void __init ecb_at91init_early(void)
2f036ac6 48{
e57556e3
JCPV
49 /* Set cpu type: PQFP */
50 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
51
2f036ac6 52 /* Initialize processor: 18.432 MHz crystal */
21d08b9d 53 at91_initialize(18432000);
2f036ac6
AV
54}
55
84e0cdb0 56static struct macb_platform_data __initdata ecb_at91eth_data = {
2f036ac6
AV
57 .phy_irq_pin = AT91_PIN_PC4,
58 .is_rmii = 0,
59};
60
61static struct at91_usbh_data __initdata ecb_at91usbh_data = {
62 .ports = 1,
63b4c296
JCPV
63 .vbus_pin = {-EINVAL, -EINVAL},
64 .overcurrent_pin= {-EINVAL, -EINVAL},
2f036ac6
AV
65};
66
67static struct at91_mmc_data __initdata ecb_at91mmc_data = {
68 .slot_b = 0,
69 .wire4 = 1,
63b4c296
JCPV
70 .det_pin = -EINVAL,
71 .wp_pin = -EINVAL,
72 .vcc_pin = -EINVAL,
2f036ac6
AV
73};
74
75
76#if defined(CONFIG_MTD_DATAFLASH)
77static struct mtd_partition __initdata my_flash0_partitions[] =
78{
79 { /* 0x8400 */
80 .name = "Darrell-loader",
81 .offset = 0,
e505240b 82 .size = 12 * 1056,
2f036ac6
AV
83 },
84 {
85 .name = "U-boot",
86 .offset = MTDPART_OFS_NXTBLK,
87 .size = 110 * 1056,
88 },
89 { /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
90 .name = "UBoot-env",
91 .offset = MTDPART_OFS_NXTBLK,
92 .size = 8 * 1056,
93 },
94 { /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
95 .name = "Kernel",
96 .offset = MTDPART_OFS_NXTBLK,
97 .size = 1534 * 1056,
98 },
99 { /* 190200 - jffs2 root filesystem */
100 .name = "Filesystem",
101 .offset = MTDPART_OFS_NXTBLK,
102 .size = MTDPART_SIZ_FULL, /* 26 sectors */
103 }
104};
105
106static struct flash_platform_data __initdata my_flash0_platform = {
107 .name = "Removable flash card",
108 .parts = my_flash0_partitions,
109 .nr_parts = ARRAY_SIZE(my_flash0_partitions)
110};
111
112#endif
113
114static struct spi_board_info __initdata ecb_at91spi_devices[] = {
115 { /* DataFlash chip */
116 .modalias = "mtd_dataflash",
117 .chip_select = 0,
118 .max_speed_hz = 10 * 1000 * 1000,
119 .bus_num = 0,
120#if defined(CONFIG_MTD_DATAFLASH)
121 .platform_data = &my_flash0_platform,
122#endif
123 },
b595076a 124 { /* User accessible spi - cs1 (250KHz) */
2f036ac6
AV
125 .modalias = "spi-cs1",
126 .chip_select = 1,
127 .max_speed_hz = 250 * 1000,
128 },
b595076a 129 { /* User accessible spi - cs2 (1MHz) */
2f036ac6
AV
130 .modalias = "spi-cs2",
131 .chip_select = 2,
132 .max_speed_hz = 1 * 1000 * 1000,
133 },
b595076a 134 { /* User accessible spi - cs3 (10MHz) */
2f036ac6
AV
135 .modalias = "spi-cs3",
136 .chip_select = 3,
137 .max_speed_hz = 10 * 1000 * 1000,
138 },
139};
140
141static void __init ecb_at91board_init(void)
142{
7eb1dbb3
JCPV
143 /* Setup the LEDs */
144 at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7);
145
2f036ac6 146 /* Serial */
71b149b3
JCPV
147 /* DBGU on ttyS0. (Rx & Tx only) */
148 at91_register_uart(0, 0, 0);
149
150 /* USART0 on ttyS1. (Rx & Tx only) */
151 at91_register_uart(AT91RM9200_ID_US0, 1, 0);
2f036ac6
AV
152 at91_add_device_serial();
153
154 /* Ethernet */
155 at91_add_device_eth(&ecb_at91eth_data);
156
157 /* USB Host */
158 at91_add_device_usbh(&ecb_at91usbh_data);
159
160 /* I2C */
161 at91_add_device_i2c(NULL, 0);
162
163 /* MMC */
164 at91_add_device_mmc(0, &ecb_at91mmc_data);
165
166 /* SPI */
167 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
168}
169
170MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
171 /* Maintainer: emQbit.com */
2f036ac6 172 .timer = &at91rm9200_timer,
21d08b9d 173 .map_io = at91_map_io,
3e135466 174 .handle_irq = at91_aic_handle_irq,
1b021a3b 175 .init_early = ecb_at91init_early,
92100c12 176 .init_irq = at91_init_irq_default,
2f036ac6
AV
177 .init_machine = ecb_at91board_init,
178MACHINE_END
This page took 0.346389 seconds and 5 git commands to generate.