aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/traps.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-22 02:34:02 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-24 02:15:17 -0400
commit07f8e5f358a0b7240f1dad6b3819f2fd1103f159 (patch)
tree5976cc05de92f27a9cc12a3db31ced5311ac3769 /arch/sparc64/kernel/traps.c
parent6d307724cb6a6b8466cad4fdf13d8a409bc2433f (diff)
[SPARC64]: Convert cpu_find_by_*() interface to in-kernel PROM device tree.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/traps.c')
-rw-r--r--arch/sparc64/kernel/traps.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 5059cbd4feee..1ff34b019f3f 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -42,6 +42,7 @@
42#ifdef CONFIG_KMOD 42#ifdef CONFIG_KMOD
43#include <linux/kmod.h> 43#include <linux/kmod.h>
44#endif 44#endif
45#include <asm/prom.h>
45 46
46ATOMIC_NOTIFIER_HEAD(sparc64die_chain); 47ATOMIC_NOTIFIER_HEAD(sparc64die_chain);
47 48
@@ -807,7 +808,8 @@ extern unsigned int cheetah_deferred_trap_vector[], cheetah_deferred_trap_vector
807void __init cheetah_ecache_flush_init(void) 808void __init cheetah_ecache_flush_init(void)
808{ 809{
809 unsigned long largest_size, smallest_linesize, order, ver; 810 unsigned long largest_size, smallest_linesize, order, ver;
810 int node, i, instance; 811 struct device_node *dp;
812 int i, instance, sz;
811 813
812 /* Scan all cpu device tree nodes, note two values: 814 /* Scan all cpu device tree nodes, note two values:
813 * 1) largest E-cache size 815 * 1) largest E-cache size
@@ -817,14 +819,14 @@ void __init cheetah_ecache_flush_init(void)
817 smallest_linesize = ~0UL; 819 smallest_linesize = ~0UL;
818 820
819 instance = 0; 821 instance = 0;
820 while (!cpu_find_by_instance(instance, &node, NULL)) { 822 while (!cpu_find_by_instance(instance, &dp, NULL)) {
821 unsigned long val; 823 unsigned long val;
822 824
823 val = prom_getintdefault(node, "ecache-size", 825 val = of_getintprop_default(dp, "ecache-size",
824 (2 * 1024 * 1024)); 826 (2 * 1024 * 1024));
825 if (val > largest_size) 827 if (val > largest_size)
826 largest_size = val; 828 largest_size = val;
827 val = prom_getintdefault(node, "ecache-line-size", 64); 829 val = of_getintprop_default(dp, "ecache-line-size", 64);
828 if (val < smallest_linesize) 830 if (val < smallest_linesize)
829 smallest_linesize = val; 831 smallest_linesize = val;
830 instance++; 832 instance++;
@@ -849,16 +851,16 @@ void __init cheetah_ecache_flush_init(void)
849 } 851 }
850 852
851 /* Now allocate error trap reporting scoreboard. */ 853 /* Now allocate error trap reporting scoreboard. */
852 node = NR_CPUS * (2 * sizeof(struct cheetah_err_info)); 854 sz = NR_CPUS * (2 * sizeof(struct cheetah_err_info));
853 for (order = 0; order < MAX_ORDER; order++) { 855 for (order = 0; order < MAX_ORDER; order++) {
854 if ((PAGE_SIZE << order) >= node) 856 if ((PAGE_SIZE << order) >= sz)
855 break; 857 break;
856 } 858 }
857 cheetah_error_log = (struct cheetah_err_info *) 859 cheetah_error_log = (struct cheetah_err_info *)
858 __get_free_pages(GFP_KERNEL, order); 860 __get_free_pages(GFP_KERNEL, order);
859 if (!cheetah_error_log) { 861 if (!cheetah_error_log) {
860 prom_printf("cheetah_ecache_flush_init: Failed to allocate " 862 prom_printf("cheetah_ecache_flush_init: Failed to allocate "
861 "error logging scoreboard (%d bytes).\n", node); 863 "error logging scoreboard (%d bytes).\n", sz);
862 prom_halt(); 864 prom_halt();
863 } 865 }
864 memset(cheetah_error_log, 0, PAGE_SIZE << order); 866 memset(cheetah_error_log, 0, PAGE_SIZE << order);