mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter De Schrijver <pdeschrijver@nvidia.com>
To: Colin Cross <ccross@android.com>
Cc: Russell King <linux@arm.linux.org.uk>,
	Olof Johansson <olof@lixom.net>,
	Stephen Warren <swarren@nvidia.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v2 2/8] arm/tegra: prepare early init for multiple tegra variants
Date: Thu, 3 Nov 2011 11:21:16 +0200	[thread overview]
Message-ID: <20111103092116.GO13358@tbergstrom-lnx.Nvidia.com> (raw)
In-Reply-To: <CAMbhsRSTcR8qgYESmM6OxkXeVeg6vS49woCe_OX6CY4pAj2g_A@mail.gmail.com>

On Wed, Nov 02, 2011 at 07:30:43PM +0100, Colin Cross wrote:
> On Wed, Nov 2, 2011 at 7:09 AM, Peter De Schrijver
> <pdeschrijver@nvidia.com> wrote:
> > This patch splits the early init code in a common and a tegra20 specific part.
> > L2 cache initialization is generalized and discovers the cache associativity
> > at runtime.
> >
> > Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
> > ---
> <snip>
> 
> > -static __initdata struct tegra_clk_init_table common_clk_init_table[] = {
> > +void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset;
> > +
> This is unrelated to the patch description?
> 

This is a left over from the past. Will be removed from the next version.

> > +static __initdata struct tegra_clk_init_table tegra20_clk_init_table[] = {
> >        /* name         parent          rate            enabled */
> >        { "clk_m",      NULL,           0,              true },
> >        { "pll_p",      "clk_m",        216000000,      true },
> > @@ -59,25 +61,34 @@ static __initdata struct tegra_clk_init_table common_clk_init_table[] = {
> >        { NULL,         NULL,           0,              0},
> >  };
> >
> > -static void __init tegra_init_cache(void)
> > +static void __init tegra_init_cache(u32 tag_latency, u32 data_latency)
> >  {
> >  #ifdef CONFIG_CACHE_L2X0
> >        void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000;
> > +       u32 aux_ctrl;
> > +
> > +       writel_relaxed(tag_latency, p + L2X0_TAG_LATENCY_CTRL);
> > +       writel_relaxed(data_latency, p + L2X0_DATA_LATENCY_CTRL);
> >
> > -       writel_relaxed(0x331, p + L2X0_TAG_LATENCY_CTRL);
> > -       writel_relaxed(0x441, p + L2X0_DATA_LATENCY_CTRL);
> > +       aux_ctrl = readl(p + L2X0_CACHE_TYPE);
> > +       aux_ctrl = (aux_ctrl & 0x700) << (17-8);
> 
> If I'm interpreting the PL310 TRM correctly, the cache associativity
> value in the L2X0_CACHE_TYPE register is read from the aux control
> register, so this is just leaving the existing value in place.  If the
> value is not being modified, just take it out of the aux_ctrl mask
> passed to l2x0_init.
> 

This seems to work fine on our android kernels though. Need to dig deeper
what's going on here.

> > +       aux_ctrl |= 0x7C000001;
> 
> This adds the BRESP bit to the aux control register.  Considering the
> problems I've seen with random bits in the L2 cache causing all sorts
> of instabilities, this should be split out into a separate change so
> that it's obvious in a bisect.
> 

Ok. Will remove that for now.

> >
> > -       l2x0_init(p, 0x6C080001, 0x8200c3fe);
> > +       l2x0_init(p, aux_ctrl, 0x8200c3fe);
> >  #endif
> >
> >  }
> >
> > -void __init tegra_init_early(void)
> > +static void __init tegra_setup_system_reset(void)
> > +{
> > +       arm_arch_reset = tegra_assert_system_reset;
> > +}
> > +
> > +void __init tegra20_init_early(void)
> >  {
> >        tegra_init_fuse();
> >        tegra_init_clock();
> > -       tegra_clk_init_from_table(common_clk_init_table);
> > -       tegra_init_cache();
> > -
> > -       arm_arch_reset = tegra_assert_system_reset;
> > +       tegra_clk_init_from_table(tegra20_clk_init_table);
> > +       tegra_init_cache(0x331, 0x441);
> > +       tegra_setup_system_reset();
> 
> It seems likely that there will be multiple init functions that need
> to be called from init_early on both tegra20 and tegra30.  Maybe add a
> common function that only calls tegra_setup_system_reset() for now?
> 

Ok. Will do that.

Cheers,

Peter.

  reply	other threads:[~2011-11-03  9:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-02 14:08 [PATCH v2 0/8] Add support for tegra30 and cardhu Peter De Schrijver
2011-11-02 14:09 ` [PATCH v2 1/8] arm/tegra: initial device tree for tegra30 Peter De Schrijver
2011-11-04 20:29   ` Stephen Warren
2011-11-02 14:09 ` [PATCH v2 2/8] arm/tegra: prepare early init for multiple tegra variants Peter De Schrijver
2011-11-02 18:30   ` Colin Cross
2011-11-03  9:21     ` Peter De Schrijver [this message]
2011-11-03 10:02       ` Russell King - ARM Linux
2011-11-04 15:09         ` Olof Johansson
2011-11-04 16:30           ` Russell King - ARM Linux
2011-11-07 12:36       ` Peter De Schrijver
2011-11-02 14:09 ` [PATCH v2 3/8] arm/tegra: rename tegra20 pinmux files Peter De Schrijver
2011-11-02 14:09 ` [PATCH v2 4/8] arm/tegra: prepare pinmux code for multiple tegra variants Peter De Schrijver
2011-11-04 20:35   ` Stephen Warren
2011-11-02 14:09 ` [PATCH v2 5/8] arm/tegra: add new fields to struct tegra_pingroup_desc Peter De Schrijver
2011-11-04 21:06   ` Olof Johansson
2011-11-02 14:09 ` [PATCH v2 6/8] arm/tegra: pinmux tables and definitions for tegra30 Peter De Schrijver
2011-11-02 14:09 ` [PATCH v2 7/8] arm/tegra: implement support " Peter De Schrijver
2011-11-04 20:43   ` Stephen Warren
2011-11-07 12:47     ` Peter De Schrijver
2011-11-02 14:09 ` [PATCH v2 8/8] arm/tegra: add support for tegra30 based board cardhu Peter De Schrijver
2011-11-02 15:46   ` Peter De Schrijver
2011-11-02 16:07     ` Stephen Warren
2011-11-02 16:19       ` Peter De Schrijver
2011-11-02 16:24         ` Peter De Schrijver

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=20111103092116.GO13358@tbergstrom-lnx.Nvidia.com \
    --to=pdeschrijver@nvidia.com \
    --cc=ccross@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    --cc=swarren@nvidia.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

all inboxes | Powered by JetHome®