[U-Boot-Users] Re: PATCH: bi_iic_fast[] initialization

Tolunay Orkun listmember at orkun.us
Wed Apr 7 16:58:48 CEST 2004


Wolfgang,

> Dear Tolunay,
>
>>    * Allow bi_iic_fast[] to be initialized via env. variable "i2cfast"
>
> I think you should  rework  this  patch.  At  the  moment,  you  call
> getenv() in board_init_f() - but board_init_f() is still running from
> flash,  which  means  that we don't have a full C runtime environment
> (uninitialized BSS, no writable data, limited stack space) so the use
> of getenv() is not allowd in that function. You  may  use  getenv_r()
> instead.

I can convert it to use getenv_r() or I think it would be better to move
that section dealing with initialization of bi_iic_fast[] flags to
board_init_r(). bi_iic_fast[] is not used by u-boot itself. It is passed
to Linux.

I believe, there is no reason why it should be done by board_init_f().

Personally, the most appropriate place to initialize such things would be
right before u-boot boots the OS. The immediate changes to the environment
would also be captured without forcing an environment save and reset as
well.

What do you think? Which fix should I attempt:

1) Fix in board_init_f() using getenv_r()
2) Fix by moving to board_init_r()
3) Create a new function (say board_init_preboot) and move that section
into it. Hook board_init_preboot() to the existing boot functions (boot,
bootm etc. somehow)

> Please send a fix.

I will as soon as I get feedback from you.

Regards,
Tolunay




More information about the U-Boot mailing list