[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/3] sdhci: add optional quirk property to di
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/3] sdhci: add optional quirk property to disable card insertion/removal interrupts |
Date: |
Mon, 21 Dec 2015 13:42:02 -0800 |
On Mon, Dec 21, 2015 at 1:31 PM, Andrew Baumann
<address@hidden> wrote:
> This is needed for a quirk of the Raspberry Pi (bcm2835/6) MMC
> controller, where the card insert bit is documented as unimplemented
> (always reads zero, doesn't generate interrupts) but is in fact
> observed on hardware as set at power on, but is cleared (and remains
> clear) on subsequent controller resets.
>
> Signed-off-by: Andrew Baumann <address@hidden>
> Reviewed-by: Peter Crosthwaite <address@hidden>
> ---
> hw/sd/sdhci.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> index dd83e89..61f919b 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -193,7 +193,9 @@ static void sdhci_reset(SDHCIState *s)
> * initialization */
> memset(&s->sdmasysad, 0, (uintptr_t)&s->capareg -
> (uintptr_t)&s->sdmasysad);
>
> - sd_set_cb(s->card, s->ro_cb, s->eject_cb);
> + if (!s->noeject_quirk) {
> + sd_set_cb(s->card, s->ro_cb, s->eject_cb);
> + }
> s->data_count = 0;
> s->stopped_state = sdhc_not_stopped;
> }
> @@ -1208,6 +1210,7 @@ const VMStateDescription sdhci_vmstate = {
> VMSTATE_UINT16(data_count, SDHCIState),
> VMSTATE_UINT64(admasysaddr, SDHCIState),
> VMSTATE_UINT8(stopped_state, SDHCIState),
> + VMSTATE_BOOL(noeject_quirk, SDHCIState),
Sorry, one small thing I missed, static props should not be in the
VMSD. I think you just need to drop the VMSTATE_ addition here.
Otherwise you would need a VMSD version bump.
Is the patch missing the corresponding header change to add the new field?
Regards,
Peter
> VMSTATE_VBUFFER_UINT32(fifo_buffer, SDHCIState, 1, NULL, 0,
> buf_maxsz),
> VMSTATE_TIMER_PTR(insert_timer, SDHCIState),
> VMSTATE_TIMER_PTR(transfer_timer, SDHCIState),
> @@ -1276,6 +1279,7 @@ static Property sdhci_sysbus_properties[] = {
> DEFINE_PROP_UINT32("capareg", SDHCIState, capareg,
> SDHC_CAPAB_REG_DEFAULT),
> DEFINE_PROP_UINT32("maxcurr", SDHCIState, maxcurr, 0),
> + DEFINE_PROP_BOOL("noeject-quirk", SDHCIState, noeject_quirk, false),
> DEFINE_PROP_END_OF_LIST(),
> };
>
> --
> 2.5.3
>