Browse Source

[PATCH] ppc32: Fix MPC52xx PCI init in cas the bootloader didn't do it

We were counting on the bootloader to init some stuff, like get the bus out of
reset and enable accesses.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Sylvain Munaut 19 years ago
parent
commit
041cb6241f
1 changed files with 6 additions and 4 deletions
  1. 6 4
      arch/ppc/syslib/mpc52xx_pci.c

+ 6 - 4
arch/ppc/syslib/mpc52xx_pci.c

@@ -154,9 +154,12 @@ static struct pci_ops mpc52xx_pci_ops = {
 static void __init
 static void __init
 mpc52xx_pci_setup(struct mpc52xx_pci __iomem *pci_regs)
 mpc52xx_pci_setup(struct mpc52xx_pci __iomem *pci_regs)
 {
 {
+	u32 tmp;
 
 
 	/* Setup control regs */
 	/* Setup control regs */
-		/* Nothing to do afaik */
+	tmp = in_be32(&pci_regs->scr);
+	tmp |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
+	out_be32(&pci_regs->scr, tmp);
 
 
 	/* Setup windows */
 	/* Setup windows */
 	out_be32(&pci_regs->iw0btar, MPC52xx_PCI_IWBTAR_TRANSLATION(
 	out_be32(&pci_regs->iw0btar, MPC52xx_PCI_IWBTAR_TRANSLATION(
@@ -197,13 +200,12 @@ mpc52xx_pci_setup(struct mpc52xx_pci __iomem *pci_regs)
 	/* Not necessary and can be a bad thing if for example the bootloader
 	/* Not necessary and can be a bad thing if for example the bootloader
 	   is displaying a splash screen or ... Just left here for
 	   is displaying a splash screen or ... Just left here for
 	   documentation purpose if anyone need it */
 	   documentation purpose if anyone need it */
-#if 0
-	u32 tmp;
 	tmp = in_be32(&pci_regs->gscr);
 	tmp = in_be32(&pci_regs->gscr);
+#if 0
 	out_be32(&pci_regs->gscr, tmp | MPC52xx_PCI_GSCR_PR);
 	out_be32(&pci_regs->gscr, tmp | MPC52xx_PCI_GSCR_PR);
 	udelay(50);
 	udelay(50);
-	out_be32(&pci_regs->gscr, tmp);
 #endif
 #endif
+	out_be32(&pci_regs->gscr, tmp & ~MPC52xx_PCI_GSCR_PR);
 }
 }
 
 
 static void
 static void