Merge branch 'mvebu/soc3' into next/dt
authorArnd Bergmann <arnd@arndb.de>
Mon, 17 Mar 2014 10:50:05 +0000 (11:50 +0100)
committerArnd Bergmann <arnd@arndb.de>
Mon, 17 Mar 2014 11:13:09 +0000 (12:13 +0100)
The dts Makefile has a bunch of nasty conflicts, attempt to resolve
these now to avoid trouble later.

Conflicts:
arch/arm/boot/dts/Makefile

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
38 files changed:
Documentation/arm/Marvell/README
Documentation/devicetree/bindings/arm/armada-375.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/armada-38x.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/mrvl/feroceon.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/mvebu-system-controller.txt
arch/arm/Kconfig
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts
arch/arm/include/asm/hardware/cache-feroceon-l2.h [new file with mode: 0644]
arch/arm/mach-dove/Kconfig
arch/arm/mach-dove/Makefile
arch/arm/mach-dove/board-dt.c [deleted file]
arch/arm/mach-kirkwood/Kconfig
arch/arm/mach-kirkwood/Makefile
arch/arm/mach-kirkwood/board-dt.c
arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c [deleted file]
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/common.h
arch/arm/mach-kirkwood/include/mach/bridge-regs.h
arch/arm/mach-kirkwood/pm.c
arch/arm/mach-kirkwood/pm.h [new file with mode: 0644]
arch/arm/mach-mv78xx0/common.c
arch/arm/mach-mvebu/Kconfig
arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/armada-370-xp.c [deleted file]
arch/arm/mach-mvebu/board-t5325.c [new file with mode: 0644]
arch/arm/mach-mvebu/board-v7.c [new file with mode: 0644]
arch/arm/mach-mvebu/board.h [new file with mode: 0644]
arch/arm/mach-mvebu/dove.c [new file with mode: 0644]
arch/arm/mach-mvebu/kirkwood-pm.c [new file with mode: 0644]
arch/arm/mach-mvebu/kirkwood-pm.h [new file with mode: 0644]
arch/arm/mach-mvebu/kirkwood.c [new file with mode: 0644]
arch/arm/mach-mvebu/kirkwood.h [new file with mode: 0644]
arch/arm/mach-mvebu/mvebu-soc-id.c
arch/arm/mach-mvebu/system-controller.c
arch/arm/mm/Kconfig
arch/arm/mm/cache-feroceon-l2.c
arch/arm/plat-orion/include/plat/cache-feroceon-l2.h [deleted file]

index 5a930c1528ad25c67f3cf98aa05a3ce9560b0019..963ec445e15a3a1a84571b15c3e2362bdd5e19b9 100644 (file)
@@ -83,14 +83,24 @@ EBU Armada family
         88F6710
         88F6707
         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:
         MV78230
         MV78260
         MV78460
     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.
 
   Core: Sheeva ARMv7 compatible
diff --git a/Documentation/devicetree/bindings/arm/armada-375.txt b/Documentation/devicetree/bindings/arm/armada-375.txt
new file mode 100644 (file)
index 0000000..867d0b8
--- /dev/null
@@ -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"
diff --git a/Documentation/devicetree/bindings/arm/armada-38x.txt b/Documentation/devicetree/bindings/arm/armada-38x.txt
new file mode 100644 (file)
index 0000000..11f2330
--- /dev/null
@@ -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.
diff --git a/Documentation/devicetree/bindings/arm/mrvl/feroceon.txt b/Documentation/devicetree/bindings/arm/mrvl/feroceon.txt
new file mode 100644 (file)
index 0000000..0d244b9
--- /dev/null
@@ -0,0 +1,16 @@
+* Marvell Feroceon Cache
+
+Required properties:
+- compatible : Should be either "marvell,feroceon-cache" or
+              "marvell,kirkwood-cache".
+
+Optional properties:
+- reg        : Address of the L2 cache control register. Mandatory for
+              "marvell,kirkwood-cache", not used by "marvell,feroceon-cache"
+
+
+Example:
+               l2: l2-cache@20128 {
+                       compatible = "marvell,kirkwood-cache";
+                       reg = <0x20128 0x4>;
+               };
index 081c6a786c8a93a7f07a58246b0a8118fbf80fb5..d24ab2ebf8a721f630868de9d3f4b85f07c2f1e2 100644 (file)
@@ -1,12 +1,13 @@
 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:
 
 - compatible: one of:
        - "marvell,orion-system-controller"
        - "marvell,armada-370-xp-system-controller"
+       - "marvell,armada-375-system-controller"
 - reg: Should contain system controller registers location and length.
 
 Example:
index 224793cefa311c7ade52ef6d40ec3b301fa6969d..df9266d41b3ba0cedcc14fca5fbb60ebadecda24 100644 (file)
@@ -894,7 +894,7 @@ config ARCH_MULTI_V5
        bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)"
        depends on !ARCH_MULTI_V6_V7
        select ARCH_MULTI_V4_V5
