From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: dts: dove: Add devicetree-based board setup
Date: Sat, 07 Jul 2012 14:42:26 -0500 [thread overview]
Message-ID: <4FF89122.20102@gmail.com> (raw)
In-Reply-To: <1341318868-24567-4-git-send-email-sebastian.hesselbarth@googlemail.com>
On 07/03/2012 07:34 AM, Sebastian Hesselbarth wrote:
> This adds devicetree-based board setup files for Marvell Dove and
> currently supported boards.
>
> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: linux-arm-kernel at lists.infradead.org
> ---
> arch/arm/mach-dove/board-cm-a510.c | 86 +++++++++++++++++++++++++++++++++
> arch/arm/mach-dove/board-dove-db.c | 92 ++++++++++++++++++++++++++++++++++++
Much of this code will be removed with proper bindings and is the same
for these 2 boards. I'd rather see a more minimal board support starting
with interrupts and platform device creation from DT.
Rob
> 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 <kostyas@compulab.co.il>
> + *
> + * 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 <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/ata_platform.h>
> +#include <linux/mv643xx_eth.h>
> +#include <linux/spi/spi.h>
> +#include <linux/spi/flash.h>
> +
> +#include <asm/mach-types.h>
> +#include <asm/mach/arch.h>
> +
> +#include <mach/dove.h>
> +
> +#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 <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/platform_device.h>
> +#include <linux/irq.h>
> +#include <linux/mtd/physmap.h>
> +#include <linux/mtd/nand.h>
> +#include <linux/timer.h>
> +#include <linux/ata_platform.h>
> +#include <linux/mv643xx_eth.h>
> +#include <linux/i2c.h>
> +#include <linux/pci.h>
> +#include <linux/spi/spi.h>
> +#include <linux/spi/flash.h>
> +#include <linux/gpio.h>
> +#include <asm/mach-types.h>
> +#include <asm/mach/arch.h>
> +#include <mach/dove.h>
> +#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 <sebastian.hesselbarth@googlemail.com>
> + *
> + * 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 <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/kexec.h>
> +#include <asm/mach/arch.h>
> +#include <asm/mach/map.h>
> +#include <mach/bridge-regs.h>
> +#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
> + * <sebastian.hesselbarth@googlemail.com>
> + */
> + .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
> +
>
next prev parent reply other threads:[~2012-07-07 19:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-03 12:34 [PATCH 0/3] ARM: dts: dove: Basic devicetree support for Marvell Dove Sebastian Hesselbarth
2012-07-03 12:34 ` [PATCH 1/3] ARM: dts: dove: Add devicetree descriptors Sebastian Hesselbarth
2012-07-07 19:37 ` Rob Herring
2012-07-03 12:34 ` [PATCH 2/3] ARM: dts: dove: Add devicetree-based board setup Sebastian Hesselbarth
2012-07-07 19:42 ` Rob Herring [this message]
2012-07-03 12:34 ` [PATCH 3/3] ARM: dts: dove: Integrate devicetree support Sebastian Hesselbarth
2012-07-07 19:34 ` Rob Herring
2012-07-07 21:08 ` Sebastian Hesselbarth
2012-07-08 18:57 ` Arnd Bergmann
2012-07-03 12:50 ` [PATCH 0/3] ARM: dts: dove: Basic devicetree support for Marvell Dove Andrew Lunn
2012-07-03 13:03 ` Sebastian Hesselbarh
2012-07-03 13:12 ` Andrew Lunn
2012-07-07 17:31 ` Jason Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FF89122.20102@gmail.com \
--to=robherring2@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.