cpu.c 951 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Cirrus Logic EP93xx CPU-specific support.
  4. *
  5. * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
  6. *
  7. * Copyright (C) 2004, 2005
  8. * Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
  9. */
  10. #include <common.h>
  11. #include <cpu_func.h>
  12. #include <asm/arch/ep93xx.h>
  13. #include <asm/io.h>
  14. /* We reset the CPU by generating a 1-->0 transition on DeviceCfg bit 31. */
  15. extern void reset_cpu(ulong addr)
  16. {
  17. struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
  18. uint32_t value;
  19. /* Unlock DeviceCfg and set SWRST */
  20. writel(0xAA, &syscon->sysswlock);
  21. value = readl(&syscon->devicecfg);
  22. value |= SYSCON_DEVICECFG_SWRST;
  23. writel(value, &syscon->devicecfg);
  24. /* Unlock DeviceCfg and clear SWRST */
  25. writel(0xAA, &syscon->sysswlock);
  26. value = readl(&syscon->devicecfg);
  27. value &= ~SYSCON_DEVICECFG_SWRST;
  28. writel(value, &syscon->devicecfg);
  29. /* Dying... */
  30. while (1)
  31. ; /* noop */
  32. }