All of lore.kernel.org
 help / color / mirror / Atom feed
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/10] ARM: mvebu: enable the ARM SCU on Armada 375 and Armada 38x
Date: Thu,  6 Mar 2014 17:46:30 +0100	[thread overview]
Message-ID: <1394124395-20030-6-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1394124395-20030-1-git-send-email-thomas.petazzoni@free-electrons.com>

Contrary to the Armada 370 and XP that used the PJ4B Marvell cores,
the Armada 375 and Armada 38x use the ARM Cortex-A9. A consequence of
this is that the unit responsible for the coherency between CPUs is
now the ARM SCU, and not the Marvell coherency unit (which is still
present to do coherency with I/O devices).

Therefore this commit:

 * Ensures that the selection of the Armada 375 or Armada 38x SoC
   support enables the ARM SCU support in the kernel.

 * Make sure to initialize the SCU at boot time.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/mach-mvebu/Kconfig    |  2 ++
 arch/arm/mach-mvebu/board-v7.c | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 884b275a..8634222 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -44,6 +44,7 @@ config MACH_ARMADA_375
 	select ARM_GIC
 	select ARMADA_375_CLK
 	select CPU_V7
+	select HAVE_ARM_SCU
 	select MACH_MVEBU_V7
 	select NEON
 	select PINCTRL_ARMADA_375
@@ -58,6 +59,7 @@ config MACH_ARMADA_38X
 	select ARM_GIC
 	select ARMADA_38X_CLK
 	select CPU_V7
+	select HAVE_ARM_SCU
 	select MACH_MVEBU_V7
 	select NEON
 	select PINCTRL_ARMADA_38X
diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
index e5d4f69..256e6f6 100644
--- a/arch/arm/mach-mvebu/board-v7.c
+++ b/arch/arm/mach-mvebu/board-v7.c
@@ -26,6 +26,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
+#include <asm/smp_scu.h>
 #include "armada-370-xp.h"
 #include "common.h"
 #include "coherency.h"
@@ -37,6 +38,23 @@ static void __init mvebu_map_io(void)
 }
 
 /*
+ * Enables the SCU when available. Obviously, this is only useful on
+ * Cortex-A based SOCs, not on PJ4B based ones.
+ */
+static void __init mvebu_scu_enable(void)
+{
+	void __iomem *scu_base;
+
+	struct device_node *np =
+		of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
+	if (np) {
+		scu_base = of_iomap(np, 0);
+		scu_enable(scu_base);
+		of_node_put(np);
+	}
+}
+
+/*
  * Early versions of Armada 375 SoC have a bug where the BootROM
  * leaves an external data abort pending. The kernel is hit by this
  * data abort as soon as it enters userspace, because it unmasks the
@@ -61,6 +79,7 @@ static void __init mvebu_timer_and_clk_init(void)
 {
 	of_clk_init(NULL);
 	clocksource_of_init();
+	mvebu_scu_enable();
 	coherency_init();
 	BUG_ON(mvebu_mbus_dt_init(coherency_available()));
 #ifdef CONFIG_CACHE_L2X0
-- 
1.8.3.2

  parent reply	other threads:[~2014-03-06 16:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06 16:46 [PATCH 00/10] ARM: mvebu: Hardware coherency support for Armada 375 and 38x Thomas Petazzoni
2014-03-06 16:46 ` [PATCH 01/10] ARM: mvebu: prepare coherency code to support more SOCs Thomas Petazzoni
2014-03-06 16:46 ` [PATCH 02/10] ARM: mvebu: add a coherency_available() call Thomas Petazzoni
2014-03-06 16:46 ` [PATCH 03/10] bus: mvebu: pass the coherency availability information at init time Thomas Petazzoni
2014-03-06 16:46 ` [PATCH 04/10] ARM: mvebu: ARM: mvebu: use of_find_matching_node_and_match() in coherency.c Thomas Petazzoni
2014-03-06 16:46 ` Thomas Petazzoni [this message]
2014-03-06 16:46 ` [PATCH 06/10] ARM: mvebu: add Armada 375 support to the coherency code Thomas Petazzoni
2014-03-06 16:46 ` [PATCH 07/10] ARM: mvebu: implement Armada 375 coherency workaround Thomas Petazzoni
2014-03-06 18:36   ` Jason Cooper
2014-03-06 21:18     ` Thomas Petazzoni
2014-03-06 16:46 ` [PATCH 08/10] ARM: mvebu: add Armada 38x support to the coherency code Thomas Petazzoni
2014-03-06 16:46 ` [PATCH 09/10] ARM: mvebu: enable the coherency fabric on Armada 375 Thomas Petazzoni
2014-03-06 16:46 ` [PATCH 10/10] ARM: mvebu: enable the coherency fabric on Armada 38x Thomas Petazzoni
2014-03-24 15:06 ` [PATCH 00/10] ARM: mvebu: Hardware coherency support for Armada 375 and 38x Thomas Petazzoni
2014-03-25  9:32   ` Andrew Lunn
2014-03-25 10:36     ` Thomas Petazzoni

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=1394124395-20030-6-git-send-email-thomas.petazzoni@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --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.