Devicetree
 help / color / mirror / Atom feed
From: Peter De Schrijver <pdeschrijver@nvidia.com>
To: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Russell King <linux@arm.linux.org.uk>,
	Gary King <gking@nvidia.com>,
	linux-doc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org,
	Rob Herring <rob.herring@calxeda.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	linux-tegra@vger.kernel.org, Randy Dunlap <rdunlap@xenotime.net>,
	Colin Cross <ccross@android.com>, Olof Johansson <olof@lixom.net>,
	Stephen Warren <swarren@nvidia.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 08/14] arm/tegra: generalize L2 cache initialization
Date: Wed, 14 Dec 2011 17:03:20 +0200	[thread overview]
Message-ID: <1323875032-18221-9-git-send-email-pdeschrijver@nvidia.com> (raw)
In-Reply-To: <1323875032-18221-1-git-send-email-pdeschrijver@nvidia.com>

Generalize L2 cache initialization and discover L2 cache associativity at
runtime.

Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
---
 arch/arm/mach-tegra/common.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 8da1847..554f18f 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -73,15 +73,20 @@ static __initdata struct tegra_clk_init_table tegra20_clk_init_table[] = {
 };
 #endif
 
-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, cache_type;
 
-	writel_relaxed(0x331, p + L2X0_TAG_LATENCY_CTRL);
-	writel_relaxed(0x441, p + L2X0_DATA_LATENCY_CTRL);
+	writel_relaxed(tag_latency, p + L2X0_TAG_LATENCY_CTRL);
+	writel_relaxed(data_latency, p + L2X0_DATA_LATENCY_CTRL);
 
-	l2x0_init(p, 0x6C080001, 0x8200c3fe);
+	cache_type = readl(p + L2X0_CACHE_TYPE);
+	aux_ctrl = (cache_type & 0x700) << (17-8);
+	aux_ctrl |= 0x6C000001;
+
+	l2x0_init(p, aux_ctrl, 0x8200c3fe);
 #endif
 
 }
@@ -92,6 +97,6 @@ void __init tegra20_init_early(void)
 	tegra_init_fuse();
 	tegra2_init_clocks();
 	tegra_clk_init_from_table(tegra20_clk_init_table);
-	tegra_init_cache();
+	tegra_init_cache(0x331, 0x441);
 }
 #endif
-- 
1.7.7.rc0.72.g4b5ea.dirty

  parent reply	other threads:[~2011-12-14 15:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 15:03 [PATCH v7 00/14] Add support for tegra30 and cardhu Peter De Schrijver
2011-12-14 15:03 ` [PATCH v7 01/14] arm/tegra: initial device tree for tegra30 Peter De Schrijver
2011-12-14 15:03 ` [PATCH v7 04/14] arm/tegra: don't export clk_measure_input_freq Peter De Schrijver
     [not found] ` <1323875032-18221-1-git-send-email-pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-12-14 15:03   ` [PATCH v7 02/14] arm/tegra: cleanup tegra20 support Peter De Schrijver
2011-12-14 15:03   ` [PATCH v7 03/14] arm/tegra: prepare clock code for multiple tegra variants Peter De Schrijver
2011-12-14 15:03   ` [PATCH v7 05/14] arm/tegra: prepare early init " Peter De Schrijver
2011-12-14 15:03   ` [PATCH v7 12/14] arm/tegra: pinmux tables and definitions for tegra30 Peter De Schrijver
2011-12-15 18:16   ` [PATCH v7 00/14] Add support for tegra30 and cardhu Olof Johansson
2011-12-15 22:06   ` Colin Cross
2011-12-14 15:03 ` [PATCH v7 06/14] arm/tegra: rename board-dt.c to board-dt-tegra20.c Peter De Schrijver
2011-12-14 15:03 ` [PATCH v7 07/14] arm/tegra: use PMC reset Peter De Schrijver
2011-12-14 15:03 ` Peter De Schrijver [this message]
2011-12-14 15:03 ` [PATCH v7 09/14] arm/tegra: rename tegra20 pinmux files Peter De Schrijver
2011-12-14 15:03 ` [PATCH v7 10/14] arm/tegra: prepare pinmux code for multiple tegra variants Peter De Schrijver
2011-12-14 15:03 ` [PATCH v7 11/14] arm/tegra: add new fields to struct tegra_pingroup_desc Peter De Schrijver
2011-12-14 15:03 ` [PATCH v7 13/14] arm/tegra: implement support for tegra30 Peter De Schrijver
2011-12-14 15:03 ` [PATCH v7 14/14] arm/tegra: add support for tegra30 based board cardhu Peter De Schrijver
2011-12-15 20:54 ` [PATCH v7 00/14] Add support for tegra30 and cardhu Stephen Warren
2011-12-18  4:48 ` Olof Johansson
2011-12-19 12:21   ` 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=1323875032-18221-9-git-send-email-pdeschrijver@nvidia.com \
    --to=pdeschrijver@nvidia.com \
    --cc=ccross@android.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=gking@nvidia.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    --cc=rdunlap@xenotime.net \
    --cc=rob.herring@calxeda.com \
    --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