blob: ac27f3cd121f7b98da9b4ca1caa0e746c8470fb3 [file] [log] [blame]
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +05301/*
Tomasz Figa3579a582012-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 Abrahamee6c7132013-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 Figa3579a582012-09-21 10:13:29 +090026static void __init exynos4_dt_map_io(void)
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053027{
Karol Lewandowski35bded82012-02-08 11:42:39 +090028 exynos_init_io(NULL, 0);
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053029}
30
Tomasz Figa3579a582012-09-21 10:13:29 +090031static void __init exynos4_dt_machine_init(void)
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053032{
Thomas Abrahamee6c7132013-03-09 17:10:23 +090033 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053034}
35
Tomasz Figa3579a582012-09-21 10:13:29 +090036static char const *exynos4_dt_compat[] __initdata = {
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053037 "samsung,exynos4210",
Tomasz Figa0f7238a2012-11-06 15:09:04 +090038 "samsung,exynos4212",
39 "samsung,exynos4412",
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053040 NULL
41};
42
Sachin Kamat20901f72013-02-08 13:58:17 -080043static void __init exynos4_reserve(void)
44{
45#ifdef CONFIG_S5P_DEV_MFC
46 struct s5p_mfc_dt_meminfo mfc_mem;
47
48 /* Reserve memory for MFC only if it's available */
49 mfc_mem.compatible = "samsung,mfc-v5";
50 if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
51 s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
52 mfc_mem.lsize);
53#endif
54}
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053055DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
56 /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */
Tomasz Figa61ef3c02012-10-22 08:16:44 +090057 .smp = smp_ops(exynos_smp_ops),
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053058 .init_irq = exynos4_init_irq,
Tomasz Figa3579a582012-09-21 10:13:29 +090059 .map_io = exynos4_dt_map_io,
Tomasz Figa3579a582012-09-21 10:13:29 +090060 .init_machine = exynos4_dt_machine_init,
Shawn Guobb13fab2012-04-26 10:35:40 +080061 .init_late = exynos_init_late,
Thomas Abraham6923ae42013-03-09 17:03:29 +090062 .init_time = exynos_init_time,
Tomasz Figa3579a582012-09-21 10:13:29 +090063 .dt_compat = exynos4_dt_compat,
Karol Lewandowski35bded82012-02-08 11:42:39 +090064 .restart = exynos4_restart,
Sachin Kamat20901f72013-02-08 13:58:17 -080065 .reserve = exynos4_reserve,
Thomas Abraham6b5ab4f2011-11-06 21:54:27 +053066MACHINE_END