qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] ide: implement simple legacy/native mode switching for PCI IDE controllers
@ 2023-11-16 10:33 Mark Cave-Ayland
  2023-11-16 10:33 ` [PATCH v3 1/4] ide/ioport: move ide_portio_list[] and ide_portio_list2[] definitions to IDE core Mark Cave-Ayland
                   ` (5 more replies)
  0 siblings, 6 replies; 33+ messages in thread
From: Mark Cave-Ayland @ 2023-11-16 10:33 UTC (permalink / raw)
  To: kwolf, jsnow, qemu-block, qemu-devel, balaton, philmd, shentey

This series adds a simple implementation of legacy/native mode switching for PCI
IDE controllers and updates the via-ide device to use it.

The approach I take here is to add a new pci_ide_update_mode() function which handles
management of the PCI BARs and legacy IDE ioports for each mode to avoid exposing
details of the internal logic to individual PCI IDE controllers.

As noted in [1] this is extracted from a local WIP branch I have which contains
further work in this area. However for the moment I've kept it simple (and
restricted it to the via-ide device) which is good enough for Zoltan's PPC
images whilst paving the way for future improvements after 8.2.

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

[1] https://lists.gnu.org/archive/html/qemu-devel/2023-10/msg05403.html

v3:
- Rebase onto master
- Move ide_portio_list[] and ide_portio_list2[] to IDE core to prevent duplication in
  hw/ide/pci.c
- Don't zero BARs when switching from native mode to legacy mode, instead always force
  them to read zero as suggested in the PCI IDE specification (note: this also appears
  to fix the fuloong2e machine booting from IDE)
- Add comments in pci_ide_update_mode() suggested by Kevin
- Drop the existing R-B and T-B tags: whilst this passes my local tests, the behaviour
  around zero BARs feels different enough here

v2:
- Rebase onto master
- Mask the bottom 4 bits of PCI_CLASS_PROG in pci_ide_update_mode() in patch 1
- Add patch 2 to remove the default BAR addresses to avoid confusion
- Don't set PCI_INTERRUPT_PIN directly in via_ide_reset() as it is already set
  by pci_ide_update_mode() in patch 3, and reword the commit message accordingly
- Add Tested-By tags from Zoltan and Bernhard


Mark Cave-Ayland (4):
  ide/ioport: move ide_portio_list[] and ide_portio_list2[] definitions
    to IDE core
  ide/pci: introduce pci_ide_update_mode() function
  ide/via: don't attempt to set default BAR addresses
  hw/ide/via: implement legacy/native mode switching

 hw/ide/core.c             | 12 ++++++
 hw/ide/ioport.c           | 12 ------
 hw/ide/pci.c              | 84 +++++++++++++++++++++++++++++++++++++++
 hw/ide/via.c              | 44 ++++++++++++++++----
 include/hw/ide/internal.h |  3 ++
 include/hw/ide/pci.h      |  1 +
 6 files changed, 137 insertions(+), 19 deletions(-)

-- 
2.39.2



^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2023-11-21 11:05 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-16 10:33 [PATCH v3 0/4] ide: implement simple legacy/native mode switching for PCI IDE controllers Mark Cave-Ayland
2023-11-16 10:33 ` [PATCH v3 1/4] ide/ioport: move ide_portio_list[] and ide_portio_list2[] definitions to IDE core Mark Cave-Ayland
2023-11-16 13:13   ` Philippe Mathieu-Daudé
2023-11-16 10:33 ` [PATCH v3 2/4] ide/pci: introduce pci_ide_update_mode() function Mark Cave-Ayland
2023-11-16 10:33 ` [PATCH v3 3/4] ide/via: don't attempt to set default BAR addresses Mark Cave-Ayland
2023-11-16 13:14   ` Philippe Mathieu-Daudé
2023-11-16 10:33 ` [PATCH v3 4/4] hw/ide/via: implement legacy/native mode switching Mark Cave-Ayland
2023-11-16 12:39   ` BALATON Zoltan
2023-11-16 13:48 ` [PATCH v3 0/4] ide: implement simple legacy/native mode switching for PCI IDE controllers Kevin Wolf
2023-11-16 21:59   ` BALATON Zoltan
2023-11-17 14:23     ` BALATON Zoltan
2023-11-20 10:17       ` Kevin Wolf
2023-11-20 11:10         ` BALATON Zoltan
2023-11-19 21:43 ` BALATON Zoltan
2023-11-19 22:11   ` BALATON Zoltan
2023-11-20 12:18   ` Mark Cave-Ayland
2023-11-20 13:09     ` BALATON Zoltan
2023-11-20 13:42       ` Kevin Wolf
2023-11-20 13:47         ` BALATON Zoltan
2023-11-20 14:00           ` BALATON Zoltan
2023-11-20 14:58           ` Kevin Wolf
2023-11-20 15:11             ` BALATON Zoltan
2023-11-21  9:48               ` Kevin Wolf
2023-11-20 14:28         ` Mark Cave-Ayland
2023-11-20 15:02           ` BALATON Zoltan
2023-11-21  9:12             ` Kevin Wolf
2023-11-21 10:16               ` Mark Cave-Ayland
2023-11-21 11:04                 ` Peter Maydell
2023-11-20 12:26   ` Mark Cave-Ayland
2023-11-20 13:19     ` BALATON Zoltan
2023-11-20 13:30       ` BALATON Zoltan
2023-11-20 14:15         ` Mark Cave-Ayland
2023-11-20 14:58           ` BALATON Zoltan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).