From patchwork Mon Jun 20 11:02:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 896932 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5KAtrZE025703 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 20 Jun 2011 10:56:21 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QYc8C-00008B-Q6; Mon, 20 Jun 2011 10:55:01 +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 1QYc8C-0007Cq-6J; Mon, 20 Jun 2011 10:55:00 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QYc6Z-0006nw-W9 for linux-arm-kernel@lists.infradead.org; Mon, 20 Jun 2011 10:53:22 +0000 Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LN3002UK4WH3MC0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 20 Jun 2011 19:53:15 +0900 (KST) X-AuditID: cbfee61a-b7ce2ae000001a8f-09-4dff269bbc74 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 12.AE.06799.B962FFD4; Mon, 20 Jun 2011 19:53:15 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LN300JSM4W4PB@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 20 Jun 2011 19:53:16 +0900 (KST) Date: Mon, 20 Jun 2011 16:32:32 +0530 From: Thomas Abraham Subject: [PATCH 6/6] arm: exynos4: Add a new Exynos4 device tree enabled machine In-reply-to: <1308567752-13451-1-git-send-email-thomas.abraham@linaro.org> To: devicetree-discuss@lists.ozlabs.org Message-id: <1308567752-13451-7-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 References: <1308567752-13451-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110620_065320_397911_C06882E5 X-CRM114-Status: GOOD ( 22.33 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [203.254.224.34 listed in list.dnswl.org] Cc: kgene.kim@samsung.com, linaro-dev@lists.linaro.org, patches@linaro.org, linux-samsung-soc@vger.kernel.org, ben-linux@fluff.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 (demeter1.kernel.org [140.211.167.41]); Mon, 20 Jun 2011 10:56:21 +0000 (UTC) Basic Exynos4 machine with device tree support that can boot on a Exynos4 based smdkv310 board and bring up the console. Signed-off-by: Thomas Abraham --- Documentation/devicetree/bindings/arm/samsung.txt | 3 +- arch/arm/mach-exynos4/Kconfig | 11 +++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/mach-exynos4-dt.c | 94 +++++++++++++++++++++ 4 files changed, 108 insertions(+), 1 deletions(-) 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 index 594cb97..80d29bb 100644 --- a/Documentation/devicetree/bindings/arm/samsung.txt +++ b/Documentation/devicetree/bindings/arm/samsung.txt @@ -4,6 +4,7 @@ Samsung Exynos4 S5PV310 SoC based SMDKV310 eval board Samsung's Exynos4 family of application processors. Required root node properties: - - compatible = "samsung,smdkv310","samsung,s5pv310" + - compatible = "samsung,smdkv310","samsung,s5pv310", "samsung,exynos4210'. (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board. (b) "samsung,s5pv310" - for boards based on S5PV310 SoC. + (c) "samsung,exynos4210" - for boards based on Exynos4210 processor. diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig index 1435fc3..412e0c5 100644 --- a/arch/arm/mach-exynos4/Kconfig +++ b/arch/arm/mach-exynos4/Kconfig @@ -186,6 +186,17 @@ config MACH_NURI help Machine support for Samsung Mobile NURI Board. +config MACH_EXYNOS4_DT + bool "Samsung's Exynos4 Machine with DT support" + select CPU_EXYNOS4210 + select USE_OF + select S3C_DEV_WDT + 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 60fe5ec..6491e5b 100644 --- a/arch/arm/mach-exynos4/Makefile +++ b/arch/arm/mach-exynos4/Makefile @@ -36,6 +36,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..34267d8 --- /dev/null +++ b/arch/arm/mach-exynos4/mach-exynos4-dt.c @@ -0,0 +1,94 @@ +/* + * Samsung's Exynos4210 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 + +#include + +static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = { + .cd_type = S3C_SDHCI_CD_INTERNAL, + .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, +#ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT + .max_width = 8, + .host_caps = MMC_CAP_8_BIT_DATA, +#endif +}; + +static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = { + .cd_type = S3C_SDHCI_CD_INTERNAL, + .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, +#ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT + .max_width = 8, + .host_caps = MMC_CAP_8_BIT_DATA, +#endif +}; + +static const struct of_dev_auxdata exynos4_auxdata_lookup[] __initconst = { + OF_DEV_AUXDATA("samsung,s3c-sdhci", EXYNOS4_PA_HSMMC(2), + "s3c-sdhci.2", &s3c_hsmmc2_def_platdata), + OF_DEV_AUXDATA("samsung,s3c-sdhci", EXYNOS4_PA_HSMMC(0), + "s3c-sdhci.0", &s3c_hsmmc0_def_platdata), + OF_DEV_AUXDATA("samsung,s5pv210-uart", S5P_PA_UART0, + "s5pv210-uart.0", NULL), + OF_DEV_AUXDATA("samsung,s5pv210-uart", S5P_PA_UART1, + "s5pv210-uart.1", 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) +{ + s3c_sdhci0_set_platdata(&smdkv310_hsmmc0_pdata); + s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata); + + 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,exynos4210", + NULL +}; + +DT_MACHINE_START(SMDKV310, "Samsung Exynos4 DT") + /* Maintainer: Kukjin Kim */ + .boot_params = S5P_PA_SDRAM + 0x100, + .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