OSDN Git Service

hw/ide/via: implement legacy/native mode switching
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Thu, 16 Nov 2023 10:33:55 +0000 (10:33 +0000)
committerKevin Wolf <kwolf@redhat.com>
Tue, 21 Nov 2023 11:45:21 +0000 (12:45 +0100)
commitdebb4911667b1f8213ca8760ae83afcf3b3579e0
treead6c8c25932d20afbc06ad3ef7bc4c8836d64bf2
parent7a9d672b8149794e0509950ba53dad64c8d476ac
hw/ide/via: implement legacy/native mode switching

Allow the VIA IDE controller to switch between both legacy and native modes by
calling pci_ide_update_mode() to reconfigure the device whenever PCI_CLASS_PROG
is updated.

This patch moves the initial setting of PCI_CLASS_PROG from via_ide_realize() to
via_ide_reset(), and removes the direct setting of PCI_INTERRUPT_PIN during PCI
bus reset since this is now managed by pci_ide_update_mode(). This ensures that
the device configuration is always consistent with respect to the currently
selected mode.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-ID: <20231116103355.588580-5-mark.cave-ayland@ilande.co.uk>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide/via.c