From 422212b06a20679ae7564594879cf6d7aa241ac0 Mon Sep 17 00:00:00 2001 From: Chao Li Date: Sat, 7 Dec 2024 05:51:18 +0800 Subject: [PATCH] system/hwquirks: Optimization Loongson 7A2000 EHCI quirk (#473) Currentilly, it only compares the root bus DID is 0x7A00 which sometimes fails, a new logic was added to compare the 7A2000 EHCI DID to fix it. Signed-off-by: Chao Li --- system/hwquirks.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/system/hwquirks.c b/system/hwquirks.c index f3781ec..48545ee 100644 --- a/system/hwquirks.c +++ b/system/hwquirks.c @@ -259,9 +259,11 @@ void quirks_init(void) // ----------------------------------------------------------- // -- Loongson 7A1000 and 7A2000 chipset USB 2.0 workaround -- // ----------------------------------------------------------- - if (quirk.root_vid == PCI_VID_LOONGSON && quirk.root_did == 0x7a00) { - quirk.id = QUIRK_LOONGSON7A00_EHCI_WORKARD; - quirk.type |= QUIRK_TYPE_USB; - quirk.process = loongson_7a00_ehci_workaround; + if (quirk.root_vid == PCI_VID_LOONGSON) { + if (pci_config_read16(0, 4, 1, PCI_DID_REG) == 0x7a14) { + quirk.id = QUIRK_LOONGSON7A00_EHCI_WORKARD; + quirk.type |= QUIRK_TYPE_USB; + quirk.process = loongson_7a00_ehci_workaround; + } } }