Merge tag 'locks-v3.16-2' of git://git.samba.org/jlayton/linux
[linux/fpc-iii.git] / arch / arm / mach-omap2 / prm.h
blob48480d557b61f82541068b174b430e4f8a1c53b5
1 /*
2 * OMAP2/3/4 Power/Reset Management (PRM) bitfield definitions
4 * Copyright (C) 2007-2009, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2010 Nokia Corporation
7 * Paul Walmsley
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.
13 #ifndef __ARCH_ARM_MACH_OMAP2_PRM_H
14 #define __ARCH_ARM_MACH_OMAP2_PRM_H
16 #include "prcm-common.h"
18 # ifndef __ASSEMBLER__
19 extern void __iomem *prm_base;
20 extern u16 prm_features;
21 extern void omap2_set_globals_prm(void __iomem *prm);
22 int of_prcm_init(void);
23 # endif
26 * prm_features flag values
28 * PRM_HAS_IO_WAKEUP: has IO wakeup capability
29 * PRM_HAS_VOLTAGE: has voltage domains
31 #define PRM_HAS_IO_WAKEUP (1 << 0)
34 * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
35 * module to softreset
37 #define MAX_MODULE_SOFTRESET_WAIT 10000
40 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
41 * submodule to exit hardreset
43 #define MAX_MODULE_HARDRESET_WAIT 10000
46 * Register bitfields
50 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP
52 * 2430: PM_PWSTST_MDM
54 * 3430: PM_PWSTST_IVA2, PM_PWSTST_MPU, PM_PWSTST_CORE, PM_PWSTST_GFX,
55 * PM_PWSTST_DSS, PM_PWSTST_CAM, PM_PWSTST_PER, PM_PWSTST_EMU,
56 * PM_PWSTST_NEON
58 #define OMAP_INTRANSITION_MASK (1 << 20)
62 * 24XX: PM_PWSTST_GFX, PM_PWSTST_DSP
64 * 2430: PM_PWSTST_MDM
66 * 3430: PM_PWSTST_IVA2, PM_PWSTST_MPU, PM_PWSTST_CORE, PM_PWSTST_GFX,
67 * PM_PWSTST_DSS, PM_PWSTST_CAM, PM_PWSTST_PER, PM_PWSTST_EMU,
68 * PM_PWSTST_NEON
70 #define OMAP_POWERSTATEST_SHIFT 0
71 #define OMAP_POWERSTATEST_MASK (0x3 << 0)
74 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
75 * PM_PWSTCTRL_DSP, PM_PWSTST_MPU
77 * 2430: PM_PWSTCTRL_MDM shared bits
79 * 3430: PM_PWSTCTRL_IVA2, PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE,
80 * PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM, PM_PWSTCTRL_PER,
81 * PM_PWSTCTRL_NEON shared bits
83 #define OMAP_POWERSTATE_SHIFT 0
84 #define OMAP_POWERSTATE_MASK (0x3 << 0)
87 * Standardized OMAP reset source bits
89 * To the extent these happen to match the hardware register bit
90 * shifts, it's purely coincidental. Used by omap-wdt.c.
91 * OMAP_UNKNOWN_RST_SRC_ID_SHIFT is a special value, used whenever
92 * there are any bits remaining in the global PRM_RSTST register that
93 * haven't been identified, or when the PRM code for the current SoC
94 * doesn't know how to interpret the register.
96 #define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT 0
97 #define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT 1
98 #define OMAP_SECU_VIOL_RST_SRC_ID_SHIFT 2
99 #define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
100 #define OMAP_SECU_WD_RST_SRC_ID_SHIFT 4
101 #define OMAP_EXTWARM_RST_SRC_ID_SHIFT 5
102 #define OMAP_VDD_MPU_VM_RST_SRC_ID_SHIFT 6
103 #define OMAP_VDD_IVA_VM_RST_SRC_ID_SHIFT 7
104 #define OMAP_VDD_CORE_VM_RST_SRC_ID_SHIFT 8
105 #define OMAP_ICEPICK_RST_SRC_ID_SHIFT 9
106 #define OMAP_ICECRUSHER_RST_SRC_ID_SHIFT 10
107 #define OMAP_C2C_RST_SRC_ID_SHIFT 11
108 #define OMAP_UNKNOWN_RST_SRC_ID_SHIFT 12
110 #ifndef __ASSEMBLER__
113 * struct prm_reset_src_map - map register bitshifts to standard bitshifts
114 * @reg_shift: bitshift in the PRM reset source register
115 * @std_shift: bitshift equivalent in the standard reset source list
117 * The fields are signed because -1 is used as a terminator.
119 struct prm_reset_src_map {
120 s8 reg_shift;
121 s8 std_shift;
125 * struct prm_ll_data - fn ptrs to per-SoC PRM function implementations
126 * @read_reset_sources: ptr to the SoC PRM-specific get_reset_source impl
127 * @was_any_context_lost_old: ptr to the SoC PRM context loss test fn
128 * @clear_context_loss_flags_old: ptr to the SoC PRM context loss flag clear fn
129 * @late_init: ptr to the late init function
131 * XXX @was_any_context_lost_old and @clear_context_loss_flags_old are
132 * deprecated.
134 struct prm_ll_data {
135 u32 (*read_reset_sources)(void);
136 bool (*was_any_context_lost_old)(u8 part, s16 inst, u16 idx);
137 void (*clear_context_loss_flags_old)(u8 part, s16 inst, u16 idx);
138 int (*late_init)(void);
141 extern int prm_register(struct prm_ll_data *pld);
142 extern int prm_unregister(struct prm_ll_data *pld);
144 extern u32 prm_read_reset_sources(void);
145 extern bool prm_was_any_context_lost_old(u8 part, s16 inst, u16 idx);
146 extern void prm_clear_context_loss_flags_old(u8 part, s16 inst, u16 idx);
148 #endif
151 #endif