2 * linux/arch/arm/mach-at91/board-sam9263ek.c
4 * Copyright (C) 2005 SAN People
5 * Copyright (C) 2007 Atmel Corporation.
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>
25 #include <linux/module.h>
26 #include <linux/platform_device.h>
27 #include <linux/spi/spi.h>
29 #include <asm/hardware.h>
30 #include <asm/setup.h>
31 #include <asm/mach-types.h>
34 #include <asm/mach/arch.h>
35 #include <asm/mach/map.h>
36 #include <asm/mach/irq.h>
38 #include <asm/arch/board.h>
39 #include <asm/arch/gpio.h>
40 #include <asm/arch/at91sam926x_mc.h>
46 * Serial port configuration.
47 * 0 .. 2 = USART0 .. USART2
50 static struct at91_uart_config __initdata ek_uart_config
= {
51 .console_tty
= 0, /* ttyS0 */
53 .tty_map
= { 3, 0, -1, -1, } /* ttyS0, ..., ttyS3 */
56 static void __init
ek_map_io(void)
58 /* Initialize processor: 16.367 MHz crystal */
59 at91sam9263_initialize(16367660);
61 /* Setup the serial ports and console */
62 at91_init_serial(&ek_uart_config
);
65 static void __init
ek_init_irq(void)
67 at91sam9263_init_interrupts(NULL
);
74 static struct at91_usbh_data __initdata ek_usbh_data
= {
76 .vbus_pin
= { AT91_PIN_PA24
, AT91_PIN_PA21
},
82 static struct at91_udc_data __initdata ek_udc_data
= {
83 .vbus_pin
= AT91_PIN_PA25
,
84 .pullup_pin
= 0, /* pull-up driven by UDC */
91 static struct spi_board_info ek_spi_devices
[] = {
92 #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
93 { /* DataFlash card */
94 .modalias
= "mtd_dataflash",
96 .max_speed_hz
= 15 * 1000 * 1000,
106 static struct at91_mmc_data __initdata ek_mmc_data
= {
108 .det_pin
= AT91_PIN_PE18
,
109 .wp_pin
= AT91_PIN_PE19
,
110 // .vcc_pin = ... not connected
117 static struct mtd_partition __initdata ek_nand_partition
[] = {
119 .name
= "Partition 1",
121 .size
= 64 * 1024 * 1024,
124 .name
= "Partition 2",
125 .offset
= 64 * 1024 * 1024,
126 .size
= MTDPART_SIZ_FULL
,
130 static struct mtd_partition
*nand_partitions(int size
, int *num_partitions
)
132 *num_partitions
= ARRAY_SIZE(ek_nand_partition
);
133 return ek_nand_partition
;
136 static struct at91_nand_data __initdata ek_nand_data
= {
139 // .det_pin = ... not connected
140 .rdy_pin
= AT91_PIN_PA22
,
141 .enable_pin
= AT91_PIN_PD15
,
142 .partition_info
= nand_partitions
,
143 #if defined(CONFIG_MTD_NAND_AT91_BUSWIDTH_16)
151 static void __init
ek_board_init(void)
154 at91_add_device_serial();
156 at91_add_device_usbh(&ek_usbh_data
);
158 at91_add_device_udc(&ek_udc_data
);
160 at91_add_device_spi(ek_spi_devices
, ARRAY_SIZE(ek_spi_devices
));
162 at91_add_device_mmc(1, &ek_mmc_data
);
164 at91_add_device_nand(&ek_nand_data
);
167 MACHINE_START(AT91SAM9263EK
, "Atmel AT91SAM9263-EK")
168 /* Maintainer: Atmel */
169 .phys_io
= AT91_BASE_SYS
,
170 .io_pg_offst
= (AT91_VA_BASE_SYS
>> 18) & 0xfffc,
171 .boot_params
= AT91_SDRAM_BASE
+ 0x100,
172 .timer
= &at91sam926x_timer
,
174 .init_irq
= ek_init_irq
,
175 .init_machine
= ek_board_init
,