Эх сурвалжийг харах

Merge tag 'mvebu-soc-3xx-3.15' of git://git.infradead.org/linux-mvebu into next/soc

Merge "mvebu new SoCs for v3.15" from Jason Cooper:

 - mvebu
    - initial support for Armada 375, 380, and 385

Depends:
 - tags/mvebu-soc-3.15 (resolves delete/rename hidden conflict)

* tag 'mvebu-soc-3xx-3.15' of git://git.infradead.org/linux-mvebu:
  Documentation: arm: update Marvell documentation about Armada 375/38x
  ARM: mvebu: add initial support for the Armada 380/385 SOCs
  ARM: mvebu: add workaround for data abort issue on Armada 375
  ARM: mvebu: add initial support for the Armada 375 SOCs
  ARM: mvebu: add Armada 375 support to the system-controller driver
  ARM: mvebu: make CPU_PJ4B selection a per-SoC choice
  ARM: mvebu: rename DT machine structure for Armada 370/XP
  ARM: mvebu: rename armada-370-xp.c to board-v7.c

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Arnd Bergmann 11 жил өмнө
parent
commit
88dbede1da

+ 11 - 1
Documentation/arm/Marvell/README

@@ -83,14 +83,24 @@ EBU Armada family
         88F6710
         88F6710
         88F6707
         88F6707
         88F6W11
         88F6W11
+    Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/Marvell_ARMADA_370_SoC.pdf
+
+  Armada 375 Flavors:
+	88F6720
+    Product Brief: http://www.marvell.com/embedded-processors/armada-300/assets/ARMADA_375_SoC-01_product_brief.pdf
+
+  Armada 380/385 Flavors:
+	88F6810
+	88F6820
+	88F6828
 
 
   Armada XP Flavors:
   Armada XP Flavors:
         MV78230
         MV78230
         MV78260
         MV78260
         MV78460
         MV78460
     NOTE: not to be confused with the non-SMP 78xx0 SoCs
     NOTE: not to be confused with the non-SMP 78xx0 SoCs
+    Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
 
 
-  Product Brief: http://www.marvell.com/embedded-processors/armada-xp/assets/Marvell-ArmadaXP-SoC-product%20brief.pdf
   No public datasheet available.
   No public datasheet available.
 
 
   Core: Sheeva ARMv7 compatible
   Core: Sheeva ARMv7 compatible

+ 9 - 0
Documentation/devicetree/bindings/arm/armada-375.txt

@@ -0,0 +1,9 @@
+Marvell Armada 375 Platforms Device Tree Bindings
+-------------------------------------------------
+
+Boards with a SoC of the Marvell Armada 375 family shall have the
+following property:
+
+Required root node property:
+
+compatible: must contain "marvell,armada375"

+ 10 - 0
Documentation/devicetree/bindings/arm/armada-38x.txt

@@ -0,0 +1,10 @@
+Marvell Armada 38x Platforms Device Tree Bindings
+-------------------------------------------------
+
+Boards with a SoC of the Marvell Armada 38x family shall have the
+following property:
+
+Required root node property:
+
+ - compatible: must contain either "marvell,armada380" or
+   "marvell,armada385" depending on the variant of the SoC being used.

+ 2 - 1
Documentation/devicetree/bindings/arm/mvebu-system-controller.txt

@@ -1,12 +1,13 @@
 MVEBU System Controller
 MVEBU System Controller
 -----------------------
 -----------------------
-MVEBU (Marvell SOCs: Armada 370/XP, Dove, mv78xx0, Kirkwood, Orion5x)
+MVEBU (Marvell SOCs: Armada 370/375/XP, Dove, mv78xx0, Kirkwood, Orion5x)
 
 
 Required properties:
 Required properties:
 
 
 - compatible: one of:
 - compatible: one of:
 	- "marvell,orion-system-controller"
 	- "marvell,orion-system-controller"
 	- "marvell,armada-370-xp-system-controller"
 	- "marvell,armada-370-xp-system-controller"
+	- "marvell,armada-375-system-controller"
 - reg: Should contain system controller registers location and length.
 - reg: Should contain system controller registers location and length.
 
 
 Example:
 Example:

+ 33 - 4
arch/arm/mach-mvebu/Kconfig

@@ -21,26 +21,55 @@ if ARCH_MVEBU
 
 
 menu "Marvell SOC with device tree"
 menu "Marvell SOC with device tree"
 
 
-config MACH_ARMADA_370_XP
+config MACH_MVEBU_V7
 	bool
 	bool
 	select ARMADA_370_XP_TIMER
 	select ARMADA_370_XP_TIMER
 	select HAVE_SMP
 	select HAVE_SMP
 	select CACHE_L2X0
 	select CACHE_L2X0