-       select CPU_ARM926T if (!CPU_ARM946E || CPU_ARM1020 || \
+       select CPU_ARM926T if !(CPU_ARM946E || CPU_ARM1020 || \
                CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \
                CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON)
 
index 489959dfe6d143451c53af6dd2dd62a29f66e187..3d34936fb4766f17d0bc908d65dc51cdc0754386 100644 (file)
@@ -55,7 +55,7 @@ dtb-$(CONFIG_ARCH_BERLIN) += \
        berlin2cd-google-chromecast.dtb
 dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \
        da850-evm.dtb
-dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \
+dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \
        dove-cubox.dtb \
        dove-d2plug.dtb \
        dove-d3plug.dtb \
@@ -82,8 +82,8 @@ dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb \
        ecx-2000.dtb
 dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
        integratorcp.dtb
-dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
-dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-b3.dtb \
+kirkwood := \
+       kirkwood-b3.dtb \
        kirkwood-cloudbox.dtb \
        kirkwood-db-88f6281.dtb \
        kirkwood-db-88f6282.dtb \
@@ -139,6 +139,9 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-b3.dtb \
        kirkwood-ts219-6282.dtb \
        kirkwood-ts419-6281.dtb \
        kirkwood-ts419-6282.dtb
+dtb-$(CONFIG_ARCH_KIRKWOOD) += $(kirkwood)
+dtb-$(CONFIG_MACH_KIRKWOOD) += $(kirkwood)
+dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
 dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
 dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
 dtb-$(CONFIG_ARCH_MXC) += \
index dc86429756d79787a780946668e2a80cd50fa893..2cb0dc529165dcd88cbbba8ae7df7da2647a041f 100644 (file)
                        gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
                };
        };
+
+       dsa@0 {
+               compatible = "marvell,dsa";
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               dsa,ethernet = <&eth0>;
+               dsa,mii-bus = <&ethphy0>;
+
+               switch@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0 0>;    /* MDIO address 0, switch 0 in tree */
+
+                       port@0 {
+                               reg = <0>;
+                               label = "lan1";
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan2";
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan3";
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan4";
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "wan";
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "cpu";
+                       };
+               };
+       };
+};
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@ff {
+               reg = <0xff>;   /* No phy attached */
+               speed = <1000>;
+               duplex = <1>;
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
 };
diff --git a/arch/arm/include/asm/hardware/cache-feroceon-l2.h b/arch/arm/include/asm/hardware/cache-feroceon-l2.h
new file mode 100644 (file)
index 0000000..12e1588
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * arch/arm/include/asm/hardware/cache-feroceon-l2.h
+ *
+ * Copyright (C) 2008 Marvell Semiconductor
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+extern void __init feroceon_l2_init(int l2_wt_override);
+extern int __init feroceon_of_init(void);
+
index 0bc7cdf8cf469d760ac384a4aa5ae46fa7605270..d8c439c89ea93b76849965f08cbeb5149a25bbb8 100644 (file)
@@ -20,18 +20,6 @@ config MACH_CM_A510
          Say 'Y' here if you want your kernel to support the
          CompuLab CM-A510 Board.
 
-config MACH_DOVE_DT
-       bool "Marvell Dove Flattened Device Tree"
-       select DOVE_CLK
-       select ORION_IRQCHIP
-       select ORION_TIMER
-       select REGULATOR
-       select REGULATOR_FIXED_VOLTAGE
-       select USE_OF
-       help
-         Say 'Y' here if you want your kernel to support the
-         Marvell Dove using flattened device tree.
-
 endmenu
 
 endif
index cbc5c06187883988e012a282d67e359d17b624c2..b608a21919fbf5c513046a7ed5ba1668099b1b7c 100644 (file)
@@ -2,5 +2,4 @@ obj-y                           += common.o
 obj-$(CONFIG_DOVE_LEGACY)      += irq.o mpp.o
 obj-$(CONFIG_PCI)              += pcie.o
 obj-$(CONFIG_MACH_DOVE_DB)     += dove-db-setup.o
-obj-$(CONFIG_MACH_DOVE_DT)     += board-dt.o
 obj-$(CONFIG_MACH_CM_A510)     += cm-a510.o
diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c
deleted file mode 100644 (file)
index 49fa9ab..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * arch/arm/mach-dove/board-dt.c
- *
- * Marvell Dove 88AP510 System On Chip FDT Board
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/init.h>
-#include <linux/clk-provider.h>
-#include <linux/of.h>
-#include <linux/of_platform.h>
-#include <asm/hardware/cache-tauros2.h>
-#include <asm/mach/arch.h>
-#include <mach/dove.h>
-#include <mach/pm.h>
-#include <plat/common.h>
-#include "common.h"
-
-static void __init dove_dt_init(void)
-{
-       pr_info("Dove 88AP510 SoC\n");
-
-#ifdef CONFIG_CACHE_TAUROS2
-       tauros2_init(0);
-#endif
-       BUG_ON(mvebu_mbus_dt_init());
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char * const dove_dt_board_compat[] = {
-       "marvell,dove",
-       NULL
-};
-
-DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
-       .map_io         = dove_map_io,
-       .init_machine   = dove_dt_init,
-       .restart        = dove_restart,
-       .dt_compat      = dove_dt_board_compat,
-MACHINE_END
index fe8319ad3158540355250c030aabd6c7f15878ea..df4b26340ae48d63cc37ecce38f65afe6927ebc7 100644 (file)
@@ -106,13 +106,6 @@ config ARCH_KIRKWOOD_DT
          Say 'Y' here if you want your kernel to support the
          Marvell Kirkwood using flattened device tree.
 
-config MACH_MV88F6281GTW_GE_DT
-       bool "Marvell 88F6281 GTW GE Board (Flattened Device Tree)"
-       depends on ARCH_KIRKWOOD_DT
-       help
-         Say 'Y' here if you want your kernel to support the
-         Marvell 88F6281 GTW GE Board (Flattened Device Tree).
-
 endmenu
 
 endif
index 144b511029399dc58a0049405478570f293ae492..3a72c5c6e7477cd946fdf8ecb0450549241b1dda 100644 (file)
@@ -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
@@ -13,4 +12,3 @@ obj-$(CONFIG_MACH_TS219)              += ts219-setup.o tsx1x-common.o
 obj-$(CONFIG_MACH_TS41X)               += ts41x-setup.o tsx1x-common.o
 
 obj-$(CONFIG_ARCH_KIRKWOOD_DT)         += board-dt.o
-obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT)  += board-mv88f6281gtw_ge.o
index 78188159484d79e760d8ec22a6303a81d100aeae..2801da49e2a36bfea53cf1fd5a084c51dbac42a6 100644 (file)
 #include <linux/of_platform.h>
 #include <linux/dma-mapping.h>
 #include <linux/irqchip.h>
