if(hwcfg1 & (2<<(i<<1))){
DWC_PRINT("Device IN EP %d Registers\n", i);
addr=&_core_if->dev_if->in_ep_regs[i]->diepctl;
- DWC_PRINT("DIEPCTL5 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DIEPCTL%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
addr=&_core_if->dev_if->in_ep_regs[i]->diepint;
- DWC_PRINT("DIEPINT5 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DIEPINT%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
addr=&_core_if->dev_if->in_ep_regs[i]->dieptsiz;
- DWC_PRINT("DIETSIZ5 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DIETSIZ%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
addr=&_core_if->dev_if->in_ep_regs[i]->diepdma;
- DWC_PRINT("DIEPDMA5 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DIEPDMA%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
addr=&_core_if->dev_if->in_ep_regs[i]->dtxfsts;
- DWC_PRINT("DTXFSTS5 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DTXFSTS%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
}
if(hwcfg1 & (1<<(i<<1))){
DWC_PRINT("Device OUT EP %d Registers\n", i);
addr=&_core_if->dev_if->out_ep_regs[i]->doepctl;
- DWC_PRINT("DOEPCTL6 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DOEPCTL%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
addr=&_core_if->dev_if->out_ep_regs[i]->doepfn;
- DWC_PRINT("DOEPFN6 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DOEPFN%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
addr=&_core_if->dev_if->out_ep_regs[i]->doepint;
- DWC_PRINT("DOEPINT6 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DOEPINT%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
addr=&_core_if->dev_if->out_ep_regs[i]->doeptsiz;
- DWC_PRINT("DOETSIZ6 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DOETSIZ%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
addr=&_core_if->dev_if->out_ep_regs[i]->doepdma;
- DWC_PRINT("DOEPDMA6 @0x%08X : 0x%08X\n",(uint32_t)addr,dwc_read_reg32(addr));
+ DWC_PRINT("DOEPDMA%d @0x%08X : 0x%08X\n", i, (uint32_t)addr,dwc_read_reg32(addr));
}
}
* ×¢Òâ,Èç¹ûhostÉ豸Èç¹û¿ìËٰβ壬»áµ±³ÉUSB_IDΪµÍµÄ³äµçÆ÷´¦Àí
*/
gotgctl.d32 = dwc_read_reg32( &_core_if->core_global_regs->gotgctl );
- #if 1
+ #if 0
if((!gotgctl.b.conidsts)&&( gotgctl.b.bsesvld ))
{
if(pcd &&(pcd->vbus_status == 0))
int _status)
{
unsigned stopped = _ep->stopped;
-
+
DWC_DEBUGPL(DBG_PCDV, "%s(%p)\n", __func__, _ep);
list_del_init(&_req->queue);
-
+
if (_req->req.status == -EINPROGRESS)
{
_req->req.status = _status;
_status = _req->req.status;
}
#if 1
+ if (_req->req.dma != DMA_ADDR_INVALID){
if (_req->mapped) {
dma_unmap_single(_ep->pcd->gadget.dev.parent,
_req->req.dma, _req->req.length,
_ep->dwc_ep.is_in
? DMA_TO_DEVICE
: DMA_FROM_DEVICE);
+ }
#endif
/* don't modify queue heads during completion callback */
_ep->stopped = 1;
}
ep = container_of(_ep, dwc_otg_pcd_ep_t, ep);
+ SPIN_LOCK_IRQSAVE(&ep->pcd->lock, flags);
if (!_ep || (!ep->desc && ep->dwc_ep.num != 0))
{
DWC_WARN("%s, bad ep\n", __func__);
+ SPIN_UNLOCK_IRQRESTORE(&ep->pcd->lock, flags);
return -EINVAL;
}
pcd = ep->pcd;
{
DWC_DEBUGPL(DBG_PCDV, "gadget.speed=%d\n", pcd->gadget.speed);
DWC_WARN("%s, bogus device state\n", __func__);
+ SPIN_UNLOCK_IRQRESTORE(&pcd->lock, flags);
return -ESHUTDOWN;
}
}
}
- SPIN_LOCK_IRQSAVE(&ep->pcd->lock, flags);
#if defined(DEBUG) & defined(VERBOSE)
dump_msg(_req->buf, _req->length);
}
if( !exitsuspend && (pcd->phy_suspend == 0)) {
pcd->phy_suspend = 1;
- *otg_phy_con1 |= (0x01<<2);
+ *otg_phy_con1 |= ((0x01<<2)|(0x05<<6));
*otg_phy_con1 &= ~(0x01<<3); // enter suspend.
udelay(3);
clk_disable(pcd->otg_dev->phyclk);
unsigned int usbgrf_status = *(unsigned int*)(USBGRF_SOC_STATUS0);
#endif
_pcd->check_vbus_timer.expires = jiffies + (HZ); /* 1 s */
- if(usbgrf_status &0x20000){ // bvalid
+ if((usbgrf_status &(1<<20)) == 0){ // id low
+
+ if( _pcd->phy_suspend)
+ dwc_otg20phy_suspend( 1 );
+ }
+ else if(usbgrf_status &0x20000){ // bvalid
/* if usb not connect before ,then start connect */
if( _pcd->vbus_status == 0 ) {
DWC_PRINT("********vbus detect*********************************************\n");
_ep->dwc_ep.dma_addr = req->req.dma;
_ep->dwc_ep.sent_zlp = 0;
_ep->dwc_ep.total_len = _ep->dwc_ep.xfer_len;
-
- //DWC_ERROR(" -> starting transfer (start_next_req) %s %s\n",
- //_ep->ep.name, _ep->dwc_ep.is_in?"IN":"OUT");
-
+
dwc_otg_ep_start_transfer( GET_CORE_IF(_ep->pcd), &_ep->dwc_ep );
}
}
}
request_done(_ep, req, 0);
} else {
-// DWC_PRINT("\n++++++FIND NULL req,ep=%s++++++++++\n" , _ep->ep.name );
+ DWC_PRINT("\n++++++FIND NULL req,ep=%s++++++++++\n" , _ep->ep.name );
_ep->pcd->request_pending = 0;
}
_ep->dwc_ep.start_xfer_buff = 0;