Thread (22 messages) flat view 22 messages, 8 authors, 2007-09-24

Re: [PATCH] PowerPC: add setup_cpu for 44x for processor-specific init

From: Kumar Gala <hidden>
Date: 2007-09-20 18:54:00

quoted hunk ↗ jump to hunk
diff -ruN linux-2.6.orig/arch/powerpc/kernel/cputable.c linux-2.6/ 
arch/powerpc/kernel/cputable.c
--- linux-2.6.orig/arch/powerpc/kernel/cputable.c	2007-09-20  
19:30:47.000000000 +0400
+++ linux-2.6/arch/powerpc/kernel/cputable.c	2007-09-20  
21:27:35.000000000 +0400
[snip]
quoted hunk ↗ jump to hunk
@@ -1318,18 +1327,14 @@

 	for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
 		if ((pvr & s->pvr_mask) == s->pvr_value) {
+			cpu_setup_t setup_func  = PTRRELOC(s->cpu_setup);
+
 			*cur = cpu_specs + i;
-#ifdef CONFIG_PPC64
-			/* ppc64 expects identify_cpu to also call setup_cpu
-			 * for that processor. I will consolidate that at a
-			 * later time, for now, just use our friend #ifdef.
-			 * we also don't need to PTRRELOC the function pointer
-			 * on ppc64 as we are running at 0 in real mode.
+			/* ppc expects identify_cpu to also call setup_cpu
+			 * for that processor.
 			 */
-			if (s->cpu_setup) {
-				s->cpu_setup(offset, s);
-			}
-#endif /* CONFIG_PPC64 */
+			if (setup_func)
+				setup_func(offset, s);
 			return s;
 		}
This should just be something like:

#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
	if (s->cpu_setup)
...
#endif

we know reloc_offset is always 0 in book-e, plus fixup the comment.

- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help