
Dear chrisv@cyberswitching.com,
In message 20110119053445.GA9776@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():
- init_baudrate() -> getenv_r() -> serial_setbrg()
- 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