summaryrefslogtreecommitdiffstats
path: root/patches/u-boot-2011.09/0008-HACK-am335x-evm-turn-d-cache-on-globally-turn-it-off.patch
blob: b79a8844b6600ce30882217f9de4c8bd6a987227 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 31d430d8db335b7c3fea08b6aa8309b90b8f2cb9 Mon Sep 17 00:00:00 2001
From: Tom Rini <trini@ti.com>
Date: Tue, 8 Nov 2011 08:07:47 +0100
Subject: [PATCH 8/8] HACK: am335x evm: turn d-cache on globally, turn it off when doing nfs stuff

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 board/ti/am335x/evm.c        |   12 ++++++++++++
 include/configs/am335x_evm.h |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/board/ti/am335x/evm.c b/board/ti/am335x/evm.c
index bc1119e..e64626a 100644
--- a/board/ti/am335x/evm.c
+++ b/board/ti/am335x/evm.c
@@ -1041,3 +1041,15 @@ U_BOOT_CMD(
 
 #endif /* CONFIG_NAND_TI81XX */
 #endif /* CONFIG_SPL_BUILD */
+
+/*
+ * Not all drivers we use (such as ethernet) are dcache safe.  But
+ * we need cache on to boot quickly enough.
+ */
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+	/* Enable D-cache. I-cache is already enabled in start.S */
+	dcache_enable();
+}
+#endif
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 8bf3ff1..58fa2f6 100755
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -119,6 +119,7 @@
 		"bootm ${loadaddr}\0" \
 	"net_boot=echo Booting from network ...; " \
 		"setenv autoload no; " \
+		"dcache off; " \
 		"dhcp; " \
 		"tftp ${loadaddr} ${bootfile}; " \
 		"run net_args; " \
-- 
1.7.2.5