aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-16 10:39:45 -0500
committerJason Cooper <jason@lakedaemon.net>2012-11-21 16:00:45 -0500
commit1bffb4a8729838f5ee27364803406416459c3252 (patch)
tree5c8c1c63d843d902c92d03fc90edff3f0e77b29b /arch/arm/mach-orion5x
parent9973978614f6cdec2ba52ce161a4bd084b252267 (diff)
arm: orion5x: basic Device Tree support
This commit adds basic DT support for the Orion5x SoC family. It adds an orion5x.dtsi description of the Orion5x SoC as well as the needed DT_MACHINE structure to support boards converted to DT in the future. So far, the Device Tree contains the interrupt controller, the GPIO bank, the UART controllers, the SPI controller, the watchdog, the SATA controller, the I2C controller and the cryptographic engine. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested by: Maxime Hadjinlian <mhadjinlian@lacie.com> Acked-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm/mach-orion5x')
-rw-r--r--arch/arm/mach-orion5x/Kconfig7
-rw-r--r--arch/arm/mach-orion5x/Makefile2
-rw-r--r--arch/arm/mach-orion5x/board-dt.c76
-rw-r--r--arch/arm/mach-orion5x/common.c4
-rw-r--r--arch/arm/mach-orion5x/common.h2
5 files changed, 89 insertions, 2 deletions
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
index 0673f0c10432..0910c3bd0c99 100644
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -2,6 +2,13 @@ if ARCH_ORION5X
2 2
3menu "Orion Implementations" 3menu "Orion Implementations"
4 4
5config ARCH_ORION5X_DT
6 bool "Marvell Orion5x Flattened Device Tree"
7 select USE_OF
8 help
9 Say 'Y' here if you want your kernel to support the
10 Marvell Orion5x using flattened device tree.
11
5config MACH_DB88F5281 12config MACH_DB88F5281
6 bool "Marvell Orion-2 Development Board" 13 bool "Marvell Orion-2 Development Board"
7 select I2C_BOARDINFO 14 select I2C_BOARDINFO
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
index 7f18cdacd487..843e6deb66d0 100644
--- a/arch/arm/mach-orion5x/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -22,3 +22,5 @@ obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o
22obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o 22obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o
23obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o 23obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o
24obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o 24obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o
25
26obj-$(CONFIG_ARCH_ORION5X_DT) += board-dt.o
diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c
new file mode 100644
index 000000000000..a26397f58f1f
--- /dev/null
+++ b/arch/arm/mach-orion5x/board-dt.c
@@ -0,0 +1,76 @@
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>
17#include <asm/system_misc.h>
18#include <asm/mach/arch.h>
19#include <mach/orion5x.h>
20#include <plat/irq.h>
21#include "common.h"
22
23struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = {
24 OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
25 OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
26 NULL),
27 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
28 OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL),
29 OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL),
30 {},
31};
32
33static void __init orion5x_dt_init(void)
34{
35 char *dev_name;
36 u32 dev, rev;
37
38 orion5x_id(&dev, &rev, &dev_name);
39 printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
40
41 /*
42 * Setup Orion address map
43 */
44 orion5x_setup_cpu_mbus_bridge();
45
46 /* Setup root of clk tree */
47 clk_init();
48
49 /*
50 * Don't issue "Wait for Interrupt" instruction if we are
51 * running on D0 5281 silicon.
52 */
53 if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) {
54 printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
55 disable_hlt();
56 }
57
58 of_platform_populate(NULL, of_default_bus_match_table,
59 orion5x_auxdata_lookup, NULL);
60}
61
62static const char *orion5x_dt_compat[] = {
63 "marvell,orion5x",
64 NULL,
65};
66
67DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)")
68 /* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */
69 .map_io = orion5x_map_io,
70 .init_early = orion5x_init_early,
71 .init_irq = orion_dt_init_irq,
72 .timer = &orion5x_timer,
73 .init_machine = orion5x_dt_init,
74 .restart = orion5x_restart,
75 .dt_compat = orion5x_dt_compat,
76MACHINE_END
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index b3eb3da01160..550f92320afb 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -65,7 +65,7 @@ void __init orion5x_map_io(void)
65 ****************************************************************************/ 65 ****************************************************************************/
66static struct clk *tclk; 66static struct clk *tclk;
67 67
68static void __init clk_init(void) 68void __init clk_init(void)
69{ 69{
70 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT, 70 tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT,
71 orion5x_tclk); 71 orion5x_tclk);
@@ -236,7 +236,7 @@ struct sys_timer orion5x_timer = {
236/* 236/*
237 * Identify device ID and rev from PCIe configuration header space '0'. 237 * Identify device ID and rev from PCIe configuration header space '0'.
238 */ 238 */
239static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name) 239void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name)
240{ 240{
241 orion5x_pcie_id(dev, rev); 241 orion5x_pcie_id(dev, rev);
242 242
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index 31bab92ce038..2033b79089a7 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -12,6 +12,8 @@ void orion5x_map_io(void);
12void orion5x_init_early(void); 12void orion5x_init_early(void);
13void orion5x_init_irq(void); 13void orion5x_init_irq(void);
14void orion5x_init(void); 14void orion5x_init(void);
15void orion5x_id(u32 *dev, u32 *rev, char **dev_name);
16void clk_init(void);
15extern int orion5x_tclk; 17extern int orion5x_tclk;
16extern struct sys_timer orion5x_timer; 18extern struct sys_timer orion5x_timer;
17 19