aboutsummaryrefslogtreecommitdiff
path: root/hw/ide/cmd646.c
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2019-01-25 14:52:11 -0500
committerJohn Snow <jsnow@redhat.com>2019-01-25 14:52:11 -0500
commit8ac98d1a97a7aeefe45f4a5af37d61caa41ded54 (patch)
treeea83f51ec6e97a80662db74012c158af4b059383 /hw/ide/cmd646.c
parentc9ebc75dc24f99e881414e7f35544041f678235a (diff)
downloadqemu-8ac98d1a97a7aeefe45f4a5af37d61caa41ded54.zip
qemu-8ac98d1a97a7aeefe45f4a5af37d61caa41ded54.tar.gz
qemu-8ac98d1a97a7aeefe45f4a5af37d61caa41ded54.tar.bz2
ide: Get rid of CMD646BAR struct
Now that no CMD646 specific parts are left in CMD646BAR (all remaining members are really PCI IDE specific) this struct can be deleted moving the memory regions for PCI IDE BARs to PCIIDEState where they better belong. The CMD646 PCI IDE model is adjusted accordingly. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 4b6cb2ae150dc0d21178209e4beb1e35140a7325.1547166960.git.balaton@eik.bme.hu Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'hw/ide/cmd646.c')
-rw-r--r--hw/ide/cmd646.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index 95f0df9..5a56791 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -50,17 +50,6 @@
static void cmd646_update_irq(PCIDevice *pd);
-static void setup_cmd646_bar(PCIIDEState *d, int bus_num)
-{
- IDEBus *bus = &d->bus[bus_num];
- CMD646BAR *bar = &d->cmd646_bar[bus_num];
-
- memory_region_init_io(&bar->cmd, OBJECT(d), &pci_ide_cmd_le_ops, bus,
- "cmd646-cmd", 4);
- memory_region_init_io(&bar->data, OBJECT(d), &pci_ide_data_le_ops, bus,
- "cmd646-data", 8);
-}
-
static void cmd646_update_dma_interrupts(PCIDevice *pd)
{
/* Sync DMA interrupt status from UDMA interrupt status */
@@ -277,12 +266,22 @@ static void pci_cmd646_ide_realize(PCIDevice *dev, Error **errp)
dev->wmask[MRDMODE] = 0x0;
dev->w1cmask[MRDMODE] = MRDMODE_INTR_CH0 | MRDMODE_INTR_CH1;
- setup_cmd646_bar(d, 0);
- setup_cmd646_bar(d, 1);
- pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd646_bar[0].data);
- pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd646_bar[0].cmd);
- pci_register_bar(dev, 2, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd646_bar[1].data);
- pci_register_bar(dev, 3, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd646_bar[1].cmd);
+ memory_region_init_io(&d->data_bar[0], OBJECT(d), &pci_ide_data_le_ops,
+ &d->bus[0], "cmd646-data0", 8);
+ pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &d->data_bar[0]);
+
+ memory_region_init_io(&d->cmd_bar[0], OBJECT(d), &pci_ide_cmd_le_ops,
+ &d->bus[0], "cmd646-cmd0", 4);
+ pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_bar[0]);
+
+ memory_region_init_io(&d->data_bar[1], OBJECT(d), &pci_ide_data_le_ops,
+ &d->bus[1], "cmd646-data1", 8);
+ pci_register_bar(dev, 2, PCI_BASE_ADDRESS_SPACE_IO, &d->data_bar[1]);
+
+ memory_region_init_io(&d->cmd_bar[1], OBJECT(d), &pci_ide_cmd_le_ops,
+ &d->bus[1], "cmd646-cmd1", 4);
+ pci_register_bar(dev, 3, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_bar[1]);
+
bmdma_setup_bar(d);
pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_bar);