[U-Boot] [PATCH 5/5] Warn when the machine ID isn't passed to an ARM kernel and u-boot is compiled in debug mode. The kernel cannot boot without it.

Christopher Harvey charvey at matrox.com
Mon Jul 4 20:55:54 CEST 2011


On Mon, Jul 04, 2011 at 02:08:44PM -0400, Jason wrote:
> On Mon, Jul 04, 2011 at 01:45:41PM -0400, Christopher Harvey wrote:
> > Signed-off-by: Christopher Harvey <charvey at matrox.com>
> > ---
> >  arch/arm/lib/board.c |    4 ++++
> >  arch/arm/lib/bootm.c |    6 ++++++
> >  2 files changed, 10 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> > index 169dfeb..dbb835a 100644
> > --- a/arch/arm/lib/board.c
> > +++ b/arch/arm/lib/board.c
> > @@ -404,6 +404,10 @@ void board_init_f (ulong bootflag)
> >  	post_bootmode_init();
> >  	post_run (NULL, POST_ROM | post_bootmode_get(0));
> >  #endif
> > +	/* 0xffffffff is used to mark is value as "unset".
> 
> s/mark is/mark a/

Yes, what I meant was:
0xffffffff is used to mark a value as "unset".

> 
> > +	   Hopefully there will never be this many machines. 
> > +	   Can't use 0 since 0 is already used as a mach-type. */
> > +	gd->bd->bi_arch_number = 0xffffffff; 
> >  
> >  	gd->bd->bi_baudrate = gd->baudrate;
> >  	/* Ram ist board specific, so move it to board code ... */
> > diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> > index 802e833..70b3b76 100644
> > --- a/arch/arm/lib/bootm.c
> > +++ b/arch/arm/lib/bootm.c
> > @@ -113,6 +113,12 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
> >  		printf ("Using machid 0x%x from environment\n", machid);
> >  	}
> >  
> > +#ifdef DEBUG
> > +	if(machid==0xffffffff) {
> > +	        debug("\nWarning: machid not set! Linux will not finish booting.\n\n");
> 
> s/finish/start/ ;-)
I'll have to disagree here.  Linux will decompress and some functions
will run but it will eventually stop, hence will not finish.
> 
> Also, shouldn't the compile fail in this case (#error)?  Or, at least #warn?
The compiler can't know what machid will be at runtime. Maybe a "would
you like to continue?" prompt could work.
> 
> > +	}
> > +#endif
> > +
> >  	show_boot_progress (15);
> >  
> >  #ifdef CONFIG_OF_LIBFDT
> > -- 
> > 1.7.3.4
> 
> Please take comments with a grain of salt, I'm asking, not telling.  I'm
> fairly new to this as well.
I'm happy to clarify. 
> 
> thx,
> 
> Jason.

thanks,
-Chris


More information about the U-Boot mailing list