All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/8] arm: mach-mvebu: add support for Armada 370 and Armada XP with DT
Date: Tue, 12 Jun 2012 13:09:18 +0000	[thread overview]
Message-ID: <201206121309.18532.arnd@arndb.de> (raw)
In-Reply-To: <1339433585-28087-5-git-send-email-gregory.clement@free-electrons.com>

On Monday 11 June 2012, Gregory CLEMENT wrote:
> +	soc {
> +		serial at d0012000 {
> +			clock-frequency = <200000000>;
> +		};
> +		timer at d0020300 {
> +			clock-frequency = <600000000>;
> +
> +		};
> +	};
> +};

In most platforms, we mark the "serial" device and anything else that
might not be connected as "disabled" in the .dtsi file, and enable the
ones that are actually used in the board specific .dts file. I think it
makes sense to also do that here.

> diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
> index 72d39e5..ad2faa2 100644
> --- a/arch/arm/mach-mvebu/Kconfig
> +++ b/arch/arm/mach-mvebu/Kconfig
> @@ -2,6 +2,13 @@ if ARCH_MVEBU
>  
>  menu "Marvell SOC with device tree"
>  
> +config MACH_ARMADA_370_XP_DT
> +	bool "Marvell Armada 370 and Aramada XP boards with device-tree support"
> +	help
> +
> +	  Say 'Y' here if you want your kernel to support boards based on
> +	  Marvell Armada 370 or Armada XP with device tree.
> +
>  endmenu
>  
>  endif
> --- /dev/null
> +++ b/arch/arm/mach-mvebu/armada-370-xp-dt.c

Please dtop the _dt postfix everywhere here.

> @@ -0,0 +1,65 @@
> +/*
> + * Device Tree support for Armada XP platforms.
> + *
> + * Copyright (C) 2012 Marvell
> + *
> + * Lior Amsalem <alior@marvell.com>
> + * Gregory CLEMENT <gregory.clement@free-electrons.com>
> + * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> + *
> + * 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_platform.h>
> +#include <linux/io.h>
> +#include <asm/mach/arch.h>
> +#include <mach/mvebu.h>
> +#include <mach/armada-370-xp.h>
> +#include "common.h"
> +
> +#define SOFT_RESET_OUT_EN	0x1
> +#define RSTOUTN_MASK_ADDR	(MVEBU_REGS_VIRT_BASE | \
> +					ARMADA_370_XP_RSTOUTN_MASK_OFFSET)
> +#define SOFT_RESET		0x1
> +#define SYSTEM_SOFT_RESET_ADDR	(MVEBU_REGS_VIRT_BASE| \
> +					ARMADA_370_XP_SYSTEM_SOFT_RESET_OFFSET)

We should not be hardcoding addresses like this any more IMHO:

> +static void armada_370_xp_restart(char mode, const char *cmd)
> +{
> +	/*
> +	* Enable soft reset to assert RSTOUTn.
> +	*/
> +	writel(SOFT_RESET_OUT_EN, RSTOUTN_MASK_ADDR);
> +	/*
> +	* Assert soft reset.
> +	*/
> +	writel(SOFT_RESET, SYSTEM_SOFT_RESET_ADDR);
> +	while (1)
> +		;
> +}

This function is the same one that's used for the existing mvebu platforms,
just with a different offset. I think it would be nice to put it into a
reset.c file along with some code that looks for the location.

For instance, you can look for the device that holds the "bridge regs"
and then either add the 0x108 or the 0x18260 offset, depending on its
compatible property.

> diff --git a/arch/arm/mach-mvebu/time-armada-370-xp.c b/arch/arm/mach-mvebu/time-armada-370-xp.c
> new file mode 100644
> index 0000000..104b88a
> --- /dev/null
> +++ b/arch/arm/mach-mvebu/time-armada-370-xp.c

I think this file should go into drivers/clocksource instead of the arch directory.

	Arnd

  reply	other threads:[~2012-06-12 13:09 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11 16:52 [PATCH v2] arm: Add basic support for new Marvell Armada 370 and Armada XP SoC Gregory CLEMENT
2012-06-11 16:52 ` [PATCH v2 1/8] arm: mach-mvebu: add header Gregory CLEMENT
2012-06-11 17:11   ` Andrew Lunn
2012-06-11 16:52 ` [PATCH v2 2/8] arm: mach-mvebu: add source files Gregory CLEMENT
2012-06-12  8:45   ` Arnd Bergmann
2012-06-12 12:56     ` Gregory CLEMENT
2012-06-12 13:35       ` Arnd Bergmann
2012-06-12 15:50       ` Nicolas Pitre
2012-06-11 16:53 ` [PATCH v2 3/8] arm: mach-mvebu: add compilation/configuration change Gregory CLEMENT
2012-06-12  8:39   ` Arnd Bergmann
2012-06-12 13:01     ` Gregory CLEMENT
2012-06-11 16:53 ` [PATCH v2 4/8] arm: mach-mvebu: add support for Armada 370 and Armada XP with DT Gregory CLEMENT
2012-06-12 13:09   ` Arnd Bergmann [this message]
2012-06-11 16:53 ` [PATCH v2 5/8] arm: mach-mvebu: add documentation for new device tree bindings Gregory CLEMENT
2012-06-11 16:53 ` [PATCH v2 6/8] arm: mach-mvebu: add defconfig Gregory CLEMENT
2012-06-11 16:53 ` [PATCH v2 7/8] arm: mach-mvebu: add entry to MAINTAINERS Gregory CLEMENT
2012-06-11 16:53 ` [PATCH v2 8/8] ARM: mvebu: MPIC: read number of interrupts from control register Gregory CLEMENT
2012-06-11 20:44 ` [PATCH v2] arm: Add basic support for new Marvell Armada 370 and Armada XP SoC David Marlin
2012-06-12  7:35   ` Gregory CLEMENT
2012-06-12  8:04     ` Andrew Lunn
2012-06-12  8:09   ` Arnd Bergmann
2012-06-12 13:49 ` Arnd Bergmann
2012-06-12 13:56   ` Gregory CLEMENT
2012-06-12 14:06   ` Andrew Lunn
2012-06-12 14:24     ` Jason Cooper
2012-06-12 14:59       ` Arnd Bergmann
2012-06-12 15:40         ` Jason Cooper
2012-06-12 17:39           ` Arnd Bergmann
2012-06-13 16:14   ` Thomas Petazzoni
2012-06-13 19:19     ` Arnd Bergmann
2012-06-13 15:06 ` Jon Masters
2012-06-13 15:14   ` Gregory CLEMENT
2012-06-13 15:24   ` Arnd Bergmann
2012-06-13 15:48   ` Jason Cooper
2012-06-13 16:12     ` Arnaud Patard (Rtp)
2012-06-13 15:56   ` Nicolas Pitre

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=201206121309.18532.arnd@arndb.de \
    --to=arnd@arndb.de \
    --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.