2012-02-10 12:13:15 +08:00
|
|
|
/*
|
|
|
|
* SAMSUNG EXYNOS5250 Flattened Device Tree enabled machine
|
|
|
|
*
|
|
|
|
* Copyright (c) 2012 Samsung Electronics Co., Ltd.
|
|
|
|
* http://www.samsung.com
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/of_platform.h>
|
2012-11-28 03:53:14 +08:00
|
|
|
#include <linux/of_fdt.h>
|
2012-10-23 21:51:33 +08:00
|
|
|
#include <linux/memblock.h>
|
2012-11-20 17:20:38 +08:00
|
|
|
#include <linux/io.h>
|
2013-03-09 15:10:03 +08:00
|
|
|
#include <linux/clocksource.h>
|
2012-02-10 12:13:15 +08:00
|
|
|
|
|
|
|
#include <asm/mach/arch.h>
|
2012-11-20 17:20:38 +08:00
|
|
|
#include <mach/regs-pmu.h>
|
2012-02-10 12:13:15 +08:00
|
|
|
|
|
|
|
#include <plat/cpu.h>
|
2012-10-23 21:51:33 +08:00
|
|
|
#include <plat/mfc.h>
|
2012-02-10 12:13:15 +08:00
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
2012-11-15 14:48:56 +08:00
|
|
|
static void __init exynos5_dt_machine_init(void)
|
2012-02-10 12:13:15 +08:00
|
|
|
{
|
2012-11-20 17:20:38 +08:00
|
|
|
struct device_node *i2c_np;
|
|
|
|
const char *i2c_compat = "samsung,s3c2440-i2c";
|
|
|
|
unsigned int tmp;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Exynos5's legacy i2c controller and new high speed i2c
|
|
|
|
* controller have muxed interrupt sources. By default the
|
|
|
|
* interrupts for 4-channel HS-I2C controller are enabled.
|
|
|
|
* If node for first four channels of legacy i2c controller
|
|
|
|
* are available then re-configure the interrupts via the
|
|
|
|
* system register.
|
|
|
|
*/
|
|
|
|
for_each_compatible_node(i2c_np, NULL, i2c_compat) {
|
|
|
|
if (of_device_is_available(i2c_np)) {
|
|
|
|
if (of_alias_get_id(i2c_np, "i2c") < 4) {
|
|
|
|
tmp = readl(EXYNOS5_SYS_I2C_CFG);
|
|
|
|
writel(tmp & ~(0x1 << of_alias_get_id(i2c_np, "i2c")),
|
|
|
|
EXYNOS5_SYS_I2C_CFG);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-09 16:10:23 +08:00
|
|
|
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
|
2012-02-10 12:13:15 +08:00
|
|
|
}
|
|
|
|
|
2012-11-15 14:48:56 +08:00
|
|
|
static char const *exynos5_dt_compat[] __initdata = {
|
2012-02-10 12:13:15 +08:00
|
|
|
"samsung,exynos5250",
|
2013-06-18 23:29:34 +08:00
|
|
|
"samsung,exynos5420",
|
2012-11-15 14:48:56 +08:00
|
|
|
"samsung,exynos5440",
|
2012-02-10 12:13:15 +08:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2012-10-23 21:51:33 +08:00
|
|
|
static void __init exynos5_reserve(void)
|
|
|
|
{
|
2012-12-06 16:02:44 +08:00
|
|
|
#ifdef CONFIG_S5P_DEV_MFC
|
2012-10-23 21:51:33 +08:00
|
|
|
struct s5p_mfc_dt_meminfo mfc_mem;
|
|
|
|
|
|
|
|
/* Reserve memory for MFC only if it's available */
|
|
|
|
mfc_mem.compatible = "samsung,mfc-v6";
|
|
|
|
if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
|
|
|
|
s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
|
|
|
|
mfc_mem.lsize);
|
2012-12-06 16:02:44 +08:00
|
|
|
#endif
|
2012-10-23 21:51:33 +08:00
|
|
|
}
|
|
|
|
|
2012-02-10 12:13:15 +08:00
|
|
|
DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
|
|
|
|
/* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
|
2011-09-08 20:15:22 +08:00
|
|
|
.smp = smp_ops(exynos_smp_ops),
|
2013-06-19 00:36:47 +08:00
|
|
|
.map_io = exynos_init_io,
|
2012-11-15 14:48:56 +08:00
|
|
|
.init_machine = exynos5_dt_machine_init,
|
2012-04-26 10:35:40 +08:00
|
|
|
.init_late = exynos_init_late,
|
2013-03-09 16:03:29 +08:00
|
|
|
.init_time = exynos_init_time,
|
2012-11-15 14:48:56 +08:00
|
|
|
.dt_compat = exynos5_dt_compat,
|
2012-02-10 12:13:15 +08:00
|
|
|
.restart = exynos5_restart,
|
2012-10-23 21:51:33 +08:00
|
|
|
.reserve = exynos5_reserve,
|
2012-02-10 12:13:15 +08:00
|
|
|
MACHINE_END
|