From patchwork Thu Dec 22 01:05:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allen Martin X-Patchwork-Id: 132764 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 BD005B7143 for ; Thu, 22 Dec 2011 12:06:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6F89F280B5; Thu, 22 Dec 2011 02:06:31 +0100 (CET) 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 2OprjqStEwcf; Thu, 22 Dec 2011 02:06:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1060280B6; Thu, 22 Dec 2011 02:06:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E3DC1280B6 for ; Thu, 22 Dec 2011 02:06:26 +0100 (CET) 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 gCc+hawXXtQj for ; Thu, 22 Dec 2011 02:06:25 +0100 (CET) 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 hqemgate03.nvidia.com (hqemgate03.nvidia.com [216.228.121.140]) by theia.denx.de (Postfix) with ESMTPS id 7FD5F280B5 for ; Thu, 22 Dec 2011 02:06:22 +0100 (CET) Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate03.nvidia.com id ; Wed, 21 Dec 2011 17:19:44 -0800 Received: from hqnvemgw02.nvidia.com ([172.17.108.22]) by hqnvupgp08.nvidia.com (PGP Universal service); Wed, 21 Dec 2011 17:06:18 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Wed, 21 Dec 2011 17:06:18 -0800 Received: from daphne.nvidia.com (Not Verified[172.16.212.96]) by hqnvemgw02.nvidia.com with MailMarshal (v6, 7, 2, 8378) id ; Wed, 21 Dec 2011 17:06:19 -0800 Received: from badger.nvidia.com (dhcp-172-17-186-24.nvidia.com [172.17.186.24]) by daphne.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id pBM16HwC017246; Wed, 21 Dec 2011 17:06:18 -0800 (PST) From: Allen Martin To: u-boot@lists.denx.de Date: Wed, 21 Dec 2011 17:05:56 -0800 Message-Id: <1324515956-1642-1-git-send-email-amartin@nvidia.com> X-Mailer: git-send-email 1.7.5.4 X-NVConfidentiality: public Subject: [U-Boot] [PATCH] USB: add CONFIG_USB_INIT to autoinitialize USB before main_loop 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 allows systems to pause autoboot with USB keyboard. Tested on tegra2 seaboard. Signed-off-by: Allen Martin --- README | 5 +++++ arch/arm/lib/board.c | 9 +++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/README b/README index 882483b..40e8481 100644 --- a/README +++ b/README @@ -1132,6 +1132,11 @@ The following options need to be configured: CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the txfilltuning field in the EHCI controller on reset. + CONFIG_USB_INIT causes USB to be initialized + automatically before the main command loop. This is + useful if you have a USB keyboard and you want to use + it to stop autoboot. + - USB Device: Define the below if you wish to use the USB console. Once firmware is rebuilt from a serial console issue the diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 3d78274..6787048 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -64,6 +64,10 @@ #include "../drivers/net/lan91c96.h" #endif +#ifdef CONFIG_USB_INIT +#include +#endif + DECLARE_GLOBAL_DATA_PTR; ulong monitor_flash_len; @@ -548,6 +552,11 @@ void board_init_r(gd_t *id, ulong dest_addr) api_init(); #endif +#ifdef CONFIG_USB_INIT + /* this needs to be before console init for USB kbd to work as stdin */ + usb_init(); +#endif + console_init_r(); /* fully init console as a device */ #if defined(CONFIG_ARCH_MISC_INIT)