2 * linux/arch/arm/mach-at91/board-afeb-9260v1.c
4 * Copyright (C) 2005 SAN People
5 * Copyright (C) 2006 Atmel
6 * Copyright (C) 2008 Sergey Lapin
8 * A custom board designed as open hardware; PCBs and various information
9 * is available at http://groups.google.com/group/arm9fpga-evolution-board/
10 * Subversion repository: svn://194.85.238.22/home/users/george/svn/arm9eb
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <linux/types.h>
28 #include <linux/gpio.h>
29 #include <linux/init.h>
31 #include <linux/module.h>
32 #include <linux/platform_device.h>
33 #include <linux/spi/spi.h>
34 #include <linux/clk.h>
35 #include <linux/dma-mapping.h>
37 #include <mach/hardware.h>
38 #include <asm/setup.h>
39 #include <asm/mach-types.h>
42 #include <asm/mach/arch.h>
43 #include <asm/mach/map.h>
44 #include <asm/mach/irq.h>
46 #include <mach/at91_aic.h>
52 static void __init
afeb9260_init_early(void)
54 /* Initialize processor: 18.432 MHz crystal */
55 at91_initialize(18432000);
61 static struct at91_usbh_data __initdata afeb9260_usbh_data
= {
63 .vbus_pin
= {-EINVAL
, -EINVAL
},
64 .overcurrent_pin
= {-EINVAL
, -EINVAL
},
70 static struct at91_udc_data __initdata afeb9260_udc_data
= {
71 .vbus_pin
= AT91_PIN_PC5
,
72 .pullup_pin
= -EINVAL
, /* pull-up driven by UDC */
80 static struct spi_board_info afeb9260_spi_devices
[] = {
81 { /* DataFlash chip */
82 .modalias
= "mtd_dataflash",
84 .max_speed_hz
= 15 * 1000 * 1000,
91 * MACB Ethernet device
93 static struct macb_platform_data __initdata afeb9260_macb_data
= {
94 .phy_irq_pin
= AT91_PIN_PA9
,
102 static struct mtd_partition __initdata afeb9260_nand_partition
[] = {
104 .name
= "bootloader",
106 .size
= (640 * SZ_1K
),
110 .offset
= MTDPART_OFS_NXTBLK
,
115 .offset
= MTDPART_OFS_NXTBLK
,
116 .size
= MTDPART_SIZ_FULL
,
120 static struct atmel_nand_data __initdata afeb9260_nand_data
= {
123 .rdy_pin
= AT91_PIN_PC13
,
124 .enable_pin
= AT91_PIN_PC14
,
126 .ecc_mode
= NAND_ECC_SOFT
,
127 .parts
= afeb9260_nand_partition
,
128 .num_parts
= ARRAY_SIZE(afeb9260_nand_partition
),
136 static struct mci_platform_data __initdata afeb9260_mci0_data
= {
139 .detect_pin
= AT91_PIN_PC9
,
140 .wp_pin
= AT91_PIN_PC4
,
146 static struct i2c_board_info __initdata afeb9260_i2c_devices
[] = {
148 I2C_BOARD_INFO("tlv320aic23", 0x1a),
150 I2C_BOARD_INFO("fm3130", 0x68),
152 I2C_BOARD_INFO("24c64", 0x50),
157 * IDE (CF True IDE mode)
159 static struct at91_cf_data afeb9260_cf_data
= {
161 .irq_pin
= AT91_PIN_PA6
,
164 .rst_pin
= AT91_PIN_PA7
,
165 .flags
= AT91_CF_TRUE_IDE
,
168 static void __init
afeb9260_board_init(void)
171 /* DBGU on ttyS0. (Rx & Tx only) */
172 at91_register_uart(0, 0, 0);
174 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
175 at91_register_uart(AT91SAM9260_ID_US0
, 1,
176 ATMEL_UART_CTS
| ATMEL_UART_RTS
177 | ATMEL_UART_DTR
| ATMEL_UART_DSR
178 | ATMEL_UART_DCD
| ATMEL_UART_RI
);
180 /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */
181 at91_register_uart(AT91SAM9260_ID_US1
, 2,
182 ATMEL_UART_CTS
| ATMEL_UART_RTS
);
183 at91_add_device_serial();
185 at91_add_device_usbh(&afeb9260_usbh_data
);
187 at91_add_device_udc(&afeb9260_udc_data
);
189 at91_add_device_spi(afeb9260_spi_devices
,
190 ARRAY_SIZE(afeb9260_spi_devices
));
192 at91_add_device_nand(&afeb9260_nand_data
);
194 at91_add_device_eth(&afeb9260_macb_data
);
196 /* Standard function's pin assignments are not
197 * appropriate for us and generic code provide
198 * no API to configure these pins any other way */
199 at91_set_B_periph(AT91_PIN_PA10
, 0); /* ETX2 */
200 at91_set_B_periph(AT91_PIN_PA11
, 0); /* ETX3 */
202 at91_add_device_mci(0, &afeb9260_mci0_data
);
204 at91_add_device_i2c(afeb9260_i2c_devices
,
205 ARRAY_SIZE(afeb9260_i2c_devices
));
207 at91_add_device_ssc(AT91SAM9260_ID_SSC
, ATMEL_SSC_TX
);
209 at91_add_device_cf(&afeb9260_cf_data
);
212 MACHINE_START(AFEB9260
, "Custom afeb9260 board")
213 /* Maintainer: Sergey Lapin <slapin@ossfans.org> */
214 .timer
= &at91sam926x_timer
,
215 .map_io
= at91_map_io
,
216 .handle_irq
= at91_aic_handle_irq
,
217 .init_early
= afeb9260_init_early
,
218 .init_irq
= at91_init_irq_default
,
219 .init_machine
= afeb9260_board_init
,