Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
pm.c File Reference
#include <linux/suspend.h>
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <linux/syscore_ops.h>
#include <asm/dpmc.h>
#include <asm/pm.h>
#include <mach/pm.h>
#include <asm/blackfin.h>
#include <asm/mem_init.h>

Go to the source code of this file.

Data Structures

struct  STRUCT_ROM_SYSCTRL
 
struct  bfin_pm_data
 

Macros

#define BITP_ROM_WUA_CHKHDR   24
 
#define BITP_ROM_WUA_DDRLOCK   7
 
#define BITP_ROM_WUA_DDRDLLEN   6
 
#define BITP_ROM_WUA_DDR   5
 
#define BITP_ROM_WUA_CGU   4
 
#define BITP_ROM_WUA_MEMBOOT   2
 
#define BITP_ROM_WUA_EN   1
 
#define BITM_ROM_WUA_CHKHDR   (0xFF000000)
 
#define ENUM_ROM_WUA_CHKHDR_AD   0xAD000000
 
#define BITM_ROM_WUA_DDRLOCK   (0x00000080)
 
#define BITM_ROM_WUA_DDRDLLEN   (0x00000040)
 
#define BITM_ROM_WUA_DDR   (0x00000020)
 
#define BITM_ROM_WUA_CGU   (0x00000010)
 
#define BITM_ROM_WUA_MEMBOOT   (0x00000002)
 
#define BITM_ROM_WUA_EN   (0x00000001)
 
#define BITP_ROM_SYSCTRL_CGU_LOCKINGEN   28 /* unlocks CGU_CTL register */
 
#define BITP_ROM_SYSCTRL_WUA_OVERRIDE   24
 
#define BITP_ROM_SYSCTRL_WUA_DDRDLLEN   20 /* Saves the DDR DLL and PADS registers to the DPM registers */
 
#define BITP_ROM_SYSCTRL_WUA_DDR   19 /* Saves the DDR registers to the DPM registers */
 
#define BITP_ROM_SYSCTRL_WUA_CGU   18 /* Saves the CGU registers into DPM registers */
 
#define BITP_ROM_SYSCTRL_WUA_DPMWRITE   17 /* Saves the Syscontrol structure structure contents into DPM registers */
 
#define BITP_ROM_SYSCTRL_WUA_EN   16 /* reads current PLL and DDR configuration into structure */
 
#define BITP_ROM_SYSCTRL_DDR_WRITE   13 /* writes the DDR registers from Syscontrol structure for wakeup initialization of DDR */
 
#define BITP_ROM_SYSCTRL_DDR_READ   12 /* Read the DDR registers into the Syscontrol structure for storing prior to hibernate */
 
#define BITP_ROM_SYSCTRL_CGU_AUTODIS   11 /* Disables auto handling of UPDT and ALGN fields */
 
#define BITP_ROM_SYSCTRL_CGU_CLKOUTSEL   7 /* access CGU_CLKOUTSEL register */
 
#define BITP_ROM_SYSCTRL_CGU_DIV   6 /* access CGU_DIV register */
 
#define BITP_ROM_SYSCTRL_CGU_STAT   5 /* access CGU_STAT register */
 
#define BITP_ROM_SYSCTRL_CGU_CTL   4 /* access CGU_CTL register */
 
#define BITP_ROM_SYSCTRL_CGU_RTNSTAT   2 /* Update structure STAT field upon error */
 
#define BITP_ROM_SYSCTRL_WRITE   1 /* write registers */
 
#define BITP_ROM_SYSCTRL_READ   0 /* read registers */
 
#define BITM_ROM_SYSCTRL_CGU_READ   (0x00000001) /* Read CGU registers */
 
#define BITM_ROM_SYSCTRL_CGU_WRITE   (0x00000002) /* Write registers */
 
#define BITM_ROM_SYSCTRL_CGU_RTNSTAT   (0x00000004) /* Update structure STAT field upon error or after a write operation */
 
