Ejemplo n.º 1
0
void __efi_runtime reset_cpu(ulong ticks)
{
	uint32_t rstc, timeout;

	if (ticks == 0) {
		hw_watchdog_disable();
		timeout = RESET_TIMEOUT;
	} else
		timeout = ticks & BCM2835_WDOG_MAX_TIMEOUT;

	rstc = readl(&wdog_regs->rstc);
	rstc &= ~BCM2835_WDOG_RSTC_WRCFG_MASK;
	rstc |= BCM2835_WDOG_RSTC_WRCFG_FULL_RESET;

	writel(BCM2835_WDOG_PASSWORD | timeout, &wdog_regs->wdog);
	writel(BCM2835_WDOG_PASSWORD | rstc, &wdog_regs->rstc);
}
Ejemplo n.º 2
0
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
#ifdef CONFIG_SYS_GPIO_0
	*((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR)) =
	    ++(*((unsigned long *)(CONFIG_SYS_GPIO_0_ADDR)));
#endif

#ifdef CONFIG_XILINX_TB_WATCHDOG
	hw_watchdog_disable();
#endif

	puts ("Reseting board\n");
	__asm__ __volatile__ ("	mts rmsr, r0;" \
				"bra r0");

	return 0;
}
Ejemplo n.º 3
0
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
#ifdef CONFIG_XILINX_GPIO
	if (reset_pin != -1)
		gpio_direction_output(reset_pin, 1);
#endif

#ifdef CONFIG_XILINX_TB_WATCHDOG
	hw_watchdog_disable();
#endif

	puts ("Reseting board\n");
	__asm__ __volatile__ ("	mts rmsr, r0;" \
				"bra r0");

	return 0;
}
Ejemplo n.º 4
0
// Entry Point
void reset_handler(void)
{
    // Disable Watchdog
    hw_watchdog_disable();

    // Init sections
    memcpy32(__data_load_start__, __data_start__, __data_end__);
    meminit32(__bss_start__, __bss_end__);
    memcpy32(__fast_load_start__, __fast_start__, __fast_end__);

    // Init heap
    __heap_start__[0] = 0;
    __heap_start__[1] = ((uint32_t)__heap_end__ - (uint32_t)__heap_start__);

    // Init hardware
    hw_init();

    // Start main
    extern void main(void);
    main();

    // Application has ended, so busy wait
    while(1);
}