Merge branch 'for-linus-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
[linux-2.6-block.git] / arch / arm / mach-s3c64xx / mach-s3c64xx-dt.c
CommitLineData
31e4001d
TF
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
31e4001d
TF
11#include <linux/of_platform.h>
12
13#include <asm/mach/arch.h>
14#include <asm/mach/map.h>
15#include <asm/system_misc.h>
16
17#include <plat/cpu.h>
31e4001d
TF
18#include <mach/map.h>
19
20#include "common.h"
96bc024c 21#include "watchdog-reset.h"
31e4001d
TF
22
23/*
24 * IO mapping for shared system controller IP.
25 *
26 * FIXME: Make remaining drivers use dynamic mapping.
27 */
28static struct map_desc s3c64xx_dt_iodesc[] __initdata = {
29 {
30 .virtual = (unsigned long)S3C_VA_SYS,
31 .pfn = __phys_to_pfn(S3C64XX_PA_SYSCON),
32 .length = SZ_4K,
33 .type = MT_DEVICE,
34 },
35};
36
37static void __init s3c64xx_dt_map_io(void)
38{
39 debug_ll_io_init();
40 iotable_init(s3c64xx_dt_iodesc, ARRAY_SIZE(s3c64xx_dt_iodesc));
41
42 s3c64xx_init_cpu();
43
44 if (!soc_is_s3c64xx())
45 panic("SoC is not S3C64xx!");
46}
47
31e4001d
TF
48static void __init s3c64xx_dt_init_machine(void)
49{
cb120572 50 samsung_wdt_reset_of_init();
31e4001d
TF
51 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
52}
53
54static void s3c64xx_dt_restart(enum reboot_mode mode, const char *cmd)
55{
56 if (mode != REBOOT_SOFT)
57 samsung_wdt_reset();
58
59 /* if all else fails, or mode was for soft, jump to 0 */
60 soft_restart(0);
61}
62
19c233b7 63static const char *const s3c64xx_dt_compat[] __initconst = {
31e4001d
TF
64 "samsung,s3c6400",
65 "samsung,s3c6410",
66 NULL
67};
68
69DT_MACHINE_START(S3C6400_DT, "Samsung S3C64xx (Flattened Device Tree)")
70 /* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
71 .dt_compat = s3c64xx_dt_compat,
72 .map_io = s3c64xx_dt_map_io,
31e4001d
TF
73 .init_machine = s3c64xx_dt_init_machine,
74 .restart = s3c64xx_dt_restart,
75MACHINE_END