AT91: Added a generic way to setup AT91 serial ports in Kconfig
[linux-2.6/pdupreez.git] / arch / arm / mach-at91 / board-cam60.c
blob1afa2fc46a53ba695b36afcc535962bbaff5a165
1 /*
2 * KwikByte CAM60 (KB9260)
4 * based on board-sam9260ek.c
5 * Copyright (C) 2005 SAN People
6 * Copyright (C) 2006 Atmel
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include <linux/types.h>
24 #include <linux/init.h>
25 #include <linux/mm.h>
26 #include <linux/module.h>
27 #include <linux/platform_device.h>
28 #include <linux/spi/spi.h>
29 #include <linux/spi/flash.h>
31 #include <mach/hardware.h>
32 #include <asm/setup.h>
33 #include <asm/mach-types.h>
34 #include <asm/irq.h>
36 #include <asm/mach/arch.h>
37 #include <asm/mach/map.h>
38 #include <asm/mach/irq.h>
40 #include <mach/board.h>
41 #include <mach/gpio.h>
43 #include "generic.h"
46 static void __init cam60_map_io(void)
48 /* Initialize processor: 10 MHz crystal */
49 at91sam9260_initialize(10000000);
51 /* Setup the serial ports and console */
52 at91_init_uarts();
55 static void __init cam60_init_irq(void)
57 at91sam9260_init_interrupts(NULL);
62 * USB Host
64 static struct at91_usbh_data __initdata cam60_usbh_data = {
65 .ports = 1,
70 * SPI devices.
72 #if defined(CONFIG_MTD_DATAFLASH)
73 static struct mtd_partition __initdata cam60_spi_partitions[] = {
75 .name = "BOOT1",
76 .offset = 0,
77 .size = 4 * 1056,
80 .name = "BOOT2",
81 .offset = MTDPART_OFS_NXTBLK,
82 .size = 256 * 1056,
85 .name = "kernel",
86 .offset = MTDPART_OFS_NXTBLK,
87 .size = 2222 * 1056,
90 .name = "file system",
91 .offset = MTDPART_OFS_NXTBLK,
92 .size = MTDPART_SIZ_FULL,
96 static struct flash_platform_data __initdata cam60_spi_flash_platform_data = {
97 .name = "spi_flash",
98 .parts = cam60_spi_partitions,
99 .nr_parts = ARRAY_SIZE(cam60_spi_partitions)
101 #endif
103 static struct spi_board_info cam60_spi_devices[] = {
104 #if defined(CONFIG_MTD_DATAFLASH)
105 { /* DataFlash chip */
106 .modalias = "mtd_dataflash",
107 .chip_select = 0,
108 .max_speed_hz = 15 * 1000 * 1000,
109 .bus_num = 0,
110 .platform_data = &cam60_spi_flash_platform_data
112 #endif
117 * MACB Ethernet device
119 static struct __initdata at91_eth_data cam60_macb_data = {
120 .phy_irq_pin = AT91_PIN_PB5,
121 .is_rmii = 0,
126 * NAND Flash
128 static struct mtd_partition __initdata cam60_nand_partition[] = {
130 .name = "nand_fs",
131 .offset = 0,
132 .size = MTDPART_SIZ_FULL,
136 static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
138 *num_partitions = ARRAY_SIZE(cam60_nand_partition);
139 return cam60_nand_partition;
142 static struct atmel_nand_data __initdata cam60_nand_data = {
143 .ale = 21,
144 .cle = 22,
145 // .det_pin = ... not there
146 .rdy_pin = AT91_PIN_PA9,
147 .enable_pin = AT91_PIN_PA7,
148 .partition_info = nand_partitions,
152 static void __init cam60_board_init(void)
154 /* Serial */
155 at91_add_device_serial();
156 /* SPI */
157 at91_add_device_spi(cam60_spi_devices, ARRAY_SIZE(cam60_spi_devices));
158 /* Ethernet */
159 at91_add_device_eth(&cam60_macb_data);
160 /* USB Host */
161 /* enable USB power supply circuit */
162 at91_set_gpio_output(AT91_PIN_PB18, 1);
163 at91_add_device_usbh(&cam60_usbh_data);
164 /* NAND */
165 at91_add_device_nand(&cam60_nand_data);
168 MACHINE_START(CAM60, "KwikByte CAM60")
169 /* Maintainer: KwikByte */
170 .phys_io = AT91_BASE_SYS,
171 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
172 .boot_params = AT91_SDRAM_BASE + 0x100,
173 .timer = &at91sam926x_timer,
174 .map_io = cam60_map_io,
175 .init_irq = cam60_init_irq,
176 .init_machine = cam60_board_init,
177 MACHINE_END