sleep-s3c2412.S 1.1 KB

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