reset.c 482 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <linux/io.h>
  8. #include <mach/sc-regs.h>
  9. void reset_cpu(unsigned long ignored)
  10. {
  11. u32 tmp;
  12. writel(5, SC_IRQTIMSET); /* default value */
  13. tmp = readl(SC_SLFRSTSEL);
  14. tmp &= ~0x3; /* mask [1:0] */
  15. tmp |= 0x0; /* XRST reboot */
  16. writel(tmp, SC_SLFRSTSEL);
  17. tmp = readl(SC_SLFRSTCTL);
  18. tmp |= 0x1;
  19. writel(tmp, SC_SLFRSTCTL);
  20. }