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

tristan blunderer at gmail.com
Wed Nov 17 14:27:26 CET 2010


Hi Michael,

2010/11/17 Michael Zaidman <michael.zaidman at gmail.com>

> 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?
>

You're right, netconsole is there when the serial console is not an option.
The best example for me would be in a training class for embedded linux
(where u-boot is not the subject but only a tool to handle kernels and
rootfs), the need for several serial adapter is a real constrain that can be
avoided.

The sendnbc will broadcast in a loop NBC packets until one board answer by
sending the u-boot prompt. So, the user won't need to be aware of the right
moment to send the packets, he will just start broadcasting and then start
the board.


>
> 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.
>

here, I choosed to add the "wait on NBC packet" after the "serial console
autoboot abort" feature. This is done to keep the serial console with the
higher priority and give the opportunity to skip nbc feature if a serial
console is available.


>
> 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
>

Regards


-- 
618FE3EF


More information about the U-Boot mailing list