2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2014-02-11 19:06:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2013 Broadcom Corporation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2019-12-28 17:45:01 +00:00
|
|
|
#include <cpu_func.h>
|
2014-02-11 19:06:34 +00:00
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/arch/sysmap.h>
|
|
|
|
|
|
|
|
#define EN_MASK 0x08000000 /* Enable timer */
|
|
|
|
#define SRSTEN_MASK 0x04000000 /* Enable soft reset */
|
|
|
|
#define CLKS_SHIFT 20 /* Clock period shift */
|
|
|
|
#define LD_SHIFT 0 /* Reload value shift */
|
|
|
|
|
2020-12-15 15:47:52 +00:00
|
|
|
void reset_cpu(void)
|
2014-02-11 19:06:34 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Set WD enable, RST enable,
|
|
|
|
* 3.9 msec clock period (8), reload value (8*3.9ms)
|
|
|
|
*/
|
|
|
|
u32 reg = EN_MASK + SRSTEN_MASK + (8 << CLKS_SHIFT) + (8 << LD_SHIFT);
|
|
|
|
writel(reg, SECWD2_BASE_ADDR);
|
|
|
|
|
|
|
|
while (1)
|
|
|
|
; /* loop forever till reset */
|
|
|
|
}
|