public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6
@ 2013-09-20  3:29 Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT Troy Kisky
                   ` (16 more replies)
  0 siblings, 17 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Hi Marek, Stefano

Sorry, for the long delay between postings.

This series is based on u-boot-usb/master branch.
After this series, nitrogen6x works with tftpboot to transfer
files over usb, and will recognize a usb stick in the OTG port.


This V4 has been rebased to the latest u-boot-usb/master branch
and changed to address Marek comments.


The most noticeable change is the addition of
"add support for host mode otg port"




Stefano, if you would you like to take the last 3 patches,
there should not be a problem.

The patches are mostly independent, so if a patch has
an issue, please feel free to skip it.
An exception is 1/17 should be before 2/17 if Stefano's branch merges upstream first,
otherwise nitrogen6x will get a build error.

Thanks


Troy Kisky (17):
  usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT
  usb: ehci-mx6: add support for host mode otg port
  usb: gadget: ether set wMaxPacketSize
  usb: gadget: ether: return error from rx_submit if no request
  usb: gadget: mv_udc: split mv_udc.h file
  usb: udc: add udc.h include file
  usb: gadget: mv_udc: fix typo in error message
  usb: gadget: mv_udc: set is_dualspeed = 1
  usb: gadget: mv_udc: fix full speed connections
  usb: gadget: mv_udc: optimize bounce
  usb: gadget: mv_udc: flush item before head
  usb: gadget: mv_udc: optimize ep_enable
  usb: gadget: mv_udc: zero transfer descriptor memory on probe
  usb: gadget: mv_udc: clear desc upon ep_disable
  mx6: iomux: add GPR1 defines for use with nitrogen6x
  nitrogen6x: add otg usb host/device mode support
  nitrogen6x: add CONFIG_MV_UDC

 arch/arm/include/asm/arch-mx6/iomux.h  |   6 ++
 board/boundary/nitrogen6x/nitrogen6x.c |  33 ++++++++
 drivers/serial/usbtty.h                |   3 +-
 drivers/usb/gadget/designware_udc.c    |   1 +
 drivers/usb/gadget/ether.c             |   4 +
 drivers/usb/gadget/mpc8xx_udc.c        |   1 +
 drivers/usb/gadget/mv_udc.c            | 113 ++++++++++++++++-----------
 drivers/usb/gadget/mv_udc.h            | 115 ++++++++++++++++++++++++++++
 drivers/usb/gadget/omap1510_udc.c      |   1 +
 drivers/usb/gadget/pxa27x_udc.c        |   1 +
 drivers/usb/host/ehci-hcd.c            |   7 ++
 drivers/usb/host/ehci-mx6.c            | 135 +++++++++++++++++++++++----------
 drivers/usb/musb/musb_udc.c            |   3 +-
 include/configs/mx6qsabreauto.h        |   2 +-
 include/configs/nitrogen6x.h           |   8 +-
 include/usb/designware_udc.h           |  31 --------
 include/usb/mpc8xx_udc.h               |  19 +----
 include/usb/musb_udc.h                 |  40 ----------
 include/usb/mv_udc.h                   | 118 ----------------------------
 include/usb/omap1510_udc.h             |  27 +------
 include/usb/pxa27x_udc.h               |  26 +------
 include/usb/udc.h                      |  61 +++++++++++++++
 22 files changed, 409 insertions(+), 346 deletions(-)
 create mode 100644 drivers/usb/gadget/mv_udc.h
 delete mode 100644 include/usb/musb_udc.h
 create mode 100644 include/usb/udc.h

-- 
1.8.1.2

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20 10:45   ` Marek Vasut
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 02/17] usb: ehci-mx6: add support for host mode otg port Troy Kisky
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

i.mx6 has 1 otg controller, and 3 host ports. So,
CONFIG_USB_MAX_CONTROLLER_COUNT can be greater than 1
even though only 1 device mode controller is supported.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: new patch
---
 drivers/usb/gadget/mv_udc.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index 7574e31..b87119c 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -17,10 +17,6 @@
 #include <linux/types.h>
 #include <usb/mv_udc.h>
 
-#if CONFIG_USB_MAX_CONTROLLER_COUNT > 1
-#error This driver only supports one single controller.
-#endif
-
 /*
  * Check if the system has too long cachelines. If the cachelines are
  * longer then 128b, the driver will not be able flush/invalidate data
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 02/17] usb: ehci-mx6: add support for host mode otg port
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20 10:51   ` Marek Vasut
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize Troy Kisky
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Previously, only host1 was supported using an index of 0.
Now, otg has index 0, host1 is 1, host2 is 2, host3 is 3.
Since OTG requires usbmode to be set after reset, I added
a weak function ehci_hcd_init_after_reset to handle this,
and removed it from ehci_hcd_init. I also added a weak
function board_ehci_power to handle turning power on/off
for otg.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
V4: new patch, replaces "usb: gadget: mv_udc: fix hardware udc address for i.MX6"
and has the bonus of giving OTG host mode support
---
 drivers/usb/host/ehci-hcd.c     |   7 +++
 drivers/usb/host/ehci-mx6.c     | 135 ++++++++++++++++++++++++++++------------
 include/configs/mx6qsabreauto.h |   2 +-
 include/configs/nitrogen6x.h    |   2 +-
 4 files changed, 105 insertions(+), 41 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index fdad739..3c570ef 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -881,6 +881,11 @@ int usb_lowlevel_stop(int index)
 	return ehci_hcd_stop(index);
 }
 
+int __weak ehci_hcd_init_after_reset(int index)
+{
+	return 0;
+}
+
 int usb_lowlevel_init(int index, void **controller)
 {
 	uint32_t reg;
@@ -900,6 +905,8 @@ int usb_lowlevel_init(int index, void **controller)
 	if (ehci_hcd_init(index, &ehcic[index].hccr, &ehcic[index].hcor))
 		return -1;
 #endif
+	ehci_hcd_init_after_reset(index);
+
 	/* Set the high address word (aka segment) for 64-bit controller */
 	if (ehci_readl(&ehcic[index].hccr->cr_hccparams) & 1)
 		ehci_writel(ehcic[index].hcor->or_ctrldssegment, 0);
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index eb24af5..41b444e 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -35,6 +35,7 @@
 #define USBPHY_CTRL_CLKGATE			0x40000000
 #define USBPHY_CTRL_ENUTMILEVEL3		0x00008000
 #define USBPHY_CTRL_ENUTMILEVEL2		0x00004000
+#define USBPHY_CTRL_OTD_ID_BIT			27
 
 #define ANADIG_USB2_CHRG_DETECT_EN_B		0x00100000
 #define ANADIG_USB2_CHRG_DETECT_CHK_CHRG_B	0x00080000
@@ -49,52 +50,83 @@
 #define UCTRL_OVER_CUR_DIS	(1 << 7) /* Disable OTG Overcurrent Detection */
 
 /* USBCMD */
-#define UH1_USBCMD_OFFSET	0x140
 #define UCMD_RUN_STOP           (1 << 0) /* controller run/stop */
 #define UCMD_RESET		(1 << 1) /* controller reset */
 
-static void usbh1_internal_phy_clock_gate(int on)
+static const unsigned phy_bases[] = {
+	USB_PHY0_BASE_ADDR,
+	USB_PHY1_BASE_ADDR,
+};
+
+static void usb_internal_phy_clock_gate(int index, int on)
 {
-	void __iomem *phy_reg = (void __iomem *)USB_PHY1_BASE_ADDR;
+	void __iomem *phy_reg;
+
+	if (index >= ARRAY_SIZE(phy_bases))
+		return;
 
+	phy_reg = (void __iomem *)phy_bases[index];
 	phy_reg += on ? USBPHY_CTRL_CLR : USBPHY_CTRL_SET;
 	__raw_writel(USBPHY_CTRL_CLKGATE, phy_reg);
 }
 
-static void usbh1_power_config(void)
+static void usb_power_config(int index)
 {
 	struct anatop_regs __iomem *anatop =
 		(struct anatop_regs __iomem *)ANATOP_BASE_ADDR;
+	void __iomem *chrg_detect;
+	void __iomem *pll_480_ctrl_clr;
+	void __iomem *pll_480_ctrl_set;
+
+	switch (index) {
+	case 0:
+		chrg_detect = &anatop->usb1_chrg_detect;
+		pll_480_ctrl_clr = &anatop->usb1_pll_480_ctrl_clr;
+		pll_480_ctrl_set = &anatop->usb1_pll_480_ctrl_set;
+		break;
+	case 1:
+		chrg_detect = &anatop->usb2_chrg_detect;
+		pll_480_ctrl_clr = &anatop->usb2_pll_480_ctrl_clr;
+		pll_480_ctrl_set = &anatop->usb2_pll_480_ctrl_set;
+		break;
+	default:
+		return;
+	}
 	/*
-	 * Some phy and power's special controls for host1
+	 * Some phy and power's special controls
 	 * 1. The external charger detector needs to be disabled
 	 * or the signal at DP will be poor
-	 * 2. The PLL's power and output to usb for host 1
+	 * 2. The PLL's power and output to usb
 	 * is totally controlled by IC, so the Software only needs
 	 * to enable them at initializtion.
 	 */
 	__raw_writel(ANADIG_USB2_CHRG_DETECT_EN_B |
 		     ANADIG_USB2_CHRG_DETECT_CHK_CHRG_B,
-		     &anatop->usb2_chrg_detect);
+		     chrg_detect);
 
 	__raw_writel(ANADIG_USB2_PLL_480_CTRL_BYPASS,
-		     &anatop->usb2_pll_480_ctrl_clr);
+		     pll_480_ctrl_clr);
 
 	__raw_writel(ANADIG_USB2_PLL_480_CTRL_ENABLE |
 		     ANADIG_USB2_PLL_480_CTRL_POWER |
 		     ANADIG_USB2_PLL_480_CTRL_EN_USB_CLKS,
-		     &anatop->usb2_pll_480_ctrl_set);
+		     pll_480_ctrl_set);
 }
 
-static int usbh1_phy_enable(void)
+static int usb_phy_enable(int index, struct usb_ehci *ehci)
 {
-	void __iomem *phy_reg = (void __iomem *)USB_PHY1_BASE_ADDR;
-	void __iomem *phy_ctrl = (void __iomem *)(phy_reg + USBPHY_CTRL);
-	void __iomem *usb_cmd =	(void __iomem *)(USBOH3_USB_BASE_ADDR +
-						 USB_H1REGS_OFFSET +
-						 UH1_USBCMD_OFFSET);
+	void __iomem *phy_reg;
+	void __iomem *phy_ctrl;
+	void __iomem *usb_cmd;
 	u32 val;
 
+	if (index >= ARRAY_SIZE(phy_bases))
+		return;
+
+	phy_reg = (void __iomem *)phy_bases[index];
+	phy_ctrl = (void __iomem *)(phy_reg + USBPHY_CTRL);
+	usb_cmd = (void __iomem *)&ehci->usbcmd;
+
 	/* Stop then Reset */
 	val = __raw_readl(usb_cmd);
 	val &= ~UCMD_RUN_STOP;
@@ -123,31 +155,36 @@ static int usbh1_phy_enable(void)
 	/* Power up the PHY */
 	__raw_writel(0, phy_reg + USBPHY_PWD);
 	/* enable FS/LS device */
-	val = __raw_readl(phy_reg + USBPHY_CTRL);
+	val = __raw_readl(phy_ctrl);
 	val |= (USBPHY_CTRL_ENUTMILEVEL2 | USBPHY_CTRL_ENUTMILEVEL3);
-	__raw_writel(val, phy_reg + USBPHY_CTRL);
+	__raw_writel(val, phy_ctrl);
 
 	return 0;
 }
 
-static void usbh1_oc_config(void)
+struct usbnc_regs {
+	u32	ctrl[4];	/* otg/host1-3 */
+};
+
+static void usb_oc_config(int index)
 {
-	void __iomem *usb_base = (void __iomem *)USBOH3_USB_BASE_ADDR;
-	void __iomem *usbother_base = usb_base + USB_OTHERREGS_OFFSET;
+	struct usbnc_regs *usbnc = (struct usbnc_regs *)(USBOH3_USB_BASE_ADDR +
+			USB_OTHERREGS_OFFSET);
+	void __iomem *ctrl = (void __iomem *)(&usbnc->ctrl[index]);
 	u32 val;
 
-	val = __raw_readl(usbother_base + USB_H1_CTRL_OFFSET);
+	val = __raw_readl(ctrl);
 #if CONFIG_MACH_TYPE == MACH_TYPE_MX6Q_ARM2
 	/* mx6qarm2 seems to required a different setting*/
 	val &= ~UCTRL_OVER_CUR_POL;
 #else
 	val |= UCTRL_OVER_CUR_POL;
 #endif
-	__raw_writel(val, usbother_base + USB_H1_CTRL_OFFSET);
+	__raw_writel(val, ctrl);
 
-	val = __raw_readl(usbother_base + USB_H1_CTRL_OFFSET);
+	val = __raw_readl(ctrl);
 	val |= UCTRL_OVER_CUR_DIS;
-	__raw_writel(val, usbother_base + USB_H1_CTRL_OFFSET);
+	__raw_writel(val, ctrl);
 }
 
 int __weak board_ehci_hcd_init(int port)
@@ -157,31 +194,51 @@ int __weak board_ehci_hcd_init(int port)
 
 int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
 {
-	struct usb_ehci *ehci;
+	struct usb_ehci *ehci = (struct usb_ehci *)(USBOH3_USB_BASE_ADDR +
+		(0x200 * index));
 
+	if (index > 3)
+		return -EINVAL;
 	enable_usboh3_clk(1);
 	mdelay(1);
 
 	/* Do board specific initialization */
-	board_ehci_hcd_init(CONFIG_MXC_USB_PORT);
-
-#if CONFIG_MXC_USB_PORT == 1
-	/* USB Host 1 */
-	usbh1_power_config();
-	usbh1_oc_config();
-	usbh1_internal_phy_clock_gate(1);
-	usbh1_phy_enable();
-#else
-#error "MXC USB port not yet supported"
-#endif
+	board_ehci_hcd_init(index);
+
+	usb_power_config(index);
+	usb_oc_config(index);
+	usb_internal_phy_clock_gate(index, 1);
+	usb_phy_enable(index, ehci);
 
-	ehci = (struct usb_ehci *)(USBOH3_USB_BASE_ADDR +
-		(0x200 * CONFIG_MXC_USB_PORT));
 	*hccr = (struct ehci_hccr *)((uint32_t)&ehci->caplength);
 	*hcor = (struct ehci_hcor *)((uint32_t)*hccr +
 			HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
-	setbits_le32(&ehci->usbmode, CM_HOST);
+	return 0;
+}
+
+int __weak board_ehci_power(int port, int on)
+{
+	return 0;
+}
 
+int ehci_hcd_init_after_reset(int index)
+{
+	int otg_id;
+	void __iomem *phy_reg;
+	void __iomem *phy_ctrl;
+	struct usb_ehci *ehci = (struct usb_ehci *)(USBOH3_USB_BASE_ADDR +
+		(0x200 * index));
+
+	if (index >= ARRAY_SIZE(phy_bases))
+		return 0;
+
+	phy_reg = (void __iomem *)phy_bases[index];
+	phy_ctrl = (void __iomem *)(phy_reg + USBPHY_CTRL);
+	otg_id = (__raw_readl(phy_ctrl) >> USBPHY_CTRL_OTD_ID_BIT) & 1;
+	printf("!!!index=%d otg_id=%d\n", index, otg_id);
+	board_ehci_power(index, otg_id ? 0 : 1);
+	if (!otg_id)
+		setbits_le32(&ehci->usbmode, CM_HOST);
 	__raw_writel(CONFIG_MXC_USB_PORTSC, &ehci->portsc);
 	setbits_le32(&ehci->portsc, USB_EN);
 
diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h
index 5530fc6..805c7be 100644
--- a/include/configs/mx6qsabreauto.h
+++ b/include/configs/mx6qsabreauto.h
@@ -23,7 +23,7 @@
 #define CONFIG_USB_STORAGE
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
-#define CONFIG_MXC_USB_PORT	1
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS	0
 
diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 3454b86..b1ca91e 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -119,7 +119,7 @@
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_ASIX
 #define CONFIG_USB_ETHER_SMSC95XX
-#define CONFIG_MXC_USB_PORT	1
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS	0
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 02/17] usb: ehci-mx6: add support for host mode otg port Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20 10:52   ` Marek Vasut
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 04/17] usb: gadget: ether: return error from rx_submit if no request Troy Kisky
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

set wMaxPacketSize for full speed descriptors
fs_source_desc, fs_sink_desc to 64.

Full-speed bulk endpoint can have a maximum packet size of
8, 16, 32, or 64 bytes, so choice 64.

The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize
set to 512. That is the only legal value for high speed bulk endpoints.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: expanded commit message
---
 drivers/usb/gadget/ether.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 700d5fb..988cffb 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -635,6 +635,7 @@ fs_source_desc = {
 
 	.bEndpointAddress =	USB_DIR_IN,
 	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(64),
 };
 
 static struct usb_endpoint_descriptor
@@ -644,6 +645,7 @@ fs_sink_desc = {
 
 	.bEndpointAddress =	USB_DIR_OUT,
 	.bmAttributes =		USB_ENDPOINT_XFER_BULK,
+	.wMaxPacketSize =	__constant_cpu_to_le16(64),
 };
 
 static const struct usb_descriptor_header *fs_eth_function[11] = {
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 04/17] usb: gadget: ether: return error from rx_submit if no request
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (2 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20 10:52   ` Marek Vasut
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 05/17] usb: gadget: mv_udc: split mv_udc.h file Troy Kisky
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

