blob: 96e8208f929a77bd8091c147c145dc12728a3f27 [file] [log] [blame]
Bryan Wu1394f032007-05-06 14:50:22 -07001/*
2 * include/asm-blackfin/dpmc.h - Miscellaneous IOCTL commands for Dynamic Power
3 * Management Controller Driver.
Michael Hennerich14b03202008-05-07 11:41:26 +08004 * Copyright (C) 2004-2008 Analog Device Inc.
Bryan Wu1394f032007-05-06 14:50:22 -07005 *
6 */
7#ifndef _BLACKFIN_DPMC_H_
8#define _BLACKFIN_DPMC_H_
9
Bryan Wu1394f032007-05-06 14:50:22 -070010#ifdef __KERNEL__
Michael Hennerich1efc80b2008-07-19 16:57:32 +080011#ifndef __ASSEMBLY__
Bryan Wu1394f032007-05-06 14:50:22 -070012
Michael Hennerichcfefe3c2008-02-09 04:12:37 +080013void sleep_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
Michael Hennerichcfefe3c2008-02-09 04:12:37 +080014void hibernate_mode(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
15void sleep_deeper(u32 sic_iwr0, u32 sic_iwr1, u32 sic_iwr2);
Michael Hennerich1efc80b2008-07-19 16:57:32 +080016void do_hibernate(int wakeup);
17void set_dram_srfs(void);
18void unset_dram_srfs(void);
Bryan Wu1394f032007-05-06 14:50:22 -070019
Michael Hennerich1efc80b2008-07-19 16:57:32 +080020#define VRPAIR(vlev, freq) (((vlev) << 16) | ((freq) >> 16))
Bryan Wu1394f032007-05-06 14:50:22 -070021
Michael Hennerich14b03202008-05-07 11:41:26 +080022struct bfin_dpmc_platform_data {
23 const unsigned int *tuple_tab;
24 unsigned short tabsize;
25 unsigned short vr_settling_time; /* in us */
26};
27
Michael Hennerich1efc80b2008-07-19 16:57:32 +080028#else
Michael Hennerich14b03202008-05-07 11:41:26 +080029
Michael Hennerich1efc80b2008-07-19 16:57:32 +080030#define PM_PUSH(x) \
31 R0 = [P0 + (x - SRAM_BASE_ADDRESS)];\
32 [--SP] = R0;\
33
34#define PM_POP(x) \
35 R0 = [SP++];\
36 [P0 + (x - SRAM_BASE_ADDRESS)] = R0;\
37
38#define PM_SYS_PUSH(x) \
39 R0 = [P0 + (x - PLL_CTL)];\
40 [--SP] = R0;\
41
42#define PM_SYS_POP(x) \
43 R0 = [SP++];\
44 [P0 + (x - PLL_CTL)] = R0;\
45
46#define PM_SYS_PUSH16(x) \
47 R0 = w[P0 + (x - PLL_CTL)];\
48 [--SP] = R0;\
49
50#define PM_SYS_POP16(x) \
51 R0 = [SP++];\
52 w[P0 + (x - PLL_CTL)] = R0;\
53
54#endif
Bryan Wu1394f032007-05-06 14:50:22 -070055#endif /* __KERNEL__ */
56
57#endif /*_BLACKFIN_DPMC_H_*/