diff options
Diffstat (limited to 'arch/powerpc/platforms/chrp/pci.c')
-rw-r--r-- | arch/powerpc/platforms/chrp/pci.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c index 82c429d487f3..00c52f27ef4f 100644 --- a/arch/powerpc/platforms/chrp/pci.c +++ b/arch/powerpc/platforms/chrp/pci.c | |||
@@ -135,12 +135,13 @@ int __init | |||
135 | hydra_init(void) | 135 | hydra_init(void) |
136 | { | 136 | { |
137 | struct device_node *np; | 137 | struct device_node *np; |
138 | struct resource r; | ||
138 | 139 | ||
139 | np = find_devices("mac-io"); | 140 | np = find_devices("mac-io"); |
140 | if (np == NULL || np->n_addrs == 0) | 141 | if (np == NULL || of_address_to_resource(np, 0, &r)) |
141 | return 0; | 142 | return 0; |
142 | Hydra = ioremap(np->addrs[0].address, np->addrs[0].size); | 143 | Hydra = ioremap(r.start, r.end-r.start); |
143 | printk("Hydra Mac I/O at %lx\n", np->addrs[0].address); | 144 | printk("Hydra Mac I/O at %lx\n", r.start); |
144 | printk("Hydra Feature_Control was %x", | 145 | printk("Hydra Feature_Control was %x", |
145 | in_le32(&Hydra->Feature_Control)); | 146 | in_le32(&Hydra->Feature_Control)); |
146 | out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN | | 147 | out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN | |
@@ -177,18 +178,24 @@ setup_python(struct pci_controller *hose, struct device_node *dev) | |||
177 | { | 178 | { |
178 | u32 __iomem *reg; | 179 | u32 __iomem *reg; |
179 | u32 val; | 180 | u32 val; |
180 | unsigned long addr = dev->addrs[0].address; | 181 | struct resource r; |
181 | 182 | ||
182 | setup_indirect_pci(hose, addr + 0xf8000, addr + 0xf8010); | 183 | if (of_address_to_resource(dev, 0, &r)) { |
184 | printk(KERN_ERR "No address for Python PCI controller\n"); | ||
185 | return; | ||
186 | } | ||
183 | 187 | ||
184 | /* Clear the magic go-slow bit */ | 188 | /* Clear the magic go-slow bit */ |
185 | reg = ioremap(dev->addrs[0].address + 0xf6000, 0x40); | 189 | reg = ioremap(r.start + 0xf6000, 0x40); |
190 | BUG_ON(!reg); | ||
186 | val = in_be32(®[12]); | 191 | val = in_be32(®[12]); |
187 | if (val & PRG_CL_RESET_VALID) { | 192 | if (val & PRG_CL_RESET_VALID) { |
188 | out_be32(®[12], val & ~PRG_CL_RESET_VALID); | 193 | out_be32(®[12], val & ~PRG_CL_RESET_VALID); |
189 | in_be32(®[12]); | 194 | in_be32(®[12]); |
190 | } | 195 | } |
191 | iounmap(reg); | 196 | iounmap(reg); |
197 | |||
198 | setup_indirect_pci(hose, r.start + 0xf8000, r.start + 0xf8010); | ||
192 | } | 199 | } |
193 | 200 | ||
194 | /* Marvell Discovery II based Pegasos 2 */ | 201 | /* Marvell Discovery II based Pegasos 2 */ |
@@ -218,7 +225,7 @@ chrp_find_bridges(void) | |||
218 | char *model, *machine; | 225 | char *model, *machine; |
219 | int is_longtrail = 0, is_mot = 0, is_pegasos = 0; | 226 | int is_longtrail = 0, is_mot = 0, is_pegasos = 0; |
220 | struct device_node *root = find_path_device("/"); | 227 | struct device_node *root = find_path_device("/"); |
221 | 228 | struct resource r; | |
222 | /* | 229 | /* |
223 | * The PCI host bridge nodes on some machines don't have | 230 | * The PCI host bridge nodes on some machines don't have |
224 | * properties to adequately identify them, so we have to | 231 | * properties to adequately identify them, so we have to |
@@ -238,7 +245,7 @@ chrp_find_bridges(void) | |||
238 | continue; | 245 | continue; |
239 | ++index; | 246 | ++index; |
240 | /* The GG2 bridge on the LongTrail doesn't have an address */ | 247 | /* The GG2 bridge on the LongTrail doesn't have an address */ |
241 | if (dev->n_addrs < 1 && !is_longtrail) { | 248 | if (of_address_to_resource(dev, 0, &r) && !is_longtrail) { |
242 | printk(KERN_WARNING "Can't use %s: no address\n", | 249 | printk(KERN_WARNING "Can't use %s: no address\n", |
243 | dev->full_name); | 250 | dev->full_name); |
244 | continue; | 251 | continue; |
@@ -255,8 +262,8 @@ chrp_find_bridges(void) | |||
255 | printk(KERN_INFO "PCI buses %d..%d", | 262 | printk(KERN_INFO "PCI buses %d..%d", |
256 | bus_range[0], bus_range[1]); | 263 | bus_range[0], bus_range[1]); |
257 | printk(" controlled by %s", dev->type); | 264 | printk(" controlled by %s", dev->type); |
258 | if (dev->n_addrs > 0) | 265 | if (!is_longtrail) |
259 | printk(" at %lx", dev->addrs[0].address); | 266 | printk(" at %lx", r.start); |
260 | printk("\n"); | 267 | printk("\n"); |
261 | 268 | ||
262 | hose = pcibios_alloc_controller(); | 269 | hose = pcibios_alloc_controller(); |