AT91: Added a generic way to setup AT91 serial ports in Kconfig
[linux-2.6/pdupreez.git] / arch / arm / mach-at91 / board-picotux200.c
blob6e7a4e34c906bacca9a96f9d7575d7e3e6c59e5b
1 /*
2 * linux/arch/arm/mach-at91/board-picotux200.c
4 * Copyright (C) 2005 SAN People
5 * Copyright (C) 2007 Kleinhenz Elektronik GmbH
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>
24 #include <linux/mm.h>
25 #include <linux/module.h>
26 #include <linux/platform_device.h>
27 #include <linux/spi/spi.h>
28 #include <linux/mtd/physmap.h>
30 #include <mach/hardware.h>
31 #include <asm/setup.h>
32 #include <asm/mach-types.h>
33 #include <asm/irq.h>
35 #include <asm/mach/arch.h>
36 #include <asm/mach/map.h>
37 #include <asm/mach/irq.h>
39 #include <mach/board.h>
40 #include <mach/gpio.h>
41 #include <mach/at91rm9200_mc.h>
43 #include "generic.h"
46 static void __init picotux200_map_io(void)
48 /* Initialize processor: 18.432 MHz crystal */
49 at91rm9200_initialize(18432000, AT91RM9200_BGA);
51 /* Setup the serial ports and console */
52 at91_init_uarts();
55 static void __init picotux200_init_irq(void)
57 at91rm9200_init_interrupts(NULL);
60 static struct at91_eth_data __initdata picotux200_eth_data = {
61 .phy_irq_pin = AT91_PIN_PC4,
62 .is_rmii = 1,
65 static struct at91_usbh_data __initdata picotux200_usbh_data = {
66 .ports = 1,
69 // static struct at91_udc_data __initdata picotux200_udc_data = {
70 // .vbus_pin = AT91_PIN_PD4,
71 // .pullup_pin = AT91_PIN_PD5,
72 // };
74 static struct at91_mmc_data __initdata picotux200_mmc_data = {
75 .det_pin = AT91_PIN_PB27,
76 .slot_b = 0,
77 .wire4 = 1,
78 .wp_pin = AT91_PIN_PA17,
81 // static struct spi_board_info picotux200_spi_devices[] = {
82 // { /* DataFlash chip */
83 // .modalias = "mtd_dataflash",
84 // .chip_select = 0,
85 // .max_speed_hz = 15 * 1000 * 1000,
86 // },
87 // #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
88 // { /* DataFlash card */
89 // .modalias = "mtd_dataflash",
90 // .chip_select = 3,
91 // .max_speed_hz = 15 * 1000 * 1000,
92 // },
93 // #endif
94 // };
96 #define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
97 #define PICOTUX200_FLASH_SIZE 0x400000
99 static struct physmap_flash_data picotux200_flash_data = {
100 .width = 2,
103 static struct resource picotux200_flash_resource = {
104 .start = PICOTUX200_FLASH_BASE,
105 .end = PICOTUX200_FLASH_BASE + PICOTUX200_FLASH_SIZE - 1,
106 .flags = IORESOURCE_MEM,
109 static struct platform_device picotux200_flash = {
110 .name = "physmap-flash",
111 .id = 0,
112 .dev = {
113 .platform_data = &picotux200_flash_data,
115 .resource = &picotux200_flash_resource,
116 .num_resources = 1,
119 static void __init picotux200_board_init(void)
121 /* Serial */
122 at91_add_device_serial();
123 /* Ethernet */
124 at91_add_device_eth(&picotux200_eth_data);
125 /* USB Host */
126 at91_add_device_usbh(&picotux200_usbh_data);
127 /* USB Device */
128 // at91_add_device_udc(&picotux200_udc_data);
129 // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
130 /* I2C */
131 at91_add_device_i2c(NULL, 0);
132 /* SPI */
133 // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices));
134 #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
135 /* DataFlash card */
136 at91_set_gpio_output(AT91_PIN_PB22, 0);
137 #else
138 /* MMC */
139 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
140 at91_add_device_mmc(0, &picotux200_mmc_data);
141 #endif
142 /* NOR Flash */
143 platform_device_register(&picotux200_flash);
146 MACHINE_START(PICOTUX2XX, "picotux 200")
147 /* Maintainer: Kleinhenz Elektronik GmbH */
148 .phys_io = AT91_BASE_SYS,
149 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
150 .boot_params = AT91_SDRAM_BASE + 0x100,
151 .timer = &at91rm9200_timer,
152 .map_io = picotux200_map_io,
153 .init_irq = picotux200_init_irq,
154 .init_machine = picotux200_board_init,
155 MACHINE_END