#
62d32ec8 |
| 21-Dec-2015 |
Andrew Baumann <Andrew.Baumann@microsoft.com> |
sdhci: don't raise a command index error for an unexpected response
This deletes a block of code that raised a command index error if a command returned response data, but the guest did not set the
sdhci: don't raise a command index error for an unexpected response
This deletes a block of code that raised a command index error if a command returned response data, but the guest did not set the appropriate bits in the response register to handle such a response. I cannot find any documentation that suggests the controller should behave in this way, the error code doesn't make sense (command index error is defined for the case where the index in a response does not match that of the issued command), and in at least one case (CMD23 issued by UEFI on Raspberry Pi 2), actual hardware does not do this.
Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-id: 1450738069-18664-3-git-send-email-Andrew.Baumann@microsoft.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
6890a695 |
| 21-Dec-2015 |
Peter Crosthwaite <crosthwaitepeter@gmail.com> |
sd: sdhci: Delete over-zealous power check
This check was conditionalising SD card operation on the card being powered by the SDHCI host controller. It is however possible (particularly in embedded
sd: sdhci: Delete over-zealous power check
This check was conditionalising SD card operation on the card being powered by the SDHCI host controller. It is however possible (particularly in embedded systems) for the power control of the SD card to be managed outside of SDHCI. This can be as trivial as hard-wiring the SD slot VCC to a constant power-rail.
This means the guest SDHCI can validly opt-out of the SDHCI power control feature while still using the card. So delete this check to allow operation of the card with SDHCI power control.
This is needed for at least Xilinx Zynq and Raspberry Pi, and also makes Freescale i.MX25 work for me. The digilent Zybo board has a public schematic which shows SD VCC hardwiring:
http://digilentinc.com/Data/Products/ZYBO/ZYBO_sch_VB.3.pdf bottom of page 3.
Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Reviewed-by: Sai Pavan Boddu <saipava@xilinx.com> Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com> Message-id: 1450738069-18664-2-git-send-email-Andrew.Baumann@microsoft.com [AB: Add Pi to list of devices fixed in commit message] Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
79f21707 |
| 07-Dec-2015 |
Markus Armbruster <armbru@redhat.com> |
sdhci: Sanitize "sdhci-pci" properties for future qomification
We currently fuse controller and card into a single device model, but we intend qomify things properly and separate the two. The prope
sdhci: Sanitize "sdhci-pci" properties for future qomification
We currently fuse controller and card into a single device model, but we intend qomify things properly and separate the two. The properties that really belong to the card would then have to somehow pass-through to the card's properties. To avoid that complication, either mark them experimental or drop them.
Properties "capareg", "maxcurr" and the usual PCI device properties belong to the controller. Property "drive" belongs to the card; rename it to "x-drive". Properties "logical_block_size", "physical_block_size", "min_io_size", "opt_io_size", "discard_granularity" belong to the card, but have no effect; drop them.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1449503710-3707-2-git-send-email-armbru@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
637d23be |
| 08-Oct-2015 |
Sai Pavan Boddu <sai.pavan.boddu@xilinx.com> |
sdhci: Split sdhci.h for public and internal device usage
Split sdhci.h into pubilc version (i.e include/hw/sd/sdhci.h) and internal version (i.e hw/sd/sdhci-interna.h) based on register declaration
sdhci: Split sdhci.h for public and internal device usage
Split sdhci.h into pubilc version (i.e include/hw/sd/sdhci.h) and internal version (i.e hw/sd/sdhci-interna.h) based on register declarations and object declaration.
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
9201bb9a |
| 06-Oct-2015 |
Alistair Francis <alistair.francis@xilinx.com> |
sdhci.c: Limit the maximum block size
It is possible for the guest to set an invalid block size which is larger then the fifo_buffer[] array. This could cause a buffer overflow.
To avoid this limit
sdhci.c: Limit the maximum block size
It is possible for the guest to set an invalid block size which is larger then the fifo_buffer[] array. This could cause a buffer overflow.
To avoid this limit the maximum size of the blksize variable.
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Reported-by: Intel Security ATR <secure@intel.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Message-id: abe4c51f513290bbb85d1ee271cb1a3d463d7561.1444067470.git.alistair.francis@xilinx.com Suggested-by: Igor Mitsyanko <i.mitsyanko@gmail.com> Reported-by: Intel Security ATR <secure@intel.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
5ec911c3 |
| 17-Aug-2015 |
Kevin O'Connor <kevin@koconnor.net> |
sdhci: Pass drive parameter to sdhci-pci via qdev property
Commit 19109131 disabled the sdhci-pci support because it used drive_get_next(). This patch reenables sdhci-pci and changes it to pass the
sdhci: Pass drive parameter to sdhci-pci via qdev property
Commit 19109131 disabled the sdhci-pci support because it used drive_get_next(). This patch reenables sdhci-pci and changes it to pass the drive via a qdev property - for example: -device sdhci-pci,drive=drive0 -drive id=drive0,if=sd,file=myimage
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
7af0fc99 |
| 07-Sep-2015 |
Sai Pavan Boddu <sai.pavan.boddu@xilinx.com> |
sdhci: Change debug prints to compile unconditionally
Conditional compilation hides few type mismatch warnings, fix it to compile unconditionally.
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com
sdhci: Change debug prints to compile unconditionally
Conditional compilation hides few type mismatch warnings, fix it to compile unconditionally.
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com> Suggested-by: Eric Blake <eblake@redhat.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
show more ...
|
#
be9c5dde |
| 07-Sep-2015 |
Sai Pavan Boddu <sai.pavan.boddu@xilinx.com> |
sdhci: use PRIx64 for uint64_t type
Fix compile time warnings, because of type mismatch for unsigned long long type.
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com> Reviewed-by: Peter Crosthwai
sdhci: use PRIx64 for uint64_t type
Fix compile time warnings, because of type mismatch for unsigned long long type.
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
show more ...
|
#
012aef07 |
| 26-Aug-2015 |
Markus Armbruster <armbru@redhat.com> |
maint: avoid useless "if (foo) free(foo)" pattern
My Coccinelle semantic patch finds a few more, because it also fixes up the equally pointless conditional
if (foo) { free(foo);
maint: avoid useless "if (foo) free(foo)" pattern
My Coccinelle semantic patch finds a few more, because it also fixes up the equally pointless conditional
if (foo) { free(foo); foo = NULL; }
Result (feel free to squash it into your patch):
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
show more ...
|
#
9f9bdf43 |
| 23-Mar-2015 |
Markus Armbruster <armbru@redhat.com> |
sysbus: Make devices picking up backends unavailable with -device
Device models aren't supposed to go on fishing expeditions for backends. They should expose suitable properties for the user to set
sysbus: Make devices picking up backends unavailable with -device
Device models aren't supposed to go on fishing expeditions for backends. They should expose suitable properties for the user to set. For onboard devices, board code sets them.
A number of sysbus devices pick up block backends in their init() / instance_init() methods with drive_get_next() instead: sl-nand, milkymist-memcard, pl181, generic-sdhci.
Likewise, a number of sysbus devices pick up character backends in their init() / realize() methods with qemu_char_get_next_serial(): cadence_uart, digic-uart, etraxfs,serial, lm32-juart, lm32-uart, milkymist-uart, pl011, stm32f2xx-usart, xlnx.xps-uartlite.
All these mistakes are already marked FIXME. See the commit that added these FIXMEs for a more detailed explanation of what's wrong.
Fortunately, only machines ppce500 and pseries-* support -device with sysbus devices, and none of the devices above is supported with these machines.
Set cannot_instantiate_with_device_add_yet to preserve our luck.
Cc: Andrzej Zaborowski <balrogg@gmail.com> Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Cc: Antony Pavlov <antonynpavlov@gmail.com> Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> Cc: Michael Walle <michael@walle.cc> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
19109131 |
| 23-Mar-2015 |
Markus Armbruster <armbru@redhat.com> |
sdhci: Make device "sdhci-pci" unavailable with -device
Device models aren't supposed to go on fishing expeditions for backends. They should expose suitable properties for the user to set. For onbo
sdhci: Make device "sdhci-pci" unavailable with -device
Device models aren't supposed to go on fishing expeditions for backends. They should expose suitable properties for the user to set. For onboard devices, board code sets them.
"sdhci-pci" picks up its block backend in its realize() method with drive_get_next() instead. Already marked FIXME. See the commit that added the FIXME for a more detailed explanation of what's wrong.
We can't fix this in time for the release, but since the device is new in 2.3, we can set cannot_instantiate_with_device_add_yet to disable it before this mistake becomes ABI, and we have to support command lines like
$ qemu -drive if=sd -drive if=sd,file=sd.img -device sdhci-pci -device sdhci-pci
forever.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
af9e40aa |
| 23-Mar-2015 |
Markus Armbruster <armbru@redhat.com> |
hw: Mark devices picking up block backends actively FIXME
Drives defined with if!=none are for board initialization to wire up. Board code calls drive_get() or similar to find them, and creates devi
hw: Mark devices picking up block backends actively FIXME
Drives defined with if!=none are for board initialization to wire up. Board code calls drive_get() or similar to find them, and creates devices with their qdev drive properties set accordingly.
Except a few devices go on a fishing expedition for a suitable backend instead of exposing a drive property for board code to set: they call driver_get() or drive_get_next() in their realize() or init() method to implicitly connect to the "next" backend with a certain interface type.
Picking up backends that way works when the devices are created by board code. But it's inappropriate for -device or device_add. Not only is this inconsistent with how the other block device models work (they connect to a backend explicitly identified by a "drive" property), it breaks when the "next" backend has been picked up by the board already.
Example:
$ qemu-system-arm -S -M connex -pflash flash.img -device ssi-sd Aborted (core dumped)
Mark them with suitable FIXME comments.
Cc: Andrzej Zaborowski <balrogg@gmail.com> Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Cc: "Andreas Färber" <andreas.faerber@web.de> Cc: Michael Walle <michael@walle.cc> Signed-off-by: Markus Armbruster <armbru@redhat.com>
show more ...
|
#
9af21dbe |
| 19-Jan-2015 |
Markus Armbruster <armbru@redhat.com> |
pci: Trivial device model conversions to realize
Convert the device models where initialization obviously can't fail.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Ts
pci: Trivial device model conversions to realize
Convert the device models where initialization obviously can't fail.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com>
show more ...
|
#
e720677e |
| 08-Jan-2015 |
Paolo Bonzini <pbonzini@redhat.com> |
vmstate: accept QEMUTimer in VMSTATE_TIMER*, add VMSTATE_TIMER_PTR*
Old users of VMSTATE_TIMER* are mechanically changed to VMSTATE_TIMER_PTR variants.
Signed-off-by: Paolo Bonzini <pbonzini@redhat
vmstate: accept QEMUTimer in VMSTATE_TIMER*, add VMSTATE_TIMER_PTR*
Old users of VMSTATE_TIMER* are mechanically changed to VMSTATE_TIMER_PTR variants.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
224d10ff |
| 08-Dec-2014 |
Kevin O'Connor <kevin@koconnor.net> |
sdhci: Support SDHCI devices on PCI
Support for PCI devices following the "SD Host Controller Simplified Specification Version 2.00" spec.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-
sdhci: Support SDHCI devices on PCI
Support for PCI devices following the "SD Host Controller Simplified Specification Version 2.00" spec.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
7302dcd6 |
| 08-Dec-2014 |
Kevin O'Connor <kevin@koconnor.net> |
sdhci: Add "sysbus" to sdhci QOM types and methods
Update the sdhci sysbus QOM types and methods so that sysbus is in their name. This is in preparation for adding PCI versions of these types and m
sdhci: Add "sysbus" to sdhci QOM types and methods
Update the sdhci sysbus QOM types and methods so that sysbus is in their name. This is in preparation for adding PCI versions of these types and methods.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
d368ba43 |
| 08-Dec-2014 |
Kevin O'Connor <kevin@koconnor.net> |
sdhci: Remove class "virtual" methods
The SDHCIClass defines a series of class "methods". However, no code in the QEMU tree overrides these methods or even uses them outside of sdhci.c.
Remove the
sdhci: Remove class "virtual" methods
The SDHCIClass defines a series of class "methods". However, no code in the QEMU tree overrides these methods or even uses them outside of sdhci.c.
Remove the virtual methods and replace them with direct calls to the underlying functions. This simplifies the process of extending the sdhci code to support PCI devices (which have a different parent class).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
c7ff8daa |
| 08-Dec-2014 |
Kevin O'Connor <kevin@koconnor.net> |
sdhci: Set a default frequency clock
The Linux SDHCI PCI driver will only register the device if there is a clock frequency set. So, set a default frequency of 52Mhz.
Signed-off-by: Kevin O'Connor
sdhci: Set a default frequency clock
The Linux SDHCI PCI driver will only register the device if there is a clock frequency set. So, set a default frequency of 52Mhz.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
4be74634 |
| 07-Oct-2014 |
Markus Armbruster <armbru@redhat.com> |
hw: Convert from BlockDriverState to BlockBackend, mostly
Device models should access their block backends only through the block-backend.h API. Convert them, and drop direct includes of inappropri
hw: Convert from BlockDriverState to BlockBackend, mostly
Device models should access their block backends only through the block-backend.h API. Convert them, and drop direct includes of inappropriate headers.
Just four uses of BlockDriverState are left:
* The Xen paravirtual block device backend (xen_disk.c) opens images itself when set up via xenbus, bypassing blockdev.c. I figure it should go through qmp_blockdev_add() instead.
* Device model "usb-storage" prompts for keys. No other device model does, and this one probably shouldn't do it, either.
* ide_issue_trim_cb() uses bdrv_aio_discard() instead of blk_aio_discard() because it fishes its backend out of a BlockAIOCB, which has only the BlockDriverState.
* PC87312State has an unused BlockDriverState[] member.
The next two commits take care of the latter two.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
#
fa1d36df |
| 07-Oct-2014 |
Markus Armbruster <armbru@redhat.com> |
block: Eliminate DriveInfo member bdrv, use blk_by_legacy_dinfo()
The patch is big, but all it really does is replacing
dinfo->bdrv
by
blk_bs(blk_by_legacy_dinfo(dinfo))
The replacement
block: Eliminate DriveInfo member bdrv, use blk_by_legacy_dinfo()
The patch is big, but all it really does is replacing
dinfo->bdrv
by
blk_bs(blk_by_legacy_dinfo(dinfo))
The replacement is repetitive, but the conversion of device models to BlockBackend is imminent, and will shorten it to just blk_legacy_dinfo(dinfo).
Line wrapping muddies the waters a bit. I also omit tests whether dinfo->bdrv is null, because it never is.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Benoît Canet <benoit.canet@nodalink.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
#
9db11cef |
| 04-Aug-2014 |
Peter Crosthwaite <peter.crosthwaite@xilinx.com> |
sd: sdhci: Fix ADMA dma_memory_read access
This dma_memory_read was giving too big a size when begin was non-zero. This could cause segfaults in some circumstances. Fix.
Signed-off-by: Peter Crosth
sd: sdhci: Fix ADMA dma_memory_read access
This dma_memory_read was giving too big a size when begin was non-zero. This could cause segfaults in some circumstances. Fix.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
f3c7d038 |
| 18-Jun-2014 |
Andreas Färber <afaerber@suse.de> |
hw: Fix qemu_allocate_irqs() leaks
Replace qemu_allocate_irqs(foo, bar, 1)[0] with qemu_allocate_irq(foo, bar, 0).
This avoids leaking the dereferenced qemu_irq *.
Cc: Markus Armbruster <armbru@re
hw: Fix qemu_allocate_irqs() leaks
Replace qemu_allocate_irqs(foo, bar, 1)[0] with qemu_allocate_irq(foo, bar, 0).
This avoids leaking the dereferenced qemu_irq *.
Cc: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andreas Färber <afaerber@suse.de> [PC Changes: * Applied change to instance in sh4/sh7750.c ] Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Kirill Batuzov <batuzovk@ispras.ru> [AF: Fix IRQ index in sh4/sh7750.c] Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de>
show more ...
|
#
127a4e1a |
| 13-May-2014 |
Andreas Färber <afaerber@suse.de> |
sdhci: Fix misuse of qemu_free_irqs()
It does a g_free() on the pointer, so don't pass a local &foo reference.
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Mayde
sdhci: Fix misuse of qemu_free_irqs()
It does a g_free() on the pointer, so don't pass a local &foo reference.
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de>
show more ...
|
#
35d08458 |
| 16-Apr-2014 |
Juan Quintela <quintela@redhat.com> |
savevm: Remove all the unneeded version_minimum_id_old (rest)
After previous Peter patch, they are redundant. This way we don't assign them except when needed. Once there, there were lots of case
savevm: Remove all the unneeded version_minimum_id_old (rest)
After previous Peter patch, they are redundant. This way we don't assign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong:
.fields = (VMStateField []) { and .fields = (VMStateField []) {
Change all the combinations to:
.fields = (VMStateField[]){
The biggest problem (appart from aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another.
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
#
61e8a923 |
| 20-Feb-2014 |
Peter Maydell <peter.maydell@linaro.org> |
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM infrastructure fixes and device conversions
* QTest cleanups and test cases for PCI NICs * NAND fix for "
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM infrastructure fixes and device conversions
* QTest cleanups and test cases for PCI NICs * NAND fix for "info qtree" * Cleanup and extension of QOM machine tests * IndustryPack test cases and conversion to QOM realize * I2C cleanups * Cleanups of legacy qdev properties
# gpg: Signature made Mon 17 Feb 2014 22:15:37 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>"
* remotes/afaerber/tags/qom-devices-for-peter: (49 commits) qtest: Include system headers before user headers qapi: Refine human printing of sizes qdev: Use QAPI type names for properties qdev: Add enum property types to QAPI schema block: Handle "rechs" and "large" translation options qdev: Remove hex8/32/64 property types qdev: Remove most legacy printers qdev: Use human mode in "info qtree" qapi: Add human mode to StringOutputVisitor qdev: Inline qdev_prop_parse() qdev: Legacy properties are just strings qdev: Legacy properties are now read-only qdev: Remove legacy parsers for hex8/32/64 qdev: Sizes are now parsed by StringInputVisitor qapi: Add size parser to StringInputVisitor qtest: Don't segfault with invalid -qtest option ipack: Move IndustryPack out of hw/char/ ipoctal232: QOM parent field cleanup ipack: QOM parent field cleanup for IPackDevice ipack: QOM parent field cleanup for IPackBus ...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|