#define BITM_ROM_SYSCTRL_CGU_CTL   (0x00000010) /* Access CGU_CTL register */
 
#define BITM_ROM_SYSCTRL_CGU_STAT   (0x00000020) /* Access CGU_STAT register */
 
#define BITM_ROM_SYSCTRL_CGU_DIV   (0x00000040) /* Access CGU_DIV register */
 
#define BITM_ROM_SYSCTRL_CGU_CLKOUTSEL   (0x00000080) /* Access CGU_CLKOUTSEL register */
 
#define BITM_ROM_SYSCTRL_CGU_AUTODIS   (0x00000800) /* Disables auto handling of UPDT and ALGN fields */
 
#define BITM_ROM_SYSCTRL_DDR_READ   (0x00001000) /* Reads the contents of the DDR registers and stores them into the structure */
 
#define BITM_ROM_SYSCTRL_DDR_WRITE   (0x00002000) /* Writes the DDR registers from the structure, only really intented for wakeup functionality and not for full DDR configuration */
 
#define BITM_ROM_SYSCTRL_WUA_EN   (0x00010000) /* Wakeup entry or exit opertation enable */
 
#define BITM_ROM_SYSCTRL_WUA_DPMWRITE   (0x00020000) /* When set indicates a restore of the PLL and DDR is to be performed otherwise a save is required */
 
#define BITM_ROM_SYSCTRL_WUA_CGU   (0x00040000) /* Only applicable for a PLL and DDR save operation to the DPM, saves the current settings if cleared or the contents of the structure if set */
 
#define BITM_ROM_SYSCTRL_WUA_DDR   (0x00080000) /* Only applicable for a PLL and DDR save operation to the DPM, saves the current settings if cleared or the contents of the structure if set */
 
#define BITM_ROM_SYSCTRL_WUA_DDRDLLEN   (0x00100000) /* Enables saving/restoring of the DDR DLLCTL register */
 
#define BITM_ROM_SYSCTRL_WUA_OVERRIDE   (0x01000000)
 
#define BITM_ROM_SYSCTRL_CGU_LOCKINGEN   (0x10000000) /* Unlocks the CGU_CTL register */
 
#define FUNC_ROM_SYSCONTROL   0xC8000080
 
#define IRQ_SID(irq)   ((irq) - IVG15)
 

Functions

 __attribute__ ((l1_data))
 
 __attribute__ ((l1_text))
 
asmlinkage void enter_deepsleep (void)
 
void bfin_hibernate (unsigned long mask, unsigned long pol_mask)
 
void bf609_cpu_pm_enter (suspend_state_t state)
 
int bf609_cpu_pm_prepare (void)
 
void bf609_cpu_pm_finish (void)
 
 late_initcall (bf609_init_pm)
 

Variables

struct bfin_pm_data bf609_pm_data
 
struct STRUCT_ROM_SYSCTRL configvalues
 
uint32_t dactionflags
 

Macro Definition Documentation

#define BITM_ROM_SYSCTRL_CGU_AUTODIS   (0x00000800) /* Disables auto handling of UPDT and ALGN fields */

Definition at line 76 of file pm.c.

#define BITM_ROM_SYSCTRL_CGU_CLKOUTSEL   (0x00000080) /* Access CGU_CLKOUTSEL register */

Definition at line 75 of file pm.c.

#define BITM_ROM_SYSCTRL_CGU_CTL   (0x00000010) /* Access CGU_CTL register */

Definition at line 72 of file pm.c.

#define BITM_ROM_SYSCTRL_CGU_DIV   (0x00000040) /* Access CGU_DIV register */

Definition at line 74 of file pm.c.

#define BITM_ROM_SYSCTRL_CGU_LOCKINGEN   (0x10000000) /* Unlocks the CGU_CTL register */

Definition at line 85 of file pm.c.

