Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[cascardo/linux.git] / arch / arm / mach-dove / board-dt.c
1 /*
2  * arch/arm/mach-dove/board-dt.c
3  *
4  * Marvell Dove 88AP510 System On Chip FDT Board
5  *
6  * This file is licensed under the terms of the GNU General Public
7  * License version 2.  This program is licensed "as is" without any
8  * warranty of any kind, whether express or implied.
9  */
10
11 #include <linux/init.h>
12 #include <linux/clk-provider.h>
13 #include <linux/of.h>
14 #include <linux/of_platform.h>
15 #include <asm/hardware/cache-tauros2.h>
16 #include <asm/mach/arch.h>
17 #include <mach/dove.h>
18 #include <mach/pm.h>
19 #include <plat/common.h>
20 #include "common.h"
21
22 /*
23  * There are still devices that doesn't even know about DT,
24  * get clock gates here and add a clock lookup.
25  */
26 static void __init dove_legacy_clk_init(void)
27 {
28         struct device_node *np = of_find_compatible_node(NULL, NULL,
29                                          "marvell,dove-gating-clock");
30         struct of_phandle_args clkspec;
31
32         clkspec.np = np;
33         clkspec.args_count = 1;
34
35         clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
36         orion_clkdev_add("0", "pcie",
37                          of_clk_get_from_provider(&clkspec));
38
39         clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
40         orion_clkdev_add("1", "pcie",
41                          of_clk_get_from_provider(&clkspec));
42 }
43
44 static void __init dove_dt_init_early(void)
45 {
46         mvebu_mbus_init("marvell,dove-mbus",
47                         BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
48                         DOVE_MC_WINS_BASE, DOVE_MC_WINS_SZ);
49 }
50
51 static void __init dove_dt_init(void)
52 {
53         pr_info("Dove 88AP510 SoC\n");
54
55 #ifdef CONFIG_CACHE_TAUROS2
56         tauros2_init(0);
57 #endif
58         dove_setup_cpu_wins();
59
60         /* Setup clocks for legacy devices */
61         dove_legacy_clk_init();
62
63         /* Internal devices not ported to DT yet */
64         dove_pcie_init(1, 1);
65
66         of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
67 }
68
69 static const char * const dove_dt_board_compat[] = {
70         "marvell,dove",
71         NULL
72 };
73
74 DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
75         .map_io         = dove_map_io,
76         .init_early     = dove_dt_init_early,
77         .init_machine   = dove_dt_init,
78         .restart        = dove_restart,
79         .dt_compat      = dove_dt_board_compat,
80 MACHINE_END