summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/pci
AgeCommit message (Collapse)Author
2011-10-29Make sure we don't accidentally use ISA or EISA interrupt mappings on PCIMark Kettenis
busses. tested by krw@
2011-10-13I'm sick and tired of people doing misalgned reads and writes to PCI configMark Kettenis
space and not noticing because they only test on amd64. So enforce alignment there as well, at least for a little while such that we find those bugs and force people to fix them.
2011-06-18Cleanup MSI code a bit by moving the code to eanble/disable MSIs intoMark Kettenis
separate functions and install them as route/unroute functions for the MIS pseudo-PIC.
2011-06-16QEMU pretends to emulate a different prehistoric Intel host bridge.Mark Kettenis
From Brad.
2011-06-05Disable MSIs in pci_intr_disestablish() when appropriate.Mark Kettenis
2011-06-05Direct MSIs at the appropriate CPU.Mark Kettenis
2011-06-02In the land of VMWare you can have the latest 64-bit AMD multicore CPUMark Kettenis
behind a prehistoric Intel host bridge. Disable MSI on these contortion.
2011-05-30Enable MSI on selected hardware. For now this means all Intel, AMD and NVIDIAMark Kettenis
chipsets. All of those that support 64-bit CPUs should support MSI as well. Explicitly disable MSI on chipsets that connect to the CPU over HyperTransport. Enabling MSI on those systems is handled by the HyperTransport support code in our PCI subsystem.
2011-05-29Don't attempt to use MSI if we're not running in APIC mode.Mark Kettenis
2011-05-21First stab at suporting Message Signaled Interrupts on amd64. UnfortunatelyMark Kettenis
this code differs somewhat from the i386 code because the amd64 interrupt subsystem is quite different. Still disabled like on i386.
2011-04-22Stop printing the PCI interrupt line programmed by the BIOS for APICMark Kettenis
interrupts. It is irreleveant, confuses people and the information is available in pcidump(8) output anyway. ok oga@, jsg@, deraadt@
2011-04-10Extend the PCI memory address space to 36-bit. The first BIOSen that assignMark Kettenis
addresses >4GB to 64-bit BARs have started to appear. But as long as machines still support running 32-bit operating systems we don't expect to see BARs that aren't addressable using PAE. Fixes a panic reported by william@. ok deraadt@
2011-04-02Remove the AMD GART based iommu code.Owain Ainsworth
With current strategies to put memory in the ``correct'' place it isn't needed. There's also the problem that it did not work on all machines, failing completely on some and utterly breaking DMA. So just remove it. If anyone needs it it will be in the Attic. ok deraadt@
2011-01-10Only use MMCFG extended PCIe config space. Gets us back the on-CPU PCI ↵Mark Kettenis
devices on AMD Family 0Fh processors.
2011-01-09Only use memory mapped extended PCIe config space access for the bussesMark Kettenis
advertised in the MCFG table, and fall back on the traditional method for other busses. Fixes issue reported by henning@.
2011-01-04Add support for Memory Mapped Configuration space access. This gives usMark Kettenis
access to PCIe extended configuration space access on modern i386 and amd64 machines.
2010-12-04Introduce a new pci routine, pci_conf_size(), which returns the size of aMiod Vallat
given pcitag_t configuration address space. Currently, all pci controllers will return the usual 0x100 bytes of PCI configuration space, but this will eventually change on PCIe-capable controlers. ok kettenis@
2010-09-10Provide a bus_dmamap_sync() implementation for the IOMMU. Fixes bigmem.Mark Kettenis
tested by naddy@, ok dlg@
2010-09-06Make sure bus_dmamap_sync() always involves a function call, to prevent theMark Kettenis
compiler from doing stupid things like reordering stores around it. There is some debate whether this will be enough for newer versions of GCC and LLVM. If this is indeed deemed necessary, this will be addressed in a future diff. ok miod@, oga@
2010-08-31Add DVACT_QUIECE support. This is called before splhigh() and beforeTheo de Raadt
DVACT_SUSPEND, therefore DVACT_QUIECE can do standard sleeping operations to get ready. Discussed quite a while back with kettenis and jakemsr, oga suddenly needed it as well and wrote half of it, so it was time to finish it. proofread by miod.
2010-08-31pchbactivate should return result of config_activate_childrenTheo de Raadt
2010-08-07On resume, re-activate the host RNG on the host bridges that need it.Theo de Raadt
ok kettenis
2010-07-08Add mapping for ACPI device to PCI bdf (match autoconf tree)Jordan Hargrave
Simplify resource parsing function to use buffer argument Convert namespace linked lists to use queue macros ok marco@, deraadt@
2010-07-08use config_activate_children to get down to the isa bus activation codeTheo de Raadt
2010-07-01Backout recent AML changes, breaks on R210 and othersJordan Hargrave
2010-06-29Add support for mapping ACPI to PCI devicesJordan Hargrave
ok kettenis, deraadt
2010-06-24The new AMD Opteron CPUs have up to 4 HyperTransport links instead of 3.Mark Kettenis
ok dlg@
2010-05-10Continue with the horrible habit of using agp_machdep.c for agp related MDOwain Ainsworth
things that there really isn't a decent api for elsewhere. Since on recent intel IGPs the gtt aperture is too big (256meg is not uncommon) to be mapped on a kva-constrained arch like i386, introduce an agp mapping api that does things depending on arch. On amd64 which can afford the space (and will use the direct mapping again soon)just do bus_space_map() on init, then parcels things out using bus_space_subregion(), thus avoiding map/unmap overhead on every call (this is how inteldrm does things right now). On i386, we do bus_space_map() and bus_space_unmap as appropriate. Linux has some tricks here involving ``atomic'' maps that are on only one cpu and that you may not sleep with to avoid the ipi overhead for tlb flushing. For now we don't go down that route but it is being considered. I am also considering if it is worth abstracting this a little more, improving the api and making it a general MD interface. Tested by myself on i386 and amd64 and by drahn@ (who has one of the machines with an aperture that is too big) on i386.
2010-04-08Fill in the bus_dma_sync for intagp to use clflush instead of wbinvd()Owain Ainsworth
if supported. When we do memory management on intel this would lead to a LOT of wbinvd() to deal with gpu->cpu incoherency. no one wants that. Needed for sanity of inteldrm memory management which is coming up next.
2010-04-02For the VT8251 host bridge, only attach the pci bus is non-zero, otherwiseMark Kettenis
keep attaching bus 0 forever. tested by mk@
2010-02-09Switching the strange VIA VT8251 PCIE host bridge into a PCI-PCI bridgeMark Kettenis
didn't quite work since the bridge seems to end up largely unconfigured, and our PCI resource configuration code isn't quite smart enough (yet) to fix things up. So instead switch it only into PCI-PCI bridge mode long enough to snoop the bus number, and attach pci(4) using that number. This is probably safer anyway, since ACPI may not like us switching things around behind its back. Fixes PR 6253 & 6304.
2009-11-23pchb must walk children tooTheo de Raadt
2009-09-28Make video buffer area and BIOS areas unavailable for PCI resource allocation.Mark Kettenis
This should prevent problems on systems where these areas are not reserved in the BIOS memory map. ok miod@, oga@, marco@
2009-09-18For some dark reason there's a bit on the VLINK device of this chipsetMark Kettenis
that makes the PCIE device show up as a host bridge instead of a PCI-PCI bridge. As a result any devices sitting behind it won't be detected. Whack the device into PCI-PCI mode such that we can walk the PCI bus hierarchy the normal way and detect all devices. Fixes PR 6215. ok dlg@
2009-08-22Constify the what/name parameter of pci_intr_establish().Michael Knudsen
Tested by myself, sthen, oga, kettenis, and jasper. Input from sthen and jasper. ok kettenis (Manpage follows shortly.)
2009-07-20Pass a pci_chipset_tag_t to pci_intr_line(), to eventually allow theMiod Vallat
logic to be chipset dependent; no functional change yet. ok kettenis@
2009-06-14Make sure the pglist is TAILQ_INIT()'ed before invoking uvm_pglistalloc().Miod Vallat
ok deraadt@ kettenis@
2009-06-06add an interface to agp to create a bus_dma_tag over a range of theOwain Ainsworth
aperture, which will take your memory, bind it to agp, and return you the aperture address. It's essentially the same as iommu on amd64 in the way it works. This will be used by the upcoming (works but is slow and will not be enabled at first) drm memory management code for intel igp chipsets. Right now the sync function for intagp is really slow (doing a wbinvd() on every sync), this is in the process of getting fixed, but the size of the diffs in my trees was getting silly.
2009-06-06option X86EMU is how this subsystem is brought into a kernelTheo de Raadt
2009-06-06fix include pathsTheo de Raadt
2009-06-06Add vga bios repost support. Fetched from the NetBSD tree mostly.Paul Irofti
Tested on multiple i386 and it works, amd64 works also with a few exceptions that will get fixed. The initial effort of importing was done by oga@, thanks! Lots of testing and debugging by mlarkin@ and me. Okay deraadt@, oga@, mlarkin@.
2009-05-18Add missing breaks so we don't fallthrough intoJonathan Gray
unwanted matching logic. ok oga@ deraadt@ miod@
2009-05-07Move amas device from arch/amd64 to dev/pci and enable it in i386 as well.Ariane van der Steldt
amas defaults to disabled on both amd64 and i386. "Go for it!" kettenis@
2009-05-04type pedantry.Owain Ainsworth
the type we bind to an iommu or a GART is paddr_t, by definition, on the other hand, the type we get out of it is not a vaddr_t, it's bus_addr_t. fix up sparc64 iommu, amd64 iommu and the sg_dma backedn that uses it to realise this. ok kettenis@
2009-04-29Extend pciio extents to cover the while 32-bit address space. The processorMark Kettenis
can only address the first 64K but BARs can contain garbage and addresses beyond the end of the extent would cause a panic.
2009-04-21Simplify PCI config space access code. There is no way we're ever going toMark Kettenis
see the ancient mode 2 on machines capable of running OpenBSD/amd64. ok deraadt@, toby@, oga@
2009-04-21add a sg_dma backend for amd64 bus_dma. This is a lot more clever aboutOwain Ainsworth
mapping to the gart than the old code, and shouldn't conflict with bouncebuffers when they're added. This is essentially the sparc64 iommu code that's been modularised a bit so I can eventually use the same code for agp-based dma for memory managed drm drivers. Now, this would overflow ramdiskA, so iommu and sg_dma are now #ifndef SMALL_KERNEL. ok kettenis@, marco@. SMALL_KERNEL discussions with deraadt.
2009-04-20fixed style, no binary changeAriane van der Steldt
2009-04-20amas device for amd64, describes the physical memory layout on AMD64 CPU.Ariane van der Steldt
Replaces pchb with amas for the AMD64 address map. amas0 at pci0 dev 24 function 1 "AMD AMD64 0Fh Address Map" rev 0x00 Currently disabled (causing pchb to attach instead). ok art@
2009-04-15The current iommu code only touches the hardware if the bios did notOwain Ainsworth
enable it (I have found the code that does enable it problematic on quite a few machines, however, that's a different issue). So provide some code that so if the bios initialised the iommu for us, we'll use what it gave us. Makes iommu work on a machine of todd's. while i'm here, we don't need to scan all pci functoins to find the hypertransport bridge. the gart is always on function 3, so just scan for all the bridges and not iterate over the functions too. Thanks to todd for his infinite patience while I gave him diffs that went ``Boom!''.