aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/board-sam9260ek.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/board-sam9260ek.c')
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c83
1 files changed, 69 insertions, 14 deletions
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index b343a6c2812..4d1d9c77708 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -25,6 +25,8 @@
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#include <linux/spi/spi.h>
28#include <linux/spi/at73c213.h>
29#include <linux/clk.h>
28 30
29#include <asm/hardware.h> 31#include <asm/hardware.h>
30#include <asm/setup.h> 32#include <asm/setup.h>
@@ -37,29 +39,28 @@
37 39
38#include <asm/arch/board.h> 40#include <asm/arch/board.h>
39#include <asm/arch/gpio.h> 41#include <asm/arch/gpio.h>
40#include <asm/arch/at91sam926x_mc.h>
41 42
42#include "generic.h" 43#include "generic.h"
43 44
44 45
45/*
46 * Serial port configuration.
47 * 0 .. 5 = USART0 .. USART5
48 * 6 = DBGU
49 */
50static struct at91_uart_config __initdata ek_uart_config = {
51 .console_tty = 0, /* ttyS0 */
52 .nr_tty = 3,
53 .tty_map = { 6, 0, 1, -1, -1, -1, -1 } /* ttyS0, ..., ttyS6 */
54};
55
56static void __init ek_map_io(void) 46static void __init ek_map_io(void)
57{ 47{
58 /* Initialize processor: 18.432 MHz crystal */ 48 /* Initialize processor: 18.432 MHz crystal */
59 at91sam9260_initialize(18432000); 49 at91sam9260_initialize(18432000);
60 50
61 /* Setup the serial ports and console */ 51 /* DGBU on ttyS0. (Rx & Tx only) */
62 at91_init_serial(&ek_uart_config); 52 at91_register_uart(0, 0, 0);
53
54 /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
55 at91_register_uart(AT91SAM9260_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
56 | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
57 | ATMEL_UART_RI);
58
59 /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */
60 at91_register_uart(AT91SAM9260_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS);
61
62 /* set serial console to ttyS0 (ie, DBGU) */
63 at91_set_serial_console(0);
63} 64}
64 65
65static void __init ek_init_irq(void) 66static void __init ek_init_irq(void)
@@ -85,6 +86,35 @@ static struct at91_udc_data __initdata ek_udc_data = {
85 86
86 87
87/* 88/*
89 * Audio
90 */
91static struct at73c213_board_info at73c213_data = {
92 .ssc_id = 0,
93 .shortname = "AT91SAM9260-EK external DAC",
94};
95
96#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
97static void __init at73c213_set_clk(struct at73c213_board_info *info)
98{
99 struct clk *pck0;
100 struct clk *plla;
101
102 pck0 = clk_get(NULL, "pck0");
103 plla = clk_get(NULL, "plla");
104
105 /* AT73C213 MCK Clock */
106 at91_set_B_periph(AT91_PIN_PC1, 0); /* PCK0 */
107
108 clk_set_parent(pck0, plla);
109 clk_put(plla);
110
111 info->dac_clk = pck0;
112}
113#else
114static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
115#endif
116
117/*
88 * SPI devices. 118 * SPI devices.
89 */ 119 */
90static struct spi_board_info ek_spi_devices[] = { 120static struct spi_board_info ek_spi_devices[] = {
@@ -110,6 +140,8 @@ static struct spi_board_info ek_spi_devices[] = {
110 .chip_select = 0, 140 .chip_select = 0,
111 .max_speed_hz = 10 * 1000 * 1000, 141 .max_speed_hz = 10 * 1000 * 1000,
112 .bus_num = 1, 142 .bus_num = 1,
143 .mode = SPI_MODE_1,
144 .platform_data = &at73c213_data,
113 }, 145 },
114#endif 146#endif
115}; 147};
@@ -172,6 +204,24 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
172// .vcc_pin = ... not connected 204// .vcc_pin = ... not connected
173}; 205};
174 206
207
208/*
209 * LEDs
210 */
211static struct gpio_led ek_leds[] = {
212 { /* "bottom" led, green, userled1 to be defined */
213 .name = "ds5",
214 .gpio = AT91_PIN_PA6,
215 .active_low = 1,
216 .default_trigger = "none",
217 },
218 { /* "power" led, yellow */
219 .name = "ds1",
220 .gpio = AT91_PIN_PA9,
221 .default_trigger = "heartbeat",
222 }
223};
224
175static void __init ek_board_init(void) 225static void __init ek_board_init(void)
176{ 226{
177 /* Serial */ 227 /* Serial */
@@ -190,6 +240,11 @@ static void __init ek_board_init(void)
190 at91_add_device_mmc(0, &ek_mmc_data); 240 at91_add_device_mmc(0, &ek_mmc_data);
191 /* I2C */ 241 /* I2C */
192 at91_add_device_i2c(NULL, 0); 242 at91_add_device_i2c(NULL, 0);
243 /* SSC (to AT73C213) */
244 at73c213_set_clk(&at73c213_data);
245 at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);
246 /* LEDs */
247 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
193} 248}
194 249
195MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") 250MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")