aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Krawczuk <m.krawczuk@partner.samsung.com>2013-09-28 12:25:28 -0400
committerKukjin Kim <kgene.kim@samsung.com>2014-07-18 15:25:09 -0400
commitadbd1ad139789ec8a5f8c7ab397d6636d6a3d277 (patch)
treebd722a3de65f44f53f109fd3e717fa6dab1f9fca
parent949ccc3a93630ed61f0f38fbf76ee2667d11d3f7 (diff)
ARM: S5PV210: Add board file for boot using Device Tree
This patch adds board file that will be used to boot S5PV210/S5PC110-based boards using Device Tree. Signed-off-by: Mateusz Krawczuk <m.krawczuk@partner.samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> [t.figa: Rebased and cleaned-up a bit.] Signed-off-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r--arch/arm/mach-s5pv210/Kconfig14
-rw-r--r--arch/arm/mach-s5pv210/Makefile2
-rw-r--r--arch/arm/mach-s5pv210/s5pv210.c68
3 files changed, 83 insertions, 1 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index f60f2862856d..ed492cf10a16 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -194,6 +194,20 @@ config MACH_TORBRECK
194 help 194 help
195 Machine support for aESOP Torbreck 195 Machine support for aESOP Torbreck
196 196
197config MACH_S5PV210_DT
198 bool "Samsung S5PV210/S5PC110 machine using Device Tree"
199 select CLKSRC_OF
200 select CPU_S5PV210
201 select PINCTRL
202 select PINCTRL_EXYNOS
203 select USE_OF
204 help
205 Machine support for Samsung S5PV210/S5PC110 machines with Device Tree
206 enabled.
207 Select this if a fdt blob is available for your S5PV210 SoC based
208 board.
209 Note: This is under development and not all peripherals can be
210 supported with this machine file.
197endmenu 211endmenu
198 212
199endif 213endif
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 08358bbccb88..8d87b10ea461 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -24,7 +24,7 @@ obj-$(CONFIG_MACH_GONI) += mach-goni.o
24obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o 24obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
25obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o 25obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o
26obj-$(CONFIG_MACH_TORBRECK) += mach-torbreck.o 26obj-$(CONFIG_MACH_TORBRECK) += mach-torbreck.o
27 27obj-$(CONFIG_MACH_S5PV210_DT) += s5pv210.o
28# device support 28# device support
29 29
30obj-y += dev-audio.o 30obj-y += dev-audio.o
diff --git a/arch/arm/mach-s5pv210/s5pv210.c b/arch/arm/mach-s5pv210/s5pv210.c
new file mode 100644
index 000000000000..c244ccb6b236
--- /dev/null
+++ b/arch/arm/mach-s5pv210/s5pv210.c
@@ -0,0 +1,68 @@
1/*
2 * Samsung's S5PC110/S5PV210 flattened device tree enabled machine.
3 *
4 * Copyright (c) 2013-2014 Samsung Electronics Co., Ltd.
5 * Mateusz Krawczuk <m.krawczuk@partner.samsung.com>
6 * Tomasz Figa <t.figa@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/of_fdt.h>
14#include <linux/of_platform.h>
15
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18#include <asm/system_misc.h>
19
20#include <plat/map-base.h>
21#include <mach/regs-clock.h>
22
23static int __init s5pv210_fdt_map_sys(unsigned long node, const char *uname,
24 int depth, void *data)
25{
26 struct map_desc iodesc;
27 const __be32 *reg;
28 int len;
29
30 if (!of_flat_dt_is_compatible(node, "samsung,s5pv210-clock"))
31 return 0;
32
33 reg = of_get_flat_dt_prop(node, "reg", &len);
34 if (reg == NULL || len != (sizeof(unsigned long) * 2))
35 return 0;
36
37 iodesc.pfn = __phys_to_pfn(be32_to_cpu(reg[0]));
38 iodesc.length = be32_to_cpu(reg[1]) - 1;
39 iodesc.virtual = (unsigned long)S3C_VA_SYS;
40 iodesc.type = MT_DEVICE;
41 iotable_init(&iodesc, 1);
42
43 return 1;
44}
45
46static void __init s5pv210_dt_map_io(void)
47{
48 debug_ll_io_init();
49
50 of_scan_flat_dt(s5pv210_fdt_map_sys, NULL);
51}
52
53static void s5pv210_dt_restart(enum reboot_mode mode, const char *cmd)
54{
55 __raw_writel(0x1, S5P_SWRESET);
56}
57
58static char const *s5pv210_dt_compat[] __initconst = {
59 "samsung,s5pc110",
60 "samsung,s5pv210",
61 NULL
62};
63
64DT_MACHINE_START(S5PV210_DT, "Samsung S5PC110/S5PV210-based board")
65 .dt_compat = s5pv210_dt_compat,
66 .map_io = s5pv210_dt_map_io,
67 .restart = s5pv210_dt_restart,
68MACHINE_END