From 5c697664858945b7a67e74e9c196a8f705c9e88f Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 22 Apr 2014 23:26:17 +0200 Subject: ARM: orion5x: convert DT to use the mvebu-mbus driver This commit switches the Orion5x Device Tree files to use the DT representation and probing for the mvebu-mbus driver. The changes are mainly: * Re-organize the DT to follow the same organization as the one used on Armada 370/XP, which is needed for mvebu-mbus to work: a top-level soc { ... } node, which corresponds to the MBus bus, and a sub-node internal-regs { ... } for all peripherals whose register sit only in the "Internal Register Window". This change re-indents by one level the definition of all nodes in the Device Tree, which explains the large change. * Use custom functions orion5x_dt_init_early() and orion5x_dt_init_time() instead of orion5x_init_early() and orion5x_timer_init() as we now want the MBus driver to be probed from the Device Tree. We still use the old-style timer initialization, but that will be changed in a followup commit. Signed-off-by: Thomas Petazzoni Acked-by: Sebastian Hesselbarth Link: https://lkml.kernel.org/r/1398202002-28530-14-git-send-email-thomas.petazzoni@free-electrons.com Signed-off-by: Jason Cooper --- arch/arm/mach-orion5x/board-dt.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-orion5x') diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c index c134a82..7f00897 100644 --- a/arch/arm/mach-orion5x/board-dt.c +++ b/arch/arm/mach-orion5x/board-dt.c @@ -15,10 +15,14 @@ #include #include #include +#include #include #include +#include #include +#include #include +#include #include "common.h" static struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = { @@ -31,6 +35,16 @@ static struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = { {}, }; +static void orion5x_dt_init_early(void) +{ + orion_time_set_base(TIMER_VIRT_BASE); +} + +static void orion5x_dt_init_time(void) +{ + orion5x_timer_init(); +} + static void __init orion5x_dt_init(void) { char *dev_name; @@ -39,6 +53,8 @@ static void __init orion5x_dt_init(void) orion5x_id(&dev, &rev, &dev_name); printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); + BUG_ON(mvebu_mbus_dt_init()); + /* * Setup Orion address map */ @@ -71,9 +87,9 @@ static const char *orion5x_dt_compat[] = { DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)") /* Maintainer: Thomas Petazzoni */ .map_io = orion5x_map_io, - .init_early = orion5x_init_early, + .init_early = orion5x_dt_init_early, .init_irq = orion_dt_init_irq, - .init_time = orion5x_timer_init, + .init_time = orion5x_dt_init_time, .init_machine = orion5x_dt_init, .restart = orion5x_restart, .dt_compat = orion5x_dt_compat, -- cgit v1.1