aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2013-08-04 09:10:12 +0800
committerZhangfei Gao <zhangfei.gao@linaro.org>2013-11-11 16:45:32 +0800
commit9cac63f6066ca7f0f7f9ade9c03aa3b778f045cd (patch)
treeea6ae88a4e5000f66d3495e6f03e891724f300a5
parentfeb4ce8b7f753ca2a44ad2baddd2d3e88177141e (diff)
ARM: add hisilicon SoC support
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
-rw-r--r--Documentation/devicetree/bindings/arm/hs/hisilicon.txt10
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/mach-hs/Kconfig21
-rw-r--r--arch/arm/mach-hs/Makefile5
-rw-r--r--arch/arm/mach-hs/hs-dt.c82
6 files changed, 121 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/arm/hs/hisilicon.txt b/Documentation/devicetree/bindings/arm/hs/hisilicon.txt
new file mode 100644
index 000000000000..3be60c861dd2
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/hs/hisilicon.txt
@@ -0,0 +1,10 @@
+Hisilicon Platforms Device Tree Bindings
+----------------------------------------------------
+
+Hi3716 Development Board
+Required root node properties:
+ - compatible = "hisilicon,hi3716-dkb";
+
+Hi4511 Board
+Required root node properties:
+ - compatible = "hisilicon,hi3620-hi4511";
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1ad6fb6c094d..5a5e3b104951 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -948,6 +948,8 @@ source "arch/arm/mach-gemini/Kconfig"
source "arch/arm/mach-highbank/Kconfig"
+source "arch/arm/mach-hs/Kconfig"
+
source "arch/arm/mach-integrator/Kconfig"
source "arch/arm/mach-iop32x/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index db50b626be98..32d8affe682d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -156,6 +156,7 @@ machine-$(CONFIG_ARCH_EP93XX) += ep93xx
machine-$(CONFIG_ARCH_EXYNOS) += exynos
machine-$(CONFIG_ARCH_GEMINI) += gemini
machine-$(CONFIG_ARCH_HIGHBANK) += highbank
+machine-$(CONFIG_ARCH_HI3xxx) += hs
machine-$(CONFIG_ARCH_INTEGRATOR) += integrator
machine-$(CONFIG_ARCH_IOP13XX) += iop13xx
machine-$(CONFIG_ARCH_IOP32X) += iop32x
diff --git a/arch/arm/mach-hs/Kconfig b/arch/arm/mach-hs/Kconfig
new file mode 100644
index 000000000000..6b1e18c57118
--- /dev/null
+++ b/arch/arm/mach-hs/Kconfig
@@ -0,0 +1,21 @@
+config ARCH_HI3xxx
+ bool "Hisilicon Hi36xx/Hi37xx family" if ARCH_MULTI_V7
+ select CACHE_L2X0
+ select CACHE_PL310
+ select PINCTRL
+ select PINCTRL_SINGLE
+ select SERIAL_AMBA_PL011
+ select SERIAL_AMBA_PL011_CONSOLE
+ help
+ Support for Hislicon Hi36xx/Hi37xx processor family
+
+if ARCH_HI3xxx
+
+config MACH_HS_DT
+ bool "Hisilicon Development Board"
+ default y
+ help
+ Say 'Y' here if you want to support the Hisilicon Development
+ Board.
+
+endif
diff --git a/arch/arm/mach-hs/Makefile b/arch/arm/mach-hs/Makefile
new file mode 100644
index 000000000000..d79ecb55a2c9
--- /dev/null
+++ b/arch/arm/mach-hs/Makefile
@@ -0,0 +1,5 @@
+#
+# Makefile for Hisilicon Hi36xx/Hi37xx processors line
+#
+
+obj-$(CONFIG_MACH_HS_DT) += hs-dt.o
diff --git a/arch/arm/mach-hs/hs-dt.c b/arch/arm/mach-hs/hs-dt.c
new file mode 100644
index 000000000000..774ace66cc22
--- /dev/null
+++ b/arch/arm/mach-hs/hs-dt.c
@@ -0,0 +1,82 @@
+/*
+ * (Hisilicon's Hi36xx/Hi37xx SoC based) flattened device tree enabled machine
+ *
+ * Copyright (c) 2012-2013 Linaro Ltd.
+ *
+ * Haojian Zhuang <haojian.zhuang@linaro.org>
+ *
+ * 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/clk.h>
+#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
+#include <linux/irqchip.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+
+#include <asm/hardware/arm_timer.h>
+#include <asm/hardware/cache-l2x0.h>
+#include <asm/hardware/timer-sp.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/time.h>
+
+#include <linux/clocksource.h>
+#include "core.h"
+
+static struct of_device_id hs_l2cache_match[] __initdata = {
+ { .compatible = "arm,pl310-cache", },
+ {}
+};
+
+static void __init hi3xxx_timer_init(void)
+{
+ struct device_node *node = NULL;
+ int ret;
+ u32 data[2];
+
+ hs_map_io();
+ hs_hotplug_init();
+ of_clk_init(NULL);
+ clocksource_of_init();
+
+ node = of_find_matching_node(NULL, hs_l2cache_match);
+ WARN_ON(!node);
+ if (!node) {
+ pr_err("Failed to find l2cache\n");
+ return;
+ }
+ ret = of_property_read_u32_array(node, "hisilicon,l2cache-aux",
+ &data[0], 2);
+ if (ret < 0) {
+ data[0] = 0;
+ data[1] = ~0UL;
+ }
+ l2x0_of_init(data[0], data[1]);
+}
+
+static void __init hs_init(void)
+{
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char *hs_compat[] __initdata = {
+ "hisilicon,hi3620-hi4511",
+ "hisilicon,hi3716",
+ NULL,
+};
+
+DT_MACHINE_START(HS_DT, "Hisilicon Hi36xx/Hi37xx (Flattened Device Tree)")
+ /* Maintainer: Haojian Zhuang <haojian.zhuang@linaro.org> */
+ .map_io = debug_ll_io_init,
+ .init_irq = irqchip_init,
+ .init_time = hi3xxx_timer_init,
+ .init_machine = hs_init,
+ .dt_compat = hs_compat,
+ .smp = smp_ops(hs_smp_ops),
+ .restart = hs_restart,
+MACHINE_END