reset.c 642 B

123456789101112131415161718192021222324252627
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright 2013 Broadcom Corporation.
  4. */
  5. #include <common.h>
  6. #include <cpu_func.h>
  7. #include <asm/io.h>
  8. #include <asm/arch/sysmap.h>
  9. #define EN_MASK 0x08000000 /* Enable timer */
  10. #define SRSTEN_MASK 0x04000000 /* Enable soft reset */
  11. #define CLKS_SHIFT 20 /* Clock period shift */
  12. #define LD_SHIFT 0 /* Reload value shift */
  13. void reset_cpu(void)
  14. {
  15. /*
  16. * Set WD enable, RST enable,
  17. * 3.9 msec clock period (8), reload value (8*3.9ms)
  18. */
  19. u32 reg = EN_MASK + SRSTEN_MASK + (8 << CLKS_SHIFT) + (8 << LD_SHIFT);
  20. writel(reg, SECWD2_BASE_ADDR);
  21. while (1)
  22. ; /* loop forever till reset */
  23. }