Hello all,

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:


void board_reset(void);
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/reset.c:89:           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

arch/powerpc/cpu/mpc85xx/cpu.c:37:void board_reset(void)
__attribute__((weak, alias("__board_reset")));
arch/powerpc/cpu/mpc85xx/cpu.c:315:     board_reset();

 * Default board reset function
static void
        /* 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:

#include <common.h>

__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 */





Leon Woestenberg
U-Boot mailing list

Reply via email to