6xx-suspend.S 902 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Enter and leave sleep state on chips with 6xx-style HID0
  4. * power management bits, which don't leave sleep state via reset.
  5. *
  6. * Author: Scott Wood <scottwood@freescale.com>
  7. *
  8. * Copyright (c) 2006-2007 Freescale Semiconductor, Inc.
  9. */
  10. #include <asm/ppc_asm.h>
  11. #include <asm/reg.h>
  12. #include <asm/thread_info.h>
  13. #include <asm/asm-offsets.h>
  14. _GLOBAL(mpc6xx_enter_standby)
  15. mflr r4
  16. mfspr r5, SPRN_HID0
  17. rlwinm r5, r5, 0, ~(HID0_DOZE | HID0_NAP)
  18. oris r5, r5, HID0_SLEEP@h
  19. mtspr SPRN_HID0, r5
  20. isync
  21. lis r5, ret_from_standby@h
  22. ori r5, r5, ret_from_standby@l
  23. mtlr r5
  24. lwz r6, TI_LOCAL_FLAGS(r2)
  25. ori r6, r6, _TLF_SLEEPING
  26. stw r6, TI_LOCAL_FLAGS(r2)
  27. mfmsr r5
  28. ori r5, r5, MSR_EE
  29. oris r5, r5, MSR_POW@h
  30. sync
  31. mtmsr r5
  32. isync
  33. 1: b 1b
  34. ret_from_standby:
  35. mfspr r5, SPRN_HID0
  36. rlwinm r5, r5, 0, ~HID0_SLEEP
  37. mtspr SPRN_HID0, r5
  38. mtlr r4
  39. blr