aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91cap9_devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/at91cap9_devices.c')
-rw-r--r--arch/arm/mach-at91/at91cap9_devices.c70
1 files changed, 62 insertions, 8 deletions
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
index c50fad9cd143..f1a80d74a4b6 100644
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ b/arch/arm/mach-at91/at91cap9_devices.c
@@ -16,15 +16,15 @@
16 16
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/mtd/physmap.h> 19#include <linux/i2c-gpio.h>
20 20
21#include <video/atmel_lcdc.h> 21#include <video/atmel_lcdc.h>
22 22
23#include <asm/arch/board.h> 23#include <asm/arch/board.h>
24#include <asm/arch/gpio.h> 24#include <asm/arch/gpio.h>
25#include <asm/arch/at91cap9.h> 25#include <asm/arch/at91cap9.h>
26#include <asm/arch/at91sam926x_mc.h>
27#include <asm/arch/at91cap9_matrix.h> 26#include <asm/arch/at91cap9_matrix.h>
27#include <asm/arch/at91sam9_smc.h>
28 28
29#include "generic.h" 29#include "generic.h"
30 30
@@ -283,10 +283,15 @@ static struct at91_nand_data nand_data;
283#define NAND_BASE AT91_CHIPSELECT_3 283#define NAND_BASE AT91_CHIPSELECT_3
284 284
285static struct resource nand_resources[] = { 285static struct resource nand_resources[] = {
286 { 286 [0] = {
287 .start = NAND_BASE, 287 .start = NAND_BASE,
288 .end = NAND_BASE + SZ_256M - 1, 288 .end = NAND_BASE + SZ_256M - 1,
289 .flags = IORESOURCE_MEM, 289 .flags = IORESOURCE_MEM,
290 },
291 [1] = {
292 .start = AT91_BASE_SYS + AT91_ECC,
293 .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
294 .flags = IORESOURCE_MEM,
290 } 295 }
291}; 296};
292 297
@@ -344,6 +349,7 @@ void __init at91_add_device_nand(struct at91_nand_data *data)
344void __init at91_add_device_nand(struct at91_nand_data *data) {} 349void __init at91_add_device_nand(struct at91_nand_data *data) {}
345#endif 350#endif
346 351
352
347/* -------------------------------------------------------------------- 353/* --------------------------------------------------------------------
348 * TWI (i2c) 354 * TWI (i2c)
349 * -------------------------------------------------------------------- */ 355 * -------------------------------------------------------------------- */
@@ -532,13 +538,59 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
532 538
533 539
534/* -------------------------------------------------------------------- 540/* --------------------------------------------------------------------
541 * Timer/Counter block
542 * -------------------------------------------------------------------- */
543
544#ifdef CONFIG_ATMEL_TCLIB
545
546static struct resource tcb_resources[] = {
547 [0] = {
548 .start = AT91CAP9_BASE_TCB0,
549 .end = AT91CAP9_BASE_TCB0 + SZ_16K - 1,
550 .flags = IORESOURCE_MEM,
551 },
552 [1] = {
553 .start = AT91CAP9_ID_TCB,
554 .end = AT91CAP9_ID_TCB,
555 .flags = IORESOURCE_IRQ,
556 },
557};
558
559static struct platform_device at91cap9_tcb_device = {
560 .name = "atmel_tcb",
561 .id = 0,
562 .resource = tcb_resources,
563 .num_resources = ARRAY_SIZE(tcb_resources),
564};
565
566static void __init at91_add_device_tc(void)
567{
568 /* this chip has one clock and irq for all three TC channels */
569 at91_clock_associate("tcb_clk", &at91cap9_tcb_device.dev, "t0_clk");
570 platform_device_register(&at91cap9_tcb_device);
571}
572#else
573static void __init at91_add_device_tc(void) { }
574#endif
575
576
577/* --------------------------------------------------------------------
535 * RTT 578 * RTT
536 * -------------------------------------------------------------------- */ 579 * -------------------------------------------------------------------- */
537 580
581static struct resource rtt_resources[] = {
582 {
583 .start = AT91_BASE_SYS + AT91_RTT,
584 .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
585 .flags = IORESOURCE_MEM,
586 }
587};
588
538static struct platform_device at91cap9_rtt_device = { 589static struct platform_device at91cap9_rtt_device = {
539 .name = "at91_rtt", 590 .name = "at91_rtt",
540 .id = -1, 591 .id = 0,
541 .num_resources = 0, 592 .resource = rtt_resources,
593 .num_resources = ARRAY_SIZE(rtt_resources),
542}; 594};
543 595
544static void __init at91_add_device_rtt(void) 596static void __init at91_add_device_rtt(void)
@@ -990,7 +1042,7 @@ static inline void configure_usart2_pins(unsigned pins)
990 at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */ 1042 at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */
991} 1043}
992 1044
993static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1045static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
994struct platform_device *atmel_default_console_device; /* the serial console device */ 1046struct platform_device *atmel_default_console_device; /* the serial console device */
995 1047
996void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) 1048void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
@@ -1031,8 +1083,6 @@ void __init at91_set_serial_console(unsigned portnr)
1031{ 1083{
1032 if (portnr < ATMEL_MAX_UART) 1084 if (portnr < ATMEL_MAX_UART)
1033 atmel_default_console_device = at91_uarts[portnr]; 1085 atmel_default_console_device = at91_uarts[portnr];
1034 if (!atmel_default_console_device)
1035 printk(KERN_INFO "AT91: No default serial console defined.\n");
1036} 1086}
1037 1087
1038void __init at91_add_device_serial(void) 1088void __init at91_add_device_serial(void)
@@ -1043,6 +1093,9 @@ void __init at91_add_device_serial(void)
1043 if (at91_uarts[i]) 1093 if (at91_uarts[i])
1044 platform_device_register(at91_uarts[i]); 1094 platform_device_register(at91_uarts[i]);
1045 } 1095 }
1096
1097 if (!atmel_default_console_device)
1098 printk(KERN_INFO "AT91: No default serial console defined.\n");
1046} 1099}
1047#else 1100#else
1048void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} 1101void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
@@ -1060,6 +1113,7 @@ static int __init at91_add_standard_devices(void)
1060{ 1113{
1061 at91_add_device_rtt(); 1114 at91_add_device_rtt();
1062 at91_add_device_watchdog(); 1115 at91_add_device_watchdog();
1116 at91_add_device_tc();
1063 return 0; 1117 return 0;
1064} 1118}
1065 1119