Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108442
b: refs/heads/master
c: 3f02a95
h: refs/heads/master
v: v3
  • Loading branch information
Enrico Scholz authored and Greg Kroah-Hartman committed Aug 14, 2008
1 parent f3d452d commit db63cbd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a36c27dfd1003e6d6842fe77faaf868e3e6e9062
refs/heads/master: 3f02a957d5eb0eeb01207a799086f2b347077f71
44 changes: 31 additions & 13 deletions trunk/drivers/usb/host/isp1760-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,15 @@ static void isp1760_writel(const unsigned int val, __u32 __iomem *regs)
* doesn't quite work because some people have to enforce 32-bit access
*/
static void priv_read_copy(struct isp1760_hcd *priv, u32 *src,
__u32 __iomem *dst, u32 offset, u32 len)
__u32 __iomem *dst, u32 len)
{
struct usb_hcd *hcd = priv_to_hcd(priv);
u32 val;
u8 *buff8;

if (!src) {
printk(KERN_ERR "ERROR: buffer: %p len: %d\n", src, len);
return;
}
isp1760_writel(offset, hcd->regs + HC_MEMORY_REG);
/* XXX
* 90nsec delay, the spec says something how this could be avoided.
*/
mdelay(1);

while (len >= 4) {
*src = __raw_readl(dst);
Expand Down Expand Up @@ -987,8 +981,20 @@ static void do_atl_int(struct usb_hcd *usb_hcd)
printk(KERN_ERR "qh is 0\n");
continue;
}
priv_read_copy(priv, (u32 *)&ptd, usb_hcd->regs + atl_regs,
atl_regs, sizeof(ptd));
isp1760_writel(atl_regs + ISP_BANK(0), usb_hcd->regs +
HC_MEMORY_REG);
isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs +
HC_MEMORY_REG);
/*
* write bank1 address twice to ensure the 90ns delay (time
* between BANK0 write and the priv_read_copy() call is at
* least 3*t_WHWL + 2*t_w11 = 3*25ns + 2*17ns = 92ns)
*/
isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs +
HC_MEMORY_REG);

priv_read_copy(priv, (u32 *)&ptd, usb_hcd->regs + atl_regs +
ISP_BANK(0), sizeof(ptd));

dw1 = le32_to_cpu(ptd.dw1);
dw2 = le32_to_cpu(ptd.dw2);
Expand Down Expand Up @@ -1091,7 +1097,7 @@ static void do_atl_int(struct usb_hcd *usb_hcd)
case IN_PID:
priv_read_copy(priv,
priv->atl_ints[queue_entry].data_buffer,
usb_hcd->regs + payload, payload,
usb_hcd->regs + payload + ISP_BANK(1),
length);

case OUT_PID:
Expand Down Expand Up @@ -1206,8 +1212,20 @@ static void do_intl_int(struct usb_hcd *usb_hcd)
continue;
}

priv_read_copy(priv, (u32 *)&ptd, usb_hcd->regs + int_regs,
int_regs, sizeof(ptd));
isp1760_writel(int_regs + ISP_BANK(0), usb_hcd->regs +
HC_MEMORY_REG);
isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs +
HC_MEMORY_REG);
/*
* write bank1 address twice to ensure the 90ns delay (time
* between BANK0 write and the priv_read_copy() call is at
* least 3*t_WHWL + 2*t_w11 = 3*25ns + 2*17ns = 92ns)
*/
isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs +
HC_MEMORY_REG);

priv_read_copy(priv, (u32 *)&ptd, usb_hcd->regs + int_regs +
ISP_BANK(0), sizeof(ptd));
dw1 = le32_to_cpu(ptd.dw1);
dw3 = le32_to_cpu(ptd.dw3);
check_int_err_status(le32_to_cpu(ptd.dw4));
Expand Down Expand Up @@ -1242,7 +1260,7 @@ static void do_intl_int(struct usb_hcd *usb_hcd)
case IN_PID:
priv_read_copy(priv,
priv->int_ints[queue_entry].data_buffer,
usb_hcd->regs + payload , payload,
usb_hcd->regs + payload + ISP_BANK(1),
length);
case OUT_PID:

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/usb/host/isp1760-hcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ void deinit_kmem_cache(void);
#define BUFFER_MAP 0x7

#define HC_MEMORY_REG 0x33c
#define ISP_BANK(x) ((x) << 16)

#define HC_PORT1_CTRL 0x374
#define PORT1_POWER (3 << 3)
#define PORT1_INIT1 (1 << 7)
Expand Down

0 comments on commit db63cbd

Please sign in to comment.