M7350v3_en_gpl
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
/* ehci-msm-hsic.c - HSUSB Host Controller Driver Implementation
|
||||
*
|
||||
* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Partly derived from ehci-fsl.c and ehci-hcd.c
|
||||
* Copyright (c) 2000-2004 by David Brownell
|
||||
@ -53,7 +53,7 @@
|
||||
|
||||
#define MSM_USB_BASE (hcd->regs)
|
||||
#define USB_REG_START_OFFSET 0x90
|
||||
#define USB_REG_END_OFFSET 0x324
|
||||
#define USB_REG_END_OFFSET 0x250
|
||||
|
||||
static struct workqueue_struct *ehci_wq;
|
||||
struct ehci_timer {
|
||||
@ -127,9 +127,6 @@ module_param(ep_addr_rxdbg_mask, uint, S_IRUGO | S_IWUSR);
|
||||
static unsigned int ep_addr_txdbg_mask = 9;
|
||||
module_param(ep_addr_txdbg_mask, uint, S_IRUGO | S_IWUSR);
|
||||
|
||||
static unsigned int dbg_qh_addr;
|
||||
module_param(dbg_qh_addr, uint, S_IRUGO | S_IWUSR);
|
||||
|
||||
/* Maximum debug message length */
|
||||
#define DBG_MSG_LEN 128UL
|
||||
|
||||
@ -321,44 +318,6 @@ static inline struct usb_hcd *hsic_to_hcd(struct msm_hsic_hcd *mehci)
|
||||
return container_of((void *) mehci, struct usb_hcd, hcd_priv);
|
||||
}
|
||||
|
||||
static void dbg_msm_qh(struct ehci_hcd *ehci, struct ehci_qh *qh)
|
||||
{
|
||||
struct ehci_qh_hw *hw = qh->hw;
|
||||
|
||||
pr_info("EP:%x qh %p info %x %x c_qtd-%08x\n",
|
||||
(hw->hw_info1 & 0xF00) >> 8, qh, hw->hw_info1,
|
||||
hw->hw_info2, hw->hw_current);
|
||||
pr_info("overlay n%08x %08x t-%08x nak-%x c_err %x\n",
|
||||
hw->hw_qtd_next, hw->hw_alt_next,
|
||||
hw->hw_token,
|
||||
(hw->hw_alt_next & 0xE)>>1, (hw->hw_token & 0xC00) >> 10);
|
||||
}
|
||||
|
||||
static void dump_msm_qhs(struct usb_hcd *hcd)
|
||||
{
|
||||
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
|
||||
struct ehci_qh *qh, *qh_next;
|
||||
unsigned long flags;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
pr_info("Dump QHs, iteration:%d\n", i);
|
||||
spin_lock_irqsave(&ehci->lock, flags);
|
||||
qh_next = ehci->async->qh_next.qh;
|
||||
while (qh_next) {
|
||||
qh = qh_next;
|
||||
qh_next = qh->qh_next.qh;
|
||||
|
||||
if (!dbg_qh_addr ||
|
||||
((struct ehci_qh *)dbg_qh_addr) == qh)
|
||||
dbg_msm_qh(ehci, qh);
|
||||
}
|
||||
spin_unlock_irqrestore(&ehci->lock, flags);
|
||||
usleep_range(5000, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void dump_hsic_regs(struct usb_hcd *hcd)
|
||||
{
|
||||
int i;
|
||||
@ -979,14 +938,6 @@ static int msm_hsic_resume(struct msm_hsic_hcd *mehci)
|
||||
|
||||
skip_phy_resume:
|
||||
|
||||
/* Check HSIC host pipe state before resume. Pipe should be empty. */
|
||||
if (pdata->consider_ipa_handshake) {
|
||||
if (!msm_bam_hsic_host_pipe_empty()) {
|
||||
dev_err(mehci->dev, "Data pending without resumed.\n");
|
||||
BUG_ON(1);
|
||||
}
|
||||
}
|
||||
|
||||
usb_hcd_resume_root_hub(hcd);
|
||||
|
||||
atomic_set(&mehci->in_lpm, 0);
|
||||
@ -1840,27 +1791,6 @@ const struct file_operations ehci_hsic_msm_dbg_ctrl_fops = {
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static int ehci_hsic_msm_qh_show(struct seq_file *s, void *unused)
|
||||
{
|
||||
struct msm_hsic_hcd *mehci = s->private;
|
||||
|
||||
dump_msm_qhs(hsic_to_hcd(mehci));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ehci_hsic_msm_qh_open(struct inode *inode, struct file *f)
|
||||
{
|
||||
return single_open(f, ehci_hsic_msm_qh_show, inode->i_private);
|
||||
}
|
||||
|
||||
const struct file_operations ehci_hsic_msm_qh_fops = {
|
||||
.open = ehci_hsic_msm_qh_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static struct dentry *ehci_hsic_msm_dbg_root;
|
||||
static int ehci_hsic_msm_debugfs_init(struct msm_hsic_hcd *mehci)
|
||||
{
|
||||
@ -1911,16 +1841,6 @@ static int ehci_hsic_msm_debugfs_init(struct msm_hsic_hcd *mehci)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ehci_hsic_msm_dentry = debugfs_create_file("show_hsic_qh",
|
||||
S_IRUGO,
|
||||
ehci_hsic_msm_dbg_root, mehci,
|
||||
&ehci_hsic_msm_qh_fops);
|
||||
|
||||
if (!ehci_hsic_msm_dentry) {
|
||||
debugfs_remove_recursive(ehci_hsic_msm_dbg_root);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2232,10 +2152,8 @@ static int __devinit ehci_hsic_msm_probe(struct platform_device *pdev)
|
||||
if (pdev->dev.parent)
|
||||
pm_runtime_put_sync(pdev->dev.parent);
|
||||
|
||||
if (mehci->enable_hbm) {
|
||||
if (mehci->enable_hbm)
|
||||
hbm_init(hcd, pdata->disable_park_mode);
|
||||
msm_bam_hsic_reset();
|
||||
}
|
||||
|
||||
if (pdata && pdata->consider_ipa_handshake)
|
||||
msm_bam_set_hsic_host_dev(&pdev->dev);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
@ -165,16 +165,6 @@ int hbm_pipe_init(u32 QH_addr, u32 pipe_num, bool is_consumer)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Disable HBM pipe */
|
||||
hbm_msm_write_reg_field(hbm_ctx->base, USB_OTG_HS_HBM_PIPE_EN,
|
||||
1 << pipe_num, 0);
|
||||
|
||||
/* Reset HBM SideBand */
|
||||
hbm_msm_write_reg_field(hbm_ctx->base, USB_OTG_HS_HBM_SB_SW_RST,
|
||||
1 << pipe_num, 1);
|
||||
hbm_msm_write_reg_field(hbm_ctx->base, USB_OTG_HS_HBM_SB_SW_RST,
|
||||
1 << pipe_num, 0);
|
||||
|
||||
/* map QH(ep) <> pipe */
|
||||
hbm_msm_write_reg(hbm_ctx->base,
|
||||
USB_OTG_HS_HBM_QH_MAP_PIPE(pipe_num), QH_addr);
|
||||
@ -230,11 +220,10 @@ static int hbm_submit_async(struct ehci_hcd *ehci, struct urb *urb,
|
||||
{
|
||||
int epnum;
|
||||
unsigned long flags;
|
||||
struct ehci_qh *qh = (struct ehci_qh *) urb->ep->hcpriv;
|
||||
struct ehci_qh *qh = NULL;
|
||||
int rc;
|
||||
struct usb_host_bam_type *bam =
|
||||
(struct usb_host_bam_type *)urb->priv_data;
|
||||
int cmd;
|
||||
|
||||
epnum = urb->ep->desc.bEndpointAddress;
|
||||
|
||||
@ -247,9 +236,6 @@ static int hbm_submit_async(struct ehci_hcd *ehci, struct urb *urb,
|
||||
if (unlikely(rc))
|
||||
goto done;
|
||||
|
||||
if (qh != NULL)
|
||||
pr_debug("%s: QH NOT NULL (%p)\n", __func__, qh);
|
||||
|
||||
qh = qh_append_tds(ehci, urb, qtd_list, epnum, &urb->ep->hcpriv);
|
||||
if (unlikely(qh == NULL)) {
|
||||
usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
|
||||
@ -257,38 +243,15 @@ static int hbm_submit_async(struct ehci_hcd *ehci, struct urb *urb,
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Stop Async Scheduler */
|
||||
cmd = ehci_readl(ehci, &ehci->regs->command);
|
||||
if (ehci->rh_state != EHCI_RH_HALTED && !ehci->reclaim) {
|
||||
ehci_writel(ehci, cmd & ~CMD_ASE, &ehci->regs->command);
|
||||
wmb();
|
||||
}
|
||||
|
||||
hbm_pipe_init(qh->qh_dma, bam->pipe_num, bam->dir);
|
||||
|
||||
if (likely(qh->qh_state == QH_STATE_IDLE)) {
|
||||
pr_debug("%s: QH was IDLE (%p)\n", __func__, qh);
|
||||
if (likely(qh->qh_state == QH_STATE_IDLE))
|
||||
qh_link_async(ehci, qh);
|
||||
}
|
||||
|
||||
/* Start Async Scheduler */
|
||||
cmd = ehci_readl(ehci, &ehci->regs->command);
|
||||
if (!(cmd & CMD_ASE)) {
|
||||
/* in case a clear of CMD_ASE didn't take yet */
|
||||
(void)handshake(ehci, &ehci->regs->status, STS_ASS, 0, 150);
|
||||
cmd |= CMD_ASE;
|
||||
ehci_writel(ehci, cmd, &ehci->regs->command);
|
||||
}
|
||||
|
||||
done:
|
||||
spin_unlock_irqrestore(&ehci->lock, flags);
|
||||
|
||||
pr_debug("QH:%p urb:%p <--> pipe:%u ep:%d(out:%u)\n",
|
||||
urb->ep->hcpriv, urb, bam->pipe_num, epnum, bam->dir);
|
||||
|
||||
if (unlikely(qh == NULL))
|
||||
qtd_list_free(ehci, urb, qtd_list);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user