for a Zynq (7-series) ARM based system I would like to implement a
board-specific reset function.
There are a few existing slightly different methods in place (see
below). What is the preferred way and place?
My current feeling is overriding reset_misc() in board.c, i.e. method
#4 from the existings methods I found in U-Boot, see below.
1) There used to be a call-out from the CPU reset to the board_reset()
if CONFIG_BOARD_RESET was defined non-zero, like this:
int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv)
This only existed for ppc4xx (which I think has been obsoleted now).
2) Blackfin seems to define a weak label "board_reset", and this
(function) pointer is compared against non-NULL, called if non-NULL.
arch/blackfin/cpu/reset.c:88: if (board_reset)
arch/blackfin/cpu/cpu.h:14:void board_reset(void) __attribute__((__weak__));
3) PowerPC MPC85xx seems to define a weak label, and alias it to a
* Default board reset function
/* Do nothing */
void board_reset(void) __attribute__((weak, alias("__board_reset")));
4) Similarly but a bit hidden for my "grep board_reset", is
reset_misc() in arch/arm/lib/reset.c:
__weak void reset_misc(void)
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv)
puts ("resetting ...\n");
udelay (50000); /* wait 50 ms */
U-Boot mailing list