2 * Samsung's S3C2416 flattened device tree enabled machine
4 * Copyright (c) 2012 Heiko Stuebner <heiko@sntech.de>
6 * based on mach-exynos/mach-exynos4-dt.c
8 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
9 * http://www.samsung.com
10 * Copyright (c) 2010-2011 Linaro Ltd.
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
18 #include <linux/clocksource.h>
19 #include <linux/irqchip.h>
20 #include <linux/of_platform.h>
21 #include <linux/serial_core.h>
23 #include <asm/mach/arch.h>
28 #include <plat/regs-serial.h>
33 * The following lookup table is used to override device names when devices
34 * are registered from device tree. This is temporarily added to enable
35 * device tree support addition for the S3C2416 architecture.
37 * For drivers that require platform data to be provided from the machine
38 * file, a platform data pointer can also be supplied along with the
39 * devices names. Usually, the platform data elements that cannot be parsed
40 * from the device tree by the drivers (example: function pointers) are
41 * supplied. But it should be noted that this is a temporary mechanism and
42 * at some point, the drivers should be capable of parsing all the platform
43 * data from the device tree.
45 static const struct of_dev_auxdata s3c2416_auxdata_lookup
[] __initconst
= {
46 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C24XX_PA_UART
,
47 "s3c2440-uart.0", NULL
),
48 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C24XX_PA_UART
+ 0x4000,
49 "s3c2440-uart.1", NULL
),
50 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C24XX_PA_UART
+ 0x8000,
51 "s3c2440-uart.2", NULL
),
52 OF_DEV_AUXDATA("samsung,s3c2440-uart", S3C24XX_PA_UART
+ 0xC000,
53 "s3c2440-uart.3", NULL
),
54 OF_DEV_AUXDATA("samsung,s3c6410-sdhci", S3C_PA_HSMMC0
,
56 OF_DEV_AUXDATA("samsung,s3c6410-sdhci", S3C_PA_HSMMC1
,
58 OF_DEV_AUXDATA("samsung,s3c2440-i2c", S3C_PA_IIC
,
59 "s3c2440-i2c.0", NULL
),
63 static void __init
s3c2416_dt_map_io(void)
65 s3c24xx_init_io(NULL
, 0);
66 s3c24xx_init_clocks(12000000);
69 static void __init
s3c2416_dt_machine_init(void)
71 of_platform_populate(NULL
, of_default_bus_match_table
,
72 s3c2416_auxdata_lookup
, NULL
);
77 static char const *s3c2416_dt_compat
[] __initdata
= {
83 DT_MACHINE_START(S3C2416_DT
, "Samsung S3C2416 (Flattened Device Tree)")
84 /* Maintainer: Heiko Stuebner <heiko@sntech.de> */
85 .dt_compat
= s3c2416_dt_compat
,
86 .map_io
= s3c2416_dt_map_io
,
87 .init_irq
= irqchip_init
,
88 .init_machine
= s3c2416_dt_machine_init
,
89 .init_time
= clocksource_of_init
,
90 .restart
= s3c2416_restart
,