From: Lubomir Rintel <lkundrak@v3.sk>
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>, Marc Zyngier <maz@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>, Rob Herring <robh+dt@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Thomas Gleixner <tglx@linutronix.de>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 14/19] ARM: mmp: add support for MMP3 SoC
Date: Fri, 9 Aug 2019 11:31:53 +0200 [thread overview]
Message-ID: <20190809093158.7969-15-lkundrak@v3.sk> (raw)
In-Reply-To: <20190809093158.7969-1-lkundrak@v3.sk>
Similar to MMP2, which this patch is based on. Known differencies from MMP2
are:
* Two PJ4B cores instead of one PJ4
* Tauros 3 L2 cache controller instead of Tauros 2
* A GIC interrupt controller optionally used instead of the MMP one
* A TWD local timer
* Different USB2 PHY
* A USB3 SS controller
* More interrupt muxes
Hard to tell what else is different, because documentation is not
available.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
arch/arm/mach-mmp/Kconfig | 22 ++++++++++++++++++++--
arch/arm/mach-mmp/Makefile | 1 +
arch/arm/mach-mmp/cputype.h | 27 +++++++++++++++++++++++++++
arch/arm/mach-mmp/mmp3.c | 29 +++++++++++++++++++++++++++++
arch/arm/mach-mmp/time.c | 3 ++-
drivers/clk/mmp/Makefile | 1 +
6 files changed, 80 insertions(+), 3 deletions(-)
create mode 100644 arch/arm/mach-mmp/mmp3.c
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig
index 0440109e973b9..b58a03b18bdef 100644
--- a/arch/arm/mach-mmp/Kconfig
+++ b/arch/arm/mach-mmp/Kconfig
@@ -1,13 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-only
menuconfig ARCH_MMP
- bool "Marvell PXA168/910/MMP2"
+ bool "Marvell PXA168/910/MMP2/MMP3"
depends on ARCH_MULTI_V5 || ARCH_MULTI_V7
select GPIO_PXA
select GPIOLIB
select PINCTRL
select PLAT_PXA
help
- Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
+ Support for Marvell's PXA168/PXA910(MMP), MMP2, and MMP3 processor lines.
if ARCH_MMP
@@ -129,6 +129,24 @@ config MACH_MMP2_DT
Include support for Marvell MMP2 based platforms using
the device tree.
+config MACH_MMP3_DT
+ bool "Support MMP3 (ARMv7) platforms"
+ depends on ARCH_MULTI_V7
+ select ARM_GIC
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select CACHE_L2X0
+ select PINCTRL
+ select PINCTRL_SINGLE
+ select ARCH_HAS_RESET_CONTROLLER
+ select CPU_PJ4B
+ select PM_GENERIC_DOMAINS if PM
+ select PM_GENERIC_DOMAINS_OF if PM && OF
+ help
+ Say 'Y' here if you want to include support for platforms
+ with Marvell MMP3 processor, also known as PXA2128 or
+ Armada 620.
+
endmenu
config CPU_PXA168
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile
index 8f267c7bc6e86..322c1c97dc900 100644
--- a/arch/arm/mach-mmp/Makefile
+++ b/arch/arm/mach-mmp/Makefile
@@ -34,5 +34,6 @@ obj-$(CONFIG_MACH_FLINT) += flint.o
obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o
obj-$(CONFIG_MACH_MMP_DT) += mmp-dt.o
obj-$(CONFIG_MACH_MMP2_DT) += mmp2-dt.o
+obj-$(CONFIG_MACH_MMP3_DT) += mmp3.o
obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o
obj-$(CONFIG_MACH_GPLUGD) += gplugd.o
diff --git a/arch/arm/mach-mmp/cputype.h b/arch/arm/mach-mmp/cputype.h
index a96abcf521b4b..c3ec88983e940 100644
--- a/arch/arm/mach-mmp/cputype.h
+++ b/arch/arm/mach-mmp/cputype.h
@@ -18,6 +18,8 @@
* MMP2 Z0 0x560f5811 0x00F00410
* MMP2 Z1 0x560f5811 0x00E00410
* MMP2 A0 0x560f5811 0x00A0A610
+ * MMP3 A0 0x562f5842 0x00A02128
+ * MMP3 B0 0x562f5842 0x00B02128
*/
extern unsigned int mmp_chip_id;
@@ -55,4 +57,29 @@ static inline int cpu_is_mmp2(void)
#define cpu_is_mmp2() (0)
#endif
+#ifdef CONFIG_MACH_MMP3_DT
+static inline int cpu_is_mmp3(void)
+{
+ return (((read_cpuid_id() >> 8) & 0xff) == 0x58) &&
+ ((mmp_chip_id & 0xffff) == 0x2128);
+}
+
+static inline int cpu_is_mmp3_a0(void)
+{
+ return (cpu_is_mmp3() &&
+ ((mmp_chip_id & 0x00ff0000) == 0x00a00000));
+}
+
+static inline int cpu_is_mmp3_b0(void)
+{
+ return (cpu_is_mmp3() &&
+ ((mmp_chip_id & 0x00ff0000) == 0x00b00000));
+}
+
+#else
+#define cpu_is_mmp3() (0)
+#define cpu_is_mmp3_a0() (0)
+#define cpu_is_mmp3_b0() (0)
+#endif
+
#endif /* __ASM_MACH_CPUTYPE_H */
diff --git a/arch/arm/mach-mmp/mmp3.c b/arch/arm/mach-mmp/mmp3.c
new file mode 100644
index 0000000000000..b0e86964f302a
--- /dev/null
+++ b/arch/arm/mach-mmp/mmp3.c
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Marvell MMP3 aka PXA2128 aka 88AP2128 support
+ *
+ * Copyright (C) 2019 Lubomir Rintel <lkundrak@v3.sk>
+ */
+
+#include <linux/io.h>
+#include <linux/irqchip.h>
+#include <linux/of_platform.h>
+#include <linux/clk-provider.h>
+#include <asm/mach/arch.h>
+#include <asm/hardware/cache-l2x0.h>
+
+#include "common.h"
+
+static const char *const mmp3_dt_board_compat[] __initconst = {
+ "marvell,mmp3",
+ NULL,
+};
+
+DT_MACHINE_START(MMP2_DT, "Marvell MMP3")
+ .map_io = mmp2_map_io,
+ .dt_compat = mmp3_dt_board_compat,
+ .l2c_aux_val = 1 << L310_AUX_CTRL_FWA_SHIFT |
+ L310_AUX_CTRL_DATA_PREFETCH |
+ L310_AUX_CTRL_INSTR_PREFETCH,
+ .l2c_aux_mask = 0xc20fffff,
+MACHINE_END
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 3f6fd0be00512..8f4cacbf640e9 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -155,7 +155,8 @@ static void __init timer_config(void)
__raw_writel(0x0, mmp_timer_base + TMR_CER); /* disable */
- ccr &= (cpu_is_mmp2()) ? (TMR_CCR_CS_0(0) | TMR_CCR_CS_1(0)) :
+ ccr &= (cpu_is_mmp2() || cpu_is_mmp3()) ?
+ (TMR_CCR_CS_0(0) | TMR_CCR_CS_1(0)) :
(TMR_CCR_CS_0(3) | TMR_CCR_CS_1(3));
__raw_writel(ccr, mmp_timer_base + TMR_CCR);
diff --git a/drivers/clk/mmp/Makefile b/drivers/clk/mmp/Makefile
index 7bc7ac69391e3..deb069a4e4215 100644
--- a/drivers/clk/mmp/Makefile
+++ b/drivers/clk/mmp/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_RESET_CONTROLLER) += reset.o
obj-$(CONFIG_MACH_MMP_DT) += clk-of-pxa168.o clk-of-pxa910.o
obj-$(CONFIG_MACH_MMP2_DT) += clk-of-mmp2.o
+obj-$(CONFIG_MACH_MMP3_DT) += clk-of-mmp2.o
obj-$(CONFIG_CPU_PXA168) += clk-pxa168.o
obj-$(CONFIG_CPU_PXA910) += clk-pxa910.o
--
2.21.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-08-09 9:36 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 9:31 [PATCH 00/19] Initial support for Marvell MMP3 SoC Lubomir Rintel
2019-08-09 9:31 ` [PATCH 01/19] dt-bindings: arm: cpu: Add Marvell MMP3 SMP enable method Lubomir Rintel
2019-08-12 18:57 ` Rob Herring
2019-08-09 9:31 ` [PATCH 02/19] dt-bindings: arm: mrvl: Document MMP3 compatible string Lubomir Rintel
2019-08-21 21:03 ` Rob Herring
2019-08-22 8:12 ` Lubomir Rintel
2019-08-22 12:42 ` Rob Herring
2019-08-09 9:31 ` [PATCH 03/19] dt-bindings: mrvl, intc: Add a MMP3 interrupt controller Lubomir Rintel
2019-08-21 21:11 ` [PATCH 03/19] dt-bindings: mrvl,intc: " Rob Herring
2019-08-09 9:31 ` [PATCH 04/19] dt-bindings: phy-mmp3-usb: Add bindings Lubomir Rintel
2019-08-21 21:13 ` Rob Herring
2019-08-09 9:31 ` [PATCH 05/19] irqchip/mmp: do not use of_address_to_resource() to get mux regs Lubomir Rintel
2019-08-09 12:12 ` Marc Zyngier
2019-08-16 18:41 ` Lubomir Rintel
2019-08-17 18:17 ` Marc Zyngier
2019-08-09 9:31 ` [PATCH 06/19] irqchip/mmp: add missing chained_irq_{enter,exit}() Lubomir Rintel
2019-08-09 10:56 ` [PATCH 06/19] irqchip/mmp: add missing chained_irq_{enter, exit}() Marc Zyngier
2019-08-09 9:31 ` [PATCH 07/19] irqchip/mmp: mask off interrupts from other cores Lubomir Rintel
2019-08-09 12:18 ` Marc Zyngier
2019-08-16 18:15 ` Lubomir Rintel
2019-08-09 9:31 ` [PATCH 08/19] irqchip/mmp: coexist with GIC root IRQ controller Lubomir Rintel
2019-08-09 9:31 ` [PATCH 09/19] ARM: l2c: add definition for FWA in PL310 aux register Lubomir Rintel
2019-08-09 9:31 ` [PATCH 10/19] ARM: mmp: don't select CACHE_TAUROS2 on all ARCH_MMP Lubomir Rintel
2019-08-09 9:31 ` [PATCH 11/19] ARM: mmp: map the PGU as well Lubomir Rintel
2019-08-09 9:31 ` [PATCH 12/19] ARM: mmp: DT: convert timer driver to use TIMER_OF_DECLARE Lubomir Rintel
2019-08-09 9:31 ` [PATCH 13/19] ARM: mmp: define MMP_CHIPID by the means of CIU_REG() Lubomir Rintel
2019-08-09 9:31 ` Lubomir Rintel [this message]
2019-08-16 18:06 ` [PATCH 14/19] ARM: mmp: add support for MMP3 SoC Stephen Boyd
2019-08-09 9:31 ` [PATCH 15/19] ARM: mmp: add SMP support Lubomir Rintel
2019-08-16 18:11 ` Florian Fainelli
2019-08-09 9:31 ` [PATCH 16/19] ARM: mmp: move cputype.h to include/linux/soc/ Lubomir Rintel
2019-08-09 9:31 ` [PATCH 17/19] ARM: mmp: remove MMP3 USB PHY registers from regs-usb.h Lubomir Rintel
2019-08-09 9:31 ` [PATCH 18/19] phy: phy-mmp3-usb: add a new driver Lubomir Rintel
2019-08-09 9:31 ` [PATCH 19/19] ARM: dts: mmp3: Add MMP3 SoC dts file Lubomir Rintel
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=20190809093158.7969-15-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=maz@kernel.org \
--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 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).