diff options
-rw-r--r-- | arch/powerpc/platforms/52xx/mpc52xx_pci.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c index c3f2c21024e3..87ff522f28b5 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c | |||
@@ -20,14 +20,6 @@ | |||
20 | 20 | ||
21 | 21 | ||
22 | /* ======================================================================== */ | 22 | /* ======================================================================== */ |
23 | /* PCI windows config */ | ||
24 | /* ======================================================================== */ | ||
25 | |||
26 | #define MPC52xx_PCI_TARGET_IO 0xf0000000 | ||
27 | #define MPC52xx_PCI_TARGET_MEM 0x00000000 | ||
28 | |||
29 | |||
30 | /* ======================================================================== */ | ||
31 | /* Structures mapping & Defines for PCI Unit */ | 23 | /* Structures mapping & Defines for PCI Unit */ |
32 | /* ======================================================================== */ | 24 | /* ======================================================================== */ |
33 | 25 | ||
@@ -244,7 +236,7 @@ static struct pci_ops mpc52xx_pci_ops = { | |||
244 | 236 | ||
245 | static void __init | 237 | static void __init |
246 | mpc52xx_pci_setup(struct pci_controller *hose, | 238 | mpc52xx_pci_setup(struct pci_controller *hose, |
247 | struct mpc52xx_pci __iomem *pci_regs) | 239 | struct mpc52xx_pci __iomem *pci_regs, phys_addr_t pci_phys) |
248 | { | 240 | { |
249 | struct resource *res; | 241 | struct resource *res; |
250 | u32 tmp; | 242 | u32 tmp; |
@@ -314,10 +306,14 @@ mpc52xx_pci_setup(struct pci_controller *hose, | |||
314 | /* Set all the IWCR fields at once; they're in the same reg */ | 306 | /* Set all the IWCR fields at once; they're in the same reg */ |
315 | out_be32(&pci_regs->iwcr, MPC52xx_PCI_IWCR_PACK(iwcr0, iwcr1, iwcr2)); | 307 | out_be32(&pci_regs->iwcr, MPC52xx_PCI_IWCR_PACK(iwcr0, iwcr1, iwcr2)); |
316 | 308 | ||
317 | out_be32(&pci_regs->tbatr0, | 309 | /* Map IMMR onto PCI bus */ |
318 | MPC52xx_PCI_TBATR_ENABLE | MPC52xx_PCI_TARGET_IO ); | 310 | pci_phys &= 0xfffc0000; /* bar0 has only 14 significant bits */ |
319 | out_be32(&pci_regs->tbatr1, | 311 | out_be32(&pci_regs->tbatr0, MPC52xx_PCI_TBATR_ENABLE | pci_phys); |
320 | MPC52xx_PCI_TBATR_ENABLE | MPC52xx_PCI_TARGET_MEM ); | 312 | out_be32(&pci_regs->bar0, PCI_BASE_ADDRESS_MEM_PREFETCH | pci_phys); |
313 | |||
314 | /* Map memory onto PCI bus */ | ||
315 | out_be32(&pci_regs->tbatr1, MPC52xx_PCI_TBATR_ENABLE); | ||
316 | out_be32(&pci_regs->bar1, PCI_BASE_ADDRESS_MEM_PREFETCH); | ||
321 | 317 | ||
322 | out_be32(&pci_regs->tcr, MPC52xx_PCI_TCR_LD | MPC52xx_PCI_TCR_WCT8); | 318 | out_be32(&pci_regs->tcr, MPC52xx_PCI_TCR_LD | MPC52xx_PCI_TCR_WCT8); |
323 | 319 | ||
@@ -414,7 +410,7 @@ mpc52xx_add_bridge(struct device_node *node) | |||
414 | 410 | ||
415 | /* Finish setting up PCI using values obtained by | 411 | /* Finish setting up PCI using values obtained by |
416 | * pci_proces_bridge_OF_ranges */ | 412 | * pci_proces_bridge_OF_ranges */ |
417 | mpc52xx_pci_setup(hose, pci_regs); | 413 | mpc52xx_pci_setup(hose, pci_regs, rsrc.start); |
418 | 414 | ||
419 | return 0; | 415 | return 0; |
420 | } | 416 | } |