aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91rm9200/board-csb337.c
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2006-06-19 12:26:23 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-06-19 12:26:23 -0400
commit466e6227e6a54d9b94b50972612fe8bf0450f786 (patch)
treeb6704d537eac6deb9ba97a937460058e9ad19201 /arch/arm/mach-at91rm9200/board-csb337.c
parent82c583e3ae31ffa76d1280197274cc1e1cde3179 (diff)
[ARM] 3588/1: AT91RM9200 CSB337/637 board update
Patch from Andrew Victor This patch updates the support for the Cogent CSB337 and CSB637 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 CSB337 board uses PB0 & PB1 (and not PB2) for the LEDs. [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-csb337.c')
-rw-r--r--arch/arm/mach-at91rm9200/board-csb337.c43
1 files changed, 25 insertions, 18 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}