linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: at91: sama5d4: Properly configure L2CC
@ 2015-03-04 11:29 Alexandre Belloni
  2015-03-09 17:23 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Belloni @ 2015-03-04 11:29 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Jean-Christophe Plagniol-Villard, Wenyou Yang, linux-arm-kernel,
	linux-kernel, Boris Brezillon, Alexandre Belloni

As the bootloader may not properly configure the L2CC, enforce its configuration
in the kernel.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/boot/dts/sama5d4.dtsi | 4 ++++
 arch/arm/mach-at91/sama5.c     | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi
index 07953f279a56..8998f14dda04 100644
--- a/arch/arm/boot/dts/sama5d4.dtsi
+++ b/arch/arm/boot/dts/sama5d4.dtsi
@@ -270,6 +270,10 @@
 			interrupts = <67 IRQ_TYPE_LEVEL_HIGH 4>;
 			cache-unified;
 			cache-level = <2>;
+			arm,double-linefill = <1>;
+			arm,double-linefill-incr = <1>;
+			arm,prefetch-drop = <1>;
+			arm,prefetch-offset = <1>;
 		};
 
 		nand0: nand@80000000 {
diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c
index 03dcb441f3d2..a3df9328daa9 100644
--- a/arch/arm/mach-at91/sama5.c
+++ b/arch/arm/mach-at91/sama5.c
@@ -22,6 +22,7 @@
 #include <mach/hardware.h>
 
 #include <asm/setup.h>
+#include <asm/hardware/cache-l2x0.h>
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -107,5 +108,7 @@ DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5")
 	.map_io		= sama5_alt_map_io,
 	.init_machine	= sama5_dt_device_init,
 	.dt_compat	= sama5_alt_dt_board_compat,
+	.l2c_aux_val	= L310_AUX_CTRL_DATA_PREFETCH |
+		L310_AUX_CTRL_INSTR_PREFETCH,
 	.l2c_aux_mask	= ~0UL,
 MACHINE_END
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: at91: sama5d4: Properly configure L2CC
  2015-03-04 11:29 [PATCH] ARM: at91: sama5d4: Properly configure L2CC Alexandre Belloni
@ 2015-03-09 17:23 ` Russell King - ARM Linux
  2015-03-09 18:33   ` Alexandre Belloni
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2015-03-09 17:23 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Nicolas Ferre, Boris Brezillon, linux-kernel, Wenyou Yang,
	Jean-Christophe Plagniol-Villard, linux-arm-kernel

On Wed, Mar 04, 2015 at 12:29:23PM +0100, Alexandre Belloni wrote:
> As the bootloader may not properly configure the L2CC, enforce its configuration
> in the kernel.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

And I assume you never bothered to read the kernel messages which result
from this?  I guess this means I need to ensure that the kernel freezes
if you do this kind of thing so you can't ignore the complaints from
the L2C code.

It would be much better if you configured the L2C in the boot loader/
board firmware rather than trying to have the kernel do it.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ARM: at91: sama5d4: Properly configure L2CC
  2015-03-09 17:23 ` Russell King - ARM Linux
@ 2015-03-09 18:33   ` Alexandre Belloni
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2015-03-09 18:33 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Nicolas Ferre, Boris Brezillon, linux-kernel, Wenyou Yang,
	Jean-Christophe Plagniol-Villard, linux-arm-kernel

On 09/03/2015 at 17:23:37 +0000, Russell King - ARM Linux wrote :
> On Wed, Mar 04, 2015 at 12:29:23PM +0100, Alexandre Belloni wrote:
> > As the bootloader may not properly configure the L2CC, enforce its configuration
> > in the kernel.
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> 
> And I assume you never bothered to read the kernel messages which result
> from this?  I guess this means I need to ensure that the kernel freezes
> if you do this kind of thing so you can't ignore the complaints from
> the L2C code.
> 
> It would be much better if you configured the L2C in the boot loader/
> board firmware rather than trying to have the kernel do it.
> 

As I understand, there is no proper way to enable prefetch from the
kernel so if it is not done by the bootloader or firmware (and it is
not), then we are out of luck.

Or is there something done right on berlin and exynos that I'm not doing
here?


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-09 18:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04 11:29 [PATCH] ARM: at91: sama5d4: Properly configure L2CC Alexandre Belloni
2015-03-09 17:23 ` Russell King - ARM Linux
2015-03-09 18:33   ` Alexandre Belloni

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).