This prevents a crash if tftpboot is given a bad filename.

rx_req will be released by eth_reset_config
which is called by eth_disconnect,
which is called using the .disconnect member of usb_gadget_driver by mv_pullup in mv_udc
which is called using the .pullup member of usb_gadget_ops by usb_gadget_disconnect
which is called by usb_eth_halt
which is called using the .halt member of eth_device by eth_halt
which is called by TftpHandler when TFTP_ERR_FILE_NOT_FOUND or TFTP_ERR_ACCESS_DENIED occurs

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: expanded commit message
---
 drivers/usb/gadget/ether.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 988cffb..cc6cc1f 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1536,6 +1536,8 @@ static int rx_submit(struct eth_dev *dev, struct usb_request *req,
 	 */
 
 	debug("%s\n", __func__);
+	if (!req)
+		return -EINVAL;
 
 	size = (ETHER_HDR_SIZE + dev->mtu + RX_EXTRA);
 	size += dev->out_ep->maxpacket - 1;
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 05/17] usb: gadget: mv_udc: split mv_udc.h file
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (3 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 04/17] usb: gadget: ether: return error from rx_submit if no request Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file Troy Kisky
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Move defines only needed by mv_udc.c to a file
in the same directory.

This allows usbtty to compile for mv_udc,
but it still doesn't link.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: unchanged
---
 drivers/usb/gadget/mv_udc.c |   6 +++
 drivers/usb/gadget/mv_udc.h | 115 ++++++++++++++++++++++++++++++++++++++++++
 include/usb/mv_udc.h        | 118 --------------------------------------------
 3 files changed, 121 insertions(+), 118 deletions(-)
 create mode 100644 drivers/usb/gadget/mv_udc.h

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index b87119c..322c04f 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -13,9 +13,15 @@
 #include <config.h>
 #include <net.h>
 #include <malloc.h>
+#include <asm/byteorder.h>
 #include <asm/io.h>
+#include <asm/errno.h>
 #include <linux/types.h>
+#include <linux/usb/ch9.h>
+#include <linux/usb/gadget.h>
 #include <usb/mv_udc.h>
+#include "../host/ehci.h"
+#include "mv_udc.h"
 
 /*
  * Check if the system has too long cachelines. If the cachelines are
diff --git a/drivers/usb/gadget/mv_udc.h b/drivers/usb/gadget/mv_udc.h
new file mode 100644
index 0000000..c7d8b33
--- /dev/null
+++ b/drivers/usb/gadget/mv_udc.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2011, Marvell Semiconductor Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+#ifndef __GADGET__MV_UDC_H__
+#define __GADGET__MV_UDC_H__
+
+#define NUM_ENDPOINTS		6
+
+struct mv_udc {
+#define MICRO_8FRAME	0x8
+#define USBCMD_ITC(x)	((((x) > 0xff) ? 0xff : x) << 16)
+#define USBCMD_FS2	(1 << 15)
+#define USBCMD_RST	(1 << 1)
+#define USBCMD_RUN	(1)
+	u32 usbcmd;		/* 0x140 */
+#define STS_SLI		(1 << 8)
+#define STS_URI		(1 << 6)
+#define STS_PCI		(1 << 2)
+#define STS_UEI		(1 << 1)
+#define STS_UI		(1 << 0)
+	u32 usbsts;		/* 0x144 */
+	u32 pad1[3];
+	u32 devaddr;		/* 0x154 */
+	u32 epinitaddr;		/* 0x158 */
+	u32 pad2[10];
+#define PTS_ENABLE	2
+#define PTS(x)		(((x) & 0x3) << 30)
+#define PFSC		(1 << 24)
+	u32 portsc;		/* 0x184 */
+	u32 pad3[8];
+#define USBMODE_DEVICE	2
+	u32 usbmode;		/* 0x1a8 */
+	u32 epstat;		/* 0x1ac */
+#define EPT_TX(x)	(1 << (((x) & 0xffff) + 16))
+#define EPT_RX(x)	(1 << ((x) & 0xffff))
+	u32 epprime;		/* 0x1b0 */
+	u32 epflush;		/* 0x1b4 */
+	u32 pad4;
+	u32 epcomp;		/* 0x1bc */
+#define CTRL_TXE	(1 << 23)
+#define CTRL_TXR	(1 << 22)
+#define CTRL_RXE	(1 << 7)
+#define CTRL_RXR	(1 << 6)
+#define CTRL_TXT_BULK	(2 << 18)
+#define CTRL_RXT_BULK	(2 << 2)
+	u32 epctrl[16];		/* 0x1c0 */
+};
+
+struct mv_ep {
+	struct usb_ep ep;
+	struct list_head queue;
+	const struct usb_endpoint_descriptor *desc;
+
+	struct usb_request req;
+	uint8_t *b_buf;
+	uint32_t b_len;
+	uint8_t b_fast[64] __aligned(ARCH_DMA_MINALIGN);
+};
+
+struct mv_drv {
+	struct usb_gadget		gadget;
+	struct usb_gadget_driver	*driver;
+	struct ehci_ctrl		*ctrl;
+	struct ept_queue_head		*epts;
+	struct ept_queue_item		*items[2 * NUM_ENDPOINTS];
+	uint8_t				*items_mem;
+	struct mv_ep			ep[NUM_ENDPOINTS];
+};
+
+struct ept_queue_head {
+	unsigned config;
+	unsigned current;	/* read-only */
+
+	unsigned next;
+	unsigned info;
+	unsigned page0;
+	unsigned page1;
+	unsigned page2;
+	unsigned page3;
+	unsigned page4;
+	unsigned reserved_0;
+
+	unsigned char setup_data[8];
+
+	unsigned reserved_1;
+	unsigned reserved_2;
+	unsigned reserved_3;
+	unsigned reserved_4;
+};
+
+#define CONFIG_MAX_PKT(n)	((n) << 16)
+#define CONFIG_ZLT		(1 << 29)	/* stop on zero-len xfer */
+#define CONFIG_IOS		(1 << 15)	/* IRQ on setup */
+
+struct ept_queue_item {
+	unsigned next;
+	unsigned info;
+	unsigned page0;
+	unsigned page1;
+	unsigned page2;
+	unsigned page3;
+	unsigned page4;
+	unsigned reserved;
+};
+
+#define TERMINATE 1
+#define INFO_BYTES(n)		((n) << 16)
+#define INFO_IOC		(1 << 15)
+#define INFO_ACTIVE		(1 << 7)
+#define INFO_HALTED		(1 << 6)
+#define INFO_BUFFER_ERROR	(1 << 5)
+#define INFO_TX_ERROR		(1 << 3)
+#endif
diff --git a/include/usb/mv_udc.h b/include/usb/mv_udc.h
index c71516c..f6c7b5e 100644
--- a/include/usb/mv_udc.h
+++ b/include/usb/mv_udc.h
@@ -9,124 +9,6 @@
 #ifndef __MV_UDC_H__
 #define __MV_UDC_H__
 
-#include <asm/byteorder.h>
-#include <asm/errno.h>
-#include <linux/usb/ch9.h>
-#include <linux/usb/gadget.h>
-
-#include "../../drivers/usb/host/ehci.h"
-
-#define NUM_ENDPOINTS		6
-
-/* Endpoint parameters */
-#define MAX_ENDPOINTS		4
-
 #define EP_MAX_PACKET_SIZE	0x200
 #define EP0_MAX_PACKET_SIZE	64
