diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-03-09 01:28:17 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 04:55:13 -0400 |
commit | 3487a1f9e719d36c9b2d4d492994b2dd815a58b7 (patch) | |
tree | 34d5ef82a837ff61413a40fa9ce6d06a9bfbc65a /arch/sparc64/kernel/pci_common.c | |
parent | 229177c7f38d6a2b1285b42da4b19d76346b4bac (diff) |
[SPARC64]: Kill PBM ranges software state.
It is only used in one spot and we can just fetch the
OF property right there.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_common.c')
-rw-r--r-- | arch/sparc64/kernel/pci_common.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c index 4945d700a769..6b5c8e7a3eb0 100644 --- a/arch/sparc64/kernel/pci_common.c +++ b/arch/sparc64/kernel/pci_common.c | |||
@@ -73,17 +73,28 @@ static void pci_register_iommu_region(struct pci_pbm_info *pbm) | |||
73 | 73 | ||
74 | void pci_determine_mem_io_space(struct pci_pbm_info *pbm) | 74 | void pci_determine_mem_io_space(struct pci_pbm_info *pbm) |
75 | { | 75 | { |
76 | struct linux_prom_pci_ranges *pbm_ranges; | ||
76 | int i, saw_mem, saw_io; | 77 | int i, saw_mem, saw_io; |
78 | int num_pbm_ranges; | ||
77 | 79 | ||
78 | saw_mem = saw_io = 0; | 80 | saw_mem = saw_io = 0; |
79 | for (i = 0; i < pbm->num_pbm_ranges; i++) { | 81 | pbm_ranges = of_get_property(pbm->prom_node, "ranges", &i); |
80 | struct linux_prom_pci_ranges *pr = &pbm->pbm_ranges[i]; | 82 | num_pbm_ranges = i / sizeof(*pbm_ranges); |
83 | |||
84 | for (i = 0; i < num_pbm_ranges; i++) { | ||
85 | struct linux_prom_pci_ranges *pr = &pbm_ranges[i]; | ||
81 | unsigned long a; | 86 | unsigned long a; |
87 | u32 parent_phys_hi, parent_phys_lo; | ||
82 | int type; | 88 | int type; |
83 | 89 | ||
90 | parent_phys_hi = pr->parent_phys_hi; | ||
91 | parent_phys_lo = pr->parent_phys_lo; | ||
92 | if (tlb_type == hypervisor) | ||
93 | parent_phys_hi &= 0x0fffffff; | ||
94 | |||
84 | type = (pr->child_phys_hi >> 24) & 0x3; | 95 | type = (pr->child_phys_hi >> 24) & 0x3; |
85 | a = (((unsigned long)pr->parent_phys_hi << 32UL) | | 96 | a = (((unsigned long)parent_phys_hi << 32UL) | |
86 | ((unsigned long)pr->parent_phys_lo << 0UL)); | 97 | ((unsigned long)parent_phys_lo << 0UL)); |
87 | 98 | ||
88 | switch (type) { | 99 | switch (type) { |
89 | case 0: | 100 | case 0: |