From ea638951acead7f1086c908c0b9f086beab82a22 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sat, 3 May 2008 13:51:28 +0900 Subject: [PATCH 1/2] [MIPS] cpu/mips/cache.S: Add dcache_enable Recent bootelf command fixes (017e9b7925f74878d0e9475388cca9bda5ef9482, "allow ports to override bootelf behavior") requires ports to have this function. Signed-off-by: Shinya Kuribayashi Acked-by: Jean-Christophe PLAGNIOL-VILLARD --- cpu/mips/cache.S | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cpu/mips/cache.S b/cpu/mips/cache.S index f593968..428d251 100644 --- a/cpu/mips/cache.S +++ b/cpu/mips/cache.S @@ -285,6 +285,22 @@ LEAF(dcache_disable) jr ra END(dcache_disable) +/******************************************************************************* +* +* dcache_enable - enable cache +* +* RETURNS: N/A +* +*/ +LEAF(dcache_enable) + mfc0 t0, CP0_CONFIG + ori t0, CONF_CM_CMASK + xori t0, CONF_CM_CMASK + ori t0, CONF_CM_CACHABLE_NONCOHERENT + mtc0 t0, CP0_CONFIG + jr ra + END(dcache_enable) + #ifdef CFG_INIT_RAM_LOCK_MIPS /******************************************************************************* * From 141ba1cad8e6598a2466e7e2976c6a12285df619 Mon Sep 17 00:00:00 2001 From: Shinya Kuribayashi Date: Sat, 3 May 2008 13:51:44 +0900 Subject: [PATCH 2/2] [MIPS] cpu/mips/config.mk: Fix GNU assembler minor version picker Current trick to pick up GNU assembler minor version uses a dot(.) as a delimiter, and take the second field to obtain minor version number. But as can be expected, this doesn't work with a version string which has dots more than needs. Here's an example: $ mips-linux-gnu-as --version | grep 'GNU assembler' GNU assembler (Sourcery G++ Lite 4.2-129) 2.18.50.20080215 $ mips-linux-gnu-as --version | grep 'GNU assembler' | cut -d. -f2 2-129) 2 $ This patch restricts the version format to 2.XX.XX... This will work in most cases. $ mips-linux-gnu-as --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' 2.18.50.20080215 $ mips-linux-gnu-as --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | cut -d. -f2 18 $ Signed-off-by: Shinya Kuribayashi --- cpu/mips/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk index b505a42..a173c54 100644 --- a/cpu/mips/config.mk +++ b/cpu/mips/config.mk @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # -v=$(shell $(AS) --version |grep "GNU assembler" |cut -d. -f2) +v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | cut -d. -f2) MIPSFLAGS:=$(shell \ if [ "$v" -lt "14" ]; then \ echo "-mcpu=4kc"; \