From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mateusz Zalega Date: Mon, 26 Aug 2013 12:41:50 +0200 Subject: [U-Boot] [PATCH] usb: new board-specific USB init interface In-Reply-To: <201308222137.16834.marex@denx.de> References: <1375786242-11734-1-git-send-email-m.zalega@samsung.com> <201308211508.01104.marex@denx.de> <5215E8A4.1030304@samsung.com> <201308222137.16834.marex@denx.de> Message-ID: <521B30EE.4090907@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 08/22/13 21:37, Marek Vasut wrote: > Dear Mateusz Zalega, > >>>>> The EHCI supports multi-bus thing (passing the controller *), will this >>>>> be viable to pass in this case too, so the busses can be inited >>>>> selectively in host/gadget functions? >>>> >>>> Hello, Marek. >>>> I need more context. Could you show me the part of code in which you'd >>>> like to pass/use additional arguments? >>> >>> Please grep the 'controller' pointer that is passed to various functions >>> at least in the EHCI case. It would be nice to pass that to the init >>> functions too, no? >> >> It may be possible, but note that board_usb_init() is not used solely by >> EHCI code (please grep or cscope function calls). In order to do that, >> we would need to devise some generic interface. >> >> Is it worth the time? Are there targets that would benefit from this >> change? > > In case you want to separatelly init one port for USB peripheral mode and one > for Host mode, yes. We could add another argument: "int controller_index" (or maybe "const char* controller_id"), which would correspond to node names or aliases defined in devicetree source files (ie. see: tegra30.dtsi). List of available controllers would be accesible via ie. "usb list" command. Implementations of board_usb_init() would lookup applicable hardware in gd_t. We would need to find a way to differentiate between these controllers in cases when it would be expected from u-boot to automatically initialize devices it needs. It looks easy in case of ehci-tegra.c. Devicetree-agnostic boards would have their own "usb list" implementation, and those of them that can't initialize their controllers selectively would be left the way they are with just one additional, unused board_usb_init() argument. -- Mateusz Zalega Samsung R&D Institute Poland