1*52e6676eSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2ca31807bSArnd Bergmann /* 3ca31807bSArnd Bergmann * TI DaVinci platform support for power management. 4ca31807bSArnd Bergmann * 5ca31807bSArnd Bergmann * Copyright (C) 2009 Texas Instruments, Inc. https://www.ti.com/ 6ca31807bSArnd Bergmann */ 7ca31807bSArnd Bergmann #ifndef _MACH_DAVINCI_PM_H 8ca31807bSArnd Bergmann #define _MACH_DAVINCI_PM_H 9ca31807bSArnd Bergmann 10ca31807bSArnd Bergmann /* 11ca31807bSArnd Bergmann * Caution: Assembly code in sleep.S makes assumtion on the order 12ca31807bSArnd Bergmann * of the members of this structure. 13ca31807bSArnd Bergmann */ 14ca31807bSArnd Bergmann struct davinci_pm_config { 15ca31807bSArnd Bergmann void __iomem *ddr2_ctlr_base; 16ca31807bSArnd Bergmann void __iomem *ddrpsc_reg_base; 17ca31807bSArnd Bergmann int ddrpsc_num; 18ca31807bSArnd Bergmann void __iomem *ddrpll_reg_base; 19ca31807bSArnd Bergmann void __iomem *deepsleep_reg; 20ca31807bSArnd Bergmann void __iomem *cpupll_reg_base; 21ca31807bSArnd Bergmann /* 22ca31807bSArnd Bergmann * Note on SLEEPCOUNT: 23ca31807bSArnd Bergmann * The SLEEPCOUNT feature is mainly intended for cases in which 24ca31807bSArnd Bergmann * the internal oscillator is used. The internal oscillator is 25ca31807bSArnd Bergmann * fully disabled in deep sleep mode. When you exist deep sleep 26ca31807bSArnd Bergmann * mode, the oscillator will be turned on and will generate very 27ca31807bSArnd Bergmann * small oscillations which will not be detected by the deep sleep 28ca31807bSArnd Bergmann * counter. Eventually those oscillations will grow to an amplitude 29ca31807bSArnd Bergmann * large enough to start incrementing the deep sleep counter. 30ca31807bSArnd Bergmann * In this case recommendation from hardware engineers is that the 31ca31807bSArnd Bergmann * SLEEPCOUNT be set to 4096. This means that 4096 valid clock cycles 32ca31807bSArnd Bergmann * must be detected before the clock is passed to the rest of the 33ca31807bSArnd Bergmann * system. 34ca31807bSArnd Bergmann * In the case that the internal oscillator is not used and the 35ca31807bSArnd Bergmann * clock is generated externally, the SLEEPCOUNT value can be very 36ca31807bSArnd Bergmann * small since the clock input is assumed to be stable before SoC 37ca31807bSArnd Bergmann * is taken out of deepsleep mode. A value of 128 would be more than 38ca31807bSArnd Bergmann * adequate. 39ca31807bSArnd Bergmann */ 40ca31807bSArnd Bergmann int sleepcount; 41ca31807bSArnd Bergmann }; 42ca31807bSArnd Bergmann 43ca31807bSArnd Bergmann extern unsigned int davinci_cpu_suspend_sz; 44ca31807bSArnd Bergmann extern void davinci_cpu_suspend(struct davinci_pm_config *); 45ca31807bSArnd Bergmann 46ca31807bSArnd Bergmann #endif 47