system.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * arch/arm/mach-ebsa110/include/mach/system.h
  3. *
  4. * Copyright (C) 1996-2000 Russell King.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_ARCH_SYSTEM_H
  11. #define __ASM_ARCH_SYSTEM_H
  12. /*
  13. * EBSA110 idling methodology:
  14. *
  15. * We can not execute the "wait for interrupt" instruction since that
  16. * will stop our MCLK signal (which provides the clock for the glue
  17. * logic, and therefore the timer interrupt).
  18. *
  19. * Instead, we spin, polling the IRQ_STAT register for the occurrence
  20. * of any interrupt with core clock down to the memory clock.
  21. */
  22. static inline void arch_idle(void)
  23. {
  24. const char *irq_stat = (char *)0xff000000;
  25. /* disable clock switching */
  26. asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc");
  27. /* wait for an interrupt to occur */
  28. while (!*irq_stat);
  29. /* enable clock switching */
  30. asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
  31. }
  32. #define arch_reset(mode, cmd) cpu_reset(0x80000000)
  33. #endif