idle.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* arch/arm/mach-msm/include/mach/idle.S
  2. *
  3. * Idle processing for MSM7K - work around bugs with SWFI.
  4. *
  5. * Copyright (c) 2007 QUALCOMM Incorporated.
  6. * Copyright (C) 2007 Google, Inc.
  7. *
  8. * This software is licensed under the terms of the GNU General Public
  9. * License version 2, as published by the Free Software Foundation, and
  10. * may be copied, distributed, and modified under those terms.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #include <linux/linkage.h>
  19. #include <asm/assembler.h>
  20. ENTRY(arch_idle)
  21. #ifdef CONFIG_MSM7X00A_IDLE
  22. mrc p15, 0, r1, c1, c0, 0 /* read current CR */
  23. bic r0, r1, #(1 << 2) /* clear dcache bit */
  24. bic r0, r0, #(1 << 12) /* clear icache bit */
  25. mcr p15, 0, r0, c1, c0, 0 /* disable d/i cache */
  26. mov r0, #0 /* prepare wfi value */
  27. mcr p15, 0, r0, c7, c10, 0 /* flush the cache */
  28. mcr p15, 0, r0, c7, c10, 4 /* memory barrier */
  29. mcr p15, 0, r0, c7, c0, 4 /* wait for interrupt */
  30. mcr p15, 0, r1, c1, c0, 0 /* restore d/i cache */
  31. #endif
  32. mov pc, lr