BZ: 24941
The usb performance is low when adb push/pull files to/from PR3 phone.
The reason is that USB interrupt is delayed by OTG device controller.
USB interrupt interval is controlled by USBCMD.ITC. The default value
of ITC is a little high. Set ITC to low value to shorten interrupt
interval.
Change-Id: I85577648e5d0844aaf05ed343c393cad5619f375
Signed-off-by: wu xia <xia.wu@intel.com>
Reviewed-on: http://android.intel.com:8080/39931
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Sun, Jianhua <jianhua.sun@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
udelay(10);
}
+ /* change ITC value. ITC field is used to set the maximum rate at which
+ the device controller will issue interrupts. ITC contain the maximum
+ interrupt interval measured in micro-frames. ITC=2 is the smallest
+ available value. The USB network gadget become instability if ITC is
+ set to 1 or 0.
+ */
+ usbcmd = readl(&dev->op_regs->usbcmd);
+ usbcmd &= ~CMD_SET_ITC(0xff); /* clear ITC field */
+ usbcmd |= CMD_SET_ITC(0x02); /* set ITC field */
+ writel(usbcmd, &dev->op_regs->usbcmd);
+
/* set controller to device mode */
usbmode = readl(&dev->op_regs->usbmode);
usbmode |= MODE_DEVICE;
(((u)>>24)&0xf) /* bits 27:24, host init resume duration */
#define CMD_ITC(u) \
(((u)>>16)&0xff) /* bits 23:16, interrupt threshold control */
+#define CMD_SET_ITC(u) \
+ (((u)&0xff)<<16) /* set value to ITC field */
#define CMD_PPE BIT(15) /* per-port change events enable */
#define CMD_ATDTW BIT(14) /* add dTD tripwire */
#define CMD_SUTW BIT(13) /* setup tripwire */