treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / thermal / ti-soc-thermal / dra752-bandgap.h
blobd1b5b699cf23c1e8a4a892d17919054ad660faf2
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * DRA752 bandgap registers, bitfields and temperature definitions
5 * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
6 * Contact:
7 * Eduardo Valentin <eduardo.valentin@ti.com>
8 * Tero Kristo <t-kristo@ti.com>
10 * This is an auto generated file.
12 #ifndef __DRA752_BANDGAP_H
13 #define __DRA752_BANDGAP_H
15 /**
16 * *** DRA752 ***
18 * Below, in sequence, are the Register definitions,
19 * the bitfields and the temperature definitions for DRA752.
22 /**
23 * DRA752 register definitions
25 * Registers are defined as offsets. The offsets are
26 * relative to FUSE_OPP_BGAP_GPU on DRA752.
27 * DRA752_BANDGAP_BASE 0x4a0021e0
29 * Register below are grouped by domain (not necessarily in offset order)
33 /* DRA752.common register offsets */
34 #define DRA752_BANDGAP_CTRL_1_OFFSET 0x1a0
35 #define DRA752_BANDGAP_STATUS_1_OFFSET 0x1c8
36 #define DRA752_BANDGAP_CTRL_2_OFFSET 0x39c
37 #define DRA752_BANDGAP_STATUS_2_OFFSET 0x3b8
39 /* DRA752.core register offsets */
40 #define DRA752_STD_FUSE_OPP_BGAP_CORE_OFFSET 0x8
41 #define DRA752_TEMP_SENSOR_CORE_OFFSET 0x154
42 #define DRA752_BANDGAP_THRESHOLD_CORE_OFFSET 0x1ac
43 #define DRA752_DTEMP_CORE_1_OFFSET 0x20c
44 #define DRA752_DTEMP_CORE_2_OFFSET 0x210
46 /* DRA752.iva register offsets */
47 #define DRA752_STD_FUSE_OPP_BGAP_IVA_OFFSET 0x388
48 #define DRA752_TEMP_SENSOR_IVA_OFFSET 0x398
49 #define DRA752_BANDGAP_THRESHOLD_IVA_OFFSET 0x3a4
50 #define DRA752_DTEMP_IVA_1_OFFSET 0x3d4
51 #define DRA752_DTEMP_IVA_2_OFFSET 0x3d8
53 /* DRA752.mpu register offsets */
54 #define DRA752_STD_FUSE_OPP_BGAP_MPU_OFFSET 0x4
55 #define DRA752_TEMP_SENSOR_MPU_OFFSET 0x14c
56 #define DRA752_BANDGAP_THRESHOLD_MPU_OFFSET 0x1a4
57 #define DRA752_DTEMP_MPU_1_OFFSET 0x1e4
58 #define DRA752_DTEMP_MPU_2_OFFSET 0x1e8
60 /* DRA752.dspeve register offsets */
61 #define DRA752_STD_FUSE_OPP_BGAP_DSPEVE_OFFSET 0x384
62 #define DRA752_TEMP_SENSOR_DSPEVE_OFFSET 0x394
63 #define DRA752_BANDGAP_THRESHOLD_DSPEVE_OFFSET 0x3a0
64 #define DRA752_DTEMP_DSPEVE_1_OFFSET 0x3c0
65 #define DRA752_DTEMP_DSPEVE_2_OFFSET 0x3c4
67 /* DRA752.gpu register offsets */
68 #define DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET 0x0
69 #define DRA752_TEMP_SENSOR_GPU_OFFSET 0x150
70 #define DRA752_BANDGAP_THRESHOLD_GPU_OFFSET 0x1a8
71 #define DRA752_DTEMP_GPU_1_OFFSET 0x1f8
72 #define DRA752_DTEMP_GPU_2_OFFSET 0x1fc
74 /**
75 * Register bitfields for DRA752
77 * All the macros bellow define the required bits for
78 * controlling temperature on DRA752. Bit defines are
79 * grouped by register.
82 /* DRA752.BANDGAP_STATUS_1 */
83 #define DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK BIT(5)
84 #define DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK BIT(4)
85 #define DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK BIT(3)
86 #define DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK BIT(2)
87 #define DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK BIT(1)
88 #define DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK BIT(0)
90 /* DRA752.BANDGAP_CTRL_2 */
91 #define DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK BIT(22)
92 #define DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK BIT(21)
93 #define DRA752_BANDGAP_CTRL_2_MASK_HOT_IVA_MASK BIT(3)
94 #define DRA752_BANDGAP_CTRL_2_MASK_COLD_IVA_MASK BIT(2)
95 #define DRA752_BANDGAP_CTRL_2_MASK_HOT_DSPEVE_MASK BIT(1)
96 #define DRA752_BANDGAP_CTRL_2_MASK_COLD_DSPEVE_MASK BIT(0)
98 /* DRA752.BANDGAP_STATUS_2 */
99 #define DRA752_BANDGAP_STATUS_2_HOT_IVA_MASK BIT(3)
100 #define DRA752_BANDGAP_STATUS_2_COLD_IVA_MASK BIT(2)
101 #define DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK BIT(1)
102 #define DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK BIT(0)
104 /* DRA752.BANDGAP_CTRL_1 */
105 #define DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK (0x7 << 27)
106 #define DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK BIT(23)
107 #define DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK BIT(22)
108 #define DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK BIT(21)
109 #define DRA752_BANDGAP_CTRL_1_MASK_HOT_CORE_MASK BIT(5)
110 #define DRA752_BANDGAP_CTRL_1_MASK_COLD_CORE_MASK BIT(4)
111 #define DRA752_BANDGAP_CTRL_1_MASK_HOT_GPU_MASK BIT(3)
112 #define DRA752_BANDGAP_CTRL_1_MASK_COLD_GPU_MASK BIT(2)
113 #define DRA752_BANDGAP_CTRL_1_MASK_HOT_MPU_MASK BIT(1)
114 #define DRA752_BANDGAP_CTRL_1_MASK_COLD_MPU_MASK BIT(0)
116 /* DRA752.TEMP_SENSOR */
117 #define DRA752_TEMP_SENSOR_TMPSOFF_MASK BIT(11)
118 #define DRA752_TEMP_SENSOR_EOCZ_MASK BIT(10)
119 #define DRA752_TEMP_SENSOR_DTEMP_MASK (0x3ff << 0)
121 /* DRA752.BANDGAP_THRESHOLD */
122 #define DRA752_BANDGAP_THRESHOLD_HOT_MASK (0x3ff << 16)
123 #define DRA752_BANDGAP_THRESHOLD_COLD_MASK (0x3ff << 0)
126 * Temperature limits and thresholds for DRA752
128 * All the macros bellow are definitions for handling the
129 * ADC conversions and representation of temperature limits
130 * and thresholds for DRA752. Definitions are grouped
131 * by temperature domain.
134 /* DRA752.common temperature definitions */
135 /* ADC conversion table limits */
136 #define DRA752_ADC_START_VALUE 540
137 #define DRA752_ADC_END_VALUE 945
139 /* DRA752.GPU temperature definitions */
140 /* bandgap clock limits */
141 #define DRA752_GPU_MAX_FREQ 1500000
142 #define DRA752_GPU_MIN_FREQ 1000000
143 /* interrupts thresholds */
144 #define DRA752_GPU_T_HOT 800
145 #define DRA752_GPU_T_COLD 795
147 /* DRA752.MPU temperature definitions */
148 /* bandgap clock limits */
149 #define DRA752_MPU_MAX_FREQ 1500000
150 #define DRA752_MPU_MIN_FREQ 1000000
151 /* interrupts thresholds */
152 #define DRA752_MPU_T_HOT 800
153 #define DRA752_MPU_T_COLD 795
155 /* DRA752.CORE temperature definitions */
156 /* bandgap clock limits */
157 #define DRA752_CORE_MAX_FREQ 1500000
158 #define DRA752_CORE_MIN_FREQ 1000000
159 /* interrupts thresholds */
160 #define DRA752_CORE_T_HOT 800
161 #define DRA752_CORE_T_COLD 795
163 /* DRA752.DSPEVE temperature definitions */
164 /* bandgap clock limits */
165 #define DRA752_DSPEVE_MAX_FREQ 1500000
166 #define DRA752_DSPEVE_MIN_FREQ 1000000
167 /* interrupts thresholds */
168 #define DRA752_DSPEVE_T_HOT 800
169 #define DRA752_DSPEVE_T_COLD 795
171 /* DRA752.IVA temperature definitions */
172 /* bandgap clock limits */
173 #define DRA752_IVA_MAX_FREQ 1500000
174 #define DRA752_IVA_MIN_FREQ 1000000
175 /* interrupts thresholds */
176 #define DRA752_IVA_T_HOT 800
177 #define DRA752_IVA_T_COLD 795
179 #endif /* __DRA752_BANDGAP_H */