diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-06-22 23:21:22 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-24 02:15:36 -0400 |
commit | 25c7581bcdd11cf9b82a8ef062a10bea310cc9e9 (patch) | |
tree | c88f4ee5e91fa7921ff13627f373e1bfbcec8b81 /arch/sparc64/kernel | |
parent | 44bdef5e8f2e64ba5974b587989a829d57126bad (diff) |
[SPARC64]: Kill off some more prom_getproperty() remnants.
The remaining ones occur before we have imported the
device tree.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r-- | arch/sparc64/kernel/irq.c | 18 | ||||
-rw-r--r-- | arch/sparc64/kernel/sbus.c | 29 |
2 files changed, 28 insertions, 19 deletions
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index a8c9dc8d1958..2d00ccffc55b 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/iommu.h> | 34 | #include <asm/iommu.h> |
35 | #include <asm/upa.h> | 35 | #include <asm/upa.h> |
36 | #include <asm/oplib.h> | 36 | #include <asm/oplib.h> |
37 | #include <asm/prom.h> | ||
37 | #include <asm/timer.h> | 38 | #include <asm/timer.h> |
38 | #include <asm/smp.h> | 39 | #include <asm/smp.h> |
39 | #include <asm/starfire.h> | 40 | #include <asm/starfire.h> |
@@ -635,23 +636,30 @@ static u64 prom_limit0, prom_limit1; | |||
635 | 636 | ||
636 | static void map_prom_timers(void) | 637 | static void map_prom_timers(void) |
637 | { | 638 | { |
638 | unsigned int addr[3]; | 639 | struct device_node *dp; |
640 | unsigned int *addr; | ||
639 | int tnode, err; | 641 | int tnode, err; |
640 | 642 | ||
641 | /* PROM timer node hangs out in the top level of device siblings... */ | 643 | /* PROM timer node hangs out in the top level of device siblings... */ |
642 | tnode = prom_finddevice("/counter-timer"); | 644 | dp = of_find_node_by_path("/"); |
645 | dp = dp->child; | ||
646 | while (dp) { | ||
647 | if (!strcmp(dp->name, "counter-timer")) | ||
648 | break; | ||
649 | dp = dp->sibling; | ||
650 | } | ||
643 | 651 | ||
644 | /* Assume if node is not present, PROM uses different tick mechanism | 652 | /* Assume if node is not present, PROM uses different tick mechanism |
645 | * which we should not care about. | 653 | * which we should not care about. |
646 | */ | 654 | */ |
647 | if (tnode == 0 || tnode == -1) { | 655 | if (!dp) { |
648 | prom_timers = (struct sun5_timer *) 0; | 656 | prom_timers = (struct sun5_timer *) 0; |
649 | return; | 657 | return; |
650 | } | 658 | } |
651 | 659 | ||
652 | /* If PROM is really using this, it must be mapped by him. */ | 660 | /* If PROM is really using this, it must be mapped by him. */ |
653 | err = prom_getproperty(tnode, "address", (char *)addr, sizeof(addr)); | 661 | addr = of_get_property(dp, "address", NULL); |
654 | if (err == -1) { | 662 | if (!addr) { |
655 | prom_printf("PROM does not have timer mapped, trying to continue.\n"); | 663 | prom_printf("PROM does not have timer mapped, trying to continue.\n"); |
656 | prom_timers = (struct sun5_timer *) 0; | 664 | prom_timers = (struct sun5_timer *) 0; |
657 | return; | 665 | return; |
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c index 8f7877ac858f..a72bba398809 100644 --- a/arch/sparc64/kernel/sbus.c +++ b/arch/sparc64/kernel/sbus.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <asm/cache.h> | 19 | #include <asm/cache.h> |
20 | #include <asm/dma.h> | 20 | #include <asm/dma.h> |
21 | #include <asm/irq.h> | 21 | #include <asm/irq.h> |
22 | #include <asm/prom.h> | ||
22 | #include <asm/starfire.h> | 23 | #include <asm/starfire.h> |
23 | 24 | ||
24 | #include "iommu_common.h" | 25 | #include "iommu_common.h" |
@@ -1098,24 +1099,25 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus) | |||
1098 | } | 1099 | } |
1099 | 1100 | ||
1100 | /* Boot time initialization. */ | 1101 | /* Boot time initialization. */ |
1101 | void __init sbus_iommu_init(int prom_node, struct sbus_bus *sbus) | 1102 | void __init sbus_iommu_init(int __node, struct sbus_bus *sbus) |
1102 | { | 1103 | { |
1103 | struct linux_prom64_registers rprop; | 1104 | struct linux_prom64_registers *pr; |
1105 | struct device_node *dp; | ||
1104 | struct sbus_iommu *iommu; | 1106 | struct sbus_iommu *iommu; |
1105 | unsigned long regs, tsb_base; | 1107 | unsigned long regs, tsb_base; |
1106 | u64 control; | 1108 | u64 control; |
1107 | int err, i; | 1109 | int i; |
1110 | |||
1111 | dp = of_find_node_by_phandle(__node); | ||
1108 | 1112 | ||
1109 | sbus->portid = prom_getintdefault(sbus->prom_node, | 1113 | sbus->portid = of_getintprop_default(dp, "upa-portid", -1); |
1110 | "upa-portid", -1); | ||
1111 | 1114 | ||
1112 | err = prom_getproperty(prom_node, "reg", | 1115 | pr = of_get_property(dp, "reg", NULL); |
1113 | (char *)&rprop, sizeof(rprop)); | 1116 | if (!pr) { |
1114 | if (err < 0) { | ||
1115 | prom_printf("sbus_iommu_init: Cannot map SYSIO control registers.\n"); | 1117 | prom_printf("sbus_iommu_init: Cannot map SYSIO control registers.\n"); |
1116 | prom_halt(); | 1118 | prom_halt(); |
1117 | } | 1119 | } |
1118 | regs = rprop.phys_addr; | 1120 | regs = pr->phys_addr; |
1119 | 1121 | ||
1120 | iommu = kmalloc(sizeof(*iommu) + SMP_CACHE_BYTES, GFP_ATOMIC); | 1122 | iommu = kmalloc(sizeof(*iommu) + SMP_CACHE_BYTES, GFP_ATOMIC); |
1121 | if (iommu == NULL) { | 1123 | if (iommu == NULL) { |
@@ -1228,12 +1230,11 @@ void __init sbus_iommu_init(int prom_node, struct sbus_bus *sbus) | |||
1228 | 1230 | ||
1229 | void sbus_fill_device_irq(struct sbus_dev *sdev) | 1231 | void sbus_fill_device_irq(struct sbus_dev *sdev) |
1230 | { | 1232 | { |
1231 | struct linux_prom_irqs irqs[PROMINTR_MAX]; | 1233 | struct device_node *dp = of_find_node_by_phandle(sdev->prom_node); |
1232 | int len; | 1234 | struct linux_prom_irqs *irqs; |
1233 | 1235 | ||
1234 | len = prom_getproperty(sdev->prom_node, "interrupts", | 1236 | irqs = of_get_property(dp, "interrupts", NULL); |
1235 | (char *) irqs, sizeof(irqs)); | 1237 | if (!irqs) { |
1236 | if (len == -1 || len == 0) { | ||
1237 | sdev->irqs[0] = 0; | 1238 | sdev->irqs[0] = 0; |
1238 | sdev->num_irqs = 0; | 1239 | sdev->num_irqs = 0; |
1239 | } else { | 1240 | } else { |