-#include <linux/kexec.h>
+#include <asm/hardware/cache-feroceon-l2.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/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 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
@@ -104,35 +177,35 @@ eth_fixup_skip:
        }
 }
 
-static void __init kirkwood_dt_init(void)
+/*
+ * Disable propagation of mbus errors to the CPU local bus, as this
+ * causes mbus errors (which can occur for example for PCI aborts) to
+ * throw CPU aborts, which we're not set up to deal with.
+ */
+static void __init kirkwood_disable_mbus_error_propagation(void)
 {
-       pr_info("Kirkwood: %s.\n", kirkwood_id());
+       void __iomem *cpu_config;
 
-       /*
-        * Disable propagation of mbus errors to the CPU local bus,
-        * as this causes mbus errors (which can occur for example
-        * for PCI aborts) to throw CPU aborts, which we're not set
-        * up to deal with.
-        */
-       writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
+       cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
+       writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
+       iounmap(cpu_config);
+}
 
-       BUG_ON(mvebu_mbus_dt_init());
+static void __init kirkwood_dt_init(void)
+{
+       kirkwood_disable_mbus_error_propagation();
 
-       kirkwood_l2_init();
+       BUG_ON(mvebu_mbus_dt_init());
 
+#ifdef CONFIG_CACHE_FEROCEON_L2
+       feroceon_of_init();
+#endif
        kirkwood_cpufreq_init();
        kirkwood_cpuidle_init();
 
        kirkwood_pm_init();
        kirkwood_dt_eth_fixup();
 
-#ifdef CONFIG_KEXEC
-       kexec_reinit = kirkwood_enable_pcie;
-#endif
-
-       if (of_machine_is_compatible("marvell,mv88f6281gtw-ge"))
-               mv88f6281gtw_ge_init();
-
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
diff --git a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c b/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
deleted file mode 100644 (file)
index ee5eea6..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
- *
- * Marvell 88F6281 GTW GE Board Setup
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/irq.h>
-#include <linux/timer.h>
-#include <linux/mv643xx_eth.h>
-#include <linux/ethtool.h>
-#include <linux/gpio.h>
-#include <net/dsa.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/pci.h>
-#include <mach/kirkwood.h>
-#include "common.h"
-
-static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
-       .phy_addr       = MV643XX_ETH_PHY_NONE,
-       .speed          = SPEED_1000,
-       .duplex         = DUPLEX_FULL,
-};
-
-static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = {
-       .port_names[0]  = "lan1",
-       .port_names[1]  = "lan2",
-       .port_names[2]  = "lan3",
-       .port_names[3]  = "lan4",
-       .port_names[4]  = "wan",
-       .port_names[5]  = "cpu",
-};
-
-static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = {
-       .nr_chips       = 1,
-       .chip           = &mv88f6281gtw_ge_switch_chip_data,
-};
-
-void __init mv88f6281gtw_ge_init(void)
-{
-       kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
-       kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ);
-}
index f3407a5db216498e6d30994c5fad8a872d2ac6b6..255f33a3903ccf7bd58fd4cce844d31f4492ad80 100644 (file)
 #include <asm/page.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
+#include <asm/hardware/cache-feroceon-l2.h>
 #include <mach/kirkwood.h>
 #include <mach/bridge-regs.h>
 #include <linux/platform_data/asoc-kirkwood.h>
-#include <plat/cache-feroceon-l2.h>
 #include <linux/platform_data/mmc-mvsdio.h>
 #include <linux/platform_data/mtd-orion_nand.h>
 #include <linux/platform_data/usb-ehci-orion.h>
@@ -36,6 +36,7 @@
 #include <plat/time.h>
 #include <linux/platform_data/dma-mv_xor.h>
 #include "common.h"
+#include "pm.h"
 
 /* These can go away once Kirkwood uses the mvebu-mbus DT binding */
 #define KIRKWOOD_MBUS_NAND_TARGET 0x01
index 05fd648df543a669d393462e6b3d739cd6992421..832a4e2ab8d70b68ba8f22b8726177177578611b 100644 (file)
@@ -58,19 +58,6 @@ void kirkwood_cpufreq_init(void);
 void kirkwood_restart(enum reboot_mode, const char *);
 void kirkwood_clk_init(void);
 
-#ifdef CONFIG_PM
-void kirkwood_pm_init(void);
-#else
-static inline void kirkwood_pm_init(void) {};
-#endif
-
-/* board init functions for boards not fully converted to fdt */
-#ifdef CONFIG_MACH_MV88F6281GTW_GE_DT
-void mv88f6281gtw_ge_init(void);
-#else
-static inline void mv88f6281gtw_ge_init(void) {};
-#endif
-
 /* early init functions not converted to fdt yet */
 char *kirkwood_id(void);
 void kirkwood_l2_init(void);
index 8b9d1c9ff1996aa58da90edaa572700e794af73b..6e5077e2ec26211acc7622de8b0ea8f44a00ff27 100644 (file)
@@ -14,6 +14,7 @@
 #include <mach/kirkwood.h>
 
 #define CPU_CONFIG             (BRIDGE_VIRT_BASE + 0x0100)
+#define CPU_CONFIG_PHYS                (BRIDGE_PHYS_BASE + 0x0100)
 #define CPU_CONFIG_ERROR_PROP  0x00000004
 
 #define CPU_CONTROL            (BRIDGE_VIRT_BASE + 0x0104)
