All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sanchayan Maity <maitysanchayan@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/6] ARM: vf610: Enable caches
Date: Wed,  8 Apr 2015 18:50:08 +0530	[thread overview]
Message-ID: <8c0da8394309a2df54b1bc187751c38ef4205551.1428497492.git.maitysanchayan@gmail.com> (raw)
In-Reply-To: <cover.1428497492.git.maitysanchayan@gmail.com>

From: Stefan Agner <stefan@agner.ch>

Enables caches which provides a rather huge speedup of the boot loader.
Also mark the on-chip RAM as cachable since this is the area U-Boot runs
from.

Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
---
 arch/arm/cpu/armv7/vf610/generic.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/cpu/armv7/vf610/generic.c b/arch/arm/cpu/armv7/vf610/generic.c
index 3bdc221..1bb9b8e 100644
--- a/arch/arm/cpu/armv7/vf610/generic.c
+++ b/arch/arm/cpu/armv7/vf610/generic.c
@@ -342,3 +342,19 @@ int get_clocks(void)
 #endif
 	return 0;
 }
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+#if defined(CONFIG_SYS_ARM_CACHE_WRITETHROUGH)
+	enum dcache_option option = DCACHE_WRITETHROUGH;
+#else
+	enum dcache_option option = DCACHE_WRITEBACK;
+#endif
+	dcache_enable();
+	icache_enable();
+
+    /* Enable caching on OCRAM */
+	mmu_set_region_dcache_behaviour(IRAM_BASE_ADDR, IRAM_SIZE, option);
+}
+#endif
-- 
2.3.5

  parent reply	other threads:[~2015-04-08 13:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 13:20 [U-Boot] [PATCH v2 0/6] Add support for Colibri Vybrid Modules Sanchayan Maity
2015-04-08 13:20 ` [U-Boot] [PATCH v2 1/6] ARM: vf610: Move DDR3 initialization to imx-common Sanchayan Maity
2015-04-08 13:20 ` [U-Boot] [PATCH v2 2/6] ARM: vf610: Enable external 32KHz oscillator Sanchayan Maity
2015-04-08 13:20 ` [U-Boot] [PATCH v2 3/6] ARM: vf610: Add SoC and CPU type detection Sanchayan Maity
2015-04-08 13:20 ` Sanchayan Maity [this message]
2015-04-08 13:20 ` [U-Boot] [PATCH v2 5/6] usb: host: Add ehci-vf USB driver for ARM Vybrid SoC's Sanchayan Maity
2015-04-12 23:29   ` Marek Vasut
2015-04-13  5:37     ` maitysanchayan at gmail.com
2015-04-13  5:49       ` Marek Vasut
2015-04-08 13:20 ` [U-Boot] [PATCH v2 6/6] ARM: vf610: Initial integration for Colibri VF50/VF61 Sanchayan Maity
2015-04-11 16:46 ` [U-Boot] [PATCH v2 0/6] Add support for Colibri Vybrid Modules Marek Vasut
2015-04-12  5:33   ` maitysanchayan at gmail.com
2015-04-12 23:28     ` Marek Vasut
2015-04-13  1:36       ` Fabio Estevam
2015-04-13  3:41         ` Marek Vasut
2015-04-13  6:21       ` maitysanchayan at gmail.com
2015-04-13  8:44         ` Marek Vasut
2015-04-13  8:50           ` Peter Chen
2015-04-13  8:52             ` Marek Vasut
2015-04-14  9:06               ` Peter Chen
2015-04-14 10:18                 ` maitysanchayan at gmail.com
2015-04-15  5:41                   ` Marek Vasut

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=8c0da8394309a2df54b1bc187751c38ef4205551.1428497492.git.maitysanchayan@gmail.com \
    --to=maitysanchayan@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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.