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/init.h>
30 #include <linux/module.h>
31 #include <linux/platform_device.h>
32 #include <linux/spi/spi.h>
33 #include <linux/clk.h>
34 #include <linux/dma-mapping.h>
36 #include <mach/hardware.h>
37 #include <asm/setup.h>
38 #include <asm/mach-types.h>
41 #include <asm/mach/arch.h>
42 #include <asm/mach/map.h>
43 #include <asm/mach/irq.h>
45 #include <mach/board.h>
46 #include <mach/gpio.h>
51 static void __init afeb9260_map_io(void)
53 /* Initialize processor: 18.432 MHz crystal */
54 at91sam9260_initialize(18432000);
56 /* DGBU on ttyS0. (Rx & Tx only) */
57 at91_register_uart(0, 0, 0);
59 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
60 at91_register_uart(AT91SAM9260_ID_US0, 1,
61 ATMEL_UART_CTS | ATMEL_UART_RTS
62 | ATMEL_UART_DTR | ATMEL_UART_DSR
63 | ATMEL_UART_DCD | ATMEL_UART_RI);
65 /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */
66 at91_register_uart(AT91SAM9260_ID_US1, 2,
67 ATMEL_UART_CTS | ATMEL_UART_RTS);
69 /* set serial console to ttyS0 (ie, DBGU) */
70 at91_set_serial_console(0);
73 static void __init afeb9260_init_irq(void)
75 at91sam9260_init_interrupts(NULL);
82 static struct at91_usbh_data __initdata afeb9260_usbh_data = {
89 static struct at91_udc_data __initdata afeb9260_udc_data = {
90 .vbus_pin = AT91_PIN_PC5,
91 .pullup_pin = 0, /* pull-up driven by UDC */
99 static struct spi_board_info afeb9260_spi_devices[] = {
100 { /* DataFlash chip */
101 .modalias = "mtd_dataflash",
103 .max_speed_hz = 15 * 1000 * 1000,
110 * MACB Ethernet device
112 static struct at91_eth_data __initdata afeb9260_macb_data = {
113 .phy_irq_pin = AT91_PIN_PA9,
121 static struct mtd_partition __initdata afeb9260_nand_partition[] = {
123 .name = "bootloader",
125 .size = (640 * SZ_1K),
129 .offset = MTDPART_OFS_NXTBLK,
134 .offset = MTDPART_OFS_NXTBLK,
135 .size = MTDPART_SIZ_FULL,
139 static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
141 *num_partitions = ARRAY_SIZE(afeb9260_nand_partition);
142 return afeb9260_nand_partition;
145 static struct atmel_nand_data __initdata afeb9260_nand_data = {
148 .rdy_pin = AT91_PIN_PC13,
149 .enable_pin = AT91_PIN_PC14,
150 .partition_info = nand_partitions,
158 static struct at91_mmc_data __initdata afeb9260_mmc_data = {
165 static struct i2c_board_info __initdata afeb9260_i2c_devices[] = {
167 I2C_BOARD_INFO("fm3130", 0x68),
169 I2C_BOARD_INFO("24c64", 0x50),
173 static void __init afeb9260_board_init(void)
176 at91_add_device_serial();
178 at91_add_device_usbh(&afeb9260_usbh_data);
180 at91_add_device_udc(&afeb9260_udc_data);
182 at91_add_device_spi(afeb9260_spi_devices,
183 ARRAY_SIZE(afeb9260_spi_devices));
185 at91_add_device_nand(&afeb9260_nand_data);
187 at91_add_device_eth(&afeb9260_macb_data);
189 /* Standard function's pin assignments are not
190 * appropriate for us and generic code provide
191 * no API to configure these pins any other way */
192 at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */
193 at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */
195 at91_add_device_mmc(0, &afeb9260_mmc_data);
197 at91_add_device_i2c(afeb9260_i2c_devices,
198 ARRAY_SIZE(afeb9260_i2c_devices));
201 MACHINE_START(AFEB9260, "Custom afeb9260 board")
202 /* Maintainer: Sergey Lapin <slapin@ossfans.org> */
203 .phys_io = AT91_BASE_SYS,
204 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
205 .boot_params = AT91_SDRAM_BASE + 0x100,
206 .timer = &at91sam926x_timer,
207 .map_io = afeb9260_map_io,
208 .init_irq = afeb9260_init_irq,
209 .init_machine = afeb9260_board_init,