qemu-arm
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]