public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget
@ 2013-08-19 15:17 Lukasz Majewski
  2013-08-19 15:17 ` [U-Boot] [PATCH 2/2] usb:dfu:g_dnl: Refactoring the string definition code for g_dnl driver Lukasz Majewski
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lukasz Majewski @ 2013-08-19 15:17 UTC (permalink / raw)
  To: u-boot

USB composite gadget (g_dnl) supports only one configuration. Due to that
the corresponding field - bConfigurationValue has been changed.

Moreover more descriptive names were chosen for relevant fields.

Windows XP setup:
- Thesyscon USB Descriptor Dumper
- zadig_xp program for WinUSB installation (which is required by dfu-util)
- dfu-util for windows (version 0.6)
- TRATS target connected via USB hub to test Win XP machine.

Tested at: Trats - Exynos4210

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: "Egli, Samuel" <samuel.egli@siemens.com>
---
 drivers/usb/gadget/g_dnl.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index cbfcb2d..3cb7302 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -31,8 +31,10 @@
 
 #define STRING_MANUFACTURER 25
 #define STRING_PRODUCT 2
+/* Index of String Descriptor describing this configuration */
 #define STRING_USBDOWN 2
-#define CONFIG_USBDOWNLOADER 2
+/* Number of supported configurations */
+#define CONFIGURATION_NUMBER 1
 
 #define DRIVER_VERSION		"usb_dnl 2.0"
 
@@ -104,7 +106,7 @@ static int g_dnl_config_register(struct usb_composite_dev *cdev)
 	static struct usb_configuration config = {
 		.label = "usb_dnload",
 		.bmAttributes =	USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
-		.bConfigurationValue =	CONFIG_USBDOWNLOADER,
+		.bConfigurationValue =	CONFIGURATION_NUMBER,
 		.iConfiguration =	STRING_USBDOWN,
 
 		.bind = g_dnl_do_config,
-- 
1.7.10.4

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

* [U-Boot] [PATCH 2/2] usb:dfu:g_dnl: Refactoring the string definition code for g_dnl driver
  2013-08-19 15:17 [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget Lukasz Majewski
@ 2013-08-19 15:17 ` Lukasz Majewski
  2013-08-19 22:51 ` [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget Marek Vasut
  2013-08-20 15:10 ` Egli, Samuel
  2 siblings, 0 replies; 6+ messages in thread
From: Lukasz Majewski @ 2013-08-19 15:17 UTC (permalink / raw)
  To: u-boot

The manufacturer and product IDs are dynamically assigned when gadget is
bind.
Now the IDs aren't assigned at struct g_dnl_string_defs definition.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
Cc: "Egli, Samuel" <samuel.egli@siemens.com>
---
 drivers/usb/gadget/g_dnl.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index 3cb7302..a3e05a8 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -56,11 +56,14 @@ static struct usb_device_descriptor device_desc = {
 	.bNumConfigurations = 1,
 };
 
