Commit | Line | Data |
---|---|---|
1bffb4a8 TP |
1 | /* |
2 | * Copyright 2012 (C), Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | |
3 | * | |
4 | * arch/arm/mach-orion5x/board-dt.c | |
5 | * | |
6 | * Flattened Device Tree board initialization | |
7 | * | |
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> | |
15 | #include <linux/of.h> | |
16 | #include <linux/of_platform.h> | |
f7b861b7 | 17 | #include <linux/cpu.h> |
5c697664 | 18 | #include <linux/mbus.h> |
98d4db26 | 19 | #include <linux/clk-provider.h> |
1bffb4a8 TP |
20 | #include <asm/system_misc.h> |
21 | #include <asm/mach/arch.h> | |
5c697664 | 22 | #include <asm/mach/map.h> |
1bffb4a8 | 23 | #include <mach/orion5x.h> |
5c697664 | 24 | #include <mach/bridge-regs.h> |
1bffb4a8 | 25 | #include <plat/irq.h> |
5c697664 | 26 | #include <plat/time.h> |
1bffb4a8 TP |
27 | #include "common.h" |
28 | ||
42366666 | 29 | static struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = { |
1bffb4a8 TP |
30 | OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), |
31 | OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", | |
32 | NULL), | |
33 | OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), | |
34 | OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), | |
35 | OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL), | |
36 | {}, | |
37 | }; | |
38 | ||
5c697664 TP |
39 | static void orion5x_dt_init_early(void) |
40 | { | |
41 | orion_time_set_base(TIMER_VIRT_BASE); | |
42 | } | |
43 | ||
44 | static void orion5x_dt_init_time(void) | |
45 | { | |
46 | orion5x_timer_init(); | |
98d4db26 | 47 | of_clk_init(NULL); |
5c697664 TP |
48 | } |
49 | ||
1bffb4a8 TP |
50 | static void __init orion5x_dt_init(void) |
51 | { | |
52 | char *dev_name; | |
53 | u32 dev, rev; | |
54 | ||
55 | orion5x_id(&dev, &rev, &dev_name); | |
56 | printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); | |
57 | ||
5c697664 TP |
58 | BUG_ON(mvebu_mbus_dt_init()); |
59 | ||
1bffb4a8 TP |
60 | /* |
61 | * Setup Orion address map | |
62 | */ | |
5d1190ea | 63 | orion5x_setup_wins(); |
1bffb4a8 | 64 | |
1bffb4a8 TP |
65 | /* |
66 | * Don't issue "Wait for Interrupt" instruction if we are | |
67 | * running on D0 5281 silicon. | |
68 | */ | |
69 | if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) { | |
70 | printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n"); | |
f7b861b7 | 71 | cpu_idle_poll_ctrl(true); |
1bffb4a8 TP |
72 | } |
73 | ||
07f645df TP |
74 | if (of_machine_is_compatible("lacie,ethernet-disk-mini-v2")) |
75 | edmini_v2_init(); | |
76 | ||
1bffb4a8 TP |
77 | of_platform_populate(NULL, of_default_bus_match_table, |
78 | orion5x_auxdata_lookup, NULL); | |
79 | } | |
80 | ||
81 | static const char *orion5x_dt_compat[] = { | |
82 | "marvell,orion5x", | |
83 | NULL, | |
84 | }; | |
85 | ||
86 | DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)") | |
87 | /* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */ | |
88 | .map_io = orion5x_map_io, | |
5c697664 | 89 | .init_early = orion5x_dt_init_early, |
1bffb4a8 | 90 | .init_irq = orion_dt_init_irq, |
5c697664 | 91 | .init_time = orion5x_dt_init_time, |
1bffb4a8 TP |
92 | .init_machine = orion5x_dt_init, |
93 | .restart = orion5x_restart, | |
94 | .dt_compat = orion5x_dt_compat, | |
95 | MACHINE_END |