Subject: [patch 27/35] Work around errata 4290

From: Olof Johansson <[email-masked]>
Date: Thu, 05 Jul 2007 12:03:00 -0500

Workaround for errata 4290: The decrementer ticks at half the expected rate
so load it with half the value it would otherwise be loaded with.

Index: 2.6.21/include/asm-powerpc/time.h
===================================================================
--- 2.6.21.orig/include/asm-powerpc/time.h
+++ 2.6.21/include/asm-powerpc/time.h
@@ -173,6 +173,13 @@ static inline unsigned int get_dec(void)
 
 static inline void set_dec(int val)
 {
+#ifdef CONFIG_PPC_PASEMI
+	/* PA6T rev Ax have decrementer ticking at 1/2 tb rate */
+	val >>= 2;
+	if (!val)
+		val = 1;
+#endif
+
 #if defined(CONFIG_40x)
 	return;		/* Have to let it auto-reload */
 #elif defined(CONFIG_8xx_CPU6)

--