aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-02-07 23:32:13 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-07 23:32:13 -0500
commitfe69102188cde0700cddd8d4cda0b77d68284884 (patch)
treeae2f88c810ff48f040a808a924585000b52082e9
parentf30ac319f1b91878cdc57a50930f15c36e0e103a (diff)
parent7d4d61544a12333600bdb9b018a149868418692e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
-rw-r--r--Documentation/powerpc/booting-without-of.txt8
-rw-r--r--arch/powerpc/kernel/fpu.S2
-rw-r--r--arch/powerpc/kernel/head_64.S5
-rw-r--r--arch/powerpc/kernel/iommu.c9
-rw-r--r--arch/powerpc/kernel/prom.c38
-rw-r--r--arch/powerpc/kernel/prom_init.c4
-rw-r--r--arch/powerpc/kernel/prom_parse.c4
-rw-r--r--arch/powerpc/kernel/rtas.c12
-rw-r--r--arch/powerpc/kernel/rtas_flash.c3
-rw-r--r--arch/powerpc/kernel/setup_64.c3
-rw-r--r--arch/powerpc/kernel/smp.c3
-rw-r--r--arch/powerpc/kernel/time.c8
-rw-r--r--arch/powerpc/kernel/udbg_16550.c2
-rw-r--r--arch/powerpc/mm/lmb.c4
-rw-r--r--arch/powerpc/mm/mem.c14
-rw-r--r--arch/powerpc/platforms/cell/Makefile2
-rw-r--r--arch/powerpc/platforms/chrp/chrp.h1
-rw-r--r--arch/powerpc/platforms/chrp/pci.c2
-rw-r--r--arch/powerpc/platforms/chrp/setup.c2
-rw-r--r--arch/powerpc/platforms/chrp/time.c21
-rw-r--r--arch/powerpc/platforms/pseries/setup.c2
-rw-r--r--arch/ppc/kernel/head_8xx.S7
-rw-r--r--drivers/macintosh/windfarm_core.c53
-rw-r--r--include/asm-powerpc/prom.h2
24 files changed, 123 insertions, 88 deletions
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 1284498e847c..54e5f9b1536d 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -880,6 +880,10 @@ address which can extend beyond that limit.
880 - device_type : Should be "soc" 880 - device_type : Should be "soc"
881 - ranges : Should be defined as specified in 1) to describe the 881 - ranges : Should be defined as specified in 1) to describe the
882 translation of SOC addresses for memory mapped SOC registers. 882 translation of SOC addresses for memory mapped SOC registers.
883 - bus-frequency: Contains the bus frequency for the SOC node.
884 Typically, the value of this field is filled in by the boot
885 loader.
886
883 887
884 Recommended properties: 888 Recommended properties:
885 889
@@ -919,6 +923,7 @@ SOC.
919 device_type = "soc"; 923 device_type = "soc";
920 ranges = <00000000 e0000000 00100000> 924 ranges = <00000000 e0000000 00100000>
921 reg = <e0000000 00003000>; 925 reg = <e0000000 00003000>;
926 bus-frequency = <0>;
922 } 927 }
923 928
924 929
@@ -1170,6 +1175,8 @@ platforms are moved over to use the flattened-device-tree model.
1170 1175
1171 mdio@24520 { 1176 mdio@24520 {
1172 reg = <24520 20>; 1177 reg = <24520 20>;
1178 device_type = "mdio";
1179 compatible = "gianfar";
1173 1180
1174 ethernet-phy@0 { 1181 ethernet-phy@0 {
1175 ...... 1182 ......
@@ -1317,6 +1324,7 @@ not necessary as they are usually the same as the root node.
1317 device_type = "soc"; 1324 device_type = "soc";
1318 ranges = <00000000 e0000000 00100000> 1325 ranges = <00000000 e0000000 00100000>
1319 reg = <e0000000 00003000>; 1326 reg = <e0000000 00003000>;
1327 bus-frequency = <0>;
1320 1328
1321 mdio@24520 { 1329 mdio@24520 {
1322 reg = <24520 20>; 1330 reg = <24520 20>;
diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S
index e4362dfa37fb..340730fb8c91 100644
--- a/arch/powerpc/kernel/fpu.S
+++ b/arch/powerpc/kernel/fpu.S
@@ -66,7 +66,7 @@ _GLOBAL(load_up_fpu)
66#else 66#else
67 ld r4,PACACURRENT(r13) 67 ld r4,PACACURRENT(r13)
68 addi r5,r4,THREAD /* Get THREAD */ 68 addi r5,r4,THREAD /* Get THREAD */
69 ld r4,THREAD_FPEXC_MODE(r5) 69 lwz r4,THREAD_FPEXC_MODE(r5)
70 ori r12,r12,MSR_FP 70 ori r12,r12,MSR_FP
71 or r12,r12,r4 71 or r12,r12,r4
72 std r12,_MSR(r1) 72 std r12,_MSR(r1)
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 308268466342..415659629394 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -749,11 +749,12 @@ iSeries_secondary_smp_loop:
749 749
750 .globl decrementer_iSeries_masked 750 .globl decrementer_iSeries_masked
751decrementer_iSeries_masked: 751decrementer_iSeries_masked:
752 /* We may not have a valid TOC pointer in here. */
752 li r11,1 753 li r11,1
753 ld r12,PACALPPACAPTR(r13) 754 ld r12,PACALPPACAPTR(r13)
754 stb r11,LPPACADECRINT(r12) 755 stb r11,LPPACADECRINT(r12)
755 LOAD_REG_ADDRBASE(r12,tb_ticks_per_jiffy) 756 LOAD_REG_IMMEDIATE(r12, tb_ticks_per_jiffy)
756 lwz r12,ADDROFF(tb_ticks_per_jiffy)(r12) 757 lwz r12,0(r12)
757 mtspr SPRN_DEC,r12 758 mtspr SPRN_DEC,r12
758 /* fall through */ 759 /* fall through */
759 760
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 4d9b4388918b..946f3219fd29 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -334,9 +334,6 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
334 334
335 spin_unlock_irqrestore(&(tbl->it_lock), flags); 335 spin_unlock_irqrestore(&(tbl->it_lock), flags);
336 336
337 /* Make sure updates are seen by hardware */
338 mb();
339
340 DBG("mapped %d elements:\n", outcount); 337 DBG("mapped %d elements:\n", outcount);
341 338
342 /* For the sake of iommu_unmap_sg, we clear out the length in the 339 /* For the sake of iommu_unmap_sg, we clear out the length in the
@@ -347,6 +344,10 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
347 outs->dma_address = DMA_ERROR_CODE; 344 outs->dma_address = DMA_ERROR_CODE;
348 outs->dma_length = 0; 345 outs->dma_length = 0;
349 } 346 }
347
348 /* Make sure updates are seen by hardware */
349 mb();
350
350 return outcount; 351 return outcount;
351 352
352 failure: 353 failure:
@@ -358,6 +359,8 @@ int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
358 npages = (PAGE_ALIGN(s->dma_address + s->dma_length) - vaddr) 359 npages = (PAGE_ALIGN(s->dma_address + s->dma_length) - vaddr)
359 >> PAGE_SHIFT; 360 >> PAGE_SHIFT;
360 __iommu_free(tbl, vaddr, npages); 361 __iommu_free(tbl, vaddr, npages);
362 s->dma_address = DMA_ERROR_CODE;
363 s->dma_length = 0;
361 } 364 }
362 } 365 }
363 spin_unlock_irqrestore(&(tbl->it_lock), flags); 366 spin_unlock_irqrestore(&(tbl->it_lock), flags);
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index d50c8df0183e..294832a7e0a6 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -491,7 +491,12 @@ void __init finish_device_tree(void)
491 size = 16; 491 size = 16;
492 finish_node(allnodes, &size, 1); 492 finish_node(allnodes, &size, 1);
493 size -= 16; 493 size -= 16;
494 end = start = (unsigned long) __va(lmb_alloc(size, 128)); 494
495 if (0 == size)
496 end = start = 0;
497 else
498 end = start = (unsigned long)__va(lmb_alloc(size, 128));
499
495 finish_node(allnodes, &end, 0); 500 finish_node(allnodes, &end, 0);
496 BUG_ON(end != start + size); 501 BUG_ON(end != start + size);
497 502
@@ -1398,8 +1403,8 @@ struct device_node *of_find_node_by_name(struct device_node *from,
1398 1403
1399 read_lock(&devtree_lock); 1404 read_lock(&devtree_lock);
1400 np = from ? from->allnext : allnodes; 1405 np = from ? from->allnext : allnodes;
1401 for (; np != 0; np = np->allnext) 1406 for (; np != NULL; np = np->allnext)
1402 if (np->name != 0 && strcasecmp(np->name, name) == 0 1407 if (np->name != NULL && strcasecmp(np->name, name) == 0
1403 && of_node_get(np)) 1408 && of_node_get(np))
1404 break; 1409 break;
1405 if (from) 1410 if (from)
@@ -1917,3 +1922,30 @@ int prom_update_property(struct device_node *np,
1917 1922
1918 return 0; 1923 return 0;
1919} 1924}
1925
1926#ifdef CONFIG_KEXEC
1927/* We may have allocated the flat device tree inside the crash kernel region
1928 * in prom_init. If so we need to move it out into regular memory. */
1929void kdump_move_device_tree(void)
1930{
1931 unsigned long start, end;
1932 struct boot_param_header *new;
1933
1934 start = __pa((unsigned long)initial_boot_params);
1935 end = start + initial_boot_params->totalsize;
1936
1937 if (end < crashk_res.start || start > crashk_res.end)
1938 return;
1939
1940 new = (struct boot_param_header*)
1941 __va(lmb_alloc(initial_boot_params->totalsize, PAGE_SIZE));
1942
1943 memcpy(new, initial_boot_params, initial_boot_params->totalsize);
1944
1945 initial_boot_params = new;
1946
1947 DBG("Flat device tree blob moved to %p\n", initial_boot_params);
1948
1949 /* XXX should we unreserve the old DT? */
1950}
1951#endif /* CONFIG_KEXEC */
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 7881ec96ef11..ec7153f4d47c 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2098,6 +2098,10 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2098 */ 2098 */
2099 prom_init_stdout(); 2099 prom_init_stdout();
2100 2100
2101 /* Bail if this is a kdump kernel. */
2102 if (PHYSICAL_START > 0)
2103 prom_panic("Error: You can't boot a kdump kernel from OF!\n");
2104
2101 /* 2105 /*
2102 * Check for an initrd 2106 * Check for an initrd
2103 */ 2107 */
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index a8099c806150..3934c227549b 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -465,8 +465,10 @@ u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size,
465 if (parent == NULL) 465 if (parent == NULL)
466 return NULL; 466 return NULL;
467 bus = of_match_bus(parent); 467 bus = of_match_bus(parent);
468 if (strcmp(bus->name, "pci")) 468 if (strcmp(bus->name, "pci")) {
469 of_node_put(parent);
469 return NULL; 470 return NULL;
471 }
470 bus->count_cells(dev, &na, &ns); 472 bus->count_cells(dev, &na, &ns);
471 of_node_put(parent); 473 of_node_put(parent);
472 if (!OF_CHECK_COUNTS(na, ns)) 474 if (!OF_CHECK_COUNTS(na, ns))
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 7fe4a5c944c9..b5b2add7ad1e 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -22,6 +22,7 @@
22 22
23#include <asm/prom.h> 23#include <asm/prom.h>
24#include <asm/rtas.h> 24#include <asm/rtas.h>
25#include <asm/hvcall.h>
25#include <asm/semaphore.h> 26#include <asm/semaphore.h>
26#include <asm/machdep.h> 27#include <asm/machdep.h>
27#include <asm/page.h> 28#include <asm/page.h>
@@ -565,6 +566,7 @@ static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE;
565#ifdef CONFIG_PPC_PSERIES 566#ifdef CONFIG_PPC_PSERIES
566static void rtas_percpu_suspend_me(void *info) 567static void rtas_percpu_suspend_me(void *info)
567{ 568{
569 int i;
568 long rc; 570 long rc;
569 long flags; 571 long flags;
570 struct rtas_suspend_me_data *data = 572 struct rtas_suspend_me_data *data =
@@ -587,18 +589,16 @@ static void rtas_percpu_suspend_me(void *info)
587 589
588 if (rc == H_Continue) { 590 if (rc == H_Continue) {
589 data->waiting = 0; 591 data->waiting = 0;
590 rtas_call(ibm_suspend_me_token, 0, 1, 592 data->args->args[data->args->nargs] =
591 data->args->args); 593 rtas_call(ibm_suspend_me_token, 0, 1, NULL);
594 for_each_cpu(i)
595 plpar_hcall_norets(H_PROD,i);
592 } else { 596 } else {
593 data->waiting = -EBUSY; 597 data->waiting = -EBUSY;
594 printk(KERN_ERR "Error on H_Join hypervisor call\n"); 598 printk(KERN_ERR "Error on H_Join hypervisor call\n");
595 } 599 }
596 600
597out: 601out:
598 /* before we restore interrupts, make sure we don't
599 * generate a spurious soft lockup errors
600 */
601 touch_softlockup_watchdog();
602 local_irq_restore(flags); 602 local_irq_restore(flags);
603 return; 603 return;
604} 604}
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index 50500093c97f..aaf384c3f04a 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -672,8 +672,7 @@ static void rtas_flash_firmware(int reboot_type)
672static void remove_flash_pde(struct proc_dir_entry *dp) 672static void remove_flash_pde(struct proc_dir_entry *dp)
673{ 673{
674 if (dp) { 674 if (dp) {
675 if (dp->data != NULL) 675 kfree(dp->data);
676 kfree(dp->data);
677 dp->owner = NULL; 676 dp->owner = NULL;
678 remove_proc_entry(dp->name, dp->parent); 677 remove_proc_entry(dp->name, dp->parent);
679 } 678 }
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index e29b275e09e0..a717dff695ef 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -398,6 +398,9 @@ void __init setup_system(void)
398{ 398{
399 DBG(" -> setup_system()\n"); 399 DBG(" -> setup_system()\n");
400 400
401#ifdef CONFIG_KEXEC
402 kdump_move_device_tree();
403#endif
401 /* 404 /*
402 * Unflatten the device-tree passed by prom_init or kexec 405 * Unflatten the device-tree passed by prom_init or kexec
403 */ 406 */
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index c8458c531b25..13595a64f013 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -540,6 +540,9 @@ int __devinit start_secondary(void *unused)
540 if (smp_ops->take_timebase) 540 if (smp_ops->take_timebase)
541 smp_ops->take_timebase(); 541 smp_ops->take_timebase();
542 542
543 if (system_state > SYSTEM_BOOTING)
544 per_cpu(last_jiffy, cpu) = get_tb();
545
543 spin_lock(&call_lock); 546 spin_lock(&call_lock);
544 cpu_set(cpu, cpu_online_map); 547 cpu_set(cpu, cpu_online_map);
545 spin_unlock(&call_lock); 548 spin_unlock(&call_lock);
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index c4a294d657b9..1886045a2fd8 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -612,10 +612,10 @@ void __init generic_calibrate_decr(void)
612 612
613 ppc_tb_freq = DEFAULT_TB_FREQ; /* hardcoded default */ 613 ppc_tb_freq = DEFAULT_TB_FREQ; /* hardcoded default */
614 node_found = 0; 614 node_found = 0;
615 if (cpu != 0) { 615 if (cpu) {
616 fp = (unsigned int *)get_property(cpu, "timebase-frequency", 616 fp = (unsigned int *)get_property(cpu, "timebase-frequency",
617 NULL); 617 NULL);
618 if (fp != 0) { 618 if (fp) {
619 node_found = 1; 619 node_found = 1;
620 ppc_tb_freq = *fp; 620 ppc_tb_freq = *fp;
621 } 621 }
@@ -626,10 +626,10 @@ void __init generic_calibrate_decr(void)
626 626
627 ppc_proc_freq = DEFAULT_PROC_FREQ; 627 ppc_proc_freq = DEFAULT_PROC_FREQ;
628 node_found = 0; 628 node_found = 0;
629 if (cpu != 0) { 629 if (cpu) {
630 fp = (unsigned int *)get_property(cpu, "clock-frequency", 630 fp = (unsigned int *)get_property(cpu, "clock-frequency",
631 NULL); 631 NULL);
632 if (fp != 0) { 632 if (fp) {
633 node_found = 1; 633 node_found = 1;
634 ppc_proc_freq = *fp; 634 ppc_proc_freq = *fp;
635 } 635 }
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index 2da65a9c93f6..5d29dcca523c 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -144,7 +144,7 @@ unsigned int udbg_probe_uart_speed(void __iomem *comport, unsigned int clock)
144} 144}
145 145
146#ifdef CONFIG_PPC_MAPLE 146#ifdef CONFIG_PPC_MAPLE
147void udbg_maple_real_putc(unsigned char c) 147void udbg_maple_real_putc(char c)
148{ 148{
149 if (udbg_comport) { 149 if (udbg_comport) {
150 while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0) 150 while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c
index 9584608fd768..bbe3eac918e8 100644
--- a/arch/powerpc/mm/lmb.c
+++ b/arch/powerpc/mm/lmb.c
@@ -197,6 +197,8 @@ long __init lmb_reserve(unsigned long base, unsigned long size)
197{ 197{
198 struct lmb_region *_rgn = &(lmb.reserved); 198 struct lmb_region *_rgn = &(lmb.reserved);
199 199
200 BUG_ON(0 == size);
201
200 return lmb_add_region(_rgn, base, size); 202 return lmb_add_region(_rgn, base, size);
201} 203}
202 204
@@ -227,6 +229,8 @@ unsigned long __init lmb_alloc_base(unsigned long size, unsigned long align,
227 long i, j; 229 long i, j;
228 unsigned long base = 0; 230 unsigned long base = 0;
229 231
232 BUG_ON(0 == size);
233
230#ifdef CONFIG_PPC32 234#ifdef CONFIG_PPC32
231 /* On 32-bit, make sure we allocate lowmem */ 235 /* On 32-bit, make sure we allocate lowmem */
232 if (max_addr == LMB_ALLOC_ANYWHERE) 236 if (max_addr == LMB_ALLOC_ANYWHERE)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 15aac0d78dfa..550517c2dd42 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -435,17 +435,12 @@ void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
435{ 435{
436 clear_page(page); 436 clear_page(page);
437 437
438 if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
439 return;
440 /* 438 /*
441 * We shouldnt have to do this, but some versions of glibc 439 * We shouldnt have to do this, but some versions of glibc
442 * require it (ld.so assumes zero filled pages are icache clean) 440 * require it (ld.so assumes zero filled pages are icache clean)
443 * - Anton 441 * - Anton
444 */ 442 */
445 443 flush_dcache_page(pg);
446 /* avoid an atomic op if possible */
447 if (test_bit(PG_arch_1, &pg->flags))
448 clear_bit(PG_arch_1, &pg->flags);
449} 444}
450EXPORT_SYMBOL(clear_user_page); 445EXPORT_SYMBOL(clear_user_page);
451 446
@@ -469,12 +464,7 @@ void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
469 return; 464 return;
470#endif 465#endif
471 466
472 if (cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) 467 flush_dcache_page(pg);
473 return;
474
475 /* avoid an atomic op if possible */
476 if (test_bit(PG_arch_1, &pg->flags))
477 clear_bit(PG_arch_1, &pg->flags);
478} 468}
479 469
480void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, 470void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
diff --git a/arch/powerpc/platforms/cell/Makefile b/arch/powerpc/platforms/cell/Makefile
index 16031b565be4..3b998a393e3f 100644
--- a/arch/powerpc/platforms/cell/Makefile
+++ b/arch/powerpc/platforms/cell/Makefile
@@ -2,7 +2,7 @@ obj-y += interrupt.o iommu.o setup.o spider-pic.o
2obj-y += pervasive.o 2obj-y += pervasive.o
3 3
4obj-$(CONFIG_SMP) += smp.o 4obj-$(CONFIG_SMP) += smp.o
5obj-$(CONFIG_SPU_FS) += spufs/ spu-base.o 5obj-$(CONFIG_SPU_FS) += spu-base.o spufs/
6 6
7spu-base-y += spu_base.o spu_priv1.o 7spu-base-y += spu_base.o spu_priv1.o
8 8
diff --git a/arch/powerpc/platforms/chrp/chrp.h b/arch/powerpc/platforms/chrp/chrp.h
index 3a2057fa314a..814f54742e0f 100644
--- a/arch/powerpc/platforms/chrp/chrp.h
+++ b/arch/powerpc/platforms/chrp/chrp.h
@@ -5,7 +5,6 @@
5extern void chrp_nvram_init(void); 5extern void chrp_nvram_init(void);
6extern void chrp_get_rtc_time(struct rtc_time *); 6extern void chrp_get_rtc_time(struct rtc_time *);
7extern int chrp_set_rtc_time(struct rtc_time *); 7extern int chrp_set_rtc_time(struct rtc_time *);
8extern void chrp_calibrate_decr(void);
9extern long chrp_time_init(void); 8extern long chrp_time_init(void);
10 9
11extern void chrp_find_bridges(void); 10extern void chrp_find_bridges(void);
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 00c52f27ef4f..8ef279ad36ad 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -204,9 +204,11 @@ static void __init setup_peg2(struct pci_controller *hose, struct device_node *d
204 struct device_node *root = find_path_device("/"); 204 struct device_node *root = find_path_device("/");
205 struct device_node *rtas; 205 struct device_node *rtas;
206 206
207 of_node_get(root);
207 rtas = of_find_node_by_name (root, "rtas"); 208 rtas = of_find_node_by_name (root, "rtas");
208 if (rtas) { 209 if (rtas) {
209 hose->ops = &rtas_pci_ops; 210 hose->ops = &rtas_pci_ops;
211 of_node_put(rtas);
210 } else { 212 } else {
211 printk ("RTAS supporting Pegasos OF not found, please upgrade" 213 printk ("RTAS supporting Pegasos OF not found, please upgrade"
212 " your firmware\n"); 214 " your firmware\n");
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 2dc87aa5962f..e1fadbf49150 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -506,7 +506,7 @@ void __init chrp_init(void)
506 ppc_md.halt = rtas_halt; 506 ppc_md.halt = rtas_halt;
507 507
508 ppc_md.time_init = chrp_time_init; 508 ppc_md.time_init = chrp_time_init;
509 ppc_md.calibrate_decr = chrp_calibrate_decr; 509 ppc_md.calibrate_decr = generic_calibrate_decr;
510 510
511 /* this may get overridden with rtas routines later... */ 511 /* this may get overridden with rtas routines later... */
512 ppc_md.set_rtc_time = chrp_set_rtc_time; 512 ppc_md.set_rtc_time = chrp_set_rtc_time;
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c
index 36a0f97bb7b1..78df2e7ca88a 100644
--- a/arch/powerpc/platforms/chrp/time.c
+++ b/arch/powerpc/platforms/chrp/time.c
@@ -167,24 +167,3 @@ void chrp_get_rtc_time(struct rtc_time *tm)
167 tm->tm_mon = mon; 167 tm->tm_mon = mon;
168 tm->tm_year = year; 168 tm->tm_year = year;
169} 169}
170
171
172void __init chrp_calibrate_decr(void)
173{
174 struct device_node *cpu;
175 unsigned int freq, *fp;
176
177 /*
178 * The cpu node should have a timebase-frequency property
179 * to tell us the rate at which the decrementer counts.
180 */
181 freq = 16666000; /* hardcoded default */
182 cpu = find_type_devices("cpu");
183 if (cpu != 0) {
184 fp = (unsigned int *)
185 get_property(cpu, "timebase-frequency", NULL);
186 if (fp != 0)
187 freq = *fp;
188 }
189 ppc_tb_freq = freq;
190}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index da6cebaf72cd..9edeca83f434 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -585,7 +585,7 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
585static void pseries_kexec_cpu_down(int crash_shutdown, int secondary) 585static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
586{ 586{
587 /* Don't risk a hypervisor call if we're crashing */ 587 /* Don't risk a hypervisor call if we're crashing */
588 if (!crash_shutdown) { 588 if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
589 unsigned long vpa = __pa(get_lppaca()); 589 unsigned long vpa = __pa(get_lppaca());
590 590
591 if (unregister_vpa(hard_smp_processor_id(), vpa)) { 591 if (unregister_vpa(hard_smp_processor_id(), vpa)) {
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S
index 3e6ca7f5843f..c1e89ad0684d 100644
--- a/arch/ppc/kernel/head_8xx.S
+++ b/arch/ppc/kernel/head_8xx.S
@@ -810,13 +810,16 @@ initial_mmu:
810 mtspr SPRN_MD_TWC, r9 810 mtspr SPRN_MD_TWC, r9
811 li r11, MI_BOOTINIT /* Create RPN for address 0 */ 811 li r11, MI_BOOTINIT /* Create RPN for address 0 */
812 addis r11, r11, 0x0080 /* Add 8M */ 812 addis r11, r11, 0x0080 /* Add 8M */
813 mtspr SPRN_MD_RPN, r8 813 mtspr SPRN_MD_RPN, r11
814
815 addi r10, r10, 0x0100
816 mtspr SPRN_MD_CTR, r10
814 817
815 addis r8, r8, 0x0080 /* Add 8M */ 818 addis r8, r8, 0x0080 /* Add 8M */
816 mtspr SPRN_MD_EPN, r8 819 mtspr SPRN_MD_EPN, r8
817 mtspr SPRN_MD_TWC, r9 820 mtspr SPRN_MD_TWC, r9
818 addis r11, r11, 0x0080 /* Add 8M */ 821 addis r11, r11, 0x0080 /* Add 8M */
819 mtspr SPRN_MD_RPN, r8 822 mtspr SPRN_MD_RPN, r11
820#endif 823#endif
821 824
822 /* Since the cache is enabled according to the information we 825 /* Since the cache is enabled according to the information we
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index 6c2a471ea6c0..32d466441ac2 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -33,6 +33,7 @@
33#include <linux/reboot.h> 33#include <linux/reboot.h>
34#include <linux/device.h> 34#include <linux/device.h>
35#include <linux/platform_device.h> 35#include <linux/platform_device.h>
36#include <linux/mutex.h>
36 37
37#include "windfarm.h" 38#include "windfarm.h"
38 39
@@ -48,7 +49,7 @@
48 49
49static LIST_HEAD(wf_controls); 50static LIST_HEAD(wf_controls);
50static LIST_HEAD(wf_sensors); 51static LIST_HEAD(wf_sensors);
51static DECLARE_MUTEX(wf_lock); 52static DEFINE_MUTEX(wf_lock);
52static struct notifier_block *wf_client_list; 53static struct notifier_block *wf_client_list;
53static int wf_client_count; 54static int wf_client_count;
54static unsigned int wf_overtemp; 55static unsigned int wf_overtemp;
@@ -160,12 +161,12 @@ int wf_register_control(struct wf_control *new_ct)
160{ 161{
161 struct wf_control *ct; 162 struct wf_control *ct;
162 163
163 down(&wf_lock); 164 mutex_lock(&wf_lock);
164 list_for_each_entry(ct, &wf_controls, link) { 165 list_for_each_entry(ct, &wf_controls, link) {
165 if (!strcmp(ct->name, new_ct->name)) { 166 if (!strcmp(ct->name, new_ct->name)) {
166 printk(KERN_WARNING "windfarm: trying to register" 167 printk(KERN_WARNING "windfarm: trying to register"
167 " duplicate control %s\n", ct->name); 168 " duplicate control %s\n", ct->name);
168 up(&wf_lock); 169 mutex_unlock(&wf_lock);
169 return -EEXIST; 170 return -EEXIST;
170 } 171 }
171 } 172 }
@@ -175,7 +176,7 @@ int wf_register_control(struct wf_control *new_ct)
175 DBG("wf: Registered control %s\n", new_ct->name); 176 DBG("wf: Registered control %s\n", new_ct->name);
176 177
177 wf_notify(WF_EVENT_NEW_CONTROL, new_ct); 178 wf_notify(WF_EVENT_NEW_CONTROL, new_ct);
178 up(&wf_lock); 179 mutex_unlock(&wf_lock);
179 180
180 return 0; 181 return 0;
181} 182}
@@ -183,9 +184,9 @@ EXPORT_SYMBOL_GPL(wf_register_control);
183 184
184void wf_unregister_control(struct wf_control *ct) 185void wf_unregister_control(struct wf_control *ct)
185{ 186{
186 down(&wf_lock); 187 mutex_lock(&wf_lock);
187 list_del(&ct->link); 188 list_del(&ct->link);
188 up(&wf_lock); 189 mutex_unlock(&wf_lock);
189 190
190 DBG("wf: Unregistered control %s\n", ct->name); 191 DBG("wf: Unregistered control %s\n", ct->name);
191 192
@@ -197,16 +198,16 @@ struct wf_control * wf_find_control(const char *name)
197{ 198{
198 struct wf_control *ct; 199 struct wf_control *ct;
199 200
200 down(&wf_lock); 201 mutex_lock(&wf_lock);
201 list_for_each_entry(ct, &wf_controls, link) { 202 list_for_each_entry(ct, &wf_controls, link) {
202 if (!strcmp(ct->name, name)) { 203 if (!strcmp(ct->name, name)) {
203 if (wf_get_control(ct)) 204 if (wf_get_control(ct))
204 ct = NULL; 205 ct = NULL;
205 up(&wf_lock); 206 mutex_unlock(&wf_lock);
206 return ct; 207 return ct;
207 } 208 }
208 } 209 }
209 up(&wf_lock); 210 mutex_unlock(&wf_lock);
210 return NULL; 211 return NULL;
211} 212}
212EXPORT_SYMBOL_GPL(wf_find_control); 213EXPORT_SYMBOL_GPL(wf_find_control);
@@ -250,12 +251,12 @@ int wf_register_sensor(struct wf_sensor *new_sr)
250{ 251{
251 struct wf_sensor *sr; 252 struct wf_sensor *sr;
252 253
253 down(&wf_lock); 254 mutex_lock(&wf_lock);
254 list_for_each_entry(sr, &wf_sensors, link) { 255 list_for_each_entry(sr, &wf_sensors, link) {
255 if (!strcmp(sr->name, new_sr->name)) { 256 if (!strcmp(sr->name, new_sr->name)) {
256 printk(KERN_WARNING "windfarm: trying to register" 257 printk(KERN_WARNING "windfarm: trying to register"
257 " duplicate sensor %s\n", sr->name); 258 " duplicate sensor %s\n", sr->name);
258 up(&wf_lock); 259 mutex_unlock(&wf_lock);
259 return -EEXIST; 260 return -EEXIST;
260 } 261 }
261 } 262 }
@@ -265,7 +266,7 @@ int wf_register_sensor(struct wf_sensor *new_sr)
265 DBG("wf: Registered sensor %s\n", new_sr->name); 266 DBG("wf: Registered sensor %s\n", new_sr->name);
266 267
267 wf_notify(WF_EVENT_NEW_SENSOR, new_sr); 268 wf_notify(WF_EVENT_NEW_SENSOR, new_sr);
268 up(&wf_lock); 269 mutex_unlock(&wf_lock);
269 270
270 return 0; 271 return 0;
271} 272}
@@ -273,9 +274,9 @@ EXPORT_SYMBOL_GPL(wf_register_sensor);
273 274
274void wf_unregister_sensor(struct wf_sensor *sr) 275void wf_unregister_sensor(struct wf_sensor *sr)
275{ 276{
276 down(&wf_lock); 277 mutex_lock(&wf_lock);
277 list_del(&sr->link); 278 list_del(&sr->link);
278 up(&wf_lock); 279 mutex_unlock(&wf_lock);
279 280
280 DBG("wf: Unregistered sensor %s\n", sr->name); 281 DBG("wf: Unregistered sensor %s\n", sr->name);
281 282
@@ -287,16 +288,16 @@ struct wf_sensor * wf_find_sensor(const char *name)
287{ 288{
288 struct wf_sensor *sr; 289 struct wf_sensor *sr;
289 290
290 down(&wf_lock); 291 mutex_lock(&wf_lock);
291 list_for_each_entry(sr, &wf_sensors, link) { 292 list_for_each_entry(sr, &wf_sensors, link) {
292 if (!strcmp(sr->name, name)) { 293 if (!strcmp(sr->name, name)) {
293 if (wf_get_sensor(sr)) 294 if (wf_get_sensor(sr))
294 sr = NULL; 295 sr = NULL;
295 up(&wf_lock); 296 mutex_unlock(&wf_lock);
296 return sr; 297 return sr;
297 } 298 }
298 } 299 }
299 up(&wf_lock); 300 mutex_unlock(&wf_lock);
300 return NULL; 301 return NULL;
301} 302}
302EXPORT_SYMBOL_GPL(wf_find_sensor); 303EXPORT_SYMBOL_GPL(wf_find_sensor);
@@ -329,7 +330,7 @@ int wf_register_client(struct notifier_block *nb)
329 struct wf_control *ct; 330 struct wf_control *ct;
330 struct wf_sensor *sr; 331 struct wf_sensor *sr;
331 332
332 down(&wf_lock); 333 mutex_lock(&wf_lock);
333 rc = notifier_chain_register(&wf_client_list, nb); 334 rc = notifier_chain_register(&wf_client_list, nb);
334 if (rc != 0) 335 if (rc != 0)
335 goto bail; 336 goto bail;
@@ -341,19 +342,19 @@ int wf_register_client(struct notifier_block *nb)
341 if (wf_client_count == 1) 342 if (wf_client_count == 1)
342 wf_start_thread(); 343 wf_start_thread();
343 bail: 344 bail:
344 up(&wf_lock); 345 mutex_unlock(&wf_lock);
345 return rc; 346 return rc;
346} 347}
347EXPORT_SYMBOL_GPL(wf_register_client); 348EXPORT_SYMBOL_GPL(wf_register_client);
348 349
349int wf_unregister_client(struct notifier_block *nb) 350int wf_unregister_client(struct notifier_block *nb)
350{ 351{
351 down(&wf_lock); 352 mutex_lock(&wf_lock);
352 notifier_chain_unregister(&wf_client_list, nb); 353 notifier_chain_unregister(&wf_client_list, nb);
353 wf_client_count++; 354 wf_client_count++;
354 if (wf_client_count == 0) 355 if (wf_client_count == 0)
355 wf_stop_thread(); 356 wf_stop_thread();
356 up(&wf_lock); 357 mutex_unlock(&wf_lock);
357 358
358 return 0; 359 return 0;
359} 360}
@@ -361,23 +362,23 @@ EXPORT_SYMBOL_GPL(wf_unregister_client);
361 362
362void wf_set_overtemp(void) 363void wf_set_overtemp(void)
363{ 364{
364 down(&wf_lock); 365 mutex_lock(&wf_lock);
365 wf_overtemp++; 366 wf_overtemp++;
366 if (wf_overtemp == 1) { 367 if (wf_overtemp == 1) {
367 printk(KERN_WARNING "windfarm: Overtemp condition detected !\n"); 368 printk(KERN_WARNING "windfarm: Overtemp condition detected !\n");
368 wf_overtemp_counter = 0; 369 wf_overtemp_counter = 0;
369 wf_notify(WF_EVENT_OVERTEMP, NULL); 370 wf_notify(WF_EVENT_OVERTEMP, NULL);
370 } 371 }
371 up(&wf_lock); 372 mutex_unlock(&wf_lock);
372} 373}
373EXPORT_SYMBOL_GPL(wf_set_overtemp); 374EXPORT_SYMBOL_GPL(wf_set_overtemp);
374 375
375void wf_clear_overtemp(void) 376void wf_clear_overtemp(void)
376{ 377{
377 down(&wf_lock); 378 mutex_lock(&wf_lock);
378 WARN_ON(wf_overtemp == 0); 379 WARN_ON(wf_overtemp == 0);
379 if (wf_overtemp == 0) { 380 if (wf_overtemp == 0) {
380 up(&wf_lock); 381 mutex_unlock(&wf_lock);
381 return; 382 return;
382 } 383 }
383 wf_overtemp--; 384 wf_overtemp--;
@@ -385,7 +386,7 @@ void wf_clear_overtemp(void)
385 printk(KERN_WARNING "windfarm: Overtemp condition cleared !\n"); 386 printk(KERN_WARNING "windfarm: Overtemp condition cleared !\n");
386 wf_notify(WF_EVENT_NORMALTEMP, NULL); 387 wf_notify(WF_EVENT_NORMALTEMP, NULL);
387 } 388 }
388 up(&wf_lock); 389 mutex_unlock(&wf_lock);
389} 390}
390EXPORT_SYMBOL_GPL(wf_clear_overtemp); 391EXPORT_SYMBOL_GPL(wf_clear_overtemp);
391 392
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 5b2bd4eefb01..cbd297f44cce 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -222,5 +222,7 @@ extern int of_address_to_resource(struct device_node *dev, int index,
222extern int of_pci_address_to_resource(struct device_node *dev, int bar, 222extern int of_pci_address_to_resource(struct device_node *dev, int bar,
223 struct resource *r); 223 struct resource *r);
224 224
225extern void kdump_move_device_tree(void);
226
225#endif /* __KERNEL__ */ 227#endif /* __KERNEL__ */
226#endif /* _POWERPC_PROM_H */ 228#endif /* _POWERPC_PROM_H */