[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] hw/sd/aspeed_sdhci: New device
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] hw/sd/aspeed_sdhci: New device |
Date: |
Wed, 7 Aug 2019 10:33:04 +0100 |
On Tue, 6 Aug 2019 at 23:12, Eddie James <address@hidden> wrote:
>
>
> On 8/5/19 9:31 AM, Peter Maydell wrote:
> > On Wed, 26 Jun 2019 at 19:43, Eddie James <address@hidden> wrote:
> >> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> >> index 7b80b1d..51a733b 100644
> >> --- a/hw/sd/sdhci.c
> >> +++ b/hw/sd/sdhci.c
> >> @@ -213,7 +213,13 @@ static uint8_t sdhci_slotint(SDHCIState *s)
> >>
> >> static inline void sdhci_update_irq(SDHCIState *s)
> >> {
> >> - qemu_set_irq(s->irq, sdhci_slotint(s));
> >> + int level = sdhci_slotint(s);
> >> +
> >> + qemu_set_irq(s->irq, level);
> >> +
> >> + if (s->irq_notify) {
> >> + s->irq_notify(s, level);
> >> + }
> > Rather than doing this, just wire the irq lines from
> > the SDHCIState device up to your AspeedSDHCIState device,
> > and then have that update the register state and assert
> > its own irq lines outbound.
>
>
> Sorry I don't follow you at all. Isn't that what I'm doing here? Surely
> I need to take action when sdhci_update_irq is called. I don't see any
> way other way to have my code called at this time.
The way to 'take action when sdhci_update_irq is called'
is to be the function on the other end of the qemu_set_irq()
call, ie be the device at the other end of the qemu_irq line.
You don't need to modify this code in sdhci.c at all.
thanks
-- PMM