aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc64')
-rw-r--r--arch/ppc64/Kconfig11
-rw-r--r--arch/ppc64/Kconfig.debug4
-rw-r--r--arch/ppc64/kernel/idle.c1
-rw-r--r--arch/ppc64/kernel/machine_kexec.c1
-rw-r--r--arch/ppc64/kernel/misc.S72
-rw-r--r--arch/ppc64/kernel/pci.c17
-rw-r--r--arch/ppc64/kernel/prom.c25
-rw-r--r--arch/ppc64/kernel/prom_init.c3
-rw-r--r--arch/ppc64/kernel/rtas_pci.c6
-rw-r--r--arch/ppc64/kernel/udbg.c55
10 files changed, 115 insertions, 80 deletions
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index 2130cc315957..29552348e581 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -56,6 +56,7 @@ config PPC_STD_MMU
56# max order + 1 56# max order + 1
57config FORCE_MAX_ZONEORDER 57config FORCE_MAX_ZONEORDER
58 int 58 int
59 default "9" if PPC_64K_PAGES
59 default "13" 60 default "13"
60 61
61source "init/Kconfig" 62source "init/Kconfig"
@@ -173,6 +174,16 @@ config KEXEC
173 support. As of this writing the exact hardware interface is 174 support. As of this writing the exact hardware interface is
174 strongly in flux, so no good recommendation can be made. 175 strongly in flux, so no good recommendation can be made.
175 176
177source "drivers/cpufreq/Kconfig"
178
179config CPU_FREQ_PMAC64
180 bool "Support for some Apple G5s"
181 depends on CPU_FREQ && PMAC_SMU && PPC64
182 select CPU_FREQ_TABLE
183 help
184 This adds support for frequency switching on Apple iMac G5,
185 and some of the more recent desktop G5 machines as well.
186
176config IBMVIO 187config IBMVIO
177 depends on PPC_PSERIES || PPC_ISERIES 188 depends on PPC_PSERIES || PPC_ISERIES
178 bool 189 bool
diff --git a/arch/ppc64/Kconfig.debug b/arch/ppc64/Kconfig.debug
index f16a5030527b..b258c9314a1b 100644
--- a/arch/ppc64/Kconfig.debug
+++ b/arch/ppc64/Kconfig.debug
@@ -55,10 +55,6 @@ config XMON_DEFAULT
55 xmon is normally disabled unless booted with 'xmon=on'. 55 xmon is normally disabled unless booted with 'xmon=on'.
56 Use 'xmon=off' to disable xmon init during runtime. 56 Use 'xmon=off' to disable xmon init during runtime.
57 57
58config PPCDBG
59 bool "Include PPCDBG realtime debugging"
60 depends on DEBUG_KERNEL
61
62config IRQSTACKS 58config IRQSTACKS
63 bool "Use separate kernel stacks when processing interrupts" 59 bool "Use separate kernel stacks when processing interrupts"
64 help 60 help
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index 8abd2ad92832..8fec27469802 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -28,6 +28,7 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/systemcfg.h> 29#include <asm/systemcfg.h>
30#include <asm/machdep.h> 30#include <asm/machdep.h>
31#include <asm/smp.h>
31 32
32extern void power4_idle(void); 33extern void power4_idle(void);
33 34
diff --git a/arch/ppc64/kernel/machine_kexec.c b/arch/ppc64/kernel/machine_kexec.c
index ff8679f260f3..07ea03598c00 100644
--- a/arch/ppc64/kernel/machine_kexec.c
+++ b/arch/ppc64/kernel/machine_kexec.c
@@ -24,6 +24,7 @@
24#include <asm/mmu.h> 24#include <asm/mmu.h>
25#include <asm/sections.h> /* _end */ 25#include <asm/sections.h> /* _end */
26#include <asm/prom.h> 26#include <asm/prom.h>
27#include <asm/smp.h>
27 28
28#define HASH_GROUP_SIZE 0x80 /* size of each hash group, asm/mmu.h */ 29#define HASH_GROUP_SIZE 0x80 /* size of each hash group, asm/mmu.h */
29 30
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index 077507ffbab8..914632ec587d 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -560,7 +560,7 @@ _GLOBAL(real_readb)
560 isync 560 isync
561 blr 561 blr
562 562
563 /* 563/*
564 * Do an IO access in real mode 564 * Do an IO access in real mode
565 */ 565 */
566_GLOBAL(real_writeb) 566_GLOBAL(real_writeb)
@@ -593,6 +593,76 @@ _GLOBAL(real_writeb)
593#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */ 593#endif /* defined(CONFIG_PPC_PMAC) || defined(CONFIG_PPC_MAPLE) */
594 594
595/* 595/*
596 * SCOM access functions for 970 (FX only for now)
597 *
598 * unsigned long scom970_read(unsigned int address);
599 * void scom970_write(unsigned int address, unsigned long value);
600 *
601 * The address passed in is the 24 bits register address. This code
602 * is 970 specific and will not check the status bits, so you should
603 * know what you are doing.
604 */
605_GLOBAL(scom970_read)
606 /* interrupts off */
607 mfmsr r4
608 ori r0,r4,MSR_EE
609 xori r0,r0,MSR_EE
610 mtmsrd r0,1
611
612 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
613 * (including parity). On current CPUs they must be 0'd,
614 * and finally or in RW bit
615 */
616 rlwinm r3,r3,8,0,15
617 ori r3,r3,0x8000
618
619 /* do the actual scom read */
620 sync
621 mtspr SPRN_SCOMC,r3
622 isync
623 mfspr r3,SPRN_SCOMD
624 isync
625 mfspr r0,SPRN_SCOMC
626 isync
627
628 /* XXX: fixup result on some buggy 970's (ouch ! we lost a bit, bah
629 * that's the best we can do). Not implemented yet as we don't use
630 * the scom on any of the bogus CPUs yet, but may have to be done
631 * ultimately
632 */
633
634 /* restore interrupts */
635 mtmsrd r4,1
636 blr
637
638
639_GLOBAL(scom970_write)
640 /* interrupts off */
641 mfmsr r5
642 ori r0,r5,MSR_EE
643 xori r0,r0,MSR_EE
644 mtmsrd r0,1
645
646 /* rotate 24 bits SCOM address 8 bits left and mask out it's low 8 bits
647 * (including parity). On current CPUs they must be 0'd.
648 */
649
650 rlwinm r3,r3,8,0,15
651
652 sync
653 mtspr SPRN_SCOMD,r4 /* write data */
654 isync
655 mtspr SPRN_SCOMC,r3 /* write command */
656 isync
657 mfspr 3,SPRN_SCOMC
658 isync
659
660 /* restore interrupts */
661 mtmsrd r5,1
662 blr
663
664
665/*
596 * Create a kernel thread 666 * Create a kernel thread
597 * kernel_thread(fn, arg, flags) 667 * kernel_thread(fn, arg, flags)
598 */ 668 */
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c
index 3d2106b022a1..30247ff74972 100644
--- a/arch/ppc64/kernel/pci.c
+++ b/arch/ppc64/kernel/pci.c
@@ -295,8 +295,8 @@ static void pci_parse_of_addrs(struct device_node *node, struct pci_dev *dev)
295 } 295 }
296} 296}
297 297
298static struct pci_dev *of_create_pci_dev(struct device_node *node, 298struct pci_dev *of_create_pci_dev(struct device_node *node,
299 struct pci_bus *bus, int devfn) 299 struct pci_bus *bus, int devfn)
300{ 300{
301 struct pci_dev *dev; 301 struct pci_dev *dev;
302 const char *type; 302 const char *type;
@@ -354,10 +354,9 @@ static struct pci_dev *of_create_pci_dev(struct device_node *node,
354 354
355 return dev; 355 return dev;
356} 356}
357EXPORT_SYMBOL(of_create_pci_dev);
357 358
358static void of_scan_pci_bridge(struct device_node *node, struct pci_dev *dev); 359void __devinit of_scan_bus(struct device_node *node,
359
360static void __devinit of_scan_bus(struct device_node *node,
361 struct pci_bus *bus) 360 struct pci_bus *bus)
362{ 361{
363 struct device_node *child = NULL; 362 struct device_node *child = NULL;
@@ -381,9 +380,10 @@ static void __devinit of_scan_bus(struct device_node *node,
381 380
382 do_bus_setup(bus); 381 do_bus_setup(bus);
383} 382}
383EXPORT_SYMBOL(of_scan_bus);
384 384
385static void __devinit of_scan_pci_bridge(struct device_node *node, 385void __devinit of_scan_pci_bridge(struct device_node *node,
386 struct pci_dev *dev) 386 struct pci_dev *dev)
387{ 387{
388 struct pci_bus *bus; 388 struct pci_bus *bus;
389 u32 *busrange, *ranges; 389 u32 *busrange, *ranges;
@@ -464,9 +464,10 @@ static void __devinit of_scan_pci_bridge(struct device_node *node,
464 else if (mode == PCI_PROBE_NORMAL) 464 else if (mode == PCI_PROBE_NORMAL)
465 pci_scan_child_bus(bus); 465 pci_scan_child_bus(bus);
466} 466}
467EXPORT_SYMBOL(of_scan_pci_bridge);
467#endif /* CONFIG_PPC_MULTIPLATFORM */ 468#endif /* CONFIG_PPC_MULTIPLATFORM */
468 469
469static void __devinit scan_phb(struct pci_controller *hose) 470void __devinit scan_phb(struct pci_controller *hose)
470{ 471{
471 struct pci_bus *bus; 472 struct pci_bus *bus;
472 struct device_node *node = hose->arch_data; 473 struct device_node *node = hose->arch_data;
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c
index dece31e58bc4..3402fbee62c7 100644
--- a/arch/ppc64/kernel/prom.c
+++ b/arch/ppc64/kernel/prom.c
@@ -31,6 +31,7 @@
31#include <linux/initrd.h> 31#include <linux/initrd.h>
32#include <linux/bitops.h> 32#include <linux/bitops.h>
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/module.h>
34 35
35#include <asm/prom.h> 36#include <asm/prom.h>
36#include <asm/rtas.h> 37#include <asm/rtas.h>
@@ -46,7 +47,6 @@
46#include <asm/pgtable.h> 47#include <asm/pgtable.h>
47#include <asm/pci.h> 48#include <asm/pci.h>
48#include <asm/iommu.h> 49#include <asm/iommu.h>
49#include <asm/ppcdebug.h>
50#include <asm/btext.h> 50#include <asm/btext.h>
51#include <asm/sections.h> 51#include <asm/sections.h>
52#include <asm/machdep.h> 52#include <asm/machdep.h>
@@ -1866,17 +1866,32 @@ get_property(struct device_node *np, const char *name, int *lenp)
1866EXPORT_SYMBOL(get_property); 1866EXPORT_SYMBOL(get_property);
1867 1867
1868/* 1868/*
1869 * Add a property to a node 1869 * Add a property to a node.
1870 */ 1870 */
1871void 1871int
1872prom_add_property(struct device_node* np, struct property* prop) 1872prom_add_property(struct device_node* np, struct property* prop)
1873{ 1873{
1874 struct property **next = &np->properties; 1874 struct property **next;
1875 1875
1876 prop->next = NULL; 1876 prop->next = NULL;
1877 while (*next) 1877 write_lock(&devtree_lock);
1878 next = &np->properties;
1879 while (*next) {
1880 if (strcmp(prop->name, (*next)->name) == 0) {
1881 /* duplicate ! don't insert it */
1882 write_unlock(&devtree_lock);
1883 return -1;
1884 }
1878 next = &(*next)->next; 1885 next = &(*next)->next;
1886 }
1879 *next = prop; 1887 *next = prop;
1888 write_unlock(&devtree_lock);
1889
1890 /* try to add to proc as well if it was initialized */
1891 if (np->pde)
1892 proc_device_tree_add_prop(np->pde, prop);
1893
1894 return 0;
1880} 1895}
1881 1896
1882#if 0 1897#if 0
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c
index a4bbca6dbb8b..e4c880dab997 100644
--- a/arch/ppc64/kernel/prom_init.c
+++ b/arch/ppc64/kernel/prom_init.c
@@ -44,7 +44,6 @@
44#include <asm/pgtable.h> 44#include <asm/pgtable.h>
45#include <asm/pci.h> 45#include <asm/pci.h>
46#include <asm/iommu.h> 46#include <asm/iommu.h>
47#include <asm/ppcdebug.h>
48#include <asm/btext.h> 47#include <asm/btext.h>
49#include <asm/sections.h> 48#include <asm/sections.h>
50#include <asm/machdep.h> 49#include <asm/machdep.h>
@@ -1825,7 +1824,7 @@ static void __init fixup_device_tree(void)
1825 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) 1824 if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))
1826 == PROM_ERROR) 1825 == PROM_ERROR)
1827 return; 1826 return;
1828 if (u3_rev != 0x35 && u3_rev != 0x37) 1827 if (u3_rev < 0x35 || u3_rev > 0x39)
1829 return; 1828 return;
1830 /* does it need fixup ? */ 1829 /* does it need fixup ? */
1831 if (prom_getproplen(i2c, "interrupts") > 0) 1830 if (prom_getproplen(i2c, "interrupts") > 0)
diff --git a/arch/ppc64/kernel/rtas_pci.c b/arch/ppc64/kernel/rtas_pci.c
index 3ad15c90fbbd..3c3f19192fcc 100644
--- a/arch/ppc64/kernel/rtas_pci.c
+++ b/arch/ppc64/kernel/rtas_pci.c
@@ -440,7 +440,6 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
440 struct device_node *root = of_find_node_by_path("/"); 440 struct device_node *root = of_find_node_by_path("/");
441 unsigned int root_size_cells = 0; 441 unsigned int root_size_cells = 0;
442 struct pci_controller *phb; 442 struct pci_controller *phb;
443 struct pci_bus *bus;
444 int primary; 443 int primary;
445 444
446 root_size_cells = prom_n_size_cells(root); 445 root_size_cells = prom_n_size_cells(root);
@@ -456,10 +455,7 @@ struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
456 of_node_put(root); 455 of_node_put(root);
457 456
458 pci_devs_phb_init_dynamic(phb); 457 pci_devs_phb_init_dynamic(phb);
459 phb->last_busno = 0xff; 458 scan_phb(phb);
460 bus = pci_scan_bus(phb->first_busno, phb->ops, phb->arch_data);
461 phb->bus = bus;
462 phb->last_busno = bus->subordinate;
463 459
464 return phb; 460 return phb;
465} 461}
diff --git a/arch/ppc64/kernel/udbg.c b/arch/ppc64/kernel/udbg.c
index d49c3613c8ec..0d878e72fc44 100644
--- a/arch/ppc64/kernel/udbg.c
+++ b/arch/ppc64/kernel/udbg.c
@@ -10,12 +10,10 @@
10 */ 10 */
11 11
12#include <stdarg.h> 12#include <stdarg.h>
13#define WANT_PPCDBG_TAB /* Only defined here */
14#include <linux/config.h> 13#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
17#include <linux/console.h> 16#include <linux/console.h>
18#include <asm/ppcdebug.h>
19#include <asm/processor.h> 17#include <asm/processor.h>
20 18
21void (*udbg_putc)(unsigned char c); 19void (*udbg_putc)(unsigned char c);
@@ -89,59 +87,6 @@ void udbg_printf(const char *fmt, ...)
89 va_end(args); 87 va_end(args);
90} 88}
91 89
92/* PPCDBG stuff */
93
94u64 ppc64_debug_switch;
95
96/* Special print used by PPCDBG() macro */
97void udbg_ppcdbg(unsigned long debug_flags, const char *fmt, ...)
98{
99 unsigned long active_debugs = debug_flags & ppc64_debug_switch;
100
101 if (active_debugs) {
102 va_list ap;
103 unsigned char buf[UDBG_BUFSIZE];
104 unsigned long i, len = 0;
105
106 for (i=0; i < PPCDBG_NUM_FLAGS; i++) {
107 if (((1U << i) & active_debugs) &&
108 trace_names[i]) {
109 len += strlen(trace_names[i]);
110 udbg_puts(trace_names[i]);
111 break;
112 }
113 }
114
115 snprintf(buf, UDBG_BUFSIZE, " [%s]: ", current->comm);
116 len += strlen(buf);
117 udbg_puts(buf);
118
119 while (len < 18) {
120 udbg_puts(" ");
121 len++;
122 }
123
124 va_start(ap, fmt);
125 vsnprintf(buf, UDBG_BUFSIZE, fmt, ap);
126 udbg_puts(buf);
127 va_end(ap);
128 }
129}
130
131unsigned long udbg_ifdebug(unsigned long flags)
132{
133 return (flags & ppc64_debug_switch);
134}
135
136/*
137 * Initialize the PPCDBG state. Called before relocation has been enabled.
138 */
139void __init ppcdbg_initialize(void)
140{
141 ppc64_debug_switch = PPC_DEBUG_DEFAULT; /* | PPCDBG_BUSWALK | */
142 /* PPCDBG_PHBINIT | PPCDBG_MM | PPCDBG_MMINIT | PPCDBG_TCEINIT | PPCDBG_TCE */;
143}
144
145/* 90/*
146 * Early boot console based on udbg 91 * Early boot console based on udbg
147 */ 92 */