@@ -79,5 +80,6 @@
 #define CGC_RESERVED           (0x6 << 21)
 
 #define MEMORY_PM_CTRL         (BRIDGE_VIRT_BASE + 0x118)
+#define MEMORY_PM_CTRL_PHYS    (BRIDGE_PHYS_BASE + 0x118)
 
 #endif
index c6ab8d9303a5b351937a8e3053f4394a6081e60f..8e5e0329d04c4d804259d9ba3faf8f37cc431b1c 100644 (file)
 #include "common.h"
 
 static void __iomem *ddr_operation_base;
+static void __iomem *memory_pm_ctrl;
 
 static void kirkwood_low_power(void)
 {
        u32 mem_pm_ctrl;
 
-       mem_pm_ctrl = readl(MEMORY_PM_CTRL);
+       mem_pm_ctrl = readl(memory_pm_ctrl);
 
        /* Set peripherals to low-power mode */
-       writel_relaxed(~0, MEMORY_PM_CTRL);
+       writel_relaxed(~0, memory_pm_ctrl);
 
        /* Set DDR in self-refresh */
        writel_relaxed(0x7, ddr_operation_base);
@@ -41,7 +42,7 @@ static void kirkwood_low_power(void)
         */
        cpu_do_idle();
 
-       writel_relaxed(mem_pm_ctrl, MEMORY_PM_CTRL);
+       writel_relaxed(mem_pm_ctrl, memory_pm_ctrl);
 }
 
 static int kirkwood_suspend_enter(suspend_state_t state)
@@ -69,5 +70,7 @@ static const struct platform_suspend_ops kirkwood_suspend_ops = {
 void __init kirkwood_pm_init(void)
 {
        ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4);
+       memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4);
+
        suspend_set_ops(&kirkwood_suspend_ops);
 }
diff --git a/arch/arm/mach-kirkwood/pm.h b/arch/arm/mach-kirkwood/pm.h
new file mode 100644 (file)
index 0000000..21e7530
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Power Management driver for Marvell Kirkwood SoCs
+ *
+ * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
+ * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License,
+ * version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_KIRKWOOD_PM_H
+#define __ARCH_KIRKWOOD_PM_H
+
+#ifdef CONFIG_PM
+void kirkwood_pm_init(void);
+#else
+static inline void kirkwood_pm_init(void) {};
+#endif
+
+#endif
index 75062eff2494005cbc6f8537b434feaf737597d6..e6ac679bece9fab3b845ed909dd8475c1359f561 100644 (file)
 #include <linux/ata_platform.h>
 #include <linux/clk-provider.h>
 #include <linux/ethtool.h>
+#include <asm/hardware/cache-feroceon-l2.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <mach/mv78xx0.h>
 #include <mach/bridge-regs.h>
-#include <plat/cache-feroceon-l2.h>
 #include <linux/platform_data/usb-ehci-orion.h>
 #include <linux/platform_data/mtd-orion_nand.h>
 #include <plat/time.h>
index 5e269d7263cea17b31cfd9c4294a0a3a8ce9d84f..4fecf5d41d8d7278fdc925eadac2d4091d5a9a85 100644 (file)
@@ -1,5 +1,5 @@
 config ARCH_MVEBU
-       bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7
+       bool "Marvell Engineering Business Unit (MVEBU) SoCs" if (ARCH_MULTI_V7 || ARCH_MULTI_V5)
        select ARCH_SUPPORTS_BIG_ENDIAN
        select CLKSRC_MMIO
        select COMMON_CLK
@@ -19,33 +19,98 @@ config ARCH_MVEBU
 
 if ARCH_MVEBU
 
-menu "Marvell SOC with device tree"
+menu "Marvell EBU SoC variants"
 
-config MACH_ARMADA_370_XP
+config MACH_MVEBU_V7
        bool
        select ARMADA_370_XP_TIMER
        select HAVE_SMP
        select CACHE_L2X0
-       select CPU_PJ4B
 
 config MACH_ARMADA_370
-       bool "Marvell Armada 370 boards"
+       bool "Marvell Armada 370 boards" if ARCH_MULTI_V7
        select ARMADA_370_CLK
-       select MACH_ARMADA_370_XP
+       select CPU_PJ4B
+       select MACH_MVEBU_V7
        select PINCTRL_ARMADA_370
        help
          Say 'Y' here if you want your kernel to support boards based
          on the Marvell Armada 370 SoC with device tree.
 
+config MACH_ARMADA_375
+       bool "Marvell Armada 375 boards" if ARCH_MULTI_V7
+       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" if ARCH_MULTI_V7
+       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
-       bool "Marvell Armada XP boards"
+       bool "Marvell Armada XP boards" if ARCH_MULTI_V7
        select ARMADA_XP_CLK
-       select MACH_ARMADA_370_XP
+       select CPU_PJ4B
+       select MACH_MVEBU_V7
        select PINCTRL_ARMADA_XP
        help
          Say 'Y' here if you want your kernel to support boards based
          on the Marvell Armada XP SoC with device tree.
 
+config MACH_DOVE
+       bool "Marvell Dove boards" if ARCH_MULTI_V7
+       select CACHE_L2X0
+       select CPU_PJ4
+       select DOVE_CLK
+       select ORION_IRQCHIP
+       select ORION_TIMER
+       select PINCTRL_DOVE
+       help
+         Say 'Y' here if you want your kernel to support the
+         Marvell Dove using flattened device tree.
+
+config MACH_KIRKWOOD
+       bool "Marvell Kirkwood boards" if ARCH_MULTI_V5
+       select ARCH_HAS_CPUFREQ
+       select ARCH_REQUIRE_GPIOLIB
+       select CPU_FEROCEON
+       select KIRKWOOD_CLK
+       select OF_IRQ
+       select ORION_IRQCHIP
+       select ORION_TIMER
+       select PCI
+       select PCI_QUIRKS
+       select PINCTRL_KIRKWOOD
+       select USE_OF
+       help
+         Say 'Y' here if you want your kernel to support boards based
+         on the Marvell Kirkwood device tree.
+
+config MACH_T5325
+       bool "HP T5325 thin client"
+       depends on MACH_KIRKWOOD
+       help
+         Say 'Y' here if you want your kernel to support the
+         HP T5325 Thin client
+
 endmenu
 
 endif
