From fa8ac1b769ae1b7681924d4c9d7252e57c612909 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Fri, 13 Mar 2020 08:24:42 +0000 Subject: via-ide: initialise IDE controller in legacy mode According to both the VT82C686B and VT8231 datasheets the VIA Southbridge IDE controller is initialised in legacy mode. This allows Linux to correctly determine that legacy rather than PCI IRQ routing should be used since the boot console text in the fulong2e test image changes from: scsi0 : pata_via scsi1 : pata_via ata1: PATA max UDMA/100 cmd 0xffffffffbfd04050 ctl 0xffffffffbfd04062 \ bmdma 0xffffffffbfd04040 irq 14 ata2: PATA max UDMA/100 cmd 0xffffffffbfd04058 ctl 0xffffffffbfd04066 \ bmdma 0xffffffffbfd04048 irq 14 to: scsi0 : pata_via scsi1 : pata_via ata1: PATA max UDMA/100 cmd 0xffffffffbfd001f0 ctl 0xffffffffbfd003f6 \ bmdma 0xffffffffbfd04040 irq 14 ata2: PATA max UDMA/100 cmd 0xffffffffbfd00170 ctl 0xffffffffbfd00376 \ bmdma 0xffffffffbfd04048 irq 15 Signed-off-by: Mark Cave-Ayland Tested-by: BALATON Zoltan Signed-off-by: BALATON Zoltan Message-id: 20200313082444.2439-6-mark.cave-ayland@ilande.co.uk Signed-off-by: John Snow --- hw/ide/via.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/ide/via.c b/hw/ide/via.c index 8363bd4802..c8835de01b 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -167,7 +167,7 @@ static void via_ide_realize(PCIDevice *dev, Error **errp) uint8_t *pci_conf = dev->config; int i; - pci_config_set_prog_interface(pci_conf, 0x8f); /* native PCI ATA mode */ + pci_config_set_prog_interface(pci_conf, 0x8a); /* legacy mode */ pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0); dev->wmask[PCI_INTERRUPT_LINE] = 0; -- cgit v1.2.3