public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes
@ 2015-08-10 11:15 Kishon Vijay Abraham I
  2015-08-10 11:15 ` [U-Boot] [PATCH 1/3] usb: gadget: ether: Perform board initialization from ethernet gadget driver Kishon Vijay Abraham I
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Kishon Vijay Abraham I @ 2015-08-10 11:15 UTC (permalink / raw)
  To: u-boot

This patch series is split from [1] to contain only the usb
host/gadget fixes.

[1] -> http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/229188

Kishon Vijay Abraham I (3):
  usb: gadget: ether: Perform board initialization from ethernet gadget
    driver
  usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop
  usb: gadget: ether: populate _reset_ callback

 drivers/usb/gadget/ether.c   |    5 +++++
 drivers/usb/host/xhci-omap.c |    1 +
 2 files changed, 6 insertions(+)

-- 
1.7.9.5

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

* [U-Boot] [PATCH 1/3] usb: gadget: ether: Perform board initialization from ethernet gadget driver
  2015-08-10 11:15 [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes Kishon Vijay Abraham I
@ 2015-08-10 11:15 ` Kishon Vijay Abraham I
  2015-08-11  0:33   ` Tom Rini
  2015-08-10 11:15 ` [U-Boot] [PATCH 2/3] usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop Kishon Vijay Abraham I
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Kishon Vijay Abraham I @ 2015-08-10 11:15 UTC (permalink / raw)
  To: u-boot

Ethernet gadget driver can be used both by both SPL and u-boot. Since
usb_eth_init() is the entry point for ethernet gadget driver, perform
board initialization there. Also perform the cleanup in usb_eth_halt.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
---
 drivers/usb/gadget/ether.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 141ff8b..850ba02 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -15,6 +15,7 @@
 #include <linux/usb/cdc.h>
 #include <linux/usb/gadget.h>
 #include <net.h>
+#include <usb.h>
 #include <malloc.h>
 #include <linux/ctype.h>
 
@@ -2312,6 +2313,8 @@ static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
 		goto fail;
 	}
 
+	board_usb_init(0, USB_INIT_DEVICE);
+
 	/* Configure default mac-addresses for the USB ethernet device */
 #ifdef CONFIG_USBNET_DEV_ADDR
 	strlcpy(dev_addr, CONFIG_USBNET_DEV_ADDR, sizeof(dev_addr));
@@ -2492,6 +2495,7 @@ void usb_eth_halt(struct eth_device *netdev)
 	}
 
 	usb_gadget_unregister_driver(&eth_driver);
