blob: 5bf9afae752d655d224346ec6eb86715a2232a9a [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 <asm/mach/arch.h>
12#include <asm/mach/map.h>
13#include <asm/system_misc.h>
14
15#include <plat/cpu.h>
Tomasz Figa31e40012013-08-26 02:37:51 +090016#include <mach/map.h>
17
18#include "common.h"
Kukjin Kim96bc0242015-07-30 02:00:52 +090019#include "watchdog-reset.h"
Tomasz Figa31e40012013-08-26 02:37:51 +090020
21/*
22 * IO mapping for shared system controller IP.
23 *
24 * FIXME: Make remaining drivers use dynamic mapping.
25 */
26static struct map_desc s3c64xx_dt_iodesc[] __initdata = {
27 {
28 .virtual = (unsigned long)S3C_VA_SYS,
29 .pfn = __phys_to_pfn(S3C64XX_PA_SYSCON),
30 .length = SZ_4K,
31 .type = MT_DEVICE,
32 },
33};
34
35static void __init s3c64xx_dt_map_io(void)
36{
37 debug_ll_io_init();
38 iotable_init(s3c64xx_dt_iodesc, ARRAY_SIZE(s3c64xx_dt_iodesc));
39
40 s3c64xx_init_cpu();
41
42 if (!soc_is_s3c64xx())
43 panic("SoC is not S3C64xx!");
44}
45
Tomasz Figa31e40012013-08-26 02:37:51 +090046static void __init s3c64xx_dt_init_machine(void)
47{
Tomasz Figacb120572013-12-13 20:59:39 +010048 samsung_wdt_reset_of_init();
Tomasz Figa31e40012013-08-26 02:37:51 +090049}
50
51static void s3c64xx_dt_restart(enum reboot_mode mode, const char *cmd)
52{
53 if (mode != REBOOT_SOFT)
54 samsung_wdt_reset();
55
56 /* if all else fails, or mode was for soft, jump to 0 */
57 soft_restart(0);
58}
59
Nicolas Pitre19c233b2015-07-27 18:27:52 -040060static const char *const s3c64xx_dt_compat[] __initconst = {
Tomasz Figa31e40012013-08-26 02:37:51 +090061 "samsung,s3c6400",
62 "samsung,s3c6410",
63 NULL
64};
65
66DT_MACHINE_START(S3C6400_DT, "Samsung S3C64xx (Flattened Device Tree)")
67 /* Maintainer: Tomasz Figa <tomasz.figa@gmail.com> */
68 .dt_compat = s3c64xx_dt_compat,
69 .map_io = s3c64xx_dt_map_io,
Tomasz Figa31e40012013-08-26 02:37:51 +090070 .init_machine = s3c64xx_dt_init_machine,
71 .restart = s3c64xx_dt_restart,
72MACHINE_END