sleep-s3c2412.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2007 Simtec Electronics
  4. * Ben Dooks <[email protected]>
  5. *
  6. * S3C2412 Power Manager low-level sleep support
  7. */
  8. #include <linux/linkage.h>
  9. #include <asm/assembler.h>
  10. #include "map.h"
  11. #include "regs-irq.h"
  12. .text
  13. .global s3c2412_sleep_enter
  14. s3c2412_sleep_enter:
  15. mov r0, #0 /* argument for coprocessors */
  16. ldr r1, =S3C2410_INTPND
  17. ldr r2, =S3C2410_SRCPND
  18. ldr r3, =S3C2410_EINTPEND
  19. teq r0, r0
  20. bl s3c2412_sleep_enter1
  21. teq pc, r0
  22. bl s3c2412_sleep_enter1
  23. .align 5
  24. /* this is called twice, first with the Z flag to ensure that the
  25. * instructions have been loaded into the cache, and the second
  26. * time to try and suspend the system.
  27. */
  28. s3c2412_sleep_enter1:
  29. mcr p15, 0, r0, c7, c10, 4
  30. mcrne p15, 0, r0, c7, c0, 4
  31. /* if we return from here, it is because an interrupt was
  32. * active when we tried to shutdown. Try and ack the IRQ and
  33. * retry, as simply returning causes the system to lock.
  34. */
  35. ldrne r9, [r1]
  36. strne r9, [r1]
  37. ldrne r9, [r2]
  38. strne r9, [r2]
  39. ldrne r9, [r3]
  40. strne r9, [r3]
  41. bne s3c2412_sleep_enter1
  42. ret lr