Merge tag 'dt-part2-v2-for-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / arch / arm / mach-at91 / board-dt-sama5.c
1 /*
2  *  Setup code for SAMA5 Evaluation Kits with Device Tree support
3  *
4  *  Copyright (C) 2013 Atmel,
5  *                2013 Ludovic Desroches <ludovic.desroches@atmel.com>
6  *
7  * Licensed under GPLv2 or later.
8  */
9
10 #include <linux/types.h>
11 #include <linux/init.h>
12 #include <linux/module.h>
13 #include <linux/gpio.h>
14 #include <linux/micrel_phy.h>
15 #include <linux/of.h>
16 #include <linux/of_irq.h>
17 #include <linux/of_platform.h>
18 #include <linux/phy.h>
19 #include <linux/clk-provider.h>
20
21 #include <asm/setup.h>
22 #include <asm/irq.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/map.h>
25 #include <asm/mach/irq.h>
26
27 #include "at91_aic.h"
28 #include "generic.h"
29
30 static void __init sama5_dt_timer_init(void)
31 {
32 #if defined(CONFIG_COMMON_CLK)
33         of_clk_init(NULL);
34 #endif
35         at91sam926x_pit_init();
36 }
37
38 static const struct of_device_id irq_of_match[] __initconst = {
39
40         { .compatible = "atmel,sama5d3-aic", .data = at91_aic5_of_init },
41         { /*sentinel*/ }
42 };
43
44 static void __init at91_dt_init_irq(void)
45 {
46         of_irq_init(irq_of_match);
47 }
48
49 static void __init sama5_dt_device_init(void)
50 {
51         of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
52 }
53
54 static const char *sama5_dt_board_compat[] __initdata = {
55         "atmel,sama5",
56         NULL
57 };
58
59 DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
60         /* Maintainer: Atmel */
61         .init_time      = sama5_dt_timer_init,
62         .map_io         = at91_map_io,
63         .handle_irq     = at91_aic5_handle_irq,
64         .init_early     = at91_dt_initialize,
65         .init_irq       = at91_dt_init_irq,
66         .init_machine   = sama5_dt_device_init,
67         .dt_compat      = sama5_dt_board_compat,
68 MACHINE_END