2 * OMAP4xxx bandgap registers, bitfields and temperature definitions
4 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
6 * Eduardo Valentin <eduardo.valentin@ti.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 #ifndef __OMAP4XXX_BANDGAP_H
24 #define __OMAP4XXX_BANDGAP_H
29 * Below, in sequence, are the Register definitions,
30 * the bitfields and the temperature definitions for OMAP4430.
34 * OMAP4430 register definitions
36 * Registers are defined as offsets. The offsets are
37 * relative to FUSE_OPP_BGAP on 4430.
40 /* OMAP4430.FUSE_OPP_BGAP */
41 #define OMAP4430_FUSE_OPP_BGAP 0x0
43 /* OMAP4430.TEMP_SENSOR */
44 #define OMAP4430_TEMP_SENSOR_CTRL_OFFSET 0xCC
47 * Register and bit definitions for OMAP4430
49 * All the macros bellow define the required bits for
50 * controlling temperature on OMAP4430. Bit defines are
51 * grouped by register.
54 /* OMAP4430.TEMP_SENSOR bits */
55 #define OMAP4430_BGAP_TEMPSOFF_MASK BIT(12)
56 #define OMAP4430_BGAP_TSHUT_MASK BIT(11)
57 #define OMAP4430_SINGLE_MODE_MASK BIT(10)
58 #define OMAP4430_BGAP_TEMP_SENSOR_SOC_MASK BIT(9)
59 #define OMAP4430_BGAP_TEMP_SENSOR_EOCZ_MASK BIT(8)
60 #define OMAP4430_BGAP_TEMP_SENSOR_DTEMP_MASK (0xff << 0)
63 * Temperature limits and thresholds for OMAP4430
65 * All the macros bellow are definitions for handling the
66 * ADC conversions and representation of temperature limits
67 * and thresholds for OMAP4430.
71 * ADC conversion table limits. Ignore values outside the TRM listed
72 * range to avoid bogus thermal shutdowns. See omap4430 TRM chapter
73 * "18.4.10.2.3 ADC Codes Versus Temperature".
75 #define OMAP4430_ADC_START_VALUE 13
76 #define OMAP4430_ADC_END_VALUE 107
77 /* bandgap clock limits (no control on 4430) */
78 #define OMAP4430_MAX_FREQ 32768
79 #define OMAP4430_MIN_FREQ 32768
81 #define OMAP4430_MIN_TEMP -40000
82 #define OMAP4430_MAX_TEMP 125000
83 #define OMAP4430_HYST_VAL 5000
86 * *** OMAP4460 *** Applicable for OMAP4470
88 * Below, in sequence, are the Register definitions,
89 * the bitfields and the temperature definitions for OMAP4460.
93 * OMAP4460 register definitions
95 * Registers are defined as offsets. The offsets are
96 * relative to FUSE_OPP_BGAP on 4460.
99 /* OMAP4460.FUSE_OPP_BGAP */
100 #define OMAP4460_FUSE_OPP_BGAP 0x0
102 /* OMAP4460.TEMP_SENSOR */
103 #define OMAP4460_TEMP_SENSOR_CTRL_OFFSET 0xCC
105 /* OMAP4460.BANDGAP_CTRL */
106 #define OMAP4460_BGAP_CTRL_OFFSET 0x118
108 /* OMAP4460.BANDGAP_COUNTER */
109 #define OMAP4460_BGAP_COUNTER_OFFSET 0x11C
111 /* OMAP4460.BANDGAP_THRESHOLD */
112 #define OMAP4460_BGAP_THRESHOLD_OFFSET 0x120
114 /* OMAP4460.TSHUT_THRESHOLD */
115 #define OMAP4460_BGAP_TSHUT_OFFSET 0x124
117 /* OMAP4460.BANDGAP_STATUS */
118 #define OMAP4460_BGAP_STATUS_OFFSET 0x128
121 * Register bitfields for OMAP4460
123 * All the macros bellow define the required bits for
124 * controlling temperature on OMAP4460. Bit defines are
125 * grouped by register.
127 /* OMAP4460.TEMP_SENSOR bits */
128 #define OMAP4460_BGAP_TEMPSOFF_MASK BIT(13)
129 #define OMAP4460_BGAP_TEMP_SENSOR_SOC_MASK BIT(11)
130 #define OMAP4460_BGAP_TEMP_SENSOR_EOCZ_MASK BIT(10)
131 #define OMAP4460_BGAP_TEMP_SENSOR_DTEMP_MASK (0x3ff << 0)
133 /* OMAP4460.BANDGAP_CTRL bits */
134 #define OMAP4460_SINGLE_MODE_MASK BIT(31)
135 #define OMAP4460_MASK_HOT_MASK BIT(1)
136 #define OMAP4460_MASK_COLD_MASK BIT(0)
138 /* OMAP4460.BANDGAP_COUNTER bits */
139 #define OMAP4460_COUNTER_MASK (0xffffff << 0)
141 /* OMAP4460.BANDGAP_THRESHOLD bits */
142 #define OMAP4460_T_HOT_MASK (0x3ff << 16)
143 #define OMAP4460_T_COLD_MASK (0x3ff << 0)
145 /* OMAP4460.TSHUT_THRESHOLD bits */
146 #define OMAP4460_TSHUT_HOT_MASK (0x3ff << 16)
147 #define OMAP4460_TSHUT_COLD_MASK (0x3ff << 0)
149 /* OMAP4460.BANDGAP_STATUS bits */
150 #define OMAP4460_CLEAN_STOP_MASK BIT(3)
151 #define OMAP4460_BGAP_ALERT_MASK BIT(2)
152 #define OMAP4460_HOT_FLAG_MASK BIT(1)
153 #define OMAP4460_COLD_FLAG_MASK BIT(0)
156 * Temperature limits and thresholds for OMAP4460
158 * All the macros bellow are definitions for handling the
159 * ADC conversions and representation of temperature limits
160 * and thresholds for OMAP4460.
163 /* ADC conversion table limits */
164 #define OMAP4460_ADC_START_VALUE 530
165 #define OMAP4460_ADC_END_VALUE 932
166 /* bandgap clock limits */
167 #define OMAP4460_MAX_FREQ 1500000
168 #define OMAP4460_MIN_FREQ 1000000
170 #define OMAP4460_MIN_TEMP -40000
171 #define OMAP4460_MAX_TEMP 123000
172 #define OMAP4460_HYST_VAL 5000
173 /* interrupts thresholds */
174 #define OMAP4460_TSHUT_HOT 900 /* 122 deg C */
175 #define OMAP4460_TSHUT_COLD 895 /* 100 deg C */
176 #define OMAP4460_T_HOT 800 /* 73 deg C */
177 #define OMAP4460_T_COLD 795 /* 71 deg C */
179 #endif /* __OMAP4XXX_BANDGAP_H */