cpu.c 929 B

123456789101112131415161718192021222324252627282930313233343536
  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 <asm/arch/ep93xx.h>
  12. #include <asm/io.h>
  13. /* We reset the CPU by generating a 1-->0 transition on DeviceCfg bit 31. */
  14. extern void reset_cpu(ulong addr)
  15. {
  16. struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
  17. uint32_t value;
  18. /* Unlock DeviceCfg and set SWRST */
  19. writel(0xAA, &syscon->sysswlock);
  20. value = readl(&syscon->devicecfg);
  21. value |= SYSCON_DEVICECFG_SWRST;
  22. writel(value, &syscon->devicecfg);
  23. /* Unlock DeviceCfg and clear SWRST */
  24. writel(0xAA, &syscon->sysswlock);
  25. value = readl(&syscon->devicecfg);
  26. value &= ~SYSCON_DEVICECFG_SWRST;
  27. writel(value, &syscon->devicecfg);
  28. /* Dying... */
  29. while (1)
  30. ; /* noop */
  31. }