aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-at91/Kconfig8
-rw-r--r--arch/arm/mach-at91/Makefile1
-rw-r--r--arch/arm/mach-at91/board-rm9200-dt.c59
-rw-r--r--arch/arm/mach-at91/generic.h1
-rw-r--r--arch/arm/mach-at91/setup.c14
5 files changed, 83 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 6d4de486df88..d37dd5c2c64f 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -500,6 +500,14 @@ endif
500 500
501comment "Generic Board Type" 501comment "Generic Board Type"
502 502
503config MACH_AT91RM9200_DT
504 bool "Atmel AT91RM9200 Evaluation Kits with device-tree support"
505 depends on SOC_AT91RM9200
506 select USE_OF
507 help
508 Select this if you want to experiment device-tree with
509 an Atmel RM9200 Evaluation Kit.
510
503config MACH_AT91SAM_DT 511config MACH_AT91SAM_DT
504 bool "Atmel AT91SAM Evaluation Kits with device-tree support" 512 bool "Atmel AT91SAM Evaluation Kits with device-tree support"
505 depends on SOC_AT91SAM9 513 depends on SOC_AT91SAM9
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 3bb7a51efc9d..b38a1dcb79b8 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -88,6 +88,7 @@ obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o
88obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o 88obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o
89 89
90# AT91SAM board with device-tree 90# AT91SAM board with device-tree
91obj-$(CONFIG_MACH_AT91RM9200_DT) += board-rm9200-dt.o
91obj-$(CONFIG_MACH_AT91SAM_DT) += board-dt.o 92obj-$(CONFIG_MACH_AT91SAM_DT) += board-dt.o
92 93
93# AT91X40 board-specific support 94# AT91X40 board-specific support
diff --git a/arch/arm/mach-at91/board-rm9200-dt.c b/arch/arm/mach-at91/board-rm9200-dt.c
new file mode 100644
index 000000000000..47e91d9706b3
--- /dev/null
+++ b/arch/arm/mach-at91/board-rm9200-dt.c
@@ -0,0 +1,59 @@
1/*
2 * Setup code for AT91RM9200 Evaluation Kits with Device Tree support
3 *
4 * Copyright (C) 2011 Atmel,
5 * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
6 * 2012 Joachim Eastwood <manabian@gmail.com>
7 *
8 * Licensed under GPLv2 or later.
9 */
10
11#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/module.h>
14#include <linux/gpio.h>
15#include <linux/of.h>
16#include <linux/of_irq.h>
17#include <linux/of_platform.h>
18
19#include <mach/board.h>
20#include <mach/at91_aic.h>
21
22#include <asm/setup.h>
23#include <asm/irq.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26#include <asm/mach/irq.h>
27
28#include "generic.h"
29
30
31static const struct of_device_id irq_of_match[] __initconst = {
32 { .compatible = "atmel,at91rm9200-aic", .data = at91_aic_of_init },
33 { /*sentinel*/ }
34};
35
36static void __init at91rm9200_dt_init_irq(void)
37{
38 of_irq_init(irq_of_match);
39}
40
41static void __init at91rm9200_dt_device_init(void)
42{
43 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
44}
45
46static const char *at91rm9200_dt_board_compat[] __initdata = {
47 "atmel,at91rm9200",
48 NULL
49};
50
51DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
52 .timer = &at91rm9200_timer,
53 .map_io = at91_map_io,
54 .handle_irq = at91_aic_handle_irq,
55 .init_early = at91rm9200_dt_initialize,
56 .init_irq = at91rm9200_dt_init_irq,
57 .init_machine = at91rm9200_dt_device_init,
58 .dt_compat = at91rm9200_dt_board_compat,
59MACHINE_END
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index f49650677653..9bb5ce5fb225 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -20,6 +20,7 @@ extern void __init at91_init_sram(int bank, unsigned long base,
20extern void __init at91rm9200_set_type(int type); 20extern void __init at91rm9200_set_type(int type);
21extern void __init at91_initialize(unsigned long main_clock); 21extern void __init at91_initialize(unsigned long main_clock);
22extern void __init at91x40_initialize(unsigned long main_clock); 22extern void __init at91x40_initialize(unsigned long main_clock);
23extern void __init at91rm9200_dt_initialize(void);
23extern void __init at91_dt_initialize(void); 24extern void __init at91_dt_initialize(void);
24 25
25 /* Interrupts */ 26 /* Interrupts */
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 523daa92be10..e3f1ea4cff0c 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -339,6 +339,7 @@ static void at91_dt_rstc(void)
339} 339}
340 340
341static struct of_device_id ramc_ids[] = { 341static struct of_device_id ramc_ids[] = {
342 { .compatible = "atmel,at91rm9200-sdramc" },
342 { .compatible = "atmel,at91sam9260-sdramc" }, 343 { .compatible = "atmel,at91sam9260-sdramc" },
343 { .compatible = "atmel,at91sam9g45-ddramc" }, 344 { .compatible = "atmel,at91sam9g45-ddramc" },
344 { /*sentinel*/ } 345 { /*sentinel*/ }
@@ -437,6 +438,19 @@ end:
437 of_node_put(np); 438 of_node_put(np);
438} 439}
439 440
441void __init at91rm9200_dt_initialize(void)
442{
443 at91_dt_ramc();
444
445 /* Init clock subsystem */
446 at91_dt_clock_init();
447
448 /* Register the processor-specific clocks */
449 at91_boot_soc.register_clocks();
450
451 at91_boot_soc.init();
452}
453
440void __init at91_dt_initialize(void) 454void __init at91_dt_initialize(void)
441{ 455{
442 at91_dt_rstc(); 456 at91_dt_rstc();