blob: b7f1154088bdeba2d144d0a7299ba9dc5324a1a3 [file] [log] [blame]
Kukjin Kimb3e68fb2012-02-10 13:13:15 +09001/*
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>
13#include <linux/serial_core.h>
Arun Kumar K2eae6132012-10-23 22:51:33 +090014#include <linux/memblock.h>
15#include <linux/of_fdt.h>
Kukjin Kimb3e68fb2012-02-10 13:13:15 +090016
17#include <asm/mach/arch.h>
18#include <asm/hardware/gic.h>
19#include <mach/map.h>
20
21#include <plat/cpu.h>
22#include <plat/regs-serial.h>
Arun Kumar K2eae6132012-10-23 22:51:33 +090023#include <plat/mfc.h>
Kukjin Kimb3e68fb2012-02-10 13:13:15 +090024
25#include "common.h"
26
27/*
28 * The following lookup table is used to override device names when devices
29 * are registered from device tree. This is temporarily added to enable
30 * device tree support addition for the EXYNOS5 architecture.
31 *
32 * For drivers that require platform data to be provided from the machine
33 * file, a platform data pointer can also be supplied along with the
34 * devices names. Usually, the platform data elements that cannot be parsed
35 * from the device tree by the drivers (example: function pointers) are
36 * supplied. But it should be noted that this is a temporary mechanism and
37 * at some point, the drivers should be capable of parsing all the platform
38 * data from the device tree.
39 */
40static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
41 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS5_PA_UART0,
42 "exynos4210-uart.0", NULL),
43 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS5_PA_UART1,
44 "exynos4210-uart.1", NULL),
45 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS5_PA_UART2,
46 "exynos4210-uart.2", NULL),
47 OF_DEV_AUXDATA("samsung,exynos4210-uart", EXYNOS5_PA_UART3,
48 "exynos4210-uart.3", NULL),
Thomas Abraham380c3a52012-05-15 15:56:57 +090049 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(0),
50 "s3c2440-i2c.0", NULL),
51 OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS5_PA_IIC(1),
52 "s3c2440-i2c.1", NULL),
Thomas Abrahama5c17772012-09-26 08:54:42 +090053 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI0,
54 "dw_mmc.0", NULL),
55 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI1,
56 "dw_mmc.1", NULL),
57 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI2,
58 "dw_mmc.2", NULL),
59 OF_DEV_AUXDATA("samsung,exynos5250-dw-mshc", EXYNOS5_PA_DWMCI3,
60 "dw_mmc.3", NULL),
Thomas Abrahamb0b27812012-07-14 10:54:31 +090061 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI0,
62 "exynos4210-spi.0", NULL),
63 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI1,
64 "exynos4210-spi.1", NULL),
65 OF_DEV_AUXDATA("samsung,exynos4210-spi", EXYNOS5_PA_SPI2,
66 "exynos4210-spi.2", NULL),
Kukjin Kimb3e68fb2012-02-10 13:13:15 +090067 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA0, "dma-pl330.0", NULL),
68 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_PDMA1, "dma-pl330.1", NULL),
Thomas Abraham60806222012-04-10 08:37:59 -070069 OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL),
Shaik Ameer Basha11286582012-09-07 14:13:08 +090070 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC0,
71 "exynos-gsc.0", NULL),
72 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC1,
73 "exynos-gsc.1", NULL),
74 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC2,
75 "exynos-gsc.2", NULL),
76 OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3,
77 "exynos-gsc.3", NULL),
Arun Kumar K2eae6132012-10-23 22:51:33 +090078 OF_DEV_AUXDATA("samsung,mfc-v6", 0x11000000, "s5p-mfc-v6", NULL),
Kukjin Kimb3e68fb2012-02-10 13:13:15 +090079 {},
80};
81
82static void __init exynos5250_dt_map_io(void)
83{
84 exynos_init_io(NULL, 0);
85 s3c24xx_init_clocks(24000000);
86}
87
88static void __init exynos5250_dt_machine_init(void)
89{
90 of_platform_populate(NULL, of_default_bus_match_table,
91 exynos5250_auxdata_lookup, NULL);
92}
93
94static char const *exynos5250_dt_compat[] __initdata = {
95 "samsung,exynos5250",
96 NULL
97};
98
Arun Kumar K2eae6132012-10-23 22:51:33 +090099static void __init exynos5_reserve(void)
100{
101 struct s5p_mfc_dt_meminfo mfc_mem;
102
103 /* Reserve memory for MFC only if it's available */
104 mfc_mem.compatible = "samsung,mfc-v6";
105 if (of_scan_flat_dt(s5p_fdt_find_mfc_mem, &mfc_mem))
106 s5p_mfc_reserve_mem(mfc_mem.roff, mfc_mem.rsize, mfc_mem.loff,
107 mfc_mem.lsize);
108}
109
Kukjin Kimb3e68fb2012-02-10 13:13:15 +0900110DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
111 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
112 .init_irq = exynos5_init_irq,
Marc Zyngier06853ae2011-09-08 13:15:22 +0100113 .smp = smp_ops(exynos_smp_ops),
Kukjin Kimb3e68fb2012-02-10 13:13:15 +0900114 .map_io = exynos5250_dt_map_io,
115 .handle_irq = gic_handle_irq,
116 .init_machine = exynos5250_dt_machine_init,
Shawn Guobb13fab2012-04-26 10:35:40 +0800117 .init_late = exynos_init_late,
Kukjin Kimb3e68fb2012-02-10 13:13:15 +0900118 .timer = &exynos4_timer,
119 .dt_compat = exynos5250_dt_compat,
120 .restart = exynos5_restart,
Arun Kumar K2eae6132012-10-23 22:51:33 +0900121 .reserve = exynos5_reserve,
Kukjin Kimb3e68fb2012-02-10 13:13:15 +0900122MACHINE_END