summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/pci
AgeCommit message (Collapse)Author
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-01-24Add bus_dmamem_alloc_range(9) to allow drivers to allocate DMA'able memoryMark Kettenis
within a range that is more (or less) restrictive than the default range. ok deraadt@, stsp@
2014-12-16Temporarily expand the pci memory range to suit Dell 13G servers.Jonathan Matthew
They have devices outside the 36 bit range that their firmware needs to talk to, and they get constant acpi interrupts if it can't. We should get the necessary ranges via ACPI, but for now just make the allowed range bigger. ok kettenis@ deraadt@
2014-11-16Replace a plethora of historical protection options with justTheo de Raadt
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
2014-09-20On i386, agp_map_subregion might sleep, which is not allowed in some ofMark Kettenis
the inteldrm code. Fix this by adding new interfaces that can map a single page without sleeping and use that in the execbuffer fast path that needs this "atomic" behaviour. Should fix the panic I've seen under memory pressure on i386.
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-04-19Don't panic if we're trying to disestablish an MSI but the hardware is gone.Mark Kettenis
tested by & ok mlarkin@
2014-04-08No need for <uvm/uvm_page.h>Martin Pieuchot
2014-04-01More <uvm/uvm.h> -> <uvm/uvm_extern.h> cleaning.Martin Pieuchot
ok kettenis@, deraadt@
2014-03-26No need to include <sys/lock.h> when only <sys/rwlock.h> is needed,Martin Pieuchot
so remove the former and include the latter instead of pulling it in <dev/pci/agpvar.h>. This header already requires various other types anyway. While here remove unneeded headers.
2013-12-09Remove MD intagp(4) code that is unused now that inteldrm(4) manages the GTTMark Kettenis
all by itself.
2013-12-07Remove the agp-specific bus_dma code. It is no longer used now thatMark Kettenis
inteldrm(4) manages the GTT by itself. ok miod@
2013-12-06Add a DVACT_WAKEUP op to the *_activate() API. This is called after theTheo de Raadt
kernel resumes normal (non-cold, able to run processes, etc) operation. Previously we were relying on specific DVACT_RESUME op's in drivers creating callback/threads themselves, but that has become too common, indicating the need for a built-in mechanism. ok dlg kettenis, tested by a sufficient amount of people
2013-11-06Add support for Power Resources for Dx states and the necessary hookMartin Pieuchot
for PCI devices. This hook should be called twice, before and after changing the power state of a PCI device. Before setting the device to the new state, the ACPI layer will notify every power resources linked to the device for that state and make sure they are turned "_ON". After changing the state of the device, it will decrement the reference of every power resources linked to that device for the old state and turn them "_OFF" if they are no longer referenced. This fixes the no-USB after resume problem seen on various ThinkPad, problem initialy diagnosed with Alexander Polakov. ok kettenis@, deraadt@
2013-05-30If ACPI is not compiled in, pci_min_powerstate() has no facts to supportTheo de Raadt
is should return D3. It should return the current power state. ok kettenis mlarkin
2013-05-30Enforce ca_activate tree-walks over the entire heirarchy for all events,Theo de Raadt
cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
2013-03-17Add an interface to rebind AGP DMA mappings. To be used by the upcoming KMSMark Kettenis
support to reload bindings after suspend/resume and to update cachability flags in the address translation table entries.
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2012-10-16Change the PCI memory extent to cover the whole 64-bit memory spaceMike Belopuhov
but reserve everything above 36 bits so that the erroneous extent allocation will fail but not panic the system. Fixes the notorious IBM x3100 panic where one of the PCI BARs is programmed with an incorrect 64 bit address. Idea and OK kettenis@, tested by Walter Souza, thanks!
2012-10-08Revamp the sequences for suspend/hibernate -> resume so that the codeTheo de Raadt
paths are reflexive. It is now possible to fail part-way through a suspend sequence, and recover along the resume code path. Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used after hibernate (and suspend too) to finish the job. Some drivers must be converted at the same time to use this instead of shutdown hooks (the others will follow at a later time) ok kettenis mlarkin
2012-09-19Set up PCI bus number resource accounting for the main PCI bus hierarchy.Mark Kettenis
2012-09-07Implement pci_min_powerstate().Mark Kettenis
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.