aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-at91rm9200/board-csb337.c43
-rw-r--r--arch/arm/mach-at91rm9200/board-csb637.c30
2 files changed, 39 insertions, 34 deletions
diff --git a/arch/arm/mach-at91rm9200/board-csb337.c b/arch/arm/mach-at91rm9200/board-csb337.c
index f45104ceea8f..3b9de181ae32 100644
--- a/arch/arm/mach-at91rm9200/board-csb337.c
+++ b/arch/arm/mach-at91rm9200/board-csb337.c
@@ -24,6 +24,7 @@
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/spi/spi.h>
27 28
28#include <asm/hardware.h> 29#include <asm/hardware.h>
29#include <asm/setup.h> 30#include <asm/setup.h>
@@ -35,8 +36,8 @@
35#include <asm/mach/irq.h> 36#include <asm/mach/irq.h>
36 37
37#include <asm/arch/hardware.h> 38#include <asm/arch/hardware.h>
38#include <asm/mach/serial_at91rm9200.h>
39#include <asm/arch/board.h> 39#include <asm/arch/board.h>
40#include <asm/arch/gpio.h>
40 41
41#include "generic.h" 42#include "generic.h"
42 43
@@ -54,32 +55,24 @@ static void __init csb337_init_irq(void)
54 * 0 .. 3 = USART0 .. USART3 55 * 0 .. 3 = USART0 .. USART3
55 * 4 = DBGU 56 * 4 = DBGU
56 */ 57 */
57#define CSB337_UART_MAP { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ 58static struct at91_uart_config __initdata csb337_uart_config = {
58#define CSB337_SERIAL_CONSOLE 0 /* ttyS0 */ 59 .console_tty = 0, /* ttyS0 */
60 .nr_tty = 2,
61 .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
62};
59 63
60static void __init csb337_map_io(void) 64static void __init csb337_map_io(void)
61{ 65{
62 int serial[AT91_NR_UART] = CSB337_UART_MAP;
63 int i;
64
65 at91rm9200_map_io(); 66 at91rm9200_map_io();
66 67
67 /* Initialize clocks: 3.6864 MHz crystal */ 68 /* Initialize clocks: 3.6864 MHz crystal */
68 at91_clock_init(3686400); 69 at91_clock_init(3686400);
69 70
70 /* Setup the LEDs */ 71 /* Setup the LEDs */
71 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2); 72 at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
72 73
73#ifdef CONFIG_SERIAL_AT91 74 /* Setup the serial ports and console */
74 at91_console_port = CSB337_SERIAL_CONSOLE; 75 at91_init_serial(&csb337_uart_config);
75 memcpy(at91_serial_map, serial, sizeof(serial));
76
77 /* Register UARTs */
78 for (i = 0; i < AT91_NR_UART; i++) {
79 if (serial[i] >= 0)
80 at91_register_uart(i, serial[i]);
81 }
82#endif
83} 76}
84 77
85static struct at91_eth_data __initdata csb337_eth_data = { 78static struct at91_eth_data __initdata csb337_eth_data = {
@@ -118,17 +111,31 @@ static struct at91_mmc_data __initdata csb337_mmc_data = {
118 .wp_pin = AT91_PIN_PD6, 111 .wp_pin = AT91_PIN_PD6,
119}; 112};
120 113
114static struct spi_board_info csb337_spi_devices[] = {
115 { /* CAN controller */
116 .modalias = "sak82c900",
117 .chip_select = 0,
118 .max_speed_hz = 6 * 1000 * 1000,
119 },
120};
121
121static void __init csb337_board_init(void) 122static void __init csb337_board_init(void)
122{ 123{
124 /* Serial */
125 at91_add_device_serial();
123 /* Ethernet */ 126 /* Ethernet */
124 at91_add_device_eth(&csb337_eth_data); 127 at91_add_device_eth(&csb337_eth_data);
125 /* USB Host */ 128 /* USB Host */
126 at91_add_device_usbh(&csb337_usbh_data); 129 at91_add_device_usbh(&csb337_usbh_data);
127 /* USB Device */ 130 /* USB Device */
128 at91_add_device_udc(&csb337_udc_data); 131 at91_add_device_udc(&csb337_udc_data);
132 /* I2C */
133 at91_add_device_i2c();
129 /* Compact Flash */ 134 /* Compact Flash */
130 at91_set_gpio_input(AT91_PIN_PB22, 1); /* IOIS16 */ 135 at91_set_gpio_input(AT91_PIN_PB22, 1); /* IOIS16 */
131 at91_add_device_cf(&csb337_cf_data); 136 at91_add_device_cf(&csb337_cf_data);
137 /* SPI */
138 at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
132 /* MMC */ 139 /* MMC */
133 at91_add_device_mmc(&csb337_mmc_data); 140 at91_add_device_mmc(&csb337_mmc_data);
134} 141}
diff --git a/arch/arm/mach-at91rm9200/board-csb637.c b/arch/arm/mach-at91rm9200/board-csb637.c
index f2c2d6e79bc6..2c4470d110da 100644
--- a/arch/arm/mach-at91rm9200/board-csb637.c
+++ b/arch/arm/mach-at91rm9200/board-csb637.c
@@ -35,8 +35,8 @@
35#include <asm/mach/irq.h> 35#include <asm/mach/irq.h>
36 36
37#include <asm/arch/hardware.h> 37#include <asm/arch/hardware.h>
38#include <asm/mach/serial_at91rm9200.h>
39#include <asm/arch/board.h> 38#include <asm/arch/board.h>
39#include <asm/arch/gpio.h>
40 40
41#include "generic.h" 41#include "generic.h"
42 42
@@ -54,14 +54,14 @@ static void __init csb637_init_irq(void)
54 * 0 .. 3 = USART0 .. USART3 54 * 0 .. 3 = USART0 .. USART3
55 * 4 = DBGU 55 * 4 = DBGU
56 */ 56 */
57#define CSB637_UART_MAP { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ 57static struct at91_uart_config __initdata csb637_uart_config = {
58#define CSB637_SERIAL_CONSOLE 0 /* ttyS0 */ 58 .console_tty = 0, /* ttyS0 */
59 .nr_tty = 2,
60 .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
61};
59 62
60static void __init csb637_map_io(void) 63static void __init csb637_map_io(void)
61{ 64{
62 int serial[AT91_NR_UART] = CSB637_UART_MAP;
63 int i;
64
65 at91rm9200_map_io(); 65 at91rm9200_map_io();
66 66
67 /* Initialize clocks: 3.6864 MHz crystal */ 67 /* Initialize clocks: 3.6864 MHz crystal */
@@ -70,16 +70,8 @@ static void __init csb637_map_io(void)
70 /* Setup the LEDs */ 70 /* Setup the LEDs */
71 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2); 71 at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
72 72
73#ifdef CONFIG_SERIAL_AT91 73 /* Setup the serial ports and console */
74 at91_console_port = CSB637_SERIAL_CONSOLE; 74 at91_init_serial(&csb637_uart_config);
75 memcpy(at91_serial_map, serial, sizeof(serial));
76
77 /* Register UARTs */
78 for (i = 0; i < AT91_NR_UART; i++) {
79 if (serial[i] >= 0)
80 at91_register_uart(i, serial[i]);
81 }
82#endif
83} 75}
84 76
85static struct at91_eth_data __initdata csb637_eth_data = { 77static struct at91_eth_data __initdata csb637_eth_data = {
@@ -98,12 +90,18 @@ static struct at91_udc_data __initdata csb637_udc_data = {
98 90
99static void __init csb637_board_init(void) 91static void __init csb637_board_init(void)
100{ 92{
93 /* Serial */
94 at91_add_device_serial();
101 /* Ethernet */ 95 /* Ethernet */
102 at91_add_device_eth(&csb637_eth_data); 96 at91_add_device_eth(&csb637_eth_data);
103 /* USB Host */ 97 /* USB Host */
104 at91_add_device_usbh(&csb637_usbh_data); 98 at91_add_device_usbh(&csb637_usbh_data);
105 /* USB Device */ 99 /* USB Device */
106 at91_add_device_udc(&csb637_udc_data); 100 at91_add_device_udc(&csb637_udc_data);
101 /* I2C */
102 at91_add_device_i2c();
103 /* SPI */
104 at91_add_device_spi(NULL, 0);
107} 105}
108 106
109MACHINE_START(CSB637, "Cogent CSB637") 107MACHINE_START(CSB637, "Cogent CSB637")