AT91: Added a generic way to setup AT91 serial ports in Kconfig
[linux-2.6/pdupreez.git] / arch / arm / mach-at91 / board-ecbat91.c
blob68dff6b7f6e4b9838d993ba890aaf7190e8901e4
1 /*
2 * linux/arch/arm/mach-at91rm9200/board-ecbat91.c
3 * Copyright (C) 2007 emQbit.com.
5 * We started from board-dk.c, which is Copyright (C) 2005 SAN People.
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.
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.
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
22 #include <linux/types.h>
23 #include <linux/init.h>
24 #include <linux/mm.h>
25 #include <linux/module.h>
26 #include <linux/platform_device.h>
27 #include <linux/spi/spi.h>
28 #include <linux/spi/flash.h>
30 #include <mach/hardware.h>
31 #include <asm/setup.h>
32 #include <asm/mach-types.h>
33 #include <asm/irq.h>
35 #include <asm/mach/arch.h>
36 #include <asm/mach/map.h>
37 #include <asm/mach/irq.h>
39 #include <mach/board.h>
40 #include <mach/gpio.h>
42 #include "generic.h"
45 static void __init ecb_at91map_io(void)
47 /* Initialize processor: 18.432 MHz crystal */
48 at91rm9200_initialize(18432000, AT91RM9200_PQFP);
50 /* Setup the LEDs */
51 at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7);
53 /* Setup the serial ports and console */
54 at91_init_uarts();
57 static void __init ecb_at91init_irq(void)
59 at91rm9200_init_interrupts(NULL);
62 static struct at91_eth_data __initdata ecb_at91eth_data = {
63 .phy_irq_pin = AT91_PIN_PC4,
64 .is_rmii = 0,
67 static struct at91_usbh_data __initdata ecb_at91usbh_data = {
68 .ports = 1,
71 static struct at91_mmc_data __initdata ecb_at91mmc_data = {
72 .slot_b = 0,
73 .wire4 = 1,
77 #if defined(CONFIG_MTD_DATAFLASH)
78 static struct mtd_partition __initdata my_flash0_partitions[] =
80 { /* 0x8400 */
81 .name = "Darrell-loader",
82 .offset = 0,
83 .size = 12* 1056,
86 .name = "U-boot",
87 .offset = MTDPART_OFS_NXTBLK,
88 .size = 110 * 1056,
90 { /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
91 .name = "UBoot-env",
92 .offset = MTDPART_OFS_NXTBLK,
93 .size = 8 * 1056,
95 { /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
96 .name = "Kernel",
97 .offset = MTDPART_OFS_NXTBLK,
98 .size = 1534 * 1056,
100 { /* 190200 - jffs2 root filesystem */
101 .name = "Filesystem",
102 .offset = MTDPART_OFS_NXTBLK,
103 .size = MTDPART_SIZ_FULL, /* 26 sectors */
107 static struct flash_platform_data __initdata my_flash0_platform = {
108 .name = "Removable flash card",
109 .parts = my_flash0_partitions,
110 .nr_parts = ARRAY_SIZE(my_flash0_partitions)
113 #endif
115 static struct spi_board_info __initdata ecb_at91spi_devices[] = {
116 { /* DataFlash chip */
117 .modalias = "mtd_dataflash",
118 .chip_select = 0,
119 .max_speed_hz = 10 * 1000 * 1000,
120 .bus_num = 0,
121 #if defined(CONFIG_MTD_DATAFLASH)
122 .platform_data = &my_flash0_platform,
123 #endif
125 { /* User accessable spi - cs1 (250KHz) */
126 .modalias = "spi-cs1",
127 .chip_select = 1,
128 .max_speed_hz = 250 * 1000,
130 { /* User accessable spi - cs2 (1MHz) */
131 .modalias = "spi-cs2",
132 .chip_select = 2,
133 .max_speed_hz = 1 * 1000 * 1000,
135 { /* User accessable spi - cs3 (10MHz) */
136 .modalias = "spi-cs3",
137 .chip_select = 3,
138 .max_speed_hz = 10 * 1000 * 1000,
142 static void __init ecb_at91board_init(void)
144 /* Serial */
145 at91_add_device_serial();
147 /* Ethernet */
148 at91_add_device_eth(&ecb_at91eth_data);
150 /* USB Host */
151 at91_add_device_usbh(&ecb_at91usbh_data);
153 /* I2C */
154 at91_add_device_i2c(NULL, 0);
156 /* MMC */
157 at91_add_device_mmc(0, &ecb_at91mmc_data);
159 /* SPI */
160 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
163 MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
164 /* Maintainer: emQbit.com */
165 .phys_io = AT91_BASE_SYS,
166 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
167 .boot_params = AT91_SDRAM_BASE + 0x100,
168 .timer = &at91rm9200_timer,
169 .map_io = ecb_at91map_io,
170 .init_irq = ecb_at91init_irq,
171 .init_machine = ecb_at91board_init,
172 MACHINE_END