summaryrefslogtreecommitdiff
path: root/hw/ide/ich.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-14hw: set interrupts using pci irq wrappersMarcel Apfelbaum1-1/+2
pci_set_irq and the other pci irq wrappers use PCI_INTERRUPT_PIN config register to compute device INTx pin to assert/deassert. An irq is allocated using pci_allocate_irq wrapper only if is needed by non pci devices. Removed irq related fields from state if not used anymore. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-07-29devices: Associate devices to their logical categoryMarcel Apfelbaum1-0/+1
The category will be used to sort the devices displayed in the command line help. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-23ide/ich: QOM parent field cleanupAndreas Färber1-11/+11
Replace direct uses of AHCIPCIState::card with QOM casts and rename it to parent_obj. Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-07-23ide/ich: QOM Upcast SweepPeter Crosthwaite1-5/+5
Define and use standard QOM cast macro. Remove usages of DO_UPCAST() and direct -> style upcasting. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [AF: Renamed to TYPE_ICH9_AHCI and used typedef in pci_ich9_reset()] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-20dma: eliminate DMAContextPaolo Bonzini1-1/+1
The DMAContext is a simple pointer to an AddressSpace that is now always already available. Make everyone hold the address space directly, and clean up the DMA API to use the AddressSpace directly. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-08hw: move headers to include/Paolo Bonzini1-2/+2
Many of these should be cleaned up with proper qdev-/QOM-ification. Right now there are many catch-all headers in include/hw/ARCH depending on cpu.h, and this makes it necessary to compile these files per-target. However, fixing this does not belong in these patches. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-01-25ahci: Add migration supportJason Baron1-4/+10
Jason tested these patches by migrating Windows 7 and Fedora 17 guests (while under I/O) on both piix with ahci attached and on q35 (which has a built-in AHCI controller). Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-01-10Make all static TypeInfos constAndreas Färber1-1/+1
Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all types natively through QEMU Object Model), TypeInfo as used in the common, non-iterative pattern is no longer amended with information and should therefore be const. Fix the documented QOM examples: sed -i 's/static TypeInfo/static const TypeInfo/g' include/qom/object.h Since frequently the wrong examples are being copied by contributors of new devices, fix all types in the tree: sed -i 's/^static TypeInfo/static const TypeInfo/g' */*.c sed -i 's/^static TypeInfo/static const TypeInfo/g' */*/*.c This also avoids to piggy-back these changes onto real functional changes or other refactorings. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-19softmmu: move include files to include/sysemu/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-19block: move include files to include/block/Paolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-12-17pci: update all users to look in pci/Michael S. Tsirkin1-2/+2
update all users so we can remove the makefile hack. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-07-29Merge branch pci into masterMichael S. Tsirkin1-3/+1
Merge master and pci branch, resolve build breakage in hw/esp.c introduced by f90c2bcd. Conflicts: hw/esp.c
2012-07-04pci: convert PCIUnregisterFunc to voidAlex Williamson1-3/+1
Not a single driver has any possibility of failure on their exit function, let's keep it that way. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-06-27ide/ahci: Use universal DMA helper functionsDavid Gibson1-1/+1
The AHCI device can provide both PCI and SysBus AHCI device emulations. For this reason, it wasn't previously converted to use the pci_dma_*() helper functions. Now that we have universal DMA helper functions, this converts AHCI to use them. The DMAContext is obtained from pci_dma_context() in the PCI case and set to NULL in the SysBus case (i.e. we assume for now that a SysBus AHCI has no IOMMU translation). Cc: Kevin Wolf <kwolf@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-06-07msi: Invoke msi/msix_write_config from PCI coreJan Kiszka1-8/+0
Also this functions is better invoked by the core than by each and every device. This allows to drop the config_write callbacks from ich and intel-hda. 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-06-07msi: Invoke msi/msix_reset from PCI coreJan Kiszka1-1/+0
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-06-07ahci: Clean up reset functionsJan Kiszka1-6/+4
Properly register reset functions via the device class. CC: Alexander Graf <agraf@suse.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-06-07ahci: Fix reset of MSI functionJan Kiszka1-2/+10
Call msi_reset on device reset as still required by the core. CC: Alexander Graf <agraf@suse.de> CC: qemu-stable@nongnu.org Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2012-02-15qom: Unify type registrationAndreas Färber1-2/+3
Replace device_init() with generalized type_init(). While at it, unify naming convention: type_init([$prefix_]register_types) Also, type_init() is a function, so add preceding blank line where necessary and don't put a semicolon after the closing brace. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Cc: malc <av1474@comtv.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-03qdev: remove baked in notion of aliases (v2)Anthony Liguori1-2/+0
Limit them to the device_add functionality. Device aliases were a hack based on the fact that virtio was modeled the wrong way. The mechanism for aliasing is very limited in that only one alias can exist for any device. We have to support it for the purposes of compatibility but we only need to support it in device_add so restrict it to that piece of code. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> --- v1 -> v2 - Use a table for aliases (Paolo)
2012-02-03qdev: register all types natively through QEMU Object ModelAnthony Liguori1-7/+10
This was done in a mostly automated fashion. I did it in three steps and then rebased it into a single step which avoids repeatedly touching every file in the tree. The first step was a sed-based addition of the parent type to the subclass registration functions. The second step was another sed-based removal of subclass registration functions while also adding virtual functions from the base class into a class_init function as appropriate. Finally, a python script was used to convert the DeviceInfo structures and qdev_register_subclass functions to TypeInfo structures, class_init functions, and type_register_static calls. We are almost fully converted to QOM after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27pci: convert to QEMU Object ModelAnthony Liguori1-12/+19
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-27qdev: prepare source tree for code conversionAnthony Liguori1-17/+13
These are various small stylistic changes which help make things more consistent such that the automated conversion script can be simpler. It's not necessary to agree or disagree with these style changes because all of this code is going to be rewritten by the patch monkey script anyway. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-09-21ahci: add port I/O index-data pairDaniel Verkamp1-1/+26
Implement an I/O space index-data register pair as defined by the AHCI spec, including the corresponding SATA PCI capability and BAR. This allows real-mode code to access the AHCI registers; real-mode code cannot address the memory-mapped register space because it is beyond the first megabyte. Signed-off-by: Daniel Verkamp <daniel@drv.nu> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-09-12hw: Trim superfluous #include "block_int.h"Markus Armbruster1-1/+0
Including it in device models is unclean, including it without a reason adds insult to injury. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-08-08pci: rename pci_register_bar_region() to pci_register_bar()Avi Kivity1-1/+1
Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-08ahci: convert to memory APIAvi Kivity1-2/+1
Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-20ahci doesn't support migrationGerd Hoffmann1-0/+6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-15Merge remote-tracking branch 'origin/master' into pciMichael S. Tsirkin1-3/+3
Conflicts: hw/virtio-pci.c
2011-06-12hw/ide/ich.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata1-5/+4
use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-16ahci: Unbreak bar registrationJan Kiszka1-3/+3
Fix regression of 667bb59: ahci_init initializes ahci.mem, so we have to move bar registration after it. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-05-16ich/ahci: fix uninitialized memory useMichael S. Tsirkin1-2/+2
The commit 667bb59d2358daeef179583c944becba3f1f9680 uses d->ahci.mem before it is initialized by ahci_init(). Fix this by calling ahci_init() first thing so that it's safe to use all fields in the ahci state struct. Reported-by: Alexey Zaytsev <alexey.zaytsev@gmail.com> Reported-by: Jan Kiszka <jan.kiszka@web.de> Tested-by: Alexey Zaytsev <alexey.zaytsev@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-05-05Merge remote branch 'origin/master' into pciMichael S. Tsirkin1-1/+0
Conflicts: exec.c
2011-05-05MSI: Robust resource releaseJan Kiszka1-4/+1
msi_init may fail, so we need to check on uninit if the cap was actually installed. This also avoids that the users need to check. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-04-15Remove unused sysemu.h include directivesBlue Swirl1-1/+0
Remove unused sysemu.h include directives to speed up build with the following patches. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-04-07ich/ahci: convert to pci_register_bar_simple()Avi Kivity1-2/+1
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-02-07ahci: make number of ports runtime determinedAlexander Graf1-1/+2
Different AHCI controllers have a different number of ports, so the core shouldn't care about the amount of ports available. This patch makes the number of ports available to the AHCI core runtime configurable, allowing us to have multiple different AHCI implementations with different amounts of ports. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-07ahci: split ICH and AHCI even moreAlexander Graf1-2/+88
Sebastian's patch already did a pretty good job at splitting up ICH-9 AHCI code and the AHCI core. We need some more though. Copyright was missing, the lspci dump belongs to ICH-9, we don't need the AHCI core to have its own qdev device duplicate. So let's split them a bit more in this patch, making things easier to read an understand. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-07ahci: split ICH9 from coreSebastian Herbszt1-0/+61
There are multiple ahci devices out there. The currently implemented ich-9 is only one of the many. So let's split that one out into a separate file to stress the difference. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>