Re: [U-Boot] [PATCH] ppc: transform init_sequence into a function.

I think most of the ugliness comes from the #ifdef hell in this list. replacing the #ifdefs is another matter so looking behind the #ifdef mess, I don't think it looks too bad.
I think the approach I took with lib_arm/board.c may apply as well. A simple weak init_nop(), no change at all in board code and no more "CONFIG_BOARD_EARLY_INIT_F" kind of stuff.
This is much more ugly, and I cannot see why it would be easier to debug.
You can set breakpoints anywhere you like. When it crashes in here somewhere, it isn't easy to tell where it did so.
I agree it is uglier (and I've discussed with Joakim offlist), this is a very strong point. I never had problems with the u-boot init function, I had serious issues with kernel initcalls.
Whils debug_initcall is great and good in the kernel, we can't do with printf ini u-boot, not in the first steps, at least.
So while I strongly prefer data structures to a burst of "if () goto error;", I think Joakim has a point here -- after I argued against it offlist.
/alessandro

rubini@gnudd.com wrote on 27/11/2009 15:54:57:
I think most of the ugliness comes from the #ifdef hell in this list. replacing the #ifdefs is another matter so looking behind the #ifdef mess, I don't think it looks too bad.
I think the approach I took with lib_arm/board.c may apply as well. A simple weak init_nop(), no change at all in board code and no more "CONFIG_BOARD_EARLY_INIT_F" kind of stuff.
This is much more ugly, and I cannot see why it would be easier to debug.
You can set breakpoints anywhere you like. When it crashes in here somewhere, it isn't easy to tell where it did so.
I agree it is uglier (and I've discussed with Joakim offlist), this is a very strong point. I never had problems with the u-boot init function, I had serious issues with kernel initcalls.
I have and it can be very time consuming to iterate back and fourth just to get to the actual crash point even with a debugger like BDI2000
Jocke
participants (2)
-
Alessandro Rubini
-
Joakim Tjernlund