NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-amd64/38682: PCI_BUS_FIXUP is missing from amd64 port



The following reply was made to PR port-amd64/38682; it has been noted by GNATS.

From: Andrew Doran <ad%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-amd64/38682: PCI_BUS_FIXUP is missing from amd64 port
Date: Sun, 18 May 2008 15:17:57 +0100

 >      I am currently using the following patch as a workaround:
 > 
 > --- pci.c    5 May 2008 20:14:30 -0000       1.117
 > +++ pci.c    18 May 2008 00:52:04 -0000
 > @@ -322,6 +323,16 @@
 >      if ((csr & PCI_COMMAND_MEM_ENABLE) == 0)
 >              pa.pa_flags &= ~PCI_FLAGS_MEM_ENABLED;
 >  
 > +    if (PCI_CLASS(pa.pa_class) == PCI_CLASS_BRIDGE &&
 > +        (pa.pa_flags & PCI_FLAGS_MEM_ENABLED) == 0 &&
 > +        (pa.pa_flags & PCI_FLAGS_IO_ENABLED) != 0) {
 > +            csr |= PCI_COMMAND_MEM_ENABLE;
 > +            pa.pa_flags |= PCI_FLAGS_MEM_ENABLED;
 > +            aprint_normal("PCI: Enabling MEM access in CSR\n");
 > +            pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG,
 > +                csr | PCI_COMMAND_MEM_ENABLE);
 > +    }
 > +
 
 It would be nice to do this by default. A comment from Linux
 drivers/pci/setup-bus.c:
 
 138    PCI-to-PCI Bridge Architecture Specification rev. 1.1 (1998)
 139    requires that if there is no I/O ports or memory behind the
 140    bridge, corresponding range must be turned off by writing base
 141    value greater than limit to the bridge's base/limit registers.
 
 How does it fail at run time without the FIXUP option?
 
 Andrew
 


Home | Main Index | Thread Index | Old Index