aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-sched.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 12:54:16 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 12:54:16 -0500
commit479b46b5599b1e610630d7332e168c1f9c4ee0b4 (patch)
treec5d7e48576f5b5b6a61a2a2e5f85abaa941b85ab /drivers/usb/host/ehci-sched.c
parentce1fd3585709e833ad102167024e97217734dbfd (diff)
Revert "USB host: Move AMD PLL quirk to pci-quirks.c"
This reverts commit b7d5b439b7a40dd0a0202fe1c118615a3fcc3b25. It conflicts with commit baab93afc2844b68d57b0dcca5e1d34c5d7cf411 "USB: EHCI: ASPM quirk of ISOC on AMD Hudson" and merging the two just doesn't work properly. Cc: Andiry Xu <andiry.xu@amd.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Alex He <alex.he@amd.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-sched.c')
-rw-r--r--drivers/usb/host/ehci-sched.c73
1 files changed, 65 insertions, 8 deletions
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
index 1543c838b3d1..30fbdbe1cf1e 100644
--- a/drivers/usb/host/ehci-sched.c
+++ b/drivers/usb/host/ehci-sched.c
@@ -1587,6 +1587,63 @@ itd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd)
1587 *hw_p = cpu_to_hc32(ehci, itd->itd_dma | Q_TYPE_ITD); 1587 *hw_p = cpu_to_hc32(ehci, itd->itd_dma | Q_TYPE_ITD);
1588} 1588}
1589 1589
1590#define AB_REG_BAR_LOW 0xe0
1591#define AB_REG_BAR_HIGH 0xe1
1592#define AB_INDX(addr) ((addr) + 0x00)
1593#define AB_DATA(addr) ((addr) + 0x04)
1594#define NB_PCIE_INDX_ADDR 0xe0
1595#define NB_PCIE_INDX_DATA 0xe4
1596#define NB_PIF0_PWRDOWN_0 0x01100012
1597#define NB_PIF0_PWRDOWN_1 0x01100013
1598
1599static void ehci_quirk_amd_L1(struct ehci_hcd *ehci, int disable)
1600{
1601 u32 addr, addr_low, addr_high, val;
1602
1603 outb_p(AB_REG_BAR_LOW, 0xcd6);
1604 addr_low = inb_p(0xcd7);
1605 outb_p(AB_REG_BAR_HIGH, 0xcd6);
1606 addr_high = inb_p(0xcd7);
1607 addr = addr_high << 8 | addr_low;
1608 outl_p(0x30, AB_INDX(addr));
1609 outl_p(0x40, AB_DATA(addr));
1610 outl_p(0x34, AB_INDX(addr));
1611 val = inl_p(AB_DATA(addr));
1612
1613 if (disable) {
1614 val &= ~0x8;
1615 val |= (1 << 4) | (1 << 9);
1616 } else {
1617 val |= 0x8;
1618 val &= ~((1 << 4) | (1 << 9));
1619 }
1620 outl_p(val, AB_DATA(addr));
1621
1622 if (amd_nb_dev) {
1623 addr = NB_PIF0_PWRDOWN_0;
1624 pci_write_config_dword(amd_nb_dev, NB_PCIE_INDX_ADDR, addr);
1625 pci_read_config_dword(amd_nb_dev, NB_PCIE_INDX_DATA, &val);
1626 if (disable)
1627 val &= ~(0x3f << 7);
1628 else
1629 val |= 0x3f << 7;
1630
1631 pci_write_config_dword(amd_nb_dev, NB_PCIE_INDX_DATA, val);
1632
1633 addr = NB_PIF0_PWRDOWN_1;
1634 pci_write_config_dword(amd_nb_dev, NB_PCIE_INDX_ADDR, addr);
1635 pci_read_config_dword(amd_nb_dev, NB_PCIE_INDX_DATA, &val);
1636 if (disable)
1637 val &= ~(0x3f << 7);
1638 else
1639 val |= 0x3f << 7;
1640
1641 pci_write_config_dword(amd_nb_dev, NB_PCIE_INDX_DATA, val);
1642 }
1643
1644 return;
1645}
1646
1590/* fit urb's itds into the selected schedule slot; activate as needed */ 1647/* fit urb's itds into the selected schedule slot; activate as needed */
1591static int 1648static int
1592itd_link_urb ( 1649itd_link_urb (
@@ -1615,8 +1672,8 @@ itd_link_urb (
1615 } 1672 }
1616 1673
1617 if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) { 1674 if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
1618 if (ehci->amd_pll_fix == 1) 1675 if (ehci->amd_l1_fix == 1)
1619 usb_amd_quirk_pll_disable(); 1676 ehci_quirk_amd_L1(ehci, 1);
1620 } 1677 }
1621 1678
1622 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++; 1679 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++;
@@ -1744,8 +1801,8 @@ itd_complete (
1744 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--; 1801 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
1745 1802
1746 if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) { 1803 if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
1747 if (ehci->amd_pll_fix == 1) 1804 if (ehci->amd_l1_fix == 1)
1748 usb_amd_quirk_pll_enable(); 1805 ehci_quirk_amd_L1(ehci, 0);
1749 } 1806 }
1750 1807
1751 if (unlikely(list_is_singular(&stream->td_list))) { 1808 if (unlikely(list_is_singular(&stream->td_list))) {
@@ -2035,8 +2092,8 @@ sitd_link_urb (
2035 } 2092 }
2036 2093
2037 if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) { 2094 if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
2038 if (ehci->amd_pll_fix == 1) 2095 if (ehci->amd_l1_fix == 1)
2039 usb_amd_quirk_pll_disable(); 2096 ehci_quirk_amd_L1(ehci, 1);
2040 } 2097 }
2041 2098
2042 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++; 2099 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++;
@@ -2140,8 +2197,8 @@ sitd_complete (
2140 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--; 2197 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
2141 2198
2142 if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) { 2199 if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
2143 if (ehci->amd_pll_fix == 1) 2200 if (ehci->amd_l1_fix == 1)
2144 usb_amd_quirk_pll_enable(); 2201 ehci_quirk_amd_L1(ehci, 0);
2145 } 2202 }
2146 2203
2147 if (list_is_singular(&stream->td_list)) { 2204 if (list_is_singular(&stream->td_list)) {