All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Andy Pugh <andy@bodgesoc.org>
Cc: xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] Fwd: Kernel Compilation Problems
Date: Sat, 01 Feb 2014 14:39:30 +0100	[thread overview]
Message-ID: <52ECF912.10308@xenomai.org> (raw)
In-Reply-To: <CAN1+YZVq7cwFnUX=bkJs8MbAkpio3azSvev2fmZwqQpgjTnvfg@mail.gmail.com>

On 01/31/2014 11:58 PM, Andy Pugh wrote:
> On 31 January 2014 21:07, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
> 
>> Ok, I am still interested by your kernel logs though, to see whether we
>> can improve the latencies by using the cache auxiliary configuration
>> register.
> 
> Is this what you need, or do you need Xenomai actually active?
> 
> http://pastebin.com/PSKwQH3A

Could you try and apply the following patch?

When you are booted, try dmesg | grep AUX_CTRL, then run a latency test
and see if latency has improved?

Regards.

diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index bfa706ff..bd3c8ce 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -61,7 +61,7 @@
 #define L2X0_CACHE_ID_PART_L210		(1 << 6)
 #define L2X0_CACHE_ID_PART_L310		(3 << 6)
 
-#define L2X0_AUX_CTRL_MASK			0xc0000fff
+#define L2X0_AUX_CTRL_MASK			0xc00007ff
 #define L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT	16
 #define L2X0_AUX_CTRL_WAY_SIZE_SHIFT		17
 #define L2X0_AUX_CTRL_WAY_SIZE_MASK		(0x7 << 17)
diff --git a/arch/arm/mach-mx6/mm.c b/arch/arm/mach-mx6/mm.c
index 3cf6b22..cec64b6 100644
--- a/arch/arm/mach-mx6/mm.c
+++ b/arch/arm/mach-mx6/mm.c
@@ -97,7 +97,7 @@ void __init mx6_map_io(void)
 #ifdef CONFIG_CACHE_L2X0
 int mxc_init_l2x0(void)
 {
-	unsigned int val;
+	unsigned int val, aux_ctrl;
 
 	#define IOMUXC_GPR11_L2CACHE_AS_OCRAM 0x00000002
 
@@ -114,12 +114,34 @@ int mxc_init_l2x0(void)
 	val = readl(IO_ADDRESS(L2_BASE_ADDR + L2X0_PREFETCH_CTRL));
 	val |= 0x40800000;
 	writel(val, IO_ADDRESS(L2_BASE_ADDR + L2X0_PREFETCH_CTRL));
+#ifndef CONFIG_IPIPE
 	val = readl(IO_ADDRESS(L2_BASE_ADDR + L2X0_POWER_CTRL));
 	val |= L2X0_DYNAMIC_CLK_GATING_EN;
 	val |= L2X0_STNDBY_MODE_EN;
 	writel(val, IO_ADDRESS(L2_BASE_ADDR + L2X0_POWER_CTRL));
+#endif
+
+	aux_ctrl = ((1 << L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT) |
+		(0x1 << L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT) |
+		(0x1 << L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT) |
+		(1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) |
+		(1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) |
+		(1 << L2X0_AUX_CTRL_EARLY_BRESP_SHIFT) |
+		(1 << 11));
+
+	l2x0_init(IO_ADDRESS(L2_BASE_ADDR), aux_ctrl, L2X0_AUX_CTRL_MASK);
+
+#ifdef CONFIG_IPIPE
+	writel_relaxed(0xEEEE, l2x0_base + 0x900);
+	writel_relaxed(0xEEEE, l2x0_base + 0x904);	
+	writel_relaxed(0xDDDD, l2x0_base + 0x908);
+	writel_relaxed(0xDDDD, l2x0_base + 0x90C);	
+	writel_relaxed(0xBBBB, l2x0_base + 0x910);
+	writel_relaxed(0xBBBB, l2x0_base + 0x914);	
+	writel_relaxed(0x7777, l2x0_base + 0x918);
+	writel_relaxed(0x7777, l2x0_base + 0x91C);	
+#endif
 
-	l2x0_init(IO_ADDRESS(L2_BASE_ADDR), 0x0, ~0x00000000);
 	return 0;
 }
 
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 1e2c52d..27550b3 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -421,6 +421,9 @@ void l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)
 		writel_relaxed(1, l2x0_base + L2X0_CTRL);
 	}
 
+	/* Re-read it in case some bits are reserved. */
+	aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
+
 	outer_cache.inv_range = l2x0_inv_range;
 	outer_cache.clean_range = l2x0_clean_range;
 	outer_cache.flush_range = l2x0_flush_range;



-- 
                                                                Gilles.


  parent reply	other threads:[~2014-02-01 13:39 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAN1+YZVvgPNNHFub5QAkw6SeSUPuf1dv_94kYGqhbjMpNt70Sg@mail.gmail.com>
2014-01-16 15:41 ` [Xenomai] Fwd: Kernel Compilation Problems Andy Pugh
2014-01-16 22:43   ` Gilles Chanteperdrix
2014-01-16 23:17     ` Andy Pugh
2014-01-17 20:44       ` Andy Pugh
2014-01-17 20:53         ` Gilles Chanteperdrix
2014-01-18 19:49           ` Andy Pugh
2014-01-18 20:43             ` Gilles Chanteperdrix
2014-01-18 22:31               ` Andy Pugh
2014-01-18 23:24                 ` Gilles Chanteperdrix
2014-01-18 23:48                   ` Andy Pugh
2014-01-19  0:27                     ` Paul
2014-01-19 12:33                 ` Gilles Chanteperdrix
2014-01-19 13:42                   ` Gilles Chanteperdrix
2014-01-31  0:05                     ` Andy Pugh
2014-01-31  9:24                       ` Gilles Chanteperdrix
2014-01-31 17:48                         ` Andy Pugh
2014-01-31 18:00                           ` Gilles Chanteperdrix
2014-01-31 20:15                             ` Andy Pugh
2014-01-31 20:19                               ` Gilles Chanteperdrix
2014-01-31 21:03                                 ` Andy Pugh
2014-01-31 21:07                                   ` Gilles Chanteperdrix
2014-01-31 22:58                                     ` Andy Pugh
2014-02-01 12:17                                       ` Gilles Chanteperdrix
2014-02-01 13:39                                       ` Gilles Chanteperdrix [this message]
2014-02-01 13:49                                         ` Gilles Chanteperdrix
2014-02-02 21:53                                           ` Andy Pugh
2014-02-02 21:59                                             ` Gilles Chanteperdrix
2014-02-02 22:44                                               ` Gilles Chanteperdrix
2014-02-03  0:25                                                 ` Andy Pugh
2014-02-03 11:25                                                   ` Gilles Chanteperdrix
2014-02-04 21:38                                                   ` Gilles Chanteperdrix
2014-02-04 23:24                                                     ` Andy Pugh
2014-01-31 20:21                               ` Gilles Chanteperdrix
2014-01-31 20:46                                 ` Lennart Sorensen
2014-01-31 20:49                                   ` Gilles Chanteperdrix
2014-01-20 17:45                   ` Andy Pugh

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=52ECF912.10308@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=andy@bodgesoc.org \
    --cc=xenomai@xenomai.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.