]> err.no Git - linux-2.6/commitdiff
[POWERPC] 4xx: Introduce cpu_setup functionality to 44x platform
authorValentine Barshak <vbarshak@ru.mvista.com>
Fri, 21 Sep 2007 14:44:38 +0000 (00:44 +1000)
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>
Wed, 3 Oct 2007 12:20:17 +0000 (07:20 -0500)
This adds cpu_setup functionality for ppc44x platform.
Low level cpu-spefic initialization routines should be
placed in cpu_setup_44x.S and a callback should be
added to cputable. The cpu_setup is invoked
by identify_cpu() function at early init.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/cpu_setup_44x.S [new file with mode: 0644]
arch/powerpc/kernel/cputable.c

index fb33a7e719417b85bd00303504d1b52e45427e52..f1dd90439efcf334fa0cc7c751fcb0f51edff028 100644 (file)
@@ -58,6 +58,7 @@ obj-y                         += time.o prom.o traps.o setup-common.o \
                                   misc_$(CONFIG_WORD_SIZE).o
 obj-$(CONFIG_PPC32)            += entry_32.o setup_32.o
 obj-$(CONFIG_PPC64)            += dma_64.o iommu.o
+obj-$(CONFIG_44x)              += cpu_setup_44x.o
 obj-$(CONFIG_PPC_MULTIPLATFORM)        += prom_init.o
 obj-$(CONFIG_MODULES)          += ppc_ksyms.o
 obj-$(CONFIG_BOOTX_TEXT)       += btext.o
diff --git a/arch/powerpc/kernel/cpu_setup_44x.S b/arch/powerpc/kernel/cpu_setup_44x.S
new file mode 100644 (file)
index 0000000..6a6e6c7
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * This file contains low level CPU setup functions.
+ * Valentine Barshak <vbarshak@ru.mvista.com>
+ * MontaVista Software, Inc (c) 2007
+ *
+ * Based on cpu_setup_6xx code by 
+ * Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <asm/processor.h>
+#include <asm/cputable.h>
+#include <asm/ppc_asm.h>
+
index 8eb8087383eba030ccf1078be0dc3a88cc6daffb..8711499f5a0283ebeef2230f5c37e2b1544be70b 100644 (file)
@@ -1319,17 +1319,18 @@ struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
        for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
                if ((pvr & s->pvr_mask) == s->pvr_value) {
                        *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.
+#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
+                       /* ppc64 and booke expect identify_cpu to also call 
+                        * setup_cpu for that processor. I will consolidate
+                        * that at a later time, for now, just use #ifdef.
                         * we also don't need to PTRRELOC the function pointer
-                        * on ppc64 as we are running at 0 in real mode.
+                        * on ppc64 and booke as we are running at 0 in real
+                        * mode on ppc64 and reloc_offset is always 0 on booke.
                         */
                        if (s->cpu_setup) {
                                s->cpu_setup(offset, s);
                        }
-#endif /* CONFIG_PPC64 */
+#endif /* CONFIG_PPC64 || CONFIG_BOOKE */
                        return s;
                }
        BUG();