All of lore.kernel.org
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [Patch v3 05/23] ARM: Kirkwood: Seperate board-dt from common and pcie code.
Date: Wed, 19 Feb 2014 15:12:36 +0100	[thread overview]
Message-ID: <1392819174-11634-6-git-send-email-andrew@lunn.ch> (raw)
In-Reply-To: <1392819174-11634-1-git-send-email-andrew@lunn.ch>

In order to be able to move DT support into mach-mvebu, the DT code
needs to be cleanly separated from common and pcie code. Import the
needed bits of these files into board-dt.c. The "common" code then
becomes purely legacy, supporting none DT boards, so reflect this in
the Makefile targets.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 arch/arm/mach-kirkwood/Makefile   |  3 +-
 arch/arm/mach-kirkwood/board-dt.c | 88 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 88 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index dc22bf5b21ed..3a72c5c6e747 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -1,5 +1,4 @@
-obj-y				+= common.o pcie.o
-obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o
+obj-$(CONFIG_KIRKWOOD_LEGACY)	+= irq.o mpp.o common.o pcie.o
 obj-$(CONFIG_PM)		+= pm.o
 
 obj-$(CONFIG_MACH_D2NET_V2)		+= d2net_v2-setup.o lacie_v2-common.o
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index a0c0ff39788e..64151a4a378f 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -21,11 +21,97 @@
 #include <linux/irqchip.h>
 #include <linux/kexec.h>
 #include <asm/mach/arch.h>
+#include <asm/mach/map.h>
 #include <mach/bridge-regs.h>
 #include <plat/common.h>
-#include "common.h"
+#include <plat/cache-feroceon-l2.h>
+#include <plat/pcie.h>
 #include "pm.h"
 
+static struct map_desc kirkwood_io_desc[] __initdata = {
+	{
+		.virtual	= (unsigned long) KIRKWOOD_REGS_VIRT_BASE,
+		.pfn		= __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE),
+		.length		= KIRKWOOD_REGS_SIZE,
+		.type		= MT_DEVICE,
+	},
+};
+
+static void __init kirkwood_map_io(void)
+{
+	iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc));
+}
+
+static void __init kirkwood_l2_init(void)
+{
+#ifdef CONFIG_CACHE_FEROCEON_L2
+#ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
+	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
+	feroceon_l2_init(1);
+#else
+	writel(readl(L2_CONFIG_REG) & ~L2_WRITETHROUGH, L2_CONFIG_REG);
+	feroceon_l2_init(0);
+#endif
+#endif
+}
+
+static struct resource kirkwood_cpufreq_resources[] = {
+	[0] = {
+		.start  = CPU_CONTROL_PHYS,
+		.end    = CPU_CONTROL_PHYS + 3,
+		.flags  = IORESOURCE_MEM,
+	},
+};
+
+static struct platform_device kirkwood_cpufreq_device = {
+	.name		= "kirkwood-cpufreq",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(kirkwood_cpufreq_resources),
+	.resource	= kirkwood_cpufreq_resources,
+};
+
+static void __init kirkwood_cpufreq_init(void)
+{
+	platform_device_register(&kirkwood_cpufreq_device);
+}
+
+static struct resource kirkwood_cpuidle_resource[] = {
+	{
+		.flags	= IORESOURCE_MEM,
+		.start	= DDR_OPERATION_BASE,
+		.end	= DDR_OPERATION_BASE + 3,
+	},
+};
+
+static struct platform_device kirkwood_cpuidle = {
+	.name		= "kirkwood_cpuidle",
+	.id		= -1,
+	.resource	= kirkwood_cpuidle_resource,
+	.num_resources	= 1,
+};
+
+static void __init kirkwood_cpuidle_init(void)
+{
+	platform_device_register(&kirkwood_cpuidle);
+}
+
+/* Temporary here since mach-mvebu has a function we can use */
+static void kirkwood_restart(enum reboot_mode mode, const char *cmd)
+{
+	/*
+	 * Enable soft reset to assert RSTOUTn.
+	 */
+	writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
+
+	/*
+	 * Assert soft reset.
+	 */
+	writel(SOFT_RESET, SYSTEM_SOFT_RESET);
+
+	while (1)
+		;
+}
+
 #define MV643XX_ETH_MAC_ADDR_LOW	0x0414
 #define MV643XX_ETH_MAC_ADDR_HIGH	0x0418
 
