summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2011-01-24SPARC: Emulation of GRLIB APB UARTFabien Chouteau2-0/+210
This device exposes one parameter: - chardev (ptr) : Pointer to a qemu character device Emulation of GrLib devices is base on the GRLIB IP Core User's Manual: http://www.gaisler.com/products/grlib/grip.pdf Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-24SPARC: Emulation of GRLIB IRQMPFabien Chouteau2-0/+414
This device exposes two parameters: - set_pil_in (ptr) : A function to set the pil_in of the SPARC CPU - set_pil_in_opaque (ptr) : Opaque argument of the set_pil_in function Emulation of GrLib devices is base on the GRLIB IP Core User's Manual: http://www.gaisler.com/products/grlib/grip.pdf Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-24SPARC: Emulation of GRLIB GPTimerFabien Chouteau2-0/+460
This device exposes three parameters: - frequency (uint32) : The system frequency - irq-line (uint32) : IRQ line number for the first timer (others use irq-line + 1, irq-line + 2...) - nr-timers (uint32) : Number of timers Emulation of GrLib devices is base on the GRLIB IP Core User's Manual: http://www.gaisler.com/products/grlib/grip.pdf Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-24usb-msd: Propagate removable bit to SCSI deviceStefan Hajnoczi1-1/+3
USB Mass Storage Devices sometimes have the RMB (removable) bit set in the SCSI INQUIRY response. Thumbdrives tend to have the bit set whereas hard disks do not. Operating systems differentiate between removable devices and fixed devices. Under Linux, the anaconda installer looks for removable devices. Under Windows, only fixed devices may have more than one partition and AutoRun is also affected by the removable bit. For these reasons, allow USB Mass Storage Devices to override the removable bit: qemu -usb -drive if=none,file=test.img,cache=none,id=disk0 -device usb-storage,drive=disk0,removable=on The default is off. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24scsi: Allow scsi_bus_legacy_add_drive() to set removable bitStefan Hajnoczi4-5/+10
scsi-disk devices may wish to override the removable bit. Add support for a qdev property on SCSI devices. This is will be used by usb-msd. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24scsi-disk: Allow overriding SCSI INQUIRY removable bitStefan Hajnoczi1-0/+3
Provide the "removable" qdev property bit to override the SCSI INQUIRY removable (RMB) bit for non-CDROM devices. This will be used by USB Mass Storage Devices, which sometimes have this guest-visible bit set and sometimes do not. They therefore requires a means for user configuration. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24usb-bus: use snprintfBlue Swirl1-5/+7
Avoid this warning from OpenBSD linker: LINK i386-softmmu/qemu ../usb-bus.o(.text+0x27c): In function `usb_get_fw_dev_path': /src/qemu/hw/usb-bus.c:294: warning: sprintf() is often misused, please use snprintf() Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-24usb hid: add migration supportGerd Hoffmann1-2/+64
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-24usb hub: add migration supportGerd Hoffmann1-0/+24
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-24usb core: add migration supportGerd Hoffmann3-5/+31
Yes, seriously. There is no migration support at all for usb devices. They loose state, especially the device address, and stop responding because of that. Oops. Luckily there is so much broken usb hardware out there that the guest usually just kicks the device hard (via port reset and reinitialization), then continues without a hitch. So we got away with that in a surprising high number of cases. The arrival of remote wakeup (which enables autosuspend support) changes that picture though. The usb devices also forget that it they are supposed to wakeup, so they don't do that. The host also doesn't notice the device stopped working in case it suspended the device and thus expects it waking up instead of polling it. Result is that your mouse is dead. Lets start fixing that. Add a vmstate struct for USBDevice. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-24usb hid: move head+n to common structGerd Hoffmann1-24/+22
This patch moves the 'head' and 'n' fields from USBMouseState and USBKeyboardState to the common USBHIDState struct. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-24usb keyboard: add event event queueGerd Hoffmann1-6/+32
This patch adds a event queue to the usb keyboard. This makes sure the guest will see all key events even if they come in bursts. With this patch applied sending Ctrl-Alt-Del using vncviewer's F8 menu works. Also with autosuspend enabled the first keypress on a suspended keyboard takes a little longer to be delivered to the guest because the usb bus must be resumed first. Without event queue this easily gets lost. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-24add event queueing to USB HIDPaolo Bonzini1-94/+127
The polling nature of the USB HID device makes it very hard to double click or drag while on a high-latency VNC connection. This patch, based on work done in the Xen qemu-dm tree by Ian Jackson, fixes this bug by adding an event queue to the device. The event queue associates each movement with the correct button state, and remembers all button presses and releases as well. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffman <kraxel@redhat.com>
2011-01-24ide: Remove unneeded null pointer checkStefan Weil1-3/+1
With bm == NULL, other code in the same function would crash. This bug was reported by cppcheck: hw/ide/pci.c:280: error: Possible null pointer dereference: bm Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24qxl: locking fixGerd Hoffmann1-0/+2
One spice worker call lacks the unlock/relock calls, which may lead to deadlocks, add them. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-24spice/qxl: zap spice 0.4 migration compatibility bitsGerd Hoffmann2-73/+10
Live migration from and to spice 0.4 qxl devices isn't going to work. Rip out the bits which attempt to support that. Zap the subsection logic which is obsolete now. Bumb the version to make a clean cut. This should obviously go in before 0.14 is released. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-01-24pci: memory leak of PCIDevice::rom_fileIsaku Yamahata1-0/+1
PCIDevice::rom_file is leaked. PCIDevice::rom_file is allocated in pci_qdev_init(), but not freed anywhere. free it in qemu_unregister_device(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-24ide: kill ide_dma_submit_checkChristoph Hellwig1-9/+6
Merge ide_dma_submit_check into it's only caller. Also use tail recursion using a goto instead of a real recursion - this avoid overflowing the stack in the pathological situation of an recurring error that is ignored. We'll still be busy looping in ide_dma_cb, but at least won't eat up all stack space after this. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24ide: also reset io_buffer_index for writesChristoph Hellwig1-2/+1
Currenly the code only resets the io_buffer_index field for reads, but the code seems to expect this for all types of I/O. I guess we simply don't hit large enough transfers that would require this often enough. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-24ide: factor dma handling helpersChristoph Hellwig3-80/+36
Factor the DMA I/O path that is duplicated between read and write commands, into common helpers using the s->is_read flag added for the macio ATA controller. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-01-23multiboot: Fix upper memory size in multiboot infoKevin Wolf1-1/+1
The upper memory size field should exclude the first MB of RAM. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-23Delete useless 'extern' qualifiers for functionsBlue Swirl7-37/+33
'extern' qualifier is useless for function declarations. Delete them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-01-21Merge branch 'usb.4' of git://anongit.freedesktop.org/spice/qemuAurelien Jarno15-1619/+1828
* 'usb.4' of git://anongit.freedesktop.org/spice/qemu: (32 commits) usb: zap pdev from usbport usb: rewrite fw path, fix numbering usb: add port property. usb: keep track of physical port address. usb storage: handle long responses usb storage: fix status reporting usb storage: high speed support usb: add device qualifier support usb: add usb_desc_attach usb: add attach callback usb: add speed mask to ports usb: hid: change serial number to "42". usb: hid: remote wakeup support. usb: hub: remote wakeup support. usb: uhci: remote wakeup support. usb: add usb_wakeup() + wakeup callback to port ops usb: rework attach/detach workflow usb: create USBPortOps, move attach there. usb: move remote wakeup handling to common code usb: move USB_REQ_{GET,SET}_CONFIGURATION handling to common code ...
2011-01-21sm501: fix screen redrawAurelien Jarno1-3/+4
Due to signed/unsigned comparison, the dirty bits are never reset, and the screen redrawn each time. Fix that by only using ram_addr_t types, and looking for page_min != addr_max instead. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20gt64xxx: set isa_mem_base during registrationAurelien Jarno1-0/+5
isa_mem_base is computed from registers during reset, but due to QEMU limitations some devices (e.g. VGA card) need to know it earlier when they are registered. Workaround this by setting the value during registration instead of reset. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20hw/pl190.c: Fix writing of default vector addressPeter Maydell1-3/+1
The PL190 implementation keeps the default vector address in vect_addr[16], but we weren't using this for writes to the DEFVECTADDR register. As a result of this fix the default_addr structure member is unused and we can delete it. Reported-by: Himanshu Chauhan <hschauhan@nulltrace.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori6-15/+71
2011-01-20pci: use qemu_malloc() in pcibus_get_dev_path()Isaku Yamahata1-1/+1
use qemu_malloc() instead of direct use of malloc(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20msix: simplify write configIsaku Yamahata1-4/+1
use pci_device_deassert_intx(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20msi: simplify write config a bit.Isaku Yamahata1-4/+1
use pci_device_deassert_intx(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-01-20pci: deassert intx on reset.Isaku Yamahata2-0/+11
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>
2011-01-20pxa2xx_lcd: restore updating of displayDmitry Eremin-Solenikov1-2/+2
Recently PXA2xx lcd have stopped to be updated incrementally (picture frozen). This patch fixes that by passing non min/max x/y, but rather (correctly) x/y and w/h. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20pxa2xx: fix vmstate_pxa2xx_i2cDmitry Eremin-Solenikov1-1/+1
vmstate_pxa2xx_i2c incorrectly recursed to itself instead of going to store slave device. Fix that stop stop qemu from segfaulting during savevm for pxa2xx-based devices. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20scoop: fix access to registers from second instanceDmitry Eremin-Solenikov1-2/+2
Second instance of scoop contains registers shifted to 0x40 from the start of the page. Instead of messing with register mapping, just limit register address to 0x00..0x3f. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20mainstone: fix name of the allocated memory for romsDmitry Eremin-Solenikov1-1/+2
Mainstone board has two flash chips (emulated by two ram regions), however currently code tries to allocate them with the same name, which fails. Fix that to make mainstone emulation work again. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20stc91c111: Implement save/restorePeter Maydell1-0/+30
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20pl080: Implement save/restorePeter Maydell1-3/+55
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20pl110: Implement save/restorePeter Maydell1-4/+40
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20pl031: Implement save/restorePeter Maydell1-1/+24
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20pl050: Implement save/restorePeter Maydell1-5/+30
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20arm_sysctl: Implement save/restorePeter Maydell1-0/+17
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20vpb_sic: Implement save/restorePeter Maydell1-3/+21
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20pl190: Implement save/restorePeter Maydell1-4/+32
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20gt64xxx: qdev conversionAurelien Jarno3-50/+69
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20sh_pci: qdev conversionAurelien Jarno3-57/+75
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20sh_serial: process all received charactersAurelien Jarno1-21/+21
When operating on the SCIF, process all the received characters, as long as the FIFO can handle them. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20sh_serial: remove one level of indirectionAurelien Jarno1-15/+2
The indirection functions are empty since commit 8da3ff180974732fc4272cb4433fef85c1822961. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20usb-hid: modifiers should generate an eventAurelien Jarno1-0/+3
When a modifier key is pressed or released, the USB HID keyboard still answers NAK, unless another key is also pressed or released. The patch fixes that by calling usb_hid_changed() when a modifier key is pressed or released. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-20virtio-serial: save/restore new fields in port structAmit Shah1-2/+40
The new fields that got added as part of not copying over the guest buffer to the host need to be saved/restored across migration. Do that and bump up the version number. Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-01-20virtio-serial: Add support for flow controlAmit Shah2-11/+55
This commit lets apps signal an incomplete write. When that happens, stop sending out any more data to the app and wait for it to unthrottle the port. Signed-off-by: Amit Shah <amit.shah@redhat.com>