diff options
author | Nitin Kumbhar <nkumbhar@nvidia.com> | 2011-04-01 17:00:08 +0530 |
---|---|---|
committer | Nitin Kumbhar <nkumbhar@nvidia.com> | 2011-04-01 17:00:08 +0530 |
commit | 677368f44ce65fe2292f696f0bfd568d3ac78436 (patch) | |
tree | e8317363967fbeef2680f4bca50bbda970d17f61 /drivers | |
parent | a8a882acd1b12930328b0090ff40a984f754eda6 (diff) | |
parent | 17a2400a982bbf7aaabe89d7bacf32f600d4e751 (diff) |
merging android-tegra-2.6.36 into git-master/linux-2.6/android-tegra-2.6.36
Conflicts:
drivers/serial/tegra_hsuart.c
drivers/usb/host/ehci-tegra.c
Change-Id: Ief6c03a63615a41e85de59ad14dedef309d0b2fb
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/tegra_hsuart.c | 16 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 26 | ||||
-rw-r--r-- | drivers/video/tegra/dc/nvhdcp.c | 1 | ||||
-rw-r--r-- | drivers/video/tegra/host/debug.c | 43 |
4 files changed, 68 insertions, 18 deletions
diff --git a/drivers/serial/tegra_hsuart.c b/drivers/serial/tegra_hsuart.c index f57ec8223492..4890def5e5c8 100644 --- a/drivers/serial/tegra_hsuart.c +++ b/drivers/serial/tegra_hsuart.c @@ -261,14 +261,13 @@ static int tegra_start_dma_rx(struct tegra_uart_port *t) static void tegra_rx_dma_threshold_callback(struct tegra_dma_req *req) { struct tegra_uart_port *t = req->dev; - struct uart_port *u = &t->uport; unsigned long flags; - spin_lock_irqsave(&u->lock, flags); + spin_lock_irqsave(&t->uport.lock, flags); do_handle_rx_dma(t); - spin_unlock_irqrestore(&u->lock, flags); + spin_unlock_irqrestore(&t->uport.lock, flags); } /* It is expected that the callers take the UART lock when this API is called. @@ -564,14 +563,19 @@ static void tegra_stop_rx(struct uart_port *u) set_rts(t, false); if (t->rx_in_progress) { + wait_sym_time(t, 1); /* wait a character interval */ + ier = t->ier_shadow; ier &= ~(UART_IER_RDI | UART_IER_RLSI | UART_IER_RTOIE | UART_IER_EORD); t->ier_shadow = ier; uart_writeb(t, ier, UART_IER); t->rx_in_progress = 0; - } - if (t->use_rx_dma && t->rx_dma) { - tegra_dma_dequeue(t->rx_dma); + + if (t->use_rx_dma && t->rx_dma) + tegra_dma_dequeue(t->rx_dma); + else + do_handle_rx_pio(t); + tty_flip_buffer_push(u->state->port.tty); } diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 29ae36d22e12..184c1783d6c7 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -36,6 +36,8 @@ #define TEGRA_USB_DMA_ALIGN 32 +#define STS_SRI (1<<7) /* SOF Recieved */ + struct tegra_ehci_hcd { struct ehci_hcd *ehci; struct tegra_usb_phy *phy; @@ -81,9 +83,9 @@ static int tegra_ehci_hub_control( { struct ehci_hcd *ehci = hcd_to_ehci(hcd); int ports = HCS_N_PORTS(ehci->hcs_params); - u32 __iomem *status_reg = &ehci->regs->port_status[ - (wIndex & 0xff) - 1]; u32 temp, status; + u32 __iomem *status_reg; + u32 usbsts_reg; unsigned long flags; int retval = 0; unsigned selector; @@ -161,6 +163,26 @@ static int tegra_ehci_hub_control( ehci->reset_done[wIndex-1] = jiffies + msecs_to_jiffies(25); + ehci_dbg(ehci, "%s:USBSTS = 0x%x", __func__, + ehci_readl(ehci, &ehci->regs->status)); + usbsts_reg = ehci_readl(ehci, &ehci->regs->status); + ehci_writel(ehci, usbsts_reg, &ehci->regs->status); + usbsts_reg = ehci_readl(ehci, &ehci->regs->status); + udelay(20); + + if (handshake(ehci, &ehci->regs->status, STS_SRI, STS_SRI, 2000)) + pr_err("%s: timeout set for STS_SRI\n", __func__); + + usbsts_reg = ehci_readl(ehci, &ehci->regs->status); + ehci_writel(ehci, usbsts_reg, &ehci->regs->status); + + if (handshake(ehci, &ehci->regs->status, STS_SRI, 0, 2000)) + pr_err("%s: timeout clear STS_SRI\n", __func__); + + if (handshake(ehci, &ehci->regs->status, STS_SRI, STS_SRI, 2000)) + pr_err("%s: timeout set STS_SRI\n", __func__); + + udelay(20); temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS); /* start resume signalling */ ehci_writel(ehci, temp | PORT_RESUME, status_reg); diff --git a/drivers/video/tegra/dc/nvhdcp.c b/drivers/video/tegra/dc/nvhdcp.c index 388da8cb05f7..07655ae01f7e 100644 --- a/drivers/video/tegra/dc/nvhdcp.c +++ b/drivers/video/tegra/dc/nvhdcp.c @@ -1012,6 +1012,7 @@ void tegra_nvhdcp_set_plug(struct tegra_nvhdcp *nvhdcp, bool hpd) nvhdcp_set_plugged(nvhdcp, hpd); if (hpd) { + nvhdcp->fail_count = 0; queue_work(nvhdcp->downstream_wq, &nvhdcp->work); } else { flush_workqueue(nvhdcp->downstream_wq); diff --git a/drivers/video/tegra/host/debug.c b/drivers/video/tegra/host/debug.c index d533310e3999..4f0b941a7ab1 100644 --- a/drivers/video/tegra/host/debug.c +++ b/drivers/video/tegra/host/debug.c @@ -106,7 +106,7 @@ static void nvhost_debug_handle_word(struct seq_file *s, int *state, int *count, switch (*state) { case NVHOST_DBG_STATE_CMD: if (addr) - seq_printf(s, "%d: %08x: %08x:", channel, addr, val); + seq_printf(s, "%d: %08lx: %08x:", channel, addr, val); else seq_printf(s, "%d: %08x:", channel, val); @@ -126,6 +126,27 @@ static void nvhost_debug_handle_word(struct seq_file *s, int *state, int *count, } } +static void nvhost_sync_reg_dump(struct seq_file *s) +{ + struct nvhost_master *m = s->private; + int i; + + /* print HOST1X_SYNC regs 4 per line (from 0x3000 -> 0x31E0) */ + for (i = 0; i <= 0x1E0; i += 4) { + if ((i & 0xF) == 0x0) + seq_printf(s, "\n0x%08x : ", i); + seq_printf(s, "%08x ", readl(m->sync_aperture + i)); + } + + seq_printf(s, "\n\n"); + + /* print HOST1X_SYNC regs 4 per line (from 0x3340 -> 0x3774) */ + for (i = 0x340; i <= 0x774; i += 4) { + if ((i & 0xF) == 0x0) + seq_printf(s, "\n0x%08x : ", i); + seq_printf(s, "%08x ", readl(m->sync_aperture + i)); + } +} static int nvhost_debug_show(struct seq_file *s, void *unused) { @@ -161,7 +182,7 @@ static int nvhost_debug_show(struct seq_file *s, void *unused) u32 dmaput, dmaget, dmactrl; u32 cbstat, cbread; u32 fifostat; - u32 val, base; + u32 val, base, offset; unsigned start, end; unsigned wr_ptr, rd_ptr; int state; @@ -175,7 +196,7 @@ static int nvhost_debug_show(struct seq_file *s, void *unused) cbstat = readl(m->aperture + HOST1X_SYNC_CBSTAT(i)); seq_printf(s, "%d-%s (%d): ", i, m->channels[i].mod.name, - m->channels[i].mod.refcount); + atomic_read(&m->channels[i].mod.refcount)); if (dmactrl != 0x0 || !m->channels[i].cdma.push_buffer.mapped) { seq_printf(s, "inactive\n\n"); @@ -183,19 +204,20 @@ static int nvhost_debug_show(struct seq_file *s, void *unused) } switch (cbstat) { - case 0x00010008: + case 0x00010008: /* HOST_WAIT_SYNCPT */ seq_printf(s, "waiting on syncpt %d val %d\n", cbread >> 24, cbread & 0xffffff); break; - case 0x00010009: + case 0x00010009: /* HOST_WAIT_SYNCPT_BASE */ base = cbread >> 15 & 0xf; + offset = cbread & 0xffff; val = readl(m->aperture + HOST1X_SYNC_SYNCPT_BASE(base)) & 0xffff; - val += cbread & 0xffff; + val += offset; - seq_printf(s, "waiting on syncpt %d val %d\n", - cbread >> 24, val); + seq_printf(s, "waiting on syncpt %d val %d (base %d, offset %d)\n", + cbread >> 24, val, base, offset); break; default: @@ -210,7 +232,6 @@ static int nvhost_debug_show(struct seq_file *s, void *unused) * check if we're executing a fetch, and if so dump * it. */ if (size) { - u32 offset = dmaget - m->channels[i].cdma.push_buffer.phys; u32 map_base = phys_addr & PAGE_MASK; u32 map_size = (size * 4 + PAGE_SIZE - 1) & PAGE_MASK; u32 map_offset = phys_addr - map_base; @@ -232,7 +253,7 @@ static int nvhost_debug_show(struct seq_file *s, void *unused) fifostat = readl(regs + HOST1X_CHANNEL_FIFOSTAT); if ((fifostat & 1 << 10) == 0 ) { - seq_printf(s, "\n%d: fifo:\n", i); + seq_printf(s, "\n%d: fifo:\n", i); writel(0x0, m->aperture + HOST1X_SYNC_CFPEEK_CTRL); writel(1 << 31 | i << 16, m->aperture + HOST1X_SYNC_CFPEEK_CTRL); rd_ptr = readl(m->aperture + HOST1X_SYNC_CFPEEK_PTRS) & 0x1ff; @@ -265,6 +286,8 @@ static int nvhost_debug_show(struct seq_file *s, void *unused) seq_printf(s, "\n"); } + nvhost_sync_reg_dump(s); + nvhost_module_idle(&m->mod); return 0; } |