L2 cache via L2X0 cache controller available on some ARM boards can
provide a performance boost in some situations but decrease performance
in others.  This adds a kernel cmdline to disable L2X0 for the Laguna
product family.

Signed-off-by: Tim Harvey <[email protected]>
---
 .../patches-3.3/480-laguna_l2cache_cmdline.patch   |   29 ++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 
target/linux/cns3xxx/patches-3.3/480-laguna_l2cache_cmdline.patch

Re-worked patch upon request to not require an OpenWrt kernel config but
instead add a kernel cmdline option to allow disabling of l2x0 for Laguna

diff --git a/target/linux/cns3xxx/patches-3.3/480-laguna_l2cache_cmdline.patch 
b/target/linux/cns3xxx/patches-3.3/480-laguna_l2cache_cmdline.patch
new file mode 100644
index 0000000..c8d9b9d
--- /dev/null
+++ b/target/linux/cns3xxx/patches-3.3/480-laguna_l2cache_cmdline.patch
@@ -0,0 +1,29 @@
+--- a/arch/arm/mach-cns3xxx/laguna.c
++++ b/arch/arm/mach-cns3xxx/laguna.c
+@@ -104,6 +104,16 @@ struct laguna_board_info {
+ 
+ static struct laguna_board_info laguna_info __initdata;
+ 
++static int l2x0_enable = 1;
++
++static int __init l2x0_disable(char *s)
++{
++      l2x0_enable = 0;
++      return 1;
++}
++__setup ("nol2x0", l2x0_disable);
++
++
+ /*
+  * NOR Flash
+  */
+@@ -693,7 +703,8 @@ static struct gpio laguna_gpio_gw2380[]
+  */
+ static void __init laguna_init(void)
+ {
+-      cns3xxx_l2x0_init();
++      if (l2x0_enable)
++              cns3xxx_l2x0_init();
+ 
+       platform_device_register(&laguna_watchdog);
+ 
-- 
1.7.5.4

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to