mbox series

[0/2] ide: implement simple legacy/native mode switching for PCI IDE controllers

Message ID 20231019130452.508426-1-mark.cave-ayland@ilande.co.uk (mailing list archive)
Headers show
Series ide: implement simple legacy/native mode switching for PCI IDE controllers | expand

Message

Mark Cave-Ayland Oct. 19, 2023, 1:04 p.m. UTC
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

Mark Cave-Ayland (2):
  ide/pci.c: introduce pci_ide_update_mode() function
  hw/ide/via: implement legacy/native mode switching

 hw/ide/pci.c         | 90 ++++++++++++++++++++++++++++++++++++++++++++
 hw/ide/via.c         | 20 +++++++++-
 include/hw/ide/pci.h |  1 +
 3 files changed, 109 insertions(+), 2 deletions(-)

Comments

BALATON Zoltan Oct. 19, 2023, 11:14 p.m. UTC | #1
On Thu, 19 Oct 2023, Mark Cave-Ayland wrote:
> 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>

Tested-by: BALATON Zoltan <balaton@eik.bme.hu>

Thank you for finishing these. I've verified that AmigaOS and MorphOS 
and Linux still boot on pegasos2 and it also works with AmigaOS on 
amigaone so I'm OK with this. I only had some small comments in patch 2. 
This can replace patch 1 in my series, the other patches should just apply 
on top of this too but I can resubmit based on this when it becomes final.

Regards,
BALATON Zoltan

>
> [1] https://lists.gnu.org/archive/html/qemu-devel/2023-10/msg05403.html
>
> Mark Cave-Ayland (2):
>  ide/pci.c: introduce pci_ide_update_mode() function
>  hw/ide/via: implement legacy/native mode switching
>
> hw/ide/pci.c         | 90 ++++++++++++++++++++++++++++++++++++++++++++
> hw/ide/via.c         | 20 +++++++++-
> include/hw/ide/pci.h |  1 +
> 3 files changed, 109 insertions(+), 2 deletions(-)
>
>
Bernhard Beschow Oct. 22, 2023, 10:10 p.m. UTC | #2
Am 19. Oktober 2023 13:04:50 UTC schrieb Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>:
>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>

I've successfully tested this series on top of my pc-via branch, so for the series:
Tested-by: Bernhard Beschow <shentey@gmail.com>

I've added comments to the first patch.

Best regards,
Bernhard

>
>
>[1] https://lists.gnu.org/archive/html/qemu-devel/2023-10/msg05403.html
>
>Mark Cave-Ayland (2):
>  ide/pci.c: introduce pci_ide_update_mode() function
>  hw/ide/via: implement legacy/native mode switching
>
> hw/ide/pci.c         | 90 ++++++++++++++++++++++++++++++++++++++++++++
> hw/ide/via.c         | 20 +++++++++-
> include/hw/ide/pci.h |  1 +
> 3 files changed, 109 insertions(+), 2 deletions(-)
>
Mark Cave-Ayland Oct. 23, 2023, 6:03 p.m. UTC | #3
On 22/10/2023 23:10, Bernhard Beschow wrote:

> Am 19. Oktober 2023 13:04:50 UTC schrieb Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>:
>> 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>
> 
> I've successfully tested this series on top of my pc-via branch, so for the series:
> Tested-by: Bernhard Beschow <shentey@gmail.com>
> 
> I've added comments to the first patch.
> 
> Best regards,
> Bernhard

Thanks a lot! I'll make the change to the switch() statement and then post an updated 
v2 later this evening.

>> [1] https://lists.gnu.org/archive/html/qemu-devel/2023-10/msg05403.html
>>
>> Mark Cave-Ayland (2):
>>   ide/pci.c: introduce pci_ide_update_mode() function
>>   hw/ide/via: implement legacy/native mode switching
>>
>> hw/ide/pci.c         | 90 ++++++++++++++++++++++++++++++++++++++++++++
>> hw/ide/via.c         | 20 +++++++++-
>> include/hw/ide/pci.h |  1 +
>> 3 files changed, 109 insertions(+), 2 deletions(-)


ATB,

Mark.