All of lore.kernel.org
 help / color / mirror / Atom feed
From: bs14@csr.com (Barry Song)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ARM: CSR: initilized L2 cache
Date: Wed, 6 Jul 2011 02:47:58 -0700	[thread overview]
Message-ID: <1309945678-18813-4-git-send-email-bs14@csr.com> (raw)
In-Reply-To: <1309945678-18813-1-git-send-email-bs14@csr.com>

From: Rongjun Ying <rongjun.ying@csr.com>

Signed-off-by: Rongjun Ying <rongjun.ying@csr.com>
Signed-off-by: Barry Song <bs14@csr.com>
---
 arch/arm/mach-prima2/Makefile |    1 +
 arch/arm/mach-prima2/l2x0.c   |   59 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-prima2/l2x0.c

diff --git a/arch/arm/mach-prima2/Makefile b/arch/arm/mach-prima2/Makefile
index f2fba66..7af7fc0 100644
--- a/arch/arm/mach-prima2/Makefile
+++ b/arch/arm/mach-prima2/Makefile
@@ -4,3 +4,4 @@ obj-y += clock.o
 obj-y += rstc.o
 obj-y += prima2.o
 obj-$(CONFIG_DEBUG_LL) += lluart.o
+obj-$(CONFIG_CACHE_L2X0) += l2x0.o
diff --git a/arch/arm/mach-prima2/l2x0.c b/arch/arm/mach-prima2/l2x0.c
new file mode 100644
index 0000000..9cda205
--- /dev/null
+++ b/arch/arm/mach-prima2/l2x0.c
@@ -0,0 +1,59 @@
+/*
+ * l2 cache initialization for CSR SiRFprimaII
+ *
+ * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/errno.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <asm/hardware/cache-l2x0.h>
+#include <mach/memory.h>
+
+#define L2X0_ADDR_FILTERING_START       0xC00
+#define L2X0_ADDR_FILTERING_END         0xC04
+
+static struct of_device_id l2x_ids[]  = {
+	{ .compatible = "arm,pl310-cache" },
+};
+
+static int __init sirfsoc_of_l2x_init(void)
+{
+	struct device_node *np;
+	void __iomem *sirfsoc_l2x_base;
+
+	np = of_find_matching_node(NULL, l2x_ids);
+	if (!np)
+		panic("unable to find compatible l2x node in dtb\n");
+
+	sirfsoc_l2x_base = of_iomap(np, 0);
+	if (!sirfsoc_l2x_base)
+		panic("unable to map l2x cpu registers\n");
+
+	of_node_put(np);
+
+	if (!(readl_relaxed(sirfsoc_l2x_base + L2X0_CTRL) & 1)) {
+		/*
+		 * set the physical memory windows L2 cache will cover
+		 */
+		writel_relaxed(PLAT_PHYS_OFFSET + 1024 * 1024 * 1024,
+			sirfsoc_l2x_base + L2X0_ADDR_FILTERING_END);
+		writel_relaxed(PLAT_PHYS_OFFSET | 0x1,
+			sirfsoc_l2x_base + L2X0_ADDR_FILTERING_START);
+
+		writel_relaxed(0,
+			sirfsoc_l2x_base + L2X0_TAG_LATENCY_CTRL);
+		writel_relaxed(0,
+			sirfsoc_l2x_base + L2X0_DATA_LATENCY_CTRL);
+	}
+	l2x0_init((void __iomem *)sirfsoc_l2x_base, 0x00040000,
+		0x00000000);
+
+	return 0;
+}
+early_initcall(sirfsoc_of_l2x_init);
-- 
1.7.1



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

  parent reply	other threads:[~2011-07-06  9:47 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-06  9:47 [PATCH 0/3] ARM: CSR: Adding CSR SiRFprimaII platform Barry Song
2011-07-06  9:47 ` [PATCH 1/3] ARM: CSR: Adding CSR SiRFprimaII board support Barry Song
2011-07-06 11:04   ` Russell King - ARM Linux
2011-07-06 15:16     ` Barry Song
     [not found]   ` <1309945678-18813-2-git-send-email-bs14-kQvG35nSl+M@public.gmane.org>
2011-07-06 11:41     ` Arnd Bergmann
2011-07-06 11:41       ` Arnd Bergmann
     [not found]       ` <201107061341.38591.arnd-r2nGTMty4D4@public.gmane.org>
2011-07-06 12:22         ` Barry Song
2011-07-06 12:22           ` Barry Song
     [not found]           ` <CAGsJ_4zzrsKZRR4KCaeFGL9iT5OfMdhKjJE1wG3CGh8M2U4-UQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06 13:44             ` Arnd Bergmann
2011-07-06 13:44               ` Arnd Bergmann
     [not found]               ` <201107061544.20859.arnd-r2nGTMty4D4@public.gmane.org>
2011-07-07  2:26                 ` Barry Song
2011-07-07  2:26                   ` Barry Song
2011-07-06 12:25   ` Russell King - ARM Linux
2011-07-06 12:42     ` Arnd Bergmann
2011-07-06 13:09       ` Russell King - ARM Linux
2011-07-06 14:41         ` Arnd Bergmann
2011-07-06 15:25           ` Russell King - ARM Linux
2011-07-06 16:13             ` Arnd Bergmann
2011-07-06 13:29       ` Russell King - ARM Linux
2011-07-06 14:51       ` Russell King - ARM Linux
2011-07-06 15:03         ` Arnd Bergmann
2011-07-06 16:35       ` Nicolas Pitre
2011-07-06 17:42         ` Russell King - ARM Linux
2011-07-06 17:59           ` Arnd Bergmann
2011-07-06 18:11             ` Nicolas Pitre
2011-07-06 18:15               ` Russell King - ARM Linux
2011-07-06 18:35                 ` Nicolas Pitre
2011-07-06 18:09           ` Nicolas Pitre
2011-07-07 11:23         ` Arnd Bergmann
2011-07-06 16:09     ` Barry Song
2011-07-06 19:10       ` Russell King - ARM Linux
2011-07-06 20:31         ` Arnd Bergmann
2011-07-06 20:50           ` Russell King - ARM Linux
2011-07-06 21:21             ` Arnd Bergmann
2011-07-07  1:20           ` Barry Song
2011-07-07 11:43             ` Arnd Bergmann
2011-07-07 12:37               ` Russell King - ARM Linux
2011-07-07 13:21                 ` Arnd Bergmann
2011-07-07 14:12                   ` Russell King - ARM Linux
2011-07-08  2:18                     ` Barry Song
2011-07-08  9:03                       ` Russell King - ARM Linux
2011-07-08 13:38                         ` Nicolas Pitre
2011-07-08 16:27                           ` Russell King - ARM Linux
2011-07-08 18:09                             ` Nicolas Pitre
2011-07-08 21:37                               ` Arnd Bergmann
2011-07-21  0:03                                 ` dynamic VMALLOC_END, was " Nicolas Pitre
2011-07-06  9:47 ` [PATCH 2/3] ARM: CSR: mapping early DEBUG_LL uart Barry Song
2011-07-06 11:05   ` Russell King - ARM Linux
2011-07-06 11:53     ` Barry Song
2011-07-06 11:56       ` Barry Song
2011-07-06 12:10       ` Russell King - ARM Linux
2011-07-06 12:29         ` Barry Song
2011-07-06 11:15   ` Arnd Bergmann
2011-07-06  9:47 ` Barry Song [this message]
2011-07-06 11:14   ` [PATCH 3/3] ARM: CSR: initilized L2 cache Arnd Bergmann

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=1309945678-18813-4-git-send-email-bs14@csr.com \
    --to=bs14@csr.com \
    --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.