From ed6991116c749dc53b7539e8f49af38bce918c3e Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Fri, 20 Dec 2013 19:39:16 +0900 Subject: [PATCH] ARM: exynos3: Add Exynos3's machine_desc structure to support Device Tree This patch add Exynos4's machine desc structure to support Device Tree. The dt driver of Exynos3 SoC include dt compatible string of Exynos3250. Signed-off-by: Chanwoo Choi --- arch/arm/mach-exynos/Kconfig | 14 ++++++++++ arch/arm/mach-exynos/Makefile | 1 + arch/arm/mach-exynos/common.c | 7 +++++ arch/arm/mach-exynos/common.h | 1 + arch/arm/mach-exynos/mach-exynos3-dt.c | 48 ++++++++++++++++++++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 arch/arm/mach-exynos/mach-exynos3-dt.c diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 5ef3352..537153b 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig @@ -433,6 +433,20 @@ endif comment "Flattened Device Tree based board for EXYNOS SoCs" +config MACH_EXYNOS3_DT + bool "Samsung Exynos3 Machine using device tree" + depends on ARCH_EXYNOS3 + select ARM_AMBA + select CLKSRC_OF + select SOC_EXYNOS3250 + select USE_OF + select TIZEN_WIP + help + Machine support for Samsung Exynos3 machine with device tree enabled. + Select this if a fdt blob is available for the Exynos3 SoC based board. + Note: This is under development and not all peripherals can be supported + with this machine file. + config MACH_EXYNOS4_DT bool "Samsung Exynos4 Machine using device tree" depends on ARCH_EXYNOS4 diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index 9f6844c..636e541 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile @@ -43,6 +43,7 @@ obj-$(CONFIG_MACH_ORIGEN) += mach-origen.o obj-$(CONFIG_MACH_SMDK4212) += mach-smdk4x12.o obj-$(CONFIG_MACH_SMDK4412) += mach-smdk4x12.o +obj-$(CONFIG_MACH_EXYNOS3_DT) += mach-exynos3-dt.o obj-$(CONFIG_MACH_EXYNOS4_DT) += mach-exynos4-dt.o obj-$(CONFIG_MACH_EXYNOS5_DT) += mach-exynos5-dt.o diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 20b98e0..a68da00 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -601,6 +601,13 @@ static unsigned int max_combiner_nr(void) return EXYNOS4210_MAX_COMBINER_NR; } +void __init exynos3_init_irq(void) +{ +#ifdef CONFIG_OF + irqchip_init(); +#endif + gic_arch_extn.irq_set_wake = s3c_irq_wake; +} void __init exynos4_init_irq(void) { diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index eeed0c5..ebe1158d 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -20,6 +20,7 @@ extern unsigned long xxti_f, xusbxti_f; struct map_desc; void exynos_init_io(struct map_desc *mach_desc, int size); +void exynos3_init_irq(void); void exynos4_init_irq(void); void exynos5_init_irq(void); void exynos4_restart(char mode, const char *cmd); diff --git a/arch/arm/mach-exynos/mach-exynos3-dt.c b/arch/arm/mach-exynos/mach-exynos3-dt.c new file mode 100644 index 0000000..c329031 --- /dev/null +++ b/arch/arm/mach-exynos/mach-exynos3-dt.c @@ -0,0 +1,48 @@ +/* + * Samsung's EXYNOS3 flattened device tree enabled machine + * + * Copyright (c) 2013 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * Copyright (c) 2010-2011 Linaro Ltd. + * www.linaro.org + * + * 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 +#include +#include +#include + +#include + +#include "common.h" + +static void __init exynos3_dt_map_io(void) +{ + exynos_init_io(NULL, 0); +} + +static void __init exynos3_dt_machine_init(void) +{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + +static char const *exynos3_dt_compat[] __initdata = { + "samsung,exynos3250", + NULL +}; + +DT_MACHINE_START(EXYNOS3250_DT, "Samsung Exynos3 (Flattened Device Tree)") + .smp = smp_ops(exynos_smp_ops), + .init_irq = exynos3_init_irq, + .map_io = exynos3_dt_map_io, + .init_early = exynos_firmware_init, + .init_machine = exynos3_dt_machine_init, + .init_late = exynos_init_late, + .init_time = exynos_init_time, + .dt_compat = exynos3_dt_compat, + .restart = exynos4_restart, +MACHINE_END -- 2.7.4