diff options
Diffstat (limited to 'drivers/usb/host/isp1760-hcd.c')
-rw-r--r-- | drivers/usb/host/isp1760-hcd.c | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c index c858f2adb929..d22a84f86a33 100644 --- a/drivers/usb/host/isp1760-hcd.c +++ b/drivers/usb/host/isp1760-hcd.c | |||
@@ -126,9 +126,8 @@ static void isp1760_writel(const unsigned int val, __u32 __iomem *regs) | |||
126 | * doesn't quite work because some people have to enforce 32-bit access | 126 | * doesn't quite work because some people have to enforce 32-bit access |
127 | */ | 127 | */ |
128 | static void priv_read_copy(struct isp1760_hcd *priv, u32 *src, | 128 | static void priv_read_copy(struct isp1760_hcd *priv, u32 *src, |
129 | __u32 __iomem *dst, u32 offset, u32 len) | 129 | __u32 __iomem *dst, u32 len) |
130 | { | 130 | { |
131 | struct usb_hcd *hcd = priv_to_hcd(priv); | ||
132 | u32 val; | 131 | u32 val; |
133 | u8 *buff8; | 132 | u8 *buff8; |
134 | 133 | ||
@@ -136,11 +135,6 @@ static void priv_read_copy(struct isp1760_hcd *priv, u32 *src, | |||
136 | printk(KERN_ERR "ERROR: buffer: %p len: %d\n", src, len); | 135 | printk(KERN_ERR "ERROR: buffer: %p len: %d\n", src, len); |
137 | return; | 136 | return; |
138 | } | 137 | } |
139 | isp1760_writel(offset, hcd->regs + HC_MEMORY_REG); | ||
140 | /* XXX | ||
141 | * 90nsec delay, the spec says something how this could be avoided. | ||
142 | */ | ||
143 | mdelay(1); | ||
144 | 138 | ||
145 | while (len >= 4) { | 139 | while (len >= 4) { |
146 | *src = __raw_readl(dst); | 140 | *src = __raw_readl(dst); |
@@ -987,8 +981,20 @@ static void do_atl_int(struct usb_hcd *usb_hcd) | |||
987 | printk(KERN_ERR "qh is 0\n"); | 981 | printk(KERN_ERR "qh is 0\n"); |
988 | continue; | 982 | continue; |
989 | } | 983 | } |
990 | priv_read_copy(priv, (u32 *)&ptd, usb_hcd->regs + atl_regs, | 984 | isp1760_writel(atl_regs + ISP_BANK(0), usb_hcd->regs + |
991 | atl_regs, sizeof(ptd)); | 985 | HC_MEMORY_REG); |
986 | isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs + | ||
987 | HC_MEMORY_REG); | ||
988 | /* | ||
989 | * write bank1 address twice to ensure the 90ns delay (time | ||
990 | * between BANK0 write and the priv_read_copy() call is at | ||
991 | * least 3*t_WHWL + 2*t_w11 = 3*25ns + 2*17ns = 92ns) | ||
992 | */ | ||
993 | isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs + | ||
994 | HC_MEMORY_REG); | ||
995 | |||
996 | priv_read_copy(priv, (u32 *)&ptd, usb_hcd->regs + atl_regs + | ||
997 | ISP_BANK(0), sizeof(ptd)); | ||
992 | 998 | ||
993 | dw1 = le32_to_cpu(ptd.dw1); | 999 | dw1 = le32_to_cpu(ptd.dw1); |
994 | dw2 = le32_to_cpu(ptd.dw2); | 1000 | dw2 = le32_to_cpu(ptd.dw2); |
@@ -1091,7 +1097,7 @@ static void do_atl_int(struct usb_hcd *usb_hcd) | |||
1091 | case IN_PID: | 1097 | case IN_PID: |
1092 | priv_read_copy(priv, | 1098 | priv_read_copy(priv, |
1093 | priv->atl_ints[queue_entry].data_buffer, | 1099 | priv->atl_ints[queue_entry].data_buffer, |
1094 | usb_hcd->regs + payload, payload, | 1100 | usb_hcd->regs + payload + ISP_BANK(1), |
1095 | length); | 1101 | length); |
1096 | 1102 | ||
1097 | case OUT_PID: | 1103 | case OUT_PID: |
@@ -1122,11 +1128,11 @@ static void do_atl_int(struct usb_hcd *usb_hcd) | |||
1122 | } else if (usb_pipebulk(urb->pipe) && (length < qtd->length)) { | 1128 | } else if (usb_pipebulk(urb->pipe) && (length < qtd->length)) { |
1123 | /* short BULK received */ | 1129 | /* short BULK received */ |
1124 | 1130 | ||
1125 | printk(KERN_ERR "short bulk, %d instead %zu\n", length, | ||
1126 | qtd->length); | ||
1127 | if (urb->transfer_flags & URB_SHORT_NOT_OK) { | 1131 | if (urb->transfer_flags & URB_SHORT_NOT_OK) { |
1128 | urb->status = -EREMOTEIO; | 1132 | urb->status = -EREMOTEIO; |
1129 | printk(KERN_ERR "not okey\n"); | 1133 | isp1760_dbg(priv, "short bulk, %d instead %zu " |
1134 | "with URB_SHORT_NOT_OK flag.\n", | ||
1135 | length, qtd->length); | ||
1130 | } | 1136 | } |
1131 | 1137 | ||
1132 | if (urb->status == -EINPROGRESS) | 1138 | if (urb->status == -EINPROGRESS) |
@@ -1206,8 +1212,20 @@ static void do_intl_int(struct usb_hcd *usb_hcd) | |||
1206 | continue; | 1212 | continue; |
1207 | } | 1213 | } |
1208 | 1214 | ||
1209 | priv_read_copy(priv, (u32 *)&ptd, usb_hcd->regs + int_regs, | 1215 | isp1760_writel(int_regs + ISP_BANK(0), usb_hcd->regs + |
1210 | int_regs, sizeof(ptd)); | 1216 | HC_MEMORY_REG); |
1217 | isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs + | ||
1218 | HC_MEMORY_REG); | ||
1219 | /* | ||
1220 | * write bank1 address twice to ensure the 90ns delay (time | ||
1221 | * between BANK0 write and the priv_read_copy() call is at | ||
1222 | * least 3*t_WHWL + 2*t_w11 = 3*25ns + 2*17ns = 92ns) | ||
1223 | */ | ||
1224 | isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs + | ||
1225 | HC_MEMORY_REG); | ||
1226 | |||
1227 | priv_read_copy(priv, (u32 *)&ptd, usb_hcd->regs + int_regs + | ||
1228 | ISP_BANK(0), sizeof(ptd)); | ||
1211 | dw1 = le32_to_cpu(ptd.dw1); | 1229 | dw1 = le32_to_cpu(ptd.dw1); |
1212 | dw3 = le32_to_cpu(ptd.dw3); | 1230 | dw3 = le32_to_cpu(ptd.dw3); |
1213 | check_int_err_status(le32_to_cpu(ptd.dw4)); | 1231 | check_int_err_status(le32_to_cpu(ptd.dw4)); |
@@ -1242,7 +1260,7 @@ static void do_intl_int(struct usb_hcd *usb_hcd) | |||
1242 | case IN_PID: | 1260 | case IN_PID: |
1243 | priv_read_copy(priv, | 1261 | priv_read_copy(priv, |
1244 | priv->int_ints[queue_entry].data_buffer, | 1262 | priv->int_ints[queue_entry].data_buffer, |
1245 | usb_hcd->regs + payload , payload, | 1263 | usb_hcd->regs + payload + ISP_BANK(1), |
1246 | length); | 1264 | length); |
1247 | case OUT_PID: | 1265 | case OUT_PID: |
1248 | 1266 | ||
@@ -1615,8 +1633,7 @@ static int isp1760_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
1615 | return -EPIPE; | 1633 | return -EPIPE; |
1616 | } | 1634 | } |
1617 | 1635 | ||
1618 | isp1760_prepare_enqueue(priv, urb, &qtd_list, mem_flags, pe); | 1636 | return isp1760_prepare_enqueue(priv, urb, &qtd_list, mem_flags, pe); |
1619 | return 0; | ||
1620 | } | 1637 | } |
1621 | 1638 | ||
1622 | static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, | 1639 | static int isp1760_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, |