public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] USB: add CONFIG_USB_INIT to autoinitialize USB before main_loop
Date: Thu, 22 Dec 2011 05:04:32 +0100	[thread overview]
Message-ID: <201112220504.32730.marek.vasut@gmail.com> (raw)
In-Reply-To: <1324515956-1642-1-git-send-email-amartin@nvidia.com>

> This allows systems to pause autoboot with USB keyboard.  Tested on
> tegra2 seaboard.
> 
> Signed-off-by: Allen Martin <amartin@nvidia.com>

Can't you just add "usb reset" to preboot env?

M
> ---
>  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 <usb.h>
> +#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)

  reply	other threads:[~2011-12-22  4:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-22  1:05 [U-Boot] [PATCH] USB: add CONFIG_USB_INIT to autoinitialize USB before main_loop Allen Martin
2011-12-22  4:04 ` Marek Vasut [this message]
2011-12-22 18:54   ` Allen Martin
2011-12-22 19:10     ` Moffett, Kyle D
2011-12-22 19:27       ` Marek Vasut
2011-12-22 20:32         ` Allen Martin
2011-12-22 22:40           ` Allen Martin
2011-12-22 23:00             ` Wolfgang Denk
2011-12-22  8:06 ` Wolfgang Denk
2011-12-22  8:17   ` Igor Grinberg
  -- strict thread matches above, loose matches on Subject: below --
2011-12-22 22:25 Allen Martin
2011-12-23  0:52 Allen Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201112220504.32730.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox