aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91rm9200/board-dk.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91rm9200/board-dk.c')
-rw-r--r--arch/arm/mach-at91rm9200/board-dk.c57
1 files changed, 41 insertions, 16 deletions
diff --git a/arch/arm/mach-at91rm9200/board-dk.c b/arch/arm/mach-at91rm9200/board-dk.c
index 2d7200ed66ed..eb02ca95be79 100644
--- a/arch/arm/mach-at91rm9200/board-dk.c
+++ b/arch/arm/mach-at91rm9200/board-dk.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 dk_init_irq(void)
57 * 0 .. 3 = USART0 .. USART3 58 * 0 .. 3 = USART0 .. USART3
58 * 4 = DBGU 59 * 4 = DBGU
59 */ 60 */
60#define DK_UART_MAP { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ 61static struct at91_uart_config __initdata dk_uart_config = {
61#define DK_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 dk_map_io(void) 67static void __init dk_map_io(void)
64{ 68{
65 int serial[AT91_NR_UART] = DK_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 dk_map_io(void)
73 /* Setup the LEDs */ 74 /* Setup the LEDs */
74 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2); 75 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
75 76
76#ifdef CONFIG_SERIAL_AT91 77 /* Setup the serial ports and console */
77 at91_console_port = DK_SERIAL_CONSOLE; 78 at91_init_serial(&dk_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 (at91_serial_map[i] >= 0)
83 at91_register_uart(i, at91_serial_map[i]);
84 }
85#endif
86} 79}
87 80
88static struct at91_eth_data __initdata dk_eth_data = { 81static struct at91_eth_data __initdata dk_eth_data = {
@@ -111,16 +104,48 @@ static struct at91_mmc_data __initdata dk_mmc_data = {
111 .wire4 = 1, 104 .wire4 = 1,
112}; 105};
113 106
107static struct spi_board_info dk_spi_devices[] = {
108 { /* DataFlash chip */
109 .modalias = "mtd_dataflash",
110 .chip_select = 0,
111 .max_speed_hz = 15 * 1000 * 1000,
112 },
113 { /* UR6HCPS2-SP40 PS2-to-SPI adapter */
114 .modalias = "ur6hcps2",
115 .chip_select = 1,
116 .max_speed_hz = 250 * 1000,
117 },
118 { /* TLV1504 ADC, 4 channels, 10 bits; one is a temp sensor */
119 .modalias = "tlv1504",
120 .chip_select = 2,
121 .max_speed_hz = 20 * 1000 * 1000,
122 },
123#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
124 { /* DataFlash card */
125 .modalias = "mtd_dataflash",
126 .chip_select = 3,
127 .max_speed_hz = 15 * 1000 * 1000,
128 }
129#endif
130};
131
114static void __init dk_board_init(void) 132static void __init dk_board_init(void)
115{ 133{
134 /* Serial */
135 at91_add_device_serial();
116 /* Ethernet */ 136 /* Ethernet */
117 at91_add_device_eth(&dk_eth_data); 137 at91_add_device_eth(&dk_eth_data);
118 /* USB Host */ 138 /* USB Host */
119 at91_add_device_usbh(&dk_usbh_data); 139 at91_add_device_usbh(&dk_usbh_data);
120 /* USB Device */ 140 /* USB Device */
121 at91_add_device_udc(&dk_udc_data); 141 at91_add_device_udc(&dk_udc_data);
142 at91_set_multi_drive(dk_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
122 /* Compact Flash */ 143 /* Compact Flash */
123 at91_add_device_cf(&dk_cf_data); 144 at91_add_device_cf(&dk_cf_data);
145 /* I2C */
146 at91_add_device_i2c();
147 /* SPI */
148 at91_add_device_spi(dk_spi_devices, ARRAY_SIZE(dk_spi_devices));
124#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD 149#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
125 /* DataFlash card */ 150 /* DataFlash card */
126 at91_set_gpio_output(AT91_PIN_PB7, 0); 151 at91_set_gpio_output(AT91_PIN_PB7, 0);