mbox series

[00/12] hw/acpi/piix4: remove legacy piix4_pm_init() function

Message ID 20220528091934.15520-1-mark.cave-ayland@ilande.co.uk (mailing list archive)
Headers show
Series hw/acpi/piix4: remove legacy piix4_pm_init() function | expand

Message

Mark Cave-Ayland May 28, 2022, 9:19 a.m. UTC
Whilst reviewing Bernhard's PIIX Southbridge QOMifcation patches at 
https://lists.gnu.org/archive/html/qemu-devel/2022-05/msg04329.html, I
noticed that we should first eliminate the legacy device init function
piix4_pm_init().

This series moves the outstanding logic from piix4_pm_init() into the
relevant instance init() and realize() functions, changes the IRQs to
use qdev gpios, and then finally removes the now-unused piix4_pm_initfn()
function.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


Mark Cave-Ayland (12):
  hw/acpi/piix4: move xen_enabled() logic from piix4_pm_init() to
    piix4_pm_realize()
  hw/acpi/piix4: change smm_enabled from int to bool
  hw/acpi/piix4: convert smm_enabled bool to qdev property
  hw/acpi/piix4: move PIIX4PMState into separate piix4.h header
  hw/acpi/piix4: alter piix4_pm_init() to return PIIX4PMState
  hw/acpi/piix4: rename piix4_pm_init() to piix4_pm_initfn()
  hw/acpi/piix4: introduce piix4_pm_init() instance init function
  hw/acpi/piix4: use qdev gpio to wire up sci_irq
  hw/acpi/piix4: use qdev gpio to wire up smi_irq
  hw/i386/pc_piix: create PIIX4_PM device directly instead of using
    piix4_pm_initfn()
  hw/isa/piix4.c: create PIIX4_PM device directly instead of using
    piix4_pm_initfn()
  hw/acpi/piix4: remove unused piix4_pm_initfn() function

 hw/acpi/piix4.c               | 77 ++++++-----------------------------
 hw/i386/acpi-build.c          |  1 +
 hw/i386/pc_piix.c             | 16 +++++---
 hw/isa/piix4.c                | 11 +++--
 include/hw/acpi/piix4.h       | 75 ++++++++++++++++++++++++++++++++++
 include/hw/southbridge/piix.h |  6 ---
 6 files changed, 107 insertions(+), 79 deletions(-)
 create mode 100644 include/hw/acpi/piix4.h

Comments

Philippe Mathieu-Daudé May 29, 2022, 6:05 p.m. UTC | #1
On 28/5/22 11:19, Mark Cave-Ayland wrote:
> Whilst reviewing Bernhard's PIIX Southbridge QOMifcation patches at
> https://lists.gnu.org/archive/html/qemu-devel/2022-05/msg04329.html, I
> noticed that we should first eliminate the legacy device init function
> piix4_pm_init().
> 
> This series moves the outstanding logic from piix4_pm_init() into the
> relevant instance init() and realize() functions, changes the IRQs to
> use qdev gpios, and then finally removes the now-unused piix4_pm_initfn()
> function.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> 
> 
> Mark Cave-Ayland (12):
>    hw/acpi/piix4: move xen_enabled() logic from piix4_pm_init() to
>      piix4_pm_realize()
>    hw/acpi/piix4: change smm_enabled from int to bool
>    hw/acpi/piix4: convert smm_enabled bool to qdev property
>    hw/acpi/piix4: move PIIX4PMState into separate piix4.h header
>    hw/acpi/piix4: alter piix4_pm_init() to return PIIX4PMState
>    hw/acpi/piix4: rename piix4_pm_init() to piix4_pm_initfn()
>    hw/acpi/piix4: introduce piix4_pm_init() instance init function
>    hw/acpi/piix4: use qdev gpio to wire up sci_irq
>    hw/acpi/piix4: use qdev gpio to wire up smi_irq
>    hw/i386/pc_piix: create PIIX4_PM device directly instead of using
>      piix4_pm_initfn()
>    hw/isa/piix4.c: create PIIX4_PM device directly instead of using
>      piix4_pm_initfn()
>    hw/acpi/piix4: remove unused piix4_pm_initfn() function

Nitpicking, SCI could also be a named GPIO :)

