All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC 00/10] New board-specific USB initialization interface
@ 2013-08-06 10:50 Mateusz Zalega
  2013-08-06 10:50 ` [U-Boot] [RFC 01/10] " Mateusz Zalega
                   ` (16 more replies)
  0 siblings, 17 replies; 63+ messages in thread
From: Mateusz Zalega @ 2013-08-06 10:50 UTC (permalink / raw)
  To: u-boot

Current implementation of do_dfu() and do_usb_mass_storage() requires
board-specific board_usb_init() which performs USB hardware initialization.

I noticed that several boards have such a function defined, named either
usb_board_init() (which binds to ohci-hcd.c driver and had been used solely
by it) or board_usb_init() (as in ehci-omap.c). I _assumed_ that these functions
do what's required by do_*() and renamed the earlier in order to unify the naming
convention.

It would:
+ make enabling DFU and UMS in these boards easier
+ clean up the namespace
+ improve code reusability
+ enable devs to postpone hardware init until it's needed (as in do_dfu())

Declarations of these functions were scattered all over the codebase. Seeing it
as a bad practice, I added declaration of usb_board_init() in usb.h and removed
the other.

I added a weak symbol for usb_board_init() in usb.c so that boards which do not
require USB initialization or have to initialize hardware earlier would compile
and run.

For boards which offer both USB device and host capabilities, you can specify
which part, host or device, to initialize, via function argument.

Does this approach sound good and/or reasonable?

Code compiles successfully for all ARM boards and was tested on Samsung Goni.

Mateusz Zalega (10):
  New board-specific USB initialization interface
  nvidia, tegra: new USB hardware init interface
  Voipac PXA270: new USB hardware init interface
  Trizeps IV: new USB hardware init interface
  Colibri PXA270: new USB hardware init interface
  icpdas lp8x4x: new USB hardware init interface
  esd pmc440: new USB hardware init interface
  esd apc405: new USB hardware init interface
  balloon3: new USB hardware init interface
  canyonlands: new USB hardware init interface

 arch/arm/include/asm/arch-tegra/usb.h         |  3 +--
 board/amcc/canyonlands/canyonlands.c          |  5 +++--
 board/balloon3/balloon3.c                     |  5 +++--
 board/esd/apc405/apc405.c                     |  5 +++--
 board/esd/pmc440/pmc440.c                     |  5 +++--
 board/icpdas/lp8x4x/lp8x4x.c                  |  5 +++--
 board/nvidia/common/board.c                   | 14 ++++++++++----
 board/toradex/colibri_pxa270/colibri_pxa270.c |  5 +++--
 board/trizepsiv/conxs.c                       |  5 +++--
 board/vpac270/vpac270.c                       |  5 +++--
 common/cmd_dfu.c                              |  5 ++---
 common/cmd_usb_mass_storage.c                 |  3 ++-
 common/usb.c                                  |  5 +++++
 drivers/usb/host/ehci-omap.c                  |  8 +-------
 drivers/usb/host/ehci-tegra.c                 |  2 +-
 drivers/usb/host/ohci-hcd.c                   |  4 ++--
 drivers/usb/host/ohci.h                       | 12 +++++-------
 include/g_dnl.h                               |  2 --
 include/usb.h                                 | 17 ++++++++++++++++-
 include/usb_mass_storage.h                    | 12 +++++-------
 20 files changed, 74 insertions(+), 53 deletions(-)

-- 
1.8.2.1

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

