2 * Copyright (C) 2005 SAN People
3 * Copyright (C) 2008 Atmel
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include <linux/types.h>
21 #include <linux/init.h>
23 #include <linux/module.h>
24 #include <linux/platform_device.h>
25 #include <linux/spi/spi.h>
26 #include <linux/spi/at73c213.h>
27 #include <linux/clk.h>
29 #include <mach/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 <mach/board.h>
39 #include <mach/gpio.h>
44 static void __init
ek_map_io(void)
46 /* Initialize processor: 18.432 MHz crystal */
47 at91sam9260_initialize(18432000);
49 /* Setup the serial ports and console */
53 static void __init
ek_init_irq(void)
55 at91sam9260_init_interrupts(NULL
);
62 static struct at91_usbh_data __initdata ek_usbh_data
= {
69 static struct at91_udc_data __initdata ek_udc_data
= {
70 .vbus_pin
= AT91_PIN_PC5
,
71 .pullup_pin
= 0, /* pull-up driven by UDC */
78 static struct spi_board_info ek_spi_devices
[] = {
79 #if !defined(CONFIG_MMC_AT91)
80 { /* DataFlash chip */
81 .modalias
= "mtd_dataflash",
83 .max_speed_hz
= 15 * 1000 * 1000,
86 #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
87 { /* DataFlash card */
88 .modalias
= "mtd_dataflash",
90 .max_speed_hz
= 15 * 1000 * 1000,
99 * MACB Ethernet device
101 static struct at91_eth_data __initdata ek_macb_data
= {
102 .phy_irq_pin
= AT91_PIN_PA7
,
110 static struct mtd_partition __initdata ek_nand_partition
[] = {
114 .size
= 4 * 1024 * 1024,
117 .name
= "Partition 1",
118 .offset
= 4 * 1024 * 1024,
119 .size
= 60 * 1024 * 1024,
122 .name
= "Partition 2",
123 .offset
= 64 * 1024 * 1024,
124 .size
= MTDPART_SIZ_FULL
,
128 static struct mtd_partition
* __init
nand_partitions(int size
, int *num_partitions
)
130 *num_partitions
= ARRAY_SIZE(ek_nand_partition
);
131 return ek_nand_partition
;
134 /* det_pin is not connected */
135 static struct atmel_nand_data __initdata ek_nand_data
= {
138 .rdy_pin
= AT91_PIN_PC13
,
139 .enable_pin
= AT91_PIN_PC14
,
140 .partition_info
= nand_partitions
,
141 #if defined(CONFIG_MTD_NAND_ATMEL_BUSWIDTH_16)
151 * det_pin, wp_pin and vcc_pin are not connected
153 static struct at91_mmc_data __initdata ek_mmc_data
= {
162 static struct gpio_led ek_leds
[] = {
163 { /* "bottom" led, green, userled1 to be defined */
165 .gpio
= AT91_PIN_PA6
,
167 .default_trigger
= "none",
169 { /* "power" led, yellow */
171 .gpio
= AT91_PIN_PA9
,
172 .default_trigger
= "heartbeat",
176 static void __init
ek_board_init(void)
179 at91_add_device_serial();
181 at91_add_device_usbh(&ek_usbh_data
);
183 at91_add_device_udc(&ek_udc_data
);
185 at91_add_device_spi(ek_spi_devices
, ARRAY_SIZE(ek_spi_devices
));
187 at91_add_device_nand(&ek_nand_data
);
189 at91_add_device_eth(&ek_macb_data
);
191 at91_add_device_mmc(0, &ek_mmc_data
);
193 at91_add_device_i2c(NULL
, 0);
195 at91_gpio_leds(ek_leds
, ARRAY_SIZE(ek_leds
));
198 MACHINE_START(AT91SAM9G20EK
, "Atmel AT91SAM9G20-EK")
199 /* Maintainer: Atmel */
200 .phys_io
= AT91_BASE_SYS
,
201 .io_pg_offst
= (AT91_VA_BASE_SYS
>> 18) & 0xfffc,
202 .boot_params
= AT91_SDRAM_BASE
+ 0x100,
203 .timer
= &at91sam926x_timer
,
205 .init_irq
= ek_init_irq
,
206 .init_machine
= ek_board_init
,