From: Bernhard Beschow <shentey@gmail.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, "Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v5 3/5] hw/isa/vt82c686: Reuse acpi_update_sci()
Date: Mon, 30 Oct 2023 09:45:49 +0000 [thread overview]
Message-ID: <8F8EE81A-9153-4DB9-ADE3-C24B64CD4D1E@gmail.com> (raw)
In-Reply-To: <4d959097-0c53-c0fd-b1a0-3d8250e1a314@eik.bme.hu>
Am 29. Oktober 2023 00:07:00 UTC schrieb BALATON Zoltan <balaton@eik.bme.hu>:
>On Sat, 28 Oct 2023, Bernhard Beschow wrote:
>> acpi_update_sci() covers everything pm_update_sci() does. It implements common
>> ACPI funtionality in a generic fashion. Note that it agnostic to any
>> Frankenstein usage of the general purpose event registers in other device
>> models. It just implements a generic mechanism which can be wired to arbitrary
>> functionality.
>>
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> ---
>> hw/isa/vt82c686.c | 20 ++------------------
>> 1 file changed, 2 insertions(+), 18 deletions(-)
>>
>> diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
>> index 60ca781e03..7b44ad9485 100644
>> --- a/hw/isa/vt82c686.c
>> +++ b/hw/isa/vt82c686.c
>> @@ -145,26 +145,10 @@ static const MemoryRegionOps pm_io_ops = {
>> },
>> };
>>
>> -static void pm_update_sci(ViaPMState *s)
>> -{
>> - int sci_level, pmsts;
>> -
>> - pmsts = acpi_pm1_evt_get_sts(&s->ar);
>> - sci_level = (((pmsts & s->ar.pm1.evt.en) &
>> - (ACPI_BITMASK_RT_CLOCK_ENABLE |
>> - ACPI_BITMASK_POWER_BUTTON_ENABLE |
>> - ACPI_BITMASK_GLOBAL_LOCK_ENABLE |
>> - ACPI_BITMASK_TIMER_ENABLE)) != 0);
>> - qemu_set_irq(s->sci_irq, sci_level);
>> - /* schedule a timer interruption if needed */
>> - acpi_pm_tmr_update(&s->ar, (s->ar.pm1.evt.en & ACPI_BITMASK_TIMER_ENABLE) &&
>> - !(pmsts & ACPI_BITMASK_TIMER_STATUS));
>> -}
>> -
>> static void pm_tmr_timer(ACPIREGS *ar)
>> {
>> ViaPMState *s = container_of(ar, ViaPMState, ar);
>> - pm_update_sci(s);
>> + acpi_update_sci(&s->ar, s->sci_irq);
>
>To avoid needing an interrupt here maybe you could modify acpi_update_sci() to allow NULL irq then call via_isa_set_irq here so the interrupt routing can be done within the ISA bridge.
Given the interesting behavior of the amigaone boot loader I'd respin this series with the last two patches only.
Best regards,
Bernhard
>
>Regards,
>BALATON Zoltan
>
>> }
>>
>> static void via_pm_reset(DeviceState *d)
>> @@ -182,7 +166,7 @@ static void via_pm_reset(DeviceState *d)
>> acpi_pm1_cnt_reset(&s->ar);
>> acpi_pm_tmr_reset(&s->ar);
>> acpi_gpe_reset(&s->ar);
>> - pm_update_sci(s);
>> + acpi_update_sci(&s->ar, s->sci_irq);
>>
>> pm_io_space_update(s);
>> smb_io_space_update(s);
>>
next prev parent reply other threads:[~2023-10-30 10:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-28 9:16 [PATCH v5 0/5] VIA PM: Implement basic ACPI support Bernhard Beschow
2023-10-28 9:16 ` [PATCH v5 1/5] hw/isa/vt82c686: Respect SCI interrupt assignment Bernhard Beschow
2023-10-28 9:16 ` [PATCH v5 2/5] hw/isa/vt82c686: Add missing initialization of ACPI general purpose event registers Bernhard Beschow
2023-10-28 9:16 ` [PATCH v5 3/5] hw/isa/vt82c686: Reuse acpi_update_sci() Bernhard Beschow
2023-10-28 12:59 ` BALATON Zoltan
2023-10-28 15:40 ` Bernhard Beschow
2023-10-29 0:07 ` BALATON Zoltan
2023-10-29 1:07 ` Bernhard Beschow
2023-10-29 9:47 ` BALATON Zoltan
2023-10-30 9:45 ` Bernhard Beschow [this message]
2023-10-30 10:43 ` BALATON Zoltan
2023-10-28 9:16 ` [PATCH v5 4/5] hw/isa/vt82c686: Implement ACPI powerdown Bernhard Beschow
2023-10-28 9:16 ` [PATCH v5 5/5] hw/isa/vt82c686: Implement software-based SMI triggering Bernhard Beschow
2023-10-28 13:03 ` BALATON Zoltan
2023-10-28 15:44 ` Bernhard Beschow
2023-10-28 17:41 ` BALATON Zoltan
2023-10-28 12:58 ` [PATCH v5 0/5] VIA PM: Implement basic ACPI support BALATON Zoltan
2023-10-28 15:20 ` Bernhard Beschow
2023-10-28 17:47 ` BALATON Zoltan
2023-10-29 0:03 ` BALATON Zoltan
2023-10-29 1:05 ` Bernhard Beschow
2023-10-29 9:46 ` BALATON Zoltan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8F8EE81A-9153-4DB9-ADE3-C24B64CD4D1E@gmail.com \
--to=shentey@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=jiaxun.yang@flygoat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).