summaryrefslogtreecommitdiffstats
path: root/hw/pci.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge remote-tracking branch 'origin/master' into pciMichael S. Tsirkin2011-06-151-1/+1
|\ | | | | | | | | Conflicts: hw/virtio-pci.c
| * Fix typo in code and commentsStefan Weil2011-05-061-1/+1
| | | | | | | | | | | | | | Replace writeable -> writable Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | pci: move ids of config space into PCIDeviceInfoIsaku Yamahata2011-06-121-0/+7
|/ | | | | | | | | vender id/device id... in configuration space are read-only registers which are commonly defined for all pci devices. So move those initialization into common place. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: add pci_register_bar_simple() APIAvi Kivity2011-04-071-0/+3
| | | | | | | | This is similar to pci_register_bar(), but automatically registers a single memory region spanning the entire BAR. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: add accessor function to get irq levelsIsaku Yamahata2011-04-011-0/+1
| | | | | | | | | | | Introduce accessor function to know INTx levels. It will be used later by q35. Although piix_pci tracks the intx line levels, it can be eliminated by this helper function. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: use uint8_t for devfn_minIsaku Yamahata2011-03-281-3/+3
| | | | | | | use uint8_t for devfn_min instead of int. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: use devfn for pci_find_device() instead of (slot, fn) pairIsaku Yamahata2011-03-281-1/+1
| | | | | | | | (slot, fn) pair is somewhat confusing because of ARI. So use devfn for pci_find_device() instead of (slot, fn). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: replace the magic, 256, for the maximum of devfnIsaku Yamahata2011-03-281-0/+1
| | | | | | | | Introduce symbol PCI_SLOT_MAX for the # of slots, and replace the magic, 256. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: add creation functions that may failBlue Swirl2011-02-121-0/+4
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci: deassert intx on reset.Isaku Yamahata2011-01-201-0/+2
| | | | | | | | | | | | deassert intx on device reset. So far pci_device_reset() is used for system reset. In that case, interrupt controller is reset at the same time so that all irq is are deasserted. But now pci bus reset/flr is supported, and in that case irq needs to be disabled explicitly. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: allow devices being tagged as not hotpluggable.Gerd Hoffmann2011-01-101-0/+3
| | | | | | | | | This patch adds a field to PCIDeviceInfo to tag devices as being not hotpluggable. Any attempt to plug-in or -out such a device will throw an error. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: introduce a helper function to convert qdev id to PCIDeviceIsaku Yamahata2010-12-241-0/+1
| | | | | | | | This patch introduce a helper function to get PCIDevice from qdev id. This function will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pcie: add flr supportIsaku Yamahata2010-12-221-0/+1
| | | | | | | Support flr: trigger device reset on flr config write. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: add ich9 pci idAlexander Graf2010-12-171-0/+1
| | | | | | | | | | We need a PCI ID for our new AHCI adapter. I just picked an ICH-9 because that's the one in the Q35 chipset. This patch adds a PCI ID define for an ICH-9 AHCI adapter. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* pci: untangle pci/msi dependencyMichael S. Tsirkin2010-12-091-3/+0
| | | | | | | | | | | | msi depends on pci but pci should not depend on msi. The only dependency we have is a recent addition of pci_msi_ functions, IMO they add little enough to open-code in the small number of users. Follow-up patches add more cleanups. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* pci: make command SERR bit writableIsaku Yamahata2010-12-091-0/+4
| | | | | | | | | | pcie aer needs SERR bit to be writable, and the PCI spec requires this as well. For compatibility, introduce compat global property command_serr_enable and make this bit readonly for a pre 0.14 pc machine. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: use qdev reset framework for pci bus resetIsaku Yamahata2010-11-221-0/+1
| | | | | | Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: allow hotplug removal of cold-plugged devicesMichael S. Tsirkin2010-11-161-1/+9
| | | | | | | | | | | | This patch fixes hot unplug of cold plugged devices (those present at system start), which got broken by 5beb8ad503c88a76f2b8106c3b74b4ce485a60e1 . Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Cam Macdonell <cam@cs.ualberta.ca> Tested-by: Cam Macdonell <cam@cs.ualberta.ca> Reported-by: Cam Macdonell <cam@cs.ualberta.ca>.
* Merge branch 'pci' into for_anthonyMichael S. Tsirkin2010-10-271-11/+94
|\
| * pcie: helper functions for pcie capability and extended capabilityIsaku Yamahata2010-10-191-0/+5
| | | | | | | | | | | | | | | | | | This patch implements helper functions for pci express capability and pci express extended capability allocation. NOTE: presence detection depends on pci_qdev_init() change. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * msi: implements msiIsaku Yamahata2010-10-191-3/+7
| | | | | | | | | | | | | | implements msi related functions. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: introduce helper function to handle msi-x and msi.Isaku Yamahata2010-10-191-0/+3
| | | | | | | | | | | | | | | | | | this patch implements helper functions to handle msi-x and msi uniformly. They will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: introduce helper functions to test-and-{clear, set} mask in ↵Isaku Yamahata2010-10-191-0/+70
| | | | | | | | | | | | | | | | | | | | | | configuration space This patch introduces helper functions to test-and-{clear, set} mask in configuration space. pci_{byte, word, long, quad}_test_and_{clear, set}_mask(). They will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: implement RW1C register framework.Isaku Yamahata2010-09-201-0/+3
| | | | | | | | | | | | | | | | | | | | Implement RW1C register framework. With this patch, it would be easy to implement W1C(Write 1 to Clear) register by just setting w1cmask. Later RW1C register will be used by pcie. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: improve signature of pci_register_bar().Isaku Yamahata2010-09-131-1/+1
| | | | | | | | | | | | Make type uint8_t from int because PCIIORegion::type is uint8_t. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
| * pci: make pci_parse_devfn() aware of func.Isaku Yamahata2010-09-071-0/+2
| | | | | | | | | | | | | | | | make pci_parse_devfn() aware of func. With func = NULL it behave as before. This will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: consolidate pci_add_capability_at_offset() into pci_add_capability().Isaku Yamahata2010-09-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | By making pci_add_capability() the special case of pci_add_capability_at_offset() of offset = 0, consolidate pci_add_capability_at_offset() into pci_add_capability(). Cc: Stefan Weil <weil@mail.berlios.de> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci/bridge: split out pci bridge code into pci_bridge.c from pci.cIsaku Yamahata2010-07-221-4/+1
| | | | | | | | | | | | | | | | | | | | | | Move pci bridge related code into pci_bridge.c from pci.c for further enhancement. pci.c is big enough now, so split it out. No code change but exporting some accesser functions. In fact, few pci bridge functions stays in pci.c. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | Introduce range.hBlue Swirl2010-09-181-29/+0
|/ | | | | | | Extract range functions from pci.h. These will be used by later patches by non-PCI devices. Adjust current users. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci_bridge: make pci bridge aware of pci multi function bit.Isaku Yamahata2010-07-111-1/+2
| | | | | | | | | make pci bridge aware of pci multi function property and let pci generic code to set the bit. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci: introduce multifunction property.Isaku Yamahata2010-07-111-0/+9
| | | | | | | | | | | | | introduce multifunction property. Also introduce new convenient device creation function which will be used later. For bisectability this patch doesn't do anything, but sets the property resulting in no functional changes. Actual changes will be introduced by later patch. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci: remove PCIDeviceInfo::header_typeIsaku Yamahata2010-07-111-2/+6
| | | | | | | | replace PCIDeviceInfo::header_type with is_bridge as suggested by Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci: insert assert that auto-assigned-address function is single function ↵Isaku Yamahata2010-07-111-0/+1
| | | | | | | | | | | | device. Auto-assigned-address pci function (passing devfn = -1) is always single function. This patch adds assert() to guarantee that auto-assigned-address function is always single function device at function = 0. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci-hotplug: make them aware of pci domain.Isaku Yamahata2010-05-311-0/+1
| | | | | | | | add helper function which converts root bus to pci domain. make them aware of pci domain. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci.h: remove unused constants.Isaku Yamahata2010-05-311-11/+0
| | | | | | | | | | So remove unused constants, PCI_STATUS_RESERVED_MASK_LO, PCI_STATUS_RESERVED_MASK_HI, PCI_COMMAND_RESERVED, PCI_COMMAND_RESERVED_MASK_HI. They were used once, but they aren't used anymore. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: add const to pci_is_express(), pci_config_size().Isaku Yamahata2010-05-311-2/+2
| | | | | | | add const to pci_is_express(), pci_config_size(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci hotplug: add argument to pci hot plug callback.Isaku Yamahata2010-05-151-2/+2
| | | | | | | | | Add argument, DeviceState*, to pci hot plug callback. The argument will be used later to remove global variable. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* pci: add API to add capability at a known offsetMichael S. Tsirkin2010-04-111-0/+2
| | | | | | | | Unlike virtio, device emulations need to add pci capabilities at known offsets to match real hardware. Make this possible by adding an appropriate API. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* adding helper pci functionsIzik Eidus2010-03-081-0/+18
| | | | | | Signed-off-by: Izik Eidus <ieidus@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: move pcibus_t to qemu-commonMichael S. Tsirkin2010-02-141-1/+0
| | | | | | move pcibus_t to qemu-common.h to simplify header dependencies. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* PCI: Convert pci_info() to QObjectLuiz Capitulino2010-01-261-1/+3
| | | | | | | | | | | | | | | | | | The returned QObject is a QList of all buses. Each bus is represented by a QDict, which has a key with a QList of all PCI devices attached to it. Each device is represented by a QDict. As has happended to other complex conversions, it's hard to split this commit as part of it are new functions which are called by each other. IMPORTANT: support for printing PCI bridge attached devices is NOT part of this commit, it's going to be added by the next commit, as it's untested. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* pci: Add missing 'const' in argument to pci_get_xxxStefan Weil2010-01-131-7/+7
| | | | | | | | | | | pci_get_byte, pci_get_word, pci_get_long and pci_get_quad all take a const uint8_t pointer, because they only read the configuration data. Their prototypes should reflect this fact. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: allow loading roms via fw_cfg.Gerd Hoffmann2010-01-111-0/+1
| | | | | | | | | | This patch adds a pci bus property 'rombar' which specifies whenever the pci rom should be loaded via pci rom bar (default) or via fw_cfg. The later can be used for compatibility with older qemu versions where no pci rom bar is present. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori2010-01-061-70/+3
|\
| * pci: use pci_regs.hIsaku Yamahata2009-12-231-74/+3
| | | | | | | | | | | | | | | | include pci_regs.h and remove duplicated defines. And remove unused PCI_REVISION and PCI_SUBDEVICE_ID. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: s/PCI_SUBVENDOR_ID/PCI_SUBSYSTEM_VENDOR_ID/gIsaku Yamahata2009-12-231-1/+1
| | | | | | | | | | | | | | | | To match Linux PCI register definition, rename PCI_SUBVENDOR_ID to PCI_SUBSYSTEM_VENDOR_ID. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * pci: remove unused macroMichael S. Tsirkin2009-12-231-1/+0
| | | | | | | | | | | | | | | | | | | | PCI_STATUS_DEVSEL is unused, and it also has a different name in pci_regs.h Remove. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Glauber Costa <glommer@gmail.com>
| * pci: add another devsel macroMichael S. Tsirkin2009-12-231-0/+1
| | | | | | | | | | | | | | | | will be used by ensoniq emulation Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Glauber Costa <glommer@gmail.com>
| * pci: add more status bitsMichael S. Tsirkin2009-12-231-0/+2
| | | | | | | | | | | | | | | | will be used by eepro100. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Glauber Costa <glommer@gmail.com>
| * pcnet: switch to symbolic names for pci registersMichael S. Tsirkin2009-12-231-0/+1
| | | | | | | | | | | | | | | | | | No functional changes. I verified that the generated binary does not change. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Glauber Costa <glommer@gmail.com>
OpenPOWER on IntegriCloud