[U-Boot-Users] using static variables

David Ho davidkwho at gmail.com
Fri Mar 24 17:33:42 CET 2006


Hi,

I would appreciate if an u-boot expert can explain the use of static
variables in u-boot.

My understanding is that when u-boot is still running in flash static
variables are not modifiable.    Once u-boot moves to RAM, what will
happen to static variables?  I don't quite understand how the
mechanism work before and after relocation.

I asked this question because I need a saved copy of a write only
latch/register, which I have to initialize early.

I have added a field in the global_data struct previously for this. 
Seeing that introduced changes in the common code I would like to
choose a method I can use to localize it in my board specific code.

Will I be able to use static variables in board_early_init_r?

Are there some other mehods I have not noticed?

Regards,
David




More information about the U-Boot mailing list