mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
USB: dwc_otg_310: pcd: don't set cnak when setup stage
Refer dwc2 databook and programming, the controller automatic receive SETUP packet to the receive FIFO and respond to Host ACK whether ep enabled or not. The core internally set the IN NAK and OUT NAK bits when SETUP packet was received in order to software process SETUP packet and transition to the next stage. If software has not enabled ep before the Host send the SETUP packet, set enable ep and cnak at the same time the Host send DATA OUT packet. Then dwc2 controller write the setup data to the memory and disable ep, respond ACK to the Host DATA OUT packet. The Host transition to the status stage, but we lost the DATA OUT packet. So don't set cnak when setup stage, the dwc2 controller respond NAK to the Host DATA OUT packet, the Host resend ping packet and DATA OUT packet. TEST=set gadget work as usb audio and connect to ubuntu(rk3036) Change-Id: Id791c44baf3d363a975ceaeb7d1c879c9703ce1d Signed-off-by: Feng Mingli <fml@rock-chips.com> Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
@@ -792,13 +792,8 @@ static inline void ep0_out_start(dwc_otg_core_if_t *core_if,
|
||||
/** DOEPCTL0 Register write cnak will be set after setup interrupt */
|
||||
doepctl.d32 = 0;
|
||||
doepctl.b.epena = 1;
|
||||
if (core_if->snpsid <= OTG_CORE_REV_2_94a) {
|
||||
doepctl.b.cnak = 1;
|
||||
DWC_WRITE_REG32(&dev_if->out_ep_regs[0]->doepctl, doepctl.d32);
|
||||
} else {
|
||||
DWC_MODIFY_REG32(&dev_if->out_ep_regs[0]->doepctl, 0,
|
||||
doepctl.d32);
|
||||
}
|
||||
DWC_MODIFY_REG32(&dev_if->out_ep_regs[0]->doepctl, 0,
|
||||
doepctl.d32);
|
||||
|
||||
#ifdef VERBOSE
|
||||
DWC_DEBUGPL(DBG_PCDV, "doepctl0=%0x\n",
|
||||
|
||||
Reference in New Issue
Block a user