sh: pci: Set class/sub-class code correctly for SH7780 PCIC.
authorPaul Mundt <lethal@linux-sh.org>
Fri, 17 Apr 2009 05:09:09 +0000 (14:09 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 17 Apr 2009 05:09:09 +0000 (14:09 +0900)
The SH7780 PCI host controller implements a configuration header that
requires a fair bit of hand-holding to initialize properly. By default
it appears as a pre-2.0 host controller given the zeroed out class code,
so fix this up properly.

Some boards that happened to be using the R7780RP version of the PCIC
fixups had set this correctly, but this belongs in the standard
initialization, and is by no means board specific.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/drivers/pci/fixups-sdk7780.c
arch/sh/drivers/pci/pci-sh7780.c

index c295731..004efd4 100644 (file)
@@ -16,8 +16,6 @@
 
 int pci_fixup_pcic(struct pci_channel *chan)
 {
-       ctrl_outl(0x00000001, SH7780_PCI_VCR2);
-
        /* Enable all interrupts, so we know what to fix */
        pci_write_reg(chan, 0x0000C3FF, SH7780_PCIIMR);
        pci_write_reg(chan, 0x0000380F, SH7780_PCIAINTM);
@@ -26,8 +24,6 @@ int pci_fixup_pcic(struct pci_channel *chan)
        pci_write_reg(chan, 0xFB00, SH7780_PCISTATUS);
        pci_write_reg(chan, 0x0047, SH7780_PCICMD);
        pci_write_reg(chan, 0x00, SH7780_PCIPIF);
-       pci_write_reg(chan, 0x00, SH7780_PCISUB);
-       pci_write_reg(chan, 0x06, SH7780_PCIBCC);
        pci_write_reg(chan, 0x1912, SH7780_PCISVID);
        pci_write_reg(chan, 0x0001, SH7780_PCISID);
 
index 45fa423..7f4f590 100644 (file)
@@ -72,16 +72,15 @@ int __init sh7780_pcic_init(struct pci_channel *chan,
 {
        u32 word;
 
+       pci_write_reg(chan, PCI_CLASS_BRIDGE_HOST >> 8, SH7780_PCIBCC);
+       pci_write_reg(chan, PCI_CLASS_BRIDGE_HOST & 0xff, SH7780_PCISUB);
+
        /* set the command/status bits to:
         * Wait Cycle Control + Parity Enable + Bus Master +
         * Mem space enable
         */
        pci_write_reg(chan, 0x00000046, SH7780_PCICMD);
 
-       /* define this host as the host bridge */
-       word = PCI_BASE_CLASS_BRIDGE << 24;
-       pci_write_reg(chan, word, SH7780_PCIRID);
-
        /* Set IO and Mem windows to local address
         * Make PCI and local address the same for easy 1 to 1 mapping
         */