[U-Boot] environmental "baudrate" not used at boot up

Wolfgang Denk wd at denx.de
Wed Jan 19 07:59:10 CET 2011


Dear chrisv at cyberswitching.com,

In message <20110119053445.GA9776 at cslinux-build01.cyberswitching.local> you wrote:
>
> I investigated this a little further, and I'm wondering if the problem
> is related to the initialization ordering in lib_arm/board.c.
> 
> Here's the sequence:
> 
>    start_armboot():
>    1. init_baudrate() -> getenv_r() -> serial_setbrg()
>    2. env_relocate()
> 
> Note that init_baudrate() calls getenv_r("baudrate") and passes either
> the result (on success) or CONFIG_BAUDRATE (on error) to
> serial_setbrg().  Only after this does the environment get relocated
> using env_relocate().

Right.  This is the intended sequence.

> Based on empirical testing, I've discovered that re-running
> init_baudrate() after env_relocate() fixes everything.  The serial
> console uses the baud rate stored in the "baudrate" variable now, and
> some ordering of display outputs needs to be tweaked so that gibberish
> isn't output in the interim.

You have diagnosed where the problem is, but you come to the wrong
conclusions and instead of fixing the problem you paint over it.

Obviously  getenv_r("baudrate")  is not returning the right value for
you.

You should first check, what exactly it returns.

Then you should check why it is not reading the correct data, as it is
supposed to do.

Then you should fix _that_ problem.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
>  Is there a way to determine Yesterday's date using Unix utilities?
         echo "what is yesterday's date?" | /bin/mail root
         -- Randal L. Schwartz in <ukbuh2y982.fsf at julie.teleport.com>


More information about the U-Boot mailing list