blob: 70f0900d4bcac263d04085933b996be9b3ec75e9 [file] [log] [blame]
Heiko Stuebner35aca362013-05-21 01:06:04 +09001/*
2 * Samsung's S3C2416 flattened device tree enabled machine
3 *
4 * Copyright (c) 2012 Heiko Stuebner <heiko@sntech.de>
5 *
6 * based on mach-exynos/mach-exynos4-dt.c
7 *
8 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
9 * http://www.samsung.com
10 * Copyright (c) 2010-2011 Linaro Ltd.
11 * www.linaro.org
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16*/
17
18#include <linux/clocksource.h>
19#include <linux/irqchip.h>
20#include <linux/of_platform.h>
21#include <linux/serial_core.h>
Tushar Behera334a1c72014-02-14 10:32:45 +090022#include <linux/serial_s3c.h>
Heiko Stuebner35aca362013-05-21 01:06:04 +090023
24#include <asm/mach/arch.h>
25#include <mach/map.h>
26
27#include <plat/cpu.h>
28#include <plat/pm.h>
Heiko Stuebner35aca362013-05-21 01:06:04 +090029
30#include "common.h"
31
32/*
33 * The following lookup table is used to override device names when devices
34 * are registered from device tree. This is temporarily added to enable
35 * device tree support addition for the S3C2416 architecture.
36 *
37 * For drivers that require platform data to be provided from the machine
38 * file, a platform data pointer can also be supplied along with the
39 * devices names. Usually, the platform data elements that cannot be parsed
40 * from the device tree by the drivers (example: function pointers) are
41 * supplied. But it should be noted that this is a temporary mechanism and
42 * at some point, the drivers should be capable of parsing all the platform
43 * data from the device tree.
44 */
45static const struct of_dev_auxdata s3c2416_auxdata_lookup[] __initconst = {
Heiko Stuebner52c76e42013-06-19 02:40:18 +090046 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C24XX_PA_UART,
Heiko Stuebner35aca362013-05-21 01:06:04 +090047 "s3c2440-uart.0", NULL),
Heiko Stuebner52c76e42013-06-19 02:40:18 +090048 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C24XX_PA_UART + 0x4000,
Heiko Stuebner35aca362013-05-21 01:06:04 +090049 "s3c2440-uart.1", NULL),
Heiko Stuebner52c76e42013-06-19 02:40:18 +090050 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C24XX_PA_UART + 0x8000,
Heiko Stuebner35aca362013-05-21 01:06:04 +090051 "s3c2440-uart.2", NULL),
Heiko Stuebner52c76e42013-06-19 02:40:18 +090052 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C24XX_PA_UART + 0xC000,
Heiko Stuebner35aca362013-05-21 01:06:04 +090053 "s3c2440-uart.3", NULL),
54 OF_DEV_AUXDATA("samsung,s3c6410-sdhci", S3C_PA_HSMMC0,
55 "s3c-sdhci.0", NULL),
56 OF_DEV_AUXDATA("samsung,s3c6410-sdhci", S3C_PA_HSMMC1,
57 "s3c-sdhci.1", NULL),
58 OF_DEV_AUXDATA("samsung,s3c2440-i2c", S3C_PA_IIC,
59 "s3c2440-i2c.0", NULL),
60 {},
61};
62
63static void __init s3c2416_dt_map_io(void)
64{
65 s3c24xx_init_io(NULL, 0);
66 s3c24xx_init_clocks(12000000);
67}
68
69static void __init s3c2416_dt_machine_init(void)
70{
71 of_platform_populate(NULL, of_default_bus_match_table,
72 s3c2416_auxdata_lookup, NULL);
73
74 s3c_pm_init();
75}
76
77static char const *s3c2416_dt_compat[] __initdata = {
78 "samsung,s3c2416",
79 "samsung,s3c2450",
80 NULL
81};
82
83DT_MACHINE_START(S3C2416_DT, "Samsung S3C2416 (Flattened Device Tree)")
84 /* Maintainer: Heiko Stuebner <heiko@sntech.de> */
85 .dt_compat = s3c2416_dt_compat,
86 .map_io = s3c2416_dt_map_io,
87 .init_irq = irqchip_init,
88 .init_machine = s3c2416_dt_machine_init,
89 .init_time = clocksource_of_init,
90 .restart = s3c2416_restart,
91MACHINE_END