-
-struct mv_udc {
-#define MICRO_8FRAME	0x8
-#define USBCMD_ITC(x)	((((x) > 0xff) ? 0xff : x) << 16)
-#define USBCMD_FS2	(1 << 15)
-#define USBCMD_RST	(1 << 1)
-#define USBCMD_RUN	(1)
-	u32 usbcmd;		/* 0x140 */
-#define STS_SLI		(1 << 8)
-#define STS_URI		(1 << 6)
-#define STS_PCI		(1 << 2)
-#define STS_UEI		(1 << 1)
-#define STS_UI		(1 << 0)
-	u32 usbsts;		/* 0x144 */
-	u32 pad1[3];
-	u32 devaddr;		/* 0x154 */
-	u32 epinitaddr;		/* 0x158 */
-	u32 pad2[10];
-#define PTS_ENABLE	2
-#define PTS(x)		(((x) & 0x3) << 30)
-#define PFSC		(1 << 24)
-	u32 portsc;		/* 0x184 */
-	u32 pad3[8];
-#define USBMODE_DEVICE	2
-	u32 usbmode;		/* 0x1a8 */
-	u32 epstat;		/* 0x1ac */
-#define EPT_TX(x)	(1 << (((x) & 0xffff) + 16))
-#define EPT_RX(x)	(1 << ((x) & 0xffff))
-	u32 epprime;		/* 0x1b0 */
-	u32 epflush;		/* 0x1b4 */
-	u32 pad4;
-	u32 epcomp;		/* 0x1bc */
-#define CTRL_TXE	(1 << 23)
-#define CTRL_TXR	(1 << 22)
-#define CTRL_RXE	(1 << 7)
-#define CTRL_RXR	(1 << 6)
-#define CTRL_TXT_BULK	(2 << 18)
-#define CTRL_RXT_BULK	(2 << 2)
-	u32 epctrl[16];		/* 0x1c0 */
-};
-
-struct mv_ep {
-	struct usb_ep ep;
-	struct list_head queue;
-	const struct usb_endpoint_descriptor *desc;
-
-	struct usb_request req;
-	uint8_t *b_buf;
-	uint32_t b_len;
-	uint8_t b_fast[64] __aligned(ARCH_DMA_MINALIGN);
-};
-
-struct mv_drv {
-	struct usb_gadget		gadget;
-	struct usb_gadget_driver	*driver;
-	struct ehci_ctrl		*ctrl;
-	struct ept_queue_head		*epts;
-	struct ept_queue_item		*items[2 * NUM_ENDPOINTS];
-	uint8_t				*items_mem;
-	struct mv_ep			ep[NUM_ENDPOINTS];
-};
-
-struct ept_queue_head {
-	unsigned config;
-	unsigned current;	/* read-only */
-
-	unsigned next;
-	unsigned info;
-	unsigned page0;
-	unsigned page1;
-	unsigned page2;
-	unsigned page3;
-	unsigned page4;
-	unsigned reserved_0;
-
-	unsigned char setup_data[8];
-
-	unsigned reserved_1;
-	unsigned reserved_2;
-	unsigned reserved_3;
-	unsigned reserved_4;
-};
-
-#define CONFIG_MAX_PKT(n)	((n) << 16)
-#define CONFIG_ZLT		(1 << 29)	/* stop on zero-len xfer */
-#define CONFIG_IOS		(1 << 15)	/* IRQ on setup */
-
-struct ept_queue_item {
-	unsigned next;
-	unsigned info;
-	unsigned page0;
-	unsigned page1;
-	unsigned page2;
-	unsigned page3;
-	unsigned page4;
-	unsigned reserved;
-};
-
-#define TERMINATE 1
-#define INFO_BYTES(n)		((n) << 16)
-#define INFO_IOC		(1 << 15)
-#define INFO_ACTIVE		(1 << 7)
-#define INFO_HALTED		(1 << 6)
-#define INFO_BUFFER_ERROR	(1 << 5)
-#define INFO_TX_ERROR		(1 << 3)
-
 #endif /* __MV_UDC_H__ */
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (4 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 05/17] usb: gadget: mv_udc: split mv_udc.h file Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20 10:55   ` Marek Vasut
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 07/17] usb: gadget: mv_udc: fix typo in error message Troy Kisky
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Move common definitions to udc.h
This allows musb_udc.h to be removed as well.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: updated commit message
removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
is the only legal value, it shouldn't be overridden.
---
 drivers/serial/usbtty.h             |  3 +-
 drivers/usb/gadget/designware_udc.c |  1 +
 drivers/usb/gadget/mpc8xx_udc.c     |  1 +
 drivers/usb/gadget/omap1510_udc.c   |  1 +
 drivers/usb/gadget/pxa27x_udc.c     |  1 +
 drivers/usb/musb/musb_udc.c         |  3 +-
 include/usb/designware_udc.h        | 31 -------------------
 include/usb/mpc8xx_udc.h            | 19 +-----------
 include/usb/musb_udc.h              | 40 ------------------------
 include/usb/omap1510_udc.h          | 27 ++--------------
 include/usb/pxa27x_udc.h            | 26 +---------------
 include/usb/udc.h                   | 61 +++++++++++++++++++++++++++++++++++++
 12 files changed, 73 insertions(+), 141 deletions(-)
 delete mode 100644 include/usb/musb_udc.h
 create mode 100644 include/usb/udc.h

diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h
index e243a8e..819dec6 100644
--- a/drivers/serial/usbtty.h
+++ b/drivers/serial/usbtty.h
@@ -16,8 +16,6 @@
 #include <usb/mpc8xx_udc.h>
 #elif defined(CONFIG_OMAP1510)
 #include <usb/omap1510_udc.h>
-#elif defined(CONFIG_MUSB_UDC)
-#include <usb/musb_udc.h>
 #elif defined(CONFIG_CPU_PXA27X)
 #include <usb/pxa27x_udc.h>
 #elif defined(CONFIG_DW_UDC)
@@ -26,6 +24,7 @@
 #include <usb/mv_udc.h>
 #endif
 
+#include <usb/udc.h>
 #include <version.h>
 
 /* If no VendorID/ProductID is defined in config.h, pretend to be Linux
diff --git a/drivers/usb/gadget/designware_udc.c b/drivers/usb/gadget/designware_udc.c
index 1aab31b..b7c1038 100644
--- a/drivers/usb/gadget/designware_udc.c
+++ b/drivers/usb/gadget/designware_udc.c
@@ -14,6 +14,7 @@
 #include <usbdevice.h>
 #include "ep0.h"
 #include <usb/designware_udc.h>
+#include <usb/udc.h>
 #include <asm/arch/hardware.h>
 
 #define UDC_INIT_MDELAY		80	/* Device settle delay */
diff --git a/drivers/usb/gadget/mpc8xx_udc.c b/drivers/usb/gadget/mpc8xx_udc.c
index 0207d39..7f72972 100644
--- a/drivers/usb/gadget/mpc8xx_udc.c
+++ b/drivers/usb/gadget/mpc8xx_udc.c
@@ -47,6 +47,7 @@
 #include <commproc.h>
 #include <usbdevice.h>
 #include <usb/mpc8xx_udc.h>
+#include <usb/udc.h>
 
 #include "ep0.h"
 
diff --git a/drivers/usb/gadget/omap1510_udc.c b/drivers/usb/gadget/omap1510_udc.c
index 8553fe5..bdc1b88 100644
--- a/drivers/usb/gadget/omap1510_udc.c
+++ b/drivers/usb/gadget/omap1510_udc.c
@@ -20,6 +20,7 @@
 #endif
 #include <usbdevice.h>
 #include <usb/omap1510_udc.h>
+#include <usb/udc.h>
 
 #include "ep0.h"
 
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 05d1b56..733558d 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -16,6 +16,7 @@
 #include <asm/arch/hardware.h>
 #include <asm/io.h>
 #include <usb/pxa27x_udc.h>
+#include <usb/udc.h>
 
 #include "ep0.h"
 
diff --git a/drivers/usb/musb/musb_udc.c b/drivers/usb/musb/musb_udc.c
index 3e3e05e..87640f4 100644
--- a/drivers/usb/musb/musb_udc.c
+++ b/drivers/usb/musb/musb_udc.c
@@ -39,7 +39,8 @@
  */
 
 #include <common.h>
-#include <usb/musb_udc.h>
+#include <usbdevice.h>
+#include <usb/udc.h>
 #include "../gadget/ep0.h"
 #include "musb_core.h"
 #if defined(CONFIG_USB_OMAP3)
diff --git a/include/usb/designware_udc.h b/include/usb/designware_udc.h
index 2e29a7e..2e1cdf1 100644
--- a/include/usb/designware_udc.h
+++ b/include/usb/designware_udc.h
@@ -174,19 +174,6 @@ struct udcfifo_regs {
 };
 
 /*
- * USBTTY definitions
- */
-#define  EP0_MAX_PACKET_SIZE		64
-#define  UDC_INT_ENDPOINT		1
-#define  UDC_INT_PACKET_SIZE		64
-#define  UDC_OUT_ENDPOINT		2
-#define  UDC_BULK_PACKET_SIZE		64
-#define  UDC_BULK_HS_PACKET_SIZE	512
-#define  UDC_IN_ENDPOINT		3
-#define  UDC_OUT_PACKET_SIZE		64
-#define  UDC_IN_PACKET_SIZE		64
-
-/*
  * UDC endpoint definitions
  */
 #define  UDC_EP0			0
@@ -194,22 +181,4 @@ struct udcfifo_regs {
 #define  UDC_EP2			2
 #define  UDC_EP3			3
 
-/*
- * Function declarations
- */
-
-void udc_irq(void);
-
-void udc_set_nak(int epid);
-void udc_unset_nak(int epid);
-int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
-int udc_init(void);
-void udc_enable(struct usb_device_instance *device);
-void udc_disable(void);
-void udc_connect(void);
-void udc_disconnect(void);
-void udc_startup_events(struct usb_device_instance *device);
-void udc_setup_ep(struct usb_device_instance *device, unsigned int ep,
-		  struct usb_endpoint_instance *endpoint);
-
 #endif /* __DW_UDC_H */
diff --git a/include/usb/mpc8xx_udc.h b/include/usb/mpc8xx_udc.h
index 475dd41..9906c75 100644
--- a/include/usb/mpc8xx_udc.h
+++ b/include/usb/mpc8xx_udc.h
@@ -111,11 +111,9 @@
 
 /* UDC device defines */
 #define EP0_MAX_PACKET_SIZE	EP_MAX_PKT
-#define UDC_OUT_ENDPOINT	0x02
+
 #define UDC_OUT_PACKET_SIZE	EP_MIN_PACKET_SIZE
-#define UDC_IN_ENDPOINT		0x03
 #define UDC_IN_PACKET_SIZE	EP_MIN_PACKET_SIZE
-#define UDC_INT_ENDPOINT	0x01
 #define UDC_INT_PACKET_SIZE	UDC_IN_PACKET_SIZE
 #define UDC_BULK_PACKET_SIZE	EP_MIN_PACKET_SIZE
 
@@ -178,18 +176,3 @@ typedef enum mpc8xx_udc_state{
 	STATE_READY,
 }mpc8xx_udc_state_t;
 
-/* Declarations */
-int udc_init(void);
-void udc_irq(void);
-int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
-void udc_setup_ep(struct usb_device_instance *device, unsigned int ep,
-		  struct usb_endpoint_instance *endpoint);
-void udc_connect(void);
-void udc_disconnect(void);
-void udc_enable(struct usb_device_instance *device);
-void udc_disable(void);
-void udc_startup_events(struct usb_device_instance *device);
-
-/* Flow control */
-void udc_set_nak(int epid);
-void udc_unset_nak (int epid);
diff --git a/include/usb/musb_udc.h b/include/usb/musb_udc.h
deleted file mode 100644
index 3500c7a..0000000
--- a/include/usb/musb_udc.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2009 Wind River Systems, Inc.
- * Tom Rix <Tom.Rix@windriver.com>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-#ifndef __MUSB_UDC_H__
-#define __MUSB_UDC_H__
-
-#include <usbdevice.h>
-
-/* UDC level routines */
-void udc_irq(void);
-void udc_set_nak(int ep_num);
-void udc_unset_nak(int ep_num);
-int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
-void udc_setup_ep(struct usb_device_instance *device, unsigned int id,
-		  struct usb_endpoint_instance *endpoint);
-void udc_connect(void);
-void udc_disconnect(void);
-void udc_enable(struct usb_device_instance *device);
-void udc_disable(void);
-void udc_startup_events(struct usb_device_instance *device);
-int udc_init(void);
-
-/* usbtty */
-#ifdef CONFIG_USB_TTY
-
-#define EP0_MAX_PACKET_SIZE	64 /* MUSB_EP0_FIFOSIZE */
-#define UDC_INT_ENDPOINT	1
-#define UDC_INT_PACKET_SIZE	64
-#define UDC_OUT_ENDPOINT	2
-#define UDC_OUT_PACKET_SIZE	64
-#define UDC_IN_ENDPOINT		3
-#define UDC_IN_PACKET_SIZE	64
-#define UDC_BULK_PACKET_SIZE	64
-
-#endif /* CONFIG_USB_TTY */
-
-#endif /* __MUSB_UDC_H__ */
diff --git a/include/usb/omap1510_udc.h b/include/usb/omap1510_udc.h
index ece0e95..934930b 100644
--- a/include/usb/omap1510_udc.h
+++ b/include/usb/omap1510_udc.h
@@ -162,32 +162,11 @@
 #define UDC_VBUS_MODE	    (1 << 18)
 
 /* OMAP Endpoint parameters */
-#define EP0_MAX_PACKET_SIZE 64
-#define UDC_OUT_ENDPOINT 2
-#define UDC_OUT_PACKET_SIZE 64
-#define UDC_IN_ENDPOINT	1
-#define UDC_IN_PACKET_SIZE 64
-#define UDC_INT_ENDPOINT 5
 #define UDC_INT_PACKET_SIZE	16
 #define UDC_BULK_PACKET_SIZE 16
 
-void udc_irq (void);
-/* Flow control */
-void udc_set_nak(int epid);
-void udc_unset_nak (int epid);
-
-/* Higher level functions for abstracting away from specific device */
-int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
-
-int  udc_init (void);
-
-void udc_enable(struct usb_device_instance *device);
-void udc_disable(void);
-
-void udc_connect(void);
-void udc_disconnect(void);
-
-void udc_startup_events(struct usb_device_instance *device);
-void udc_setup_ep(struct usb_device_instance *device, unsigned int ep, struct usb_endpoint_instance *endpoint);
+#define UDC_INT_ENDPOINT 5
+#define UDC_OUT_ENDPOINT 2
+#define UDC_IN_ENDPOINT	1
 
 #endif
diff --git a/include/usb/pxa27x_udc.h b/include/usb/pxa27x_udc.h
index 7fdbe2a..7eaa000 100644
--- a/include/usb/pxa27x_udc.h
+++ b/include/usb/pxa27x_udc.h
@@ -22,35 +22,11 @@
 
 /* Endpoint parameters */
 #define MAX_ENDPOINTS		4
-#define EP_MAX_PACKET_SIZE	64
 
 #define EP0_MAX_PACKET_SIZE     16
+
 #define UDC_OUT_ENDPOINT        0x02
-#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
 #define UDC_IN_ENDPOINT         0x01
-#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
 #define UDC_INT_ENDPOINT        0x05
-#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
-#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
-
-void udc_irq(void);
-/* Flow control */
-void udc_set_nak(int epid);
-void udc_unset_nak(int epid);
-
-/* Higher level functions for abstracting away from specific device */
-int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
-
-int  udc_init(void);
-
-void udc_enable(struct usb_device_instance *device);
-void udc_disable(void);
-
-void udc_connect(void);
-void udc_disconnect(void);
-
-void udc_startup_events(struct usb_device_instance *device);
-void udc_setup_ep(struct usb_device_instance *device,
-	 unsigned int ep, struct usb_endpoint_instance *endpoint);
 
 #endif
diff --git a/include/usb/udc.h b/include/usb/udc.h
new file mode 100644
index 0000000..3bcbbbc
--- /dev/null
+++ b/include/usb/udc.h
@@ -0,0 +1,61 @@
+/*
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+#ifndef USB_UDC_H
+#define USB_UDC_H
+
+#ifndef EP0_MAX_PACKET_SIZE
+#define EP0_MAX_PACKET_SIZE     64
+#endif
+
+#ifndef EP_MAX_PACKET_SIZE
+#define EP_MAX_PACKET_SIZE	64
+#endif
+
+#ifndef UDC_OUT_PACKET_SIZE
+#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
+#endif
+
+#ifndef UDC_IN_PACKET_SIZE
+#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
+#endif
+
+#ifndef UDC_INT_PACKET_SIZE
+#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
+#endif
+
+#ifndef UDC_BULK_PACKET_SIZE
+#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
+#endif
+
+#define UDC_BULK_HS_PACKET_SIZE	512
+
+#ifndef UDC_INT_ENDPOINT
+#define UDC_INT_ENDPOINT	1
+#endif
+
+#ifndef UDC_OUT_ENDPOINT
+#define UDC_OUT_ENDPOINT	2
+#endif
+
+#ifndef UDC_IN_ENDPOINT
+#define UDC_IN_ENDPOINT		3
+#endif
+
+/* function declarations */
+int udc_init(void);
+void udc_irq(void);
+int udc_endpoint_write(struct usb_endpoint_instance *endpoint);
+void udc_setup_ep(struct usb_device_instance *device, unsigned int ep,
+		  struct usb_endpoint_instance *endpoint);
+void udc_connect(void);
+void udc_disconnect(void);
+void udc_enable(struct usb_device_instance *device);
+void udc_disable(void);
+void udc_startup_events(struct usb_device_instance *device);
+
+/* Flow control */
+void udc_set_nak(int epid);
+void udc_unset_nak(int epid);
+
+#endif
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 07/17] usb: gadget: mv_udc: fix typo in error message
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (5 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 08/17] usb: gadget: mv_udc: set is_dualspeed = 1 Troy Kisky
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Change 'nfo=' to 'info='

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: no change
---
 drivers/usb/gadget/mv_udc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index 322c04f..cc21306 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -368,8 +368,8 @@ static void handle_ep_complete(struct mv_ep *ep)
 	mv_invalidate_qtd(num);
 	
 	if (item->info & 0xff)
-		printf("EP%d/%s FAIL nfo=%x pg0=%x\n",
-			num, in ? "in" : "out", item->info, item->page0);
+		printf("EP%d/%s FAIL info=%x pg0=%x\n",
+		       num, in ? "in" : "out", item->info, item->page0);
 
 	len = (item->info >> 16) & 0x7fff;
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 08/17] usb: gadget: mv_udc: set is_dualspeed = 1
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (6 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 07/17] usb: gadget: mv_udc: fix typo in error message Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 09/17] usb: gadget: mv_udc: fix full speed connections Troy Kisky
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

This controller support full and high speed.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: no change
---
 drivers/usb/gadget/mv_udc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index cc21306..b04ac47 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -109,6 +109,7 @@ static struct mv_drv controller = {
 	.gadget	= {
 		.name	= "mv_udc",
 		.ops	= &mv_udc_ops,
+		.is_dualspeed = 1,
 	},
 };
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 09/17] usb: gadget: mv_udc: fix full speed connections
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (7 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 08/17] usb: gadget: mv_udc: set is_dualspeed = 1 Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce Troy Kisky
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Set maximum packet length in queue header to wMaxPacketSize
of endpoint.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: no change
---
 drivers/usb/gadget/mv_udc.c | 48 ++++++++++++++++++++++++++++++++-------------
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index b04ac47..c2df749 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -16,6 +16,7 @@
 #include <asm/byteorder.h>
 #include <asm/io.h>
 #include <asm/errno.h>
+#include <asm/unaligned.h>
 #include <linux/types.h>
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
@@ -213,7 +214,7 @@ static void mv_ep_free_request(struct usb_ep *ep, struct usb_request *_req)
 	return;
 }
 
-static void ep_enable(int num, int in)
+static void ep_enable(int num, int in, int maxpacket)
 {
 	struct ept_queue_head *head;
 	struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor;
@@ -227,7 +228,7 @@ static void ep_enable(int num, int in)
 		n |= (CTRL_RXE | CTRL_RXR | CTRL_RXT_BULK);
 
 	if (num != 0) {
-		head->config = CONFIG_MAX_PKT(EP_MAX_PACKET_SIZE) | CONFIG_ZLT;
+		head->config = CONFIG_MAX_PKT(maxpacket) | CONFIG_ZLT;
 		mv_flush_qh(num);
 	}
 	writel(n, &udc->epctrl[num]);
@@ -240,8 +241,21 @@ static int mv_ep_enable(struct usb_ep *ep,
 	int num, in;
 	num = desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
 	in = (desc->bEndpointAddress & USB_DIR_IN) != 0;
-	ep_enable(num, in);
 	mv_ep->desc = desc;
+
+	if (num) {
+		int max = get_unaligned_le16(&desc->wMaxPacketSize);
+
+		if ((max > 64) && (controller.gadget.speed == USB_SPEED_FULL))
+			max = 64;
+		if (ep->maxpacket != max) {
+			DBG("%s: from %d to %d\n", __func__,
+			    ep->maxpacket, max);
+			ep->maxpacket = max;
+		}
+	}
+	ep_enable(num, in, ep->maxpacket);
+	DBG("%s: num=%d maxpacket=%d\n", __func__, num, ep->maxpacket);
 	return 0;
 }
 
@@ -414,14 +428,16 @@ static void handle_setup(void)
 		if ((r.wValue == 0) && (r.wLength == 0)) {
 			req->length = 0;
 			for (i = 0; i < NUM_ENDPOINTS; i++) {
-				if (!controller.ep[i].desc)
+				struct mv_ep *ep = &controller.ep[i];
+
+				if (!ep->desc)
 					continue;
-				num = controller.ep[i].desc->bEndpointAddress
+				num = ep->desc->bEndpointAddress
 						& USB_ENDPOINT_NUMBER_MASK;
-				in = (controller.ep[i].desc->bEndpointAddress
+				in = (ep->desc->bEndpointAddress
 						& USB_DIR_IN) != 0;
 				if ((num == _num) && (in == _in)) {
-					ep_enable(num, in);
+					ep_enable(num, in, ep->ep.maxpacket);
 					usb_ep_queue(controller.gadget.ep0,
 							req, 0);
 					break;
@@ -505,15 +521,19 @@ void udc_irq(void)
 		DBG("-- suspend --\n");
 
 	if (n & STS_PCI) {
-		DBG("-- portchange --\n");
+		int max = 64;
+		int speed = USB_SPEED_FULL;
+
 		bit = (readl(&udc->portsc) >> 26) & 3;
+		DBG("-- portchange %x %s\n", bit, (bit == 2) ? "High" : "Full");
 		if (bit == 2) {
-			controller.gadget.speed = USB_SPEED_HIGH;
-			for (i = 1; i < NUM_ENDPOINTS && n; i++)
-				if (controller.ep[i].desc)
-					controller.ep[i].ep.maxpacket = 512;
-		} else {
-			controller.gadget.speed = USB_SPEED_FULL;
+			speed = USB_SPEED_HIGH;
+			max = 512;
+		}
+		controller.gadget.speed = speed;
+		for (i = 1; i < NUM_ENDPOINTS; i++) {
+			if (controller.ep[i].ep.maxpacket > max)
+				controller.ep[i].ep.maxpacket = max;
 		}
 	}
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (8 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 09/17] usb: gadget: mv_udc: fix full speed connections Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20 10:58   ` Marek Vasut
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 11/17] usb: gadget: mv_udc: flush item before head Troy Kisky
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Only perform one copy, either in the bounce
routine for IN transfers, or the debounce
rtn for OUT transfer.

