diff options
author | Tomasz Figa <tomasz.figa@gmail.com> | 2013-08-25 13:37:51 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-09-16 17:48:27 -0400 |
commit | 31e4001d2e3c3f2d3b544c9891d542ee3502798e (patch) | |
tree | ffda7e22ed5957d4a13b6f54577907af6e7e4d2a /arch/arm/mach-s3c64xx | |
parent | 608f9737f1bbe44428ecec44604f638b3949e12c (diff) |
ARM: S3C64XX: Add board file for boot using Device Tree
This patch adds board file that will be used to boot S3C64xx-based boards
using Device Tree.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c64xx')
-rw-r--r-- | arch/arm/mach-s3c64xx/Kconfig | 16 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | 85 |
3 files changed, 102 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 041da5172423..bd14e3a37128 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig | |||
@@ -306,3 +306,19 @@ config MACH_WLF_CRAGG_6410 | |||
306 | select SAMSUNG_GPIO_EXTRA128 | 306 | select SAMSUNG_GPIO_EXTRA128 |
307 | help | 307 | help |
308 | Machine support for the Wolfson Cragganmore S3C6410 variant. | 308 | Machine support for the Wolfson Cragganmore S3C6410 variant. |
309 | |||
310 | config MACH_S3C64XX_DT | ||
311 | bool "Samsung S3C6400/S3C6410 machine using Device Tree" | ||
312 | select CLKSRC_OF | ||
313 | select CPU_S3C6400 | ||
314 | select CPU_S3C6410 | ||
315 | select PINCTRL | ||
316 | select PINCTRL_S3C64XX | ||
317 | select USE_OF | ||
318 | help | ||
319 | Machine support for Samsung S3C6400/S3C6410 machines with Device Tree | ||
320 | enabled. | ||
321 | Select this if a fdt blob is available for your S3C64XX SoC based | ||
322 | board. | ||
323 | Note: This is under development and not all peripherals can be | ||
324 | supported with this machine file. | ||
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index 645a8fe55f8d..6faedcffce04 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile | |||
@@ -57,3 +57,4 @@ obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o | |||
57 | obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o | 57 | obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o |
58 | obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o | 58 | obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o |
59 | obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o | 59 | obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o |
60 | obj-$(CONFIG_MACH_S3C64XX_DT) += mach-s3c64xx-dt.o | ||
diff --git a/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c new file mode 100644 index 000000000000..7eb9a10fc1af --- /dev/null +++ b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | |||
@@ -0,0 +1,85 @@ | |||
1 | /* | ||
2 | * Samsung's S3C64XX flattened device tree enabled machine | ||
3 | * | ||
4 | * Copyright (c) 2013 Tomasz Figa <tomasz.figa@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/clk-provider.h> | ||
12 | #include <linux/irqchip.h> | ||
13 | #include <linux/of_platform.h> | ||
14 | |||
15 | #include <asm/mach/arch.h> | ||
16 | #include <asm/mach/map.h> | ||
17 | #include <asm/system_misc.h> | ||
18 | |||
19 | #include <plat/cpu.h> | ||
20 | #include <plat/watchdog-reset.h> | ||
21 | |||
22 | #include <mach/map.h> | ||
23 | |||
24 | #include "common.h" | ||
25 | |||
26 | /* | ||
27 | * IO mapping for shared system controller IP. | ||
28 | * | ||
29 | * FIXME: Make remaining drivers use dynamic mapping. | ||
30 | */ | ||
31 | static struct map_desc s3c64xx_dt_iodesc[] __initdata = { | ||
32 | { | ||
33 | .virtual = (unsigned long)S3C_VA_SYS, | ||
34 | .pfn = __phys_to_pfn(S3C64XX_PA_SYSCON), | ||
35 | .length = SZ_4K, | ||
36 | .type = MT_DEVICE, | ||
37 | }, | ||
38 | }; | ||
39 | |||
40 | static void __init s3c64xx_dt_map_io(void) | ||
41 | { | ||
42 | debug_ll_io_init(); | ||
43 | iotable_init(s3c64xx_dt_iodesc, ARRAY_SIZE(s3c64xx_dt_iodesc)); | ||
44 | |||
45 | s3c64xx_init_cpu(); | ||
46 | |||
47 | if (!soc_is_s3c64xx()) | ||
48 | panic("SoC is not S3C64xx!"); | ||
49 | } | ||
50 | |||
51 | static void __init s3c64xx_dt_init_irq(void) | ||
52 | { | ||
53 | of_clk_init(NULL); | ||
54 | samsung_wdt_reset_of_init(); | ||
55 | irqchip_init(); | ||
56 | }; | ||
57 | |||
58 | static void __init s3c64xx_dt_init_machine(void) | ||
59 | { | ||
60 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
61 | } | ||
62 | |||
63 | static void s3c64xx_dt_restart(enum reboot_mode mode, const char *cmd) | ||
64 | { | ||
65 | if (mode != REBOOT_SOFT) | ||
66 | samsung_wdt_reset(); | ||
67 | |||
68 | /* if all else fails, or mode was for soft, jump to 0 */ | ||
69 | soft_restart(0); | ||
70 | } | ||
71 | |||
72 | static char const *s3c64xx_dt_compat[] __initdata = { | ||
73 | "samsung,s3c6400", | ||
74 | "samsung,s3c6410", | ||
75 | NULL | ||
76 | }; | ||
77 | |||
78 | DT_MACHINE_START(S3C6400_DT, "Samsung S3C64xx (Flattened Device Tree)") | ||
79 | /* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */ | ||
80 | .dt_compat = s3c64xx_dt_compat, | ||
81 | .map_io = s3c64xx_dt_map_io, | ||
82 | .init_irq = s3c64xx_dt_init_irq, | ||
83 | .init_machine = s3c64xx_dt_init_machine, | ||
84 | .restart = s3c64xx_dt_restart, | ||
85 | MACHINE_END | ||