+	board_usb_cleanup(0, USB_INIT_DEVICE);
 }
 
 static struct usb_gadget_driver eth_driver = {
-- 
1.7.9.5

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

* [U-Boot] [PATCH 2/3] usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop
  2015-08-10 11:15 [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes Kishon Vijay Abraham I
  2015-08-10 11:15 ` [U-Boot] [PATCH 1/3] usb: gadget: ether: Perform board initialization from ethernet gadget driver Kishon Vijay Abraham I
@ 2015-08-10 11:15 ` Kishon Vijay Abraham I
  2015-08-11  0:33   ` Tom Rini
  2015-08-10 11:15 ` [U-Boot] [PATCH 3/3] usb: gadget: ether: populate _reset_ callback Kishon Vijay Abraham I
  2015-08-11  6:54 ` [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes Lukasz Majewski
  3 siblings, 1 reply; 10+ messages in thread
From: Kishon Vijay Abraham I @ 2015-08-10 11:15 UTC (permalink / raw)
  To: u-boot

xhci omap driver has board_usb_init in xhci_hcd_init but doesn't have
the corresponding cleanup function in xhci_hcd_stop.

Fix it here by invoking board_usb_cleanup() in xhci_hcd_stop().

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
---
 drivers/usb/host/xhci-omap.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/xhci-omap.c b/drivers/usb/host/xhci-omap.c
index 3a55208..104e7a7 100644
--- a/drivers/usb/host/xhci-omap.c
+++ b/drivers/usb/host/xhci-omap.c
@@ -96,4 +96,5 @@ void xhci_hcd_stop(int index)
 	struct omap_xhci *ctx = &omap;
 
 	omap_xhci_core_exit(ctx);
+	board_usb_cleanup(index, USB_INIT_HOST);
 }
-- 
1.7.9.5

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

* [U-Boot] [PATCH 3/3] usb: gadget: ether: populate _reset_ callback
  2015-08-10 11:15 [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes Kishon Vijay Abraham I
  2015-08-10 11:15 ` [U-Boot] [PATCH 1/3] usb: gadget: ether: Perform board initialization from ethernet gadget driver Kishon Vijay Abraham I
  2015-08-10 11:15 ` [U-Boot] [PATCH 2/3] usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop Kishon Vijay Abraham I
@ 2015-08-10 11:15 ` Kishon Vijay Abraham I
  2015-08-10 12:20   ` Marek Vasut
  2015-08-11  0:33   ` Tom Rini
  2015-08-11  6:54 ` [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes Lukasz Majewski
  3 siblings, 2 replies; 10+ messages in thread
From: Kishon Vijay Abraham I @ 2015-08-10 11:15 UTC (permalink / raw)
  To: u-boot

populate _reset_ callback to the USB ethernet gadget since UDC core
expects every gadget driver to have the reset callback. This shouldn't
be needed once the ethernet gadget driver is adapted to use the
composite driver.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/usb/gadget/ether.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 850ba02..53f4672 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2505,6 +2505,7 @@ static struct usb_gadget_driver eth_driver = {
 	.unbind		= eth_unbind,
 
 	.setup		= eth_setup,
+	.reset		= eth_disconnect,
 	.disconnect	= eth_disconnect,
 
 	.suspend	= eth_suspend,
-- 
1.7.9.5

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

* [U-Boot] [PATCH 3/3] usb: gadget: ether: populate _reset_ callback
  2015-08-10 11:15 ` [U-Boot] [PATCH 3/3] usb: gadget: ether: populate _reset_ callback Kishon Vijay Abraham I
@ 2015-08-10 12:20   ` Marek Vasut
  2015-08-11  6:51     ` Lukasz Majewski
  2015-08-11  0:33   ` Tom Rini
  1 sibling, 1 reply; 10+ messages in thread
From: Marek Vasut @ 2015-08-10 12:20 UTC (permalink / raw)
  To: u-boot

On Monday, August 10, 2015 at 01:15:51 PM, Kishon Vijay Abraham I wrote:
> populate _reset_ callback to the USB ethernet gadget since UDC core
> expects every gadget driver to have the reset callback. This shouldn't
> be needed once the ethernet gadget driver is adapted to use the
> composite driver.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
>  drivers/usb/gadget/ether.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
> index 850ba02..53f4672 100644
> --- a/drivers/usb/gadget/ether.c
> +++ b/drivers/usb/gadget/ether.c
> @@ -2505,6 +2505,7 @@ static struct usb_gadget_driver eth_driver = {
>  	.unbind		= eth_unbind,
> 
>  	.setup		= eth_setup,
> +	.reset		= eth_disconnect,
>  	.disconnect	= eth_disconnect,

I'm not sure about this one, Lukasz, can you please comment ?

> 
>  	.suspend	= eth_suspend,

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH 1/3] usb: gadget: ether: Perform board initialization from ethernet gadget driver
  2015-08-10 11:15 ` [U-Boot] [PATCH 1/3] usb: gadget: ether: Perform board initialization from ethernet gadget driver Kishon Vijay Abraham I
@ 2015-08-11  0:33   ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2015-08-11  0:33 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 10, 2015 at 04:45:49PM +0530, Kishon Vijay Abraham I wrote:

> Ethernet gadget driver can be used both by both SPL and u-boot. Since
> usb_eth_init() is the entry point for ethernet gadget driver, perform
> board initialization there. Also perform the cleanup in usb_eth_halt.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> Acked-by: Marek Vasut <marex@denx.de>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150810/ce13f412/attachment.sig>

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

* [U-Boot] [PATCH 2/3] usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop
  2015-08-10 11:15 ` [U-Boot] [PATCH 2/3] usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop Kishon Vijay Abraham I
@ 2015-08-11  0:33   ` Tom Rini
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Rini @ 2015-08-11  0:33 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 10, 2015 at 04:45:50PM +0530, Kishon Vijay Abraham I wrote:

> xhci omap driver has board_usb_init in xhci_hcd_init but doesn't have
> the corresponding cleanup function in xhci_hcd_stop.
> 
> Fix it here by invoking board_usb_cleanup() in xhci_hcd_stop().
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> Acked-by: Marek Vasut <marex@denx.de>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150810/685772c7/attachment.sig>

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

* [U-Boot] [PATCH 3/3] usb: gadget: ether: populate _reset_ callback
  2015-08-10 11:15 ` [U-Boot] [PATCH 3/3] usb: gadget: ether: populate _reset_ callback Kishon Vijay Abraham I
  2015-08-10 12:20   ` Marek Vasut
@ 2015-08-11  0:33   ` Tom Rini
  1 sibling, 0 replies; 10+ messages in thread
From: Tom Rini @ 2015-08-11  0:33 UTC (permalink / raw)
  To: u-boot

On Mon, Aug 10, 2015 at 04:45:51PM +0530, Kishon Vijay Abraham I wrote:

> populate _reset_ callback to the USB ethernet gadget since UDC core
> expects every gadget driver to have the reset callback. This shouldn't
> be needed once the ethernet gadget driver is adapted to use the
> composite driver.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150810/5df7665b/attachment.sig>

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

* [U-Boot] [PATCH 3/3] usb: gadget: ether: populate _reset_ callback
  2015-08-10 12:20   ` Marek Vasut
@ 2015-08-11  6:51     ` Lukasz Majewski
  0 siblings, 0 replies; 10+ messages in thread
From: Lukasz Majewski @ 2015-08-11  6:51 UTC (permalink / raw)
  To: u-boot

Hi Marek,

> On Monday, August 10, 2015 at 01:15:51 PM, Kishon Vijay Abraham I
> wrote:
> > populate _reset_ callback to the USB ethernet gadget since UDC core
> > expects every gadget driver to have the reset callback. This
> > shouldn't be needed once the ethernet gadget driver is adapted to
> > use the composite driver.
> > 
> > Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> > ---
> >  drivers/usb/gadget/ether.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
> > index 850ba02..53f4672 100644
> > --- a/drivers/usb/gadget/ether.c
> > +++ b/drivers/usb/gadget/ether.c
> > @@ -2505,6 +2505,7 @@ static struct usb_gadget_driver eth_driver = {
> >  	.unbind		= eth_unbind,
> > 
> >  	.setup		= eth_setup,
> > +	.reset		= eth_disconnect,
> >  	.disconnect	= eth_disconnect,
> 
> I'm not sure about this one, Lukasz, can you please comment ?

This is correct.

> 
> > 
> >  	.suspend	= eth_suspend,
> 
> Best regards,
> Marek Vasut

Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

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

* [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes
  2015-08-10 11:15 [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes Kishon Vijay Abraham I
                   ` (2 preceding siblings ...)
  2015-08-10 11:15 ` [U-Boot] [PATCH 3/3] usb: gadget: ether: populate _reset_ callback Kishon Vijay Abraham I
@ 2015-08-11  6:54 ` Lukasz Majewski
  3 siblings, 0 replies; 10+ messages in thread
From: Lukasz Majewski @ 2015-08-11  6:54 UTC (permalink / raw)
  To: u-boot

Hi Kishon,

> This patch series is split from [1] to contain only the usb
> host/gadget fixes.
> 
> [1] ->
> http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/229188
> 
> Kishon Vijay Abraham I (3):
>   usb: gadget: ether: Perform board initialization from ethernet
> gadget driver
>   usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop
>   usb: gadget: ether: populate _reset_ callback
> 
>  drivers/usb/gadget/ether.c   |    5 +++++
>  drivers/usb/host/xhci-omap.c |    1 +
>  2 files changed, 6 insertions(+)
> 

Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

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

end of thread, other threads:[~2015-08-11  6:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-10 11:15 [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes Kishon Vijay Abraham I
2015-08-10 11:15 ` [U-Boot] [PATCH 1/3] usb: gadget: ether: Perform board initialization from ethernet gadget driver Kishon Vijay Abraham I
2015-08-11  0:33   ` Tom Rini
2015-08-10 11:15 ` [U-Boot] [PATCH 2/3] usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop Kishon Vijay Abraham I
2015-08-11  0:33   ` Tom Rini
2015-08-10 11:15 ` [U-Boot] [PATCH 3/3] usb: gadget: ether: populate _reset_ callback Kishon Vijay Abraham I
2015-08-10 12:20   ` Marek Vasut
2015-08-11  6:51     ` Lukasz Majewski
2015-08-11  0:33   ` Tom Rini
2015-08-11  6:54 ` [U-Boot] [PATCH 0/3] usb: host/gadget: Miscellaneous fixes Lukasz Majewski

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