xref: /openbmc/u-boot/arch/arm/cpu/armv7/bcm281xx/reset.c (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
2989ce049SDarwin Rambo /*
3989ce049SDarwin Rambo  * Copyright 2013 Broadcom Corporation.
4989ce049SDarwin Rambo  */
5989ce049SDarwin Rambo 
6989ce049SDarwin Rambo #include <common.h>
7989ce049SDarwin Rambo #include <asm/io.h>
8989ce049SDarwin Rambo #include <asm/arch/sysmap.h>
9989ce049SDarwin Rambo 
10989ce049SDarwin Rambo #define EN_MASK		0x08000000	/* Enable timer */
11989ce049SDarwin Rambo #define SRSTEN_MASK	0x04000000	/* Enable soft reset */
12989ce049SDarwin Rambo #define CLKS_SHIFT	20		/* Clock period shift */
13989ce049SDarwin Rambo #define LD_SHIFT	0		/* Reload value shift */
14989ce049SDarwin Rambo 
reset_cpu(ulong ignored)15989ce049SDarwin Rambo void reset_cpu(ulong ignored)
16989ce049SDarwin Rambo {
17989ce049SDarwin Rambo 	/*
18989ce049SDarwin Rambo 	 * Set WD enable, RST enable,
19989ce049SDarwin Rambo 	 * 3.9 msec clock period (8), reload value (8*3.9ms)
20989ce049SDarwin Rambo 	 */
21989ce049SDarwin Rambo 	u32 reg = EN_MASK + SRSTEN_MASK + (8 << CLKS_SHIFT) + (8 << LD_SHIFT);
22989ce049SDarwin Rambo 	writel(reg, SECWD2_BASE_ADDR);
23989ce049SDarwin Rambo 
24989ce049SDarwin Rambo 	while (1)
25989ce049SDarwin Rambo 		;	/* loop forever till reset */
26989ce049SDarwin Rambo }
27