On out transfers, only copy the number
of bytes received from the bounce buffer

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: no change
---
 drivers/usb/gadget/mv_udc.c | 37 ++++++++++++++++---------------------
 1 file changed, 16 insertions(+), 21 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index c2df749..97bab93 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -264,7 +264,7 @@ static int mv_ep_disable(struct usb_ep *ep)
 	return 0;
 }
 
-static int mv_bounce(struct mv_ep *ep)
+static int mv_bounce(struct mv_ep *ep, int in)
 {
 	uint32_t addr = (uint32_t)ep->req.buf;
 	uint32_t ba;
@@ -293,8 +293,8 @@ align:
 		if (!ep->b_buf)
 			return -ENOMEM;
 	}
-
-	memcpy(ep->b_buf, ep->req.buf, ep->req.length);
+	if (in)
+		memcpy(ep->b_buf, ep->req.buf, ep->req.length);
 
 flush:
 	ba = (uint32_t)ep->b_buf;
@@ -303,29 +303,25 @@ flush:
 	return 0;
 }
 
-static void mv_debounce(struct mv_ep *ep)
+static void mv_debounce(struct mv_ep *ep, int in)
 {
 	uint32_t addr = (uint32_t)ep->req.buf;
 	uint32_t ba = (uint32_t)ep->b_buf;
 
+	if (in) {
+		if (addr == ba)
+			return;		/* not a bounce */
+		goto free;
+	}
 	invalidate_dcache_range(ba, ba + ep->b_len);
 
-	/* Input buffer address is not aligned. */
-	if (addr & (ARCH_DMA_MINALIGN - 1))
-		goto copy;
-
-	/* Input buffer length is not aligned. */
-	if (ep->req.length & (ARCH_DMA_MINALIGN - 1))
-		goto copy;
-
-	/* The buffer is well aligned, only invalidate cache. */
-	return;
+	if (addr == ba)
+		return;		/* not a bounce */
 
-copy:
 	memcpy(ep->req.buf, ep->b_buf, ep->req.length);
-
+free:
 	/* Large payloads use allocated buffer, free it. */
-	if (ep->req.length > 64)
+	if (ep->b_buf != ep->b_fast)
 		free(ep->b_buf);
 }
 
@@ -343,7 +339,7 @@ static int mv_ep_queue(struct usb_ep *ep,
 	head = mv_get_qh(num, in);
 	len = req->length;
 
-	ret = mv_bounce(mv_ep);
+	ret = mv_bounce(mv_ep, in);
 	if (ret)
 		return ret;
 
@@ -387,10 +383,9 @@ static void handle_ep_complete(struct mv_ep *ep)
 		       num, in ? "in" : "out", item->info, item->page0);
 
 	len = (item->info >> 16) & 0x7fff;
-
-	mv_debounce(ep);
-
 	ep->req.length -= len;
+	mv_debounce(ep, in);
+
 	DBG("ept%d %s complete %x\n",
 			num, in ? "in" : "out", len);
 	ep->req.complete(&ep->ep, &ep->req);
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 11/17] usb: gadget: mv_udc: flush item before head
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (9 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 12/17] usb: gadget: mv_udc: optimize ep_enable Troy Kisky
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Make sure the transfer descriptor is flushed
before the queue is updated so that the controller
will not see old information.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: no change
---
 drivers/usb/gadget/mv_udc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index 97bab93..075b039 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -347,21 +347,20 @@ static int mv_ep_queue(struct usb_ep *ep,
 	item->info = INFO_BYTES(len) | INFO_IOC | INFO_ACTIVE;
 	item->page0 = (uint32_t)mv_ep->b_buf;
 	item->page1 = ((uint32_t)mv_ep->b_buf & 0xfffff000) + 0x1000;
+	mv_flush_qtd(num);
 
 	head->next = (unsigned) item;
 	head->info = 0;
 
 	DBG("ept%d %s queue len %x, buffer %p\n",
 	    num, in ? "in" : "out", len, mv_ep->b_buf);
+	mv_flush_qh(num);
 
 	if (in)
 		bit = EPT_TX(num);
 	else
 		bit = EPT_RX(num);
 
-	mv_flush_qh(num);
-	mv_flush_qtd(num);
-
 	writel(bit, &udc->epprime);
 
 	return 0;
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 12/17] usb: gadget: mv_udc: optimize ep_enable
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (10 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 11/17] usb: gadget: mv_udc: flush item before head Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 13/17] usb: gadget: mv_udc: zero transfer descriptor memory on probe Troy Kisky
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Only get head if not ep0.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: no change
---
 drivers/usb/gadget/mv_udc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index 075b039..995585d 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -216,10 +216,8 @@ static void mv_ep_free_request(struct usb_ep *ep, struct usb_request *_req)
 
 static void ep_enable(int num, int in, int maxpacket)
 {
-	struct ept_queue_head *head;
 	struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor;
 	unsigned n;
-	head = mv_get_qh(num, in);
 
 	n = readl(&udc->epctrl[num]);
 	if (in)
@@ -228,6 +226,8 @@ static void ep_enable(int num, int in, int maxpacket)
 		n |= (CTRL_RXE | CTRL_RXR | CTRL_RXT_BULK);
 
 	if (num != 0) {
+		struct ept_queue_head *head = mv_get_qh(num, in);
+
 		head->config = CONFIG_MAX_PKT(maxpacket) | CONFIG_ZLT;
 		mv_flush_qh(num);
 	}
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 13/17] usb: gadget: mv_udc: zero transfer descriptor memory on probe
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (11 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 12/17] usb: gadget: mv_udc: optimize ep_enable Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 14/17] usb: gadget: mv_udc: clear desc upon ep_disable Troy Kisky
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Since we flush the TD, we may as well set it to a known value.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: no change
---
 drivers/usb/gadget/mv_udc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index 995585d..ea296cc 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -643,6 +643,7 @@ static int mvudc_probe(void)
 		free(controller.epts);
 		return -ENOMEM;
 	}
+	memset(controller.items_mem, 0, ilist_sz);
 
 	for (i = 0; i < 2 * NUM_ENDPOINTS; i++) {
 		/*
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 14/17] usb: gadget: mv_udc: clear desc upon ep_disable
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (12 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 13/17] usb: gadget: mv_udc: zero transfer descriptor memory on probe Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 15/17] mx6: iomux: add GPR1 defines for use with nitrogen6x Troy Kisky
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

desc is set at ep_enable, so for symmetry,
clear it at ep_disable.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

v4: no change
---
 drivers/usb/gadget/mv_udc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index ea296cc..766df7f 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -261,6 +261,9 @@ static int mv_ep_enable(struct usb_ep *ep,
 
 static int mv_ep_disable(struct usb_ep *ep)
 {
+	struct mv_ep *mv_ep = container_of(ep, struct mv_ep, ep);
+
+	mv_ep->desc = NULL;
 	return 0;
 }
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 15/17] mx6: iomux: add GPR1 defines for use with nitrogen6x
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (13 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 14/17] usb: gadget: mv_udc: clear desc upon ep_disable Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 16/17] nitrogen6x: add otg usb host/device mode support Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 17/17] nitrogen6x: add CONFIG_MV_UDC Troy Kisky
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Select GPIO1 as the USB OTG ID pin for Nitrogen6x

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: move the Nitrogen6x bits into this patch as well
---
 arch/arm/include/asm/arch-mx6/iomux.h  | 6 ++++++
 board/boundary/nitrogen6x/nitrogen6x.c | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/arch/arm/include/asm/arch-mx6/iomux.h b/arch/arm/include/asm/arch-mx6/iomux.h
index f4cfd4f..9e6d40f 100644
--- a/arch/arm/include/asm/arch-mx6/iomux.h
+++ b/arch/arm/include/asm/arch-mx6/iomux.h
@@ -10,6 +10,12 @@
 #define MX6_IOMUXC_GPR7		0x020e001c
 
 /*
+ * IOMUXC_GPR1 bit fields
+ */
+#define IOMUXC_GPR1_OTG_ID_ENET_RX_ERR	(0<<13)
+#define IOMUXC_GPR1_OTG_ID_GPIO1	(1<<13)
+#define IOMUXC_GPR1_OTG_ID_MASK		(1<<13)
+/*
  * IOMUXC_GPR13 bit fields
  */
 #define IOMUXC_GPR13_SDMA_STOP_REQ	(1<<30)
diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c
index f664f6d..c6efafc 100644
--- a/board/boundary/nitrogen6x/nitrogen6x.c
+++ b/board/boundary/nitrogen6x/nitrogen6x.c
@@ -704,6 +704,13 @@ int overwrite_console(void)
 
 int board_init(void)
 {
+	struct iomuxc_base_regs *const iomuxc_regs
+		= (struct iomuxc_base_regs *)IOMUXC_BASE_ADDR;
+
+	clrsetbits_le32(&iomuxc_regs->gpr[1],
+			IOMUXC_GPR1_OTG_ID_MASK,
+			IOMUXC_GPR1_OTG_ID_GPIO1);
+
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 16/17] nitrogen6x: add otg usb host/device mode support
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (14 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 15/17] mx6: iomux: add GPR1 defines for use with nitrogen6x Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  2013-09-20  4:08   ` Troy Kisky
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 17/17] nitrogen6x: add CONFIG_MV_UDC Troy Kisky
  16 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: similar to Nitrogen6x: add otg usb ethernet gadget support
But I added pad setup for over current, otg_id, and power control
Added board_ehci_power function to enable power for host mode.
Removed otg_id selection done now in previous patch.
---
 board/boundary/nitrogen6x/nitrogen6x.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c
index c6efafc..9b07846 100644
--- a/board/boundary/nitrogen6x/nitrogen6x.c
+++ b/board/boundary/nitrogen6x/nitrogen6x.c
@@ -30,6 +30,7 @@
 #include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
+#define GP_USB_OTG_PWR	IMX_GPIO_NR(3, 22)
 
 #define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |			\
 	PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |			\
@@ -179,6 +180,14 @@ iomux_v3_cfg_t const enet_pads2[] = {
 	MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL	| MUX_PAD_CTRL(ENET_PAD_CTRL),
 };
 
+static iomux_v3_cfg_t const misc_pads[] = {
+	MX6_PAD_GPIO_1__USBOTG_ID		| MUX_PAD_CTRL(WEAK_PULLUP),
+	MX6_PAD_KEY_COL4__USBOH3_USBOTG_OC	| MUX_PAD_CTRL(WEAK_PULLUP),
+	MX6_PAD_EIM_D30__USBOH3_USBH1_OC	| MUX_PAD_CTRL(WEAK_PULLUP),
+	/* OTG Power enable */
+	MX6_PAD_EIM_D22__GPIO_3_22		| MUX_PAD_CTRL(OUTPUT_40OHM),
+};
+
 /* wl1271 pads on nitrogen6x */
 iomux_v3_cfg_t const wl12xx_pads[] = {
 	(MX6_PAD_NANDF_CS1__GPIO_6_14 & ~MUX_PAD_CTRL_MASK)
@@ -250,6 +259,15 @@ int board_ehci_hcd_init(int port)
 
 	return 0;
 }
+
+int board_ehci_power(int port, int on)
+{
+	if (port)
+		return 0;
+	gpio_set_value(GP_USB_OTG_PWR, on);
+	return 0;
+}
+
 #endif
 
 #ifdef CONFIG_FSL_ESDHC
@@ -369,6 +387,11 @@ int board_eth_init(bd_t *bis)
 		free(bus);
 	}
 #endif
+
+#ifdef CONFIG_MV_UDC
+	/* For otg ethernet*/
+	usb_eth_initialize(bis);
+#endif
 	return 0;
 }
 
@@ -683,6 +706,7 @@ int board_early_init_f(void)
 	gpio_direction_input(WL12XX_WL_IRQ_GP);
 	gpio_direction_output(WL12XX_WL_ENABLE_GP, 0);
 	gpio_direction_output(WL12XX_BT_ENABLE_GP, 0);
+	gpio_direction_output(GP_USB_OTG_PWR, 0); /* OTG power off */
 
 	imx_iomux_v3_setup_multiple_pads(wl12xx_pads, ARRAY_SIZE(wl12xx_pads));
 	setup_buttons();
@@ -711,6 +735,8 @@ int board_init(void)
 			IOMUXC_GPR1_OTG_ID_MASK,
 			IOMUXC_GPR1_OTG_ID_GPIO1);
 
+	imx_iomux_v3_setup_multiple_pads(misc_pads, ARRAY_SIZE(misc_pads));
+
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 17/17] nitrogen6x: add CONFIG_MV_UDC
  2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
                   ` (15 preceding siblings ...)
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 16/17] nitrogen6x: add otg usb host/device mode support Troy Kisky
@ 2013-09-20  3:29 ` Troy Kisky
  16 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  3:29 UTC (permalink / raw)
  To: u-boot

Also, add other USB related config items.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

---
v4: Updated commit message
---
 include/configs/nitrogen6x.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index b1ca91e..06f173e 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -30,6 +30,12 @@
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_MISC_INIT_R
 #define CONFIG_MXC_GPIO
+#define CONFIG_MV_UDC
+#define CONFIG_USBD_HS
+#define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_ETHER
+#define CONFIG_USB_ETH_CDC
+#define CONFIG_NETCONSOLE
 
 #define CONFIG_CMD_FUSE
 #ifdef CONFIG_CMD_FUSE
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 16/17] nitrogen6x: add otg usb host/device mode support
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 16/17] nitrogen6x: add otg usb host/device mode support Troy Kisky
@ 2013-09-20  4:08   ` Troy Kisky
  0 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20  4:08 UTC (permalink / raw)
  To: u-boot

On 9/19/2013 8:29 PM, Troy Kisky wrote:
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>
> ---
> v4: similar to Nitrogen6x: add otg usb ethernet gadget support
> But I added pad setup for over current, otg_id, and power control
> Added board_ehci_power function to enable power for host mode.
> Removed otg_id selection done now in previous patch.
> ---
>   board/boundary/nitrogen6x/nitrogen6x.c | 26 ++++++++++++++++++++++++++
>   1 file changed, 26 insertions(+)
>
> diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c
> index c6efafc..9b07846 100644
> --- a/board/boundary/nitrogen6x/nitrogen6x.c
> +++ b/board/boundary/nitrogen6x/nitrogen6x.c
> @@ -30,6 +30,7 @@
>   #include <i2c.h>
>   
>   DECLARE_GLOBAL_DATA_PTR;
> +#define GP_USB_OTG_PWR	IMX_GPIO_NR(3, 22)
>   
>   #define UART_PAD_CTRL  (PAD_CTL_PUS_100K_UP |			\
>   	PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm |			\
> @@ -179,6 +180,14 @@ iomux_v3_cfg_t const enet_pads2[] = {
>   	MX6_PAD_RGMII_RX_CTL__RGMII_RX_CTL	| MUX_PAD_CTRL(ENET_PAD_CTRL),
>   };
>   
> +static iomux_v3_cfg_t const misc_pads[] = {
> +	MX6_PAD_GPIO_1__USBOTG_ID		| MUX_PAD_CTRL(WEAK_PULLUP),
> +	MX6_PAD_KEY_COL4__USBOH3_USBOTG_OC	| MUX_PAD_CTRL(WEAK_PULLUP),
> +	MX6_PAD_EIM_D30__USBOH3_USBH1_OC	| MUX_PAD_CTRL(WEAK_PULLUP),
> +	/* OTG Power enable */
> +	MX6_PAD_EIM_D22__GPIO_3_22		| MUX_PAD_CTRL(OUTPUT_40OHM),
> +};
> +
MX6_PAD_GPIO_1__USBOTG_ID is undefined, so please skip this patch and 
let me correct.

The was defined in a patch by Eric that I missed including.

