blob: 87856b5a397d01b433ac2313191b2a5107301929 [file] [log] [blame]
Jason Cooper3d468b62012-02-27 16:07:13 +00001/*
2 * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
3 *
4 * arch/arm/mach-kirkwood/board-dt.c
5 *
Jason Cooper6fa6b872012-03-15 00:52:31 +00006 * Flattened Device Tree board initialization
Jason Cooper3d468b62012-02-27 16:07:13 +00007 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
Jason Cooper3d468b62012-02-27 16:07:13 +000015#include <linux/of.h>
Jason Cooper3d468b62012-02-27 16:07:13 +000016#include <linux/of_platform.h>
Jason Cooper3d468b62012-02-27 16:07:13 +000017#include <asm/mach/arch.h>
Jason Cooper2b45e052012-02-29 17:39:08 +000018#include <asm/mach/map.h>
Jason Cooper2b45e052012-02-29 17:39:08 +000019#include <mach/bridge-regs.h>
Jason Cooper3d468b62012-02-27 16:07:13 +000020#include "common.h"
Jason Cooper3d468b62012-02-27 16:07:13 +000021
22static struct of_device_id kirkwood_dt_match_table[] __initdata = {
23 { .compatible = "simple-bus", },
24 { }
25};
26
Jason Cooper3d468b62012-02-27 16:07:13 +000027static void __init kirkwood_dt_init(void)
28{
Jason Cooper2b45e052012-02-29 17:39:08 +000029 pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);
30
31 /*
32 * Disable propagation of mbus errors to the CPU local bus,
33 * as this causes mbus errors (which can occur for example
34 * for PCI aborts) to throw CPU aborts, which we're not set
35 * up to deal with.
36 */
37 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
38
39 kirkwood_setup_cpu_mbus();
40
41#ifdef CONFIG_CACHE_FEROCEON_L2
42 kirkwood_l2_init();
43#endif
44
Andrew Lunn2f129bf2011-12-15 08:15:07 +010045 /* Setup root of clk tree */
46 kirkwood_clk_init();
47
Jason Cooper2b45e052012-02-29 17:39:08 +000048 /* internal devices that every board has */
Jason Cooper2b45e052012-02-29 17:39:08 +000049 kirkwood_wdt_init();
50 kirkwood_xor0_init();
51 kirkwood_xor1_init();
52 kirkwood_crypto_init();
53
54#ifdef CONFIG_KEXEC
55 kexec_reinit = kirkwood_enable_pcie;
56#endif
Jason Cooper3d468b62012-02-27 16:07:13 +000057
58 if (of_machine_is_compatible("globalscale,dreamplug"))
59 dreamplug_init();
60
61 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
62}
63
64static const char *kirkwood_dt_board_compat[] = {
65 "globalscale,dreamplug",
66 NULL
67};
68
69DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
70 /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
71 .map_io = kirkwood_map_io,
72 .init_early = kirkwood_init_early,
73 .init_irq = kirkwood_init_irq,
74 .timer = &kirkwood_timer,
75 .init_machine = kirkwood_dt_init,
76 .restart = kirkwood_restart,
77 .dt_compat = kirkwood_dt_board_compat,
78MACHINE_END