18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * OMAP2/3/4 powerdomain control 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2007-2008, 2010 Texas Instruments, Inc. 68c2ecf20Sopenharmony_ci * Copyright (C) 2007-2011 Nokia Corporation 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Paul Walmsley 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * XXX This should be moved to the mach-omap2/ directory at the earliest 118c2ecf20Sopenharmony_ci * opportunity. 128c2ecf20Sopenharmony_ci */ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#ifndef __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H 158c2ecf20Sopenharmony_ci#define __ARCH_ARM_MACH_OMAP2_POWERDOMAIN_H 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#include <linux/types.h> 188c2ecf20Sopenharmony_ci#include <linux/list.h> 198c2ecf20Sopenharmony_ci#include <linux/spinlock.h> 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci/* Powerdomain basic power states */ 228c2ecf20Sopenharmony_ci#define PWRDM_POWER_OFF 0x0 238c2ecf20Sopenharmony_ci#define PWRDM_POWER_RET 0x1 248c2ecf20Sopenharmony_ci#define PWRDM_POWER_INACTIVE 0x2 258c2ecf20Sopenharmony_ci#define PWRDM_POWER_ON 0x3 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#define PWRDM_MAX_PWRSTS 4 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci/* Powerdomain allowable state bitfields */ 308c2ecf20Sopenharmony_ci#define PWRSTS_ON (1 << PWRDM_POWER_ON) 318c2ecf20Sopenharmony_ci#define PWRSTS_INACTIVE (1 << PWRDM_POWER_INACTIVE) 328c2ecf20Sopenharmony_ci#define PWRSTS_RET (1 << PWRDM_POWER_RET) 338c2ecf20Sopenharmony_ci#define PWRSTS_OFF (1 << PWRDM_POWER_OFF) 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#define PWRSTS_OFF_ON (PWRSTS_OFF | PWRSTS_ON) 368c2ecf20Sopenharmony_ci#define PWRSTS_OFF_RET (PWRSTS_OFF | PWRSTS_RET) 378c2ecf20Sopenharmony_ci#define PWRSTS_RET_ON (PWRSTS_RET | PWRSTS_ON) 388c2ecf20Sopenharmony_ci#define PWRSTS_OFF_RET_ON (PWRSTS_OFF_RET | PWRSTS_ON) 398c2ecf20Sopenharmony_ci#define PWRSTS_INA_ON (PWRSTS_INACTIVE | PWRSTS_ON) 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci/* 438c2ecf20Sopenharmony_ci * Powerdomain flags (struct powerdomain.flags) 448c2ecf20Sopenharmony_ci * 458c2ecf20Sopenharmony_ci * PWRDM_HAS_HDWR_SAR - powerdomain has hardware save-and-restore support 468c2ecf20Sopenharmony_ci * 478c2ecf20Sopenharmony_ci * PWRDM_HAS_MPU_QUIRK - MPU pwr domain has MEM bank 0 bits in MEM 488c2ecf20Sopenharmony_ci * bank 1 position. This is true for OMAP3430 498c2ecf20Sopenharmony_ci * 508c2ecf20Sopenharmony_ci * PWRDM_HAS_LOWPOWERSTATECHANGE - can transition from a sleep state 518c2ecf20Sopenharmony_ci * to a lower sleep state without waking up the powerdomain 528c2ecf20Sopenharmony_ci */ 538c2ecf20Sopenharmony_ci#define PWRDM_HAS_HDWR_SAR BIT(0) 548c2ecf20Sopenharmony_ci#define PWRDM_HAS_MPU_QUIRK BIT(1) 558c2ecf20Sopenharmony_ci#define PWRDM_HAS_LOWPOWERSTATECHANGE BIT(2) 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci/* 588c2ecf20Sopenharmony_ci * Number of memory banks that are power-controllable. On OMAP4430, the 598c2ecf20Sopenharmony_ci * maximum is 5. 608c2ecf20Sopenharmony_ci */ 618c2ecf20Sopenharmony_ci#define PWRDM_MAX_MEM_BANKS 5 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci/* 648c2ecf20Sopenharmony_ci * Maximum number of clockdomains that can be associated with a powerdomain. 658c2ecf20Sopenharmony_ci * PER powerdomain on AM33XX is the worst case 668c2ecf20Sopenharmony_ci */ 678c2ecf20Sopenharmony_ci#define PWRDM_MAX_CLKDMS 11 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci/* XXX A completely arbitrary number. What is reasonable here? */ 708c2ecf20Sopenharmony_ci#define PWRDM_TRANSITION_BAILOUT 100000 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_cistruct clockdomain; 738c2ecf20Sopenharmony_cistruct powerdomain; 748c2ecf20Sopenharmony_cistruct voltagedomain; 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci/** 778c2ecf20Sopenharmony_ci * struct powerdomain - OMAP powerdomain 788c2ecf20Sopenharmony_ci * @name: Powerdomain name 798c2ecf20Sopenharmony_ci * @voltdm: voltagedomain containing this powerdomain 808c2ecf20Sopenharmony_ci * @prcm_offs: the address offset from CM_BASE/PRM_BASE 818c2ecf20Sopenharmony_ci * @prcm_partition: (OMAP4 only) the PRCM partition ID containing @prcm_offs 828c2ecf20Sopenharmony_ci * @pwrsts: Possible powerdomain power states 838c2ecf20Sopenharmony_ci * @pwrsts_logic_ret: Possible logic power states when pwrdm in RETENTION 848c2ecf20Sopenharmony_ci * @flags: Powerdomain flags 858c2ecf20Sopenharmony_ci * @banks: Number of software-controllable memory banks in this powerdomain 868c2ecf20Sopenharmony_ci * @pwrsts_mem_ret: Possible memory bank pwrstates when pwrdm in RETENTION 878c2ecf20Sopenharmony_ci * @pwrsts_mem_on: Possible memory bank pwrstates when pwrdm in ON 888c2ecf20Sopenharmony_ci * @pwrdm_clkdms: Clockdomains in this powerdomain 898c2ecf20Sopenharmony_ci * @node: list_head linking all powerdomains 908c2ecf20Sopenharmony_ci * @voltdm_node: list_head linking all powerdomains in a voltagedomain 918c2ecf20Sopenharmony_ci * @pwrstctrl_offs: (AM33XX only) XXX_PWRSTCTRL reg offset from prcm_offs 928c2ecf20Sopenharmony_ci * @pwrstst_offs: (AM33XX only) XXX_PWRSTST reg offset from prcm_offs 938c2ecf20Sopenharmony_ci * @logicretstate_mask: (AM33XX only) mask for logic retention bitfield 948c2ecf20Sopenharmony_ci * in @pwrstctrl_offs 958c2ecf20Sopenharmony_ci * @mem_on_mask: (AM33XX only) mask for mem on bitfield in @pwrstctrl_offs 968c2ecf20Sopenharmony_ci * @mem_ret_mask: (AM33XX only) mask for mem ret bitfield in @pwrstctrl_offs 978c2ecf20Sopenharmony_ci * @mem_pwrst_mask: (AM33XX only) mask for mem state bitfield in @pwrstst_offs 988c2ecf20Sopenharmony_ci * @mem_retst_mask: (AM33XX only) mask for mem retention state bitfield 998c2ecf20Sopenharmony_ci * in @pwrstctrl_offs 1008c2ecf20Sopenharmony_ci * @state: 1018c2ecf20Sopenharmony_ci * @state_counter: 1028c2ecf20Sopenharmony_ci * @timer: 1038c2ecf20Sopenharmony_ci * @state_timer: 1048c2ecf20Sopenharmony_ci * @_lock: spinlock used to serialize powerdomain and some clockdomain ops 1058c2ecf20Sopenharmony_ci * @_lock_flags: stored flags when @_lock is taken 1068c2ecf20Sopenharmony_ci * 1078c2ecf20Sopenharmony_ci * @prcm_partition possible values are defined in mach-omap2/prcm44xx.h. 1088c2ecf20Sopenharmony_ci */ 1098c2ecf20Sopenharmony_cistruct powerdomain { 1108c2ecf20Sopenharmony_ci const char *name; 1118c2ecf20Sopenharmony_ci union { 1128c2ecf20Sopenharmony_ci const char *name; 1138c2ecf20Sopenharmony_ci struct voltagedomain *ptr; 1148c2ecf20Sopenharmony_ci } voltdm; 1158c2ecf20Sopenharmony_ci const s16 prcm_offs; 1168c2ecf20Sopenharmony_ci const u8 pwrsts; 1178c2ecf20Sopenharmony_ci const u8 pwrsts_logic_ret; 1188c2ecf20Sopenharmony_ci const u8 flags; 1198c2ecf20Sopenharmony_ci const u8 banks; 1208c2ecf20Sopenharmony_ci const u8 pwrsts_mem_ret[PWRDM_MAX_MEM_BANKS]; 1218c2ecf20Sopenharmony_ci const u8 pwrsts_mem_on[PWRDM_MAX_MEM_BANKS]; 1228c2ecf20Sopenharmony_ci const u8 prcm_partition; 1238c2ecf20Sopenharmony_ci struct clockdomain *pwrdm_clkdms[PWRDM_MAX_CLKDMS]; 1248c2ecf20Sopenharmony_ci struct list_head node; 1258c2ecf20Sopenharmony_ci struct list_head voltdm_node; 1268c2ecf20Sopenharmony_ci int state; 1278c2ecf20Sopenharmony_ci unsigned state_counter[PWRDM_MAX_PWRSTS]; 1288c2ecf20Sopenharmony_ci unsigned ret_logic_off_counter; 1298c2ecf20Sopenharmony_ci unsigned ret_mem_off_counter[PWRDM_MAX_MEM_BANKS]; 1308c2ecf20Sopenharmony_ci spinlock_t _lock; 1318c2ecf20Sopenharmony_ci unsigned long _lock_flags; 1328c2ecf20Sopenharmony_ci const u8 pwrstctrl_offs; 1338c2ecf20Sopenharmony_ci const u8 pwrstst_offs; 1348c2ecf20Sopenharmony_ci const u32 logicretstate_mask; 1358c2ecf20Sopenharmony_ci const u32 mem_on_mask[PWRDM_MAX_MEM_BANKS]; 1368c2ecf20Sopenharmony_ci const u32 mem_ret_mask[PWRDM_MAX_MEM_BANKS]; 1378c2ecf20Sopenharmony_ci const u32 mem_pwrst_mask[PWRDM_MAX_MEM_BANKS]; 1388c2ecf20Sopenharmony_ci const u32 mem_retst_mask[PWRDM_MAX_MEM_BANKS]; 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ci#ifdef CONFIG_PM_DEBUG 1418c2ecf20Sopenharmony_ci s64 timer; 1428c2ecf20Sopenharmony_ci s64 state_timer[PWRDM_MAX_PWRSTS]; 1438c2ecf20Sopenharmony_ci#endif 1448c2ecf20Sopenharmony_ci u32 context; 1458c2ecf20Sopenharmony_ci}; 1468c2ecf20Sopenharmony_ci 1478c2ecf20Sopenharmony_ci/** 1488c2ecf20Sopenharmony_ci * struct pwrdm_ops - Arch specific function implementations 1498c2ecf20Sopenharmony_ci * @pwrdm_set_next_pwrst: Set the target power state for a pd 1508c2ecf20Sopenharmony_ci * @pwrdm_read_next_pwrst: Read the target power state set for a pd 1518c2ecf20Sopenharmony_ci * @pwrdm_read_pwrst: Read the current power state of a pd 1528c2ecf20Sopenharmony_ci * @pwrdm_read_prev_pwrst: Read the prev power state entered by the pd 1538c2ecf20Sopenharmony_ci * @pwrdm_set_logic_retst: Set the logic state in RET for a pd 1548c2ecf20Sopenharmony_ci * @pwrdm_set_mem_onst: Set the Memory state in ON for a pd 1558c2ecf20Sopenharmony_ci * @pwrdm_set_mem_retst: Set the Memory state in RET for a pd 1568c2ecf20Sopenharmony_ci * @pwrdm_read_logic_pwrst: Read the current logic state of a pd 1578c2ecf20Sopenharmony_ci * @pwrdm_read_prev_logic_pwrst: Read the previous logic state entered by a pd 1588c2ecf20Sopenharmony_ci * @pwrdm_read_logic_retst: Read the logic state in RET for a pd 1598c2ecf20Sopenharmony_ci * @pwrdm_read_mem_pwrst: Read the current memory state of a pd 1608c2ecf20Sopenharmony_ci * @pwrdm_read_prev_mem_pwrst: Read the previous memory state entered by a pd 1618c2ecf20Sopenharmony_ci * @pwrdm_read_mem_retst: Read the memory state in RET for a pd 1628c2ecf20Sopenharmony_ci * @pwrdm_clear_all_prev_pwrst: Clear all previous power states logged for a pd 1638c2ecf20Sopenharmony_ci * @pwrdm_enable_hdwr_sar: Enable Hardware Save-Restore feature for the pd 1648c2ecf20Sopenharmony_ci * @pwrdm_disable_hdwr_sar: Disable Hardware Save-Restore feature for a pd 1658c2ecf20Sopenharmony_ci * @pwrdm_set_lowpwrstchange: Enable pd transitions from a shallow to deep sleep 1668c2ecf20Sopenharmony_ci * @pwrdm_wait_transition: Wait for a pd state transition to complete 1678c2ecf20Sopenharmony_ci * @pwrdm_has_voltdm: Check if a voltdm association is needed 1688c2ecf20Sopenharmony_ci * 1698c2ecf20Sopenharmony_ci * Regarding @pwrdm_set_lowpwrstchange: On the OMAP2 and 3-family 1708c2ecf20Sopenharmony_ci * chips, a powerdomain's power state is not allowed to directly 1718c2ecf20Sopenharmony_ci * transition from one low-power state (e.g., CSWR) to another 1728c2ecf20Sopenharmony_ci * low-power state (e.g., OFF) without first waking up the 1738c2ecf20Sopenharmony_ci * powerdomain. This wastes energy. So OMAP4 chips support the 1748c2ecf20Sopenharmony_ci * ability to transition a powerdomain power state directly from one 1758c2ecf20Sopenharmony_ci * low-power state to another. The function pointed to by 1768c2ecf20Sopenharmony_ci * @pwrdm_set_lowpwrstchange is intended to configure the OMAP4 1778c2ecf20Sopenharmony_ci * hardware powerdomain state machine to enable this feature. 1788c2ecf20Sopenharmony_ci */ 1798c2ecf20Sopenharmony_cistruct pwrdm_ops { 1808c2ecf20Sopenharmony_ci int (*pwrdm_set_next_pwrst)(struct powerdomain *pwrdm, u8 pwrst); 1818c2ecf20Sopenharmony_ci int (*pwrdm_read_next_pwrst)(struct powerdomain *pwrdm); 1828c2ecf20Sopenharmony_ci int (*pwrdm_read_pwrst)(struct powerdomain *pwrdm); 1838c2ecf20Sopenharmony_ci int (*pwrdm_read_prev_pwrst)(struct powerdomain *pwrdm); 1848c2ecf20Sopenharmony_ci int (*pwrdm_set_logic_retst)(struct powerdomain *pwrdm, u8 pwrst); 1858c2ecf20Sopenharmony_ci int (*pwrdm_set_mem_onst)(struct powerdomain *pwrdm, u8 bank, u8 pwrst); 1868c2ecf20Sopenharmony_ci int (*pwrdm_set_mem_retst)(struct powerdomain *pwrdm, u8 bank, u8 pwrst); 1878c2ecf20Sopenharmony_ci int (*pwrdm_read_logic_pwrst)(struct powerdomain *pwrdm); 1888c2ecf20Sopenharmony_ci int (*pwrdm_read_prev_logic_pwrst)(struct powerdomain *pwrdm); 1898c2ecf20Sopenharmony_ci int (*pwrdm_read_logic_retst)(struct powerdomain *pwrdm); 1908c2ecf20Sopenharmony_ci int (*pwrdm_read_mem_pwrst)(struct powerdomain *pwrdm, u8 bank); 1918c2ecf20Sopenharmony_ci int (*pwrdm_read_prev_mem_pwrst)(struct powerdomain *pwrdm, u8 bank); 1928c2ecf20Sopenharmony_ci int (*pwrdm_read_mem_retst)(struct powerdomain *pwrdm, u8 bank); 1938c2ecf20Sopenharmony_ci int (*pwrdm_clear_all_prev_pwrst)(struct powerdomain *pwrdm); 1948c2ecf20Sopenharmony_ci int (*pwrdm_enable_hdwr_sar)(struct powerdomain *pwrdm); 1958c2ecf20Sopenharmony_ci int (*pwrdm_disable_hdwr_sar)(struct powerdomain *pwrdm); 1968c2ecf20Sopenharmony_ci int (*pwrdm_set_lowpwrstchange)(struct powerdomain *pwrdm); 1978c2ecf20Sopenharmony_ci int (*pwrdm_wait_transition)(struct powerdomain *pwrdm); 1988c2ecf20Sopenharmony_ci int (*pwrdm_has_voltdm)(void); 1998c2ecf20Sopenharmony_ci void (*pwrdm_save_context)(struct powerdomain *pwrdm); 2008c2ecf20Sopenharmony_ci void (*pwrdm_restore_context)(struct powerdomain *pwrdm); 2018c2ecf20Sopenharmony_ci}; 2028c2ecf20Sopenharmony_ci 2038c2ecf20Sopenharmony_ciint pwrdm_register_platform_funcs(struct pwrdm_ops *custom_funcs); 2048c2ecf20Sopenharmony_ciint pwrdm_register_pwrdms(struct powerdomain **pwrdm_list); 2058c2ecf20Sopenharmony_ciint pwrdm_complete_init(void); 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_cistruct powerdomain *pwrdm_lookup(const char *name); 2088c2ecf20Sopenharmony_ci 2098c2ecf20Sopenharmony_ciint pwrdm_for_each(int (*fn)(struct powerdomain *pwrdm, void *user), 2108c2ecf20Sopenharmony_ci void *user); 2118c2ecf20Sopenharmony_ciint pwrdm_for_each_nolock(int (*fn)(struct powerdomain *pwrdm, void *user), 2128c2ecf20Sopenharmony_ci void *user); 2138c2ecf20Sopenharmony_ci 2148c2ecf20Sopenharmony_ciint pwrdm_add_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm); 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_ciint pwrdm_get_mem_bank_count(struct powerdomain *pwrdm); 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_ciu8 pwrdm_get_valid_lp_state(struct powerdomain *pwrdm, 2198c2ecf20Sopenharmony_ci bool is_logic_state, u8 req_state); 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_ciint pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst); 2228c2ecf20Sopenharmony_ciint pwrdm_read_next_pwrst(struct powerdomain *pwrdm); 2238c2ecf20Sopenharmony_ciint pwrdm_read_pwrst(struct powerdomain *pwrdm); 2248c2ecf20Sopenharmony_ciint pwrdm_read_prev_pwrst(struct powerdomain *pwrdm); 2258c2ecf20Sopenharmony_ciint pwrdm_clear_all_prev_pwrst(struct powerdomain *pwrdm); 2268c2ecf20Sopenharmony_ci 2278c2ecf20Sopenharmony_ciint pwrdm_set_logic_retst(struct powerdomain *pwrdm, u8 pwrst); 2288c2ecf20Sopenharmony_ciint pwrdm_set_mem_onst(struct powerdomain *pwrdm, u8 bank, u8 pwrst); 2298c2ecf20Sopenharmony_ciint pwrdm_set_mem_retst(struct powerdomain *pwrdm, u8 bank, u8 pwrst); 2308c2ecf20Sopenharmony_ci 2318c2ecf20Sopenharmony_ciint pwrdm_read_logic_pwrst(struct powerdomain *pwrdm); 2328c2ecf20Sopenharmony_ciint pwrdm_read_prev_logic_pwrst(struct powerdomain *pwrdm); 2338c2ecf20Sopenharmony_ciint pwrdm_read_logic_retst(struct powerdomain *pwrdm); 2348c2ecf20Sopenharmony_ciint pwrdm_read_mem_pwrst(struct powerdomain *pwrdm, u8 bank); 2358c2ecf20Sopenharmony_ciint pwrdm_read_prev_mem_pwrst(struct powerdomain *pwrdm, u8 bank); 2368c2ecf20Sopenharmony_ciint pwrdm_read_mem_retst(struct powerdomain *pwrdm, u8 bank); 2378c2ecf20Sopenharmony_ci 2388c2ecf20Sopenharmony_ciint pwrdm_enable_hdwr_sar(struct powerdomain *pwrdm); 2398c2ecf20Sopenharmony_ciint pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm); 2408c2ecf20Sopenharmony_cibool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm); 2418c2ecf20Sopenharmony_ci 2428c2ecf20Sopenharmony_ciint pwrdm_state_switch_nolock(struct powerdomain *pwrdm); 2438c2ecf20Sopenharmony_ciint pwrdm_state_switch(struct powerdomain *pwrdm); 2448c2ecf20Sopenharmony_ciint pwrdm_pre_transition(struct powerdomain *pwrdm); 2458c2ecf20Sopenharmony_ciint pwrdm_post_transition(struct powerdomain *pwrdm); 2468c2ecf20Sopenharmony_ciint pwrdm_get_context_loss_count(struct powerdomain *pwrdm); 2478c2ecf20Sopenharmony_cibool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); 2488c2ecf20Sopenharmony_ci 2498c2ecf20Sopenharmony_ciextern int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 state); 2508c2ecf20Sopenharmony_ci 2518c2ecf20Sopenharmony_ciextern void omap242x_powerdomains_init(void); 2528c2ecf20Sopenharmony_ciextern void omap243x_powerdomains_init(void); 2538c2ecf20Sopenharmony_ciextern void omap3xxx_powerdomains_init(void); 2548c2ecf20Sopenharmony_ciextern void am33xx_powerdomains_init(void); 2558c2ecf20Sopenharmony_ciextern void omap44xx_powerdomains_init(void); 2568c2ecf20Sopenharmony_ciextern void omap54xx_powerdomains_init(void); 2578c2ecf20Sopenharmony_ciextern void dra7xx_powerdomains_init(void); 2588c2ecf20Sopenharmony_civoid am43xx_powerdomains_init(void); 2598c2ecf20Sopenharmony_ci 2608c2ecf20Sopenharmony_ciextern struct pwrdm_ops omap2_pwrdm_operations; 2618c2ecf20Sopenharmony_ciextern struct pwrdm_ops omap3_pwrdm_operations; 2628c2ecf20Sopenharmony_ciextern struct pwrdm_ops am33xx_pwrdm_operations; 2638c2ecf20Sopenharmony_ciextern struct pwrdm_ops omap4_pwrdm_operations; 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_ci/* Common Internal functions used across OMAP rev's */ 2668c2ecf20Sopenharmony_ciextern u32 omap2_pwrdm_get_mem_bank_onstate_mask(u8 bank); 2678c2ecf20Sopenharmony_ciextern u32 omap2_pwrdm_get_mem_bank_retst_mask(u8 bank); 2688c2ecf20Sopenharmony_ciextern u32 omap2_pwrdm_get_mem_bank_stst_mask(u8 bank); 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_ciextern struct powerdomain wkup_omap2_pwrdm; 2718c2ecf20Sopenharmony_ciextern struct powerdomain gfx_omap2_pwrdm; 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_ciextern void pwrdm_lock(struct powerdomain *pwrdm); 2748c2ecf20Sopenharmony_ciextern void pwrdm_unlock(struct powerdomain *pwrdm); 2758c2ecf20Sopenharmony_ci 2768c2ecf20Sopenharmony_ciextern void pwrdms_save_context(void); 2778c2ecf20Sopenharmony_ciextern void pwrdms_restore_context(void); 2788c2ecf20Sopenharmony_ci 2798c2ecf20Sopenharmony_ciextern void pwrdms_lost_power(void); 2808c2ecf20Sopenharmony_ci#endif 281