-- 
1.8.5.3

  parent reply	other threads:[~2014-02-19 14:12 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 14:12 [Patch v3 00/23] Move DT kirkwood into mach-mvebu Andrew Lunn
2014-02-19 14:12 ` [Patch v3 01/23] ARM: Kirkwood: Give pm.c its own header file Andrew Lunn
2014-02-19 14:12 ` [Patch v3 02/23] irqchip: Orion: Fix getting generic chip pointer Andrew Lunn
2014-02-19 14:12 ` [Patch v3 03/23] ARM: Kirkwood: Convert mv88f6281gtw_ge switch setup to DT Andrew Lunn
2014-02-19 14:12 ` [Patch v3 04/23] ARM: Kirkwood: Drop printing the SoC type and revision Andrew Lunn
2014-02-19 14:12 ` Andrew Lunn [this message]
2014-02-19 14:12 ` [Patch v3 06/23] ARM: Kirkwood: ioremap the cpu_config register before using it Andrew Lunn
2014-02-19 14:12 ` [Patch v3 07/23] ARM: Kirkwood: ioremap memory control register Andrew Lunn
2014-02-19 14:12 ` [Patch v3 08/23] ARM: MVEBU: Add ARCH_MULTI_V7 to SoCs Andrew Lunn
2014-02-19 14:12 ` [Patch v3 09/23] ARM: Orion: Move cache-feroceon-l2.h out of plat-orion Andrew Lunn
     [not found] ` <1392819174-11634-1-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2014-02-19 14:12   ` [Patch v3 10/23] ARM: MM: Add DT binding for Feroceon L2 cache Andrew Lunn
2014-02-19 14:12     ` Andrew Lunn
     [not found]     ` <1392819174-11634-11-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2014-02-19 18:17       ` Jason Cooper
2014-02-19 18:17         ` Jason Cooper
2014-02-19 14:12 ` [Patch v3 11/23] ARM: Kirkwood: Instantiate L2 cache from DT Andrew Lunn
2014-02-19 14:12 ` [Patch v3 12/23] ARM: Fix default CPU selection for ARCH_MULTI_V5 Andrew Lunn
2014-02-19 14:12 ` [Patch v3 13/23] ARM: Fix MULTI_TLB for feroceon Andrew Lunn
2014-02-19 14:12 ` [Patch v3 14/23] ARM: MM Enable building Feroceon L2 cache controller with ARCH_MVEBU Andrew Lunn
2014-02-19 14:12 ` [Patch v3 15/23] ARM: Move kirkwood DT boards into mach-mvebu Andrew Lunn
2014-02-19 14:12 ` [Patch v3 16/23] ARM: MVEBU: Let kirkwood use the system controller for restart Andrew Lunn
2014-02-19 14:12 ` [Patch v3 17/23] ARM: MVEBU: Instantiate system controller in kirkwood.dtsi Andrew Lunn
2014-02-19 14:12 ` [Patch v3 18/23] drivers: Enable building of Kirkwood drivers for mach-mvebu Andrew Lunn
2014-02-20  4:00   ` Mark Brown
2014-02-20  5:26   ` Kishon Vijay Abraham I
2014-02-20  8:55   ` Daniel Lezcano
2014-02-19 14:12 ` [Patch v3 19/23] ARM: MVEBU: Enable mvebu-soc-id on Kirkwood Andrew Lunn
2014-02-19 14:12 ` [Patch v3 20/23] ARM: config: Add a multi_v5_defconfig Andrew Lunn
2014-02-19 14:19   ` Alexander Shiyan
2014-02-19 14:24     ` Andrew Lunn
2014-02-19 14:54     ` Arnd Bergmann
2014-02-19 15:08       ` Alexander Shiyan
2014-02-19 15:54         ` Arnd Bergmann
2014-02-19 15:59           ` Alexander Shiyan
2014-02-19 16:42             ` Andrew Lunn
2014-02-19 14:12 ` [Patch v3 21/23] ARM: MVEBU: Simplifiy headers and make local Andrew Lunn
2014-02-19 18:20   ` Jason Cooper
2014-02-19 14:12 ` [Patch v3 22/23] ARM: config: Add mvebu_v5_defconfig Andrew Lunn
2014-02-19 14:12 ` [Patch v3 23/23] ARM: Kirkwood: Remove DT support Andrew Lunn

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=1392819174-11634-6-git-send-email-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.