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 Rambovoid 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