Re: [U-Boot] [PATCH v6] usb: new board-specific USB init interface

2013-10-08 Thread Marek Vasut
Dear Troy Kisky,

> On 10/7/2013 3:32 AM, Mateusz Zalega wrote:
> > On 10/05/13 02:48, Troy Kisky wrote:
> >> On 10/4/2013 10:22 AM, Mateusz Zalega wrote:
> >>>+/*
> >>> 
> >>> + * You can initialize platform's USB host or device
> >>> + * ports by passing this enum as an argument to
> >>> + * board_usb_init().
> >>> + */
> >>> +enum board_usb_init_type {
> >>> +USB_INIT_HOST,
> >>> +USB_INIT_DEVICE
> >>> +};
> >>> +
> >> 
> >> I'm a little late to the game, but can you rename this to just
> >> usb_init_type ?
> >> I'm wanting to use this as a parameter to usb_lowlevel_init, moving it
> >> above the usb_lowlevel_init definition would help me too.
> > 
> > Looks like Marek already applied it. You can always send another RFC.
> > 
> > Regards,
> 
> So you are O.K. with me sending a rename patch?

Send a patch on top of usb/next please.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6] usb: new board-specific USB init interface

2013-10-07 Thread Troy Kisky

On 10/7/2013 3:32 AM, Mateusz Zalega wrote:

On 10/05/13 02:48, Troy Kisky wrote:

On 10/4/2013 10:22 AM, Mateusz Zalega wrote:

   +/*
+ * You can initialize platform's USB host or device
+ * ports by passing this enum as an argument to
+ * board_usb_init().
+ */
+enum board_usb_init_type {
+USB_INIT_HOST,
+USB_INIT_DEVICE
+};
+


I'm a little late to the game, but can you rename this to just
usb_init_type ?
I'm wanting to use this as a parameter to usb_lowlevel_init, moving it
above the usb_lowlevel_init definition would help me too.

Looks like Marek already applied it. You can always send another RFC.

Regards,


So you are O.K. with me sending a rename patch?

Thanks
Troy

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6] usb: new board-specific USB init interface

2013-10-07 Thread Mateusz Zalega
On 10/05/13 02:48, Troy Kisky wrote:
> On 10/4/2013 10:22 AM, Mateusz Zalega wrote:
>>   +/*
>> + * You can initialize platform's USB host or device
>> + * ports by passing this enum as an argument to
>> + * board_usb_init().
>> + */
>> +enum board_usb_init_type {
>> +USB_INIT_HOST,
>> +USB_INIT_DEVICE
>> +};
>> +
>>
> I'm a little late to the game, but can you rename this to just
> usb_init_type ?
> I'm wanting to use this as a parameter to usb_lowlevel_init, moving it
> above the usb_lowlevel_init definition would help me too.

Looks like Marek already applied it. You can always send another RFC.

Regards,

-- 
Mateusz Zalega
Samsung R&D Institute Poland
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6] usb: new board-specific USB init interface

2013-10-06 Thread Marek Vasut
Dear Mateusz Zalega,

> This commit unifies board-specific USB initialization implementations
> under one symbol (usb_board_init), declaration of which is available in
> usb.h.
> 
> New API allows selective initialization of USB controllers whenever needed.
> 
> Signed-off-by: Mateusz Zalega 
> Signed-off-by: Kyungmin Park 
> Reviewed-by: Lukasz Majewski 
> Cc: Marek Vasut 
> Cc: Lukasz Majewski 
> ---
> Changes since RFC (v1):
> - NVIDIA Tegra doesn't postpone its USB init anymore
> - board_usb_init()'s sole argument name was shortened
> - networking code comment style (/* blurb...) dropped
> - squashed RFC changes so that patch won't break bisect

Applied to usb/next, thanks

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6] usb: new board-specific USB init interface

2013-10-04 Thread Troy Kisky

On 10/4/2013 10:22 AM, Mateusz Zalega wrote:
  
+/*

+ * You can initialize platform's USB host or device
+ * ports by passing this enum as an argument to
+ * board_usb_init().
+ */
+enum board_usb_init_type {
+   USB_INIT_HOST,
+   USB_INIT_DEVICE
+};
+

I'm a little late to the game, but can you rename this to just 
usb_init_type ?

I'm wanting to use this as a parameter to usb_lowlevel_init, moving it
above the usb_lowlevel_init definition would help me too.


Thanks
Troy

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v6] usb: new board-specific USB init interface

2013-10-04 Thread Mateusz Zalega
This commit unifies board-specific USB initialization implementations
under one symbol (usb_board_init), declaration of which is available in
usb.h.

New API allows selective initialization of USB controllers whenever needed.