Series:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Bernhard Beschow May 29, 2022, 6:31 p.m. UTC | #2
Am 29. Mai 2022 18:05:41 UTC schrieb "Philippe Mathieu-Daudé" <f4bug@amsat.org>:
>On 28/5/22 11:19, Mark Cave-Ayland wrote:
>> Whilst reviewing Bernhard's PIIX Southbridge QOMifcation patches at
>> https://lists.gnu.org/archive/html/qemu-devel/2022-05/msg04329.html, I
>> noticed that we should first eliminate the legacy device init function
>> piix4_pm_init().
>> 
>> This series moves the outstanding logic from piix4_pm_init() into the
>> relevant instance init() and realize() functions, changes the IRQs to
>> use qdev gpios, and then finally removes the now-unused piix4_pm_initfn()
>> function.
>> 
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> 
>> 
>> Mark Cave-Ayland (12):
>>    hw/acpi/piix4: move xen_enabled() logic from piix4_pm_init() to
>>      piix4_pm_realize()
>>    hw/acpi/piix4: change smm_enabled from int to bool
>>    hw/acpi/piix4: convert smm_enabled bool to qdev property
>>    hw/acpi/piix4: move PIIX4PMState into separate piix4.h header
>>    hw/acpi/piix4: alter piix4_pm_init() to return PIIX4PMState
>>    hw/acpi/piix4: rename piix4_pm_init() to piix4_pm_initfn()
>>    hw/acpi/piix4: introduce piix4_pm_init() instance init function
>>    hw/acpi/piix4: use qdev gpio to wire up sci_irq
>>    hw/acpi/piix4: use qdev gpio to wire up smi_irq
>>    hw/i386/pc_piix: create PIIX4_PM device directly instead of using
>>      piix4_pm_initfn()
>>    hw/isa/piix4.c: create PIIX4_PM device directly instead of using
>>      piix4_pm_initfn()
>>    hw/acpi/piix4: remove unused piix4_pm_initfn() function
>
>Nitpicking, SCI could also be a named GPIO :)

Yes... I was just wondering the same!

Best regards,
Bernhard

>
>Series:
>Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Mark Cave-Ayland May 30, 2022, 8:02 p.m. UTC | #3
On 29/05/2022 19:05, Philippe Mathieu-Daudé via wrote:

> On 28/5/22 11:19, Mark Cave-Ayland wrote:
>> Whilst reviewing Bernhard's PIIX Southbridge QOMifcation patches at
>> https://lists.gnu.org/archive/html/qemu-devel/2022-05/msg04329.html, I
>> noticed that we should first eliminate the legacy device init function
>> piix4_pm_init().
>>
>> This series moves the outstanding logic from piix4_pm_init() into the
>> relevant instance init() and realize() functions, changes the IRQs to
>> use qdev gpios, and then finally removes the now-unused piix4_pm_initfn()
>> function.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>>
>>
>> Mark Cave-Ayland (12):
>>    hw/acpi/piix4: move xen_enabled() logic from piix4_pm_init() to
>>      piix4_pm_realize()
>>    hw/acpi/piix4: change smm_enabled from int to bool
>>    hw/acpi/piix4: convert smm_enabled bool to qdev property
>>    hw/acpi/piix4: move PIIX4PMState into separate piix4.h header
>>    hw/acpi/piix4: alter piix4_pm_init() to return PIIX4PMState
>>    hw/acpi/piix4: rename piix4_pm_init() to piix4_pm_initfn()
>>    hw/acpi/piix4: introduce piix4_pm_init() instance init function
>>    hw/acpi/piix4: use qdev gpio to wire up sci_irq
>>    hw/acpi/piix4: use qdev gpio to wire up smi_irq
>>    hw/i386/pc_piix: create PIIX4_PM device directly instead of using
>>      piix4_pm_initfn()
>>    hw/isa/piix4.c: create PIIX4_PM device directly instead of using
>>      piix4_pm_initfn()
>>    hw/acpi/piix4: remove unused piix4_pm_initfn() function
> 
> Nitpicking, SCI could also be a named GPIO :)

FWIW I used the SCI irq as the "primary" GPIO since it was referenced as just "irq" 
within PIIX4PMState which is typical for a single output IRQ (my guess would be that 
"smi_irq" came along later).

> Series:
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Thanks!


ATB,

Mark.