devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Boris BREZILLON <b.brezillon@overkiz.com>,
	Russell King <linux@arm.linux.org.uk>,
	Andrew Victor <linux@maxim.org.za>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Ludovic Desroches <ludovic.desroches@atmel.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 1/6] ARM: at91: prepare sama5 dt boards transition to common clk
Date: Wed, 9 Oct 2013 15:04:21 +0200	[thread overview]
Message-ID: <52555455.7080605@atmel.com> (raw)
In-Reply-To: <1375953654-11168-1-git-send-email-b.brezillon@overkiz.com>

On 08/08/2013 11:20, Boris BREZILLON :
> This patch prepare the transition to common clk for sama5 dt boards by
> replacing the timer init callback.
>
> Clocks registration cannot be done in early init callback (as formerly done
> by the old clk implementation) because it requires dynamic allocation
> which is not ready yet during early init.
>
> In the other hand, at91 clocks must be registered before
> at91sam926x_pit_init is called because PIT (Periodic Interval Timer) driver
> request the master clk (mck).
>
> A new function (at91sama5_dt_timer_init) is created to fullfil these needs.
> This function registers all at91 clks using the dt definition before
> calling the PIT init function.
> The device tree clock registration is enabled only if common clk is
> selected. Else the old clk registration is been done during
> at91_dt_initialize call.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>   arch/arm/mach-at91/board-dt-sama5.c |   10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/board-dt-sama5.c
> index ad95f6a..10b6913 100644
> --- a/arch/arm/mach-at91/board-dt-sama5.c
> +++ b/arch/arm/mach-at91/board-dt-sama5.c
> @@ -16,6 +16,7 @@
>   #include <linux/of_irq.h>
>   #include <linux/of_platform.h>
>   #include <linux/phy.h>
> +#include <linux/clk-provider.h>
>
>   #include <asm/setup.h>
>   #include <asm/irq.h>
> @@ -26,6 +27,13 @@
>   #include "at91_aic.h"
>   #include "generic.h"
>
> +static void __init sama5_dt_timer_init(void)
> +{
> +#if defined(CONFIG_COMMON_CLK)
> +	of_clk_init(NULL);
> +#endif
> +	at91sam926x_pit_init();
> +}
>
>   static const struct of_device_id irq_of_match[] __initconst = {
>
> @@ -77,7 +85,7 @@ static const char *sama5_dt_board_compat[] __initdata = {
>
>   DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)")
>   	/* Maintainer: Atmel */
> -	.init_time	= at91sam926x_pit_init,
> +	.init_time	= sama5_dt_timer_init,
>   	.map_io		= at91_map_io,
>   	.handle_irq	= at91_aic5_handle_irq,
>   	.init_early	= at91_dt_initialize,
>


-- 
Nicolas Ferre

       reply	other threads:[~2013-10-09 13:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1375951572-10829-1-git-send-email-b.brezillon@overkiz.com>
     [not found] ` <1375953654-11168-1-git-send-email-b.brezillon@overkiz.com>
2013-10-09 13:04   ` Nicolas Ferre [this message]
     [not found] ` <1375953690-11207-1-git-send-email-b.brezillon@overkiz.com>
     [not found]   ` <1375953690-11207-1-git-send-email-b.brezillon-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2013-10-09 13:05     ` [PATCH 2/6] ARM: at91: prepare common clk transition for sama5d3 SoC Nicolas Ferre
     [not found] ` <1375954299-11285-1-git-send-email-b.brezillon@overkiz.com>
     [not found]   ` <1375954299-11285-1-git-send-email-b.brezillon-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2013-10-09 13:10     ` [PATCH 3/6] ARM: at91/dt: define sama5d3 clocks Nicolas Ferre
     [not found] ` <1375954563-11343-1-git-send-email-b.brezillon@overkiz.com>
2013-10-09 13:12   ` [PATCH 4/6] ARM: at91/dt: define sama5d3xek's main clk frequency Nicolas Ferre
     [not found] ` <1375957794-11559-1-git-send-email-b.brezillon@overkiz.com>
     [not found]   ` <1375957794-11559-1-git-send-email-b.brezillon-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2013-10-09 13:12     ` [PATCH 5/6] ARM: at91: move sama5d3 SoC to common clk Nicolas Ferre
     [not found] ` <1375957837-11600-1-git-send-email-b.brezillon@overkiz.com>
     [not found]   ` <1375957837-11600-1-git-send-email-b.brezillon-ZNYIgs0QAGpBDgjK7y7TUQ@public.gmane.org>
2013-10-09 13:14     ` [PATCH 6/6] ARM: at91/dt: remove old main clk definition from sama5d3xcm.dtsi Nicolas Ferre

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=52555455.7080605@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=b.brezillon@overkiz.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=linux@maxim.org.za \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=ludovic.desroches@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).