diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2013-12-11 02:54:50 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2013-12-17 19:42:47 -0500 |
commit | 2c7268c70fc1099ce4aac83c194675efd927e90f (patch) | |
tree | aeabac1c3d96e9fc7f0aba9c6523274f6f0a86a7 | |
parent | 6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff) |
ARM: hi3xxx: add board support with device tree
Add board support with device tree for Hisilicon Hi3620 SoC platform.
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
[khilman: fix checkpatch errors]
[khilman: fold in patch which selects GPIO in Kconfig]
Signed-off-by: Kevin Hilman <khilman@linaro.org>
-rw-r--r-- | Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt | 6 | ||||
-rw-r--r-- | arch/arm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-hi3xxx/Kconfig | 13 | ||||
-rw-r--r-- | arch/arm/mach-hi3xxx/Makefile | 5 | ||||
-rw-r--r-- | arch/arm/mach-hi3xxx/hi3xxx.c | 60 |
6 files changed, 87 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt new file mode 100644 index 000000000000..21a73363e019 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt | |||
@@ -0,0 +1,6 @@ | |||
1 | Hisilicon Platforms Device Tree Bindings | ||
2 | ---------------------------------------------------- | ||
3 | |||
4 | Hi4511 Board | ||
5 | Required root node properties: | ||
6 | - compatible = "hisilicon,hi3620-hi4511"; | ||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c1f1a7eee953..75eb5323fedd 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -925,6 +925,8 @@ source "arch/arm/mach-footbridge/Kconfig" | |||
925 | 925 | ||
926 | source "arch/arm/mach-gemini/Kconfig" | 926 | source "arch/arm/mach-gemini/Kconfig" |
927 | 927 | ||
928 | source "arch/arm/mach-hi3xxx/Kconfig" | ||
929 | |||
928 | source "arch/arm/mach-highbank/Kconfig" | 930 | source "arch/arm/mach-highbank/Kconfig" |
929 | 931 | ||
930 | source "arch/arm/mach-integrator/Kconfig" | 932 | source "arch/arm/mach-integrator/Kconfig" |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index c99b1086d83d..dfbafa38b4cd 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -156,6 +156,7 @@ machine-$(CONFIG_ARCH_EBSA110) += ebsa110 | |||
156 | machine-$(CONFIG_ARCH_EP93XX) += ep93xx | 156 | machine-$(CONFIG_ARCH_EP93XX) += ep93xx |
157 | machine-$(CONFIG_ARCH_EXYNOS) += exynos | 157 | machine-$(CONFIG_ARCH_EXYNOS) += exynos |
158 | machine-$(CONFIG_ARCH_GEMINI) += gemini | 158 | machine-$(CONFIG_ARCH_GEMINI) += gemini |
159 | machine-$(CONFIG_ARCH_HI3xxx) += hi3xxx | ||
159 | machine-$(CONFIG_ARCH_HIGHBANK) += highbank | 160 | machine-$(CONFIG_ARCH_HIGHBANK) += highbank |
160 | machine-$(CONFIG_ARCH_INTEGRATOR) += integrator | 161 | machine-$(CONFIG_ARCH_INTEGRATOR) += integrator |
161 | machine-$(CONFIG_ARCH_IOP13XX) += iop13xx | 162 | machine-$(CONFIG_ARCH_IOP13XX) += iop13xx |
diff --git a/arch/arm/mach-hi3xxx/Kconfig b/arch/arm/mach-hi3xxx/Kconfig new file mode 100644 index 000000000000..8a502d1e9542 --- /dev/null +++ b/arch/arm/mach-hi3xxx/Kconfig | |||
@@ -0,0 +1,13 @@ | |||
1 | config ARCH_HI3xxx | ||
2 | bool "Hisilicon Hi36xx/Hi37xx family" if ARCH_MULTI_V7 | ||
3 | select ARM_AMBA | ||
4 | select ARM_GIC | ||
5 | select ARM_TIMER_SP804 | ||
6 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
7 | select CACHE_L2X0 | ||
8 | select CLKSRC_OF | ||
9 | select GENERIC_CLOCKEVENTS | ||
10 | select PINCTRL | ||
11 | select PINCTRL_SINGLE | ||
12 | help | ||
13 | Support for Hisilicon Hi36xx/Hi37xx processor family | ||
diff --git a/arch/arm/mach-hi3xxx/Makefile b/arch/arm/mach-hi3xxx/Makefile new file mode 100644 index 000000000000..d68ebb3d10bb --- /dev/null +++ b/arch/arm/mach-hi3xxx/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | # | ||
2 | # Makefile for Hisilicon Hi36xx/Hi37xx processors line | ||
3 | # | ||
4 | |||
5 | obj-y += hi3xxx.o | ||
diff --git a/arch/arm/mach-hi3xxx/hi3xxx.c b/arch/arm/mach-hi3xxx/hi3xxx.c new file mode 100644 index 000000000000..fe56daf84b1a --- /dev/null +++ b/arch/arm/mach-hi3xxx/hi3xxx.c | |||
@@ -0,0 +1,60 @@ | |||
1 | 5/* | ||
2 | * (Hisilicon's Hi36xx/Hi37xx SoC based) flattened device tree enabled machine | ||
3 | * | ||
4 | * Copyright (c) 2012-2013 Hisilicon Ltd. | ||
5 | * Copyright (c) 2012-2013 Linaro Ltd. | ||
6 | * | ||
7 | * Author: Haojian Zhuang <haojian.zhuang@linaro.org> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/clk-provider.h> | ||
15 | #include <linux/clocksource.h> | ||
16 | #include <linux/irqchip.h> | ||
17 | #include <linux/of_platform.h> | ||
18 | |||
19 | #include <asm/mach/arch.h> | ||
20 | #include <asm/mach/map.h> | ||
21 | |||
22 | /* | ||
23 | * This table is only for optimization. Since ioremap() could always share | ||
24 | * the same mapping if it's defined as static IO mapping. | ||
25 | * | ||
26 | * Without this table, system could also work. The cost is some virtual address | ||
27 | * spaces wasted since ioremap() may be called multi times for the same | ||
28 | * IO space. | ||
29 | */ | ||
30 | static struct map_desc hi3620_io_desc[] __initdata = { | ||
31 | { | ||
32 | .pfn = __phys_to_pfn(0xfc802000), | ||
33 | .virtual = 0xfe802000, | ||
34 | .length = 0x1000, | ||
35 | .type = MT_DEVICE, | ||
36 | }, | ||
37 | }; | ||
38 | |||
39 | static void __init hi3620_map_io(void) | ||
40 | { | ||
41 | debug_ll_io_init(); | ||
42 | iotable_init(hi3620_io_desc, ARRAY_SIZE(hi3620_io_desc)); | ||
43 | } | ||
44 | |||
45 | static void __init hi3xxx_timer_init(void) | ||
46 | { | ||
47 | of_clk_init(NULL); | ||
48 | clocksource_of_init(); | ||
49 | } | ||
50 | |||
51 | static const char *hi3xxx_compat[] __initconst = { | ||
52 | "hisilicon,hi3620-hi4511", | ||
53 | NULL, | ||
54 | }; | ||
55 | |||
56 | DT_MACHINE_START(HI3620, "Hisilicon Hi3620 (Flattened Device Tree)") | ||
57 | .map_io = hi3620_map_io, | ||
58 | .init_time = hi3xxx_timer_init, | ||
59 | .dt_compat = hi3xxx_compat, | ||
60 | MACHINE_END | ||