1 /* 2 * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef __MCE_PRIVATE_H__ 8 #define __MCE_PRIVATE_H__ 9 10 #include <tegra_def.h> 11 12 /******************************************************************************* 13 * Macros to prepare CSTATE info request 14 ******************************************************************************/ 15 /* Description of the parameters for UPDATE_CSTATE_INFO request */ 16 #define CLUSTER_CSTATE_MASK 0x7U 17 #define CLUSTER_CSTATE_SHIFT 0X0U 18 #define CLUSTER_CSTATE_UPDATE_BIT (1U << 7) 19 #define CCPLEX_CSTATE_MASK 0x3U 20 #define CCPLEX_CSTATE_SHIFT 8U 21 #define CCPLEX_CSTATE_UPDATE_BIT (1U << 15) 22 #define SYSTEM_CSTATE_MASK 0xFU 23 #define SYSTEM_CSTATE_SHIFT 16U 24 #define SYSTEM_CSTATE_UPDATE_BIT (1U << 23) 25 #define CSTATE_WAKE_MASK_UPDATE_BIT (1U << 31) 26 #define CSTATE_WAKE_MASK_SHIFT 32U 27 #define CSTATE_WAKE_MASK_CLEAR 0xFFFFFFFFU 28 29 /******************************************************************************* 30 * Core ID mask (bits 3:0 in the online request) 31 ******************************************************************************/ 32 #define MCE_CORE_ID_MASK 0xFU 33 34 /******************************************************************************* 35 * C-state statistics macros 36 ******************************************************************************/ 37 #define MCE_STAT_ID_SHIFT 16U 38 39 /* declarations for NVG handler functions */ 40 uint64_t nvg_get_version(void); 41 int32_t nvg_enable_power_perf_mode(void); 42 int32_t nvg_disable_power_perf_mode(void); 43 int32_t nvg_enable_power_saver_modes(void); 44 int32_t nvg_disable_power_saver_modes(void); 45 void nvg_set_wake_time(uint32_t wake_time); 46 void nvg_update_cstate_info(uint32_t cluster, uint32_t ccplex, 47 uint32_t system, uint32_t wake_mask, uint8_t update_wake_mask); 48 int32_t nvg_set_cstate_stat_query_value(uint64_t data); 49 uint64_t nvg_get_cstate_stat_query_value(void); 50 int32_t nvg_is_sc7_allowed(void); 51 int32_t nvg_online_core(uint32_t core); 52 int32_t nvg_update_ccplex_gsc(uint32_t gsc_idx); 53 int32_t nvg_enter_cstate(uint32_t state, uint32_t wake_time); 54 55 void nvg_set_request_data(uint64_t req, uint64_t data); 56 void nvg_set_request(uint64_t req); 57 uint64_t nvg_get_result(void); 58 uint64_t nvg_cache_clean(void); 59 uint64_t nvg_cache_clean_inval(void); 60 uint64_t nvg_cache_inval_all(void); 61 62 #endif /* __MCE_PRIVATE_H__ */ 63