Thanks

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT Troy Kisky
@ 2013-09-20 10:45   ` Marek Vasut
  2013-09-20 18:18     ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 10:45 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> i.mx6 has 1 otg controller, and 3 host ports. So,
> CONFIG_USB_MAX_CONTROLLER_COUNT can be greater than 1
> even though only 1 device mode controller is supported.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> 

The problem is, will the 3 additional ports still work? I suspect they will, but 
then if you run 'usb reset', the gadget port will also be switched back into USB 
Host function, no

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 02/17] usb: ehci-mx6: add support for host mode otg port
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 02/17] usb: ehci-mx6: add support for host mode otg port Troy Kisky
@ 2013-09-20 10:51   ` Marek Vasut
  2013-09-20 18:27     ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 10:51 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> Previously, only host1 was supported using an index of 0.
> Now, otg has index 0, host1 is 1, host2 is 2, host3 is 3.
> Since OTG requires usbmode to be set after reset, I added
> a weak function ehci_hcd_init_after_reset to handle this,
> and removed it from ehci_hcd_init. I also added a weak
> function board_ehci_power to handle turning power on/off
> for otg.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> 
> ---
> V4: new patch, replaces "usb: gadget: mv_udc: fix hardware udc address for
> i.MX6" and has the bonus of giving OTG host mode support
> ---

Would it be a problem to implement this in ehci_hcd_init() call instead of 
adding a new call?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 04/17] usb: gadget: ether: return error from rx_submit if no request
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 04/17] usb: gadget: ether: return error from rx_submit if no request Troy Kisky
@ 2013-09-20 10:52   ` Marek Vasut
  0 siblings, 0 replies; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 10:52 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> This prevents a crash if tftpboot is given a bad filename.
> 
> rx_req will be released by eth_reset_config
> which is called by eth_disconnect,
> which is called using the .disconnect member of usb_gadget_driver by
> mv_pullup in mv_udc which is called using the .pullup member of
> usb_gadget_ops by usb_gadget_disconnect which is called by usb_eth_halt
> which is called using the .halt member of eth_device by eth_halt
> which is called by TftpHandler when TFTP_ERR_FILE_NOT_FOUND or
> TFTP_ERR_ACCESS_DENIED occurs
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> 

How do I trigger this? It'd be nice to have a test-case in the commit message.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize Troy Kisky
@ 2013-09-20 10:52   ` Marek Vasut
  2013-09-20 18:34     ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 10:52 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> set wMaxPacketSize for full speed descriptors
> fs_source_desc, fs_sink_desc to 64.
> 
> Full-speed bulk endpoint can have a maximum packet size of
> 8, 16, 32, or 64 bytes, so choice 64.
> 
> The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize
> set to 512. That is the only legal value for high speed bulk endpoints.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>

