powerpc: Fix boot hang regression on MPC8544DS

Commit 00c5372d37a78990c1530184a9c792ee60a30067 caused the MPC8544DS
board to hang at boot. The MPC8544DS is unique in that it doesn't use
the PCI slots on the ULI (unlike the MPC8572DS or MPC8610HPCD). So
the dummy read at the end of the address space causes us to hang.

We can detect the situation by comparing the bridge's BARs versus
the root complex.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

+11 -1
+11 -1
arch/powerpc/platforms/fsl_uli1575.c
··· 219 219 int i; 220 220 u8 *dummy; 221 221 struct pci_bus *bus = dev->bus; 222 + resource_size_t end = 0; 223 + 224 + for (i = PCI_BRIDGE_RESOURCES; i < PCI_BRIDGE_RESOURCES+3; i++) { 225 + unsigned long flags = pci_resource_flags(dev, i); 226 + if ((flags & (IORESOURCE_MEM|IORESOURCE_PREFETCH)) == IORESOURCE_MEM) 227 + end = pci_resource_end(dev, i); 228 + } 222 229 223 230 for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { 224 231 if ((bus->resource[i]) && 225 232 (bus->resource[i]->flags & IORESOURCE_MEM)) { 226 - dummy = ioremap(bus->resource[i]->end - 3, 0x4); 233 + if (bus->resource[i]->end == end) 234 + dummy = ioremap(bus->resource[i]->start, 0x4); 235 + else 236 + dummy = ioremap(bus->resource[i]->end - 3, 0x4); 227 237 if (dummy) { 228 238 in_8(dummy); 229 239 iounmap(dummy);