hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
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
....@@ -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