mirror of
https://github.com/torvalds/linux.git
synced 2024-12-12 14:12:51 +00:00
efc1bb8a6f
This patch adds core power management (suspend-to-RAM) support for DaVinci SoCs. The code depends on the the "deepsleep" feature to suspend the SoC and saves power by gating the input clock. The wakeup can be based on an external event as supported by the SoC. Assembly code (in sleep.S) is added to aid gating DDR2 clocks. Code doing this work should not be accessing DDR2. The assembly code is relocated to SRAM by the code in pm.c The support has been validated on DA850/OMAP-L138 only though the code is (hopefully) generic enough that other SoCs supporting deepsleep feature simply requires SoC specific code to start using this driver. Note that all the device drivers don't support suspend/resume still and are being worked on. Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
55 lines
2.0 KiB
C
55 lines
2.0 KiB
C
/*
|
|
* TI DaVinci platform support for power management.
|
|
*
|
|
* Copyright (C) 2009 Texas Instruments, Inc. http://www.ti.com/
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation version 2.
|
|
*
|
|
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
|
|
* kind, whether express or implied; without even the implied warranty
|
|
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
#ifndef _MACH_DAVINCI_PM_H
|
|
#define _MACH_DAVINCI_PM_H
|
|
|
|
/*
|
|
* Caution: Assembly code in sleep.S makes assumtion on the order
|
|
* of the members of this structure.
|
|
*/
|
|
struct davinci_pm_config {
|
|
void __iomem *ddr2_ctlr_base;
|
|
void __iomem *ddrpsc_reg_base;
|
|
int ddrpsc_num;
|
|
void __iomem *ddrpll_reg_base;
|
|
void __iomem *deepsleep_reg;
|
|
void __iomem *cpupll_reg_base;
|
|
/*
|
|
* Note on SLEEPCOUNT:
|
|
* The SLEEPCOUNT feature is mainly intended for cases in which
|
|
* the internal oscillator is used. The internal oscillator is
|
|
* fully disabled in deep sleep mode. When you exist deep sleep
|
|
* mode, the oscillator will be turned on and will generate very
|
|
* small oscillations which will not be detected by the deep sleep
|
|
* counter. Eventually those oscillations will grow to an amplitude
|
|
* large enough to start incrementing the deep sleep counter.
|
|
* In this case recommendation from hardware engineers is that the
|
|
* SLEEPCOUNT be set to 4096. This means that 4096 valid clock cycles
|
|
* must be detected before the clock is passed to the rest of the
|
|
* system.
|
|
* In the case that the internal oscillator is not used and the
|
|
* clock is generated externally, the SLEEPCOUNT value can be very
|
|
* small since the clock input is assumed to be stable before SoC
|
|
* is taken out of deepsleep mode. A value of 128 would be more than
|
|
* adequate.
|
|
*/
|
|
int sleepcount;
|
|
};
|
|
|
|
extern unsigned int davinci_cpu_suspend_sz;
|
|
extern void davinci_cpu_suspend(struct davinci_pm_config *);
|
|
|
|
#endif
|