From patchwork Tue Aug 6 10:50:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Zalega X-Patchwork-Id: 265011 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B1A4F2C0040 for ; Tue, 6 Aug 2013 21:07:32 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B05984A0F9; Tue, 6 Aug 2013 13:06:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id amEfScpkv8ia; Tue, 6 Aug 2013 13:06:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 235994A0FA; Tue, 6 Aug 2013 13:04:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 585954A019 for ; Tue, 6 Aug 2013 13:02:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UouxIWCcp5G0 for ; Tue, 6 Aug 2013 13:01:59 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by theia.denx.de (Postfix) with ESMTP id 5EDC34A023 for ; Tue, 6 Aug 2013 13:01:49 +0200 (CEST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MR300M2CVEJSG70@mailout2.w1.samsung.com> for u-boot@lists.denx.de; Tue, 06 Aug 2013 11:51:25 +0100 (BST) X-AuditID: cbfec7f4-b7f5f6d000000ff6-6b-5200d52d31e3 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 29.D1.04086.D25D0025; Tue, 06 Aug 2013 11:51:25 +0100 (BST) Received: from kernelpanic.DIGITAL.local ([106.120.53.14]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MR300KSLVHO0R70@eusync4.samsung.com>; Tue, 06 Aug 2013 11:51:25 +0100 (BST) From: Mateusz Zalega To: u-boot@lists.denx.de Date: Tue, 06 Aug 2013 12:50:34 +0200 Message-id: <1375786242-11734-3-git-send-email-m.zalega@samsung.com> X-Mailer: git-send-email 1.8.2.1 In-reply-to: <1375786242-11734-1-git-send-email-m.zalega@samsung.com> References: <1375786242-11734-1-git-send-email-m.zalega@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLJMWRmVeSWpSXmKPExsVy+t/xa7q6VxmCDKbfMbQ42/SG3WLuuylM FhdO7WayeLu3k92BxePsnR2MHr3N79g8+rasYgxgjuKySUnNySxLLdK3S+DKuP7xCWvBc76K a3f3MDcwHubpYuTkkBAwkfg26SUzhC0mceHeejYQW0hgKaPEoS3sXYxcQHY/k8TFc4/AitgE tCVu7J3PDmKLCEhI/Oq/yghiMwuUS2w71AcWFxZwlmhc8YIJxGYRUJX4sv4nWJxXwEVi59tG VohlChLHt28D6+UUcJVo+fuBFWKxi8TvLd9YJjDyLmBkWMUomlqaXFCclJ5rqFecmFtcmpeu l5yfu4kREiRfdjAuPmZ1iFGAg1GJhzfh6v9AIdbEsuLK3EOMEhzMSiK8KjsZgoR4UxIrq1KL 8uOLSnNSiw8xMnFwSjUwMt3Zd3s31/I7nCILciY811/TWCopGF0/jTvX7O0hx4+dKq9WR0g4 etSn7Tn47FBB4sS8in3R/RtsIwMXT81ewuHpovekZeNeDf5X8buacosj9i3UcAj14DneWa7x Sl9D66oHp4W+103F++zyupqBAXV9DxvSzXy2VL1NkHNOPnE35cqD+iYlluKMREMt5qLiRAAN ktDg8AEAAA== X-Mailman-Approved-At: Tue, 06 Aug 2013 13:04:03 +0200 Cc: Kyungmin Park , Tom Warren , Mateusz Zalega Subject: [U-Boot] [RFC 02/10] nvidia, tegra: new USB hardware init interface X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This commit postpones initialization of USB hardware until usb_board_init() is called by a command implementation (ie. do_dfu()) or a driver. Signed-off-by: Mateusz Zalega Signed-off-by: Kyungmin Park Cc: Tom Warren --- arch/arm/include/asm/arch-tegra/usb.h | 3 +-- board/nvidia/common/board.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 6 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/board/nvidia/common/board.c b/board/nvidia/common/board.c index 126e56e..cdb02ee 100644 --- a/board/nvidia/common/board.c +++ b/board/nvidia/common/board.c @@ -32,6 +32,7 @@ #ifdef CONFIG_USB_EHCI_TEGRA #include #include +#include #endif #ifdef CONFIG_TEGRA_MMC #include @@ -151,10 +152,6 @@ int board_init(void) # endif /* CONFIG_TEGRA_PMU */ #endif /* CONFIG_SYS_I2C_TEGRA */ -#ifdef CONFIG_USB_EHCI_TEGRA - pin_mux_usb(); - board_usb_init(gd->fdt_blob); -#endif #ifdef CONFIG_LCD tegra_lcd_check_next_stage(gd->fdt_blob, 0); #endif @@ -257,3 +254,12 @@ void pad_init_mmc(struct mmc_host *host) #endif /* T30 */ } #endif /* MMC */ + +#ifdef CONFIG_USB_EHCI_TEGRA +int board_usb_init(enum board_usb_init_type what_to_init) +{ + pin_mux_usb(); + usb_process_devicetree(gd->fdt_blob); + return 0; +} +#endif