forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/x86/pci/fixup.c
....@@ -7,6 +7,7 @@
77 #include <linux/dmi.h>
88 #include <linux/pci.h>
99 #include <linux/vgaarb.h>
10
+#include <asm/amd_nb.h>
1011 #include <asm/hpet.h>
1112 #include <asm/pci_x86.h>
1213
....@@ -557,12 +558,12 @@
557558 * Device [8086:2fc0]
558559 * Erratum HSE43
559560 * CONFIG_TDP_NOMINAL CSR Implemented at Incorrect Offset
560
- * http://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v3-spec-update.html
561
+ * https://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v3-spec-update.html
561562 *
562563 * Devices [8086:6f60,6fa0,6fc0]
563564 * Erratum BDF2
564565 * PCI BARs in the Home Agent Will Return Non-Zero Values During Enumeration
565
- * http://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v4-spec-update.html
566
+ * https://www.intel.com/content/www/us/en/processors/xeon/xeon-e5-v4-spec-update.html
566567 */
567568 static void pci_invalid_bar(struct pci_dev *dev)
568569 {
....@@ -587,7 +588,7 @@
587588 static void pci_fixup_amd_ehci_pme(struct pci_dev *dev)
588589 {
589590 dev_info(&dev->dev, "PME# does not work under D3, disabling it\n");
590
- dev->pme_support &= ~((PCI_PM_CAP_PME_D3 | PCI_PM_CAP_PME_D3cold)
591
+ dev->pme_support &= ~((PCI_PM_CAP_PME_D3hot | PCI_PM_CAP_PME_D3cold)
591592 >> PCI_PM_CAP_PME_SHIFT);
592593 }
593594 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x7808, pci_fixup_amd_ehci_pme);
....@@ -824,3 +825,23 @@
824825 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7910, rs690_fix_64bit_dma);
825826
826827 #endif
828
+
829
+#ifdef CONFIG_AMD_NB
830
+
831
+#define AMD_15B8_RCC_DEV2_EPF0_STRAP2 0x10136008
832
+#define AMD_15B8_RCC_DEV2_EPF0_STRAP2_NO_SOFT_RESET_DEV2_F0_MASK 0x00000080L
833
+
834
+static void quirk_clear_strap_no_soft_reset_dev2_f0(struct pci_dev *dev)
835
+{
836
+ u32 data;
837
+
838
+ if (!amd_smn_read(0, AMD_15B8_RCC_DEV2_EPF0_STRAP2, &data)) {
839
+ data &= ~AMD_15B8_RCC_DEV2_EPF0_STRAP2_NO_SOFT_RESET_DEV2_F0_MASK;
840
+ if (amd_smn_write(0, AMD_15B8_RCC_DEV2_EPF0_STRAP2, data))
841
+ pci_err(dev, "Failed to write data 0x%x\n", data);
842
+ } else {
843
+ pci_err(dev, "Failed to read data\n");
844
+ }
845
+}
846
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x15b8, quirk_clear_strap_no_soft_reset_dev2_f0);
847
+#endif