diff options
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 145 |
1 files changed, 81 insertions, 64 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 16945c2ba2ca..1e6eda25c0d8 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -61,7 +61,8 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_p | |||
61 | 61 | ||
62 | This appears to be BIOS not version dependent. So presumably there is a | 62 | This appears to be BIOS not version dependent. So presumably there is a |
63 | chipset level fix */ | 63 | chipset level fix */ |
64 | int isa_dma_bridge_buggy; /* Exported */ | 64 | int isa_dma_bridge_buggy; |
65 | EXPORT_SYMBOL(isa_dma_bridge_buggy); | ||
65 | 66 | ||
66 | static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev) | 67 | static void __devinit quirk_isa_dma_hangs(struct pci_dev *dev) |
67 | { | 68 | { |
@@ -83,6 +84,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_2, quirk_isa_d | |||
83 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs ); | 84 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_CBUS_3, quirk_isa_dma_hangs ); |
84 | 85 | ||
85 | int pci_pci_problems; | 86 | int pci_pci_problems; |
87 | EXPORT_SYMBOL(pci_pci_problems); | ||
86 | 88 | ||
87 | /* | 89 | /* |
88 | * Chipsets where PCI->PCI transfers vanish or hang | 90 | * Chipsets where PCI->PCI transfers vanish or hang |
@@ -94,6 +96,8 @@ static void __devinit quirk_nopcipci(struct pci_dev *dev) | |||
94 | pci_pci_problems |= PCIPCI_FAIL; | 96 | pci_pci_problems |= PCIPCI_FAIL; |
95 | } | 97 | } |
96 | } | 98 | } |
99 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, quirk_nopcipci ); | ||
100 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496, quirk_nopcipci ); | ||
97 | 101 | ||
98 | static void __devinit quirk_nopciamd(struct pci_dev *dev) | 102 | static void __devinit quirk_nopciamd(struct pci_dev *dev) |
99 | { | 103 | { |
@@ -105,9 +109,6 @@ static void __devinit quirk_nopciamd(struct pci_dev *dev) | |||
105 | pci_pci_problems |= PCIAGP_FAIL; | 109 | pci_pci_problems |= PCIAGP_FAIL; |
106 | } | 110 | } |
107 | } | 111 | } |
108 | |||
109 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, quirk_nopcipci ); | ||
110 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496, quirk_nopcipci ); | ||
111 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8151_0, quirk_nopciamd ); | 112 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8151_0, quirk_nopciamd ); |
112 | 113 | ||
113 | /* | 114 | /* |
@@ -661,9 +662,11 @@ static void quirk_via_bridge(struct pci_dev *dev) | |||
661 | /* See what bridge we have and find the device ranges */ | 662 | /* See what bridge we have and find the device ranges */ |
662 | switch (dev->device) { | 663 | switch (dev->device) { |
663 | case PCI_DEVICE_ID_VIA_82C686: | 664 | case PCI_DEVICE_ID_VIA_82C686: |
664 | /* 82C686 is special */ | 665 | /* The VT82C686 is special, it attaches to PCI and can have |
665 | via_vlink_dev_lo = 7; | 666 | any device number. All its subdevices are functions of |
666 | via_vlink_dev_hi = 7; | 667 | that single device. */ |
668 | via_vlink_dev_lo = PCI_SLOT(dev->devfn); | ||
669 | via_vlink_dev_hi = PCI_SLOT(dev->devfn); | ||
667 | break; | 670 | break; |
668 | case PCI_DEVICE_ID_VIA_8237: | 671 | case PCI_DEVICE_ID_VIA_8237: |
669 | case PCI_DEVICE_ID_VIA_8237A: | 672 | case PCI_DEVICE_ID_VIA_8237A: |
@@ -868,7 +871,7 @@ static void __devinit quirk_sb600_sata(struct pci_dev *pdev) | |||
868 | pci_write_config_byte(pdev, 0xa, 6); | 871 | pci_write_config_byte(pdev, 0xa, 6); |
869 | pci_write_config_byte(pdev, 0x40, tmp); | 872 | pci_write_config_byte(pdev, 0x40, tmp); |
870 | 873 | ||
871 | pdev->class = 0x010601; | 874 | pdev->class = PCI_CLASS_STORAGE_SATA_AHCI; |
872 | } | 875 | } |
873 | } | 876 | } |
874 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata); | 877 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata); |
@@ -974,52 +977,51 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) | |||
974 | case 0x1626: /* L3C notebook */ | 977 | case 0x1626: /* L3C notebook */ |
975 | asus_hides_smbus = 1; | 978 | asus_hides_smbus = 1; |
976 | } | 979 | } |
977 | if (dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) | 980 | else if (dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) |
978 | switch(dev->subsystem_device) { | 981 | switch(dev->subsystem_device) { |
979 | case 0x80b1: /* P4GE-V */ | 982 | case 0x80b1: /* P4GE-V */ |
980 | case 0x80b2: /* P4PE */ | 983 | case 0x80b2: /* P4PE */ |
981 | case 0x8093: /* P4B533-V */ | 984 | case 0x8093: /* P4B533-V */ |
982 | asus_hides_smbus = 1; | 985 | asus_hides_smbus = 1; |
983 | } | 986 | } |
984 | if (dev->device == PCI_DEVICE_ID_INTEL_82850_HB) | 987 | else if (dev->device == PCI_DEVICE_ID_INTEL_82850_HB) |
985 | switch(dev->subsystem_device) { | 988 | switch(dev->subsystem_device) { |
986 | case 0x8030: /* P4T533 */ | 989 | case 0x8030: /* P4T533 */ |
987 | asus_hides_smbus = 1; | 990 | asus_hides_smbus = 1; |
988 | } | 991 | } |
989 | if (dev->device == PCI_DEVICE_ID_INTEL_7205_0) | 992 | else if (dev->device == PCI_DEVICE_ID_INTEL_7205_0) |
990 | switch (dev->subsystem_device) { | 993 | switch (dev->subsystem_device) { |
991 | case 0x8070: /* P4G8X Deluxe */ | 994 | case 0x8070: /* P4G8X Deluxe */ |
992 | asus_hides_smbus = 1; | 995 | asus_hides_smbus = 1; |
993 | } | 996 | } |
994 | if (dev->device == PCI_DEVICE_ID_INTEL_E7501_MCH) | 997 | else if (dev->device == PCI_DEVICE_ID_INTEL_E7501_MCH) |
995 | switch (dev->subsystem_device) { | 998 | switch (dev->subsystem_device) { |
996 | case 0x80c9: /* PU-DLS */ | 999 | case 0x80c9: /* PU-DLS */ |
997 | asus_hides_smbus = 1; | 1000 | asus_hides_smbus = 1; |
998 | } | 1001 | } |
999 | if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) | 1002 | else if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) |
1000 | switch (dev->subsystem_device) { | 1003 | switch (dev->subsystem_device) { |
1001 | case 0x1751: /* M2N notebook */ | 1004 | case 0x1751: /* M2N notebook */ |
1002 | case 0x1821: /* M5N notebook */ | 1005 | case 0x1821: /* M5N notebook */ |
1003 | asus_hides_smbus = 1; | 1006 | asus_hides_smbus = 1; |
1004 | } | 1007 | } |
1005 | if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) | 1008 | else if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) |
1006 | switch (dev->subsystem_device) { | 1009 | switch (dev->subsystem_device) { |
1007 | case 0x184b: /* W1N notebook */ | 1010 | case 0x184b: /* W1N notebook */ |
1008 | case 0x186a: /* M6Ne notebook */ | 1011 | case 0x186a: /* M6Ne notebook */ |
1009 | asus_hides_smbus = 1; | 1012 | asus_hides_smbus = 1; |
1010 | } | 1013 | } |
1011 | if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) | 1014 | else if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) |
1012 | switch (dev->subsystem_device) { | 1015 | switch (dev->subsystem_device) { |
1013 | case 0x80f2: /* P4P800-X */ | 1016 | case 0x80f2: /* P4P800-X */ |
1014 | asus_hides_smbus = 1; | 1017 | asus_hides_smbus = 1; |
1015 | } | 1018 | } |
1016 | if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) { | 1019 | else if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) |
1017 | switch (dev->subsystem_device) { | 1020 | switch (dev->subsystem_device) { |
1018 | case 0x1882: /* M6V notebook */ | 1021 | case 0x1882: /* M6V notebook */ |
1019 | case 0x1977: /* A6VA notebook */ | 1022 | case 0x1977: /* A6VA notebook */ |
1020 | asus_hides_smbus = 1; | 1023 | asus_hides_smbus = 1; |
1021 | } | 1024 | } |
1022 | } | ||
1023 | } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_HP)) { | 1025 | } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_HP)) { |
1024 | if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) | 1026 | if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) |
1025 | switch(dev->subsystem_device) { | 1027 | switch(dev->subsystem_device) { |
@@ -1027,25 +1029,24 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) | |||
1027 | case 0x0890: /* HP Compaq nc6000 */ | 1029 | case 0x0890: /* HP Compaq nc6000 */ |
1028 | asus_hides_smbus = 1; | 1030 | asus_hides_smbus = 1; |
1029 | } | 1031 | } |
1030 | if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) | 1032 | else if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) |
1031 | switch (dev->subsystem_device) { | 1033 | switch (dev->subsystem_device) { |
1032 | case 0x12bc: /* HP D330L */ | 1034 | case 0x12bc: /* HP D330L */ |
1033 | case 0x12bd: /* HP D530 */ | 1035 | case 0x12bd: /* HP D530 */ |
1034 | asus_hides_smbus = 1; | 1036 | asus_hides_smbus = 1; |
1035 | } | 1037 | } |
1036 | if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) { | 1038 | else if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) |
1037 | switch (dev->subsystem_device) { | 1039 | switch (dev->subsystem_device) { |
1038 | case 0x099c: /* HP Compaq nx6110 */ | 1040 | case 0x099c: /* HP Compaq nx6110 */ |
1039 | asus_hides_smbus = 1; | 1041 | asus_hides_smbus = 1; |
1040 | } | 1042 | } |
1041 | } | ||
1042 | } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_TOSHIBA)) { | 1043 | } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_TOSHIBA)) { |
1043 | if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) | 1044 | if (dev->device == PCI_DEVICE_ID_INTEL_82855GM_HB) |
1044 | switch(dev->subsystem_device) { | 1045 | switch(dev->subsystem_device) { |
1045 | case 0x0001: /* Toshiba Satellite A40 */ | 1046 | case 0x0001: /* Toshiba Satellite A40 */ |
1046 | asus_hides_smbus = 1; | 1047 | asus_hides_smbus = 1; |
1047 | } | 1048 | } |
1048 | if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) | 1049 | else if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB) |
1049 | switch(dev->subsystem_device) { | 1050 | switch(dev->subsystem_device) { |
1050 | case 0x0001: /* Toshiba Tecra M2 */ | 1051 | case 0x0001: /* Toshiba Tecra M2 */ |
1051 | asus_hides_smbus = 1; | 1052 | asus_hides_smbus = 1; |
@@ -1134,6 +1135,14 @@ static void quirk_sis_96x_smbus(struct pci_dev *dev) | |||
1134 | pci_write_config_byte(dev, 0x77, val & ~0x10); | 1135 | pci_write_config_byte(dev, 0x77, val & ~0x10); |
1135 | } | 1136 | } |
1136 | } | 1137 | } |
1138 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_961, quirk_sis_96x_smbus ); | ||
1139 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_smbus ); | ||
1140 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); | ||
1141 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); | ||
1142 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_961, quirk_sis_96x_smbus ); | ||
1143 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_smbus ); | ||
1144 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); | ||
1145 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); | ||
1137 | 1146 | ||
1138 | /* | 1147 | /* |
1139 | * ... This is further complicated by the fact that some SiS96x south | 1148 | * ... This is further complicated by the fact that some SiS96x south |
@@ -1143,8 +1152,6 @@ static void quirk_sis_96x_smbus(struct pci_dev *dev) | |||
1143 | * | 1152 | * |
1144 | * We can also enable the sis96x bit in the discovery register.. | 1153 | * We can also enable the sis96x bit in the discovery register.. |
1145 | */ | 1154 | */ |
1146 | static int __devinitdata sis_96x_compatible = 0; | ||
1147 | |||
1148 | #define SIS_DETECT_REGISTER 0x40 | 1155 | #define SIS_DETECT_REGISTER 0x40 |
1149 | 1156 | ||
1150 | static void quirk_sis_503(struct pci_dev *dev) | 1157 | static void quirk_sis_503(struct pci_dev *dev) |
@@ -1160,9 +1167,6 @@ static void quirk_sis_503(struct pci_dev *dev) | |||
1160 | return; | 1167 | return; |
1161 | } | 1168 | } |
1162 | 1169 | ||
1163 | /* Make people aware that we changed the config.. */ | ||
1164 | printk(KERN_WARNING "Uncovering SIS%x that hid as a SIS503 (compatible=%d)\n", devid, sis_96x_compatible); | ||
1165 | |||
1166 | /* | 1170 | /* |
1167 | * Ok, it now shows up as a 96x.. run the 96x quirk by | 1171 | * Ok, it now shows up as a 96x.. run the 96x quirk by |
1168 | * hand in case it has already been processed. | 1172 | * hand in case it has already been processed. |
@@ -1171,20 +1175,10 @@ static void quirk_sis_503(struct pci_dev *dev) | |||
1171 | dev->device = devid; | 1175 | dev->device = devid; |
1172 | quirk_sis_96x_smbus(dev); | 1176 | quirk_sis_96x_smbus(dev); |
1173 | } | 1177 | } |
1174 | |||
1175 | static void __init quirk_sis_96x_compatible(struct pci_dev *dev) | ||
1176 | { | ||
1177 | sis_96x_compatible = 1; | ||
1178 | } | ||
1179 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_645, quirk_sis_96x_compatible ); | ||
1180 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_646, quirk_sis_96x_compatible ); | ||
1181 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_648, quirk_sis_96x_compatible ); | ||
1182 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650, quirk_sis_96x_compatible ); | ||
1183 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_651, quirk_sis_96x_compatible ); | ||
1184 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_735, quirk_sis_96x_compatible ); | ||
1185 | |||
1186 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, quirk_sis_503 ); | 1178 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, quirk_sis_503 ); |
1187 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, quirk_sis_503 ); | 1179 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, quirk_sis_503 ); |
1180 | |||
1181 | |||
1188 | /* | 1182 | /* |
1189 | * On ASUS A8V and A8V Deluxe boards, the onboard AC97 audio controller | 1183 | * On ASUS A8V and A8V Deluxe boards, the onboard AC97 audio controller |
1190 | * and MC97 modem controller are disabled when a second PCI soundcard is | 1184 | * and MC97 modem controller are disabled when a second PCI soundcard is |
@@ -1215,21 +1209,8 @@ static void asus_hides_ac97_lpc(struct pci_dev *dev) | |||
1215 | } | 1209 | } |
1216 | } | 1210 | } |
1217 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, asus_hides_ac97_lpc ); | 1211 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, asus_hides_ac97_lpc ); |
1218 | |||
1219 | |||
1220 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_961, quirk_sis_96x_smbus ); | ||
1221 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_smbus ); | ||
1222 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); | ||
1223 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); | ||
1224 | |||
1225 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, asus_hides_ac97_lpc ); | 1212 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, asus_hides_ac97_lpc ); |
1226 | 1213 | ||
1227 | |||
1228 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_961, quirk_sis_96x_smbus ); | ||
1229 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_smbus ); | ||
1230 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus ); | ||
1231 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus ); | ||
1232 | |||
1233 | #if defined(CONFIG_ATA) || defined(CONFIG_ATA_MODULE) | 1214 | #if defined(CONFIG_ATA) || defined(CONFIG_ATA_MODULE) |
1234 | 1215 | ||
1235 | /* | 1216 | /* |
@@ -1260,8 +1241,8 @@ static void quirk_jmicron_dualfn(struct pci_dev *pdev) | |||
1260 | pci_read_config_dword(pdev, 0x40, &conf); | 1241 | pci_read_config_dword(pdev, 0x40, &conf); |
1261 | /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ | 1242 | /* Enable dual function mode, AHCI on fn 0, IDE fn1 */ |
1262 | /* Set the class codes correctly and then direct IDE 0 */ | 1243 | /* Set the class codes correctly and then direct IDE 0 */ |
1263 | conf &= ~0x000F0200; /* Clear bit 9 and 16-19 */ | 1244 | conf &= ~0x000FF200; /* Clear bit 9 and 12-19 */ |
1264 | conf |= 0x00C20002; /* Set bit 1, 17, 22, 23 */ | 1245 | conf |= 0x00C2A102; /* Set 1, 8, 13, 15, 17, 22, 23 */ |
1265 | pci_write_config_dword(pdev, 0x40, conf); | 1246 | pci_write_config_dword(pdev, 0x40, conf); |
1266 | 1247 | ||
1267 | /* Reconfigure so that the PCI scanner discovers the | 1248 | /* Reconfigure so that the PCI scanner discovers the |
@@ -1274,7 +1255,6 @@ static void quirk_jmicron_dualfn(struct pci_dev *pdev) | |||
1274 | break; | 1255 | break; |
1275 | } | 1256 | } |
1276 | } | 1257 | } |
1277 | |||
1278 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn); | 1258 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn); |
1279 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn); | 1259 | DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, quirk_jmicron_dualfn); |
1280 | 1260 | ||
@@ -1418,6 +1398,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_intel_ide_co | |||
1418 | 1398 | ||
1419 | 1399 | ||
1420 | int pcie_mch_quirk; | 1400 | int pcie_mch_quirk; |
1401 | EXPORT_SYMBOL(pcie_mch_quirk); | ||
1421 | 1402 | ||
1422 | static void __devinit quirk_pcie_mch(struct pci_dev *pdev) | 1403 | static void __devinit quirk_pcie_mch(struct pci_dev *pdev) |
1423 | { | 1404 | { |
@@ -1479,6 +1460,24 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm); | |||
1479 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); | 1460 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); |
1480 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); | 1461 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); |
1481 | 1462 | ||
1463 | /* | ||
1464 | * Toshiba TC86C001 IDE controller reports the standard 8-byte BAR0 size | ||
1465 | * but the PIO transfers won't work if BAR0 falls at the odd 8 bytes. | ||
1466 | * Re-allocate the region if needed... | ||
1467 | */ | ||
1468 | static void __init quirk_tc86c001_ide(struct pci_dev *dev) | ||
1469 | { | ||
1470 | struct resource *r = &dev->resource[0]; | ||
1471 | |||
1472 | if (r->start & 0x8) { | ||
1473 | r->start = 0; | ||
1474 | r->end = 0xf; | ||
1475 | } | ||
1476 | } | ||
1477 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TOSHIBA_2, | ||
1478 | PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE, | ||
1479 | quirk_tc86c001_ide); | ||
1480 | |||
1482 | static void __devinit quirk_netmos(struct pci_dev *dev) | 1481 | static void __devinit quirk_netmos(struct pci_dev *dev) |
1483 | { | 1482 | { |
1484 | unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; | 1483 | unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4; |
@@ -1644,6 +1643,7 @@ void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | |||
1644 | } | 1643 | } |
1645 | pci_do_fixups(dev, start, end); | 1644 | pci_do_fixups(dev, start, end); |
1646 | } | 1645 | } |
1646 | EXPORT_SYMBOL(pci_fixup_device); | ||
1647 | 1647 | ||
1648 | /* Enable 1k I/O space granularity on the Intel P64H2 */ | 1648 | /* Enable 1k I/O space granularity on the Intel P64H2 */ |
1649 | static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev) | 1649 | static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev) |
@@ -1671,6 +1671,31 @@ static void __devinit quirk_p64h2_1k_io(struct pci_dev *dev) | |||
1671 | } | 1671 | } |
1672 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io); | 1672 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io); |
1673 | 1673 | ||
1674 | /* Fix the IOBL_ADR for 1k I/O space granularity on the Intel P64H2 | ||
1675 | * The IOBL_ADR gets re-written to 4k boundaries in pci_setup_bridge() | ||
1676 | * in drivers/pci/setup-bus.c | ||
1677 | */ | ||
1678 | static void __devinit quirk_p64h2_1k_io_fix_iobl(struct pci_dev *dev) | ||
1679 | { | ||
1680 | u16 en1k, iobl_adr, iobl_adr_1k; | ||
1681 | struct resource *res = dev->resource + PCI_BRIDGE_RESOURCES; | ||
1682 | |||
1683 | pci_read_config_word(dev, 0x40, &en1k); | ||
1684 | |||
1685 | if (en1k & 0x200) { | ||
1686 | pci_read_config_word(dev, PCI_IO_BASE, &iobl_adr); | ||
1687 | |||
1688 | iobl_adr_1k = iobl_adr | (res->start >> 8) | (res->end & 0xfc00); | ||
1689 | |||
1690 | if (iobl_adr != iobl_adr_1k) { | ||
1691 | printk(KERN_INFO "PCI: Fixing P64H2 IOBL_ADR from 0x%x to 0x%x for 1 KB Granularity\n", | ||
1692 | iobl_adr,iobl_adr_1k); | ||
1693 | pci_write_config_word(dev, PCI_IO_BASE, iobl_adr_1k); | ||
1694 | } | ||
1695 | } | ||
1696 | } | ||
1697 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1460, quirk_p64h2_1k_io_fix_iobl); | ||
1698 | |||
1674 | /* Under some circumstances, AER is not linked with extended capabilities. | 1699 | /* Under some circumstances, AER is not linked with extended capabilities. |
1675 | * Force it to be linked by setting the corresponding control bit in the | 1700 | * Force it to be linked by setting the corresponding control bit in the |
1676 | * config space. | 1701 | * config space. |
@@ -1693,9 +1718,6 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, | |||
1693 | quirk_nvidia_ck804_pcie_aer_ext_cap); | 1718 | quirk_nvidia_ck804_pcie_aer_ext_cap); |
1694 | 1719 | ||
1695 | #ifdef CONFIG_PCI_MSI | 1720 | #ifdef CONFIG_PCI_MSI |
1696 | /* To disable MSI globally */ | ||
1697 | int pci_msi_quirk; | ||
1698 | |||
1699 | /* The Serverworks PCI-X chipset does not support MSI. We cannot easily rely | 1721 | /* The Serverworks PCI-X chipset does not support MSI. We cannot easily rely |
1700 | * on setting PCI_BUS_FLAGS_NO_MSI in its bus flags because there are actually | 1722 | * on setting PCI_BUS_FLAGS_NO_MSI in its bus flags because there are actually |
1701 | * some other busses controlled by the chipset even if Linux is not aware of it. | 1723 | * some other busses controlled by the chipset even if Linux is not aware of it. |
@@ -1704,8 +1726,8 @@ int pci_msi_quirk; | |||
1704 | */ | 1726 | */ |
1705 | static void __init quirk_svw_msi(struct pci_dev *dev) | 1727 | static void __init quirk_svw_msi(struct pci_dev *dev) |
1706 | { | 1728 | { |
1707 | pci_msi_quirk = 1; | 1729 | pci_no_msi(); |
1708 | printk(KERN_WARNING "PCI: MSI quirk detected. pci_msi_quirk set.\n"); | 1730 | printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n"); |
1709 | } | 1731 | } |
1710 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_svw_msi); | 1732 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_svw_msi); |
1711 | 1733 | ||
@@ -1786,8 +1808,3 @@ static void __devinit quirk_nvidia_ck804_msi_ht_cap(struct pci_dev *dev) | |||
1786 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, | 1808 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE, |
1787 | quirk_nvidia_ck804_msi_ht_cap); | 1809 | quirk_nvidia_ck804_msi_ht_cap); |
1788 | #endif /* CONFIG_PCI_MSI */ | 1810 | #endif /* CONFIG_PCI_MSI */ |
1789 | |||
1790 | EXPORT_SYMBOL(pcie_mch_quirk); | ||
1791 | #ifdef CONFIG_HOTPLUG | ||
1792 | EXPORT_SYMBOL(pci_fixup_device); | ||
1793 | #endif | ||