From patchwork Tue Jul 3 12:34:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 1150821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id C8AEEDFF72 for ; Tue, 3 Jul 2012 12:44:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sm2NJ-00060q-Bs; Tue, 03 Jul 2012 12:38:37 +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-0005Wk-Av for linux-arm-kernel@lists.infradead.org; Tue, 03 Jul 2012 12:35:47 +0000 Received: by bkcji2 with SMTP id ji2so1014401bkc.36 for ; Tue, 03 Jul 2012 05:34:44 -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=9UMQJ/dcJeBH2Wfviz7WsRwlO2q65UxeOufhkZo2wSU=; b=IbkayiZ3AkfkwMy7KIZitMiHi6uGwbKZRaDSd9nduZ1mS7vTdMX2jlNAYlTEU/VmmC tL7Eoovr+o1Fa/NBiNg9Ht/8kGPS2LBSNGKTUDr3TN8VGRXnQj7etb9onXdECQxN6RX4 xablpdEMqtMpD0WgdAuPPiXJ1B0/9DRyr2RkJQQRuQiqCKHCnkRhpaUI4xxEA3XqbDAB DMsSy4iPJmxY62G2MyiPqf9t9mtPv+cgkrlOGJkZJSqw6IIuVpgfqmEF97CxvITeWHO1 m5an0AUhbxSnCHOuIGH4qeDXyuKontwD3/E8kRRbCA4u7ie+tUtOQFbDNs9FK3PMm0EV 8dqA== Received: by 10.204.155.66 with SMTP id r2mr6663745bkw.131.1341318884737; Tue, 03 Jul 2012 05:34:44 -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.43 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 05:34:44 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH 2/3] ARM: dts: dove: Add devicetree-based board setup Date: Tue, 3 Jul 2012 14:34:25 +0200 Message-Id: <1341318868-24567-4-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] -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 adds devicetree-based board setup files for Marvell Dove and currently supported 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/board-cm-a510.c | 86 +++++++++++++++++++++++++++++++++ arch/arm/mach-dove/board-dove-db.c | 92 ++++++++++++++++++++++++++++++++++++ arch/arm/mach-dove/board-dt.c | 73 ++++++++++++++++++++++++++++ 3 files changed, 251 insertions(+) create mode 100644 arch/arm/mach-dove/board-cm-a510.c create mode 100644 arch/arm/mach-dove/board-dove-db.c create mode 100644 arch/arm/mach-dove/board-dt.c diff --git a/arch/arm/mach-dove/board-cm-a510.c b/arch/arm/mach-dove/board-cm-a510.c new file mode 100644 index 0000000..1eda62f --- /dev/null +++ b/arch/arm/mach-dove/board-cm-a510.c @@ -0,0 +1,86 @@ +/* + * arch/arm/mach-dove/board-cm-a510.c + * + * Copyright (C) 2010 CompuLab, Ltd. + * Konstantin Sinyuk + * + * Compulab CM-A510 Board Init + * for drivers not converted to flattened device tree yet. + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "common.h" + +static struct mv643xx_eth_platform_data cm_a510_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT, +}; + +static struct mv_sata_platform_data cm_a510_sata_data = { + .n_ports = 1, +}; + +/* + * SPI Devices: + * SPI0: 1M Flash Winbond w25q32bv + */ +static const struct flash_platform_data cm_a510_spi_flash_data = { + .type = "w25q32bv", +}; + +static struct spi_board_info __initdata cm_a510_spi_flash_info[] = { + { + .modalias = "m25p80", + .platform_data = &cm_a510_spi_flash_data, + .irq = -1, + .max_speed_hz = 20000000, + .bus_num = 0, + .chip_select = 0, + }, +}; + +static int __init cm_a510_pci_init(void) +{ + if (machine_is_cm_a510()) + dove_pcie_init(1, 1); + + return 0; +} + +subsys_initcall(cm_a510_pci_init); + +/* Board Init */ +void __init cm_a510_init(void) +{ + /* + * Basic Dove setup. Needs to be called early. + */ + dove_init(); + + dove_ge00_init(&cm_a510_ge00_data); + dove_ehci0_init(); + dove_ehci1_init(); + dove_sata_init(&cm_a510_sata_data); + dove_sdio0_init(); + dove_sdio1_init(); + dove_spi0_init(); + dove_spi1_init(); + dove_i2c_init(); + spi_register_board_info(cm_a510_spi_flash_info, + ARRAY_SIZE(cm_a510_spi_flash_info)); +} diff --git a/arch/arm/mach-dove/board-dove-db.c b/arch/arm/mach-dove/board-dove-db.c new file mode 100644 index 0000000..21094d4 --- /dev/null +++ b/arch/arm/mach-dove/board-dove-db.c @@ -0,0 +1,92 @@ +/* + * arch/arm/mach-dove/board-dove-db.c + * + * Marvell DB-MV88AP510-BP Development Board Init + * for drivers not converted to flattened device tree yet. + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "common.h" + +static struct mv643xx_eth_platform_data dove_db_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT, +}; + +static struct mv_sata_platform_data dove_db_sata_data = { + .n_ports = 1, +}; + +/***************************************************************************** + * SPI Devices: + * SPI0: 4M Flash ST-M25P32-VMF6P + ****************************************************************************/ +static const struct flash_platform_data dove_db_spi_flash_data = { + .type = "m25p64", +}; + +static struct spi_board_info __initdata dove_db_spi_flash_info[] = { + { + .modalias = "m25p80", + .platform_data = &dove_db_spi_flash_data, + .irq = -1, + .max_speed_hz = 20000000, + .bus_num = 0, + .chip_select = 0, + }, +}; + +/***************************************************************************** + * PCI + ****************************************************************************/ +static int __init dove_db_pci_init(void) +{ + if (machine_is_dove_db()) + dove_pcie_init(1, 1); + + return 0; +} + +subsys_initcall(dove_db_pci_init); + +/***************************************************************************** + * Board Init + ****************************************************************************/ +void __init dove_db_init(void) +{ + /* + * Basic Dove setup. Needs to be called early. + */ + dove_init(); + + dove_ge00_init(&dove_db_ge00_data); + dove_ehci0_init(); + dove_ehci1_init(); + dove_sata_init(&dove_db_sata_data); + dove_sdio0_init(); + dove_sdio1_init(); + dove_spi0_init(); + dove_spi1_init(); + dove_i2c_init(); + spi_register_board_info(dove_db_spi_flash_info, + ARRAY_SIZE(dove_db_spi_flash_info)); +} diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-dove/board-dt.c new file mode 100644 index 0000000..7b5d481 --- /dev/null +++ b/arch/arm/mach-dove/board-dt.c @@ -0,0 +1,73 @@ +/* + * Copyright 2012 (C) + * Sebastian Hesselbarth + * + * arch/arm/mach-dove/board-dt.c + * + * Flattened Device Tree board initialization + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "common.h" + +static struct of_device_id dove_dt_match_table[] __initdata = { + { .compatible = "simple-bus", }, + { } +}; + +static void __init dove_dt_init(void) +{ + pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n", + (dove_tclk + 499999) / 1000000); + +#ifdef CONFIG_CACHE_TAUROS2 + tauros2_init(); +#endif + dove_setup_cpu_mbus(); + + /* Setup root of clk tree */ + dove_clk_init(); + + /* internal devices that every board has */ + dove_xor0_init(); + dove_xor1_init(); + + if (of_machine_is_compatible("marvell,dove-db")) + dove_db_init(); + + if (of_machine_is_compatible("compulab,cm-a510")) + cm_a510_init(); + + of_platform_populate(NULL, dove_dt_match_table, NULL, NULL); +} + +static const char * const dove_dt_board_compat[] = { + "marvell,dove-db", + "compulab,cm-a510", + NULL +}; + +DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)") + /* Maintainer: Sebastian Hesselbarth + * + */ + .map_io = dove_map_io, + .init_early = dove_init_early, + .init_irq = dove_init_irq, + .timer = &dove_timer, + .init_machine = dove_dt_init, + .restart = dove_restart, + .dt_compat = dove_dt_board_compat, +MACHINE_END +