#define BITM_ROM_SYSCTRL_CGU_READ   (0x00000001) /* Read CGU registers */

Definition at line 69 of file pm.c.

#define BITM_ROM_SYSCTRL_CGU_RTNSTAT   (0x00000004) /* Update structure STAT field upon error or after a write operation */

Definition at line 71 of file pm.c.

#define BITM_ROM_SYSCTRL_CGU_STAT   (0x00000020) /* Access CGU_STAT register */

Definition at line 73 of file pm.c.

#define BITM_ROM_SYSCTRL_CGU_WRITE   (0x00000002) /* Write registers */

Definition at line 70 of file pm.c.

#define BITM_ROM_SYSCTRL_DDR_READ   (0x00001000) /* Reads the contents of the DDR registers and stores them into the structure */

Definition at line 77 of file pm.c.

#define BITM_ROM_SYSCTRL_DDR_WRITE   (0x00002000) /* Writes the DDR registers from the structure, only really intented for wakeup functionality and not for full DDR configuration */

Definition at line 78 of file pm.c.

#define BITM_ROM_SYSCTRL_WUA_CGU   (0x00040000) /* Only applicable for a PLL and DDR save operation to the DPM, saves the current settings if cleared or the contents of the structure if set */

Definition at line 81 of file pm.c.

#define BITM_ROM_SYSCTRL_WUA_DDR   (0x00080000) /* Only applicable for a PLL and DDR save operation to the DPM, saves the current settings if cleared or the contents of the structure if set */

Definition at line 82 of file pm.c.

#define BITM_ROM_SYSCTRL_WUA_DDRDLLEN   (0x00100000) /* Enables saving/restoring of the DDR DLLCTL register */

Definition at line 83 of file pm.c.

#define BITM_ROM_SYSCTRL_WUA_DPMWRITE   (0x00020000) /* When set indicates a restore of the PLL and DDR is to be performed otherwise a save is required */

Definition at line 80 of file pm.c.

#define BITM_ROM_SYSCTRL_WUA_EN   (0x00010000) /* Wakeup entry or exit opertation enable */

Definition at line 79 of file pm.c.

#define BITM_ROM_SYSCTRL_WUA_OVERRIDE   (0x01000000)

Definition at line 84 of file pm.c.

#define BITM_ROM_WUA_CGU   (0x00000010)

Definition at line 42 of file pm.c.

#define BITM_ROM_WUA_CHKHDR   (0xFF000000)

Definition at line 36 of file pm.c.

#define BITM_ROM_WUA_DDR   (0x00000020)

Definition at line 41 of file pm.c.

#define BITM_ROM_WUA_DDRDLLEN   (0x00000040)

Definition at line 40 of file pm.c.

#define BITM_ROM_WUA_DDRLOCK   (0x00000080)

Definition at line 39 of file pm.c.

#define BITM_ROM_WUA_EN   (0x00000001)

Definition at line 44 of file pm.c.

#define BITM_ROM_WUA_MEMBOOT   (0x00000002)

Definition at line 43 of file pm.c.

#define BITP_ROM_SYSCTRL_CGU_AUTODIS   11 /* Disables auto handling of UPDT and ALGN fields */

Definition at line 60 of file pm.c.

#define BITP_ROM_SYSCTRL_CGU_CLKOUTSEL   7 /* access CGU_CLKOUTSEL register */

Definition at line 61 of file pm.c.

#define BITP_ROM_SYSCTRL_CGU_CTL   4 /* access CGU_CTL register */

Definition at line 64 of file pm.c.

#define BITP_ROM_SYSCTRL_CGU_DIV   6 /* access CGU_DIV register */

Definition at line 62 of file pm.c.

#define BITP_ROM_SYSCTRL_CGU_LOCKINGEN   28 /* unlocks CGU_CTL register */

Definition at line 51 of file pm.c.

