cpu.c 668 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * (C) Copyright 2010,2011
  3. * Vladimir Khusainov, Emcraft Systems, vlad@emcraft.com
  4. *
  5. * (C) Copyright 2015
  6. * Kamil Lulko, <kamil.lulko@gmail.com>
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #include <common.h>
  11. #include <asm/io.h>
  12. #include <asm/armv7m.h>
  13. /*
  14. * This is called right before passing control to
  15. * the Linux kernel point.
  16. */
  17. int cleanup_before_linux(void)
  18. {
  19. return 0;
  20. }
  21. /*
  22. * Perform the low-level reset.
  23. */
  24. void reset_cpu(ulong addr)
  25. {
  26. /*
  27. * Perform reset but keep priority group unchanged.
  28. */
  29. writel((V7M_AIRCR_VECTKEY << V7M_AIRCR_VECTKEY_SHIFT)
  30. | (V7M_SCB->aircr & V7M_AIRCR_PRIGROUP_MSK)
  31. | V7M_AIRCR_SYSRESET, &V7M_SCB->aircr);
  32. }