-	select CPU_PJ4B
 
 
 config MACH_ARMADA_370
 config MACH_ARMADA_370
 	bool "Marvell Armada 370 boards"
 	bool "Marvell Armada 370 boards"
 	select ARMADA_370_CLK
 	select ARMADA_370_CLK
-	select MACH_ARMADA_370_XP
+	select CPU_PJ4B
+	select MACH_MVEBU_V7
 	select PINCTRL_ARMADA_370
 	select PINCTRL_ARMADA_370
 	help
 	help
 	  Say 'Y' here if you want your kernel to support boards based
 	  Say 'Y' here if you want your kernel to support boards based
 	  on the Marvell Armada 370 SoC with device tree.
 	  on the Marvell Armada 370 SoC with device tree.
 
 
+config MACH_ARMADA_375
+	bool "Marvell Armada 375 boards"
+	select ARM_ERRATA_720789
+	select ARM_ERRATA_753970
+	select ARM_GIC
+	select ARMADA_375_CLK
+	select CPU_V7
+	select MACH_MVEBU_V7
+	select NEON
+	select PINCTRL_ARMADA_375
+	help
+	  Say 'Y' here if you want your kernel to support boards based
+	  on the Marvell Armada 375 SoC with device tree.
+
+config MACH_ARMADA_38X
+	bool "Marvell Armada 380/385 boards"
+	select ARM_ERRATA_720789
+	select ARM_ERRATA_753970
+	select ARM_GIC
+	select ARMADA_38X_CLK
+	select CPU_V7
+	select MACH_MVEBU_V7
+	select NEON
+	select PINCTRL_ARMADA_38X
+	help
+	  Say 'Y' here if you want your kernel to support boards based
+	  on the Marvell Armada 380/385 SoC with device tree.
+
 config MACH_ARMADA_XP
 config MACH_ARMADA_XP
 	bool "Marvell Armada XP boards"
 	bool "Marvell Armada XP boards"
 	select ARMADA_XP_CLK
 	select ARMADA_XP_CLK
-	select MACH_ARMADA_370_XP
+	select CPU_PJ4B
+	select MACH_MVEBU_V7
 	select PINCTRL_ARMADA_XP
 	select PINCTRL_ARMADA_XP
 	help
 	help
 	  Say 'Y' here if you want your kernel to support boards based
 	  Say 'Y' here if you want your kernel to support boards based

+ 3 - 2
arch/arm/mach-mvebu/Makefile

@@ -3,7 +3,8 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 
 
 AFLAGS_coherency_ll.o		:= -Wa,-march=armv7-a
 AFLAGS_coherency_ll.o		:= -Wa,-march=armv7-a
 
 
-obj-y				 += coherency.o coherency_ll.o pmsu.o system-controller.o mvebu-soc-id.o
-obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
+obj-y				 += system-controller.o mvebu-soc-id.o
+obj-$(CONFIG_MACH_MVEBU_V7)      += board-v7.o
+obj-$(CONFIG_ARCH_MVEBU)	 += coherency.o coherency_ll.o pmsu.o
 obj-$(CONFIG_SMP)                += platsmp.o headsmp.o
 obj-$(CONFIG_SMP)                += platsmp.o headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)        += hotplug.o
 obj-$(CONFIG_HOTPLUG_CPU)        += hotplug.o

+ 53 - 5
arch/arm/mach-mvebu/armada-370-xp.c → arch/arm/mach-mvebu/board-v7.c

@@ -31,7 +31,28 @@
 #include "coherency.h"
 #include "coherency.h"
 #include "mvebu-soc-id.h"
 #include "mvebu-soc-id.h"
 
 
-static void __init armada_370_xp_timer_and_clk_init(void)
+/*
+ * 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
+ * data aborts at this moment. We register a custom abort handler
+ * below to ignore the first data abort to work around this
+ * problem.
+ */
+static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr,
+					struct pt_regs *regs)
+{
+	static int ignore_first;
+
+	if (!ignore_first && fsr == 0x1406) {
+		ignore_first = 1;
+		return 0;
+	}
+
+	return 1;
+}
+
+static void __init mvebu_timer_and_clk_init(void)
 {
 {
 	of_clk_init(NULL);
 	of_clk_init(NULL);
 	clocksource_of_init();
 	clocksource_of_init();
@@ -40,6 +61,10 @@ static void __init armada_370_xp_timer_and_clk_init(void)
 #ifdef CONFIG_CACHE_L2X0
 #ifdef CONFIG_CACHE_L2X0
 	l2x0_of_init(0, ~0UL);
 	l2x0_of_init(0, ~0UL);
 #endif
 #endif
+
+	if (of_machine_is_compatible("marvell,armada375"))
+		hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0,
+				"imprecise external abort");
 }
 }
 
 
 static void __init i2c_quirk(void)
 static void __init i2c_quirk(void)