index 878aebe98dcc817029732847f6b2fb39880f8ba2..a63e43b6b451e24c1aba904006f9d5a3c636a47d 100644 (file)
@@ -4,7 +4,10 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 AFLAGS_coherency_ll.o          := -Wa,-march=armv7-a
 
 obj-y                           += system-controller.o mvebu-soc-id.o
-obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
+obj-$(CONFIG_MACH_MVEBU_V7)      += board-v7.o
+obj-$(CONFIG_MACH_DOVE)                 += dove.o
 obj-$(CONFIG_ARCH_MVEBU)        += coherency.o coherency_ll.o pmsu.o
 obj-$(CONFIG_SMP)                += platsmp.o headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)        += hotplug.o
+obj-$(CONFIG_MACH_KIRKWOOD)     += kirkwood.o kirkwood-pm.o
+obj-$(CONFIG_MACH_T5325)        += board-t5325.o
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
deleted file mode 100644 (file)
index f6c9d1d..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Device Tree support for Armada 370 and XP platforms.
- *
- * Copyright (C) 2012 Marvell
- *
- * Lior Amsalem <alior@marvell.com>
- * Gregory CLEMENT <gregory.clement@free-electrons.com>
- * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/clk-provider.h>
-#include <linux/of_address.h>
-#include <linux/of_platform.h>
-#include <linux/io.h>
-#include <linux/clocksource.h>
-#include <linux/dma-mapping.h>
-#include <linux/mbus.h>
-#include <linux/slab.h>
-#include <asm/hardware/cache-l2x0.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/time.h>
-#include "armada-370-xp.h"
-#include "common.h"
-#include "coherency.h"
-#include "mvebu-soc-id.h"
-
-static void __init armada_370_xp_map_io(void)
-{
-       debug_ll_io_init();
-}
-
-static void __init armada_370_xp_timer_and_clk_init(void)
-{
-       of_clk_init(NULL);
-       clocksource_of_init();
-       coherency_init();
-       BUG_ON(mvebu_mbus_dt_init());
-#ifdef CONFIG_CACHE_L2X0
-       l2x0_of_init(0, ~0UL);
-#endif
-}
-
-static void __init i2c_quirk(void)
-{
-       struct device_node *np;
-       u32 dev, rev;
-
-       /*
-        * Only revisons more recent than A0 support the offload
-        * mechanism. We can exit only if we are sure that we can
-        * get the SoC revision and it is more recent than A0.
-        */
-       if (mvebu_get_soc_id(&rev, &dev) == 0 && dev > MV78XX0_A0_REV)
-               return;
-
-       for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") {
-               struct property *new_compat;
-
-               new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
-
-               new_compat->name = kstrdup("compatible", GFP_KERNEL);
-               new_compat->length = sizeof("marvell,mv78230-a0-i2c");
-               new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
-                                               GFP_KERNEL);
-
-               of_update_property(np, new_compat);
-       }
-       return;
-}
-
-static void __init armada_370_xp_dt_init(void)
-{
-       if (of_machine_is_compatible("plathome,openblocks-ax3-4"))
-               i2c_quirk();
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
-static const char * const armada_370_xp_dt_compat[] = {
-       "marvell,armada-370-xp",
-       NULL,
-};
-
-DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)")
-       .smp            = smp_ops(armada_xp_smp_ops),
-       .init_machine   = armada_370_xp_dt_init,
-       .map_io         = armada_370_xp_map_io,
-       .init_time      = armada_370_xp_timer_and_clk_init,
-       .restart        = mvebu_restart,
-       .dt_compat      = armada_370_xp_dt_compat,
-MACHINE_END
diff --git a/arch/arm/mach-mvebu/board-t5325.c b/arch/arm/mach-mvebu/board-t5325.c
new file mode 100644 (file)
index 0000000..65ace6d
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * HP T5325 Board Setup
+ *
+ * Copyright (C) 2014
+ *
+ * Andrew Lunn <andrew@lunn.ch>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/i2c.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <sound/alc5623.h>
+#include "board.h"
+
+static struct platform_device hp_t5325_audio_device = {
+       .name           = "t5325-audio",
+       .id             = -1,
+};
+
+static struct alc5623_platform_data alc5621_data = {
+       .add_ctrl = 0x3700,
+       .jack_det_ctrl = 0x4810,
+};
+
+static struct i2c_board_info i2c_board_info[] __initdata = {
+       {
+               I2C_BOARD_INFO("alc5621", 0x1a),
+               .platform_data = &alc5621_data,
+       },
+};
+
+void __init t5325_init(void)
+{
+       i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));
+       platform_device_register(&hp_t5325_audio_device);
+}
diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c
new file mode 100644 (file)
index 0000000..746134e
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Device Tree support for Armada 370 and XP platforms.
+ *
+ * Copyright (C) 2012 Marvell
+ *
+ * Lior Amsalem <alior@marvell.com>
+ * Gregory CLEMENT <gregory.clement@free-electrons.com>
+ * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/clk-provider.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/io.h>
+#include <linux/clocksource.h>
+#include <linux/dma-mapping.h>
+#include <linux/mbus.h>
+#include <linux/slab.h>
+#include <asm/hardware/cache-l2x0.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/time.h>
+#include "armada-370-xp.h"
+#include "common.h"
+#include "coherency.h"
+#include "mvebu-soc-id.h"
+
+/*
+ * 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);
+       clocksource_of_init();
+       coherency_init();
+       BUG_ON(mvebu_mbus_dt_init());
+#ifdef CONFIG_CACHE_L2X0
+       l2x0_of_init(0, ~0UL);
+#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)
+{
+       struct device_node *np;
+       u32 dev, rev;
+
+       /*
+        * Only revisons more recent than A0 support the offload
+        * mechanism. We can exit only if we are sure that we can
+        * get the SoC revision and it is more recent than A0.
+        */
+       if (mvebu_get_soc_id(&rev, &dev) == 0 && dev > MV78XX0_A0_REV)
+               return;
+
+       for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") {
+               struct property *new_compat;
+
+               new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
+
+               new_compat->name = kstrdup("compatible", GFP_KERNEL);
+               new_compat->length = sizeof("marvell,mv78230-a0-i2c");
+               new_compat->value = kstrdup("marvell,mv78230-a0-i2c",
+                                               GFP_KERNEL);
+
+               of_update_property(np, new_compat);
+       }
+       return;
+}
+
+static void __init mvebu_dt_init(void)
+{
+       if (of_machine_is_compatible("plathome,openblocks-ax3-4"))
+               i2c_quirk();
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char * const armada_370_xp_dt_compat[] = {
+       "marvell,armada-370-xp",
+       NULL,
+};
+
+DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)")
+       .smp            = smp_ops(armada_xp_smp_ops),
+       .init_machine   = mvebu_dt_init,
+       .init_time      = mvebu_timer_and_clk_init,
+       .restart        = mvebu_restart,
+       .dt_compat      = armada_370_xp_dt_compat,
+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
diff --git a/arch/arm/mach-mvebu/board.h b/arch/arm/mach-mvebu/board.h
new file mode 100644 (file)
index 0000000..de7f0a1
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Board functions for Marvell System On Chip
+ *
+ * Copyright (C) 2014
+ *
+ * Andrew Lunn <andrew@lunn.ch>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#ifndef __ARCH_MVEBU_BOARD_H
+#define __ARCH_MVEBU_BOARD_H
+
+#ifdef CONFIG_MACH_T5325
+void t5325_init(void);
+#else
+static inline void t5325_init(void) {};
+#endif
+
+#endif
diff --git a/arch/arm/mach-mvebu/dove.c b/arch/arm/mach-mvebu/dove.c
new file mode 100644 (file)
index 0000000..5e5a436
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * arch/arm/mach-mvebu/dove.c
+ *
+ * Marvell Dove 88AP510 System On Chip FDT Board
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/init.h>
+#include <linux/mbus.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <asm/hardware/cache-tauros2.h>
+#include <asm/mach/arch.h>
+#include "common.h"
+
+static void __init dove_init(void)
+{
+       pr_info("Dove 88AP510 SoC\n");
+
+#ifdef CONFIG_CACHE_TAUROS2
+       tauros2_init(0);
+#endif
+       BUG_ON(mvebu_mbus_dt_init());
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char * const dove_dt_compat[] = {
+       "marvell,dove",
+       NULL
+};
+
+DT_MACHINE_START(DOVE_DT, "Marvell Dove")
+       .init_machine   = dove_init,
+       .restart        = mvebu_restart,
+       .dt_compat      = dove_dt_compat,
+MACHINE_END
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.c b/arch/arm/mach-mvebu/kirkwood-pm.c
new file mode 100644 (file)
index 0000000..cbb816f
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Power Management driver for Marvell Kirkwood SoCs
+ *
+ * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
+ * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License,
+ * version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/kernel.h>
+#include <linux/suspend.h>
+#include <linux/io.h>
+#include "kirkwood.h"
+
+static void __iomem *ddr_operation_base;
+static void __iomem *memory_pm_ctrl;
+
+static void kirkwood_low_power(void)
+{
+       u32 mem_pm_ctrl;
+
+       mem_pm_ctrl = readl(memory_pm_ctrl);
+
+       /* Set peripherals to low-power mode */
+       writel_relaxed(~0, memory_pm_ctrl);
+
+       /* Set DDR in self-refresh */
+       writel_relaxed(0x7, ddr_operation_base);
+
+       /*
+        * Set CPU in wait-for-interrupt state.
+        * This disables the CPU core clocks,
+        * the array clocks, and also the L2 controller.
+        */
+       cpu_do_idle();
+
+       writel_relaxed(mem_pm_ctrl, memory_pm_ctrl);
+}
+
+static int kirkwood_suspend_enter(suspend_state_t state)
+{
+       switch (state) {
+       case PM_SUSPEND_STANDBY:
+               kirkwood_low_power();
+               break;
+       default:
+               return -EINVAL;
+       }
+       return 0;
+}
+
+static int kirkwood_pm_valid_standby(suspend_state_t state)
+{
+       return state == PM_SUSPEND_STANDBY;
+}
+
+static const struct platform_suspend_ops kirkwood_suspend_ops = {
+       .enter = kirkwood_suspend_enter,
+       .valid = kirkwood_pm_valid_standby,
+};
+
+int __init kirkwood_pm_init(void)
+{
+       ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4);
+       memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4);
+
+       suspend_set_ops(&kirkwood_suspend_ops);
+       return 0;
+}
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.h b/arch/arm/mach-mvebu/kirkwood-pm.h
new file mode 100644 (file)
index 0000000..21e7530
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Power Management driver for Marvell Kirkwood SoCs
+ *
+ * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com>
+ * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License,
+ * version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ARCH_KIRKWOOD_PM_H
+#define __ARCH_KIRKWOOD_PM_H
+
+#ifdef CONFIG_PM
+void kirkwood_pm_init(void);
+#else
+static inline void kirkwood_pm_init(void) {};
+#endif
+
+#endif
diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c
new file mode 100644 (file)
index 0000000..120207f
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net>
+ *
+ * arch/arm/mach-mvebu/kirkwood.c
+ *
+ * Flattened Device Tree board initialization
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include <linux/clk.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/mbus.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_net.h>
+#include <linux/of_platform.h>
+#include <linux/slab.h>
+#include <asm/hardware/cache-feroceon-l2.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include "kirkwood.h"
+#include "kirkwood-pm.h"
+#include "common.h"
+#include "board.h"
+
+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);
+}
+
+#define MV643XX_ETH_MAC_ADDR_LOW       0x0414
+#define MV643XX_ETH_MAC_ADDR_HIGH      0x0418
+
+static void __init kirkwood_dt_eth_fixup(void)
+{
+       struct device_node *np;
+
+       /*
+        * The ethernet interfaces forget the MAC address assigned by u-boot
+        * if the clocks are turned off. Usually, u-boot on kirkwood boards
+        * has no DT support to properly set local-mac-address property.
+        * As a workaround, we get the MAC address from mv643xx_eth registers
+        * and update the port device node if no valid MAC address is set.
+        */
+       for_each_compatible_node(np, NULL, "marvell,kirkwood-eth-port") {
+               struct device_node *pnp = of_get_parent(np);
+               struct clk *clk;
+               struct property *pmac;
+               void __iomem *io;
+               u8 *macaddr;
+               u32 reg;
+
+               if (!pnp)
+                       continue;
+
+               /* skip disabled nodes or nodes with valid MAC address*/
+               if (!of_device_is_available(pnp) || of_get_mac_address(np))
+                       goto eth_fixup_skip;
+
+               clk = of_clk_get(pnp, 0);
+               if (IS_ERR(clk))
+                       goto eth_fixup_skip;
+
+               io = of_iomap(pnp, 0);
+               if (!io)
+                       goto eth_fixup_no_map;
+
+               /* ensure port clock is not gated to not hang CPU */
+               clk_prepare_enable(clk);
+
+               /* store MAC address register contents in local-mac-address */
+               pr_err(FW_INFO "%s: local-mac-address is not set\n",
+                      np->full_name);
+
+               pmac = kzalloc(sizeof(*pmac) + 6, GFP_KERNEL);
+               if (!pmac)
+                       goto eth_fixup_no_mem;
+
+               pmac->value = pmac + 1;
+               pmac->length = 6;
+               pmac->name = kstrdup("local-mac-address", GFP_KERNEL);
+               if (!pmac->name) {
+                       kfree(pmac);
+                       goto eth_fixup_no_mem;
+               }
+
+               macaddr = pmac->value;
+               reg = readl(io + MV643XX_ETH_MAC_ADDR_HIGH);
+               macaddr[0] = (reg >> 24) & 0xff;
+               macaddr[1] = (reg >> 16) & 0xff;
+               macaddr[2] = (reg >> 8) & 0xff;
+               macaddr[3] = reg & 0xff;
+
+               reg = readl(io + MV643XX_ETH_MAC_ADDR_LOW);
+               macaddr[4] = (reg >> 8) & 0xff;
+               macaddr[5] = reg & 0xff;
+
+               of_update_property(np, pmac);
+
+eth_fixup_no_mem:
+               iounmap(io);
+               clk_disable_unprepare(clk);
+eth_fixup_no_map:
+               clk_put(clk);
+eth_fixup_skip:
+               of_node_put(pnp);
+       }
+}
+
+/*
+ * Disable propagation of mbus errors to the CPU local bus, as this
+ * causes mbus errors (which can occur for example for PCI aborts) to
+ * throw CPU aborts, which we're not set up to deal with.
+ */
+void kirkwood_disable_mbus_error_propagation(void)
+{
+       void __iomem *cpu_config;
+
+       cpu_config = ioremap(CPU_CONFIG_PHYS, 4);
+       writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
+}
+
+static struct of_dev_auxdata auxdata[] __initdata = {
+       OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000,
+                      "mvebu-audio", NULL),
+       { /* sentinel */ }
+};
+
+static void __init kirkwood_dt_init(void)
+{
+       kirkwood_disable_mbus_error_propagation();
+
+       BUG_ON(mvebu_mbus_dt_init());
+
+#ifdef CONFIG_CACHE_FEROCEON_L2
+       feroceon_of_init();
+#endif
+       kirkwood_cpufreq_init();
+       kirkwood_cpuidle_init();
+
+       kirkwood_pm_init();
+       kirkwood_dt_eth_fixup();
+
+       if (of_machine_is_compatible("hp,t5325"))
+               t5325_init();
+
+       of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL);
+}
+
+static const char * const kirkwood_dt_board_compat[] = {
+       "marvell,kirkwood",
+       NULL
+};
+
+DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
+       /* Maintainer: Jason Cooper <jason@lakedaemon.net> */
+       .init_machine   = kirkwood_dt_init,
+       .restart        = mvebu_restart,
+       .dt_compat      = kirkwood_dt_board_compat,
+MACHINE_END
diff --git a/arch/arm/mach-mvebu/kirkwood.h b/arch/arm/mach-mvebu/kirkwood.h
new file mode 100644 (file)
index 0000000..89f3d1f
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * arch/arm/mach-mvebu/kirkwood.h
+ *
+ * Generic definitions for Marvell Kirkwood SoC flavors:
+ * 88F6180, 88F6192 and 88F6281.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#define KIRKWOOD_REGS_PHYS_BASE        0xf1000000
+#define DDR_PHYS_BASE           (KIRKWOOD_REGS_PHYS_BASE + 0x00000)
+#define BRIDGE_PHYS_BASE       (KIRKWOOD_REGS_PHYS_BASE + 0x20000)
+
+#define DDR_OPERATION_BASE     (DDR_PHYS_BASE + 0x1418)
+
+#define CPU_CONFIG_PHYS                (BRIDGE_PHYS_BASE + 0x0100)
+#define CPU_CONFIG_ERROR_PROP  0x00000004
+
+#define CPU_CONTROL_PHYS       (BRIDGE_PHYS_BASE + 0x0104)
+#define MEMORY_PM_CTRL_PHYS    (BRIDGE_PHYS_BASE + 0x0118)
index f3b325f6cbd4e8cc7c9b493d99bb688c5f3f9511..f3d4cf53f7466ba6c44f5ef1d91484e3ce8f62e6 100644 (file)
@@ -38,6 +38,7 @@ static bool is_id_valid;
 static const struct of_device_id mvebu_pcie_of_match_table[] = {
        { .compatible = "marvell,armada-xp-pcie", },
        { .compatible = "marvell,armada-370-pcie", },
+       { .compatible = "marvell,kirkwood-pcie" },
        {},
 };
 
