aboutsummaryrefslogtreecommitdiffstats
path: root/hw/lsi53c895a.c
AgeCommit message (Collapse)AuthorFilesLines
2010-05-10lsi: Adjust some register reset valuesJan Kiszka1-3/+5
According to the LSI spec, the reset value of dcmd, dstat, and ctest2 were wrong, and sdid as well as ssid require zero initialization. There are surely more discrepancies, this is just another increment. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-10lsi: Purge message queue on resetJan Kiszka1-0/+2
Declare the input message queue empty and initialize the related state machine properly on controller reset. This fixes unrecoverable errors when the controller was reset during ongoing requests. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03lsi: Properly initialize controller state on resetJan Kiszka1-2/+8
The LSI controller was lacking a system reset handler. Simply invoke the existing soft reset handler in this case. This also allows to drop its explicit invocation during init. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-05-03lsi: Purge request queue on soft resetJan Kiszka1-0/+11
Avoid keeping zombie requests across controller reset by purging the queue and also dropping the currently active request. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-04-09lsi: fix segfault in lsi_command_completeGerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-01-11lsi: pass lsi_request to lsi_reselectGerd Hoffmann1-16/+7
All callers of lsi_reselect have a lsi_request struct at hand anyway. So just pass it directly instead of having lsi_reselect search for it using the tag. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11lsi: move dma_len+dma_buf into lsi_requestGerd Hoffmann1-22/+23
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11lsi: move current_dev into lsi_requestGerd Hoffmann1-11/+12
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11lsi: have lsi_request for the whole life time of the request.Gerd Hoffmann1-21/+32
Right now lsi_request is allocated when a request is queued and released when a request is unqueued. With this patch applied the lsi_request is kept for the whole lifetime of the scsi request. Rationale: We can use it for per-request data then. The patch does that already for the request tag. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-11lsi: use QTAILQ for lsi_queueGerd Hoffmann1-40/+28
Replace the funky array logic for queued commands with standard qemu list functions. Also rename lsi_queue to lsi_request. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-01-06Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori1-4/+6
2009-12-25Fix Sparse warning: dubious: !x & yBlue Swirl1-1/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-12-23lsi: symbolic names for pci registersMichael S. Tsirkin1-4/+6
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>
2009-12-03Fix compile error when LSI_DEBUG is definedRyan Harper1-3/+3
This patch fixes the follow error when LSI_DEBUG is set. CC libhw64/lsi53c895a.o cc1: warnings being treated as errors qemu/hw/lsi53c895a.c: In function 'lsi_io_mapfunc': qemu/hw/lsi53c895a.c:1932: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t' qemu/hw/lsi53c895a.c: In function 'lsi_ram_mapfunc': /qemu/hw/lsi53c895a.c:1947: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t' qemu/hw/lsi53c895a.c: In function 'lsi_mmio_mapfunc': qemu/hw/lsi53c895a.c:1957: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t' make[1]: *** [lsi53c895a.o] Error 1 make: *** [subdir-libhw64] Error 2 Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03savevm: Port to qdev.vmsd all devices that have qdevJuan Quintela1-1/+1
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03lsi53c895a: Implement IRQ on reselectionLaszlo Ast1-3/+40
The critical part of this change is how to deal with simultaneaous generation of interrupts. The only (normal) case when this happens in the emulation is near simultaneous reselection + selection. If selection comes first, there is no problem, since the target attempting reselection loses the arbitration (in the emulation it only means that the reselect function will not be started). In the worst case the host adapter is reselected, but the device driver already started a selection, so we jump to the alternative address to handle the situation. The SCRIPTS code can trigger another interrupt to notify the driver that the new task has to be postponed. I suppose that on real hardware there is enough time after the reselection interrupt to set the SIP bit before the next interrupt comes, so it would result in 2 stacked interrupts (a SCSI and a DMA one). However, in the emulation there is no interrupt stacking, so there is a good chance that the 2 interrupts will get to the interrupt handler at the same time. Nevertheless, it should not make a big difference in interrupt handling, since in both cases both interrupts have to be fetched first, and after that the new task (that failed during the selection phase) has to be prepared/reset for a later restart, and the reconnected device has to be serviced. The changes do not modify the host adapter's behavior if this interrupt is not enabled. See also LSI53C895A technical manual, SCID and SIEN0. Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03lsi53c895a: Use alternative address when already reselectedLaszlo Ast1-2/+3
See SCRIPTS, 3.2.17 SELECT. Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03lsi53c895a: Fix SDID in SELECT ID commandLaszlo Ast1-1/+1
See SCRIPTS Programming Guide, 3.2.17 SELECT. Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03lsi53c895a: Fix message code of DISCONNECTLaszlo Ast1-1/+1
See SCSI-2, 6.5 Message system description/message codes. Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03lsi53c895a: Add support for LSI53C700 Family Compatibility bitLaszlo Ast1-0/+4
Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-03lsi53c895a: Whitespace and typo fixesLaszlo Ast1-5/+5
Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-12-01pci: pci.h cleanup: move out stuff not in pci.cMichael S. Tsirkin1-0/+2
pci.h declares some functions which aren't defined in pci.h. Clean up moving things to appropriate headers, and update all users. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2009-11-09pci: introduce pcibus_t to represent pci bus address/size instead of uint32_tIsaku Yamahata1-3/+3
This patch is preliminary for 64 bit BAR support. Introduce dedicated type, pcibus_t, to represent pci bus address/size instead of uint32_t. Later this type will be changed to uint64_t. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09pci: s/PCI_ADDRESS_SPACE_/PCI_BASE_ADDRESS_SPACE_/ to match pci_regs.hIsaku Yamahata1-3/+3
make constants for pci base address match pci_regs.h by renaming PCI_ADDRESS_SPACE_xxx to PCI_BASE_ADDRESS_SPACE_xxx. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09scsi: move scsi-disk.h -> scsi.hGerd Hoffmann1-1/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-11-09scsi: move scsi.h -> esp.hGerd Hoffmann1-1/+0
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-27lsi_scsi: port to vmstateJuan Quintela1-159/+83
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-27hotplug: fix "pci_add storage if=scsi"Gerd Hoffmann1-1/+3
Explicitly add the drive to the bus of the newly created scsi adapter instead of hoping that scsi_bus_legacy_handle_cmdline() picks it up correctly. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05pci: move unregister from PCIDevice to PCIDeviceInfoGerd Hoffmann1-1/+1
One more cleanup while being at it ;) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-05switch scsi bus to inplace allocation.Gerd Hoffmann1-6/+6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01Revert "Get rid of _t suffix"Anthony Liguori1-13/+13
In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-10-01Get rid of _t suffixmalc1-13/+13
Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
2009-09-09qdev/scsi: add scsi bus support to qdev, convert drivers.Gerd Hoffmann1-44/+21
* Add SCSIBus. * Add SCSIDeviceInfo, move device callbacks here. * add qdev/scsi helper functions. * convert drivers. Adding scsi disks via -device works now, i.e. you can do: -drive id=sda,if=none,... -device lsi -device scsi-disk,drive=sda legacy command lines (-drive if=scsi,...) continue to work. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27lsi53c895a: LSIState is a DeviceHostJuan Quintela1-1/+1
Go figure. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27lsi53c895a: rename PCIDevice field from pci_dev to dev (consistence)Juan Quintela1-12/+12
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27lsi53c895a: use DO_UPCAST to cast from PCIDeviceJuan Quintela1-5/+5
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27lsi53c895a: remove pointless cast from void *Juan Quintela1-19/+19
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-27qdev: add return value to init() callbacks.Gerd Hoffmann1-1/+2
Sorry folks, but it has to be. One more of these invasive qdev patches. We have a serious design bug in the qdev interface: device init callbacks can't signal failure because the init() callback has no return value. This patch fixes it. We have already one case in-tree where this is needed: Try -device virtio-blk-pci (without drive= specified) and watch qemu segfault. This patch fixes it. With usb+scsi being converted to qdev we'll get more devices where the init callback can fail for various reasons. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-08-25Make CPURead/WriteFunc structure 'const'Blue Swirl1-4/+4
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-22Add save/restore support to the LSI logic SCSI device model.Nolan1-0/+172
This patch requires "Handle BH's queued by AIO completions in qemu_aio_flush()" to work reliably. The combination of those two patches survived 300+ migrations with heavy IO load running in the guest. Signed-off-by: Nolan Leake <nolan <at> sigbus.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-09qdev: update pci device registration.Gerd Hoffmann1-1/+7
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunch of parameters. Also adds config_read and config_write callbacks to PCIDeviceInfo, so drivers needing these can be converted to the qdev device API too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2009-06-16lsi53c895a: Implement write access to DMA Byte CounterSebastian Herbszt1-0/+7
Adds CASE_SET_REG24 and fixes the following errors: lsi_scsi: error: Unhandled writeb 0x24 = 0x0 lsi_scsi: error: Unhandled writeb 0x25 = 0x0 Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-16lsi53c895a: Implement read and write access to DMA Next AddressSebastian Herbszt1-0/+2
Fixes the following errors: lsi_scsi: error: Unhandled writeb 0x28 = 0x0 lsi_scsi: error: Unhandled writeb 0x29 = 0x0 lsi_scsi: error: Unhandled writeb 0x2a = 0x0 lsi_scsi: error: Unhandled writeb 0x2b = 0x0 Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-16lsi53c895a: Implement Scratch Byte RegisterSebastian Herbszt1-0/+7
Fixes the following errors: lsi_scsi: error: Unhandled writeb 0x3a = 0x0 lsi_scsi: error: readb 0x3a Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-16Rename pci_register_io_region() to pci_register_bar()Avi Kivity1-3/+3
This function is used to manage a PCI BAR, so make the more generic pci_register_io_region() available to other uses. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-06-16Remove io_index argument from cpu_register_io_memory()Avi Kivity1-2/+2
The parameter is always zero except when registering the three internal io regions (ROM, unassigned, notdirty). Remove the parameter to reduce the API's power, thus facilitating future change. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-05-21Compile fdc, escc and SCSI controllers only onceBlue Swirl1-2/+3
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-05-14LSI SCSI qdev conversionPaul Brook1-12/+12
Signed-off-by: Paul Brook <paul@codesourcery.com>
2009-05-13Replace gcc variadic macro extension with C99 versionBlue Swirl1-7/+7
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-03-05lsi: add ISTAT1 register read (Ryan Harper)aliguori1-0/+2
SLES10 SP2 installer complains when probing a scsi disk and exits qemu when failing to read one of the registers. lsi_scsi: error: readb 0x15 -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx ryanh@us.ibm.com diffstat output: lsi53c895a.c | 2 ++ 1 files changed, 2 insertions(+) Signed-off-by: Ryan Harper <ryanh@us.ibm.com> --- Subject: [PATCH] lsi: add ISTAT1 register read From: Ryan Harper <ryanh@us.ibm.com> Cc: kvm@vger.kernel.org SLES10 SP2 installer complains when probing a scsi disk and exits qemu when failing to read one of the registers. lsi_scsi: error: readb 0x15 Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6688 c046a42c-6fe2-441c-8c8c-71466251a162