[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 25/33] hw/isa/piix4: Use TYPE_ISA_PIC device
From: |
Bernhard Beschow |
Subject: |
Re: [PATCH v6 25/33] hw/isa/piix4: Use TYPE_ISA_PIC device |
Date: |
Wed, 11 Jan 2023 22:47:13 +0000 |
Am 11. Januar 2023 17:08:28 UTC schrieb "Philippe Mathieu-Daudé"
<philmd@linaro.org>:
>On 9/1/23 18:23, Bernhard Beschow wrote:
>> Aligns the code with PIIX3 such that PIIXState can be used in PIIX4,
>> too.
>>
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
>> Message-Id: <20221022150508.26830-33-shentey@gmail.com>
>> ---
>> hw/isa/piix4.c | 28 ++++++++++------------------
>> hw/mips/malta.c | 11 +++++++++--
>> hw/mips/Kconfig | 1 +
>> 3 files changed, 20 insertions(+), 20 deletions(-)
>
>> @@ -1459,7 +1461,12 @@ void mips_malta_init(MachineState *machine)
>> pci_ide_create_devs(PCI_DEVICE(dev));
>> /* Interrupt controller */
>> - qdev_connect_gpio_out_named(DEVICE(piix4), "intr", 0, i8259_irq);
>> + dev = DEVICE(object_resolve_path_component(OBJECT(piix4), "pic"));
>> + i8259 = i8259_init(isa_bus, i8259_irq);
>> + for (i = 0; i < ISA_NUM_IRQS; i++) {
>> + qdev_connect_gpio_out(dev, i, i8259[i]);
>> + }
>> + g_free(i8259);
>> /* generate SPD EEPROM data */
>> dev = DEVICE(object_resolve_path_component(OBJECT(piix4), "pm"));
>> diff --git a/hw/mips/Kconfig b/hw/mips/Kconfig
>> index 4e7042f03d..d156de812c 100644
>> --- a/hw/mips/Kconfig
>> +++ b/hw/mips/Kconfig
>> @@ -1,5 +1,6 @@
>> config MALTA
>> bool
>> + select I8259
>> select ISA_SUPERIO
>> select PIIX4
>
>The PIIX4 owns / exposes the I8259, so we don't need to select it here.
>The Malta board only initializes it. Why did you have to add this?
The Malta board instantiates a real I8259 while PIIX4 instantiates the
TYPE_ISA_PIC proxy. Both are implemented pragmatically in the same source file,
so both Malta and PIIX4 select it for different reasons.
In previous iterations using the TYPE_PROXY_PIC this might have been clearer:
PIIX4 would select PROXY_PIC (and not I8259) while Malta would select I8259.
OK?
Best regards,
Bernhard
- Re: [PATCH v6 13/33] hw/i386/pc_piix: Allow for setting properties before realizing PIIX3 south bridge, (continued)
- [PATCH v6 21/33] hw/isa/piix3: Rename piix3_reset() for sharing with PIIX4, Bernhard Beschow, 2023/01/09
- [PATCH v6 20/33] hw/isa/piix3: Rename pci_piix3_props for sharing with PIIX4, Bernhard Beschow, 2023/01/09
- [PATCH v6 15/33] hw/isa/piix3: Create power management controller in host device, Bernhard Beschow, 2023/01/09
- [PATCH v6 23/33] hw/isa/piix4: Make PIIX4's ACPI and USB functions optional, Bernhard Beschow, 2023/01/09
- [PATCH v6 24/33] hw/isa/piix4: Remove unused inbound ISA interrupt lines, Bernhard Beschow, 2023/01/09
- [PATCH v6 19/33] hw/isa/piix3: Resolve redundant PIIX_NUM_PIC_IRQS, Bernhard Beschow, 2023/01/09
- [PATCH v6 25/33] hw/isa/piix4: Use TYPE_ISA_PIC device, Bernhard Beschow, 2023/01/09
- [PATCH v6 22/33] hw/isa/piix3: Drop the "3" from PIIX base class, Bernhard Beschow, 2023/01/09
- [PATCH v6 27/33] hw/isa/piix4: Rename reset control operations to match PIIX3, Bernhard Beschow, 2023/01/09
- [PATCH v6 32/33] hw/isa/piix: Consolidate IRQ triggering, Bernhard Beschow, 2023/01/09
- [PATCH v6 33/33] hw/isa/piix: Share PIIX3's base class with PIIX4, Bernhard Beschow, 2023/01/09
- [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c, Bernhard Beschow, 2023/01/09
- Re: [PATCH v6 28/33] hw/isa/piix3: Merge hw/isa/piix4.c, Philippe Mathieu-Daudé, 2023/01/12