aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/board-sam9261ek.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/board-sam9261ek.c')
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c83
1 files changed, 69 insertions, 14 deletions
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index 0ce38dfa6ebe..08382c0df221 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -26,6 +26,8 @@
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/ads7846.h> 28#include <linux/spi/ads7846.h>
29#include <linux/spi/at73c213.h>
30#include <linux/clk.h>
29#include <linux/dm9000.h> 31#include <linux/dm9000.h>
30#include <linux/fb.h> 32#include <linux/fb.h>
31#include <linux/gpio_keys.h> 33#include <linux/gpio_keys.h>
@@ -44,22 +46,11 @@
44 46
45#include <asm/arch/board.h> 47#include <asm/arch/board.h>
46#include <asm/arch/gpio.h> 48#include <asm/arch/gpio.h>
47#include <asm/arch/at91sam926x_mc.h> 49#include <asm/arch/at91sam9_smc.h>
48 50
49#include "generic.h" 51#include "generic.h"
50 52
51 53
52/*
53 * Serial port configuration.
54 * 0 .. 2 = USART0 .. USART2
55 * 3 = DBGU
56 */
57static struct at91_uart_config __initdata ek_uart_config = {
58 .console_tty = 0, /* ttyS0 */
59 .nr_tty = 1,
60 .tty_map = { 3, -1, -1, -1 } /* ttyS0, ..., ttyS3 */
61};
62
63static void __init ek_map_io(void) 54static void __init ek_map_io(void)
64{ 55{
65 /* Initialize processor: 18.432 MHz crystal */ 56 /* Initialize processor: 18.432 MHz crystal */
@@ -68,8 +59,11 @@ static void __init ek_map_io(void)
68 /* Setup the LEDs */ 59 /* Setup the LEDs */
69 at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14); 60 at91_init_leds(AT91_PIN_PA13, AT91_PIN_PA14);
70 61
71 /* Setup the serial ports and console */ 62 /* DGBU on ttyS0. (Rx & Tx only) */
72 at91_init_serial(&ek_uart_config); 63 at91_register_uart(0, 0, 0);
64
65 /* set serial console to ttyS0 (ie, DBGU) */
66 at91_set_serial_console(0);
73} 67}
74 68
75static void __init ek_init_irq(void) 69static void __init ek_init_irq(void)
@@ -239,6 +233,35 @@ static void __init ek_add_device_ts(void) {}
239#endif 233#endif
240 234
241/* 235/*
236 * Audio
237 */
238static struct at73c213_board_info at73c213_data = {
239 .ssc_id = 1,
240 .shortname = "AT91SAM9261-EK external DAC",
241};
242
243#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
244static void __init at73c213_set_clk(struct at73c213_board_info *info)
245{
246 struct clk *pck2;
247 struct clk *plla;
248
249 pck2 = clk_get(NULL, "pck2");
250 plla = clk_get(NULL, "plla");
251
252 /* AT73C213 MCK Clock */
253 at91_set_B_periph(AT91_PIN_PB31, 0); /* PCK2 */
254
255 clk_set_parent(pck2, plla);
256 clk_put(plla);
257
258 info->dac_clk = pck2;
259}
260#else
261static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
262#endif
263
264/*
242 * SPI devices 265 * SPI devices
243 */ 266 */
244static struct spi_board_info ek_spi_devices[] = { 267static struct spi_board_info ek_spi_devices[] = {
@@ -256,6 +279,7 @@ static struct spi_board_info ek_spi_devices[] = {
256 .bus_num = 0, 279 .bus_num = 0,
257 .platform_data = &ads_info, 280 .platform_data = &ads_info,
258 .irq = AT91SAM9261_ID_IRQ0, 281 .irq = AT91SAM9261_ID_IRQ0,
282 .controller_data = (void *) AT91_PIN_PA28, /* CS pin */
259 }, 283 },
260#endif 284#endif
261#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) 285#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
@@ -271,6 +295,9 @@ static struct spi_board_info ek_spi_devices[] = {
271 .chip_select = 3, 295 .chip_select = 3,
272 .max_speed_hz = 10 * 1000 * 1000, 296 .max_speed_hz = 10 * 1000 * 1000,
273 .bus_num = 0, 297 .bus_num = 0,
298 .mode = SPI_MODE_1,
299 .platform_data = &at73c213_data,
300 .controller_data = (void*) AT91_PIN_PA29, /* default for CS3 is PA6, but it must be PA29 */
274 }, 301 },
275#endif 302#endif
276}; 303};
@@ -460,6 +487,29 @@ static void __init ek_add_device_buttons(void)
460static void __init ek_add_device_buttons(void) {} 487static void __init ek_add_device_buttons(void) {}
461#endif 488#endif
462 489
490/*
491 * LEDs
492 */
493static struct gpio_led ek_leds[] = {
494 { /* "bottom" led, green, userled1 to be defined */
495 .name = "ds7",
496 .gpio = AT91_PIN_PA14,
497 .active_low = 1,
498 .default_trigger = "none",
499 },
500 { /* "top" led, green, userled2 to be defined */
501 .name = "ds8",
502 .gpio = AT91_PIN_PA13,
503 .active_low = 1,
504 .default_trigger = "none",
505 },
506 { /* "power" led, yellow */
507 .name = "ds1",
508 .gpio = AT91_PIN_PA23,
509 .default_trigger = "heartbeat",
510 }
511};
512
463static void __init ek_board_init(void) 513static void __init ek_board_init(void)
464{ 514{
465 /* Serial */ 515 /* Serial */
@@ -481,6 +531,9 @@ static void __init ek_board_init(void)
481 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); 531 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
482 /* Touchscreen */ 532 /* Touchscreen */
483 ek_add_device_ts(); 533 ek_add_device_ts();
534 /* SSC (to AT73C213) */
535 at73c213_set_clk(&at73c213_data);
536 at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX);
484#else 537#else
485 /* MMC */ 538 /* MMC */
486 at91_add_device_mmc(0, &ek_mmc_data); 539 at91_add_device_mmc(0, &ek_mmc_data);
@@ -489,6 +542,8 @@ static void __init ek_board_init(void)
489 at91_add_device_lcdc(&ek_lcdc_data); 542 at91_add_device_lcdc(&ek_lcdc_data);
490 /* Push Buttons */ 543 /* Push Buttons */
491 ek_add_device_buttons(); 544 ek_add_device_buttons();
545 /* LEDs */
546 at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds));
492} 547}
493 548
494MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK") 549MACHINE_START(AT91SAM9261EK, "Atmel AT91SAM9261-EK")