[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v2 06/20] piix4: Add a i8257 DMA Controller as specified in datasheet
- To: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
- From: Li Qiang <liq3ea@xxxxxxxxx>
- Date: Mon, 21 Oct 2019 23:25:19 +0800
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Paul Durrant <paul@xxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Qemu Developers <qemu-devel@xxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Hervé Poussineau <hpoussin@xxxxxxxxxxx>, Aleksandar Markovic <amarkovic@xxxxxxxxxxxx>, Igor Mammedov <imammedo@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxx>, Aurelien Jarno <aurelien@xxxxxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxx>
- Delivery-date: Mon, 21 Oct 2019 15:26:06 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
From: Hervé Poussineau <hpoussin@xxxxxxxxxxx>
Remove i8257 instantiated in malta board, to not have it twice.
Acked-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
Acked-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Signed-off-by: Hervé Poussineau <hpoussin@xxxxxxxxxxx>
Message-Id: <20171216090228.28505-9-hpoussin@xxxxxxxxxxx>
Reviewed-by: Aleksandar Markovic <amarkovic@xxxxxxxxxxxx>
[PMD: rebased]
Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
---
hw/isa/piix4.c | 4 ++++
hw/mips/mips_malta.c | 2 --
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
index ac9383a658..0b24d8323c 100644
--- a/hw/isa/piix4.c
+++ b/hw/isa/piix4.c
@@ -29,6 +29,7 @@
#include "hw/pci/pci.h"
#include "hw/isa/isa.h"
#include "hw/sysbus.h"
+#include "hw/dma/i8257.h"
#include "migration/vmstate.h"
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
@@ -167,6 +168,9 @@ static void piix4_realize(PCIDevice *dev, Error **errp)
/* initialize ISA irqs */
isa_bus_irqs(isa_bus, s->isa);
+ /* DMA */
+ i8257_dma_init(isa_bus, 0);
+
piix4_dev = dev;
}
Could you please explain why this is better calling 'i8257_dma_init' in piix4 realize function instead of calling it in mips_malta_init.
I'm still a little of which things should be done in realize and which should be done in qom instance init function.
Thanks, Li Qiang
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index e499b7a6bb..df247177ca 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -28,7 +28,6 @@
#include "cpu.h"
#include "hw/i386/pc.h"
#include "hw/isa/superio.h"
-#include "hw/dma/i8257.h"
#include "hw/char/serial.h"
#include "net/net.h"
#include "hw/boards.h"
@@ -1430,7 +1429,6 @@ void mips_malta_init(MachineState *machine)
smbus = piix4_pm_init(pci_bus, piix4_devfn + 3, 0x1100,
isa_get_irq(NULL, 9), NULL, 0, NULL);
pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
- i8257_dma_init(isa_bus, 0);
mc146818_rtc_init(isa_bus, 2000, NULL);
/* generate SPD EEPROM data */
--
2.21.0
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|