aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-pci.c')
-rw-r--r--drivers/usb/host/ehci-pci.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 1ec8060e8cc4..76179c39c0e3 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -44,6 +44,35 @@ static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)
44 return 0; 44 return 0;
45} 45}
46 46
47static int ehci_quirk_amd_SB800(struct ehci_hcd *ehci)
48{
49 struct pci_dev *amd_smbus_dev;
50 u8 rev = 0;
51
52 amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI, 0x4385, NULL);
53 if (!amd_smbus_dev)
54 return 0;
55
56 pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev);
57 if (rev < 0x40) {
58 pci_dev_put(amd_smbus_dev);
59 amd_smbus_dev = NULL;
60 return 0;
61 }
62
63 if (!amd_nb_dev)
64 amd_nb_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1510, NULL);
65 if (!amd_nb_dev)
66 ehci_err(ehci, "QUIRK: unable to get AMD NB device\n");
67
68 ehci_info(ehci, "QUIRK: Enable AMD SB800 L1 fix\n");
69
70 pci_dev_put(amd_smbus_dev);
71 amd_smbus_dev = NULL;
72
73 return 1;
74}
75
47/* called during probe() after chip reset completes */ 76/* called during probe() after chip reset completes */
48static int ehci_pci_setup(struct usb_hcd *hcd) 77static int ehci_pci_setup(struct usb_hcd *hcd)
49{ 78{
@@ -102,6 +131,9 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
102 /* cache this readonly data; minimize chip reads */ 131 /* cache this readonly data; minimize chip reads */
103 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); 132 ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
104 133
134 if (ehci_quirk_amd_SB800(ehci))
135 ehci->amd_l1_fix = 1;
136
105 retval = ehci_halt(ehci); 137 retval = ehci_halt(ehci);
106 if (retval) 138 if (retval)
107 return retval; 139 return retval;
@@ -152,9 +184,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
152 } 184 }
153 break; 185 break;
154 case PCI_VENDOR_ID_AMD: 186 case PCI_VENDOR_ID_AMD:
155 /* AMD PLL quirk */
156 if (usb_amd_find_chipset_info())
157 ehci->amd_pll_fix = 1;
158 /* AMD8111 EHCI doesn't work, according to AMD errata */ 187 /* AMD8111 EHCI doesn't work, according to AMD errata */
159 if (pdev->device == 0x7463) { 188 if (pdev->device == 0x7463) {
160 ehci_info(ehci, "ignoring AMD8111 (errata)\n"); 189 ehci_info(ehci, "ignoring AMD8111 (errata)\n");
@@ -200,9 +229,6 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
200 } 229 }
201 break; 230 break;
202 case PCI_VENDOR_ID_ATI: 231 case PCI_VENDOR_ID_ATI:
203 /* AMD PLL quirk */
204 if (usb_amd_find_chipset_info())
205 ehci->amd_pll_fix = 1;
206 /* SB600 and old version of SB700 have a bug in EHCI controller, 232 /* SB600 and old version of SB700 have a bug in EHCI controller,
207 * which causes usb devices lose response in some cases. 233 * which causes usb devices lose response in some cases.
208 */ 234 */