blob: 2fddf38192df3ad0f67bc646914e7d4121a6b41c [file] [log] [blame]
Tomasz Figa31e40012013-08-26 02:37:51 +09001/*
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
Tomasz Figa31e40012013-08-26 02:37:51 +090011#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>
18#include <plat/watchdog-reset.h>
19
20#include <mach/map.h>
21
22#include "common.h"
23
24/*
25 * IO mapping for shared system controller IP.
26 *
27 * FIXME: Make remaining drivers use dynamic mapping.
28 */
29static struct map_desc s3c64xx_dt_iodesc[] __initdata = {
30 {
31 .virtual = (unsigned long)S3C_VA_SYS,
32 .pfn = __phys_to_pfn(S3C64XX_PA_SYSCON),
33 .length = SZ_4K,
34 .type = MT_DEVICE,
35 },
36};
37
38static void __init s3c64xx_dt_map_io(void)
39{
40 debug_ll_io_init();
41 iotable_init(s3c64xx_dt_iodesc, ARRAY_SIZE(s3c64xx_dt_iodesc));
42
43 s3c64xx_init_cpu();
44
45 if (!soc_is_s3c64xx())
46 panic("SoC is not S3C64xx!");
47}
48
Tomasz Figa31e40012013-08-26 02:37:51 +090049static void __init s3c64xx_dt_init_machine(void)
50{
Tomasz Figacb120572013-12-13 20:59:39 +010051 samsung_wdt_reset_of_init();
Tomasz Figa31e40012013-08-26 02:37:51 +090052 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
53}
54
55static void s3c64xx_dt_restart(enum reboot_mode mode, const char *cmd)
56{
57 if (mode != REBOOT_SOFT)
58 samsung_wdt_reset();
59
60 /* if all else fails, or mode was for soft, jump to 0 */
61 soft_restart(0);
62}
63
64static char const *s3c64xx_dt_compat[] __initdata = {
65 "samsung,s3c6400",
66 "samsung,s3c6410",
67 NULL
68};
69
70DT_MACHINE_START(S3C6400_DT, "Samsung S3C64xx (Flattened Device Tree)")
71 /* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
72 .dt_compat = s3c64xx_dt_compat,
73 .map_io = s3c64xx_dt_map_io,
Tomasz Figa31e40012013-08-26 02:37:51 +090074 .init_machine = s3c64xx_dt_init_machine,
75 .restart = s3c64xx_dt_restart,
76MACHINE_END