sleep-s3c2410.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2004 Simtec Electronics
  4. * Ben Dooks <[email protected]>
  5. *
  6. * S3C2410 Power Manager (Suspend-To-RAM) support
  7. *
  8. * Based on PXA/SA1100 sleep code by:
  9. * Nicolas Pitre, (c) 2002 Monta Vista Software Inc
  10. * Cliff Brake, (c) 2001
  11. */
  12. #include <linux/linkage.h>
  13. #include <linux/serial_s3c.h>
  14. #include <asm/assembler.h>
  15. #include "map.h"
  16. #include "regs-gpio.h"
  17. #include "regs-clock.h"
  18. #include "regs-mem-s3c24xx.h"
  19. /* s3c2410_cpu_suspend
  20. *
  21. * put the cpu into sleep mode
  22. */
  23. ENTRY(s3c2410_cpu_suspend)
  24. @@ prepare cpu to sleep
  25. ldr r4, =S3C2410_REFRESH
  26. ldr r5, =S3C24XX_MISCCR
  27. ldr r6, =S3C2410_CLKCON
  28. ldr r7, [r4] @ get REFRESH (and ensure in TLB)
  29. ldr r8, [r5] @ get MISCCR (and ensure in TLB)
  30. ldr r9, [r6] @ get CLKCON (and ensure in TLB)
  31. orr r7, r7, #S3C2410_REFRESH_SELF @ SDRAM sleep command
  32. orr r8, r8, #S3C2410_MISCCR_SDSLEEP @ SDRAM power-down signals
  33. orr r9, r9, #S3C2410_CLKCON_POWER @ power down command
  34. teq pc, #0 @ first as a trial-run to load cache
  35. bl s3c2410_do_sleep
  36. teq r0, r0 @ now do it for real
  37. b s3c2410_do_sleep @
  38. @@ align next bit of code to cache line
  39. .align 5
  40. s3c2410_do_sleep:
  41. streq r7, [r4] @ SDRAM sleep command
  42. streq r8, [r5] @ SDRAM power-down config
  43. streq r9, [r6] @ CPU sleep
  44. 1: beq 1b
  45. ret lr