From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>,
Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Rabeeh Khoury <rabeeh@solid-run.com>,
Ian Molton <ian.molton@codethink.co.uk>,
Maen Suleiman <maen@marvell.com>, Olof Johansson <olof@lixom.net>
Subject: [PATCH v3 4/6] ARM: dove: add device tree based machine descriptor
Date: Wed, 15 Aug 2012 19:07:33 +0200 [thread overview]
Message-ID: <1345050455-32643-5-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1345050455-32643-1-git-send-email-sebastian.hesselbarth@gmail.com>
This adds a generic DT_MACHINE for mach-dove. As with other orion based
SoCs there still is some glue code required to make all internal devices
work, i.e. auxdata is provided to pass clocks to corresponding device
drivers.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: Rabeeh Khoury <rabeeh@solid-run.com>
Cc: Ian Molton <ian.molton@codethink.co.uk>
Cc: Maen Suleiman <maen@marvell.com>
Cc: Olof Johansson <olof@lixom.net>
---
arch/arm/mach-dove/Kconfig | 7 +++++
arch/arm/mach-dove/common.c | 67 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 74 insertions(+)
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig
index dd937c5..00154e7 100644
--- a/arch/arm/mach-dove/Kconfig
+++ b/arch/arm/mach-dove/Kconfig
@@ -15,6 +15,13 @@ config MACH_CM_A510
Say 'Y' here if you want your kernel to support the
CompuLab CM-A510 Board.
+config MACH_DOVE_DT
+ bool "Marvell Dove Flattened Device Tree"
+ select USE_OF
+ help
+ Say 'Y' here if you want your kernel to support the
+ Marvell Dove using flattened device tree.
+
endmenu
endif
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 66689ce..810ea15 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -16,6 +16,8 @@
#include <linux/clk-provider.h>
#include <linux/ata_platform.h>
#include <linux/gpio.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
#include <asm/page.h>
#include <asm/setup.h>
#include <asm/timex.h>
@@ -29,6 +31,7 @@
#include <asm/mach/arch.h>
#include <linux/irq.h>
#include <plat/time.h>
+#include <plat/irq.h>
#include <plat/ehci-orion.h>
#include <plat/common.h>
#include <plat/addr-map.h>
@@ -379,3 +382,67 @@ void dove_restart(char mode, const char *cmd)
while (1)
;
}
+
+#if defined(CONFIG_MACH_DOVE_DT)
+/*
+ * Auxdata required until real OF clock provider
+ */
+struct of_dev_auxdata dove_auxdata_lookup[] __initdata = {
+ OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
+ OF_DEV_AUXDATA("marvell,orion-spi", 0xf1014600, "orion_spi.1", NULL),
+ OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
+ OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
+ NULL),
+ OF_DEV_AUXDATA("marvell,orion-sata", 0xf10a0000, "sata_mv.0", NULL),
+ OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1092000, "sdhci-dove.0", NULL),
+ OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1090000, "sdhci-dove.1", NULL),
+ {},
+};
+
+static struct mv643xx_eth_platform_data dove_dt_ge00_data = {
+ .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT,
+};
+
+static void __init dove_dt_init(void)
+{
+ pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n",
+ (dove_tclk + 499999) / 1000000);
+
+#ifdef CONFIG_CACHE_TAUROS2
+ tauros2_init();
+#endif
+ dove_setup_cpu_mbus();
+
+ /* Setup root of clk tree */
+ dove_clk_init();
+
+ /* Internal devices not ported to DT yet */
+ dove_rtc_init();
+ dove_xor0_init();
+ dove_xor1_init();
+
+ dove_ge00_init(&dove_dt_ge00_data);
+ dove_ehci0_init();
+ dove_ehci1_init();
+ dove_pcie_init(1, 1);
+ dove_crypto_init();
+
+ of_platform_populate(NULL, of_default_bus_match_table,
+ dove_auxdata_lookup, NULL);
+}
+
+static const char * const dove_dt_board_compat[] = {
+ "marvell,dove",
+ NULL
+};
+
+DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
+ .map_io = dove_map_io,
+ .init_early = dove_init_early,
+ .init_irq = orion_dt_init_irq,
+ .timer = &dove_timer,
+ .init_machine = dove_dt_init,
+ .restart = dove_restart,
+ .dt_compat = dove_dt_board_compat,
+MACHINE_END
+#endif
--
1.7.10.4
next prev parent reply other threads:[~2012-08-15 17:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 12:23 [PATCH 0/6] ARM: dove: DT support for Marvell Dove Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 1/6] ARM: dove: unify clock setup Sebastian Hesselbarth
2012-08-11 9:12 ` Andrew Lunn
2012-08-11 9:38 ` Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 2/6] ARM: dove: add clock gating control Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 3/6] ARM: dove: add crypto engine Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 4/6] ARM: dove: add device tree based machine descriptor Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 5/6] ARM: dove: add device tree descriptors Sebastian Hesselbarth
2012-08-06 12:23 ` [PATCH 6/6] ARM: dove: SolidRun CuBox DT Sebastian Hesselbarth
2012-08-06 14:02 ` [PATCH 0/6] ARM: dove: DT support for Marvell Dove Arnd Bergmann
2012-08-06 14:16 ` Sebastian Hesselbarth
2012-08-06 14:23 ` Arnd Bergmann
2012-08-07 16:53 ` Russell King - ARM Linux
2012-08-07 19:32 ` Sebastian Hesselbarth
2012-08-11 10:35 ` [PATCH v2 " Sebastian Hesselbarth
2012-08-11 10:35 ` [PATCH v2 1/6] ARM: dove: unify clock setup Sebastian Hesselbarth
2012-08-11 10:35 ` [PATCH v2 2/6] ARM: dove: add clock gating control Sebastian Hesselbarth
2012-08-12 15:22 ` Andrew Lunn
2012-08-11 10:35 ` [PATCH v2 3/6] ARM: dove: add crypto engine Sebastian Hesselbarth
2012-08-11 10:35 ` [PATCH v2 4/6] ARM: dove: add device tree based machine descriptor Sebastian Hesselbarth
2012-08-11 10:35 ` [PATCH v2 5/6] ARM: dove: add device tree descriptors Sebastian Hesselbarth
2012-08-11 10:35 ` [PATCH v2 6/6] ARM: dove: SolidRun CuBox DT Sebastian Hesselbarth
2012-08-15 17:07 ` [PATCH v3 0/6] ARM: dove: DT support for Marvell Dove Sebastian Hesselbarth
2012-08-15 17:07 ` [PATCH v3 1/6] ARM: dove: unify clock setup Sebastian Hesselbarth
2012-08-15 17:07 ` [PATCH v3 2/6] ARM: dove: add clock gating control Sebastian Hesselbarth
2012-08-15 17:07 ` [PATCH v3 3/6] ARM: dove: add crypto engine Sebastian Hesselbarth
2012-08-15 17:07 ` Sebastian Hesselbarth [this message]
2012-08-15 17:07 ` [PATCH v3 5/6] ARM: dove: add device tree descriptors Sebastian Hesselbarth
2012-08-15 17:07 ` [PATCH v3 6/6] ARM: dove: SolidRun CuBox DT Sebastian Hesselbarth
2012-09-10 2:41 ` [PATCH v3 0/6] ARM: dove: DT support for Marvell Dove Jason Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1345050455-32643-5-git-send-email-sebastian.hesselbarth@gmail.com \
--to=sebastian.hesselbarth@gmail.com \
--cc=andrew@lunn.ch \
--cc=ian.molton@codethink.co.uk \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=maen@marvell.com \
--cc=olof@lixom.net \
--cc=rabeeh@solid-run.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).