blob: 0099c6c13bbaa9504dccd6fa760c21273de41d3f [file] [log] [blame]
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +05301/*
Tomasz Figa3579a5822012-09-21 10:13:29 +09002 * Samsung's EXYNOS4 flattened device tree enabled machine
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +05303 *
4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com
6 * Copyright (c) 2010-2011 Linaro Ltd.
7 * www.linaro.org
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
Thomas Abrahamee6c71372013-03-09 17:10:23 +090014#include <linux/kernel.h>
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053015#include <linux/of_platform.h>
Sachin Kamat20901f72013-02-08 13:58:17 -080016#include <linux/of_fdt.h>
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053017#include <linux/serial_core.h>
Sachin Kamat20901f72013-02-08 13:58:17 -080018#include <linux/memblock.h>
Thomas Abraham9fbf0c82013-03-09 16:10:03 +090019#include <linux/clocksource.h>
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053020
21#include <asm/mach/arch.h>
Sachin Kamat20901f72013-02-08 13:58:17 -080022#include <plat/mfc.h>
Karol Lewandowski35bded82012-02-08 11:42:39 +090023
24#include "common.h"
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053025
Tomasz Figa3579a5822012-09-21 10:13:29 +090026static void __init exynos4_dt_machine_init(void)
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053027{
Thomas Abrahamee6c71372013-03-09 17:10:23 +090028 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053029}
30
Tomasz Figa3579a5822012-09-21 10:13:29 +090031static char const *exynos4_dt_compat[] __initdata = {
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053032 "samsung,exynos4210",
Tomasz Figa0f7238a2012-11-06 15:09:04 +090033 "samsung,exynos4212",
34 "samsung,exynos4412",
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053035 NULL
36};
37
Sachin Kamat20901f72013-02-08 13:58:17 -080038static void __init exynos4_reserve(void)
39{
40#ifdef CONFIG_S5P_DEV_MFC
41 struct s5p_mfc_dt_meminfo mfc_mem;
42
43 /* Reserve memory for MFC only if it's available */
44 mfc_mem.compatible = "samsung,mfc-v5";
45 if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
46 s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
47 mfc_mem.lsize);
48#endif
49}
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053050DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
51 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
Tomasz Figa61ef3c02012-10-22 08:16:44 +090052 .smp = smp_ops(exynos_smp_ops),
Arnd Bergmann0e2238e2013-06-19 01:36:47 +090053 .map_io = exynos_init_io,
Tomasz Figabca28f82012-12-11 13:58:43 +090054 .init_early = exynos_firmware_init,
Tomasz Figa3579a5822012-09-21 10:13:29 +090055 .init_machine = exynos4_dt_machine_init,
Shawn Guobb13fab2012-04-26 10:35:40 +080056 .init_late = exynos_init_late,
Thomas Abraham6923ae42013-03-09 17:03:29 +090057 .init_time = exynos_init_time,
Tomasz Figa3579a5822012-09-21 10:13:29 +090058 .dt_compat = exynos4_dt_compat,
Karol Lewandowski35bded82012-02-08 11:42:39 +090059 .restart = exynos4_restart,
Sachin Kamat20901f72013-02-08 13:58:17 -080060 .reserve = exynos4_reserve,
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053061MACHINE_END