end of thread, other threads:[~2013-10-08 10:31 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06 10:50 [U-Boot] [RFC 00/10] New board-specific USB initialization interface Mateusz Zalega
2013-08-06 10:50 ` [U-Boot] [RFC 01/10] " Mateusz Zalega
2013-08-07 16:23   ` Stephen Warren
2013-08-11 18:04   ` Marek Vasut
2013-08-12  9:33     ` Mateusz Zalega
2013-08-06 10:50 ` [U-Boot] [RFC 02/10] nvidia, tegra: new USB hardware init interface Mateusz Zalega
2013-08-07 16:26   ` Stephen Warren
2013-08-06 10:50 ` [U-Boot] [RFC 03/10] Voipac PXA270: " Mateusz Zalega
2013-08-06 10:50 ` [U-Boot] [RFC 04/10] Trizeps IV: " Mateusz Zalega
2013-08-06 10:50 ` [U-Boot] [RFC 05/10] Colibri PXA270: " Mateusz Zalega
2013-08-06 10:50 ` [U-Boot] [RFC 06/10] icpdas lp8x4x: " Mateusz Zalega
2013-08-11 18:07   ` Marek Vasut
2013-08-06 10:50 ` [U-Boot] [RFC 07/10] esd pmc440: " Mateusz Zalega
2013-08-06 10:50 ` [U-Boot] [RFC 08/10] esd apc405: " Mateusz Zalega
2013-08-06 10:50 ` [U-Boot] [RFC 09/10] balloon3: " Mateusz Zalega
2013-08-06 10:50 ` [U-Boot] [RFC 10/10] canyonlands: " Mateusz Zalega
2013-08-06 11:40 ` [U-Boot] [RFC 00/10] New board-specific USB initialization interface Wolfgang Denk
2013-08-07 15:57   ` Mateusz Zalega
2013-08-07 16:59     ` Mateusz Zalega
2013-08-07 17:01     ` Wolfgang Denk
2013-08-20 13:35 ` [U-Boot] [PATCH] usb: new board-specific USB init interface Mateusz Zalega
2013-08-21  3:33   ` Marek Vasut
2013-08-21 10:22     ` Mateusz Zalega
2013-08-21 13:08       ` Marek Vasut
2013-08-22 10:32         ` Mateusz Zalega
2013-08-22 19:37           ` Marek Vasut
2013-08-26 10:41             ` Mateusz Zalega
2013-08-27 19:50               ` Marek Vasut
2013-08-21  8:33 ` [U-Boot] [PATCH v2] " Mateusz Zalega
2013-08-27 15:51   ` Mateusz Zalega
2013-09-03 10:41 ` [U-Boot] [PATCH v3] " Mateusz Zalega
2013-09-05 15:50   ` Marek Vasut
2013-09-05 17:37     ` Mateusz Zalega
2013-09-05 17:51       ` Marek Vasut
2013-09-06 11:22         ` Mateusz Zalega
2013-09-06 11:24           ` Marek Vasut
2013-09-06 11:36             ` Mateusz Zalega
2013-09-06 11:40               ` Marek Vasut
2013-09-06 12:17                 ` Mateusz Zalega
2013-09-15 14:21                   ` Marek Vasut
2013-09-16  8:27                     ` Mateusz Zalega
2013-09-10 15:10 ` [U-Boot] [PATCH v4] " Mateusz Zalega
2013-09-15 16:44   ` Marek Vasut
2013-09-16  9:10     ` Mateusz Zalega
2013-09-16 14:24       ` Marek Vasut
2013-09-17 16:11   ` Igor Grinberg
2013-09-18 10:58     ` Mateusz Zalega
2013-09-19 13:34   ` Marek Vasut
2013-09-19 13:40     ` Marek Vasut
2013-09-19 14:34       ` Marek Vasut
2013-09-24 11:54         ` Minkyu Kang
2013-09-24 13:15           ` Marek Vasut
2013-09-25 11:01         ` Mateusz Zalega
2013-09-26  1:50           ` Marek Vasut
2013-09-26 10:04             ` Mateusz Zalega
2013-10-02 19:11 ` [U-Boot] [PATCH v5] " Mateusz Zalega
2013-10-03 15:16   ` Marek Vasut
2013-10-04 17:22 ` [U-Boot] [PATCH v6] " Mateusz Zalega
2013-10-05  0:48   ` Troy Kisky
2013-10-07 10:32     ` Mateusz Zalega
2013-10-08  0:09       ` Troy Kisky
2013-10-08 10:31         ` Marek Vasut
2013-10-06 13:55   ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.