linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 2/2] ARM: tegra: Initialize flow controller from DT
Date: Thu, 12 Jun 2014 14:21:39 -0600	[thread overview]
Message-ID: <539A0BD3.6060002@wwwdotorg.org> (raw)
In-Reply-To: <1402487891-6493-2-git-send-email-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On 06/11/2014 05:58 AM, Thierry Reding wrote:
> From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> 
> Use a matching device tree node to initialize the flow controller driver
> instead of hard-coding the I/O address. This is necessary to get rid of
> the iomap.h include, which in turn make it easier to share this code
> with 64-bit Tegra SoCs.
> 
> Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
> Note that this doesn't provide a fallback option for compatibility with
> old device trees. Any kind of fallback would require either the iomap.h
> file to remain included or copying out some parts verbatim, which to a
> large degree defies the whole purpose of this patch. The ultimate goal
> is to move this code into drivers/soc/tegra in order to allow sharing
> between 32- and 64-bit Tegra SoCs.
> 
> If we absolutely must have backwards compatibility with device trees
> that don't have the flow controller node and still want to share this
> code with ARM64, I don't see any other way than moving iomap.h to
> drivers/soc/tegra along with all the other code.

We do need a fallback. I think it would be as simple as the following:

  	np = of_find_matching_node(NULL, matches);
- 	BUG_ON(!np);
+ 	if (!np) {
+ 		base_addr = 0x60007000;
+ 		iomap(base_addr) // roughly this anyway

In other words, hard-code the fallback right where it's used. No need to
keep iomap.h around etc.

> diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c

> @@ -80,6 +81,7 @@ static void __init tegra_init_early(void)
>  	tegra_cpu_reset_handler_init();
>  	tegra_powergate_init();
>  	tegra_hotplug_init();
> +	tegra_flowctrl_init();
>  }

It might make sense to call the function as early as possible; don't
some of CPU reset, powergate, hotplug depend on the flow controller? Not
that they can likely trigger this early, but it'd still be good if the
init order roughly logically followed any runtime dependencies.

  parent reply	other threads:[~2014-06-12 20:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 11:58 [PATCH 1/2] ARM: tegra: Add device tree nodes for flow controller Thierry Reding
     [not found] ` <1402487891-6493-1-git-send-email-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-06-11 11:58   ` [PATCH 2/2] ARM: tegra: Initialize flow controller from DT Thierry Reding
     [not found]     ` <1402487891-6493-2-git-send-email-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-06-12 20:21       ` Stephen Warren [this message]
2014-06-12 20:15   ` [PATCH 1/2] ARM: tegra: Add device tree nodes for flow controller Stephen Warren

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=539A0BD3.6060002@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 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).