index a7fb89a5b5d9818db3174916d0e7e0589ed53456..614ba6832ff3ae4e14fe72ff12bdd98c83b95964 100644 (file)
@@ -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
  *
@@ -11,7 +11,7 @@
  * License version 2.  This program is licensed "as is" without any
  * 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,
  * but rather provide system-level features. This basic
  * 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,
 };
 
+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 = {
        .rstoutn_mask_offset = 0x108,
        .system_soft_reset_offset = 0x10c,
@@ -54,13 +61,16 @@ static const struct mvebu_system_controller orion_system_controller = {
        .system_soft_reset = 0x1,
 };
 
-static struct of_device_id of_system_controller_table[] = {
+static const struct of_device_id of_system_controller_table[] = {
        {
                .compatible = "marvell,orion-system-controller",
                .data = (void *) &orion_system_controller,
        }, {
                .compatible = "marvell,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 */ },
 };
@@ -90,13 +100,12 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd)
 
 static int __init mvebu_system_controller_init(void)
 {
+       const struct of_device_id *match;
        struct device_node *np;
 
-       np = of_find_matching_node(NULL, of_system_controller_table);
+       np = of_find_matching_node_and_match(NULL, of_system_controller_table,
+                                            &match);
        if (np) {
-               const struct of_device_id *match =
-                   of_match_node(of_system_controller_table, np);
-               BUG_ON(!match);
                system_controller_base = of_iomap(np, 0);
                mvebu_sc = (struct mvebu_system_controller *)match->data;
                of_node_put(np);
index 1f8fed94c2a499939354258fc61339a10d229a4f..dccd7e177653a978c7bcc940e5d6900407d7b1f9 100644 (file)
@@ -855,7 +855,7 @@ config OUTER_CACHE_SYNC
 
 config CACHE_FEROCEON_L2
        bool "Enable the Feroceon L2 cache controller"
-       depends on ARCH_KIRKWOOD || ARCH_MV78XX0
+       depends on ARCH_KIRKWOOD || ARCH_MV78XX0 || ARCH_MVEBU
        default y
        select OUTER_CACHE
        help
index 48bc3c0a87ce321cc2e37c257bf217dc085307e6..8dc1a2b5a8ed5148880a7ec8edd46e3c2ece8fe9 100644 (file)
  */
 
 #include <linux/init.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/highmem.h>
+#include <linux/io.h>
 #include <asm/cacheflush.h>
 #include <asm/cp15.h>
-#include <plat/cache-feroceon-l2.h>
+#include <asm/hardware/cache-feroceon-l2.h>
+
+#define L2_WRITETHROUGH_KIRKWOOD       BIT(4)
 
 /*
  * Low-level cache maintenance operations.
@@ -350,3 +355,41 @@ void __init feroceon_l2_init(int __l2_wt_override)
        printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n",
                         l2_wt_override ? ", in WT override mode" : "");
 }
+#ifdef CONFIG_OF
+static const struct of_device_id feroceon_ids[] __initconst = {
+       { .compatible = "marvell,kirkwood-cache"},
+       { .compatible = "marvell,feroceon-cache"},
+       {}
+};
+
+int __init feroceon_of_init(void)
+{
+       struct device_node *node;
+       void __iomem *base;
+       bool l2_wt_override = false;
+       struct resource res;
+
+#if defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH)
+       l2_wt_override = true;
+#endif
+
+       node = of_find_matching_node(NULL, feroceon_ids);
+       if (node && of_device_is_compatible(node, "marvell,kirkwood-cache")) {
+               if (of_address_to_resource(node, 0, &res))
+                       return -ENODEV;
+
+               base = ioremap(res.start, resource_size(&res));
+               if (!base)
+                       return -ENOMEM;
+
+               if (l2_wt_override)
+                       writel(readl(base) | L2_WRITETHROUGH_KIRKWOOD, base);
+               else
+                       writel(readl(base) & ~L2_WRITETHROUGH_KIRKWOOD, base);
+       }
+
+       feroceon_l2_init(l2_wt_override);
+
+       return 0;
+}
+#endif
diff --git a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h b/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h
deleted file mode 100644 (file)
index 06f982d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * arch/arm/plat-orion/include/plat/cache-feroceon-l2.h
- *
- * Copyright (C) 2008 Marvell Semiconductor
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-
-extern void __init feroceon_l2_init(int l2_wt_override);