Signed-off-by: Mateusz Zalega 
Signed-off-by: Kyungmin Park 
Reviewed-by: Lukasz Majewski 
Cc: Marek Vasut 
Cc: Lukasz Majewski 
---
Changes since RFC (v1):
- NVIDIA Tegra doesn't postpone its USB init anymore
- board_usb_init()'s sole argument name was shortened
- networking code comment style (/* blurb...) dropped
- squashed RFC changes so that patch won't break bisect

v2 changes:
- commit message fixup

v3 changes:
- added 'index' argument to perform selective port initialization

v4 changes:
- board_usb_init_fail() renamed to board_usb_cleanup()
- board_usb_cleanup() accepts controller index and init type
- DFU and UMS commands don't init all USB controllers anymore
- minor related fixes & refactorization

v5 changes:
- fixed an issue with boards based on canyonlands.c
- patch passes MAKEALL -a powerpc (vide: ^)

v6 changes:
- rebased onto usb/next
---
 arch/arm/include/asm/arch-tegra/usb.h |  3 +-
 arch/arm/include/asm/ehci-omap.h  |  4 +--
 board/amcc/canyonlands/canyonlands.c  |  5 +--
 board/balloon3/balloon3.c |  7 +++--
 board/compulab/cm_t35/cm_t35.c|  2 +-
 board/esd/apc405/apc405.c |  8 ++---
 board/esd/pmc440/pmc440.c |  8 ++---
 board/htkw/mcx/mcx.c  |  2 +-
 board/icpdas/lp8x4x/lp8x4x.c  |  7 +++--
 board/nvidia/common/board.c   |  4 ++-
 board/samsung/trats/trats.c   |  5 +--
 board/technexion/twister/twister.c|  2 +-
 board/teejet/mt_ventoux/mt_ventoux.c  |  2 +-
 board/ti/beagle/beagle.c  |  2 +-
 board/ti/omap5_uevm/evm.c |  2 +-
 board/ti/panda/panda.c|  2 +-
 board/toradex/colibri_pxa270/colibri_pxa270.c |  7 +++--
 board/trizepsiv/conxs.c   |  7 +++--
 board/vpac270/vpac270.c   |  7 +++--
 common/cmd_dfu.c  | 30 ++
 common/cmd_usb_mass_storage.c | 44 ++-
 common/usb.c  |  6 
 drivers/dfu/dfu.c |  2 +-
 drivers/usb/host/ehci-omap.c  | 12 ++--
 drivers/usb/host/ehci-tegra.c |  2 +-
 drivers/usb/host/ohci-hcd.c   |  4 +--
 drivers/usb/host/ohci.h   | 11 +++
 include/g_dnl.h   |  2 --
 include/usb.h | 30 --
 include/usb_mass_storage.h| 13 +++-
 30 files changed, 138 insertions(+), 104 deletions(-)

diff --git a/arch/arm/include/asm/arch-tegra/usb.h 
b/arch/arm/include/asm/arch-tegra/usb.h
index f66257c..a1efd07 100644
--- a/arch/arm/include/asm/arch-tegra/usb.h
+++ b/arch/arm/include/asm/arch-tegra/usb.h
@@ -131,8 +131,7 @@
 /* USB3_IF_USB_PHY_VBUS_SENSORS_0 */
 #define VBUS_VLD_STS   (1 << 26)
 
-
 /* Setup USB on the board */
-int board_usb_init(const void *blob);
+int usb_process_devicetree(const void *blob);
 
 #endif /* _TEGRA_USB_H_ */
diff --git a/arch/arm/include/asm/ehci-omap.h b/arch/arm/include/asm/ehci-omap.h
index ac83a53..c7bca05 100644
--- a/arch/arm/include/asm/ehci-omap.h
+++ b/arch/arm/include/asm/ehci-omap.h
@@ -145,8 +145,8 @@ struct omap_ehci {
 struct ehci_hccr;
 struct ehci_hcor;
 
-int omap_ehci_hcd_init(struct omap_usbhs_board_data *usbhs_pdata,
-   struct ehci_hccr **hccr, struct ehci_hcor **hcor);
+int omap_ehci_hcd_init(int index, struct omap_usbhs_board_data *usbhs_pdata,
+  struct ehci_hccr **hccr, struct ehci_hcor **hcor);
 int omap_ehci_hcd_stop(void);
 
 #endif /* _OMAP_COMMON_EHCI_H_ */
diff --git a/board/amcc/canyonlands/canyonlands.c 
b/board/amcc/canyonlands/canyonlands.c
index cc36f45..395095e 100644
--- a/board/amcc/canyonlands/canyonlands.c
+++ b/board/amcc/canyonlands/canyonlands.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 
 extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH 
chips */
 
@@ -188,7 +189,7 @@ int board_early_init_f(void)
 }
 
 #if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_BOARD_INIT)
-int usb_board_init(void)
+int board_usb_init(int index, enum board_usb_init_type init)
 {
struct board_bcsr *bcsr_data =
(struct board_bcsr *)CONFIG_SYS_BCSR_BASE;
@@ -229,7 +230,7 @@ int usb_board_stop(void)
return 0;
 }
 
-int usb_board_init_fail(void)
+int board_usb_cleanup(int index, enum board_usb_init_type init)
 {
return usb_board_stop();
 }
diff --git a/board/balloon3/balloon3.c b/board/balloon3/balloon3.c
index ecbac16..19c0e02 100644
--- a/board/balloon3/ba