[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>
This commit is contained in:
Родитель
82c583e3ae
Коммит
466e6227e6
|
@ -24,6 +24,7 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/spi/spi.h>
|
||||
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/setup.h>
|
||||
|
@ -35,8 +36,8 @@
|
|||
#include <asm/mach/irq.h>
|
||||
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/mach/serial_at91rm9200.h>
|
||||
#include <asm/arch/board.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
|
||||
#include "generic.h"
|
||||
|
||||
|
@ -54,32 +55,24 @@ static void __init csb337_init_irq(void)
|
|||
* 0 .. 3 = USART0 .. USART3
|
||||
* 4 = DBGU
|
||||
*/
|
||||
#define CSB337_UART_MAP { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
|
||||
#define CSB337_SERIAL_CONSOLE 0 /* ttyS0 */
|
||||
static struct at91_uart_config __initdata csb337_uart_config = {
|
||||
.console_tty = 0, /* ttyS0 */
|
||||
.nr_tty = 2,
|
||||
.tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
|
||||
};
|
||||
|
||||
static void __init csb337_map_io(void)
|
||||
{
|
||||
int serial[AT91_NR_UART] = CSB337_UART_MAP;
|
||||
int i;
|
||||
|
||||
at91rm9200_map_io();
|
||||
|
||||
/* Initialize clocks: 3.6864 MHz crystal */
|
||||
at91_clock_init(3686400);
|
||||
|
||||
/* Setup the LEDs */
|
||||
at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
|
||||
at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
|
||||
|
||||
#ifdef CONFIG_SERIAL_AT91
|
||||
at91_console_port = CSB337_SERIAL_CONSOLE;
|
||||
memcpy(at91_serial_map, serial, sizeof(serial));
|
||||
|
||||
/* Register UARTs */
|
||||
for (i = 0; i < AT91_NR_UART; i++) {
|
||||
if (serial[i] >= 0)
|
||||
at91_register_uart(i, serial[i]);
|
||||
}
|
||||
#endif
|
||||
/* Setup the serial ports and console */
|
||||
at91_init_serial(&csb337_uart_config);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata csb337_eth_data = {
|
||||
|
@ -118,17 +111,31 @@ static struct at91_mmc_data __initdata csb337_mmc_data = {
|
|||
.wp_pin = AT91_PIN_PD6,
|
||||
};
|
||||
|
||||
static struct spi_board_info csb337_spi_devices[] = {
|
||||
{ /* CAN controller */
|
||||
.modalias = "sak82c900",
|
||||
.chip_select = 0,
|
||||
.max_speed_hz = 6 * 1000 * 1000,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init csb337_board_init(void)
|
||||
{
|
||||
/* Serial */
|
||||
at91_add_device_serial();
|
||||
/* Ethernet */
|
||||
at91_add_device_eth(&csb337_eth_data);
|
||||
/* USB Host */
|
||||
at91_add_device_usbh(&csb337_usbh_data);
|
||||
/* USB Device */
|
||||
at91_add_device_udc(&csb337_udc_data);
|
||||
/* I2C */
|
||||
at91_add_device_i2c();
|
||||
/* Compact Flash */
|
||||
at91_set_gpio_input(AT91_PIN_PB22, 1); /* IOIS16 */
|
||||
at91_add_device_cf(&csb337_cf_data);
|
||||
/* SPI */
|
||||
at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices));
|
||||
/* MMC */
|
||||
at91_add_device_mmc(&csb337_mmc_data);
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
#include <asm/mach/irq.h>
|
||||
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/mach/serial_at91rm9200.h>
|
||||
#include <asm/arch/board.h>
|
||||
#include <asm/arch/gpio.h>
|
||||
|
||||
#include "generic.h"
|
||||
|
||||
|
@ -54,14 +54,14 @@ static void __init csb637_init_irq(void)
|
|||
* 0 .. 3 = USART0 .. USART3
|
||||
* 4 = DBGU
|
||||
*/
|
||||
#define CSB637_UART_MAP { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
|
||||
#define CSB637_SERIAL_CONSOLE 0 /* ttyS0 */
|
||||
static struct at91_uart_config __initdata csb637_uart_config = {
|
||||
.console_tty = 0, /* ttyS0 */
|
||||
.nr_tty = 2,
|
||||
.tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
|
||||
};
|
||||
|
||||
static void __init csb637_map_io(void)
|
||||
{
|
||||
int serial[AT91_NR_UART] = CSB637_UART_MAP;
|
||||
int i;
|
||||
|
||||
at91rm9200_map_io();
|
||||
|
||||
/* Initialize clocks: 3.6864 MHz crystal */
|
||||
|
@ -70,16 +70,8 @@ static void __init csb637_map_io(void)
|
|||
/* Setup the LEDs */
|
||||
at91_init_leds(AT91_PIN_PB2, AT91_PIN_PB2);
|
||||
|
||||
#ifdef CONFIG_SERIAL_AT91
|
||||
at91_console_port = CSB637_SERIAL_CONSOLE;
|
||||
memcpy(at91_serial_map, serial, sizeof(serial));
|
||||
|
||||
/* Register UARTs */
|
||||
for (i = 0; i < AT91_NR_UART; i++) {
|
||||
if (serial[i] >= 0)
|
||||
at91_register_uart(i, serial[i]);
|
||||
}
|
||||
#endif
|
||||
/* Setup the serial ports and console */
|
||||
at91_init_serial(&csb637_uart_config);
|
||||
}
|
||||
|
||||
static struct at91_eth_data __initdata csb637_eth_data = {
|
||||
|
@ -98,12 +90,18 @@ static struct at91_udc_data __initdata csb637_udc_data = {
|
|||
|
||||
static void __init csb637_board_init(void)
|
||||
{
|
||||
/* Serial */
|
||||
at91_add_device_serial();
|
||||
/* Ethernet */
|
||||
at91_add_device_eth(&csb637_eth_data);
|
||||
/* USB Host */
|
||||
at91_add_device_usbh(&csb637_usbh_data);
|
||||
/* USB Device */
|
||||
at91_add_device_udc(&csb637_udc_data);
|
||||
/* I2C */
|
||||
at91_add_device_i2c();
|
||||
/* SPI */
|
||||
at91_add_device_spi(NULL, 0);
|
||||
}
|
||||
|
||||
MACHINE_START(CSB637, "Cogent CSB637")
|
||||
|
|
Загрузка…
Ссылка в новой задаче