@@ -70,7 +95,7 @@ static void __init i2c_quirk(void)
 	return;
 	return;
 }
 }
 
 
-static void __init armada_370_xp_dt_init(void)
+static void __init mvebu_dt_init(void)
 {
 {
 	if (of_machine_is_compatible("plathome,openblocks-ax3-4"))
 	if (of_machine_is_compatible("plathome,openblocks-ax3-4"))
 		i2c_quirk();
 		i2c_quirk();
@@ -82,10 +107,33 @@ static const char * const armada_370_xp_dt_compat[] = {
 	NULL,
 	NULL,
 };
 };
 
 
-DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)")
+DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)")
 	.smp		= smp_ops(armada_xp_smp_ops),
 	.smp		= smp_ops(armada_xp_smp_ops),
-	.init_machine	= armada_370_xp_dt_init,
-	.init_time	= armada_370_xp_timer_and_clk_init,
+	.init_machine	= mvebu_dt_init,
+	.init_time	= mvebu_timer_and_clk_init,
 	.restart	= mvebu_restart,
 	.restart	= mvebu_restart,
 	.dt_compat	= armada_370_xp_dt_compat,
 	.dt_compat	= armada_370_xp_dt_compat,
 MACHINE_END
 MACHINE_END
+
+static const char * const armada_375_dt_compat[] = {
+	"marvell,armada375",
+	NULL,
+};
+
+DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)")
+	.init_time	= mvebu_timer_and_clk_init,
+	.restart	= mvebu_restart,
+	.dt_compat	= armada_375_dt_compat,
+MACHINE_END
+
+static const char * const armada_38x_dt_compat[] = {
+	"marvell,armada380",
+	"marvell,armada385",
+	NULL,
+};
+
+DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)")
+	.init_time	= mvebu_timer_and_clk_init,
+	.restart	= mvebu_restart,
+	.dt_compat	= armada_38x_dt_compat,
+MACHINE_END

+ 12 - 2
arch/arm/mach-mvebu/system-controller.c

@@ -1,5 +1,5 @@
 /*
 /*
- * System controller support for Armada 370 and XP platforms.
+ * System controller support for Armada 370, 375 and XP platforms.
  *
  *
  * Copyright (C) 2012 Marvell
  * Copyright (C) 2012 Marvell
  *
  *
@@ -11,7 +11,7 @@
  * License version 2.  This program is licensed "as is" without any
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  * warranty of any kind, whether express or implied.
  *
  *
- * The Armada 370 and Armada XP SoCs both have a range of
+ * The Armada 370, 375 and Armada XP SoCs have a range of
  * miscellaneous registers, that do not belong to a particular device,
  * miscellaneous registers, that do not belong to a particular device,
  * but rather provide system-level features. This basic
  * but rather provide system-level features. This basic
  * system-controller driver provides a device tree binding for those
  * system-controller driver provides a device tree binding for those
@@ -47,6 +47,13 @@ static const struct mvebu_system_controller armada_370_xp_system_controller = {
 	.system_soft_reset = 0x1,
 	.system_soft_reset = 0x1,
 };
 };
 
 
+static const struct mvebu_system_controller armada_375_system_controller = {
+	.rstoutn_mask_offset = 0x54,
+	.system_soft_reset_offset = 0x58,
+	.rstoutn_mask_reset_out_en = 0x1,
+	.system_soft_reset = 0x1,
+};
+
 static const struct mvebu_system_controller orion_system_controller = {
 static const struct mvebu_system_controller orion_system_controller = {
 	.rstoutn_mask_offset = 0x108,
 	.rstoutn_mask_offset = 0x108,
 	.system_soft_reset_offset = 0x10c,
 	.system_soft_reset_offset = 0x10c,
@@ -61,6 +68,9 @@ static const struct of_device_id of_system_controller_table[] = {
 	}, {
 	}, {
 		.compatible = "marvell,armada-370-xp-system-controller",
 		.compatible = "marvell,armada-370-xp-system-controller",
 		.data = (void *) &armada_370_xp_system_controller,
 		.data = (void *) &armada_370_xp_system_controller,
+	}, {
+		.compatible = "marvell,armada-375-system-controller",
+		.data = (void *) &armada_375_system_controller,
 	},
 	},
 	{ /* end of list */ },
 	{ /* end of list */ },
 };
 };