sleep-s3c24xx.S 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. /*
  19. * S3C24XX_DEBUG_RESUME is dangerous if your bootloader does not
  20. * reset the UART configuration, only enable if you really need this!
  21. */
  22. //#define S3C24XX_DEBUG_RESUME
  23. .text
  24. /* sleep magic, to allow the bootloader to check for an valid
  25. * image to resume to. Must be the first word before the
  26. * s3c_cpu_resume entry.
  27. */
  28. .word 0x2bedf00d
  29. /* s3c_cpu_resume
  30. *
  31. * resume code entry for bootloader to call
  32. */
  33. ENTRY(s3c_cpu_resume)
  34. mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE
  35. msr cpsr_c, r0
  36. @@ load UART to allow us to print the two characters for
  37. @@ resume debug
  38. mov r2, #S3C24XX_PA_UART & 0xff000000
  39. orr r2, r2, #S3C24XX_PA_UART & 0xff000
  40. #if 0
  41. /* SMDK2440 LED set */
  42. mov r14, #S3C24XX_PA_GPIO
  43. ldr r12, [ r14, #0x54 ]
  44. bic r12, r12, #3<<4
  45. orr r12, r12, #1<<7
  46. str r12, [ r14, #0x54 ]
  47. #endif
  48. #ifdef S3C24XX_DEBUG_RESUME
  49. mov r3, #'L'
  50. strb r3, [ r2, #S3C2410_UTXH ]
  51. 1001:
  52. ldrb r14, [ r3, #S3C2410_UTRSTAT ]
  53. tst r14, #S3C2410_UTRSTAT_TXE
  54. beq 1001b
  55. #endif /* S3C24XX_DEBUG_RESUME */
  56. b cpu_resume