[U-Boot] replacing do_reset with a custom one

Richard Retanubun RichardRetanubun at RuggedCom.com
Fri Oct 23 23:43:18 CEST 2009


Greetings,

I am sorry if this has been asked before, It does not appear so on the mailing list archive.

I'd like to replace do_reset function with my own custom one, (i.e. resetting by not petting an external hw watchdog).

In previous discussion,
http://lists.denx.de/pipermail/u-boot/2007-January/018848.html

Wolfgang seems to favor creating a custom-board specific command (e.g. wdreset) and calling that
but If I do that, I have to replace all instances of do_reset that matters to my board.
It seems simpler to simply 'hijack and replace/enhance' the existing 'do_reset' to do my bidding.

Is there a recommended way of doing this? Any chance of adding something like this:

/cpu/$some-cpu/cpu.c

do_reset()
{

#ifdef CUSTOM_BOARD_RESET
	custom_board_reset();
#endif;

<normal do_reset command>
}

This way each board can define their own "call_custom_board" function.

Thanks for everyone's time

- Richard


More information about the U-Boot mailing list