ARM: OMAP3/4: PRM: provide io chain reconfig function through irq setup
[deliverable/linux.git] / arch / arm / mach-omap2 / prm.h
CommitLineData
69d88a00 1/*
59fb659b 2 * OMAP2/3/4 Power/Reset Management (PRM) bitfield definitions
69d88a00 3 *
d9a16f9a 4 * Copyright (C) 2007-2009, 2012 Texas Instruments, Inc.
0be1621a 5 * Copyright (C) 2010 Nokia Corporation
69d88a00 6 *
59fb659b 7 * Paul Walmsley
69d88a00
PW
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.
12 */
59fb659b
PW
13#ifndef __ARCH_ARM_MACH_OMAP2_PRM_H
14#define __ARCH_ARM_MACH_OMAP2_PRM_H
69d88a00
PW
15
16#include "prcm-common.h"
17
d9a16f9a
PW
18# ifndef __ASSEMBLER__
19extern void __iomem *prm_base;
20extern void omap2_set_globals_prm(void __iomem *prm);
943a63a4 21int of_prcm_init(void);
d9a16f9a
PW
22# endif
23
b13159af
PW
24
25/*
26 * MAX_MODULE_SOFTRESET_WAIT: Maximum microseconds to wait for OMAP
27 * module to softreset
28 */
29#define MAX_MODULE_SOFTRESET_WAIT 10000
30
31/*
32 * MAX_MODULE_HARDRESET_WAIT: Maximum microseconds to wait for an OMAP
33 * submodule to exit hardreset
34 */
35#define MAX_MODULE_HARDRESET_WAIT 10000
36
37/*
38 * Register bitfields
39 */
40
69d88a00
PW
41/*
42 * 24XX: PM_PWSTST_CORE, PM_PWSTST_GFX, PM_PWSTST_MPU, PM_PWSTST_DSP
43 *
44 * 2430: PM_PWSTST_MDM
45 *
46 * 3430: PM_PWSTST_IVA2, PM_PWSTST_MPU, PM_PWSTST_CORE, PM_PWSTST_GFX,
47 * PM_PWSTST_DSS, PM_PWSTST_CAM, PM_PWSTST_PER, PM_PWSTST_EMU,
48 * PM_PWSTST_NEON
49 */
2fd0f75c 50#define OMAP_INTRANSITION_MASK (1 << 20)
69d88a00
PW
51
52
53/*
54 * 24XX: PM_PWSTST_GFX, PM_PWSTST_DSP
55 *
56 * 2430: PM_PWSTST_MDM
57 *
58 * 3430: PM_PWSTST_IVA2, PM_PWSTST_MPU, PM_PWSTST_CORE, PM_PWSTST_GFX,
59 * PM_PWSTST_DSS, PM_PWSTST_CAM, PM_PWSTST_PER, PM_PWSTST_EMU,
60 * PM_PWSTST_NEON
61 */
62#define OMAP_POWERSTATEST_SHIFT 0
63#define OMAP_POWERSTATEST_MASK (0x3 << 0)
64
69d88a00
PW
65/*
66 * 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
67 * PM_PWSTCTRL_DSP, PM_PWSTST_MPU
68 *
69 * 2430: PM_PWSTCTRL_MDM shared bits
70 *
71 * 3430: PM_PWSTCTRL_IVA2, PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE,
72 * PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSS, PM_PWSTCTRL_CAM, PM_PWSTCTRL_PER,
73 * PM_PWSTCTRL_NEON shared bits
74 */
75#define OMAP_POWERSTATE_SHIFT 0
76#define OMAP_POWERSTATE_MASK (0x3 << 0)
77
2bb2a5d3
PW
78/*
79 * Standardized OMAP reset source bits
80 *
81 * To the extent these happen to match the hardware register bit
82 * shifts, it's purely coincidental. Used by omap-wdt.c.
83 * OMAP_UNKNOWN_RST_SRC_ID_SHIFT is a special value, used whenever
84 * there are any bits remaining in the global PRM_RSTST register that
85 * haven't been identified, or when the PRM code for the current SoC
86 * doesn't know how to interpret the register.
87 */
88#define OMAP_GLOBAL_COLD_RST_SRC_ID_SHIFT 0
89#define OMAP_GLOBAL_WARM_RST_SRC_ID_SHIFT 1
90#define OMAP_SECU_VIOL_RST_SRC_ID_SHIFT 2
91#define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
92#define OMAP_SECU_WD_RST_SRC_ID_SHIFT 4
93#define OMAP_EXTWARM_RST_SRC_ID_SHIFT 5
94#define OMAP_VDD_MPU_VM_RST_SRC_ID_SHIFT 6
95#define OMAP_VDD_IVA_VM_RST_SRC_ID_SHIFT 7
96#define OMAP_VDD_CORE_VM_RST_SRC_ID_SHIFT 8
97#define OMAP_ICEPICK_RST_SRC_ID_SHIFT 9
98#define OMAP_ICECRUSHER_RST_SRC_ID_SHIFT 10
99#define OMAP_C2C_RST_SRC_ID_SHIFT 11
100#define OMAP_UNKNOWN_RST_SRC_ID_SHIFT 12
101
e24c3573
PW
102#ifndef __ASSEMBLER__
103
2bb2a5d3
PW
104/**
105 * struct prm_reset_src_map - map register bitshifts to standard bitshifts
106 * @reg_shift: bitshift in the PRM reset source register
107 * @std_shift: bitshift equivalent in the standard reset source list
108 *
109 * The fields are signed because -1 is used as a terminator.
110 */
111struct prm_reset_src_map {
112 s8 reg_shift;
113 s8 std_shift;
114};
115
e24c3573
PW
116/**
117 * struct prm_ll_data - fn ptrs to per-SoC PRM function implementations
e6d3a8b0
RN
118 * @read_reset_sources: ptr to the SoC PRM-specific get_reset_source impl
119 * @was_any_context_lost_old: ptr to the SoC PRM context loss test fn
120 * @clear_context_loss_flags_old: ptr to the SoC PRM context loss flag clear fn
121 *
122 * XXX @was_any_context_lost_old and @clear_context_loss_flags_old are
123 * deprecated.
e24c3573 124 */
2bb2a5d3
PW
125struct prm_ll_data {
126 u32 (*read_reset_sources)(void);
e6d3a8b0
RN
127 bool (*was_any_context_lost_old)(u8 part, s16 inst, u16 idx);
128 void (*clear_context_loss_flags_old)(u8 part, s16 inst, u16 idx);
2bb2a5d3 129};
e24c3573
PW
130
131extern int prm_register(struct prm_ll_data *pld);
132extern int prm_unregister(struct prm_ll_data *pld);
133
2bb2a5d3 134extern u32 prm_read_reset_sources(void);
e6d3a8b0
RN
135extern bool prm_was_any_context_lost_old(u8 part, s16 inst, u16 idx);
136extern void prm_clear_context_loss_flags_old(u8 part, s16 inst, u16 idx);
2bb2a5d3 137
e24c3573 138#endif
69d88a00 139
2bb2a5d3 140
69d88a00 141#endif
This page took 0.375076 seconds and 5 git commands to generate.