xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_pm_mcu_states.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  *
4  * (C) COPYRIGHT 2020-2022 ARM Limited. All rights reserved.
5  *
6  * This program is free software and is provided to you under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation, and any use by you of this program is subject to the terms
9  * of such GNU license.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you can access it online at
18  * http://www.gnu.org/licenses/gpl-2.0.html.
19  *
20  */
21 
22 /*
23  * Backend-specific Power Manager MCU state definitions.
24  * The function-like macro KBASEP_MCU_STATE() must be defined before including
25  * this header file. This header file can be included multiple times in the
26  * same compilation unit with different definitions of KBASEP_MCU_STATE().
27  *
28  * @OFF:                                The MCU is powered off.
29  * @PEND_ON_RELOAD:                     The warm boot of MCU or cold boot of MCU (with
30  *                                      firmware reloading) is in progress.
31  * @ON_GLB_REINIT_PEND:                 The MCU is enabled and Global configuration
32  *                                      requests have been sent to the firmware.
33  * @ON_HWCNT_ENABLE:                    The Global requests have completed and MCU is now
34  *                                      ready for use and hwcnt is being enabled.
35  * @ON:                                 The MCU is active and hwcnt has been enabled.
36  * @ON_CORE_ATTR_UPDATE_PEND:           The MCU is active and mask of enabled shader cores
37  *                                      is being updated.
38  * @ON_HWCNT_DISABLE:                   The MCU is on and hwcnt is being disabled.
39  * @ON_HALT:                            The MCU is on and hwcnt has been disabled, MCU
40  *                                      halt would be triggered.
41  * @ON_PEND_HALT:                       MCU halt in progress, confirmation pending.
42  * @POWER_DOWN:                         MCU halted operations, pending being disabled.
43  * @PEND_OFF:                           MCU is being disabled, pending on powering off.
44  * @RESET_WAIT:                         The GPU is resetting, MCU state is unknown.
45  * @HCTL_SHADERS_PEND_ON:               Global configuration requests sent to the firmware
46  *                                      have completed and shaders have been requested to
47  *                                      power on.
48  * @HCTL_CORES_NOTIFY_PEND:             Shader cores have powered up and firmware is being
49  *                                      notified of the mask of enabled shader cores.
50  * @HCTL_MCU_ON_RECHECK:                MCU is on and hwcnt disabling is triggered
51  *                                      and checks are done to update the number of
52  *                                      enabled cores.
53  * @HCTL_SHADERS_READY_OFF:             MCU has halted and cores need to be powered down
54  * @HCTL_SHADERS_PEND_OFF:              Cores are transitioning to power down.
55  * @HCTL_CORES_DOWN_SCALE_NOTIFY_PEND:  Firmware has been informed to stop using
56  *                                      specific cores, due to core_mask change request.
57  *                                      After the ACK from FW, the wait will be done for
58  *                                      undesired cores to become inactive.
59  * @HCTL_CORE_INACTIVE_PEND:            Waiting for specific cores to become inactive.
60  *                                      Once the cores become inactive their power down
61  *                                      will be initiated.
62  * @HCTL_SHADERS_CORE_OFF_PEND:         Waiting for specific cores to complete the
63  *                                      transition to power down. Once powered down,
64  *                                      HW counters will be re-enabled.
65  * @ON_SLEEP_INITIATE:                  MCU is on and hwcnt has been disabled and MCU
66  *                                      is being put to sleep.
67  * @ON_PEND_SLEEP:                      MCU sleep is in progress.
68  * @IN_SLEEP:                           Sleep request is completed and MCU has halted.
69  * @ON_PMODE_ENTER_CORESIGHT_DISABLE:   The MCU is on, protected mode enter is about to
70  *                                      be requested, Coresight is being disabled.
71  * @ON_PMODE_EXIT_CORESIGHT_ENABLE :    The MCU is on, protected mode exit has happened
72  *                                      Coresight is being enabled.
73  * @CORESIGHT_DISABLE:                  The MCU is on and Coresight is being disabled.
74  * @CORESIGHT_ENABLE:                   The MCU is on, host does not have control and
75  *                                      Coresight is being enabled.
76  */
77 KBASEP_MCU_STATE(OFF)
78 KBASEP_MCU_STATE(PEND_ON_RELOAD)
79 KBASEP_MCU_STATE(ON_GLB_REINIT_PEND)
80 KBASEP_MCU_STATE(ON_HWCNT_ENABLE)
81 KBASEP_MCU_STATE(ON)
82 KBASEP_MCU_STATE(ON_CORE_ATTR_UPDATE_PEND)
83 KBASEP_MCU_STATE(ON_HWCNT_DISABLE)
84 KBASEP_MCU_STATE(ON_HALT)
85 KBASEP_MCU_STATE(ON_PEND_HALT)
86 KBASEP_MCU_STATE(POWER_DOWN)
87 KBASEP_MCU_STATE(PEND_OFF)
88 KBASEP_MCU_STATE(RESET_WAIT)
89 /* Additional MCU states with HOST_CONTROL_SHADERS */
90 KBASEP_MCU_STATE(HCTL_SHADERS_PEND_ON)
91 KBASEP_MCU_STATE(HCTL_CORES_NOTIFY_PEND)
92 KBASEP_MCU_STATE(HCTL_MCU_ON_RECHECK)
93 KBASEP_MCU_STATE(HCTL_SHADERS_READY_OFF)
94 KBASEP_MCU_STATE(HCTL_SHADERS_PEND_OFF)
95 KBASEP_MCU_STATE(HCTL_CORES_DOWN_SCALE_NOTIFY_PEND)
96 KBASEP_MCU_STATE(HCTL_CORE_INACTIVE_PEND)
97 KBASEP_MCU_STATE(HCTL_SHADERS_CORE_OFF_PEND)
98 /* Additional MCU states to support GPU sleep feature */
99 KBASEP_MCU_STATE(ON_SLEEP_INITIATE)
100 KBASEP_MCU_STATE(ON_PEND_SLEEP)
101 KBASEP_MCU_STATE(IN_SLEEP)
102 #if IS_ENABLED(CONFIG_MALI_CORESIGHT)
103 /* Additional MCU states for Coresight */
104 KBASEP_MCU_STATE(ON_PMODE_ENTER_CORESIGHT_DISABLE)
105 KBASEP_MCU_STATE(ON_PMODE_EXIT_CORESIGHT_ENABLE)
106 KBASEP_MCU_STATE(CORESIGHT_DISABLE)
107 KBASEP_MCU_STATE(CORESIGHT_ENABLE)
108 #endif /* IS_ENABLED(CONFIG_MALI_CORESIGHT) */
109