idle_power4.S 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * This file contains the power_save function for 970-family CPUs.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. */
  9. #include <linux/config.h>
  10. #include <linux/threads.h>
  11. #include <asm/processor.h>
  12. #include <asm/page.h>
  13. #include <asm/cputable.h>
  14. #include <asm/thread_info.h>
  15. #include <asm/ppc_asm.h>
  16. #include <asm/asm-offsets.h>
  17. #undef DEBUG
  18. .text
  19. _GLOBAL(power4_idle)
  20. BEGIN_FTR_SECTION
  21. blr
  22. END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
  23. /* Now check if user or arch enabled NAP mode */
  24. LOAD_REG_ADDRBASE(r3,powersave_nap)
  25. lwz r4,ADDROFF(powersave_nap)(r3)
  26. cmpwi 0,r4,0
  27. beqlr
  28. /* Go to NAP now */
  29. BEGIN_FTR_SECTION
  30. DSSALL
  31. sync
  32. END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
  33. mfmsr r7
  34. ori r7,r7,MSR_EE
  35. oris r7,r7,MSR_POW@h
  36. sync
  37. isync
  38. mtmsrd r7
  39. isync
  40. sync
  41. blr