hda: disable TCSEL on ATI/AMD for non-hmdi

also disable MSI with C-MEDIA 0x5011 (reference alsa)

Change-Id: I51e0b8f046df13a23a0b39998e4155a2ec40f5f2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2290
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Jérôme Duval 2020-02-28 10:29:55 +01:00
parent 276e89f756
commit a5544d0a21

View File

@ -37,6 +37,7 @@
#define PCI_VENDOR_ATI 0x1002
#define PCI_VENDOR_AMD 0x1022
#define PCI_VENDOR_CREATIVE 0x1102
#define PCI_VENDOR_CMEDIA 0x13f6
#define PCI_VENDOR_INTEL 0x8086
#define PCI_VENDOR_NVIDIA 0x10de
#define PCI_VENDOR_VMWARE 0x15ad
@ -46,6 +47,7 @@
#define HDA_QUIRK_SNOOP 0x0001
#define HDA_QUIRK_NO_MSI 0x0002
#define HDA_QUIRK_NO_CORBRP_RESET_ACK 0x0004
#define HDA_QUIRK_NOTCSEL 0x0008
static const struct {
@ -92,17 +94,18 @@ static const struct {
{ PCI_VENDOR_INTEL, 0xa2f0, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_INTEL, 0xa348, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_INTEL, 0xa3f0, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_ATI, 0x437b, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_ATI, 0x4383, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_AMD, 0x157a, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_AMD, 0x780d, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_AMD, 0x1457, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_AMD, 0x1487, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_AMD, 0x15e3, HDA_QUIRK_SNOOP },
{ PCI_VENDOR_ATI, 0x437b, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
{ PCI_VENDOR_ATI, 0x4383, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
{ PCI_VENDOR_AMD, 0x157a, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
{ PCI_VENDOR_AMD, 0x780d, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
{ PCI_VENDOR_AMD, 0x1457, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
{ PCI_VENDOR_AMD, 0x1487, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
{ PCI_VENDOR_AMD, 0x15e3, HDA_QUIRK_SNOOP | HDA_QUIRK_NOTCSEL },
// Enable snooping for Nvidia, right now for all their hda-devices,
// but only based on guessing.
{ PCI_VENDOR_NVIDIA, PCI_ALL_DEVICES, HDA_QUIRK_SNOOP | HDA_QUIRK_NO_MSI
| HDA_QUIRK_NO_CORBRP_RESET_ACK },
{ PCI_VENDOR_CMEDIA, 0x5011, HDA_QUIRK_NO_MSI },
{ PCI_VENDOR_CREATIVE, 0x0010, HDA_QUIRK_NO_MSI },
{ PCI_VENDOR_CREATIVE, 0x0012, HDA_QUIRK_NO_MSI },
{ PCI_VENDOR_VMWARE, PCI_ALL_DEVICES, HDA_QUIRK_NO_CORBRP_RESET_ACK },
@ -1060,7 +1063,10 @@ hda_hw_init(hda_controller* controller)
goto no_irq;
// TCSEL is reset to TC0 (clear 0-2 bits)
update_pci_register(controller, PCI_HDA_TCSEL, PCI_HDA_TCSEL_MASK, 0, 1);
if ((quirks & HDA_QUIRK_NOTCSEL) == 0) {
update_pci_register(controller, PCI_HDA_TCSEL, PCI_HDA_TCSEL_MASK, 0,
1);
}
controller->dma_snooping = false;