summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/timex.h
diff options
context:
space:
mode:
authorLEROY Christophe <christophe.leroy@c-s.fr>2013-11-22 17:57:31 +0100
committerScott Wood <scottwood@freescale.com>2013-11-22 23:56:48 +0100
commitae2163be10ac6090e7aeed72591e2d7fabb1cdda (patch)
tree1f6f4ba3beb2358c53bb951e3002c83de824163d /arch/powerpc/include/asm/timex.h
parentpowerpc/corenet64: compile with CONFIG_E{5,6}500_CPU well (diff)
downloadlinux-ae2163be10ac6090e7aeed72591e2d7fabb1cdda.tar.xz
linux-ae2163be10ac6090e7aeed72591e2d7fabb1cdda.zip
powerpc/8xx: mfspr SPRN_TBRx in lieu of mftb/mftbu is not supported
Commit beb2dc0a7a84be003ce54e98b95d65cc66e6e536 breaks the MPC8xx which seems to not support using mfspr SPRN_TBRx instead of mftb/mftbu despite what is written in the reference manual. This patch reverts to the use of mftb/mftbu when CONFIG_8xx is selected. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/include/asm/timex.h')
-rw-r--r--arch/powerpc/include/asm/timex.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/timex.h b/arch/powerpc/include/asm/timex.h
index 18908caa1f3b..2cf846edb3fc 100644
--- a/arch/powerpc/include/asm/timex.h
+++ b/arch/powerpc/include/asm/timex.h
@@ -29,7 +29,11 @@ static inline cycles_t get_cycles(void)
ret = 0;
__asm__ __volatile__(
+#ifdef CONFIG_8xx
+ "97: mftb %0\n"
+#else
"97: mfspr %0, %2\n"
+#endif
"99:\n"
".section __ftr_fixup,\"a\"\n"
".align 2\n"
@@ -41,7 +45,11 @@ static inline cycles_t get_cycles(void)
" .long 0\n"
" .long 0\n"
".previous"
+#ifdef CONFIG_8xx
+ : "=r" (ret) : "i" (CPU_FTR_601));
+#else
: "=r" (ret) : "i" (CPU_FTR_601), "i" (SPRN_TBRL));
+#endif
return ret;
#endif
}