aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91rm9200/board-ek.c
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2006-06-19 13:16:45 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-06-19 13:16:45 -0400
commit067bbada4cc574eaa4fa577483ecae4012049477 (patch)
treeec609719b6b413cf0baf4fd9d57b1a0570274fc7 /arch/arm/mach-at91rm9200/board-ek.c
parent466e6227e6a54d9b94b50972612fe8bf0450f786 (diff)
[ARM] 3589/1: AT91RM9200 DK/EK board update
Patch from Andrew Victor This patch updates the support for the Atmel DK and EK boards. The changes include: 1. Use the new at91_uart_config structure and device registration functions for the UARTs. 2. Registration of I2C and SPI platform devices. 3. The USB Device pullup line is connected to reset, so multidrive needs to be enabled on the line. [Patch from David Brownell]. Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91rm9200/board-ek.c')
-rw-r--r--arch/arm/mach-at91rm9200/board-ek.c47
1 files changed, 31 insertions, 16 deletions
diff --git a/arch/arm/mach-at91rm9200/board-ek.c b/arch/arm/mach-at91rm9200/board-ek.c
index 80d90f5135a1..4d7468e42679 100644
--- a/arch/arm/mach-at91rm9200/board-ek.c
+++ b/arch/arm/mach-at91rm9200/board-ek.c
@@ -27,6 +27,7 @@
27#include <linux/mm.h> 27#include <linux/mm.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#include <linux/spi/spi.h>
30 31
31#include <asm/hardware.h> 32#include <asm/hardware.h>
32#include <asm/setup.h> 33#include <asm/setup.h>
@@ -38,8 +39,8 @@
38#include <asm/mach/irq.h> 39#include <asm/mach/irq.h>
39 40
40#include <asm/arch/hardware.h> 41#include <asm/arch/hardware.h>
41#include <asm/mach/serial_at91rm9200.h>
42#include <asm/arch/board.h> 42#include <asm/arch/board.h>
43#include <asm/arch/gpio.h>
43 44
44#include "generic.h" 45#include "generic.h"
45 46
@@ -57,14 +58,14 @@ static void __init ek_init_irq(void)
57 * 0 .. 3 = USART0 .. USART3 58 * 0 .. 3 = USART0 .. USART3
58 * 4 = DBGU 59 * 4 = DBGU
59 */ 60 */
60#define EK_UART_MAP { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ 61static struct at91_uart_config __initdata ek_uart_config = {
61#define EK_SERIAL_CONSOLE 0 /* ttyS0 */ 62 .console_tty = 0, /* ttyS0 */
63 .nr_tty = 2,
64 .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
65};
62 66
63static void __init ek_map_io(void) 67static void __init ek_map_io(void)
64{ 68{
65 int serial[AT91_NR_UART] = EK_UART_MAP;
66 int i;
67
68 at91rm9200_map_io(); 69 at91rm9200_map_io();
69 70
70 /* Initialize clocks: 18.432 MHz crystal */ 71 /* Initialize clocks: 18.432 MHz crystal */
@@ -73,16 +74,8 @@ static void __init ek_map_io(void)
73 /* Setup the LEDs */ 74 /* Setup the LEDs */
74 at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2); 75 at91_init_leds(AT91_PIN_PB1, AT91_PIN_PB2);
75 76
76#ifdef CONFIG_SERIAL_AT91 77 /* Setup the serial ports and console */
77 at91_console_port = EK_SERIAL_CONSOLE; 78 at91_init_serial(&ek_uart_config);
78 memcpy(at91_serial_map, serial, sizeof(serial));
79
80 /* Register UARTs */
81 for (i = 0; i < AT91_NR_UART; i++) {
82 if (serial[i] >= 0)
83 at91_register_uart(i, serial[i]);
84 }
85#endif
86} 79}
87 80
88static struct at91_eth_data __initdata ek_eth_data = { 81static struct at91_eth_data __initdata ek_eth_data = {
@@ -106,14 +99,36 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
106 .wp_pin = AT91_PIN_PA17, 99 .wp_pin = AT91_PIN_PA17,
107}; 100};
108 101
102static struct spi_board_info ek_spi_devices[] = {
103 { /* DataFlash chip */
104 .modalias = "mtd_dataflash",
105 .chip_select = 0,
106 .max_speed_hz = 15 * 1000 * 1000,
107 },
108#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
109 { /* DataFlash card */
110 .modalias = "mtd_dataflash",
111 .chip_select = 3,
112 .max_speed_hz = 15 * 1000 * 1000,
113 },
114#endif
115};
116
109static void __init ek_board_init(void) 117static void __init ek_board_init(void)
110{ 118{
119 /* Serial */
120 at91_add_device_serial();
111 /* Ethernet */ 121 /* Ethernet */
112 at91_add_device_eth(&ek_eth_data); 122 at91_add_device_eth(&ek_eth_data);
113 /* USB Host */ 123 /* USB Host */
114 at91_add_device_usbh(&ek_usbh_data); 124 at91_add_device_usbh(&ek_usbh_data);
115 /* USB Device */ 125 /* USB Device */
116 at91_add_device_udc(&ek_udc_data); 126 at91_add_device_udc(&ek_udc_data);
127 at91_set_multi_drive(ek_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
128 /* I2C */
129 at91_add_device_i2c();
130 /* SPI */
131 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
117#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD 132#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
118 /* DataFlash card */ 133 /* DataFlash card */
119 at91_set_gpio_output(AT91_PIN_PB22, 0); 134 at91_set_gpio_output(AT91_PIN_PB22, 0);