arm: initial machine port for artpec-6 SoC
authorLars Persson <lars.persson@axis.com>
Thu, 11 Feb 2016 16:06:19 +0000 (17:06 +0100)
committerOlof Johansson <olof@lixom.net>
Wed, 24 Feb 2016 21:55:47 +0000 (13:55 -0800)
Basic machine port for the Artpec-6 SoC from Axis
Communications.

Signed-off-by: Lars Persson <larper@axis.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/mach-artpec/Kconfig [new file with mode: 0644]
arch/arm/mach-artpec/Makefile [new file with mode: 0644]
arch/arm/mach-artpec/board-artpec6.c [new file with mode: 0644]

index 84b7291de5c2917dc675ef0d274a333142436fbb..7c5920fdcbbdc0ab97abcbcb0789b761fe4c791a 100644 (file)
@@ -724,6 +724,8 @@ source "arch/arm/mach-mvebu/Kconfig"
 
 source "arch/arm/mach-alpine/Kconfig"
 
+source "arch/arm/mach-artpec/Kconfig"
+
 source "arch/arm/mach-asm9260/Kconfig"
 
 source "arch/arm/mach-at91/Kconfig"
index fe254108d1d92c88bb05b90221ca314edcaceedb..4eb24c633714d6d648e76f94a2b53a545bc5f81c 100644 (file)
@@ -154,6 +154,7 @@ textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
 # Machine directory name.  This list is sorted alphanumerically
 # by CONFIG_* macro name.
 machine-$(CONFIG_ARCH_ALPINE)          += alpine
+machine-$(CONFIG_ARCH_ARTPEC)          += artpec
 machine-$(CONFIG_ARCH_AT91)            += at91
 machine-$(CONFIG_ARCH_AXXIA)           += axxia
 machine-$(CONFIG_ARCH_BCM)             += bcm
diff --git a/arch/arm/mach-artpec/Kconfig b/arch/arm/mach-artpec/Kconfig
new file mode 100644 (file)
index 0000000..6cbe5a2
--- /dev/null
@@ -0,0 +1,20 @@
+menuconfig ARCH_ARTPEC
+       bool "Axis Communications ARM based ARTPEC SoCs"
+       depends on ARCH_MULTI_V7
+
+if ARCH_ARTPEC
+
+config MACH_ARTPEC6
+       bool "Axis ARTPEC-6 ARM Cortex A9 Platform"
+       depends on ARCH_MULTI_V7
+       select ARM_AMBA
+       select ARM_GIC
+       select ARM_GLOBAL_TIMER
+       select ARM_PSCI
+       select HAVE_ARM_ARCH_TIMER
+       select HAVE_ARM_SCU
+       select HAVE_ARM_TWD if SMP
+       help
+         Support for Axis ARTPEC-6 ARM Cortex A9 Platform
+
+endif
diff --git a/arch/arm/mach-artpec/Makefile b/arch/arm/mach-artpec/Makefile
new file mode 100644 (file)
index 0000000..78325f0
--- /dev/null
@@ -0,0 +1 @@
+obj-$(CONFIG_MACH_ARTPEC6)             := board-artpec6.o
diff --git a/arch/arm/mach-artpec/board-artpec6.c b/arch/arm/mach-artpec/board-artpec6.c
new file mode 100644 (file)
index 0000000..71513df
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * ARTPEC-6 device support.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/amba/bus.h>
+#include <linux/clocksource.h>
+#include <linux/dma-mapping.h>
+#include <linux/io.h>
+#include <linux/irqchip.h>
+#include <linux/irqchip/arm-gic.h>
+#include <linux/mfd/syscon.h>
+#include <linux/of_platform.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/clk-provider.h>
+#include <linux/regmap.h>
+#include <linux/smp.h>
+#include <asm/smp_scu.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/psci.h>
+#include <linux/arm-smccc.h>
+
+
+#define ARTPEC6_DMACFG_REGNUM 0x10
+#define ARTPEC6_DMACFG_UARTS_BURST 0xff
+
+#define SECURE_OP_L2C_WRITEREG 0xb4000001
+
+static void __init artpec6_init_machine(void)
+{
+       struct regmap *regmap;
+
+       regmap = syscon_regmap_lookup_by_compatible("axis,artpec6-syscon");
+
+       if (!IS_ERR(regmap)) {
+               /* Use PL011 DMA Burst Request signal instead of DMA
+                *  Single Request
+                */
+               regmap_write(regmap, ARTPEC6_DMACFG_REGNUM,
+                            ARTPEC6_DMACFG_UARTS_BURST);
+       };
+
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static void artpec6_l2c310_write_sec(unsigned long val, unsigned reg)
+{
+       struct arm_smccc_res res;
+
+       arm_smccc_smc(SECURE_OP_L2C_WRITEREG, reg, val, 0,
+                     0, 0, 0, 0, &res);
+
+       WARN_ON(res.a0);
+}
+
+static const char * const artpec6_dt_match[] = {
+       "axis,artpec6",
+       NULL
+};
+
+DT_MACHINE_START(ARTPEC6, "Axis ARTPEC-6 Platform")
+       .l2c_aux_val    = 0x0C000000,
+       .l2c_aux_mask   = 0xF3FFFFFF,
+       .l2c_write_sec  = artpec6_l2c310_write_sec,
+       .init_machine   = artpec6_init_machine,
+       .dt_compat      = artpec6_dt_match,
+MACHINE_END