Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295324
b: refs/heads/master
c: 1b7f72f
h: refs/heads/master
v: v3
  • Loading branch information
Nicolas Pitre authored and Nicolas Pitre committed Jan 20, 2012
1 parent 8abe6a2 commit 58af9ee
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 71e256c54d67f55536bae184bb579c682714a95a
refs/heads/master: 1b7f72fc395d3d2b498fee5ecfb9e46497f55cdd
25 changes: 25 additions & 0 deletions trunk/arch/arm/mach-ebsa110/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,33 @@ static struct platform_device *ebsa110_devices[] = {
&am79c961_device,
};

/*
* EBSA110 idling methodology:
*
* We can not execute the "wait for interrupt" instruction since that
* will stop our MCLK signal (which provides the clock for the glue
* logic, and therefore the timer interrupt).
*
* Instead, we spin, polling the IRQ_STAT register for the occurrence
* of any interrupt with core clock down to the memory clock.
*/
static void ebsa110_idle(void)
{
const char *irq_stat = (char *)0xff000000;

/* disable clock switching */
asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc");

/* wait for an interrupt to occur */
while (!*irq_stat);

/* enable clock switching */
asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
}

static int __init ebsa110_init(void)
{
arm_pm_idle = ebsa110_idle;
return platform_add_devices(ebsa110_devices, ARRAY_SIZE(ebsa110_devices));
}

Expand Down
21 changes: 1 addition & 20 deletions trunk/arch/arm/mach-ebsa110/include/mach/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,9 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H

/*
* EBSA110 idling methodology:
*
* We can not execute the "wait for interrupt" instruction since that
* will stop our MCLK signal (which provides the clock for the glue
* logic, and therefore the timer interrupt).
*
* Instead, we spin, polling the IRQ_STAT register for the occurrence
* of any interrupt with core clock down to the memory clock.
*/
static inline void arch_idle(void)
{
const char *irq_stat = (char *)0xff000000;

/* disable clock switching */
asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc");

/* wait for an interrupt to occur */
while (!*irq_stat);

/* enable clock switching */
asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
cpu_do_idle();
}

#endif

0 comments on commit 58af9ee

Please sign in to comment.