18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * DRA752 bandgap registers, bitfields and temperature definitions
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
68c2ecf20Sopenharmony_ci * Contact:
78c2ecf20Sopenharmony_ci *   Eduardo Valentin <eduardo.valentin@ti.com>
88c2ecf20Sopenharmony_ci *   Tero Kristo <t-kristo@ti.com>
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * This is an auto generated file.
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci#ifndef __DRA752_BANDGAP_H
138c2ecf20Sopenharmony_ci#define __DRA752_BANDGAP_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/**
168c2ecf20Sopenharmony_ci * *** DRA752 ***
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci * Below, in sequence, are the Register definitions,
198c2ecf20Sopenharmony_ci * the bitfields and the temperature definitions for DRA752.
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci/**
238c2ecf20Sopenharmony_ci * DRA752 register definitions
248c2ecf20Sopenharmony_ci *
258c2ecf20Sopenharmony_ci * Registers are defined as offsets. The offsets are
268c2ecf20Sopenharmony_ci * relative to FUSE_OPP_BGAP_GPU on DRA752.
278c2ecf20Sopenharmony_ci * DRA752_BANDGAP_BASE		0x4a0021e0
288c2ecf20Sopenharmony_ci *
298c2ecf20Sopenharmony_ci * Register below are grouped by domain (not necessarily in offset order)
308c2ecf20Sopenharmony_ci */
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci/* DRA752.common register offsets */
348c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_OFFSET		0x1a0
358c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_1_OFFSET		0x1c8
368c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_2_OFFSET		0x39c
378c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_2_OFFSET		0x3b8
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci/* DRA752.core register offsets */
408c2ecf20Sopenharmony_ci#define DRA752_STD_FUSE_OPP_BGAP_CORE_OFFSET		0x8
418c2ecf20Sopenharmony_ci#define DRA752_TEMP_SENSOR_CORE_OFFSET			0x154
428c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_THRESHOLD_CORE_OFFSET		0x1ac
438c2ecf20Sopenharmony_ci#define DRA752_DTEMP_CORE_1_OFFSET			0x20c
448c2ecf20Sopenharmony_ci#define DRA752_DTEMP_CORE_2_OFFSET			0x210
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/* DRA752.iva register offsets */
478c2ecf20Sopenharmony_ci#define DRA752_STD_FUSE_OPP_BGAP_IVA_OFFSET		0x388
488c2ecf20Sopenharmony_ci#define DRA752_TEMP_SENSOR_IVA_OFFSET			0x398
498c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_THRESHOLD_IVA_OFFSET		0x3a4
508c2ecf20Sopenharmony_ci#define DRA752_DTEMP_IVA_1_OFFSET			0x3d4
518c2ecf20Sopenharmony_ci#define DRA752_DTEMP_IVA_2_OFFSET			0x3d8
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci/* DRA752.mpu register offsets */
548c2ecf20Sopenharmony_ci#define DRA752_STD_FUSE_OPP_BGAP_MPU_OFFSET		0x4
558c2ecf20Sopenharmony_ci#define DRA752_TEMP_SENSOR_MPU_OFFSET			0x14c
568c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_THRESHOLD_MPU_OFFSET		0x1a4
578c2ecf20Sopenharmony_ci#define DRA752_DTEMP_MPU_1_OFFSET			0x1e4
588c2ecf20Sopenharmony_ci#define DRA752_DTEMP_MPU_2_OFFSET			0x1e8
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/* DRA752.dspeve register offsets */
618c2ecf20Sopenharmony_ci#define DRA752_STD_FUSE_OPP_BGAP_DSPEVE_OFFSET			0x384
628c2ecf20Sopenharmony_ci#define DRA752_TEMP_SENSOR_DSPEVE_OFFSET			0x394
638c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_THRESHOLD_DSPEVE_OFFSET			0x3a0
648c2ecf20Sopenharmony_ci#define DRA752_DTEMP_DSPEVE_1_OFFSET				0x3c0
658c2ecf20Sopenharmony_ci#define DRA752_DTEMP_DSPEVE_2_OFFSET				0x3c4
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/* DRA752.gpu register offsets */
688c2ecf20Sopenharmony_ci#define DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET		0x0
698c2ecf20Sopenharmony_ci#define DRA752_TEMP_SENSOR_GPU_OFFSET			0x150
708c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_THRESHOLD_GPU_OFFSET		0x1a8
718c2ecf20Sopenharmony_ci#define DRA752_DTEMP_GPU_1_OFFSET			0x1f8
728c2ecf20Sopenharmony_ci#define DRA752_DTEMP_GPU_2_OFFSET			0x1fc
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci/**
758c2ecf20Sopenharmony_ci * Register bitfields for DRA752
768c2ecf20Sopenharmony_ci *
778c2ecf20Sopenharmony_ci * All the macros bellow define the required bits for
788c2ecf20Sopenharmony_ci * controlling temperature on DRA752. Bit defines are
798c2ecf20Sopenharmony_ci * grouped by register.
808c2ecf20Sopenharmony_ci */
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci/* DRA752.BANDGAP_STATUS_1 */
838c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK		BIT(5)
848c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK		BIT(4)
858c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK		BIT(3)
868c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK		BIT(2)
878c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK		BIT(1)
888c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK		BIT(0)
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci/* DRA752.BANDGAP_CTRL_2 */
918c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK			BIT(22)
928c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK		BIT(21)
938c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_2_MASK_HOT_IVA_MASK			BIT(3)
948c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_2_MASK_COLD_IVA_MASK		BIT(2)
958c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_2_MASK_HOT_DSPEVE_MASK		BIT(1)
968c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_2_MASK_COLD_DSPEVE_MASK		BIT(0)
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/* DRA752.BANDGAP_STATUS_2 */
998c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_2_HOT_IVA_MASK			BIT(3)
1008c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_2_COLD_IVA_MASK			BIT(2)
1018c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK			BIT(1)
1028c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK		BIT(0)
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/* DRA752.BANDGAP_CTRL_1 */
1058c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK		(0x7 << 27)
1068c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK			BIT(23)
1078c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK			BIT(22)
1088c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK			BIT(21)
1098c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_MASK_HOT_CORE_MASK		BIT(5)
1108c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_MASK_COLD_CORE_MASK		BIT(4)
1118c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_MASK_HOT_GPU_MASK			BIT(3)
1128c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_MASK_COLD_GPU_MASK		BIT(2)
1138c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_MASK_HOT_MPU_MASK			BIT(1)
1148c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_CTRL_1_MASK_COLD_MPU_MASK		BIT(0)
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci/* DRA752.TEMP_SENSOR */
1178c2ecf20Sopenharmony_ci#define DRA752_TEMP_SENSOR_TMPSOFF_MASK		BIT(11)
1188c2ecf20Sopenharmony_ci#define DRA752_TEMP_SENSOR_EOCZ_MASK		BIT(10)
1198c2ecf20Sopenharmony_ci#define DRA752_TEMP_SENSOR_DTEMP_MASK		(0x3ff << 0)
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci/* DRA752.BANDGAP_THRESHOLD */
1228c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_THRESHOLD_HOT_MASK		(0x3ff << 16)
1238c2ecf20Sopenharmony_ci#define DRA752_BANDGAP_THRESHOLD_COLD_MASK		(0x3ff << 0)
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci/**
1268c2ecf20Sopenharmony_ci * Temperature limits and thresholds for DRA752
1278c2ecf20Sopenharmony_ci *
1288c2ecf20Sopenharmony_ci * All the macros bellow are definitions for handling the
1298c2ecf20Sopenharmony_ci * ADC conversions and representation of temperature limits
1308c2ecf20Sopenharmony_ci * and thresholds for DRA752. Definitions are grouped
1318c2ecf20Sopenharmony_ci * by temperature domain.
1328c2ecf20Sopenharmony_ci */
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci/* DRA752.common temperature definitions */
1358c2ecf20Sopenharmony_ci/* ADC conversion table limits */
1368c2ecf20Sopenharmony_ci#define DRA752_ADC_START_VALUE		540
1378c2ecf20Sopenharmony_ci#define DRA752_ADC_END_VALUE		945
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci/* DRA752.GPU temperature definitions */
1408c2ecf20Sopenharmony_ci/* bandgap clock limits */
1418c2ecf20Sopenharmony_ci#define DRA752_GPU_MAX_FREQ				1500000
1428c2ecf20Sopenharmony_ci#define DRA752_GPU_MIN_FREQ				1000000
1438c2ecf20Sopenharmony_ci/* interrupts thresholds */
1448c2ecf20Sopenharmony_ci#define DRA752_GPU_T_HOT				800
1458c2ecf20Sopenharmony_ci#define DRA752_GPU_T_COLD				795
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci/* DRA752.MPU temperature definitions */
1488c2ecf20Sopenharmony_ci/* bandgap clock limits */
1498c2ecf20Sopenharmony_ci#define DRA752_MPU_MAX_FREQ				1500000
1508c2ecf20Sopenharmony_ci#define DRA752_MPU_MIN_FREQ				1000000
1518c2ecf20Sopenharmony_ci/* interrupts thresholds */
1528c2ecf20Sopenharmony_ci#define DRA752_MPU_T_HOT				800
1538c2ecf20Sopenharmony_ci#define DRA752_MPU_T_COLD				795
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci/* DRA752.CORE temperature definitions */
1568c2ecf20Sopenharmony_ci/* bandgap clock limits */
1578c2ecf20Sopenharmony_ci#define DRA752_CORE_MAX_FREQ				1500000
1588c2ecf20Sopenharmony_ci#define DRA752_CORE_MIN_FREQ				1000000
1598c2ecf20Sopenharmony_ci/* interrupts thresholds */
1608c2ecf20Sopenharmony_ci#define DRA752_CORE_T_HOT				800
1618c2ecf20Sopenharmony_ci#define DRA752_CORE_T_COLD				795
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_ci/* DRA752.DSPEVE temperature definitions */
1648c2ecf20Sopenharmony_ci/* bandgap clock limits */
1658c2ecf20Sopenharmony_ci#define DRA752_DSPEVE_MAX_FREQ				1500000
1668c2ecf20Sopenharmony_ci#define DRA752_DSPEVE_MIN_FREQ				1000000
1678c2ecf20Sopenharmony_ci/* interrupts thresholds */
1688c2ecf20Sopenharmony_ci#define DRA752_DSPEVE_T_HOT				800
1698c2ecf20Sopenharmony_ci#define DRA752_DSPEVE_T_COLD				795
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci/* DRA752.IVA temperature definitions */
1728c2ecf20Sopenharmony_ci/* bandgap clock limits */
1738c2ecf20Sopenharmony_ci#define DRA752_IVA_MAX_FREQ				1500000
1748c2ecf20Sopenharmony_ci#define DRA752_IVA_MIN_FREQ				1000000
1758c2ecf20Sopenharmony_ci/* interrupts thresholds */
1768c2ecf20Sopenharmony_ci#define DRA752_IVA_T_HOT				800
1778c2ecf20Sopenharmony_ci#define DRA752_IVA_T_COLD				795
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ci#endif /* __DRA752_BANDGAP_H */
180