#define BITP_ROM_SYSCTRL_CGU_RTNSTAT   2 /* Update structure STAT field upon error */

Definition at line 65 of file pm.c.

#define BITP_ROM_SYSCTRL_CGU_STAT   5 /* access CGU_STAT register */

Definition at line 63 of file pm.c.

#define BITP_ROM_SYSCTRL_DDR_READ   12 /* Read the DDR registers into the Syscontrol structure for storing prior to hibernate */

Definition at line 59 of file pm.c.

#define BITP_ROM_SYSCTRL_DDR_WRITE   13 /* writes the DDR registers from Syscontrol structure for wakeup initialization of DDR */

Definition at line 58 of file pm.c.

#define BITP_ROM_SYSCTRL_READ   0 /* read registers */

Definition at line 67 of file pm.c.

#define BITP_ROM_SYSCTRL_WRITE   1 /* write registers */

Definition at line 66 of file pm.c.

#define BITP_ROM_SYSCTRL_WUA_CGU   18 /* Saves the CGU registers into DPM registers */

Definition at line 55 of file pm.c.

#define BITP_ROM_SYSCTRL_WUA_DDR   19 /* Saves the DDR registers to the DPM registers */

Definition at line 54 of file pm.c.

#define BITP_ROM_SYSCTRL_WUA_DDRDLLEN   20 /* Saves the DDR DLL and PADS registers to the DPM registers */

Definition at line 53 of file pm.c.

#define BITP_ROM_SYSCTRL_WUA_DPMWRITE   17 /* Saves the Syscontrol structure structure contents into DPM registers */

Definition at line 56 of file pm.c.

#define BITP_ROM_SYSCTRL_WUA_EN   16 /* reads current PLL and DDR configuration into structure */

Definition at line 57 of file pm.c.

#define BITP_ROM_SYSCTRL_WUA_OVERRIDE   24

Definition at line 52 of file pm.c.

#define BITP_ROM_WUA_CGU   4

Definition at line 32 of file pm.c.

#define BITP_ROM_WUA_CHKHDR   24

Definition at line 28 of file pm.c.

#define BITP_ROM_WUA_DDR   5

Definition at line 31 of file pm.c.

#define BITP_ROM_WUA_DDRDLLEN   6

Definition at line 30 of file pm.c.

#define BITP_ROM_WUA_DDRLOCK   7

Definition at line 29 of file pm.c.

#define BITP_ROM_WUA_EN   1

Definition at line 34 of file pm.c.

#define BITP_ROM_WUA_MEMBOOT   2

Definition at line 33 of file pm.c.

#define ENUM_ROM_WUA_CHKHDR_AD   0xAD000000

Definition at line 37 of file pm.c.

#define FUNC_ROM_SYSCONTROL   0xC8000080

Definition at line 121 of file pm.c.

#define IRQ_SID (   irq)    ((irq) - IVG15)

Definition at line 177 of file pm.c.

Function Documentation

__attribute__ ( (l1_data)  )

Definition at line 122 of file pm.c.

__attribute__ ( (l1_text)  )

Definition at line 135 of file pm.c.

void bf609_cpu_pm_enter ( suspend_state_t  state)

Definition at line 199 of file pm.c.

void bf609_cpu_pm_finish ( void  )

Definition at line 281 of file pm.c.

int bf609_cpu_pm_prepare ( void  )

Definition at line 276 of file pm.c.

void bfin_hibernate ( unsigned long  mask,
unsigned long  pol_mask 
)

Definition at line 189 of file pm.c.

asmlinkage void enter_deepsleep ( void  )
late_initcall ( bf609_init_pm  )

Variable Documentation

struct bfin_pm_data bf609_pm_data

Definition at line 116 of file pm.c.

struct STRUCT_ROM_SYSCTRL configvalues

Definition at line 118 of file pm.c.

uint32_t dactionflags

Definition at line 119 of file pm.c.