From patchwork Wed Jan 9 23:41:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1957781 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id E0D923FC5A for ; Wed, 9 Jan 2013 23:45:36 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tt5IX-0003dN-4Z; Wed, 09 Jan 2013 23:43:05 +0000 Received: from mail-ee0-f45.google.com ([74.125.83.45]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tt5Hc-0003Sj-Us for linux-arm-kernel@lists.infradead.org; Wed, 09 Jan 2013 23:42:10 +0000 Received: by mail-ee0-f45.google.com with SMTP id d49so1140740eek.32 for ; Wed, 09 Jan 2013 15:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=ILGwUSZObk6vF5+j9SNvaYBK6PaNjMUG799rkPyGH74=; b=lqeEM/kFyglYAxMV8n527y6Rfg9ZwVyDs+SQ1Yheln3kHPVhEEXv/aKaY/nw93Bjlt THDWnYH3QzTPE8B/9S/tnixe09hZOCSMhEQpPqFnt/CSFheYXtUR4R0qQyl4UjqrVXiX QABwoedu5vgqrIFMnfhvTJYSVN7BzIvj687+DJ/V/q1/iO9aoG8hlUQw1CFcoxXUQcGh llixtDDHWeBA0eaLGPHgdeAtL3JUJwkltg8Ws+XJc9Rr2npzIrsdxxz2zA5+8cWpgT9v Pd/GcNG2VlYz4MDNClQ2qTOmGDKUpMMhtqikhSDjX9xe79cfzJJHZBcXNZQRoCjHXQnB vwtA== X-Received: by 10.14.225.194 with SMTP id z42mr187325411eep.22.1357774927453; Wed, 09 Jan 2013 15:42:07 -0800 (PST) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPS id e2sm144296239eeo.8.2013.01.09.15.42.06 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Jan 2013 15:42:07 -0800 (PST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [RFC PATCH 5/7] ARM: s3c64xx: Add board file for boot using Device Tree Date: Thu, 10 Jan 2013 00:41:47 +0100 Message-Id: <1357774909-29938-6-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1357774909-29938-1-git-send-email-tomasz.figa@gmail.com> References: <1357774909-29938-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130109_184209_397552_3C57B7CC X-CRM114-Status: GOOD ( 18.45 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.45 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomasz.figa[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: kgene.kim@samsung.com, linux@arm.linux.org.uk, kwangwoo.lee@gmail.com, devicetree-discuss@lists.ozlabs.org, broonie@opensource.wolfsonmicro.com, mcuelenaere@gmail.com, Tomasz Figa , augulis.darius@gmail.com, jacmet@sunsite.dk, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 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 This patch adds board file that will be used to boot S3C64xx-based boards using Device Tree. Signed-off-by: Tomasz Figa --- arch/arm/mach-s3c64xx/Kconfig | 13 +++++ arch/arm/mach-s3c64xx/Makefile | 1 + arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | 93 +++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 131c862..a43b3f7 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -309,3 +309,16 @@ config MACH_WLF_CRAGG_6410 select SAMSUNG_GPIO_EXTRA128 help Machine support for the Wolfson Cragganmore S3C6410 variant. + +config MACH_S3C64XX_DT + bool "Samsung S3C6400/S3C6410 machine using Device Tree" + select CPU_S3C6400 + select CPU_S3C6410 + select USE_OF + help + Machine support for Samsung S3C6400/S3C6410 machines with Device Tree + enabled. + Select this if a fdt blob is available for your S3C64XX SoC based + board. + Note: This is under development and not all peripherals can be + supported with this machine file. diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index f9ce1dc..59b3d06 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile @@ -58,3 +58,4 @@ obj-$(CONFIG_MACH_SMARTQ7) += mach-smartq7.o obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o obj-$(CONFIG_MACH_WLF_CRAGG_6410) += mach-crag6410.o mach-crag6410-module.o +obj-$(CONFIG_MACH_S3C64XX_DT) += mach-s3c64xx-dt.o diff --git a/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c new file mode 100644 index 0000000..f5725ce --- /dev/null +++ b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c @@ -0,0 +1,93 @@ +/* + * Samsung's S3C64XX flattened device tree enabled machine + * + * Copyright (c) 2012 Tomasz Figa + * + * 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 "common.h" + +/* + * 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 s3c64xx_auxdata_lookup[] __initconst = { + OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART0, + "s3c6400-uart.0", NULL), + OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART1, + "s3c6400-uart.1", NULL), + OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART2, + "s3c6400-uart.2", NULL), + OF_DEV_AUXDATA("samsung,s3c6400-uart", S3C_PA_UART3, + "s3c6400-uart.3", NULL), + {}, +}; + +static void __init s3c64xx_dt_map_io(void) +{ + s3c64xx_init_io(NULL, 0); + s3c24xx_init_clocks(12000000); +} + +static void __init s3c64xx_dt_machine_init(void) +{ + of_platform_populate(NULL, of_default_bus_match_table, + s3c64xx_auxdata_lookup, NULL); +} + +static char const *s3c6400_dt_compat[] __initdata = { + "samsung,s3c6400", + NULL +}; + +DT_MACHINE_START(S3C6400_DT, "Samsung S3C6400 (Flattened Device Tree)") + /* Maintainer: Tomasz Figa */ + .init_irq = s3c6400_init_irq, + .map_io = s3c64xx_dt_map_io, + .handle_irq = vic_handle_irq, + .init_machine = s3c64xx_dt_machine_init, + .init_late = s3c64xx_init_late, + .timer = &s3c24xx_timer, + .dt_compat = s3c6400_dt_compat, + .restart = s3c64xx_restart, +MACHINE_END + +static char const *s3c6410_dt_compat[] __initdata = { + "samsung,s3c6410", + NULL +}; + +DT_MACHINE_START(S3C6410_DT, "Samsung S3C6410 (Flattened Device Tree)") + /* Maintainer: Tomasz Figa */ + .init_irq = s3c6410_init_irq, + .map_io = s3c64xx_dt_map_io, + .handle_irq = vic_handle_irq, + .init_machine = s3c64xx_dt_machine_init, + .init_late = s3c64xx_init_late, + .timer = &s3c24xx_timer, + .dt_compat = s3c6410_dt_compat, + .restart = s3c64xx_restart, +MACHINE_END