Commit | Line | Data |
---|---|---|
b3e68fb1 KK |
1 | /* |
2 | * SAMSUNG EXYNOS5250 Flattened Device Tree enabled machine | |
3 | * | |
4 | * Copyright (c) 2012 Samsung Electronics Co., Ltd. | |
5 | * http://www.samsung.com | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License version 2 as | |
9 | * published by the Free Software Foundation. | |
10 | */ | |
11 | ||
12 | #include <linux/of_platform.h> | |
5b7897db | 13 | #include <linux/of_fdt.h> |
2eae613b | 14 | #include <linux/memblock.h> |
7000fe8c | 15 | #include <linux/io.h> |
9fbf0c85 | 16 | #include <linux/clocksource.h> |
b3e68fb1 KK |
17 | |
18 | #include <asm/mach/arch.h> | |
7000fe8c | 19 | #include <mach/regs-pmu.h> |
b3e68fb1 KK |
20 | |
21 | #include <plat/cpu.h> | |
2eae613b | 22 | #include <plat/mfc.h> |
b3e68fb1 KK |
23 | |
24 | #include "common.h" | |
25 | ||
2edb36c4 | 26 | static void __init exynos5_dt_machine_init(void) |
b3e68fb1 | 27 | { |
7000fe8c AK |
28 | struct device_node *i2c_np; |
29 | const char *i2c_compat = "samsung,s3c2440-i2c"; | |
30 | unsigned int tmp; | |
31 | ||
32 | /* | |
33 | * Exynos5's legacy i2c controller and new high speed i2c | |
34 | * controller have muxed interrupt sources. By default the | |
35 | * interrupts for 4-channel HS-I2C controller are enabled. | |
36 | * If node for first four channels of legacy i2c controller | |
37 | * are available then re-configure the interrupts via the | |
38 | * system register. | |
39 | */ | |
40 | for_each_compatible_node(i2c_np, NULL, i2c_compat) { | |
41 | if (of_device_is_available(i2c_np)) { | |
42 | if (of_alias_get_id(i2c_np, "i2c") < 4) { | |
43 | tmp = readl(EXYNOS5_SYS_I2C_CFG); | |
44 | writel(tmp & ~(0x1 << of_alias_get_id(i2c_np, "i2c")), | |
45 | EXYNOS5_SYS_I2C_CFG); | |
46 | } | |
47 | } | |
48 | } | |
49 | ||
35baa336 BZ |
50 | exynos_cpuidle_init(); |
51 | ||
ee6c7137 | 52 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
b3e68fb1 KK |
53 | } |
54 | ||
2edb36c4 | 55 | static char const *exynos5_dt_compat[] __initdata = { |
b3e68fb1 | 56 | "samsung,exynos5250", |
191d754f | 57 | "samsung,exynos5420", |
2edb36c4 | 58 | "samsung,exynos5440", |
b3e68fb1 KK |
59 | NULL |
60 | }; | |
61 | ||
2eae613b AK |
62 | static void __init exynos5_reserve(void) |
63 | { | |
ade7ffbb | 64 | #ifdef CONFIG_S5P_DEV_MFC |
2eae613b AK |
65 | struct s5p_mfc_dt_meminfo mfc_mem; |
66 | ||
67 | /* Reserve memory for MFC only if it's available */ | |
68 | mfc_mem.compatible = "samsung,mfc-v6"; | |
69 | if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem)) | |
70 | s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff, | |
71 | mfc_mem.lsize); | |
ade7ffbb | 72 | #endif |
2eae613b AK |
73 | } |
74 | ||
b3e68fb1 KK |
75 | DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)") |
76 | /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */ | |
06853ae4 | 77 | .smp = smp_ops(exynos_smp_ops), |
0e2238ec | 78 | .map_io = exynos_init_io, |
2edb36c4 | 79 | .init_machine = exynos5_dt_machine_init, |
bb13fabc | 80 | .init_late = exynos_init_late, |
6923ae4b | 81 | .init_time = exynos_init_time, |
2edb36c4 | 82 | .dt_compat = exynos5_dt_compat, |
b3e68fb1 | 83 | .restart = exynos5_restart, |
2eae613b | 84 | .reserve = exynos5_reserve, |
b3e68fb1 | 85 | MACHINE_END |