diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-11 23:12:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-11 23:12:57 -0400 |
commit | af3b146d26550f0c8e0d77b2117c6f8aec5d8146 (patch) | |
tree | e8078b0d760cd2a2488d3755b7dee341f3ea61b3 /arch/powerpc/kernel | |
parent | c5b7bede71853d92fc747cdc12fa5234b6045731 (diff) | |
parent | fd4ba7e2b7ce9a48b8c60d5fcd65feda5746812e (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (23 commits)
[POWERPC] Add arch/powerpc support for the Motorola PrPMC2800
[POWERPC] Add bootwrapper support for Motorola PrPMC2800 platform
[POWERPC] Add DTS file for the Motorola PrPMC2800 platform
[POWERPC] Check cache coherency of kernel vs firmware
[POWERPC] Add Marvell mv64x60 PCI bridge support
[POWERPC] Create Marvell mv64x60 I2C platform_data
[POWERPC] Create Marvell mv64x60 ethernet platform_data
[POWERPC] Create Marvell mv64x60 MPSC (serial) platform_data
[POWERPC] Add interrupt support for Marvell mv64x60 chips
[POWERPC] Add bootwrapper support for Marvell/mv64x60 I2C
[POWERPC] Add bootwrapper support for Marvell MPSC
[POWERPC] Add bootwrapper support for Marvell/mv64x60 hostbridge
[POWERPC] Add Makefile rules to wrap dts file in zImage
[POWERPC] Spelling fixes: arch/ppc/
[POWERPC] U-boot passes the initrd as start/end, not start/size.
[POWERPC] PS3: Update ps3_defconfig
[POWERPC] PS3: Fix request_irq warning
[POWERPC] Don't complain if size-cells == 0 in prom_parse()
[POWERPC] Simplify smp_space_timers
[POWERPC] Trivial ps3 warning fixes
...
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/prom_parse.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 41 | ||||
-rw-r--r-- | arch/powerpc/kernel/time.c | 19 |
3 files changed, 44 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index b5c96af955c6..3786dcc8a7b6 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c | |||
@@ -24,7 +24,7 @@ | |||
24 | /* Max address size we deal with */ | 24 | /* Max address size we deal with */ |
25 | #define OF_MAX_ADDR_CELLS 4 | 25 | #define OF_MAX_ADDR_CELLS 4 |
26 | #define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ | 26 | #define OF_CHECK_COUNTS(na, ns) ((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \ |
27 | (ns) > 0) | 27 | (ns) >= 0) |
28 | 28 | ||
29 | static struct of_bus *of_match_bus(struct device_node *np); | 29 | static struct of_bus *of_match_bus(struct device_node *np); |
30 | static int __of_address_to_resource(struct device_node *dev, | 30 | static int __of_address_to_resource(struct device_node *dev, |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 370803722e47..ed07a198f8d6 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -530,3 +530,44 @@ void __init setup_panic(void) | |||
530 | { | 530 | { |
531 | atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); | 531 | atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); |
532 | } | 532 | } |
533 | |||
534 | #ifdef CONFIG_CHECK_CACHE_COHERENCY | ||
535 | /* | ||
536 | * For platforms that have configurable cache-coherency. This function | ||
537 | * checks that the cache coherency setting of the kernel matches the setting | ||
538 | * left by the firmware, as indicated in the device tree. Since a mismatch | ||
539 | * will eventually result in DMA failures, we print * and error and call | ||
540 | * BUG() in that case. | ||
541 | */ | ||
542 | |||
543 | #ifdef CONFIG_NOT_COHERENT_CACHE | ||
544 | #define KERNEL_COHERENCY 0 | ||
545 | #else | ||
546 | #define KERNEL_COHERENCY 1 | ||
547 | #endif | ||
548 | |||
549 | static int __init check_cache_coherency(void) | ||
550 | { | ||
551 | struct device_node *np; | ||
552 | const void *prop; | ||
553 | int devtree_coherency; | ||
554 | |||
555 | np = of_find_node_by_path("/"); | ||
556 | prop = of_get_property(np, "coherency-off", NULL); | ||
557 | of_node_put(np); | ||
558 | |||
559 | devtree_coherency = prop ? 0 : 1; | ||
560 | |||
561 | if (devtree_coherency != KERNEL_COHERENCY) { | ||
562 | printk(KERN_ERR | ||
563 | "kernel coherency:%s != device tree_coherency:%s\n", | ||
564 | KERNEL_COHERENCY ? "on" : "off", | ||
565 | devtree_coherency ? "on" : "off"); | ||
566 | BUG(); | ||
567 | } | ||
568 | |||
569 | return 0; | ||
570 | } | ||
571 | |||
572 | late_initcall(check_cache_coherency); | ||
573 | #endif /* CONFIG_CHECK_CACHE_COHERENCY */ | ||
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 7cedef8f5f70..2c8564d54e4d 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -711,30 +711,15 @@ void wakeup_decrementer(void) | |||
711 | void __init smp_space_timers(unsigned int max_cpus) | 711 | void __init smp_space_timers(unsigned int max_cpus) |
712 | { | 712 | { |
713 | int i; | 713 | int i; |
714 | unsigned long half = tb_ticks_per_jiffy / 2; | ||
715 | unsigned long offset = tb_ticks_per_jiffy / max_cpus; | ||
716 | u64 previous_tb = per_cpu(last_jiffy, boot_cpuid); | 714 | u64 previous_tb = per_cpu(last_jiffy, boot_cpuid); |
717 | 715 | ||
718 | /* make sure tb > per_cpu(last_jiffy, cpu) for all cpus always */ | 716 | /* make sure tb > per_cpu(last_jiffy, cpu) for all cpus always */ |
719 | previous_tb -= tb_ticks_per_jiffy; | 717 | previous_tb -= tb_ticks_per_jiffy; |
720 | /* | 718 | |
721 | * The stolen time calculation for POWER5 shared-processor LPAR | ||
722 | * systems works better if the two threads' timebase interrupts | ||
723 | * are staggered by half a jiffy with respect to each other. | ||
724 | */ | ||
725 | for_each_possible_cpu(i) { | 719 | for_each_possible_cpu(i) { |
726 | if (i == boot_cpuid) | 720 | if (i == boot_cpuid) |
727 | continue; | 721 | continue; |
728 | if (i == (boot_cpuid ^ 1)) | 722 | per_cpu(last_jiffy, i) = previous_tb; |
729 | per_cpu(last_jiffy, i) = | ||
730 | per_cpu(last_jiffy, boot_cpuid) - half; | ||
731 | else if (i & 1) | ||
732 | per_cpu(last_jiffy, i) = | ||
733 | per_cpu(last_jiffy, i ^ 1) + half; | ||
734 | else { | ||
735 | previous_tb += offset; | ||
736 | per_cpu(last_jiffy, i) = previous_tb; | ||
737 | } | ||
738 | } | 723 | } |
739 | } | 724 | } |
740 | #endif | 725 | #endif |