[U-Boot] boot-up time optimization. Where to start?

Wolfgang Denk
2011-05-02T17:00:47Z

Dear Alexander Stein,

In message <201105021640.27241.alexander.stein@systec-electronic.com> you wrote:
>
> Ok, let me be more precise on this.
> We used U-Boot v2010.09 on a custom board running on an I.MX35 (ARM1136).

Let's summarize known facts:

1. You are talking about an out-of-tree port, i. e. code which is
completely unknown here, so it is basicly impossible to comment.
We can barely speculate.

2. This is an ARM board.

3. This is an old version before cache support for ARM was added.

> We noticed the following code snippet took relatively long.
> From common/console.c in console_init_r(void):
>
> > /* Setting environment variables */
> > for (i = 0; i < 3; i++) {
> > setenv(stdio_names[i], stdio_devices[i]->name);
> > }
>
> We added PIN toggling around this part of code and measured something >100ms.
> A collegue said it was ~100ms, I remembered ~500ms. Dunno who is right.

Both numbers are way off.

Let me speculate: (I) you have a _huge_ environment allocated for your
board, probably > 100 KiB or more; (II) you are loading it from a slow
storage device, probably NAND flash; (III) you are running on a narrow
system bus (16 bit) with non-optimal RAM timings; (IV) you do all this
with caches turned off; (V) you measure some numbers but you don;t
understand what they mean.

I bet some beer that at least 3 of these speculations hit the point.

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
I don't want to be young again, I just don't want to get any older.