
Hi Wolfgang,
On Tue, Aug 23, 2011 at 6:10 AM, Wolfgang Denk wd@denx.de wrote:
Dear Graeme Russ,
In message 1313587343-3693-1-git-send-email-graeme.russ@gmail.com you wrote:
I have been thinking about the problem of the pesky init_sequence arrays and the inevitable #ifdefs and empty stub functions that result so I thought I'de have a crack at a more dynamic implementation. And like all good programmers, I stole the solution ;). This implementation is based on Linux's __initcall(fn) et. al. macros
If this works cross-platform, we can finally move board_init_* into /lib/ - Wouldn't that be nice
Thoughts?
I explained this a number of times before: the current code was designed to allow even for completely board specific init sequences, by simply adding #define for the list of init functions to the board config file - see for example here:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/33951/focus=36436
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/72131/focus=72136
Hmm, this last thread includes this little gem:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/72131/focus=72136
<quote> Somewhat offtopic, but you could add a few weak empty dummy functions at strategic places in the board_X funcs. Any board that needs some extra init sequence could define the appropriate function which will replace the weak one. </quote>
There is an incling that there may be a requirement to have more flexibility in the init sequence at the board level. Your response here:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/72131/focus=72136
<quote> The idea is that boards that want such contrrol can redefine the whole init sequence list - adding what they really need, and omitting what they don't. Zero overhead. </quote>
I would agree with Detlev - For a board to redefine the entire init sequence just to inject a single init function seems like gross overkill. Of course, this has already been realised and the solution was to #ifdef the init sequence array itself.
I think we are starting to see that the init array methodology is getting a little restrictive and in order to break free, some rather unsavoury coding behaviour has started to creep in
Regards,
Graeme