sleep.S 1.5 KB

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