aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/setup_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r--arch/powerpc/kernel/setup_64.c60
1 files changed, 28 insertions, 32 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index c4b76961d6de..e29b275e09e0 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -33,6 +33,7 @@
33#include <linux/unistd.h> 33#include <linux/unistd.h>
34#include <linux/serial.h> 34#include <linux/serial.h>
35#include <linux/serial_8250.h> 35#include <linux/serial_8250.h>
36#include <linux/bootmem.h>
36#include <asm/io.h> 37#include <asm/io.h>
37#include <asm/kdump.h> 38#include <asm/kdump.h>
38#include <asm/prom.h> 39#include <asm/prom.h>
@@ -70,33 +71,6 @@
70#define DBG(fmt...) 71#define DBG(fmt...)
71#endif 72#endif
72 73
73/*
74 * Here are some early debugging facilities. You can enable one
75 * but your kernel will not boot on anything else if you do so
76 */
77
78/* This one is for use on LPAR machines that support an HVC console
79 * on vterm 0
80 */
81extern void udbg_init_debug_lpar(void);
82/* This one is for use on Apple G5 machines
83 */
84extern void udbg_init_pmac_realmode(void);
85/* That's RTAS panel debug */
86extern void call_rtas_display_status_delay(unsigned char c);
87/* Here's maple real mode debug */
88extern void udbg_init_maple_realmode(void);
89
90#define EARLY_DEBUG_INIT() do {} while(0)
91
92#if 0
93#define EARLY_DEBUG_INIT() udbg_init_debug_lpar()
94#define EARLY_DEBUG_INIT() udbg_init_maple_realmode()
95#define EARLY_DEBUG_INIT() udbg_init_pmac_realmode()
96#define EARLY_DEBUG_INIT() \
97 do { udbg_putc = call_rtas_display_status_delay; } while(0)
98#endif
99
100int have_of = 1; 74int have_of = 1;
101int boot_cpuid = 0; 75int boot_cpuid = 0;
102int boot_cpuid_phys = 0; 76int boot_cpuid_phys = 0;
@@ -237,11 +211,8 @@ void __init early_setup(unsigned long dt_ptr)
237 struct paca_struct *lpaca = get_paca(); 211 struct paca_struct *lpaca = get_paca();
238 static struct machdep_calls **mach; 212 static struct machdep_calls **mach;
239 213
240 /* 214 /* Enable early debugging if any specified (see udbg.h) */
241 * Enable early debugging if any specified (see top of 215 udbg_early_init();
242 * this file)
243 */
244 EARLY_DEBUG_INIT();
245 216
246 DBG(" -> early_setup()\n"); 217 DBG(" -> early_setup()\n");
247 218
@@ -684,3 +655,28 @@ void cpu_die(void)
684 if (ppc_md.cpu_die) 655 if (ppc_md.cpu_die)
685 ppc_md.cpu_die(); 656 ppc_md.cpu_die();
686} 657}
658
659#ifdef CONFIG_SMP
660void __init setup_per_cpu_areas(void)
661{
662 int i;
663 unsigned long size;
664 char *ptr;
665
666 /* Copy section for each CPU (we discard the original) */
667 size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES);
668#ifdef CONFIG_MODULES
669 if (size < PERCPU_ENOUGH_ROOM)
670 size = PERCPU_ENOUGH_ROOM;
671#endif
672
673 for_each_cpu(i) {
674 ptr = alloc_bootmem_node(NODE_DATA(cpu_to_node(i)), size);
675 if (!ptr)
676 panic("Cannot allocate cpu data for CPU %d\n", i);
677
678 paca[i].data_offset = ptr - __per_cpu_start;
679 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
680 }
681}
682#endif