From patchwork Sat Jun 22 13:44:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2765751 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5D58A9F39E for ; Sat, 22 Jun 2013 13:44:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67E7020105 for ; Sat, 22 Jun 2013 13:44:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5FF8120104 for ; Sat, 22 Jun 2013 13:44:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755956Ab3FVNoL (ORCPT ); Sat, 22 Jun 2013 09:44:11 -0400 Received: from mail-bk0-f52.google.com ([209.85.214.52]:41922 "EHLO mail-bk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755671Ab3FVNoK (ORCPT ); Sat, 22 Jun 2013 09:44:10 -0400 Received: by mail-bk0-f52.google.com with SMTP id d7so3660231bkh.39 for ; Sat, 22 Jun 2013 06:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding:content-type; bh=h7LEcShtZBCpf7L0RptsJ1QJ3ALhUeL9xpjlb3QdpQ8=; b=XsumOpWUpNVlfirXhN2QIe/WOxk+bCra46vJvRXEpM1ahq1N+wfOXxlrwlpO8dMUKl SPwR5ooghdwJOlClg52J9Nc8LiGJQ+X4XM+ibI2CamH2K5xWFkBNs7XXcIPafWE6MQgl V4w8WwpLz9g0+WvMkHT/d3RHjmohItR8OmBt6CmL9MlDgQME/o0u553G32yt9T8hHLLr fEEzOXyDWgT4X3KV/rN8ebuVyP2zFC4xBMcxMm9qExnVkjNCGLMEEJti4g0I08y6/vHn wT1f0GjCXmpOy4XJTlLuFVCK3+zy6cJBB2Gbnl6M0AFnXhGKUFhStRSwKPvlXhdkq2I8 1i0Q== X-Received: by 10.204.190.7 with SMTP id dg7mr2571600bkb.52.1371908647945; Sat, 22 Jun 2013 06:44:07 -0700 (PDT) Received: from flatron.localnet (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id ch16sm2546980bkb.17.2013.06.22.06.44.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 22 Jun 2013 06:44:07 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Kukjin Kim , Arnd Bergmann , Olof Johansson , Mark Brown , Rob Herring , Grant Likely , Benoit Cousson , devicetree-discuss@lists.ozlabs.org, Jason Cooper , linux-kernel@vger.kernel.org, Marc Zyngier , Nicolas Pitre , Russell King , Stephen Warren , Thomas Gleixner , Will Deacon Subject: [PATCH v7 5/8] ARM: s3c64xx: Add board file for boot using Device Tree Date: Sat, 22 Jun 2013 15:44:07 +0200 Message-ID: <2302304.NyG5fka8vK@flatron> User-Agent: KMail/4.10.4 (Linux/3.9.6-gentoo; KDE/4.10.4; x86_64; ; ) In-Reply-To: <1371774924-9224-6-git-send-email-tomasz.figa@gmail.com> References: <1371774924-9224-1-git-send-email-tomasz.figa@gmail.com> <1371774924-9224-6-git-send-email-tomasz.figa@gmail.com> MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 16 +++++++ arch/arm/mach-s3c64xx/Makefile | 1 + arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c | 85 +++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c Changes since v6: - Dropped the concept of .init_platform() callback and returned back to the old good abuse of .init_irq(). diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index f78a6a0..fb4258c 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -308,3 +308,19 @@ 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 CLKSRC_OF + select CPU_S3C6400 + select CPU_S3C6410 + select PINCTRL + select PINCTRL_S3C64XX + 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 645a8fe..6faedcf 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile @@ -57,3 +57,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..3384cb0 --- /dev/null +++ b/arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c @@ -0,0 +1,85 @@ +/* + * Samsung's S3C64XX flattened device tree enabled machine + * + * Copyright (c) 2013 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 + +#include "common.h" + +/* + * IO mapping for shared system controller IP. + * + * FIXME: Make remaining drivers use dynamic mapping. + */ +static struct map_desc s3c64xx_dt_iodesc[] __initdata = { + { + .virtual = (unsigned long)S3C_VA_SYS, + .pfn = __phys_to_pfn(S3C64XX_PA_SYSCON), + .length = SZ_4K, + .type = MT_DEVICE, + }, +}; + +static void __init s3c64xx_dt_map_io(void) +{ + debug_ll_io_init(); + iotable_init(s3c64xx_dt_iodesc, ARRAY_SIZE(s3c64xx_dt_iodesc)); + + s3c64xx_init_cpu(); + + if (!soc_is_s3c64xx()) + panic("SoC is not S3C64xx!"); +} + +static void __init s3c64xx_dt_init_irq(void) +{ + of_clk_init(NULL); + samsung_wdt_reset_of_init(); + irqchip_init(); +}; + +static void __init s3c64xx_dt_init_machine(void) +{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + +static void s3c64xx_dt_restart(char mode, const char *cmd) +{ + if (mode != 's') + samsung_wdt_reset(); + + /* if all else fails, or mode was for soft, jump to 0 */ + soft_restart(0); +} + +static char const *s3c64xx_dt_compat[] __initdata = { + "samsung,s3c6400", + "samsung,s3c6410", + NULL +}; + +DT_MACHINE_START(S3C6400_DT, "Samsung S3C64xx (Flattened Device Tree)") + /* Maintainer: Tomasz Figa */ + .dt_compat = s3c64xx_dt_compat, + .map_io = s3c64xx_dt_map_io, + .init_irq = s3c64xx_dt_init_irq, + .init_machine = s3c64xx_dt_init_machine, + .restart = s3c64xx_dt_restart, +MACHINE_END