diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index e377a065d491f54a0c3ba673a4a9892e40fe07eb..8fbf7597b9e38bf1963fc13a9f66d820b6646135 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -81,6 +81,16 @@ enum board_ids { board_ahci_mcp79 = board_ahci_mcp77, }; +static bool is_zhaoxin_cpu(void) +{ +#ifdef CONFIG_CPU_SUP_ZHAOXIN || CONFIG_CPU_SUP_CENTAUR + if (boot_cpu_data.x86_vendor == X86_VENDOR_ZHAOXIN || + boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR) + return true; +#endif /* CONFIG_CPU_SUP_ZHAOXIN || CONFIG_CPU_SUP_CENTAUR */ + return false; +} + static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); static void ahci_remove_one(struct pci_dev *dev); static void ahci_shutdown_one(struct pci_dev *dev); @@ -1892,6 +1902,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (ahci_sb600_enable_64bit(pdev)) hpriv->flags &= ~AHCI_HFLAG_32BIT_ONLY; + if (pdev->vendor == PCI_VENDOR_ID_ZHAOXIN && !is_zhaoxin_cpu()) + hpriv->flags |= AHCI_HFLAG_32BIT_ONLY; + hpriv->mmio = pcim_iomap_table(pdev)[ahci_pci_bar]; /* detect remapped nvme devices */ diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 2a83547302c63e0c33c9203f7e767ba64bfd2304..754023fe64ed5f276195f420dab9f0b1b5611432 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -297,6 +297,16 @@ static int xhci_pci_reinit(struct xhci_hcd *xhci, struct pci_dev *pdev) return 0; } +static bool is_zhaoxin_cpu(void) +{ +#ifdef CONFIG_CPU_SUP_ZHAOXIN || CONFIG_CPU_SUP_CENTAUR + if (boot_cpu_data.x86_vendor == X86_VENDOR_ZHAOXIN || + boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR) + return true; +#endif + return false; +} + static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) { struct pci_dev *pdev = to_pci_dev(dev); @@ -540,6 +550,12 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) xhci->quirks |= XHCI_TRB_OVERFETCH; } + if (pdev->vendor == PCI_VENDOR_ID_ZHAOXIN && !is_zhaoxin_cpu()) { + xhci->quirks |= XHCI_NO_64BIT_SUPPORT; + if (pdev->device == 0x9203) + xhci->quirks |= XHCI_RESET_ON_RESUME; + } + if (pdev->vendor == PCI_DEVICE_ID_CADENCE && pdev->device == PCI_DEVICE_ID_CADENCE_SSP) xhci->quirks |= XHCI_CDNS_SCTX_QUIRK;