Why do we need this patch? What issue does this fix ?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file Troy Kisky
@ 2013-09-20 10:55   ` Marek Vasut
  2013-09-20 18:46     ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 10:55 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> Move common definitions to udc.h
> This allows musb_udc.h to be removed as well.
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> 
> ---
> v4: updated commit message
> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
> is the only legal value, it shouldn't be overridden.

[...]

>  #endif
> diff --git a/include/usb/udc.h b/include/usb/udc.h
> new file mode 100644
> index 0000000..3bcbbbc
> --- /dev/null
> +++ b/include/usb/udc.h
> @@ -0,0 +1,61 @@
> +/*
> + * SPDX-License-Identifier:	GPL-2.0+
> + */
> +#ifndef USB_UDC_H
> +#define USB_UDC_H
> +
> +#ifndef EP0_MAX_PACKET_SIZE
> +#define EP0_MAX_PACKET_SIZE     64
> +#endif
> +
> +#ifndef EP_MAX_PACKET_SIZE
> +#define EP_MAX_PACKET_SIZE	64
> +#endif
> +
> +#ifndef UDC_OUT_PACKET_SIZE
> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> +#endif
> +
> +#ifndef UDC_IN_PACKET_SIZE
> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
> +#endif
> +
> +#ifndef UDC_INT_PACKET_SIZE
> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> +#endif
> +
> +#ifndef UDC_BULK_PACKET_SIZE
> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
> +#endif

Do you expect these values to change on per-controller basis? Or why do you have 
these ifndefs here ?

> +#define UDC_BULK_HS_PACKET_SIZE	512
> +
> +#ifndef UDC_INT_ENDPOINT
> +#define UDC_INT_ENDPOINT	1
> +#endif
> +
> +#ifndef UDC_OUT_ENDPOINT
> +#define UDC_OUT_ENDPOINT	2
> +#endif
> +
> +#ifndef UDC_IN_ENDPOINT
> +#define UDC_IN_ENDPOINT		3
> +#endif

[...]

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce
  2013-09-20  3:29 ` [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce Troy Kisky
@ 2013-09-20 10:58   ` Marek Vasut
  2013-09-20 18:58     ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 10:58 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> Only perform one copy, either in the bounce
> routine for IN transfers, or the debounce
> rtn for OUT transfer.
> 
> On out transfers, only copy the number
> of bytes received from the bounce buffer
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> 
> ---
> v4: no change

Just a question here. Are you sure we never Send AND Reserve the data in one 
turn? Because that would need two copyings.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT
  2013-09-20 10:45   ` Marek Vasut
@ 2013-09-20 18:18     ` Troy Kisky
  2013-09-23  0:05       ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20 18:18 UTC (permalink / raw)
  To: u-boot

On 9/20/2013 3:45 AM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> i.mx6 has 1 otg controller, and 3 host ports. So,
>> CONFIG_USB_MAX_CONTROLLER_COUNT can be greater than 1
>> even though only 1 device mode controller is supported.
>>
>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>
> The problem is, will the 3 additional ports still work? I suspect they will, but
> then if you run 'usb reset', the gadget port will also be switched back into USB
> Host function, no
>
> Best regards,
> Marek Vasut
>
The next patch checks the OTG id before switching to host mode. If it is 
grounded, then it enters
host mode, otherwise it doesn't.  But, running 'usb reset' on a 
netconsole may kill your connection.
I haven't tested that.  Do you have a suggestion to fix that? I've been 
testing with tftp transfers only.

Thanks
Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 02/17] usb: ehci-mx6: add support for host mode otg port
  2013-09-20 10:51   ` Marek Vasut
@ 2013-09-20 18:27     ` Troy Kisky
  0 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-20 18:27 UTC (permalink / raw)
  To: u-boot

On 9/20/2013 3:51 AM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> Previously, only host1 was supported using an index of 0.
>> Now, otg has index 0, host1 is 1, host2 is 2, host3 is 3.
>> Since OTG requires usbmode to be set after reset, I added
>> a weak function ehci_hcd_init_after_reset to handle this,
>> and removed it from ehci_hcd_init. I also added a weak
>> function board_ehci_power to handle turning power on/off
>> for otg.
>>
>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>
>> ---
>> V4: new patch, replaces "usb: gadget: mv_udc: fix hardware udc address for
>> i.MX6" and has the bonus of giving OTG host mode support
>> ---
> Would it be a problem to implement this in ehci_hcd_init() call instead of
> adding a new call?
>
> Best regards,
> Marek Vasut
>

Maybe. I could try defining CONFIG_EHCI_HCD_INIT_AFTER_RESET and see if 
anything breaks.
Although, I suspect the processor may hang if the clocks aren't setup 
before ehci_reset.
I'll give it a try and let you know.


Thanks
Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize
  2013-09-20 10:52   ` Marek Vasut
@ 2013-09-20 18:34     ` Troy Kisky
  2013-09-23  0:04       ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20 18:34 UTC (permalink / raw)
  To: u-boot

On 9/20/2013 3:52 AM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> set wMaxPacketSize for full speed descriptors
>> fs_source_desc, fs_sink_desc to 64.
>>
>> Full-speed bulk endpoint can have a maximum packet size of
>> 8, 16, 32, or 64 bytes, so choice 64.
>>
>> The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize
>> set to 512. That is the only legal value for high speed bulk endpoints.
>>
>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> Why do we need this patch? What issue does this fix ?
>
> Best regards,
> Marek Vasut
>
I could try full speed mode without this and see how linux behaves when 
given bad data,
but that would not says anything about other O.S.es. It seems safer just 
not to give out
bad data.

Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20 10:55   ` Marek Vasut
@ 2013-09-20 18:46     ` Troy Kisky
  2013-09-20 18:52       ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20 18:46 UTC (permalink / raw)
  To: u-boot

On 9/20/2013 3:55 AM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> Move common definitions to udc.h
>> This allows musb_udc.h to be removed as well.
>>
>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>
>> ---
>> v4: updated commit message
>> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
>> is the only legal value, it shouldn't be overridden.
> [...]
>
>>   #endif
>> diff --git a/include/usb/udc.h b/include/usb/udc.h
>> new file mode 100644
>> index 0000000..3bcbbbc
>> --- /dev/null
>> +++ b/include/usb/udc.h
>> @@ -0,0 +1,61 @@
>> +/*
>> + * SPDX-License-Identifier:	GPL-2.0+
>> + */
>> +#ifndef USB_UDC_H
>> +#define USB_UDC_H
>> +
>> +#ifndef EP0_MAX_PACKET_SIZE
>> +#define EP0_MAX_PACKET_SIZE     64
>> +#endif
>> +
>> +#ifndef EP_MAX_PACKET_SIZE
>> +#define EP_MAX_PACKET_SIZE	64
>> +#endif
>> +
>> +#ifndef UDC_OUT_PACKET_SIZE
>> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>> +#endif
>> +
>> +#ifndef UDC_IN_PACKET_SIZE
>> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
>> +#endif
>> +
>> +#ifndef UDC_INT_PACKET_SIZE
>> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>> +#endif
>> +
>> +#ifndef UDC_BULK_PACKET_SIZE
>> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
>> +#endif
> Do you expect these values to change on per-controller basis? Or why do you have
> these ifndefs here ?

I don't know why they change but

include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE 
EP_MIN_PACKET_SIZE    /* 8 */
include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16

include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE 
UDC_IN_PACKET_SIZE   /* 8 */
include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16

include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE 
EP_MIN_PACKET_SIZE    /* */

>> +#define UDC_BULK_HS_PACKET_SIZE	512
>> +
>> +#ifndef UDC_INT_ENDPOINT
>> +#define UDC_INT_ENDPOINT	1
>> +#endif
>> +
>> +#ifndef UDC_OUT_ENDPOINT
>> +#define UDC_OUT_ENDPOINT	2
>> +#endif
>> +
>> +#ifndef UDC_IN_ENDPOINT
>> +#define UDC_IN_ENDPOINT		3
>> +#endif
> [...]
>
> Best regards,
> Marek Vasut
>

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20 18:46     ` Troy Kisky
@ 2013-09-20 18:52       ` Marek Vasut
  2013-09-20 19:37         ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 18:52 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/20/2013 3:55 AM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> Move common definitions to udc.h
> >> This allows musb_udc.h to be removed as well.
> >> 
> >> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >> 
> >> ---
> >> v4: updated commit message
> >> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
> >> is the only legal value, it shouldn't be overridden.
> > 
> > [...]
> > 
> >>   #endif
> >> 
> >> diff --git a/include/usb/udc.h b/include/usb/udc.h
> >> new file mode 100644
> >> index 0000000..3bcbbbc
> >> --- /dev/null
> >> +++ b/include/usb/udc.h
> >> @@ -0,0 +1,61 @@
> >> +/*
> >> + * SPDX-License-Identifier:	GPL-2.0+
> >> + */
> >> +#ifndef USB_UDC_H
> >> +#define USB_UDC_H
> >> +
> >> +#ifndef EP0_MAX_PACKET_SIZE
> >> +#define EP0_MAX_PACKET_SIZE     64
> >> +#endif
> >> +
> >> +#ifndef EP_MAX_PACKET_SIZE
> >> +#define EP_MAX_PACKET_SIZE	64
> >> +#endif
> >> +
> >> +#ifndef UDC_OUT_PACKET_SIZE
> >> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> >> +#endif
> >> +
> >> +#ifndef UDC_IN_PACKET_SIZE
> >> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
> >> +#endif
> >> +
> >> +#ifndef UDC_INT_PACKET_SIZE
> >> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> >> +#endif
> >> +
> >> +#ifndef UDC_BULK_PACKET_SIZE
> >> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
> >> +#endif
> > 
> > Do you expect these values to change on per-controller basis? Or why do
> > you have these ifndefs here ?
> 
> I don't know why they change but
> 
> include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE
> EP_MIN_PACKET_SIZE    /* 8 */
> include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16
> 
> include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE
> UDC_IN_PACKET_SIZE   /* 8 */
> include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16
> 
> include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE
> EP_MIN_PACKET_SIZE    /* */

Are you sure this is not OHCI ?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce
  2013-09-20 10:58   ` Marek Vasut
@ 2013-09-20 18:58     ` Troy Kisky
  2013-09-23  0:02       ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20 18:58 UTC (permalink / raw)
  To: u-boot

On 9/20/2013 3:58 AM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> Only perform one copy, either in the bounce
>> routine for IN transfers, or the debounce
>> rtn for OUT transfer.
>>
>> On out transfers, only copy the number
>> of bytes received from the bounce buffer
>>
>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>
>> ---
>> v4: no change
> Just a question here. Are you sure we never Send AND Reserve the data in one
> turn? Because that would need two copyings.

  ???   s/Reserve/Receive/

As far as I'm aware, a single buffer is only ever used to capture or 
provide data not both.
But, if 2 transfers were queued, an OUT and then an IN using the same 
buffer, if it worked before
this patch, it should work after as well.
>
> Best regards,
> Marek Vasut
>

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20 18:52       ` Marek Vasut
@ 2013-09-20 19:37         ` Troy Kisky
  2013-09-20 19:53           ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20 19:37 UTC (permalink / raw)
  To: u-boot

On 9/20/2013 11:52 AM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 9/20/2013 3:55 AM, Marek Vasut wrote:
>>> Dear Troy Kisky,
>>>
>>>> Move common definitions to udc.h
>>>> This allows musb_udc.h to be removed as well.
>>>>
>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>>>
>>>> ---
>>>> v4: updated commit message
>>>> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
>>>> is the only legal value, it shouldn't be overridden.
>>> [...]
>>>
>>>>    #endif
>>>>
>>>> diff --git a/include/usb/udc.h b/include/usb/udc.h
>>>> new file mode 100644
>>>> index 0000000..3bcbbbc
>>>> --- /dev/null
>>>> +++ b/include/usb/udc.h
>>>> @@ -0,0 +1,61 @@
>>>> +/*
>>>> + * SPDX-License-Identifier:	GPL-2.0+
>>>> + */
>>>> +#ifndef USB_UDC_H
>>>> +#define USB_UDC_H
>>>> +
>>>> +#ifndef EP0_MAX_PACKET_SIZE
>>>> +#define EP0_MAX_PACKET_SIZE     64
>>>> +#endif
>>>> +
>>>> +#ifndef EP_MAX_PACKET_SIZE
>>>> +#define EP_MAX_PACKET_SIZE	64
>>>> +#endif
>>>> +
>>>> +#ifndef UDC_OUT_PACKET_SIZE
>>>> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>> +#endif
>>>> +
>>>> +#ifndef UDC_IN_PACKET_SIZE
>>>> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
>>>> +#endif
>>>> +
>>>> +#ifndef UDC_INT_PACKET_SIZE
>>>> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>> +#endif
>>>> +
>>>> +#ifndef UDC_BULK_PACKET_SIZE
>>>> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
>>>> +#endif
>>> Do you expect these values to change on per-controller basis? Or why do
>>> you have these ifndefs here ?
>> I don't know why they change but
>>
>> include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE
>> EP_MIN_PACKET_SIZE    /* 8 */
>> include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16
>>
>> include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE
>> UDC_IN_PACKET_SIZE   /* 8 */
>> include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16
>>
>> include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE
>> EP_MIN_PACKET_SIZE    /* */
> Are you sure this is not OHCI ?
>
> Best regards,
> Marek Vasut
>

I don't know.
I don't understand the relevance of the question. Can you explain the 
issue a little more
for me.

Thanks
Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20 19:37         ` Troy Kisky
@ 2013-09-20 19:53           ` Marek Vasut
  2013-09-20 21:15             ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 19:53 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/20/2013 11:52 AM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> On 9/20/2013 3:55 AM, Marek Vasut wrote:
> >>> Dear Troy Kisky,
> >>> 
> >>>> Move common definitions to udc.h
> >>>> This allows musb_udc.h to be removed as well.
> >>>> 
> >>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >>>> 
> >>>> ---
> >>>> v4: updated commit message
> >>>> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
> >>>> is the only legal value, it shouldn't be overridden.
> >>> 
> >>> [...]
> >>> 
> >>>>    #endif
> >>>> 
> >>>> diff --git a/include/usb/udc.h b/include/usb/udc.h
> >>>> new file mode 100644
> >>>> index 0000000..3bcbbbc
> >>>> --- /dev/null
> >>>> +++ b/include/usb/udc.h
> >>>> @@ -0,0 +1,61 @@
> >>>> +/*
> >>>> + * SPDX-License-Identifier:	GPL-2.0+
> >>>> + */
> >>>> +#ifndef USB_UDC_H
> >>>> +#define USB_UDC_H
> >>>> +
> >>>> +#ifndef EP0_MAX_PACKET_SIZE
> >>>> +#define EP0_MAX_PACKET_SIZE     64
> >>>> +#endif
> >>>> +
> >>>> +#ifndef EP_MAX_PACKET_SIZE
> >>>> +#define EP_MAX_PACKET_SIZE	64
> >>>> +#endif
> >>>> +
> >>>> +#ifndef UDC_OUT_PACKET_SIZE
> >>>> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> >>>> +#endif
> >>>> +
> >>>> +#ifndef UDC_IN_PACKET_SIZE
> >>>> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
> >>>> +#endif
> >>>> +
> >>>> +#ifndef UDC_INT_PACKET_SIZE
> >>>> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> >>>> +#endif
> >>>> +
> >>>> +#ifndef UDC_BULK_PACKET_SIZE
> >>>> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
> >>>> +#endif
> >>> 
> >>> Do you expect these values to change on per-controller basis? Or why do
> >>> you have these ifndefs here ?
> >> 
> >> I don't know why they change but
> >> 
> >> include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE
> >> EP_MIN_PACKET_SIZE    /* 8 */
> >> include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16
> >> 
> >> include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE
> >> UDC_IN_PACKET_SIZE   /* 8 */
> >> include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16
> >> 
> >> include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE
> >> EP_MIN_PACKET_SIZE    /* */
> > 
> > Are you sure this is not OHCI ?
> > 
> > Best regards,
> > Marek Vasut
> 
> I don't know.
> I don't understand the relevance of the question. Can you explain the
> issue a little more
> for me.

OMAP1510 has only OHCI controller in it, dunno about MPC8xx, but that seems to 
be the case as well. Therefore, in OHCI case, the max packet is 16 and in ehci 
it's 64 . Check the specs ;-)

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20 19:53           ` Marek Vasut
@ 2013-09-20 21:15             ` Troy Kisky
  2013-09-20 21:20               ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20 21:15 UTC (permalink / raw)
  To: u-boot

On 9/20/2013 12:53 PM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 9/20/2013 11:52 AM, Marek Vasut wrote:
>>> Dear Troy Kisky,
>>>
>>>> On 9/20/2013 3:55 AM, Marek Vasut wrote:
>>>>> Dear Troy Kisky,
>>>>>
>>>>>> Move common definitions to udc.h
>>>>>> This allows musb_udc.h to be removed as well.
>>>>>>
>>>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>>>>>
>>>>>> ---
>>>>>> v4: updated commit message
>>>>>> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
>>>>>> is the only legal value, it shouldn't be overridden.
>>>>> [...]
>>>>>
>>>>>>     #endif
>>>>>>
>>>>>> diff --git a/include/usb/udc.h b/include/usb/udc.h
>>>>>> new file mode 100644
>>>>>> index 0000000..3bcbbbc
>>>>>> --- /dev/null
>>>>>> +++ b/include/usb/udc.h
>>>>>> @@ -0,0 +1,61 @@
>>>>>> +/*
>>>>>> + * SPDX-License-Identifier:	GPL-2.0+
>>>>>> + */
>>>>>> +#ifndef USB_UDC_H
>>>>>> +#define USB_UDC_H
>>>>>> +
>>>>>> +#ifndef EP0_MAX_PACKET_SIZE
>>>>>> +#define EP0_MAX_PACKET_SIZE     64
>>>>>> +#endif
>>>>>> +
>>>>>> +#ifndef EP_MAX_PACKET_SIZE
>>>>>> +#define EP_MAX_PACKET_SIZE	64
>>>>>> +#endif
>>>>>> +
>>>>>> +#ifndef UDC_OUT_PACKET_SIZE
>>>>>> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>>>> +#endif
>>>>>> +
>>>>>> +#ifndef UDC_IN_PACKET_SIZE
>>>>>> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
>>>>>> +#endif
>>>>>> +
>>>>>> +#ifndef UDC_INT_PACKET_SIZE
>>>>>> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>>>> +#endif
>>>>>> +
>>>>>> +#ifndef UDC_BULK_PACKET_SIZE
>>>>>> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
>>>>>> +#endif
>>>>> Do you expect these values to change on per-controller basis? Or why do
>>>>> you have these ifndefs here ?
>>>> I don't know why they change but
>>>>
>>>> include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE
>>>> EP_MIN_PACKET_SIZE    /* 8 */
>>>> include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16
>>>>
>>>> include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE
>>>> UDC_IN_PACKET_SIZE   /* 8 */
>>>> include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16
>>>>
>>>> include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE
>>>> EP_MIN_PACKET_SIZE    /* */
>>> Are you sure this is not OHCI ?
>>>
>>> Best regards,
>>> Marek Vasut
>> I don't know.
>> I don't understand the relevance of the question. Can you explain the
>> issue a little more
>> for me.
> OMAP1510 has only OHCI controller in it, dunno about MPC8xx, but that seems to
> be the case as well. Therefore, in OHCI case, the max packet is 16 and in ehci
> it's 64 . Check the specs ;-)
>
> Best regards,
> Marek Vasut
>
Ok, I checked the spec for the OMAP1510, and found "Table 14?23. 
Endpoint n Size Values"
lists maximum packet sizes of 8, 16, 32, or 64 bytes for Non-isochronous
endpoints, and 8, 16, 32, 64, 128, 256, 512 for Isochronous endpoints

So, I still don't understand the limit of 16, but that isn't required.


So, are you saying I should edit omap1510_udc.h and add

#define EP_MAX_PACKET_SIZE 16


and remove
#ifndef UDC_BULK_PACKET_SIZE

in udc.h and do

#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE

unconditionally?


Thanks
Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20 21:15             ` Troy Kisky
@ 2013-09-20 21:20               ` Marek Vasut
  2013-09-20 21:33                 ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 21:20 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/20/2013 12:53 PM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> On 9/20/2013 11:52 AM, Marek Vasut wrote:
> >>> Dear Troy Kisky,
> >>> 
> >>>> On 9/20/2013 3:55 AM, Marek Vasut wrote:
> >>>>> Dear Troy Kisky,
> >>>>> 
> >>>>>> Move common definitions to udc.h
> >>>>>> This allows musb_udc.h to be removed as well.
> >>>>>> 
> >>>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >>>>>> 
> >>>>>> ---
> >>>>>> v4: updated commit message
> >>>>>> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
> >>>>>> is the only legal value, it shouldn't be overridden.
> >>>>> 
> >>>>> [...]
> >>>>> 
> >>>>>>     #endif
> >>>>>> 
> >>>>>> diff --git a/include/usb/udc.h b/include/usb/udc.h
> >>>>>> new file mode 100644
> >>>>>> index 0000000..3bcbbbc
> >>>>>> --- /dev/null
> >>>>>> +++ b/include/usb/udc.h
> >>>>>> @@ -0,0 +1,61 @@
> >>>>>> +/*
> >>>>>> + * SPDX-License-Identifier:	GPL-2.0+
> >>>>>> + */
> >>>>>> +#ifndef USB_UDC_H
> >>>>>> +#define USB_UDC_H
> >>>>>> +
> >>>>>> +#ifndef EP0_MAX_PACKET_SIZE
> >>>>>> +#define EP0_MAX_PACKET_SIZE     64
> >>>>>> +#endif
> >>>>>> +
> >>>>>> +#ifndef EP_MAX_PACKET_SIZE
> >>>>>> +#define EP_MAX_PACKET_SIZE	64
> >>>>>> +#endif
> >>>>>> +
> >>>>>> +#ifndef UDC_OUT_PACKET_SIZE
> >>>>>> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> >>>>>> +#endif
> >>>>>> +
> >>>>>> +#ifndef UDC_IN_PACKET_SIZE
> >>>>>> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
> >>>>>> +#endif
> >>>>>> +
> >>>>>> +#ifndef UDC_INT_PACKET_SIZE
> >>>>>> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> >>>>>> +#endif
> >>>>>> +
> >>>>>> +#ifndef UDC_BULK_PACKET_SIZE
> >>>>>> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
> >>>>>> +#endif
> >>>>> 
> >>>>> Do you expect these values to change on per-controller basis? Or why
> >>>>> do you have these ifndefs here ?
> >>>> 
> >>>> I don't know why they change but
> >>>> 
> >>>> include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE
> >>>> EP_MIN_PACKET_SIZE    /* 8 */
> >>>> include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16
> >>>> 
> >>>> include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE
> >>>> UDC_IN_PACKET_SIZE   /* 8 */
> >>>> include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16
> >>>> 
> >>>> include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE
> >>>> EP_MIN_PACKET_SIZE    /* */
> >>> 
> >>> Are you sure this is not OHCI ?
> >>> 
> >>> Best regards,
> >>> Marek Vasut
> >> 
> >> I don't know.
> >> I don't understand the relevance of the question. Can you explain the
> >> issue a little more
> >> for me.
> > 
> > OMAP1510 has only OHCI controller in it, dunno about MPC8xx, but that
> > seems to be the case as well. Therefore, in OHCI case, the max packet is
> > 16 and in ehci it's 64 . Check the specs ;-)
> > 
> > Best regards,
> > Marek Vasut
> 
> Ok, I checked the spec for the OMAP1510, and found "Table 14?23.
> Endpoint n Size Values"
> lists maximum packet sizes of 8, 16, 32, or 64 bytes for Non-isochronous
> endpoints, and 8, 16, 32, 64, 128, 256, 512 for Isochronous endpoints
> 
> So, I still don't understand the limit of 16, but that isn't required.
> 
> 
> So, are you saying I should edit omap1510_udc.h and add
> 
> #define EP_MAX_PACKET_SIZE 16
> 
> 
> and remove
> #ifndef UDC_BULK_PACKET_SIZE
> 
> in udc.h and do
> 
> #define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
> 
> unconditionally?

I'd say you should check if the controller is OHCI or EHCI , check what kind of 
endpoint it is and based on that , configure the max packet size. Or is this 
really controller specific ? What do the OHCI and EHCI specs say ?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20 21:20               ` Marek Vasut
@ 2013-09-20 21:33                 ` Troy Kisky
  2013-09-20 22:01                   ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-20 21:33 UTC (permalink / raw)
  To: u-boot

On 9/20/2013 2:20 PM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 9/20/2013 12:53 PM, Marek Vasut wrote:
>>> Dear Troy Kisky,
>>>
>>>> On 9/20/2013 11:52 AM, Marek Vasut wrote:
>>>>> Dear Troy Kisky,
>>>>>
>>>>>> On 9/20/2013 3:55 AM, Marek Vasut wrote:
>>>>>>> Dear Troy Kisky,
>>>>>>>
>>>>>>>> Move common definitions to udc.h
>>>>>>>> This allows musb_udc.h to be removed as well.
>>>>>>>>
>>>>>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>>>>>>>
>>>>>>>> ---
>>>>>>>> v4: updated commit message
>>>>>>>> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
>>>>>>>> is the only legal value, it shouldn't be overridden.
>>>>>>> [...]
>>>>>>>
>>>>>>>>      #endif
>>>>>>>>
>>>>>>>> diff --git a/include/usb/udc.h b/include/usb/udc.h
>>>>>>>> new file mode 100644
>>>>>>>> index 0000000..3bcbbbc
>>>>>>>> --- /dev/null
>>>>>>>> +++ b/include/usb/udc.h
>>>>>>>> @@ -0,0 +1,61 @@
>>>>>>>> +/*
>>>>>>>> + * SPDX-License-Identifier:	GPL-2.0+
>>>>>>>> + */
>>>>>>>> +#ifndef USB_UDC_H
>>>>>>>> +#define USB_UDC_H
>>>>>>>> +
>>>>>>>> +#ifndef EP0_MAX_PACKET_SIZE
>>>>>>>> +#define EP0_MAX_PACKET_SIZE     64
>>>>>>>> +#endif
>>>>>>>> +
>>>>>>>> +#ifndef EP_MAX_PACKET_SIZE
>>>>>>>> +#define EP_MAX_PACKET_SIZE	64
>>>>>>>> +#endif
>>>>>>>> +
>>>>>>>> +#ifndef UDC_OUT_PACKET_SIZE
>>>>>>>> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>>>>>> +#endif
>>>>>>>> +
>>>>>>>> +#ifndef UDC_IN_PACKET_SIZE
>>>>>>>> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
>>>>>>>> +#endif
>>>>>>>> +
>>>>>>>> +#ifndef UDC_INT_PACKET_SIZE
>>>>>>>> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>>>>>> +#endif
>>>>>>>> +
>>>>>>>> +#ifndef UDC_BULK_PACKET_SIZE
>>>>>>>> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
>>>>>>>> +#endif
>>>>>>> Do you expect these values to change on per-controller basis? Or why
>>>>>>> do you have these ifndefs here ?
>>>>>> I don't know why they change but
>>>>>>
>>>>>> include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE
>>>>>> EP_MIN_PACKET_SIZE    /* 8 */
>>>>>> include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16
>>>>>>
>>>>>> include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE
>>>>>> UDC_IN_PACKET_SIZE   /* 8 */
>>>>>> include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16
>>>>>>
>>>>>> include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE
>>>>>> EP_MIN_PACKET_SIZE    /* */
>>>>> Are you sure this is not OHCI ?
>>>>>
>>>>> Best regards,
>>>>> Marek Vasut
>>>> I don't know.
>>>> I don't understand the relevance of the question. Can you explain the
>>>> issue a little more
>>>> for me.
>>> OMAP1510 has only OHCI controller in it, dunno about MPC8xx, but that
>>> seems to be the case as well. Therefore, in OHCI case, the max packet is
>>> 16 and in ehci it's 64 . Check the specs ;-)
>>>
>>> Best regards,
>>> Marek Vasut
>> Ok, I checked the spec for the OMAP1510, and found "Table 14?23.
>> Endpoint n Size Values"
>> lists maximum packet sizes of 8, 16, 32, or 64 bytes for Non-isochronous
>> endpoints, and 8, 16, 32, 64, 128, 256, 512 for Isochronous endpoints
>>
>> So, I still don't understand the limit of 16, but that isn't required.
>>
>>
>> So, are you saying I should edit omap1510_udc.h and add
>>
>> #define EP_MAX_PACKET_SIZE 16
>>
>>
>> and remove
>> #ifndef UDC_BULK_PACKET_SIZE
>>
>> in udc.h and do
>>
>> #define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
>>
>> unconditionally?
> I'd say you should check if the controller is OHCI or EHCI , check what kind of
> endpoint it is and based on that , configure the max packet size. Or is this
> really controller specific ? What do the OHCI and EHCI specs say ?
>
> Best regards,
> Marek Vasut
>

The omap1510 does have an OHCI host controller, I don't know how that 
relates to the device
controller so I think a check would just be confusing.

Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20 21:33                 ` Troy Kisky
@ 2013-09-20 22:01                   ` Marek Vasut
  2013-09-21  0:25                     ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-20 22:01 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/20/2013 2:20 PM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> On 9/20/2013 12:53 PM, Marek Vasut wrote:
> >>> Dear Troy Kisky,
> >>> 
> >>>> On 9/20/2013 11:52 AM, Marek Vasut wrote:
> >>>>> Dear Troy Kisky,
> >>>>> 
> >>>>>> On 9/20/2013 3:55 AM, Marek Vasut wrote:
> >>>>>>> Dear Troy Kisky,
> >>>>>>> 
> >>>>>>>> Move common definitions to udc.h
> >>>>>>>> This allows musb_udc.h to be removed as well.
> >>>>>>>> 
> >>>>>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >>>>>>>> 
> >>>>>>>> ---
> >>>>>>>> v4: updated commit message
> >>>>>>>> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
> >>>>>>>> is the only legal value, it shouldn't be overridden.
> >>>>>>> 
> >>>>>>> [...]
> >>>>>>> 
> >>>>>>>>      #endif
> >>>>>>>> 
> >>>>>>>> diff --git a/include/usb/udc.h b/include/usb/udc.h
> >>>>>>>> new file mode 100644
> >>>>>>>> index 0000000..3bcbbbc
> >>>>>>>> --- /dev/null
> >>>>>>>> +++ b/include/usb/udc.h
> >>>>>>>> @@ -0,0 +1,61 @@
> >>>>>>>> +/*
> >>>>>>>> + * SPDX-License-Identifier:	GPL-2.0+
> >>>>>>>> + */
> >>>>>>>> +#ifndef USB_UDC_H
> >>>>>>>> +#define USB_UDC_H
> >>>>>>>> +
> >>>>>>>> +#ifndef EP0_MAX_PACKET_SIZE
> >>>>>>>> +#define EP0_MAX_PACKET_SIZE     64
> >>>>>>>> +#endif
> >>>>>>>> +
> >>>>>>>> +#ifndef EP_MAX_PACKET_SIZE
> >>>>>>>> +#define EP_MAX_PACKET_SIZE	64
> >>>>>>>> +#endif
> >>>>>>>> +
> >>>>>>>> +#ifndef UDC_OUT_PACKET_SIZE
> >>>>>>>> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> >>>>>>>> +#endif
> >>>>>>>> +
> >>>>>>>> +#ifndef UDC_IN_PACKET_SIZE
> >>>>>>>> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
> >>>>>>>> +#endif
> >>>>>>>> +
> >>>>>>>> +#ifndef UDC_INT_PACKET_SIZE
> >>>>>>>> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
> >>>>>>>> +#endif
> >>>>>>>> +
> >>>>>>>> +#ifndef UDC_BULK_PACKET_SIZE
> >>>>>>>> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
> >>>>>>>> +#endif
> >>>>>>> 
> >>>>>>> Do you expect these values to change on per-controller basis? Or
> >>>>>>> why do you have these ifndefs here ?
> >>>>>> 
> >>>>>> I don't know why they change but
> >>>>>> 
> >>>>>> include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE
> >>>>>> EP_MIN_PACKET_SIZE    /* 8 */
> >>>>>> include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16
> >>>>>> 
> >>>>>> include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE
> >>>>>> UDC_IN_PACKET_SIZE   /* 8 */
> >>>>>> include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16
> >>>>>> 
> >>>>>> include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE
> >>>>>> EP_MIN_PACKET_SIZE    /* */
> >>>>> 
> >>>>> Are you sure this is not OHCI ?
> >>>>> 
> >>>>> Best regards,
> >>>>> Marek Vasut
> >>>> 
> >>>> I don't know.
> >>>> I don't understand the relevance of the question. Can you explain the
> >>>> issue a little more
> >>>> for me.
> >>> 
> >>> OMAP1510 has only OHCI controller in it, dunno about MPC8xx, but that
> >>> seems to be the case as well. Therefore, in OHCI case, the max packet
> >>> is 16 and in ehci it's 64 . Check the specs ;-)
> >>> 
> >>> Best regards,
> >>> Marek Vasut
> >> 
> >> Ok, I checked the spec for the OMAP1510, and found "Table 14?23.
> >> Endpoint n Size Values"
> >> lists maximum packet sizes of 8, 16, 32, or 64 bytes for Non-isochronous
> >> endpoints, and 8, 16, 32, 64, 128, 256, 512 for Isochronous endpoints
> >> 
> >> So, I still don't understand the limit of 16, but that isn't required.
> >> 
> >> 
> >> So, are you saying I should edit omap1510_udc.h and add
> >> 
> >> #define EP_MAX_PACKET_SIZE 16
> >> 
> >> 
> >> and remove
> >> #ifndef UDC_BULK_PACKET_SIZE
> >> 
> >> in udc.h and do
> >> 
> >> #define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
> >> 
> >> unconditionally?
> > 
> > I'd say you should check if the controller is OHCI or EHCI , check what
> > kind of endpoint it is and based on that , configure the max packet
> > size. Or is this really controller specific ? What do the OHCI and EHCI
> > specs say ?
> > 
> > Best regards,
> > Marek Vasut
> 
> The omap1510 does have an OHCI host controller, I don't know how that
> relates to the device
> controller so I think a check would just be confusing.

I see the difference now. For EHCI UDC, the max packet sizes are as they are. 
For OMAP/MPC8xx, these are non-standard arbitrary values, it's just that the 
name is the same.

This is pretty ugly and confusing, ick. I'd say you #ifdef this stuff like this:
#ifdef OMAP1510 ... 
#elif MPC8xx
#elif ....
#endif

And put a comment around it that the old UDCs simply follow no standard.

Best regards,

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file
  2013-09-20 22:01                   ` Marek Vasut
@ 2013-09-21  0:25                     ` Troy Kisky
  0 siblings, 0 replies; 48+ messages in thread
From: Troy Kisky @ 2013-09-21  0:25 UTC (permalink / raw)
  To: u-boot

On 9/20/2013 3:01 PM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 9/20/2013 2:20 PM, Marek Vasut wrote:
>>> Dear Troy Kisky,
>>>
>>>> On 9/20/2013 12:53 PM, Marek Vasut wrote:
>>>>> Dear Troy Kisky,
>>>>>
>>>>>> On 9/20/2013 11:52 AM, Marek Vasut wrote:
>>>>>>> Dear Troy Kisky,
>>>>>>>
>>>>>>>> On 9/20/2013 3:55 AM, Marek Vasut wrote:
>>>>>>>>> Dear Troy Kisky,
>>>>>>>>>
>>>>>>>>>> Move common definitions to udc.h
>>>>>>>>>> This allows musb_udc.h to be removed as well.
>>>>>>>>>>
>>>>>>>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>>>>>>>>>
>>>>>>>>>> ---
>>>>>>>>>> v4: updated commit message
>>>>>>>>>> removed ifdef UDC_BULK_HS_PACKET_SIZE since 512
>>>>>>>>>> is the only legal value, it shouldn't be overridden.
>>>>>>>>> [...]
>>>>>>>>>
>>>>>>>>>>       #endif
>>>>>>>>>>
>>>>>>>>>> diff --git a/include/usb/udc.h b/include/usb/udc.h
>>>>>>>>>> new file mode 100644
>>>>>>>>>> index 0000000..3bcbbbc
>>>>>>>>>> --- /dev/null
>>>>>>>>>> +++ b/include/usb/udc.h
>>>>>>>>>> @@ -0,0 +1,61 @@
>>>>>>>>>> +/*
>>>>>>>>>> + * SPDX-License-Identifier:	GPL-2.0+
>>>>>>>>>> + */
>>>>>>>>>> +#ifndef USB_UDC_H
>>>>>>>>>> +#define USB_UDC_H
>>>>>>>>>> +
>>>>>>>>>> +#ifndef EP0_MAX_PACKET_SIZE
>>>>>>>>>> +#define EP0_MAX_PACKET_SIZE     64
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef EP_MAX_PACKET_SIZE
>>>>>>>>>> +#define EP_MAX_PACKET_SIZE	64
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef UDC_OUT_PACKET_SIZE
>>>>>>>>>> +#define UDC_OUT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef UDC_IN_PACKET_SIZE
>>>>>>>>>> +#define UDC_IN_PACKET_SIZE      EP_MAX_PACKET_SIZE
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef UDC_INT_PACKET_SIZE
>>>>>>>>>> +#define UDC_INT_PACKET_SIZE     EP_MAX_PACKET_SIZE
>>>>>>>>>> +#endif
>>>>>>>>>> +
>>>>>>>>>> +#ifndef UDC_BULK_PACKET_SIZE
>>>>>>>>>> +#define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
>>>>>>>>>> +#endif
>>>>>>>>> Do you expect these values to change on per-controller basis? Or
>>>>>>>>> why do you have these ifndefs here ?
>>>>>>>> I don't know why they change but
>>>>>>>>
>>>>>>>> include/usb/mpc8xx_udc.h:#define UDC_BULK_PACKET_SIZE
>>>>>>>> EP_MIN_PACKET_SIZE    /* 8 */
>>>>>>>> include/usb/omap1510_udc.h:#define UDC_BULK_PACKET_SIZE 16
>>>>>>>>
>>>>>>>> include/usb/mpc8xx_udc.h:#define UDC_INT_PACKET_SIZE
>>>>>>>> UDC_IN_PACKET_SIZE   /* 8 */
>>>>>>>> include/usb/omap1510_udc.h:#define UDC_INT_PACKET_SIZE  16
>>>>>>>>
>>>>>>>> include/usb/mpc8xx_udc.h:#define UDC_OUT_PACKET_SIZE
>>>>>>>> EP_MIN_PACKET_SIZE    /* */
>>>>>>> Are you sure this is not OHCI ?
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Marek Vasut
>>>>>> I don't know.
>>>>>> I don't understand the relevance of the question. Can you explain the
>>>>>> issue a little more
>>>>>> for me.
>>>>> OMAP1510 has only OHCI controller in it, dunno about MPC8xx, but that
>>>>> seems to be the case as well. Therefore, in OHCI case, the max packet
>>>>> is 16 and in ehci it's 64 . Check the specs ;-)
>>>>>
>>>>> Best regards,
>>>>> Marek Vasut
>>>> Ok, I checked the spec for the OMAP1510, and found "Table 14?23.
>>>> Endpoint n Size Values"
>>>> lists maximum packet sizes of 8, 16, 32, or 64 bytes for Non-isochronous
>>>> endpoints, and 8, 16, 32, 64, 128, 256, 512 for Isochronous endpoints
>>>>
>>>> So, I still don't understand the limit of 16, but that isn't required.
>>>>
>>>>
>>>> So, are you saying I should edit omap1510_udc.h and add
>>>>
>>>> #define EP_MAX_PACKET_SIZE 16
>>>>
>>>>
>>>> and remove
>>>> #ifndef UDC_BULK_PACKET_SIZE
>>>>
>>>> in udc.h and do
>>>>
>>>> #define UDC_BULK_PACKET_SIZE    EP_MAX_PACKET_SIZE
>>>>
>>>> unconditionally?
>>> I'd say you should check if the controller is OHCI or EHCI , check what
>>> kind of endpoint it is and based on that , configure the max packet
>>> size. Or is this really controller specific ? What do the OHCI and EHCI
>>> specs say ?
>>>
>>> Best regards,
>>> Marek Vasut
>> The omap1510 does have an OHCI host controller, I don't know how that
>> relates to the device
>> controller so I think a check would just be confusing.
> I see the difference now. For EHCI UDC, the max packet sizes are as they are.
> For OMAP/MPC8xx, these are non-standard arbitrary values, it's just that the
> name is the same.
>
> This is pretty ugly and confusing, ick. I'd say you #ifdef this stuff like this:
> #ifdef OMAP1510 ...
> #elif MPC8xx
> #elif ....
> #endif
>
> And put a comment around it that the old UDCs simply follow no standard.
>
> Best regards,
>
I suspect omap1510 will work with a value of 64 for the sizes, since it 
and mpc8xx
were added by Bryan O'Donoghue - 29 May 2006

I've added him to the CC.
Bryan, can you test changing

include/usb/omap1510_udc.h
#define UDC_INT_PACKET_SIZE     16
#define UDC_BULK_PACKET_SIZE 16
--------
or on a very old u-boot
include/usbdcore_omap1510.h
#define UDC_INT_PKTSIZE        16
#define UDC_BULK_PKTSIZE 16


from 16 to 64? Or maybe you remember the reason 16 was needed?
Also, do your remember anything about the MPC885 family and why
endpoint 0 could be 16 bytes, but bulk endpoints are limited to 8?

Thanks, I'd like my comments to be accurate...

Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce
  2013-09-20 18:58     ` Troy Kisky
@ 2013-09-23  0:02       ` Marek Vasut
  2013-09-23 19:12         ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-23  0:02 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/20/2013 3:58 AM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> Only perform one copy, either in the bounce
> >> routine for IN transfers, or the debounce
> >> rtn for OUT transfer.
> >> 
> >> On out transfers, only copy the number
> >> of bytes received from the bounce buffer
> >> 
> >> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >> 
> >> ---
> >> v4: no change
> > 
> > Just a question here. Are you sure we never Send AND Reserve the data in
> > one turn? Because that would need two copyings.
> 
>   ???   s/Reserve/Receive/
> 
> As far as I'm aware, a single buffer is only ever used to capture or
> provide data not both.
> But, if 2 transfers were queued, an OUT and then an IN using the same
> buffer, if it worked before
> this patch, it should work after as well.

How come? Before, it was doing flush before and inval after the transfer, right 
?

btw what does this part of the patch do/mean ? Why is it there?

@@ -387,10 +383,9 @@ static void handle_ep_complete(struct mv_ep *ep)
                       num, in ? "in" : "out", item->info, item->page0);
 
        len = (item->info >> 16) & 0x7fff;
-
-       mv_debounce(ep);
-
        ep->req.length -= len;
+       mv_debounce(ep, in);
+
        DBG("ept%d %s complete %x\n",
                        num, in ? "in" : "out", len);
        ep->req.complete(&ep->ep, &ep->req);

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize
  2013-09-20 18:34     ` Troy Kisky
@ 2013-09-23  0:04       ` Marek Vasut
  2013-09-23 19:51         ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-23  0:04 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/20/2013 3:52 AM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> set wMaxPacketSize for full speed descriptors
> >> fs_source_desc, fs_sink_desc to 64.
> >> 
> >> Full-speed bulk endpoint can have a maximum packet size of
> >> 8, 16, 32, or 64 bytes, so choice 64.
> >> 
> >> The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize
> >> set to 512. That is the only legal value for high speed bulk endpoints.
> >> 
> >> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> > 
> > Why do we need this patch? What issue does this fix ?
> > 
> > Best regards,
> > Marek Vasut
> 
> I could try full speed mode without this and see how linux behaves when
> given bad data,
> but that would not says anything about other O.S.es. It seems safer just
> not to give out
> bad data.

Certainly. Will this not cause issues with the MPC8xx controller and OMAP1510 
controller?

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT
  2013-09-20 18:18     ` Troy Kisky
@ 2013-09-23  0:05       ` Marek Vasut
  2013-09-23 20:23         ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Marek Vasut @ 2013-09-23  0:05 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/20/2013 3:45 AM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> i.mx6 has 1 otg controller, and 3 host ports. So,
> >> CONFIG_USB_MAX_CONTROLLER_COUNT can be greater than 1
> >> even though only 1 device mode controller is supported.
> >> 
> >> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> > 
> > The problem is, will the 3 additional ports still work? I suspect they
> > will, but then if you run 'usb reset', the gadget port will also be
> > switched back into USB Host function, no
> > 
> > Best regards,
> > Marek Vasut
> 
> The next patch checks the OTG id before switching to host mode. If it is
> grounded, then it enters
> host mode, otherwise it doesn't.  But, running 'usb reset' on a
> netconsole may kill your connection.

It won't if you properly ignore rhis one controller depending on the OTG pin 
then, no ?

> I haven't tested that.  Do you have a suggestion to fix that? I've been
> testing with tftp transfers only.
> 
> Thanks
> Troy

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce
  2013-09-23  0:02       ` Marek Vasut
@ 2013-09-23 19:12         ` Troy Kisky
  2013-09-23 21:23           ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-23 19:12 UTC (permalink / raw)
  To: u-boot

On 9/22/2013 5:02 PM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 9/20/2013 3:58 AM, Marek Vasut wrote:
>>> Dear Troy Kisky,
>>>
>>>> Only perform one copy, either in the bounce
>>>> routine for IN transfers, or the debounce
>>>> rtn for OUT transfer.
>>>>
>>>> On out transfers, only copy the number
>>>> of bytes received from the bounce buffer
>>>>
>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>>>
>>>> ---
>>>> v4: no change
>>> Just a question here. Are you sure we never Send AND Reserve the data in
>>> one turn? Because that would need two copyings.
>>    ???   s/Reserve/Receive/
>>
>> As far as I'm aware, a single buffer is only ever used to capture or
>> provide data not both.
>> But, if 2 transfers were queued, an OUT and then an IN using the same
Actually, I should have said "an IN (tx to the host controller) and then 
an OUT(rx from the host controller)"
>> buffer, if it worked before
>> this patch, it should work after as well.
> How come? Before, it was doing flush before and inval after the transfer, right
> ?

The 1st "IN" transfer (tx to the host), will [copy]/flush on mv_bounce 
and [free]/nothing on mv_debounce.
The 2nd "OUT" transfer (rx from the host) will flush on mv_bounce and 
invalidate/[copy/free] on mv_debounce.

>
> btw what does this part of the patch do/mean ? Why is it there?
>
> @@ -387,10 +383,9 @@ static void handle_ep_complete(struct mv_ep *ep)
>                         num, in ? "in" : "out", item->info, item->page0);
>   
>          len = (item->info >> 16) & 0x7fff;
> -
> -       mv_debounce(ep);
> -
>          ep->req.length -= len;
> +       mv_debounce(ep, in);
> +
>
That implements the "On out transfers, only copy the number of bytes 
received from the bounce buffer"
portion of the commit message.


Thanks
Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize
  2013-09-23  0:04       ` Marek Vasut
@ 2013-09-23 19:51         ` Troy Kisky
  2013-09-23 21:22           ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-23 19:51 UTC (permalink / raw)
  To: u-boot

On 9/22/2013 5:04 PM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 9/20/2013 3:52 AM, Marek Vasut wrote:
>>> Dear Troy Kisky,
>>>
>>>> set wMaxPacketSize for full speed descriptors
>>>> fs_source_desc, fs_sink_desc to 64.
>>>>
>>>> Full-speed bulk endpoint can have a maximum packet size of
>>>> 8, 16, 32, or 64 bytes, so choice 64.
>>>>
>>>> The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize
>>>> set to 512. That is the only legal value for high speed bulk endpoints.
>>>>
>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>> Why do we need this patch? What issue does this fix ?
>>>
>>> Best regards,
>>> Marek Vasut
>> I could try full speed mode without this and see how linux behaves when
>> given bad data,
>> but that would not says anything about other O.S.es. It seems safer just
>> not to give out
>> bad data.
> Certainly. Will this not cause issues with the MPC8xx controller and OMAP1510
> controller?
>
> Best regards,
> Marek Vasut
>
Good point. ether.c is compiled when CONFIG_USB_ETHER is set.
And omap1510_udc.c, mpc8xx_udc.c will only be compiled when 
CONFIG_USB_ETHER is NOT set.


So, not a issue at present. I doubt anyone will upgrade these old boards 
to support CONFIG_USB_ETHER.

Thanks
Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT
  2013-09-23  0:05       ` Marek Vasut
@ 2013-09-23 20:23         ` Troy Kisky
  2013-09-23 20:55           ` Troy Kisky
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-23 20:23 UTC (permalink / raw)
  To: u-boot

On 9/22/2013 5:05 PM, Marek Vasut wrote:
> Dear Troy Kisky,
>
>> On 9/20/2013 3:45 AM, Marek Vasut wrote:
>>> Dear Troy Kisky,
>>>
>>>> i.mx6 has 1 otg controller, and 3 host ports. So,
>>>> CONFIG_USB_MAX_CONTROLLER_COUNT can be greater than 1
>>>> even though only 1 device mode controller is supported.
>>>>
>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>> The problem is, will the 3 additional ports still work? I suspect they
>>> will, but then if you run 'usb reset', the gadget port will also be
>>> switched back into USB Host function, no
>>>
>>> Best regards,
>>> Marek Vasut
>> The next patch checks the OTG id before switching to host mode. If it is
>> grounded, then it enters
>> host mode, otherwise it doesn't.  But, running 'usb reset' on a
>> netconsole may kill your connection.
> It won't if you properly ignore rhis one controller depending on the OTG pin
> then, no ?
>
I can return an error code from ehci_hcd_init, so that ehci_reset will 
not be called. But then
usb_lowlevel_init will also return an error, which is good for the call 
from usb_init, but bad
for the call in usb_gadget_register_driver.

Perhaps I should return a 1, instead of 0, when the otg_id pin is high? 
And check for < 0
before aborting from usb_gadget_register_driver ?

Thanks
Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT
  2013-09-23 20:23         ` Troy Kisky
@ 2013-09-23 20:55           ` Troy Kisky
  2013-09-23 21:17             ` Marek Vasut
  0 siblings, 1 reply; 48+ messages in thread
From: Troy Kisky @ 2013-09-23 20:55 UTC (permalink / raw)
  To: u-boot

On 9/23/2013 1:23 PM, Troy Kisky wrote:
> On 9/22/2013 5:05 PM, Marek Vasut wrote:
>> Dear Troy Kisky,
>>
>>> On 9/20/2013 3:45 AM, Marek Vasut wrote:
>>>> Dear Troy Kisky,
>>>>
>>>>> i.mx6 has 1 otg controller, and 3 host ports. So,
>>>>> CONFIG_USB_MAX_CONTROLLER_COUNT can be greater than 1
>>>>> even though only 1 device mode controller is supported.
>>>>>
>>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
>>>> The problem is, will the 3 additional ports still work? I suspect they
>>>> will, but then if you run 'usb reset', the gadget port will also be
>>>> switched back into USB Host function, no
>>>>
>>>> Best regards,
>>>> Marek Vasut
>>> The next patch checks the OTG id before switching to host mode. If 
>>> it is
>>> grounded, then it enters
>>> host mode, otherwise it doesn't.  But, running 'usb reset' on a
>>> netconsole may kill your connection.
>> It won't if you properly ignore rhis one controller depending on the 
>> OTG pin
>> then, no ?
>>
> I can return an error code from ehci_hcd_init, so that ehci_reset will 
> not be called. But then
> usb_lowlevel_init will also return an error, which is good for the 
> call from usb_init, but bad
> for the call in usb_gadget_register_driver.
>
> Perhaps I should return a 1, instead of 0, when the otg_id pin is 
> high? And check for < 0
> before aborting from usb_gadget_register_driver ?
>
> Thanks
> Troy
>
>
>
Or maybe add a parameter to usb_lowlevel_init specifying if I desire 
host or device mode?

Thanks
Troy

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT
  2013-09-23 20:55           ` Troy Kisky
@ 2013-09-23 21:17             ` Marek Vasut
  0 siblings, 0 replies; 48+ messages in thread
From: Marek Vasut @ 2013-09-23 21:17 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/23/2013 1:23 PM, Troy Kisky wrote:
> > On 9/22/2013 5:05 PM, Marek Vasut wrote:
> >> Dear Troy Kisky,
> >> 
> >>> On 9/20/2013 3:45 AM, Marek Vasut wrote:
> >>>> Dear Troy Kisky,
> >>>> 
> >>>>> i.mx6 has 1 otg controller, and 3 host ports. So,
> >>>>> CONFIG_USB_MAX_CONTROLLER_COUNT can be greater than 1
> >>>>> even though only 1 device mode controller is supported.
> >>>>> 
> >>>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >>>> 
> >>>> The problem is, will the 3 additional ports still work? I suspect they
> >>>> will, but then if you run 'usb reset', the gadget port will also be
> >>>> switched back into USB Host function, no
> >>>> 
> >>>> Best regards,
> >>>> Marek Vasut
> >>> 
> >>> The next patch checks the OTG id before switching to host mode. If
> >>> it is
> >>> grounded, then it enters
> >>> host mode, otherwise it doesn't.  But, running 'usb reset' on a
> >>> netconsole may kill your connection.
> >> 
> >> It won't if you properly ignore rhis one controller depending on the
> >> OTG pin
> >> then, no ?
> > 
> > I can return an error code from ehci_hcd_init, so that ehci_reset will
> > not be called. But then
> > usb_lowlevel_init will also return an error, which is good for the
> > call from usb_init, but bad
> > for the call in usb_gadget_register_driver.
> > 
> > Perhaps I should return a 1, instead of 0, when the otg_id pin is
> > high? And check for < 0
> > before aborting from usb_gadget_register_driver ?
> > 
> > Thanks
> > Troy
> 
> Or maybe add a parameter to usb_lowlevel_init specifying if I desire
> host or device mode?

Check

[PATCH v4] usb: new board-specific USB init interface

That might give you some ideas.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize
  2013-09-23 19:51         ` Troy Kisky
@ 2013-09-23 21:22           ` Marek Vasut
  0 siblings, 0 replies; 48+ messages in thread
From: Marek Vasut @ 2013-09-23 21:22 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/22/2013 5:04 PM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> On 9/20/2013 3:52 AM, Marek Vasut wrote:
> >>> Dear Troy Kisky,
> >>> 
> >>>> set wMaxPacketSize for full speed descriptors
> >>>> fs_source_desc, fs_sink_desc to 64.
> >>>> 
> >>>> Full-speed bulk endpoint can have a maximum packet size of
> >>>> 8, 16, 32, or 64 bytes, so choice 64.
> >>>> 
> >>>> The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize
> >>>> set to 512. That is the only legal value for high speed bulk
> >>>> endpoints.
> >>>> 
> >>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >>> 
> >>> Why do we need this patch? What issue does this fix ?
> >>> 
> >>> Best regards,
> >>> Marek Vasut
> >> 
> >> I could try full speed mode without this and see how linux behaves when
> >> given bad data,
> >> but that would not says anything about other O.S.es. It seems safer just
> >> not to give out
> >> bad data.
> > 
> > Certainly. Will this not cause issues with the MPC8xx controller and
> > OMAP1510 controller?
> > 
> > Best regards,
> > Marek Vasut
> 
> Good point. ether.c is compiled when CONFIG_USB_ETHER is set.
> And omap1510_udc.c, mpc8xx_udc.c will only be compiled when
> CONFIG_USB_ETHER is NOT set.
> 
> 
> So, not a issue at present. I doubt anyone will upgrade these old boards
> to support CONFIG_USB_ETHER.

Did you manage to get any feedback from the OMAP1 and MPC8xx guys on the USB 
topic?

btw. it might be actually better to split out the MX6 fixes and general USB 
fixes so the MX6 ones can go in before the rest.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce
  2013-09-23 19:12         ` Troy Kisky
@ 2013-09-23 21:23           ` Marek Vasut
  0 siblings, 0 replies; 48+ messages in thread
From: Marek Vasut @ 2013-09-23 21:23 UTC (permalink / raw)
  To: u-boot

Dear Troy Kisky,

> On 9/22/2013 5:02 PM, Marek Vasut wrote:
> > Dear Troy Kisky,
> > 
> >> On 9/20/2013 3:58 AM, Marek Vasut wrote:
> >>> Dear Troy Kisky,
> >>> 
> >>>> Only perform one copy, either in the bounce
> >>>> routine for IN transfers, or the debounce
> >>>> rtn for OUT transfer.
> >>>> 
> >>>> On out transfers, only copy the number
> >>>> of bytes received from the bounce buffer
> >>>> 
> >>>> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> >>>> 
> >>>> ---
> >>>> v4: no change
> >>> 
> >>> Just a question here. Are you sure we never Send AND Reserve the data
> >>> in one turn? Because that would need two copyings.
> >>> 
> >>    ???   s/Reserve/Receive/
> >> 
> >> As far as I'm aware, a single buffer is only ever used to capture or
> >> provide data not both.
> >> But, if 2 transfers were queued, an OUT and then an IN using the same
> 
> Actually, I should have said "an IN (tx to the host controller) and then
> an OUT(rx from the host controller)"
> 
> >> buffer, if it worked before
> >> this patch, it should work after as well.
> > 
> > How come? Before, it was doing flush before and inval after the transfer,
> > right ?
> 
> The 1st "IN" transfer (tx to the host), will [copy]/flush on mv_bounce
> and [free]/nothing on mv_debounce.
> The 2nd "OUT" transfer (rx from the host) will flush on mv_bounce and
> invalidate/[copy/free] on mv_debounce.
> 
> > btw what does this part of the patch do/mean ? Why is it there?
> > 
> > @@ -387,10 +383,9 @@ static void handle_ep_complete(struct mv_ep *ep)
> > 
> >                         num, in ? "in" : "out", item->info, item->page0);
> >          
> >          len = (item->info >> 16) & 0x7fff;
> > 
> > -
> > -       mv_debounce(ep);
> > -
> > 
> >          ep->req.length -= len;
> > 
> > +       mv_debounce(ep, in);
> > +
> 
> That implements the "On out transfers, only copy the number of bytes
> received from the bounce buffer"
> portion of the commit message.

OK, thanks.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2013-09-23 21:23 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-20  3:29 [U-Boot] [PATCH V4 00/17] Make mv_udc work for i.mx6 Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 01/17] usb: gadget: mv_udc: don't check CONFIG_USB_MAX_CONTROLLER_COUNT Troy Kisky
2013-09-20 10:45   ` Marek Vasut
2013-09-20 18:18     ` Troy Kisky
2013-09-23  0:05       ` Marek Vasut
2013-09-23 20:23         ` Troy Kisky
2013-09-23 20:55           ` Troy Kisky
2013-09-23 21:17             ` Marek Vasut
2013-09-20  3:29 ` [U-Boot] [PATCH V4 02/17] usb: ehci-mx6: add support for host mode otg port Troy Kisky
2013-09-20 10:51   ` Marek Vasut
2013-09-20 18:27     ` Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 03/17] usb: gadget: ether set wMaxPacketSize Troy Kisky
2013-09-20 10:52   ` Marek Vasut
2013-09-20 18:34     ` Troy Kisky
2013-09-23  0:04       ` Marek Vasut
2013-09-23 19:51         ` Troy Kisky
2013-09-23 21:22           ` Marek Vasut
2013-09-20  3:29 ` [U-Boot] [PATCH V4 04/17] usb: gadget: ether: return error from rx_submit if no request Troy Kisky
2013-09-20 10:52   ` Marek Vasut
2013-09-20  3:29 ` [U-Boot] [PATCH V4 05/17] usb: gadget: mv_udc: split mv_udc.h file Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 06/17] usb: udc: add udc.h include file Troy Kisky
2013-09-20 10:55   ` Marek Vasut
2013-09-20 18:46     ` Troy Kisky
2013-09-20 18:52       ` Marek Vasut
2013-09-20 19:37         ` Troy Kisky
2013-09-20 19:53           ` Marek Vasut
2013-09-20 21:15             ` Troy Kisky
2013-09-20 21:20               ` Marek Vasut
2013-09-20 21:33                 ` Troy Kisky
2013-09-20 22:01                   ` Marek Vasut
2013-09-21  0:25                     ` Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 07/17] usb: gadget: mv_udc: fix typo in error message Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 08/17] usb: gadget: mv_udc: set is_dualspeed = 1 Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 09/17] usb: gadget: mv_udc: fix full speed connections Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 10/17] usb: gadget: mv_udc: optimize bounce Troy Kisky
2013-09-20 10:58   ` Marek Vasut
2013-09-20 18:58     ` Troy Kisky
2013-09-23  0:02       ` Marek Vasut
2013-09-23 19:12         ` Troy Kisky
2013-09-23 21:23           ` Marek Vasut
2013-09-20  3:29 ` [U-Boot] [PATCH V4 11/17] usb: gadget: mv_udc: flush item before head Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 12/17] usb: gadget: mv_udc: optimize ep_enable Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 13/17] usb: gadget: mv_udc: zero transfer descriptor memory on probe Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 14/17] usb: gadget: mv_udc: clear desc upon ep_disable Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 15/17] mx6: iomux: add GPR1 defines for use with nitrogen6x Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 16/17] nitrogen6x: add otg usb host/device mode support Troy Kisky
2013-09-20  4:08   ` Troy Kisky
2013-09-20  3:29 ` [U-Boot] [PATCH V4 17/17] nitrogen6x: add CONFIG_MV_UDC Troy Kisky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox