All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lubomir Rintel <lkundrak@v3.sk>
To: "To : Olof Johansson" <olof@lixom.net>
Cc: "Cc : Rob Herring" <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Russell King <linux@armlinux.org.uk>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	Lubomir Rintel <lkundrak@v3.sk>
Subject: [PATCH v3 12/16] ARM: mmp: add SMP support
Date: Sat, 31 Aug 2019 00:07:39 +0200	[thread overview]
Message-ID: <20190830220743.439670-13-lkundrak@v3.sk> (raw)
In-Reply-To: <20190830220743.439670-1-lkundrak@v3.sk>

Used to bring up the second core on MMP3.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

---
Changes since v2:
- Wrap secondary_startup with __pa_symbol(), instead of
  SW_BRANCH_VIRT_ADDR.

Changes since v1:
- Wrap SW_BRANCH_VIRT_ADDR with __pa_symbol()

 arch/arm/mach-mmp/Makefile  |  3 +++
 arch/arm/mach-mmp/platsmp.c | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 arch/arm/mach-mmp/platsmp.c

diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile
index 322c1c97dc900..7b3a7f979eece 100644
--- a/arch/arm/mach-mmp/Makefile
+++ b/arch/arm/mach-mmp/Makefile
@@ -22,6 +22,9 @@ ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_CPU_PXA910)	+= pm-pxa910.o
 obj-$(CONFIG_CPU_MMP2)		+= pm-mmp2.o
 endif
+ifeq ($(CONFIG_SMP),y)
+obj-$(CONFIG_MACH_MMP3_DT)	+= platsmp.o
+endif
 
 # board support
 obj-$(CONFIG_MACH_ASPENITE)	+= aspenite.o
diff --git a/arch/arm/mach-mmp/platsmp.c b/arch/arm/mach-mmp/platsmp.c
new file mode 100644
index 0000000000000..c99405469bb4b
--- /dev/null
+++ b/arch/arm/mach-mmp/platsmp.c
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2019 Lubomir Rintel <lkundrak@v3.sk>
+ */
+#include <linux/io.h>
+#include <asm/smp_scu.h>
+#include <asm/smp.h>
+#include "addr-map.h"
+
+#define SW_BRANCH_VIRT_ADDR	CIU_REG(0x24)
+
+static int mmp3_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	/*
+	 * Apparently, the boot ROM on the second core spins on this
+	 * register becoming non-zero and then jumps to the address written
+	 * there. No IPIs involved.
+	 */
+	__raw_writel(__pa_symbol(secondary_startup), SW_BRANCH_VIRT_ADDR);
+	return 0;
+}
+
+static void mmp3_smp_prepare_cpus(unsigned int max_cpus)
+{
+	scu_enable(SCU_VIRT_BASE);
+}
+
+static const struct smp_operations mmp3_smp_ops __initconst = {
+	.smp_prepare_cpus	= mmp3_smp_prepare_cpus,
+	.smp_boot_secondary	= mmp3_boot_secondary,
+};
+CPU_METHOD_OF_DECLARE(mmp3_smp, "marvell,mmp3-smp", &mmp3_smp_ops);
-- 
2.21.0


WARNING: multiple messages have this Message-ID (diff)
From: Lubomir Rintel <lkundrak@v3.sk>
To: "To : Olof Johansson" <olof@lixom.net>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, Jason Cooper <jason@lakedaemon.net>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-kernel@vger.kernel.org,
	Michael Turquette <mturquette@baylibre.com>,
	Russell King <linux@armlinux.org.uk>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Lubomir Rintel <lkundrak@v3.sk>,
	"Cc : Rob Herring" <robh+dt@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 12/16] ARM: mmp: add SMP support
Date: Sat, 31 Aug 2019 00:07:39 +0200	[thread overview]
Message-ID: <20190830220743.439670-13-lkundrak@v3.sk> (raw)
In-Reply-To: <20190830220743.439670-1-lkundrak@v3.sk>

Used to bring up the second core on MMP3.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

---
Changes since v2:
- Wrap secondary_startup with __pa_symbol(), instead of
  SW_BRANCH_VIRT_ADDR.

Changes since v1:
- Wrap SW_BRANCH_VIRT_ADDR with __pa_symbol()

 arch/arm/mach-mmp/Makefile  |  3 +++
 arch/arm/mach-mmp/platsmp.c | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 arch/arm/mach-mmp/platsmp.c

diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile
index 322c1c97dc900..7b3a7f979eece 100644
--- a/arch/arm/mach-mmp/Makefile
+++ b/arch/arm/mach-mmp/Makefile
@@ -22,6 +22,9 @@ ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_CPU_PXA910)	+= pm-pxa910.o
 obj-$(CONFIG_CPU_MMP2)		+= pm-mmp2.o
 endif
+ifeq ($(CONFIG_SMP),y)
+obj-$(CONFIG_MACH_MMP3_DT)	+= platsmp.o
+endif
 
 # board support
 obj-$(CONFIG_MACH_ASPENITE)	+= aspenite.o
diff --git a/arch/arm/mach-mmp/platsmp.c b/arch/arm/mach-mmp/platsmp.c
new file mode 100644
index 0000000000000..c99405469bb4b
--- /dev/null
+++ b/arch/arm/mach-mmp/platsmp.c
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2019 Lubomir Rintel <lkundrak@v3.sk>
+ */
+#include <linux/io.h>
+#include <asm/smp_scu.h>
+#include <asm/smp.h>
+#include "addr-map.h"
+
+#define SW_BRANCH_VIRT_ADDR	CIU_REG(0x24)
+
+static int mmp3_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	/*
+	 * Apparently, the boot ROM on the second core spins on this
+	 * register becoming non-zero and then jumps to the address written
+	 * there. No IPIs involved.
+	 */
+	__raw_writel(__pa_symbol(secondary_startup), SW_BRANCH_VIRT_ADDR);
+	return 0;
+}
+
+static void mmp3_smp_prepare_cpus(unsigned int max_cpus)
+{
+	scu_enable(SCU_VIRT_BASE);
+}
+
+static const struct smp_operations mmp3_smp_ops __initconst = {
+	.smp_prepare_cpus	= mmp3_smp_prepare_cpus,
+	.smp_boot_secondary	= mmp3_boot_secondary,
+};
+CPU_METHOD_OF_DECLARE(mmp3_smp, "marvell,mmp3-smp", &mmp3_smp_ops);
-- 
2.21.0

WARNING: multiple messages have this Message-ID (diff)
From: Lubomir Rintel <lkundrak@v3.sk>
To: "To : Olof Johansson" <olof@lixom.net>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, Jason Cooper <jason@lakedaemon.net>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-kernel@vger.kernel.org,
	Michael Turquette <mturquette@baylibre.com>,
	Russell King <linux@armlinux.org.uk>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Lubomir Rintel <lkundrak@v3.sk>,
	"Cc : Rob Herring" <robh+dt@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 12/16] ARM: mmp: add SMP support
Date: Sat, 31 Aug 2019 00:07:39 +0200	[thread overview]
Message-ID: <20190830220743.439670-13-lkundrak@v3.sk> (raw)
In-Reply-To: <20190830220743.439670-1-lkundrak@v3.sk>

Used to bring up the second core on MMP3.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

---
Changes since v2:
- Wrap secondary_startup with __pa_symbol(), instead of
  SW_BRANCH_VIRT_ADDR.

Changes since v1:
- Wrap SW_BRANCH_VIRT_ADDR with __pa_symbol()

 arch/arm/mach-mmp/Makefile  |  3 +++
 arch/arm/mach-mmp/platsmp.c | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 arch/arm/mach-mmp/platsmp.c

diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile
index 322c1c97dc900..7b3a7f979eece 100644
--- a/arch/arm/mach-mmp/Makefile
+++ b/arch/arm/mach-mmp/Makefile
@@ -22,6 +22,9 @@ ifeq ($(CONFIG_PM),y)
 obj-$(CONFIG_CPU_PXA910)	+= pm-pxa910.o
 obj-$(CONFIG_CPU_MMP2)		+= pm-mmp2.o
 endif
+ifeq ($(CONFIG_SMP),y)
+obj-$(CONFIG_MACH_MMP3_DT)	+= platsmp.o
+endif
 
 # board support
 obj-$(CONFIG_MACH_ASPENITE)	+= aspenite.o
diff --git a/arch/arm/mach-mmp/platsmp.c b/arch/arm/mach-mmp/platsmp.c
new file mode 100644
index 0000000000000..c99405469bb4b
--- /dev/null
+++ b/arch/arm/mach-mmp/platsmp.c
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2019 Lubomir Rintel <lkundrak@v3.sk>
+ */
+#include <linux/io.h>
+#include <asm/smp_scu.h>
+#include <asm/smp.h>
+#include "addr-map.h"
+
+#define SW_BRANCH_VIRT_ADDR	CIU_REG(0x24)
+
+static int mmp3_boot_secondary(unsigned int cpu, struct task_struct *idle)
+{
+	/*
+	 * Apparently, the boot ROM on the second core spins on this
+	 * register becoming non-zero and then jumps to the address written
+	 * there. No IPIs involved.
+	 */
+	__raw_writel(__pa_symbol(secondary_startup), SW_BRANCH_VIRT_ADDR);
+	return 0;
+}
+
+static void mmp3_smp_prepare_cpus(unsigned int max_cpus)
+{
+	scu_enable(SCU_VIRT_BASE);
+}
+
+static const struct smp_operations mmp3_smp_ops __initconst = {
+	.smp_prepare_cpus	= mmp3_smp_prepare_cpus,
+	.smp_boot_secondary	= mmp3_boot_secondary,
+};
+CPU_METHOD_OF_DECLARE(mmp3_smp, "marvell,mmp3-smp", &mmp3_smp_ops);
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-08-30 22:17 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 22:07 [PATCH v3 00/16] Initial support for Marvell MMP3 SoC Lubomir Rintel
2019-08-30 22:07 ` Lubomir Rintel
2019-08-30 22:07 ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 01/16] dt-bindings: arm: cpu: Add Marvell MMP3 SMP enable method Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 02/16] dt-bindings: arm: Convert Marvell MMP board/soc bindings to json-schema Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-09-02 13:39   ` Rob Herring
2019-09-02 13:39     ` Rob Herring
2019-09-02 13:39     ` Rob Herring
2019-08-30 22:07 ` [PATCH v3 03/16] dt-bindings: arm: mrvl: Document MMP3 compatible string Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 04/16] dt-bindings: mrvl,intc: Add a MMP3 interrupt controller Lubomir Rintel
2019-08-30 22:07   ` [PATCH v3 04/16] dt-bindings: mrvl, intc: " Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 05/16] dt-bindings: phy-mmp3-usb: Add bindings Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 06/16] ARM: l2c: add definition for FWA in PL310 aux register Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 07/16] ARM: mmp: don't select CACHE_TAUROS2 on all ARCH_MMP Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 08/16] ARM: mmp: map the PGU as well Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 09/16] ARM: mmp: DT: convert timer driver to use TIMER_OF_DECLARE Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 10/16] ARM: mmp: define MMP_CHIPID by the means of CIU_REG() Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 11/16] ARM: mmp: add support for MMP3 SoC Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-09-06 23:48   ` Stephen Boyd
2019-09-06 23:48     ` Stephen Boyd
2019-09-06 23:48     ` Stephen Boyd
2019-08-30 22:07 ` Lubomir Rintel [this message]
2019-08-30 22:07   ` [PATCH v3 12/16] ARM: mmp: add SMP support Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 13/16] ARM: mmp: move cputype.h to include/linux/soc/ Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-09-02  8:15   ` kbuild test robot
2019-09-02  8:15     ` kbuild test robot
2019-09-02  8:15     ` kbuild test robot
2019-09-05 10:20     ` Arnd Bergmann
2019-09-05 10:20       ` Arnd Bergmann
2019-08-30 22:07 ` [PATCH v3 14/16] ARM: mmp: remove MMP3 USB PHY registers from regs-usb.h Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07 ` [PATCH v3 15/16] phy: phy-mmp3-usb: add a new driver Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-10-10  8:58   ` Kishon Vijay Abraham I
2019-10-10  8:58     ` Kishon Vijay Abraham I
2019-10-10  8:58     ` Kishon Vijay Abraham I
2019-08-30 22:07 ` [PATCH v3 16/16] ARM: dts: mmp3: Add MMP3 SoC dts file Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-08-30 22:07   ` Lubomir Rintel
2019-09-05 10:17   ` Arnd Bergmann
2019-09-05 10:17     ` Arnd Bergmann
2019-09-05 10:24 ` [PATCH v3 00/16] Initial support for Marvell MMP3 SoC Arnd Bergmann
2019-09-05 10:24   ` Arnd Bergmann
2019-09-05 10:24   ` Arnd Bergmann

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=20190830220743.439670-13-lkundrak@v3.sk \
    --to=lkundrak@v3.sk \
    --cc=devicetree@vger.kernel.org \
    --cc=jason@lakedaemon.net \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@baylibre.com \
    --cc=olof@lixom.net \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /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.