From patchwork Tue Jul 3 12:34:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 1150831 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 D33363FE4F for ; Tue, 3 Jul 2012 12:44:24 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sm2Nn-000635-Hb; Tue, 03 Jul 2012 12:39:07 +0000 Received: from [209.85.214.49] (helo=mail-bk0-f49.google.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sm2KF-0005Wz-Aw for linux-arm-kernel@lists.infradead.org; Tue, 03 Jul 2012 12:35:47 +0000 Received: by bkcji2 with SMTP id ji2so1014473bkc.36 for ; Tue, 03 Jul 2012 05:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=48fJxDzpdkG07ftFNEGcM0a9btXNfVVx17JIi92sFgM=; b=hSt3Ifx3wdHDhXZKX9w1WwG9YREvqbgbqtodMX/sK7mm2+KXODcHPbZHRy7WcsdIEG pF9qPIwYv6WH6ZP1J1PdnscJe7H+f9f0gIi1VGaVRNzHj+KYm11hwNg4bZuEIGXPMe/B iF1TGJKVq1LN3Qfemy4HjjtEw/5PiV7ZiCW10VlCNuH/EpgGIHDO5EjBbnkXLWUEuVUu hArSx57z0PgsPbb6uFjHlZhAqkUyUQ7z8bB0q/Xq2afnqs/kp0DtF515wZc/IpJPEr00 1YP7Bye2NBT2/U5ir+oQH+YgfqjLFo6cD2Gx24fe9vWGQbSeKMdKME4sAFsncVLvpc81 RoSQ== Received: by 10.205.33.136 with SMTP id so8mr9214898bkb.1.1341318888143; Tue, 03 Jul 2012 05:34:48 -0700 (PDT) Received: from localhost.localdomain (dslc-082-083-240-137.pools.arcor-ip.net. [82.83.240.137]) by mx.google.com with ESMTPS id t23sm9529216bks.4.2012.07.03.05.34.46 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 05:34:47 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH 3/3] ARM: dts: dove: Integrate devicetree support Date: Tue, 3 Jul 2012 14:34:27 +0200 Message-Id: <1341318868-24567-6-git-send-email-sebastian.hesselbarth@googlemail.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1341318868-24567-2-git-send-email-sebastian.hesselbarth@googlemail.com> References: <1341318868-24567-2-git-send-email-sebastian.hesselbarth@googlemail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.1 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (sebastian.hesselbarth[at]googlemail.com) 0.8 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [82.83.240.137 listed in dnsbl.sorbs.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.49 listed in list.dnswl.org] -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 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS Cc: Andrew Lunn , Russell King , Jason Cooper , 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 integrates devicetree support for Marvell Dove and currently suppported boards. Signed-off-by: Sebastian Hesselbarth Cc: Jason Cooper Cc: Andrew Lunn Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org --- arch/arm/mach-dove/Kconfig | 20 ++++++++++++++++++++ arch/arm/mach-dove/Makefile | 4 ++++ arch/arm/mach-dove/Makefile.boot | 3 +++ arch/arm/mach-dove/common.c | 17 +++++++++-------- arch/arm/mach-dove/common.h | 25 +++++++++++++++++++++++++ 5 files changed, 61 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig index dd937c5..8dff8fc 100644 --- a/arch/arm/mach-dove/Kconfig +++ b/arch/arm/mach-dove/Kconfig @@ -15,6 +15,26 @@ config MACH_CM_A510 Say 'Y' here if you want your kernel to support the CompuLab CM-A510 Board. +config ARCH_DOVE_DT + bool "Marvell Dove Flattened Device Tree" + select USE_OF + help + Say 'Y' here if you want your kernel to support the + Marvell Dove using flattened device tree. + +config MACH_DOVE_DB_DT + bool "Marvell DB-MV88AP510 Development Board (Flattened Device Tree)" + select ARCH_DOVE_DT + help + Say 'Y' here if you want your kernel to support the + Marvell DB-MV88AP510 Development Board (Flattened Device Tree). + +config MACH_CM_A510_DT + bool "CompuLab CM-A510 Board (Flattened Device Tree)" + help + Say 'Y' here if you want your kernel to support the + CompuLab CM-A510 Board (Flattened Device Tree). + endmenu endif diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile index fa0f018..bdb39f5 100644 --- a/arch/arm/mach-dove/Makefile +++ b/arch/arm/mach-dove/Makefile @@ -2,3 +2,7 @@ obj-y += common.o addr-map.o irq.o pcie.o mpp.o obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o obj-$(CONFIG_MACH_CM_A510) += cm-a510.o + +obj-$(CONFIG_ARCH_DOVE_DT) += board-dt.o +obj-$(CONFIG_MACH_DOVE_DB_DT) += board-dove-db.o +obj-$(CONFIG_MACH_CM_A510_DT) += board-cm-a510.o diff --git a/arch/arm/mach-dove/Makefile.boot b/arch/arm/mach-dove/Makefile.boot index 760a0ef..185e988 100644 --- a/arch/arm/mach-dove/Makefile.boot +++ b/arch/arm/mach-dove/Makefile.boot @@ -1,3 +1,6 @@ zreladdr-y += 0x00008000 params_phys-y := 0x00000100 initrd_phys-y := 0x00800000 + +dtb-$(CONFIG_MACH_DOVE_DB_DT) += dove-dove-db.dtb +dtb-$(CONFIG_MACH_CM_A510_DT) += dove-cm-a510.dtb diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 9493076..6236035 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c @@ -33,8 +33,6 @@ #include #include "common.h" -static int get_tclk(void); - /***************************************************************************** * I/O Address Mapping ****************************************************************************/ @@ -72,10 +70,10 @@ void __init dove_map_io(void) ****************************************************************************/ static struct clk *tclk; -static void __init clk_init(void) +void __init dove_clk_init(void) { tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT, - get_tclk()); + dove_tclk); orion_clkdev_init(tclk); } @@ -187,7 +185,9 @@ void __init dove_init_early(void) orion_time_set_base(TIMER_VIRT_BASE); } -static int get_tclk(void) +int dove_tclk; + +static int __init dove_find_tclk(void) { /* use DOVE_RESET_SAMPLE_HI/LO to detect tclk */ return 166666667; @@ -195,8 +195,9 @@ static int get_tclk(void) static void __init dove_timer_init(void) { + dove_tclk = dove_find_tclk(); orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, - IRQ_DOVE_BRIDGE, get_tclk()); + IRQ_DOVE_BRIDGE, dove_tclk); } struct sys_timer dove_timer = { @@ -285,7 +286,7 @@ void __init dove_sdio1_init(void) void __init dove_init(void) { printk(KERN_INFO "Dove 88AP510 SoC, "); - printk(KERN_INFO "TCLK = %dMHz\n", (get_tclk() + 499999) / 1000000); + printk(KERN_INFO "TCLK = %dMHz\n", (dove_tclk + 499999) / 1000000); #ifdef CONFIG_CACHE_TAUROS2 tauros2_init(); @@ -293,7 +294,7 @@ void __init dove_init(void) dove_setup_cpu_mbus(); /* Setup root of clk tree */ - clk_init(); + dove_clk_init(); /* internal devices that every board has */ dove_rtc_init(); diff --git a/arch/arm/mach-dove/common.h b/arch/arm/mach-dove/common.h index 6432a3b..a11f842 100644 --- a/arch/arm/mach-dove/common.h +++ b/arch/arm/mach-dove/common.h @@ -40,4 +40,29 @@ void dove_sdio0_init(void); void dove_sdio1_init(void); void dove_restart(char, const char *); +/* board init functions for boards not fully converted to fdt */ +#ifdef CONFIG_MACH_DOVE_DB_DT +void dove_db_init(void); +#else +static inline void dove_db_init(void) {}; +#endif + +#ifdef CONFIG_MACH_CM_A510_DT +void cm_a510_init(void); +#else +static inline void cm_a510_init(void) {}; +#endif + +/* early init functions not converted to fdt yet */ +void dove_clk_init(void); +void dove_rtc_init(void); +void dove_xor0_init(void); +void dove_xor1_init(void); + +extern int dove_tclk; + +#ifdef CONFIG_CACHE_TAUROS2 +#include +#endif + #endif