[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH 08/10] hw/sd/pxa2xx_mmci: Update to use new SDBus
From: |
Peter Maydell |
Subject: |
Re: [Qemu-arm] [PATCH 08/10] hw/sd/pxa2xx_mmci: Update to use new SDBus APIs |
Date: |
Sun, 20 Dec 2015 17:14:45 +0000 |
On 19 December 2015 at 21:42, Peter Crosthwaite
<address@hidden> wrote:
> On Fri, Dec 11, 2015 at 04:37:09PM +0000, Peter Maydell wrote:
>> Now the PXA2xx MMCI device is QOMified itself, we can
>> update it to use the SDBus APIs to talk to the SD card.
>> void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq readonly,
>> qemu_irq coverswitch)
>> {
>> - sd_set_cb(s->card, readonly, coverswitch);
>> + DeviceState *dev = DEVICE(s);
>> +
>> + s->readonly = readonly;
>> + s->inserted = coverswitch;
>> +
>> + pxa2xx_mmci_set_inserted(dev, sdbus_get_inserted(&s->sdbus));
>> + pxa2xx_mmci_set_readonly(dev, sdbus_get_readonly(&s->sdbus));
>
> Looking at the machine models, _mmci_handlers is only called at
> machine init time. So this should not be needed. devices should be
> triggering an initial call of _set_readonly that reliably propagates
> back up.
>
> If we do need these two lines they should be in the reset handler.
This change is just retaining current behaviour over the QOMification
(we would assert the lines in this function before this patch,
so we should continue to do so afterwards).
We have no good mechanism for dealing with lines that ought to
be asserted on device reset (of which "sd card inserted" is
typically one). If we assert these lines on reset then we're
just introducing a different wrong behaviour where there's
a dependency on reset order. I preferred not to touch this
because we don't actually care much about the pxa2xx boards
themselves except that they're getting a bit elderly and
need updating to QOM.
thanks
-- PMM
- Re: [Qemu-arm] [PATCH 01/10] hw/sd/sdhci.c: Remove x-drive property, (continued)
[Qemu-arm] [PATCH 08/10] hw/sd/pxa2xx_mmci: Update to use new SDBus APIs, Peter Maydell, 2015/12/11
[Qemu-arm] [PATCH 06/10] sdhci_sysbus: Create SD card device in users, not the device itself, Peter Maydell, 2015/12/11
[Qemu-arm] [PATCH 04/10] hw/sd: Add QOM bus which SD cards plug in to, Peter Maydell, 2015/12/11