aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-at91rm9200/board-dk.c57
-rw-r--r--arch/arm/mach-at91rm9200/board-ek.c47
2 files changed, 72 insertions, 32 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);
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);