aboutsummaryrefslogtreecommitdiffstats
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2012-02-24scsi: fix searching for an empty idPaolo Bonzini1-5/+10
The conditions for detecting no free target or LUN were wrong. The LUN loop was followed by an "if" condition that is never true, because the loop is exited as soon as lun becomes equal to bus->info->max_lun, and never becomes greater than it. The target loop had a wrong condition (<= instead of <). Once this is fixed, the loop would fail in the same way as the LUN loop. The fix is to see whether scsi_device_find returned the device with the last (channel, target, LUN) pair, and fail if so. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-24scsi: fix wrong return for target INQUIRYPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-24virtio-scsi: add migration supportPaolo Bonzini1-1/+49
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-24virtio-scsi: process control queue requestsPaolo Bonzini1-8/+126
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22virtio-scsi: add basic SCSI bus operationPaolo Bonzini1-13/+98
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22virtio-scsi: Add basic request processing infrastructureStefan Hajnoczi1-2/+140
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22virtio-scsi: Add virtio-scsi stub deviceStefan Hajnoczi8-0/+361
Add a useless virtio SCSI HBA device: qemu -device virtio-scsi-pci Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi-disk: add migration supportPaolo Bonzini1-4/+55
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi-generic: add migration supportPaolo Bonzini1-0/+25
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi: add SCSIDevice vmstate definitionsPaolo Bonzini2-3/+120
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi-disk: enable scatter/gather functionalityPaolo Bonzini2-13/+51
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi: add scatter/gather functionalityPaolo Bonzini2-2/+29
Scatter/gather functionality uses the newly added DMA helpers. The device can choose between doing DMA itself, or calling scsi_req_data as usual, which will use the newly added DMA helpers to copy piecewise to/from the destination area(s). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22scsi: pass residual amount to command_completePaolo Bonzini6-9/+15
With the upcoming sglist support, HBAs will not see any transfer_data call and will not have a way to detect short transfers. So pass the residual amount of data upon command completion. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-22ahci: use new DMA helpersPaolo Bonzini1-69/+13
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-02-17i8259: Do not clear level-triggered lines in IRR on initJan Kiszka3-3/+3
When an input line is handled as level-triggered, it will immediately raise an IRQ on the output of a PIC again that goes through an init reset. So only clear the edge-triggered inputs from IRR in that scenario. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17i8254: Factor out pit_get_channel_infoJan Kiszka3-34/+29
Instead of providing 4 individual query functions for mode, gate, output and initial counter state, introduce a service that queries all information at once. This comes with tiny additional costs for pcspk_callback but with a much cleaner interface. Also, it will simplify the implementation of the KVM in-kernel PIT model. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17pcspk: Convert to qdevJan Kiszka6-17/+108
Convert the PC speaker device to a qdev ISA model. Move the public interface to a dedicated header file at this chance. CC: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17i8254: Rework & fix interaction with HPET in legacy modeJan Kiszka5-48/+57
When the HPET enters legacy mode, the IRQ output of the PIT is suppressed and replaced by the HPET timer 0. But the current code to emulate this was broken in many ways. It reset the PIT state after re-enabling, it worked against a stale static PIT structure, and it did not properly saved/restored the IRQ output mask in the PIT vmstate. This patch solves the PIT IRQ control in a different way. On x86, it both redirects the PIT IRQ to the HPET, just like the RTC. But it also keeps the control line from the HPET to the PIT. This allows to disable the PIT QEMU timer when it is not needed. The PIT's view on the control line state is now saved in the same format that qemu-kvm is already using. Note that, in contrast to the suppressed RTC IRQ line, we do not need to save/restore the PIT line state in the HPET. As we trigger a PIT IRQ update via the control line, the line state is reconstructed on mode switch. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17i8254: Pass alternative IRQ output object on initializationJan Kiszka9-12/+12
HPET legacy emulation will require control over the PIT IRQ output. To enable this, add support for an alternative IRQ output object to the PIT factory function. If the isa_irq number is < 0, this object will be used. This also removes the IRQ number property from the PIT class as we now use a generic GPIO output pin that is connected by the factory function. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17i8254: Factor out interface headerJan Kiszka12-25/+64
Move the public interface of the PIT into its own header file and update all users. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17hpet: Save/restore cached RTC IRQ levelJan Kiszka1-0/+29
In legacy mode, the HPET suppresses the RTC interrupt delivery via IRQ 8 but keeps track of the RTC output level and applies it when legacy mode is turned off again. This value has to be preserved across save/ restore as it cannot be reconstructed otherwise. To document that a raised rtc_irq_level won't survive a vmload without a hpet/rtc_irq_level subsection, add an explicit clearing to the reset handler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17i8254: Do not raise IRQ level on resetJan Kiszka1-1/+7
Avoid changing the IRQ level to high on reset as it may trigger spurious events. Instead, open-code the effects of pit_load_count(0) in the reset handler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17qdev: Fix qdev_try_create() semanticsAndreas Färber1-0/+3
Since QOM'ification, qdev_try_create() uses object_new() internally, which asserts "type != NULL" when the type is not registered. This was revealed by the combination of kvmclock's kvm_enabled() check and early QOM type registration. Check whether the class exists before calling object_new(), so that the caller (e.g., qdev_create) can fail gracefully, telling us which device could not be created. Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <aliguori@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-17Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into stagingAnthony Liguori23-122/+7083
* pmaydell/arm-devs.for-upstream: (22 commits) hw/pl031: Actually raise interrupt on timer expiry MAINTAINERS: Add hw/highbank.c maintainer Remove unnecessary includes of primecell.h hw/primecell.h: Remove obsolete pl080_init() declaration hw/arm_sysctl: Drop legacy init function hw/vexpress.c: Add vexpress-a15 machine arm_boot: Pass base address of GIC CPU interface, not whole GIC hw/vexpress.c: Instantiate the motherboard CLCD hw/vexpress.c: Factor out daughterboard-specific initialization hw/vexpress.c: Move secondary CPU boot code to SRAM hw/vexpress.c: Make motherboard peripheral memory map table-driven hw/a15mpcore.c: Add Cortex-A15 private peripheral model MAINTAINERS: Add maintainers for Exynos SOC. Exynos4210: added display controller implementation hw/exynos4210.c: Add LAN support for SMDKC210. hw/lan9118: Add basic 16-bit mode support. ARM: exynos4210: MCT support. ARM: exynos4210: basic Power Management Unit implementation ARM: exynos4210: PWM support. ARM: exynos4210: UART support ...
2012-02-17Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori4-7/+6
* stefanha/trivial-patches: linux-user: brk() debugging virtio: Remove unneeded g_free() check in virtio_cleanup() net: remove extra spaces in help messages fmopl: Fix typo in function name vl.c: Fix typo in variable name ide: fix compilation errors when DEBUG_IDE is set cpu-exec.c: Correct comment about this file and indentation cleanup CODING_STYLE: Clarify style for enum and function type names linux-user: fail execve() if env/args too big
2012-02-17hw/pl031: Actually raise interrupt on timer expiryPeter Maydell1-1/+1
Fix a typo in pl031_interrupt() which meant we were setting a bit in the interrupt mask rather than the interrupt status register and thus not actually raising an interrupt. This fix allows the rtctest program from the kernel's Documentation/rtc.txt to pass rather than hanging. Reported-by: Daniel Forsgren <daniel.forsgren@enea.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <afaerber@suse.de>
2012-02-17Remove unnecessary includes of primecell.hPeter Maydell4-4/+0
The primecell.h header now only has the definitions of constants indicating the usage of the arm_sysctl GPIO lines; remove obsolete includes of it from source files which don't care about those GPIO lines. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17hw/primecell.h: Remove obsolete pl080_init() declarationPeter Maydell1-3/+0
Remove an obsolete declaration of pl080_init(), which has been incorrect since the conversion of pl080 to qdev back in 2009. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17hw/arm_sysctl: Drop legacy init functionPeter Maydell2-17/+2
Drop the legacy init function arm_sysctl_init(), since it has no users left any more. This allows us to drop the awkward '1' from the actual device init function. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <afaerber@suse.de>
2012-02-17hw/vexpress.c: Add vexpress-a15 machinePeter Maydell1-0/+141
Add the vexpress-a15 machine, and the A-Series memory map it uses. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de>
2012-02-17arm_boot: Pass base address of GIC CPU interface, not whole GICPeter Maydell5-13/+18
The arm_boot secondary boot loader code needs the address of the GIC CPU interface. Obtaining this from the base address of the private peripheral region was possible for A9 and 11MPcore, but the A15 puts the GIC CPU interface in a different place. So make boards pass in the GIC CPU interface address directly. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17hw/vexpress.c: Instantiate the motherboard CLCDPeter Maydell1-1/+1
Instantiate the CLCD on the vexpress motherboard as well as one on the daughterboard -- the A15 daughterboard does not have a CLCD and so relies on the motherboard one. At the moment QEMU doesn't provide infrastructure for selecting which display device gets to actually show graphics -- the first one registered is it. Fortunately this works for the major use case (Linux): if the daughterboard has a CLCD it will come first and be used, otherwise we fall back to the motherboard CLCD. So we don't (currently) need to implement the control register which allows software to tell the mux which video output to pass through to the outside world. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de>
2012-02-17hw/vexpress.c: Factor out daughterboard-specific initializationPeter Maydell1-35/+83
Factor out daughterboard specifics into a data structure and daughterboard initialization function, in preparation for adding vexpress-a15 support. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17hw/vexpress.c: Move secondary CPU boot code to SRAMPeter Maydell1-14/+2
On real Versatile Express hardware, the boot ROM puts the secondary CPU bootcode/holding pen in SRAM. We can therefore rely on Linux not trashing this memory until secondary CPUs have booted up, and can put our QEMU-specific pen code in the same place. This allows us to drop the odd "hack" RAM page we were using before. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17hw/vexpress.c: Make motherboard peripheral memory map table-drivenPeter Maydell1-34/+103
Pull the addresses used for mapping motherboard peripherals into memory out into a table. This will allow us to simply provide a second table to implement the "Cortex-A Series" memory map used by the A15 variant of Versatile Express, as well as the current "Legacy" map used by A9. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de>
2012-02-17hw/a15mpcore.c: Add Cortex-A15 private peripheral modelPeter Maydell1-0/+103
Add a model of the Cortex-A15 memory mapped private peripheral space. This is fairly simple because the only memory mapped bit of the A15 is the GIC. Note that we don't currently model a VGIC and therefore don't map the VGIC related bits of the GIC. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17Exynos4210: added display controller implementationMitsyanko Igor2-0/+1938
Exynos4210 display controller (FIMD) has 5 hardware windows with alpha and chroma key blending functions. Signed-off-by: Mitsyanko Igor <i.mitsyanko@samsung.com> Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17hw/exynos4210.c: Add LAN support for SMDKC210.Evgeny Voevodin1-2/+25
SMDKC210 uses lan9215 chip, but lan9118 in 16-bit mode seems to be enough. Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17hw/lan9118: Add basic 16-bit mode support.Evgeny Voevodin1-6/+118
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17ARM: exynos4210: MCT support.Evgeny Voevodin2-0/+1507
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17ARM: exynos4210: basic Power Management Unit implementationMaksim Kozlov2-0/+508
Patch adds basic model for Exynos4210 SoC PMU. This model implements PMU registers just as a bulk of memory. Currently, the only reason this device exists is that secondary CPU boot loader uses PMU INFORM5 register as a holding pen. Signed-off-by: Maksim Kozlov <m.kozlov@samsung.com> Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17ARM: exynos4210: PWM support.Evgeny Voevodin2-0/+434
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17ARM: exynos4210: UART supportMaksim Kozlov3-0/+714
Add basic support of exynos4210 UART Signed-off-by: Maksim Kozlov <m.kozlov@samsung.com> Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17ARM: Samsung exynos4210-based boards emulationEvgeny Voevodin3-0/+384
Add initial support of NURI and SMDKC210 boards Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17ARM: exynos4210: IRQ subsystem support.Evgeny Voevodin3-0/+1009
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-02-17hw/arm: Remove redundant arguments from set_kernel_args*Stefan Weil1-9/+8
The parameters initrd_size and base are already included in the info parameter, so there is no need to pass them separately. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>,
2012-02-17pxa2xx_lcd: SRAM is valid location for the framebufferVasily Khoruzhick1-4/+9
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-02-17nseries: attach monitor powerdown request to menelausPaolo Bonzini2-12/+11
I noticed some unused code in the twl92230, probably from before qdev-ification. This patch makes the machine use the chip's pwrbtn signal. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-02-15Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori3-6/+11
* qemu-kvm/uq/master: apic: Fix legacy vmstate loading for KVM kvm: Implement kvm_irqchip_in_kernel like kvm_enabled kvm: Allow to set shadow MMU size
2012-02-15Merge remote-tracking branch 'kraxel/usb.38' into stagingAnthony Liguori17-360/+596
* kraxel/usb.38: (28 commits) xhci: handle USB_RET_NAK xhci: remote wakeup support xhci: kill port arg from xhci_setup_packet xhci: stop on errors xhci: add trb type name lookup support. xhci: signal low- and fullspeed support usb: add USBBusOps->wakeup_endpoint usb: pass USBEndpoint to usb_wakeup usb: maintain async packet list per endpoint usb: Set USBEndpoint in usb_packet_setup(). usb: add USBEndpoint->{nr,pid} usb: USBPacket: add status, rename owner -> ep usb: fold usb_generic_handle_packet into usb_handle_packet usb: kill handle_packet callback usb-xhci: switch to usb_find_device() usb-musb: switch to usb_find_device() usb-ohci: switch to usb_find_device() usb-ehci: switch to usb_find_device() usb-uhci: switch to usb_find_device() usb: handle dev == NULL in usb_handle_packet() ...