-/* static strings, in UTF-8 */
+/*
+ * static strings, in UTF-8
+ * IDs for those strings are assigned dynamically at g_dnl_bind()
+ */
 static struct usb_string g_dnl_string_defs[] = {
-	{ 0, manufacturer, },
-	{ 1, product, },
-	{  }		/* end of list */
+	{.s = manufacturer},
+	{.s = product},
+	{ }		/* end of list */
 };
 
 static struct usb_gadget_strings g_dnl_string_tab = {
-- 
1.7.10.4

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

* [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget
  2013-08-19 15:17 [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget Lukasz Majewski
  2013-08-19 15:17 ` [U-Boot] [PATCH 2/2] usb:dfu:g_dnl: Refactoring the string definition code for g_dnl driver Lukasz Majewski
@ 2013-08-19 22:51 ` Marek Vasut
  2013-08-20 15:10 ` Egli, Samuel
  2 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2013-08-19 22:51 UTC (permalink / raw)
  To: u-boot

Dear Lukasz Majewski,

> USB composite gadget (g_dnl) supports only one configuration. Due to that
> the corresponding field - bConfigurationValue has been changed.
> 
> Moreover more descriptive names were chosen for relevant fields.
> 
> Windows XP setup:
> - Thesyscon USB Descriptor Dumper
> - zadig_xp program for WinUSB installation (which is required by dfu-util)
> - dfu-util for windows (version 0.6)
> - TRATS target connected via USB hub to test Win XP machine.

Applied both, thanks.

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget
  2013-08-19 15:17 [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget Lukasz Majewski
  2013-08-19 15:17 ` [U-Boot] [PATCH 2/2] usb:dfu:g_dnl: Refactoring the string definition code for g_dnl driver Lukasz Majewski
  2013-08-19 22:51 ` [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget Marek Vasut
@ 2013-08-20 15:10 ` Egli, Samuel
  2013-08-21  3:16   ` Marek Vasut
  2 siblings, 1 reply; 6+ messages in thread
From: Egli, Samuel @ 2013-08-20 15:10 UTC (permalink / raw)
  To: u-boot

Hi Lukasz,

>-----Original Message-----
>From: Lukasz Majewski [mailto:l.majewski at samsung.com]
>Sent: Montag, 19. August 2013 17:17
>To: u-boot at lists.denx.de
>Cc: Lukasz Majewski; Heiko Schocher; Tormod Volden; Lukasz Majewski;
>Marek Vasut; Egli, Samuel
>Subject: [PATCH 1/2] usb:dfu:g_dnl: Change number of exported
>configurations at composite gadget
>
>USB composite gadget (g_dnl) supports only one configuration. Due to
>that the corresponding field - bConfigurationValue has been changed.
>
>Moreover more descriptive names were chosen for relevant fields.
>
>Windows XP setup:
>- Thesyscon USB Descriptor Dumper
>- zadig_xp program for WinUSB installation (which is required by dfu-
>util)
>- dfu-util for windows (version 0.6)
>- TRATS target connected via USB hub to test Win XP machine.
>
>Tested at: Trats - Exynos4210

I applied both patches and tested download from windows 7 with dfu-util 0.7 
and it worked all fine. Thanks!

Best

Sam

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

* [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget
  2013-08-20 15:10 ` Egli, Samuel
@ 2013-08-21  3:16   ` Marek Vasut
  2013-08-21  6:19     ` Lukasz Majewski
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2013-08-21  3:16 UTC (permalink / raw)
  To: u-boot

Dear Egli, Samuel,

> Hi Lukasz,
> 
> >-----Original Message-----
> >From: Lukasz Majewski [mailto:l.majewski at samsung.com]
> >Sent: Montag, 19. August 2013 17:17
> >To: u-boot at lists.denx.de
> >Cc: Lukasz Majewski; Heiko Schocher; Tormod Volden; Lukasz Majewski;
> >Marek Vasut; Egli, Samuel
> >Subject: [PATCH 1/2] usb:dfu:g_dnl: Change number of exported
> >configurations at composite gadget
> >
> >USB composite gadget (g_dnl) supports only one configuration. Due to
> >that the corresponding field - bConfigurationValue has been changed.
> >
> >Moreover more descriptive names were chosen for relevant fields.
> >
> >Windows XP setup:
> >- Thesyscon USB Descriptor Dumper
> >- zadig_xp program for WinUSB installation (which is required by dfu-
> >util)
> >- dfu-util for windows (version 0.6)
> >- TRATS target connected via USB hub to test Win XP machine.
> >
> >Tested at: Trats - Exynos4210
> 
> I applied both patches and tested download from windows 7 with dfu-util 0.7
> and it worked all fine. Thanks!

Will it also work with my playstation and/or other game loaders ? (lol)

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget
  2013-08-21  3:16   ` Marek Vasut
@ 2013-08-21  6:19     ` Lukasz Majewski
  0 siblings, 0 replies; 6+ messages in thread
From: Lukasz Majewski @ 2013-08-21  6:19 UTC (permalink / raw)
  To: u-boot

On Wed, 21 Aug 2013 05:16:46 +0200 Marek Vasut marex at denx.de wrote,
> Dear Egli, Samuel,
> 
> > Hi Lukasz,
> > 
> > >-----Original Message-----
> > >From: Lukasz Majewski [mailto:l.majewski at samsung.com]
> > >Sent: Montag, 19. August 2013 17:17
> > >To: u-boot at lists.denx.de
> > >Cc: Lukasz Majewski; Heiko Schocher; Tormod Volden; Lukasz
> > >Majewski; Marek Vasut; Egli, Samuel
> > >Subject: [PATCH 1/2] usb:dfu:g_dnl: Change number of exported
> > >configurations at composite gadget
> > >
> > >USB composite gadget (g_dnl) supports only one configuration. Due
> > >to that the corresponding field - bConfigurationValue has been
> > >changed.
> > >
> > >Moreover more descriptive names were chosen for relevant fields.
> > >
> > >Windows XP setup:
> > >- Thesyscon USB Descriptor Dumper
> > >- zadig_xp program for WinUSB installation (which is required by
> > >dfu- util)
> > >- dfu-util for windows (version 0.6)
> > >- TRATS target connected via USB hub to test Win XP machine.
> > >
> > >Tested at: Trats - Exynos4210
> > 
> > I applied both patches and tested download from windows 7 with
> > dfu-util 0.7 and it worked all fine. Thanks!
> 
> Will it also work with my playstation and/or other game loaders ?
> (lol)

I'm not very familiar with PS, but yes it is possible to setup working
DFU connection from Windows now.
The only thing you need to remember is to install the WinUSB (via
zadig program) for the vendor:device supporting DFU.

> 
> Best regards,
> Marek Vasut



-- 
Best regards,

Lukasz Majewski

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

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

end of thread, other threads:[~2013-08-21  6:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-19 15:17 [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget Lukasz Majewski
2013-08-19 15:17 ` [U-Boot] [PATCH 2/2] usb:dfu:g_dnl: Refactoring the string definition code for g_dnl driver Lukasz Majewski
2013-08-19 22:51 ` [U-Boot] [PATCH 1/2] usb:dfu:g_dnl: Change number of exported configurations at composite gadget Marek Vasut
2013-08-20 15:10 ` Egli, Samuel
2013-08-21  3:16   ` Marek Vasut
2013-08-21  6:19     ` Lukasz Majewski

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