qemu/hw/ide
Mark Cave-Ayland fd6a543d19 ide/pci: introduce pci_ide_update_mode() function
This function reads the value of the PCI_CLASS_PROG register for PCI IDE
controllers and configures the PCI BARs and/or IDE ioports accordingly.

In the case where we switch to legacy mode, the PCI BARs are set to return zero
(as suggested in the "PCI IDE Controller" specification), the legacy IDE ioports
are enabled, and the PCI interrupt pin cleared to indicate legacy IRQ routing.

Conversely when we switch to native mode, the legacy IDE ioports are disabled
and the PCI interrupt pin set to indicate native IRQ routing. The contents of
the PCI BARs are unspecified, but this is not an issue since if a PCI IDE
controller has been switched to native mode then its BARs will need to be
programmed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-ID: <20231116103355.588580-3-mark.cave-ayland@ilande.co.uk>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2023-11-21 12:45:21 +01:00
..
ahci_internal.h hw/ide: spelling fixes 2023-08-31 19:47:43 +02:00
ahci-allwinner.c ahci: Move QOM macro to header 2020-08-27 14:04:54 -04:00
ahci.c hw/ide/ahci: fix legacy software reset 2023-11-21 12:45:21 +01:00
atapi.c hw/ide: Rename ide_set_irq() -> ide_bus_set_irq() 2023-02-27 22:29:02 +01:00
cmd646.c hw/ide: spelling fixes 2023-08-31 19:47:43 +02:00
core.c ide/ioport: move ide_portio_list[] and ide_portio_list2[] definitions to IDE core 2023-11-21 12:45:21 +01:00
ich.c hw/ide: Un-inline ide_set_irq() 2023-02-27 22:29:02 +01:00
ioport.c ide/ioport: move ide_portio_list[] and ide_portio_list2[] definitions to IDE core 2023-11-21 12:45:21 +01:00
isa.c migration: Use vmstate_register_any() for isa-ide 2023-11-01 16:13:58 +01:00
Kconfig hw/ide/Kconfig: Add missing dependency PCI -> IDE_QDEV 2021-07-20 15:30:42 +02:00
macio.c hw/ide: Rename idebus_active_if() -> ide_bus_active_if() 2023-02-27 22:29:02 +01:00
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
microdrive.c hw/ide: replace TABs with space 2023-03-24 11:45:33 +01:00
mmio.c hw/ide: Rename ide_init2() -> ide_bus_init_output_irq() 2023-02-27 22:29:02 +01:00
pci.c ide/pci: introduce pci_ide_update_mode() function 2023-11-21 12:45:21 +01:00
piix.c hw/ide/piix: properly initialize the BMIBA register 2023-07-14 11:10:57 +02:00
qdev.c hw/ide: Rename ide_create_drive() -> ide_bus_create_drive() 2023-02-27 22:29:02 +01:00
sii3112.c hw/ide: Extract bmdma_status_writeb() 2023-07-11 00:11:25 +02:00
trace-events hw/ide: Rename ide_exec_cmd() -> ide_bus_exec_cmd() 2023-02-27 22:29:02 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
via.c hw/ide: Extract bmdma_status_writeb() 2023-07-11 00:11:25 +02:00