15 #include <linux/export.h>
16 #include <linux/string.h>
17 #include <linux/sched.h>
19 #include <linux/kernel.h>
20 #include <linux/reboot.h>
27 #include <linux/screen_info.h>
32 #include <linux/serial.h>
41 #include <asm/processor.h>
42 #include <asm/vdso_datapage.h>
43 #include <asm/pgtable.h>
46 #include <asm/machdep.h>
48 #include <asm/cputable.h>
49 #include <asm/sections.h>
51 #include <asm/btext.h>
52 #include <asm/nvram.h>
53 #include <asm/setup.h>
55 #include <asm/iommu.h>
56 #include <asm/serial.h>
57 #include <asm/cache.h>
69 #define DBG(fmt...) udbg_printf(fmt)
91 .orig_video_cols = 80,
92 .orig_video_lines = 25,
93 .orig_video_isVGA = 1,
94 .orig_video_points = 16
103 #ifdef __DO_IRQ_CANON
105 int ppc_do_canonicalize_irqs;
112 #ifdef CONFIG_FA_DUMP
120 if (
ppc_md.machine_shutdown)
121 ppc_md.machine_shutdown();
178 static void show_cpuinfo_summary(
struct seq_file *
m)
182 #if defined(CONFIG_SMP) && defined(CONFIG_PPC32)
183 unsigned long bogosum = 0;
188 bogosum/(500000/
HZ), bogosum/(5000/HZ) % 100);
226 pvr =
per_cpu(cpu_pvr, cpu_id);
230 maj = (pvr >> 8) & 0xFF;
241 #ifdef CONFIG_ALTIVEC
250 #ifdef CONFIG_TAU_AVERAGE
252 seq_printf(m,
"temperature \t: %u C (uncalibrated)\n",
258 seq_printf(m,
"temperature \t: %u-%u C (uncalibrated)\n",
259 temp & 0xff, temp >> 16);
273 ppc_md.show_percpuinfo(m, cpu_id);
285 maj = ((pvr >> 8) & 0xF);
296 maj = PVR_MAJ(pvr) + 1;
300 maj = ((pvr >> 8) & 0xFF) - 1;
304 maj = (pvr >> 8) & 0xFF;
310 seq_printf(m,
"revision\t: %hd.%hd (pvr %04x %04x)\n",
315 loops_per_jiffy / (500000/HZ),
316 (loops_per_jiffy / (5000/HZ)) % 100);
326 if (cpumask_next(cpu_id, cpu_online_mask) >= nr_cpu_ids)
327 show_cpuinfo_summary(m);
335 *pos = cpumask_first(cpu_online_mask);
337 *pos = cpumask_next(*pos - 1, cpu_online_mask);
338 if ((*pos) < nr_cpu_ids)
339 return (
void *)(
unsigned long)(*pos + 1);
343 static void *c_next(
struct seq_file *m,
void *v, loff_t *pos)
349 static void c_stop(
struct seq_file *m,
void *v)
362 #ifdef CONFIG_BLK_DEV_INITRD
363 DBG(
" -> check_for_initrd() initrd_start=0x%lx initrd_end=0x%lx\n",
378 DBG(
" <- check_for_initrd()\n");
390 static void __init cpu_init_thread_core_maps(
int tpc)
394 threads_per_core = tpc;
395 cpumask_clear(&threads_core_mask);
400 threads_shift =
ilog2(tpc);
401 BUG_ON(tpc != (1 << threads_shift));
403 for (i = 0; i < tpc; i++)
404 cpumask_set_cpu(i, &threads_core_mask);
407 tpc, tpc > 1 ?
"s" :
"");
430 void __init smp_setup_cpu_maps(
void)
436 DBG(
"smp_setup_cpu_maps()\n");
447 nthreads = len /
sizeof(
int);
448 DBG(
" ibm,ppc-interrupt-server#s -> %d threads\n",
451 DBG(
" no ibm,ppc-interrupt-server#s -> 1 thread\n");
457 for (j = 0; j < nthreads && cpu <
nr_cpu_ids; j++) {
458 DBG(
" thread %d -> cpu %d (hard id %d)\n",
461 set_hard_smp_processor_id(cpu, intserv[j]);
469 DBG(
" SMT disabled ! nthreads forced to 1\n");
478 if (machine_is(pseries) && firmware_has_feature(FW_FEATURE_LPAR) &&
480 int num_addr_cell, num_size_cell, maxcpus;
481 const unsigned int *ireg;
491 maxcpus = ireg[num_addr_cell + num_size_cell];
497 if (maxcpus > nr_cpu_ids) {
499 "Partition configured for %d cpus, "
500 "operating system maximum is %d.\n",
501 maxcpus, nr_cpu_ids);
507 for (cpu = 0; cpu < maxcpus; cpu++)
521 cpu_init_thread_core_maps(nthreads);
530 #ifdef CONFIG_PCSPKR_PLATFORM
531 static __init int add_pcspkr(
void)
557 extern struct machdep_calls __machine_desc_start;
558 extern struct machdep_calls __machine_desc_end;
564 DBG(
"Probing machine type ...\n");
579 DBG(
"No suitable machine found !\n");
624 #ifdef CONFIG_PPC_PREP
660 .notifier_call = ppc_panic_event,
669 #ifdef CONFIG_CHECK_CACHE_COHERENCY
678 #ifdef CONFIG_NOT_COHERENT_CACHE
679 #define KERNEL_COHERENCY 0
681 #define KERNEL_COHERENCY 1
684 static int __init check_cache_coherency(
void)
688 int devtree_coherency;
694 devtree_coherency = prop ? 0 : 1;
696 if (devtree_coherency != KERNEL_COHERENCY) {
698 "kernel coherency:%s != device tree_coherency:%s\n",
699 KERNEL_COHERENCY ?
"on" :
"off",
700 devtree_coherency ?
"on" :
"off");
710 #ifdef CONFIG_DEBUG_FS
714 static int powerpc_debugfs_init(
void)
718 return powerpc_debugfs_root ==
NULL;
723 #ifdef CONFIG_BOOKE_WDT
730 if (p &&
strncmp(p,
"0", 1) != 0)
731 booke_wdt_enabled = 1;
737 int __init early_parse_wdt_period(
char *p)
741 if (!kstrtol(p, 0, &ret))
742 booke_wdt_period =
ret;