diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-05-25 18:49:59 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-29 05:49:41 -0400 |
commit | 5cbc30737398b49f62ae8603129ce43ac7db1a41 (patch) | |
tree | 45d01a686865e6fd9c32b670f77af1e37db03008 /arch/sparc64/kernel/traps.c | |
parent | e01c0d6d8cf29c1c11725837b265598cab687952 (diff) |
[SPARC64]: Use machine description and OBP properly for cpu probing.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/traps.c')
-rw-r--r-- | arch/sparc64/kernel/traps.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index d0fde36395b4..00a9e3286c83 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -795,8 +795,7 @@ extern unsigned int cheetah_deferred_trap_vector[], cheetah_deferred_trap_vector | |||
795 | void __init cheetah_ecache_flush_init(void) | 795 | void __init cheetah_ecache_flush_init(void) |
796 | { | 796 | { |
797 | unsigned long largest_size, smallest_linesize, order, ver; | 797 | unsigned long largest_size, smallest_linesize, order, ver; |
798 | struct device_node *dp; | 798 | int i, sz; |
799 | int i, instance, sz; | ||
800 | 799 | ||
801 | /* Scan all cpu device tree nodes, note two values: | 800 | /* Scan all cpu device tree nodes, note two values: |
802 | * 1) largest E-cache size | 801 | * 1) largest E-cache size |
@@ -805,18 +804,20 @@ void __init cheetah_ecache_flush_init(void) | |||
805 | largest_size = 0UL; | 804 | largest_size = 0UL; |
806 | smallest_linesize = ~0UL; | 805 | smallest_linesize = ~0UL; |
807 | 806 | ||
808 | instance = 0; | 807 | for (i = 0; i < NR_CPUS; i++) { |
809 | while (!cpu_find_by_instance(instance, &dp, NULL)) { | ||
810 | unsigned long val; | 808 | unsigned long val; |
811 | 809 | ||
812 | val = of_getintprop_default(dp, "ecache-size", | 810 | val = cpu_data(i).ecache_size; |
813 | (2 * 1024 * 1024)); | 811 | if (!val) |
812 | continue; | ||
813 | |||
814 | if (val > largest_size) | 814 | if (val > largest_size) |
815 | largest_size = val; | 815 | largest_size = val; |
816 | val = of_getintprop_default(dp, "ecache-line-size", 64); | 816 | |
817 | val = cpu_data(i).ecache_line_size; | ||
817 | if (val < smallest_linesize) | 818 | if (val < smallest_linesize) |
818 | smallest_linesize = val; | 819 | smallest_linesize = val; |
819 | instance++; | 820 | |
820 | } | 821 | } |
821 | 822 | ||
822 | if (largest_size == 0UL || smallest_linesize == ~0UL) { | 823 | if (largest_size == 0UL || smallest_linesize == ~0UL) { |
@@ -2564,7 +2565,15 @@ void __init trap_init(void) | |||
2564 | (TRAP_PER_CPU_TSB_HUGE_TEMP != | 2565 | (TRAP_PER_CPU_TSB_HUGE_TEMP != |
2565 | offsetof(struct trap_per_cpu, tsb_huge_temp)) || | 2566 | offsetof(struct trap_per_cpu, tsb_huge_temp)) || |
2566 | (TRAP_PER_CPU_IRQ_WORKLIST != | 2567 | (TRAP_PER_CPU_IRQ_WORKLIST != |
2567 | offsetof(struct trap_per_cpu, irq_worklist))) | 2568 | offsetof(struct trap_per_cpu, irq_worklist)) || |
2569 | (TRAP_PER_CPU_CPU_MONDO_QMASK != | ||
2570 | offsetof(struct trap_per_cpu, cpu_mondo_qmask)) || | ||
2571 | (TRAP_PER_CPU_DEV_MONDO_QMASK != | ||
2572 | offsetof(struct trap_per_cpu, dev_mondo_qmask)) || | ||
2573 | (TRAP_PER_CPU_RESUM_QMASK != | ||
2574 | offsetof(struct trap_per_cpu, resum_qmask)) || | ||
2575 | (TRAP_PER_CPU_NONRESUM_QMASK != | ||
2576 | offsetof(struct trap_per_cpu, nonresum_qmask))) | ||
2568 | trap_per_cpu_offsets_are_bolixed_dave(); | 2577 | trap_per_cpu_offsets_are_bolixed_dave(); |
2569 | 2578 | ||
2570 | if ((TSB_CONFIG_TSB != | 2579 | if ((TSB_CONFIG_TSB != |