Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 1 | /* |
Paul Walmsley | a64bb9c | 2010-12-21 21:05:14 -0700 | [diff] [blame] | 2 | * OMAP2/3/4 powerdomain control |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 3 | * |
Paul Walmsley | 72e06d0 | 2010-12-21 21:05:16 -0700 | [diff] [blame] | 4 | * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc. |
Paul Walmsley | 694606c | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 6 | * |
Paul Walmsley | 72e06d0 | 2010-12-21 21:05:16 -0700 | [diff] [blame] | 7 | * Paul Walmsley |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 12 | * |
| 13 | * XXX This should be moved to the mach-omap2/ directory at the earliest |
| 14 | * opportunity. |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 15 | */ |
| 16 | |
Paul Walmsley | 72e06d0 | 2010-12-21 21:05:16 -0700 | [diff] [blame] | 17 | #ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H |
| 18 | #define __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 19 | |
| 20 | #include <linux/types.h> |
| 21 | #include <linux/list.h> |
| 22 | |
Paul Walmsley | 72e06d0 | 2010-12-21 21:05:16 -0700 | [diff] [blame] | 23 | #include <linux/atomic.h> |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 24 | |
Kevin Hilman | 8f1bec2 | 2011-03-23 07:22:23 -0700 | [diff] [blame] | 25 | #include "voltage.h" |
| 26 | |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 27 | /* Powerdomain basic power states */ |
| 28 | #define PWRDM_POWER_OFF 0x0 |
| 29 | #define PWRDM_POWER_RET 0x1 |
| 30 | #define PWRDM_POWER_INACTIVE 0x2 |
| 31 | #define PWRDM_POWER_ON 0x3 |
| 32 | |
Paul Walmsley | 2354eb5 | 2009-12-08 16:33:12 -0700 | [diff] [blame] | 33 | #define PWRDM_MAX_PWRSTS 4 |
| 34 | |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 35 | /* Powerdomain allowable state bitfields */ |
Rajendra Nayak | d3353e1 | 2010-05-18 20:24:01 -0600 | [diff] [blame] | 36 | #define PWRSTS_ON (1 << PWRDM_POWER_ON) |
Paul Walmsley | 694606c | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 37 | #define PWRSTS_INACTIVE (1 << PWRDM_POWER_INACTIVE) |
| 38 | #define PWRSTS_RET (1 << PWRDM_POWER_RET) |
Rajendra Nayak | bb722f3 | 2010-09-27 14:02:56 -0600 | [diff] [blame] | 39 | #define PWRSTS_OFF (1 << PWRDM_POWER_OFF) |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 40 | |
Paul Walmsley | 694606c | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 41 | #define PWRSTS_OFF_ON (PWRSTS_OFF | PWRSTS_ON) |
| 42 | #define PWRSTS_OFF_RET (PWRSTS_OFF | PWRSTS_RET) |
| 43 | #define PWRSTS_RET_ON (PWRSTS_RET | PWRSTS_ON) |
| 44 | #define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | PWRSTS_ON) |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 45 | |
| 46 | |
Paul Walmsley | 0b7cbfb | 2008-06-25 18:09:37 -0600 | [diff] [blame] | 47 | /* Powerdomain flags */ |
| 48 | #define PWRDM_HAS_HDWR_SAR (1 << 0) /* hardware save-and-restore support */ |
Thara Gopinath | 3863c74 | 2009-12-08 16:33:15 -0700 | [diff] [blame] | 49 | #define PWRDM_HAS_MPU_QUIRK (1 << 1) /* MPU pwr domain has MEM bank 0 bits |
| 50 | * in MEM bank 1 position. This is |
| 51 | * true for OMAP3430 |
| 52 | */ |
Rajendra Nayak | 90dbc7b | 2010-05-18 20:24:03 -0600 | [diff] [blame] | 53 | #define PWRDM_HAS_LOWPOWERSTATECHANGE (1 << 2) /* |
| 54 | * support to transition from a |
| 55 | * sleep state to a lower sleep |
| 56 | * state without waking up the |
| 57 | * powerdomain |
| 58 | */ |
Paul Walmsley | 0b7cbfb | 2008-06-25 18:09:37 -0600 | [diff] [blame] | 59 | |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 60 | /* |
Abhijit Pagare | 38900c2 | 2010-01-26 20:12:52 -0700 | [diff] [blame] | 61 | * Number of memory banks that are power-controllable. On OMAP4430, the |
| 62 | * maximum is 5. |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 63 | */ |
Abhijit Pagare | 38900c2 | 2010-01-26 20:12:52 -0700 | [diff] [blame] | 64 | #define PWRDM_MAX_MEM_BANKS 5 |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 65 | |
Paul Walmsley | 8420bb1 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 66 | /* |
| 67 | * Maximum number of clockdomains that can be associated with a powerdomain. |
Vaibhav Hiremath | 3f0ea76 | 2012-06-18 00:47:27 -0600 | [diff] [blame] | 68 | * PER powerdomain on AM33XX is the worst case |
Paul Walmsley | 8420bb1 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 69 | */ |
Vaibhav Hiremath | 3f0ea76 | 2012-06-18 00:47:27 -0600 | [diff] [blame] | 70 | #define PWRDM_MAX_CLKDMS 11 |
Paul Walmsley | 8420bb1 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 71 | |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 72 | /* XXX A completely arbitrary number. What is reasonable here? */ |
| 73 | #define PWRDM_TRANSITION_BAILOUT 100000 |
| 74 | |
Paul Walmsley | 8420bb1 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 75 | struct clockdomain; |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 76 | struct powerdomain; |
| 77 | |
Paul Walmsley | f0271d6 | 2010-01-26 20:13:02 -0700 | [diff] [blame] | 78 | /** |
| 79 | * struct powerdomain - OMAP powerdomain |
| 80 | * @name: Powerdomain name |
Kevin Hilman | 8f1bec2 | 2011-03-23 07:22:23 -0700 | [diff] [blame] | 81 | * @voltdm: voltagedomain containing this powerdomain |
Paul Walmsley | f0271d6 | 2010-01-26 20:13:02 -0700 | [diff] [blame] | 82 | * @prcm_offs: the address offset from CM_BASE/PRM_BASE |
Paul Walmsley | a64bb9c | 2010-12-21 21:05:14 -0700 | [diff] [blame] | 83 | * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs |
Paul Walmsley | f0271d6 | 2010-01-26 20:13:02 -0700 | [diff] [blame] | 84 | * @pwrsts: Possible powerdomain power states |
| 85 | * @pwrsts_logic_ret: Possible logic power states when pwrdm in RETENTION |
| 86 | * @flags: Powerdomain flags |
| 87 | * @banks: Number of software-controllable memory banks in this powerdomain |
| 88 | * @pwrsts_mem_ret: Possible memory bank pwrstates when pwrdm in RETENTION |
| 89 | * @pwrsts_mem_on: Possible memory bank pwrstates when pwrdm in ON |
| 90 | * @pwrdm_clkdms: Clockdomains in this powerdomain |
| 91 | * @node: list_head linking all powerdomains |
Kevin Hilman | e69c22b | 2011-03-16 16:13:15 -0700 | [diff] [blame] | 92 | * @voltdm_node: list_head linking all powerdomains in a voltagedomain |
Vaibhav Hiremath | 3f0ea76 | 2012-06-18 00:47:27 -0600 | [diff] [blame] | 93 | * @pwrstctrl_offs: (AM33XX only) XXX_PWRSTCTRL reg offset from prcm_offs |
| 94 | * @pwrstst_offs: (AM33XX only) XXX_PWRSTST reg offset from prcm_offs |
| 95 | * @logicretstate_mask: (AM33XX only) mask for logic retention bitfield |
| 96 | * in @pwrstctrl_offs |
| 97 | * @mem_on_mask: (AM33XX only) mask for mem on bitfield in @pwrstctrl_offs |
| 98 | * @mem_ret_mask: (AM33XX only) mask for mem ret bitfield in @pwrstctrl_offs |
| 99 | * @mem_pwrst_mask: (AM33XX only) mask for mem state bitfield in @pwrstst_offs |
| 100 | * @mem_retst_mask: (AM33XX only) mask for mem retention state bitfield |
| 101 | * in @pwrstctrl_offs |
Paul Walmsley | f0271d6 | 2010-01-26 20:13:02 -0700 | [diff] [blame] | 102 | * @state: |
| 103 | * @state_counter: |
| 104 | * @timer: |
| 105 | * @state_timer: |
Paul Walmsley | a64bb9c | 2010-12-21 21:05:14 -0700 | [diff] [blame] | 106 | * |
| 107 | * @prcm_partition possible values are defined in mach-omap2/prcm44xx.h. |
Paul Walmsley | f0271d6 | 2010-01-26 20:13:02 -0700 | [diff] [blame] | 108 | */ |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 109 | struct powerdomain { |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 110 | const char *name; |
Kevin Hilman | 8f1bec2 | 2011-03-23 07:22:23 -0700 | [diff] [blame] | 111 | union { |
| 112 | const char *name; |
| 113 | struct voltagedomain *ptr; |
| 114 | } voltdm; |
Paul Walmsley | e0594b4 | 2010-01-26 20:13:01 -0700 | [diff] [blame] | 115 | const s16 prcm_offs; |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 116 | const u8 pwrsts; |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 117 | const u8 pwrsts_logic_ret; |
Paul Walmsley | 0b7cbfb | 2008-06-25 18:09:37 -0600 | [diff] [blame] | 118 | const u8 flags; |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 119 | const u8 banks; |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 120 | const u8 pwrsts_mem_ret[PWRDM_MAX_MEM_BANKS]; |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 121 | const u8 pwrsts_mem_on[PWRDM_MAX_MEM_BANKS]; |
Paul Walmsley | a64bb9c | 2010-12-21 21:05:14 -0700 | [diff] [blame] | 122 | const u8 prcm_partition; |
Paul Walmsley | 8420bb1 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 123 | struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 124 | struct list_head node; |
Kevin Hilman | e69c22b | 2011-03-16 16:13:15 -0700 | [diff] [blame] | 125 | struct list_head voltdm_node; |
Peter 'p2' De Schrijver | ba20bb1 | 2008-10-15 17:48:43 +0300 | [diff] [blame] | 126 | int state; |
Paul Walmsley | 2354eb5 | 2009-12-08 16:33:12 -0700 | [diff] [blame] | 127 | unsigned state_counter[PWRDM_MAX_PWRSTS]; |
Thara Gopinath | cde08f8 | 2010-02-24 12:05:50 -0700 | [diff] [blame] | 128 | unsigned ret_logic_off_counter; |
| 129 | unsigned ret_mem_off_counter[PWRDM_MAX_MEM_BANKS]; |
Peter 'p2' De Schrijver | 331b93f | 2008-10-15 18:13:48 +0300 | [diff] [blame] | 130 | |
Vaibhav Hiremath | 3f0ea76 | 2012-06-18 00:47:27 -0600 | [diff] [blame] | 131 | const u8 pwrstctrl_offs; |
| 132 | const u8 pwrstst_offs; |
| 133 | const u32 logicretstate_mask; |
| 134 | const u32 mem_on_mask[PWRDM_MAX_MEM_BANKS]; |
| 135 | const u32 mem_ret_mask[PWRDM_MAX_MEM_BANKS]; |
| 136 | const u32 mem_pwrst_mask[PWRDM_MAX_MEM_BANKS]; |
| 137 | const u32 mem_retst_mask[PWRDM_MAX_MEM_BANKS]; |
| 138 | |
Peter 'p2' De Schrijver | 331b93f | 2008-10-15 18:13:48 +0300 | [diff] [blame] | 139 | #ifdef CONFIG_PM_DEBUG |
| 140 | s64 timer; |
Paul Walmsley | 2354eb5 | 2009-12-08 16:33:12 -0700 | [diff] [blame] | 141 | s64 state_timer[PWRDM_MAX_PWRSTS]; |
Peter 'p2' De Schrijver | 331b93f | 2008-10-15 18:13:48 +0300 | [diff] [blame] | 142 | #endif |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 143 | }; |
| 144 | |
Rajendra Nayak | 3b1e8b2 | 2010-12-21 20:01:18 -0700 | [diff] [blame] | 145 | /** |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 146 | * struct pwrdm_ops - Arch specific function implementations |
Rajendra Nayak | 3b1e8b2 | 2010-12-21 20:01:18 -0700 | [diff] [blame] | 147 | * @pwrdm_set_next_pwrst: Set the target power state for a pd |
| 148 | * @pwrdm_read_next_pwrst: Read the target power state set for a pd |
| 149 | * @pwrdm_read_pwrst: Read the current power state of a pd |
| 150 | * @pwrdm_read_prev_pwrst: Read the prev power state entered by the pd |
| 151 | * @pwrdm_set_logic_retst: Set the logic state in RET for a pd |
| 152 | * @pwrdm_set_mem_onst: Set the Memory state in ON for a pd |
| 153 | * @pwrdm_set_mem_retst: Set the Memory state in RET for a pd |
| 154 | * @pwrdm_read_logic_pwrst: Read the current logic state of a pd |
| 155 | * @pwrdm_read_prev_logic_pwrst: Read the previous logic state entered by a pd |
| 156 | * @pwrdm_read_logic_retst: Read the logic state in RET for a pd |
| 157 | * @pwrdm_read_mem_pwrst: Read the current memory state of a pd |
| 158 | * @pwrdm_read_prev_mem_pwrst: Read the previous memory state entered by a pd |
| 159 | * @pwrdm_read_mem_retst: Read the memory state in RET for a pd |
| 160 | * @pwrdm_clear_all_prev_pwrst: Clear all previous power states logged for a pd |
| 161 | * @pwrdm_enable_hdwr_sar: Enable Hardware Save-Restore feature for the pd |
| 162 | * @pwrdm_disable_hdwr_sar: Disable Hardware Save-Restore feature for a pd |
| 163 | * @pwrdm_set_lowpwrstchange: Enable pd transitions from a shallow to deep sleep |
| 164 | * @pwrdm_wait_transition: Wait for a pd state transition to complete |
Paul Walmsley | c4978fb | 2013-01-29 13:45:09 -0700 | [diff] [blame^] | 165 | * |
| 166 | * Regarding @pwrdm_set_lowpwrstchange: On the OMAP2 and 3-family |
| 167 | * chips, a powerdomain's power state is not allowed to directly |
| 168 | * transition from one low-power state (e.g., CSWR) to another |
| 169 | * low-power state (e.g., OFF) without first waking up the |
| 170 | * powerdomain. This wastes energy. So OMAP4 chips support the |
| 171 | * ability to transition a powerdomain power state directly from one |
| 172 | * low-power state to another. The function pointed to by |
| 173 | * @pwrdm_set_lowpwrstchange is intended to configure the OMAP4 |
| 174 | * hardware powerdomain state machine to enable this feature. |
Rajendra Nayak | 3b1e8b2 | 2010-12-21 20:01:18 -0700 | [diff] [blame] | 175 | */ |
| 176 | struct pwrdm_ops { |
| 177 | int (*pwrdm_set_next_pwrst)(struct powerdomain *pwrdm, u8 pwrst); |
| 178 | int (*pwrdm_read_next_pwrst)(struct powerdomain *pwrdm); |
| 179 | int (*pwrdm_read_pwrst)(struct powerdomain *pwrdm); |
| 180 | int (*pwrdm_read_prev_pwrst)(struct powerdomain *pwrdm); |
| 181 | int (*pwrdm_set_logic_retst)(struct powerdomain *pwrdm, u8 pwrst); |
| 182 | int (*pwrdm_set_mem_onst)(struct powerdomain *pwrdm, u8 bank, u8 pwrst); |
| 183 | int (*pwrdm_set_mem_retst)(struct powerdomain *pwrdm, u8 bank, u8 pwrst); |
| 184 | int (*pwrdm_read_logic_pwrst)(struct powerdomain *pwrdm); |
| 185 | int (*pwrdm_read_prev_logic_pwrst)(struct powerdomain *pwrdm); |
| 186 | int (*pwrdm_read_logic_retst)(struct powerdomain *pwrdm); |
| 187 | int (*pwrdm_read_mem_pwrst)(struct powerdomain *pwrdm, u8 bank); |
| 188 | int (*pwrdm_read_prev_mem_pwrst)(struct powerdomain *pwrdm, u8 bank); |
| 189 | int (*pwrdm_read_mem_retst)(struct powerdomain *pwrdm, u8 bank); |
| 190 | int (*pwrdm_clear_all_prev_pwrst)(struct powerdomain *pwrdm); |
| 191 | int (*pwrdm_enable_hdwr_sar)(struct powerdomain *pwrdm); |
| 192 | int (*pwrdm_disable_hdwr_sar)(struct powerdomain *pwrdm); |
| 193 | int (*pwrdm_set_lowpwrstchange)(struct powerdomain *pwrdm); |
| 194 | int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); |
| 195 | }; |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 196 | |
Paul Walmsley | 129c65e | 2011-09-14 16:01:21 -0600 | [diff] [blame] | 197 | int pwrdm_register_platform_funcs(struct pwrdm_ops *custom_funcs); |
| 198 | int pwrdm_register_pwrdms(struct powerdomain **pwrdm_list); |
| 199 | int pwrdm_complete_init(void); |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 200 | |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 201 | struct powerdomain *pwrdm_lookup(const char *name); |
| 202 | |
Peter 'p2' De Schrijver | a23456e | 2008-10-15 18:13:47 +0300 | [diff] [blame] | 203 | int pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm, void *user), |
| 204 | void *user); |
Artem Bityutskiy | ee894b1 | 2009-10-01 10:01:55 +0300 | [diff] [blame] | 205 | int pwrdm_for_each_nolock(int (*fn)(struct powerdomain *pwrdm, void *user), |
| 206 | void *user); |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 207 | |
Paul Walmsley | 8420bb1 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 208 | int pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm); |
| 209 | int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm); |
| 210 | int pwrdm_for_each_clkdm(struct powerdomain *pwrdm, |
| 211 | int (*fn)(struct powerdomain *pwrdm, |
| 212 | struct clockdomain *clkdm)); |
Kevin Hilman | 048a703 | 2011-03-16 15:52:47 -0700 | [diff] [blame] | 213 | struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm); |
Paul Walmsley | 8420bb1 | 2008-08-19 11:08:44 +0300 | [diff] [blame] | 214 | |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 215 | int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm); |
| 216 | |
| 217 | int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst); |
| 218 | int pwrdm_read_next_pwrst(struct powerdomain *pwrdm); |
Paul Walmsley | fecb494 | 2009-01-27 19:12:50 -0700 | [diff] [blame] | 219 | int pwrdm_read_pwrst(struct powerdomain *pwrdm); |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 220 | int pwrdm_read_prev_pwrst(struct powerdomain *pwrdm); |
| 221 | int pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm); |
| 222 | |
| 223 | int pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst); |
| 224 | int pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst); |
| 225 | int pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst); |
| 226 | |
| 227 | int pwrdm_read_logic_pwrst(struct powerdomain *pwrdm); |
| 228 | int pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm); |
Thara Gopinath | 1e3d0d2 | 2010-02-24 12:05:49 -0700 | [diff] [blame] | 229 | int pwrdm_read_logic_retst(struct powerdomain *pwrdm); |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 230 | int pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank); |
| 231 | int pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank); |
Thara Gopinath | 1e3d0d2 | 2010-02-24 12:05:49 -0700 | [diff] [blame] | 232 | int pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank); |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 233 | |
Paul Walmsley | 0b7cbfb | 2008-06-25 18:09:37 -0600 | [diff] [blame] | 234 | int pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm); |
| 235 | int pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm); |
| 236 | bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm); |
| 237 | |
Peter 'p2' De Schrijver | ba20bb1 | 2008-10-15 17:48:43 +0300 | [diff] [blame] | 238 | int pwrdm_state_switch(struct powerdomain *pwrdm); |
Kevin Hilman | e055548 | 2012-05-11 16:00:24 -0700 | [diff] [blame] | 239 | int pwrdm_pre_transition(struct powerdomain *pwrdm); |
| 240 | int pwrdm_post_transition(struct powerdomain *pwrdm); |
Tomi Valkeinen | fc01387 | 2011-06-09 16:56:23 +0300 | [diff] [blame] | 241 | int pwrdm_get_context_loss_count(struct powerdomain *pwrdm); |
Paul Walmsley | 694606c | 2011-03-07 19:28:15 -0700 | [diff] [blame] | 242 | bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); |
Peter 'p2' De Schrijver | ba20bb1 | 2008-10-15 17:48:43 +0300 | [diff] [blame] | 243 | |
Paul Walmsley | c4978fb | 2013-01-29 13:45:09 -0700 | [diff] [blame^] | 244 | extern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 state); |
| 245 | |
Paul Walmsley | 8179488 | 2011-09-14 11:34:21 -0600 | [diff] [blame] | 246 | extern void omap242x_powerdomains_init(void); |
| 247 | extern void omap243x_powerdomains_init(void); |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 248 | extern void omap3xxx_powerdomains_init(void); |
Vaibhav Hiremath | 3f0ea76 | 2012-06-18 00:47:27 -0600 | [diff] [blame] | 249 | extern void am33xx_powerdomains_init(void); |
Paul Walmsley | 6e01478 | 2010-12-21 20:01:20 -0700 | [diff] [blame] | 250 | extern void omap44xx_powerdomains_init(void); |
| 251 | |
Paul Walmsley | 72e06d0 | 2010-12-21 21:05:16 -0700 | [diff] [blame] | 252 | extern struct pwrdm_ops omap2_pwrdm_operations; |
| 253 | extern struct pwrdm_ops omap3_pwrdm_operations; |
Vaibhav Hiremath | 3f0ea76 | 2012-06-18 00:47:27 -0600 | [diff] [blame] | 254 | extern struct pwrdm_ops am33xx_pwrdm_operations; |
Paul Walmsley | 72e06d0 | 2010-12-21 21:05:16 -0700 | [diff] [blame] | 255 | extern struct pwrdm_ops omap4_pwrdm_operations; |
| 256 | |
| 257 | /* Common Internal functions used across OMAP rev's */ |
| 258 | extern u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank); |
| 259 | extern u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank); |
| 260 | extern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank); |
| 261 | |
| 262 | extern struct powerdomain wkup_omap2_pwrdm; |
| 263 | extern struct powerdomain gfx_omap2_pwrdm; |
| 264 | |
| 265 | |
Paul Walmsley | ad67ef6 | 2008-08-19 11:08:40 +0300 | [diff] [blame] | 266 | #endif |