[U-Boot] [PATCH 0/3] Net Boot Controller

Michael Zaidman michael.zaidman at gmail.com
Wed Nov 17 12:34:54 CET 2010


Hi Tristan,

On Tue, Nov 16, 2010 at 8:04 PM, <tristan.lelong at blunderer.org> wrote:
>
> From: Tristan Lelong <tristan.lelong at blunderer.org>
>
> This patch allow to interrupt u-boot autoboot from remote PC and auto-reconfigure a netconsole redirected to this remote PC
>
> Tristan Lelong (3):
>  Add support for Net Boot Controller (NBC) packet
>  Add sendnbc tool to broadcast NBC magic packet
>  Add the NBC + netconsole corresponding documentation
>

We usually need netconsole when serial console is not the option. The
u-boot autorun lasts for few seconds only afterwards the control is
passed to OS. That means that u-boot will be capable of NBC catching
during very sort period of time. How the user is supposed to know when
to issue the NBC packet?

It is also not clear how proposed feature will coexist with BOOTP?

In order to remotely connect to u-boot via netconsole I use the
following approach - the u-boot wakes up with serial console and after
few seconds switches to netconsole if user did not hit any key to stay
with serial console.

The code is very simple and compact.

Add to your board configuration file:

#define CONFIG_NETCONSOLE           1
#define CONFIG_PREBOOT      "setenv stdout nc;setenv stderr nc;setenv stdin nc;"

Override the last_stage_init() in your board .c file:

int last_stage_init(void)
{
	int i, abort = 0;
	int bootdelay = 2; /* Seconds */

	printf("\nHit any key to stay with serial console: %2d ", bootdelay);

	while ((bootdelay-- > 0) && (!abort)) {

		/* delay 100 * 10mS */
		for (i=0; !abort && i<100; ++i) {
			if (tstc()) { /* we got a key press */
				abort  = 1;
				bootdelay = 0; /* no more delay */
				(void)getc(); /* consume input */
				setenv("preboot","echo");
				break;
			}
			udelay(10000);
		}
		printf("\b\b\b%2d ", bootdelay);
	}
	putc('\n');

	return 0;
}



Regards,
Michael


More information about the U-Boot mailing list