power.c (55fa518867978e1f5fd8353098f80d125ac734d7) power.c (785e3268e2951d4c0c21417c8e5d8004b2ab2480)
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xx0 Power Management routines.
4 *
5 * Copyright 2001, 2008 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. <source@mvista.com>
7 *
8 * Some of the routines are right out of init/main.c, whose

--- 37 unchanged lines hidden (view full) ---

46#else
47#define DPRINTK(fmt, args...)
48#endif
49
50static void au1000_calibrate_delay(void);
51
52extern unsigned long save_local_and_disable(int controller);
53extern void restore_local_and_enable(int controller, unsigned long mask);
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xx0 Power Management routines.
4 *
5 * Copyright 2001, 2008 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. <source@mvista.com>
7 *
8 * Some of the routines are right out of init/main.c, whose

--- 37 unchanged lines hidden (view full) ---

46#else
47#define DPRINTK(fmt, args...)
48#endif
49
50static void au1000_calibrate_delay(void);
51
52extern unsigned long save_local_and_disable(int controller);
53extern void restore_local_and_enable(int controller, unsigned long mask);
54extern void local_enable_irq(unsigned int irq_nr);
55
56static DEFINE_SPINLOCK(pm_lock);
57
58/*
59 * We need to save/restore a bunch of core registers that are
60 * either volatile or reset to some state across a processor sleep.
61 * If reading a register doesn't provide a proper result for a
62 * later restore, we have to provide a function for loading that

--- 296 unchanged lines hidden (view full) ---

359 }
360
361 /*
362 * We don't want _any_ interrupts other than match20. Otherwise our
363 * au1000_calibrate_delay() calculation will be off, potentially a lot.
364 */
365 intc0_mask = save_local_and_disable(0);
366 intc1_mask = save_local_and_disable(1);
54
55static DEFINE_SPINLOCK(pm_lock);
56
57/*
58 * We need to save/restore a bunch of core registers that are
59 * either volatile or reset to some state across a processor sleep.
60 * If reading a register doesn't provide a proper result for a
61 * later restore, we have to provide a function for loading that

--- 296 unchanged lines hidden (view full) ---

358 }
359
360 /*
361 * We don't want _any_ interrupts other than match20. Otherwise our
362 * au1000_calibrate_delay() calculation will be off, potentially a lot.
363 */
364 intc0_mask = save_local_and_disable(0);
365 intc1_mask = save_local_and_disable(1);
367 local_enable_irq(AU1000_TOY_MATCH2_INT);
366 val = 1 << (AU1000_TOY_MATCH2_INT - AU1000_INTC0_INT_BASE);
367 au_writel(val, IC0_MASKSET); /* unmask */
368 au_writel(val, IC0_WAKESET); /* enable wake-from-sleep */
369 au_sync();
368 spin_unlock_irqrestore(&pm_lock, flags);
369 au1000_calibrate_delay();
370 restore_local_and_enable(0, intc0_mask);
371 restore_local_and_enable(1, intc1_mask);
372
373 return retval;
374}
375

--- 90 unchanged lines hidden ---
370 spin_unlock_irqrestore(&pm_lock, flags);
371 au1000_calibrate_delay();
372 restore_local_and_enable(0, intc0_mask);
373 restore_local_and_enable(1, intc1_mask);
374
375 return retval;
376}
377

--- 90 unchanged lines hidden ---