From patchwork Tue Aug 2 23:08:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 1030242 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p72NACWa015901 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Aug 2011 23:10:33 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoO5q-00047s-SL; Tue, 02 Aug 2011 23:09:47 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QoO5q-0002SP-16; Tue, 02 Aug 2011 23:09:46 +0000 Received: from mail-wy0-f177.google.com ([74.125.82.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoO4z-0002G5-FT for linux-arm-kernel@lists.infradead.org; Tue, 02 Aug 2011 23:08:55 +0000 Received: by wyf23 with SMTP id 23so240134wyf.36 for ; Tue, 02 Aug 2011 16:08:51 -0700 (PDT) Received: by 10.227.2.136 with SMTP id 8mr998143wbj.63.1312326531478; Tue, 02 Aug 2011 16:08:51 -0700 (PDT) Received: from localhost.localdomain ([109.234.204.184]) by mx.google.com with ESMTPS id b13sm192251wbh.24.2011.08.02.16.08.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 02 Aug 2011 16:08:50 -0700 (PDT) From: Thomas Abraham To: devicetree-discuss@lists.ozlabs.org Subject: [PATCH 3/4] arm: exynos4: Add a new Exynos4 device tree enabled machine Date: Wed, 3 Aug 2011 00:08:28 +0100 Message-Id: <1312326509-2723-4-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1312326509-2723-1-git-send-email-thomas.abraham@linaro.org> References: <1312326509-2723-1-git-send-email-thomas.abraham@linaro.org> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110802_190853_766211_2C7B812E X-CRM114-Status: GOOD ( 25.21 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] Cc: kgene.kim@samsung.com, patches@linaro.org, grant.likely@secretlab.ca, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 02 Aug 2011 23:10:33 +0000 (UTC) Add a new basic Exynos4 machine with device tree support that can boot on a Exynos4 processor based board and bring up the console. This acts as a stating point to add device tree support for Exynos4 architecture. Signed-off-by: Thomas Abraham --- Documentation/devicetree/bindings/arm/samsung.txt | 8 ++ arch/arm/mach-exynos4/Kconfig | 10 +++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/mach-exynos4-dt.c | 84 +++++++++++++++++++++ 4 files changed, 103 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/samsung.txt create mode 100644 arch/arm/mach-exynos4/mach-exynos4-dt.c diff --git a/Documentation/devicetree/bindings/arm/samsung.txt b/Documentation/devicetree/bindings/arm/samsung.txt new file mode 100644 index 0000000..ce4a1aa --- /dev/null +++ b/Documentation/devicetree/bindings/arm/samsung.txt @@ -0,0 +1,8 @@ +Samsung Exynos4 based SMDKV310 eval board + + SMDKV310 eval board is based on Samsung's Exynos4 processor architecture. + +Required root node properties: + - compatible = "samsung,smdkv310","samsung,exynos4" + (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board. + (b) "samsung,exynos4" - for boards based on Exynos4 architecture. diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig index 0c77ab9..c29de4e 100644 --- a/arch/arm/mach-exynos4/Kconfig +++ b/arch/arm/mach-exynos4/Kconfig @@ -218,6 +218,16 @@ config MACH_NURI help Machine support for Samsung Mobile NURI Board. +config MACH_EXYNOS4_DT + bool "Samsung Exynos4 Machine using device tree" + select CPU_EXYNOS4210 + select USE_OF + select S3C_DEV_HSMMC + select S3C_DEV_HSMMC2 + select EXYNOS4_SETUP_SDHCI + help + Machine support for Samsung Exynos4 machine with device tree enabled. + endmenu comment "Configuration for HSMMC bus width" diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile index b7fe1d7..d2bf5bf 100644 --- a/arch/arm/mach-exynos4/Makefile +++ b/arch/arm/mach-exynos4/Makefile @@ -30,6 +30,7 @@ obj-$(CONFIG_MACH_SMDKV310) += mach-smdkv310.o obj-$(CONFIG_MACH_ARMLEX4210) += mach-armlex4210.o obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o obj-$(CONFIG_MACH_NURI) += mach-nuri.o +obj-$(CONFIG_MACH_EXYNOS4_DT) += mach-exynos4-dt.o # device support diff --git a/arch/arm/mach-exynos4/mach-exynos4-dt.c b/arch/arm/mach-exynos4/mach-exynos4-dt.c new file mode 100644 index 0000000..47c3892 --- /dev/null +++ b/arch/arm/mach-exynos4/mach-exynos4-dt.c @@ -0,0 +1,84 @@ +/* + * Samsung's Exynos4 device tree enabled machine. + * + * Copyright (c) 2010-2011 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 +#include + +#include +#include +#include + +#include + +/* + * The following lookup table is used to override device names when devices + * are registered from device tree. This is temporarily added to enable + * device tree support addition for the Exynos4 architecture. + * + * For drivers that require platform data to be provided from the machine + * file, a platform data pointer can also be supplied along with the + * devices names. Usually, the platform data elements that cannot be parsed + * from the device tree by the drivers (example: function pointers) are + * supplied. But it should be noted that this is a temporary mechanism and + * at some point, the drivers should be capable of parsing all the platform + * data from the device tree. + */ +static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = { + OF_DEV_AUXDATA("samsung,s5pv310-uart", S5P_PA_UART0, + "s5pv210-uart.0", NULL), + OF_DEV_AUXDATA("samsung,s5pv310-uart", S5P_PA_UART1, + "s5pv210-uart.1", NULL), + OF_DEV_AUXDATA("samsung,s5pv310-uart", S5P_PA_UART2, + "s5pv210-uart.2", NULL), + OF_DEV_AUXDATA("samsung,s5pv310-uart", S5P_PA_UART3, + "s5pv210-uart.3", NULL), + {}, +}; + +static void __init exynos4_dt_map_io(void) +{ + s5p_init_io(NULL, 0, S5P_VA_CHIPID); + s3c24xx_init_clocks(24000000); +} + +static const struct of_device_id intc_of_match[] __initconst = { + { .compatible = "samsung,exynos4-gic", }, + {}, +}; + +static void __init exynos4_dt_machine_init(void) +{ + irq_domain_generate_simple(intc_of_match, EXYNOS4_PA_GIC_DIST, 0); + of_platform_populate(NULL, of_default_bus_match_table, + exynos4_auxdata_lookup, NULL); +} + +static char const *exynos4_dt_compat[] __initdata = { + "samsung,exynos4", + NULL +}; + +DT_MACHINE_START(SMDKV310, "Samsung Exynos4 DT") + /* Maintainer: Kukjin Kim */ + .init_irq = exynos4_init_irq, + .map_io = exynos4_dt_map_io, + .init_machine = exynos4_dt_machine_init, + .timer = &exynos4_timer, + .dt_compat = exynos4_dt_compat, +MACHINE_END