Patchwork [U-Boot,v2] tegra2: Enable data cache

login
register
mail settings
Submitter Simon Glass
Date Sept. 21, 2011, 9:24 p.m.
Message ID <1316640261-5152-1-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/115858/
State New, archived
Headers show

Comments

Simon Glass - Sept. 21, 2011, 9:24 p.m.
This enables the data cache on Tegra2 boards.

As discussed on the list, this is better off in the Tegra2 cpu code than in a
particular vendor directory. We should be safe turning on the cache for all
Tegra2 boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Enable caches for all Tegra2 boards instead of just Nvidia ones

 arch/arm/cpu/armv7/tegra2/board.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Patch

diff --git a/arch/arm/cpu/armv7/tegra2/board.c b/arch/arm/cpu/armv7/tegra2/board.c
index 9061d18..a996b88 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -86,3 +86,11 @@  int checkboard(void)
 	return 0;
 }
 #endif	/* CONFIG_DISPLAY_BOARDINFO */
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+	/* Enable D-cache. I-cache is already enabled in start.S */
+	dcache_enable();
+}
+#endif