aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDirk Behme <dirk.behme@de.bosch.com>2013-04-26 04:13:56 -0400
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:00:37 -0400
commit51f93c2d8352a93e82b4934aab602e0826a50bef (patch)
treecacdd4cde2550af4ccb81cbaa663331453bac337 /arch
parent826edf62da96ea813656708cdb0e3cb4be453618 (diff)
ARM: i.MX6: add i.MX6 specific L2 cache configuration
Commit b3a9c315378ff811bf34393f2f0a6e8b9ffced3b upstream. To improve the performance and power consumption add an i.MX6 specific L2 cache initialization. This configuration is taken from Freescale's kernel patch "ENGR00153601 [MX6]Adjust L2 cache parameter" [1] with two additional improvements: a) The L2X0_POWER_CTRL has only the two bits we set. So no need to read the register before. Remove the register read done in Freescale's patch. b) In the L2X0_PREFETCH_CTRL register, besides the double linefill (bit[30]), additionally enable the instruction and data prefetch (bit[29-28]). Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Shawn Guo <shawn.guo@freescale.com> [1] http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/commit/arch/arm/mach-mx6/mm.c?h=imx_3.0.35_12.09.01&id=814656410b40c67a10b25300e51b0477b2bb96d1
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 6421e728f4b4..5ab972567ef6 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -257,10 +257,44 @@ static void __init imx6q_map_io(void)
257 imx_scu_map_io(); 257 imx_scu_map_io();
258} 258}
259 259
260#ifdef CONFIG_CACHE_L2X0
261static void __init imx6q_init_l2cache(void)
262{
263 void __iomem *l2x0_base;
264 struct device_node *np;
265 unsigned int val;
266
267 np = of_find_compatible_node(NULL, NULL, "arm,pl310-cache");
268 if (!np)
269 goto out;
270
271 l2x0_base = of_iomap(np, 0);
272 if (!l2x0_base) {
273 of_node_put(np);
274 goto out;
275 }
276
277 /* Configure the L2 PREFETCH and POWER registers */
278 val = readl_relaxed(l2x0_base + L2X0_PREFETCH_CTRL);
279 val |= 0x70800000;
280 writel_relaxed(val, l2x0_base + L2X0_PREFETCH_CTRL);
281 val = L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN;
282 writel_relaxed(val, l2x0_base + L2X0_POWER_CTRL);
283
284 iounmap(l2x0_base);
285 of_node_put(np);
286
287out:
288 l2x0_of_init(0, ~0UL);
289}
290#else
291static inline void imx6q_init_l2cache(void) {}
292#endif
293
260static void __init imx6q_init_irq(void) 294static void __init imx6q_init_irq(void)
261{ 295{
262 imx6q_init_revision(); 296 imx6q_init_revision();
263 l2x0_of_init(0, ~0UL); 297 imx6q_init_l2cache();
264 imx_src_init(); 298 imx_src_init();
265 imx_gpc_init(); 299 imx_gpc_init();
266 irqchip_init(); 300 irqchip_init();