summaryrefslogtreecommitdiff
path: root/hw/pci_bridge.c
AgeCommit message (Collapse)AuthorFilesLines
2012-06-18Merge remote-tracking branch 'afaerber-or/qom-next-2' into stagingAnthony Liguori1-1/+1
* afaerber-or/qom-next-2: (22 commits) qom: Push error reporting to object_property_find() qdev: Remove qdev_prop_exists() qbus: Initialize in standard way qbus: Make child devices links qdev: Connect busses with their parent devices qdev: Convert busses to QEMU Object Model qdev: Move SysBus initialization to sysbus.c qdev: Use wrapper for qdev_get_path qdev: Remove qdev_prop_set_defaults qdev: Clean up global properties qdev: Move bus properties to abstract superclasses qdev: Move bus properties to a separate global qdev: Push "type" property up to Object arm_l2x0: Rename "type" property to "cache-type" m48t59: Rename "type" property to "model" qom: Assert that public types have a non-NULL parent field qom: Drop type_register_static_alias() macro qom: Make Object a type qom: Add class_base_init qom: Add object_child_foreach() ...
2012-06-18qdev: Convert busses to QEMU Object ModelAnthony Liguori1-1/+1
This is far less interesting than it sounds. We simply add an Object to each BusState and then register the types appropriately. Most of the interesting refactoring will follow in the next patches. Since we're changing fundamental type names (BusInfo -> BusClass), it all needs to convert at once. Fortunately, not a lot of code is affected. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [AF: Made all new bus TypeInfos static const.] [AF: Made qbus_free() call object_delete(), required {qom,glib}_allocated] Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-06-07msi: Invoke msi/msix_reset from PCI coreJan Kiszka1-8/+2
There is no point in pushing this burden to the devices, they tend to forget to call them (like intel-hda, ahci, xhci did). Instead, reset functions are now called from pci_device_reset. They do nothing if MSI/MSI-X is not in use. CC: Alexander Graf <agraf@suse.de> CC: Gerd Hoffmann <kraxel@redhat.com> CC: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-03-16pci_bridge: upper 32 bit are long registersMichael S. Tsirkin1-4/+4
Use pci_set_long for accesses. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-03-15pci_bridge: user-friendly default bus nameMichael S. Tsirkin1-0/+10
For a pci bridge device, if we don't override the name with custom code, the bus will be addressed as <id>.0, where id is the id specified by the user. Since PCI Bridge devices have a single bus each, we don't need the index: address the bus using the parent device name. This is better since this way users don't care about our internal bus/device distinctions. As far as I could see, we only have built-in bridges at this point which always override the name. So this change will only affect ioh3420.c. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-03-15pci_bridge: fix status: do not override cap bitMichael S. Tsirkin1-2/+2
2012-01-27pci: convert to QEMU Object ModelAnthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-10-23pci_bridge: fix typoBlue Swirl1-1/+1
Reviewed-by: Avi Kivity <avi@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-09-20pci_bridge: simplify memory regions some moreMichael S. Tsirkin1-13/+9
replace alloc/free with struct members. todo: smash with initial implementation after testing. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-09-19pci: implement bridge filteringMichael S. Tsirkin1-6/+86
Support bridge filtering on top of the memory API as suggested by Avi Kivity: Create a memory region for the bridge's address space. This region is not directly added to system_memory or its descendants. Devices under the bridge see this region as its pci_address_space(). The region is as large as the entire address space - it does not take into account any windows. For each of the three windows (pref, non-pref, vga), create an alias with the appropriate start and size. Map the alias into the bridge's parent's pci_address_space(), as subregions. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-09-19pci_bridge: use parent bus's address spaceWen Congyang1-0/+3
The switch to the new memory API caused the following problem: The pci device may call pci_register_bar() to use PCI bus's address space. But we don't init PCI bus's address space if it is not bus 0. A crash was reported: http://lists.gnu.org/archive/html/qemu-devel/2011-08/msg02243.html More work will be needed to make bridge filtering work correctly with the memory API. Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-11-22pci bridge: implement secondary bus resetIsaku Yamahata1-1/+10
Trigger secondary bus reset when secondary bus reset bit value changes from 0 to 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>
2010-10-27Introduce range.hBlue Swirl1-0/+1
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> (cherry picked from commit bf1b00712375bea65f2254dea8281fa646eebbd5)
2010-10-20pci/bridge: fix pci_bridge_reset()Isaku Yamahata1-6/+42
The lower bits of base/limit registers is RO and shouldn't be zero cleared on reset. This patch fixes it. In fact, the default value of base/limit registers aren't specified in the spec. And some bridges disable forwarding on reset instead of zeroing base/limit registers. So introduce one function to disable bridge forwarding so that such bridges can use it. It will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-07pci bridge: add helper function for ssvid capability.Isaku Yamahata1-0/+19
helper function to add ssvid capability. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-09-07pci_bridge: introduce pci bridge library.Isaku Yamahata1-53/+69
introduce pci bridge library. convert apb bridge and dec p2p bridge to use new pci bridge library. save/restore is supported as a side effect. This is also preparation for pci express root/upstream/downstream port. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-07-22pci_bridge: clean up: remove pci_{register, unregister}_secondary_bus()Isaku Yamahata1-22/+10
Remove pci_{register, unregister}_secondary_bus() by open code. They are old stype API and aren't used any more by others. So eliminate it. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-07-22pci_bridge: rename PCIBridge::bus -> PCIBridge::sec_bus.Isaku Yamahata1-6/+4
To avoid confusion of primary bus with secondary bus, rename PCIBridge::bus to PCIBridge::sec_bus. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-07-22pci/bridge: split out pci bridge code into pci_bridge.c from pci.cIsaku Yamahata1-0/+208
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>