Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2014 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  */
0023 
0024 #ifndef CZ_PP_SMC_H
0025 #define CZ_PP_SMC_H
0026 
0027 #pragma pack(push, 1)
0028 
0029 /* Fan control algorithm:*/
0030 #define FDO_MODE_HARDWARE 0
0031 #define FDO_MODE_PIECE_WISE_LINEAR 1
0032 
0033 enum FAN_CONTROL {
0034     FAN_CONTROL_FUZZY,
0035     FAN_CONTROL_TABLE
0036 };
0037 
0038 enum DPM_ARRAY {
0039     DPM_ARRAY_HARD_MAX,
0040     DPM_ARRAY_HARD_MIN,
0041     DPM_ARRAY_SOFT_MAX,
0042     DPM_ARRAY_SOFT_MIN
0043 };
0044 
0045 /*
0046  * Return codes for driver to SMC communication.
0047  * Leave these #define-s, enums might not be exactly 8-bits on the microcontroller.
0048  */
0049 #define PPSMC_Result_OK             ((uint16_t)0x01)
0050 #define PPSMC_Result_NoMore         ((uint16_t)0x02)
0051 #define PPSMC_Result_NotNow         ((uint16_t)0x03)
0052 #define PPSMC_Result_Failed         ((uint16_t)0xFF)
0053 #define PPSMC_Result_UnknownCmd     ((uint16_t)0xFE)
0054 #define PPSMC_Result_UnknownVT      ((uint16_t)0xFD)
0055 
0056 #define PPSMC_isERROR(x)            ((uint16_t)0x80 & (x))
0057 
0058 /*
0059  * Supported driver messages
0060  */
0061 #define PPSMC_MSG_Test                        ((uint16_t) 0x1)
0062 #define PPSMC_MSG_GetFeatureStatus            ((uint16_t) 0x2)
0063 #define PPSMC_MSG_EnableAllSmuFeatures        ((uint16_t) 0x3)
0064 #define PPSMC_MSG_DisableAllSmuFeatures       ((uint16_t) 0x4)
0065 #define PPSMC_MSG_OptimizeBattery             ((uint16_t) 0x5)
0066 #define PPSMC_MSG_MaximizePerf                ((uint16_t) 0x6)
0067 #define PPSMC_MSG_UVDPowerOFF                 ((uint16_t) 0x7)
0068 #define PPSMC_MSG_UVDPowerON                  ((uint16_t) 0x8)
0069 #define PPSMC_MSG_VCEPowerOFF                 ((uint16_t) 0x9)
0070 #define PPSMC_MSG_VCEPowerON                  ((uint16_t) 0xA)
0071 #define PPSMC_MSG_ACPPowerOFF                 ((uint16_t) 0xB)
0072 #define PPSMC_MSG_ACPPowerON                  ((uint16_t) 0xC)
0073 #define PPSMC_MSG_SDMAPowerOFF                ((uint16_t) 0xD)
0074 #define PPSMC_MSG_SDMAPowerON                 ((uint16_t) 0xE)
0075 #define PPSMC_MSG_XDMAPowerOFF                ((uint16_t) 0xF)
0076 #define PPSMC_MSG_XDMAPowerON                 ((uint16_t) 0x10)
0077 #define PPSMC_MSG_SetMinDeepSleepSclk         ((uint16_t) 0x11)
0078 #define PPSMC_MSG_SetSclkSoftMin              ((uint16_t) 0x12)
0079 #define PPSMC_MSG_SetSclkSoftMax              ((uint16_t) 0x13)
0080 #define PPSMC_MSG_SetSclkHardMin              ((uint16_t) 0x14)
0081 #define PPSMC_MSG_SetSclkHardMax              ((uint16_t) 0x15)
0082 #define PPSMC_MSG_SetLclkSoftMin              ((uint16_t) 0x16)
0083 #define PPSMC_MSG_SetLclkSoftMax              ((uint16_t) 0x17)
0084 #define PPSMC_MSG_SetLclkHardMin              ((uint16_t) 0x18)
0085 #define PPSMC_MSG_SetLclkHardMax              ((uint16_t) 0x19)
0086 #define PPSMC_MSG_SetUvdSoftMin               ((uint16_t) 0x1A)
0087 #define PPSMC_MSG_SetUvdSoftMax               ((uint16_t) 0x1B)
0088 #define PPSMC_MSG_SetUvdHardMin               ((uint16_t) 0x1C)
0089 #define PPSMC_MSG_SetUvdHardMax               ((uint16_t) 0x1D)
0090 #define PPSMC_MSG_SetEclkSoftMin              ((uint16_t) 0x1E)
0091 #define PPSMC_MSG_SetEclkSoftMax              ((uint16_t) 0x1F)
0092 #define PPSMC_MSG_SetEclkHardMin              ((uint16_t) 0x20)
0093 #define PPSMC_MSG_SetEclkHardMax              ((uint16_t) 0x21)
0094 #define PPSMC_MSG_SetAclkSoftMin              ((uint16_t) 0x22)
0095 #define PPSMC_MSG_SetAclkSoftMax              ((uint16_t) 0x23)
0096 #define PPSMC_MSG_SetAclkHardMin              ((uint16_t) 0x24)
0097 #define PPSMC_MSG_SetAclkHardMax              ((uint16_t) 0x25)
0098 #define PPSMC_MSG_SetNclkSoftMin              ((uint16_t) 0x26)
0099 #define PPSMC_MSG_SetNclkSoftMax              ((uint16_t) 0x27)
0100 #define PPSMC_MSG_SetNclkHardMin              ((uint16_t) 0x28)
0101 #define PPSMC_MSG_SetNclkHardMax              ((uint16_t) 0x29)
0102 #define PPSMC_MSG_SetPstateSoftMin            ((uint16_t) 0x2A)
0103 #define PPSMC_MSG_SetPstateSoftMax            ((uint16_t) 0x2B)
0104 #define PPSMC_MSG_SetPstateHardMin            ((uint16_t) 0x2C)
0105 #define PPSMC_MSG_SetPstateHardMax            ((uint16_t) 0x2D)
0106 #define PPSMC_MSG_DisableLowMemoryPstate      ((uint16_t) 0x2E)
0107 #define PPSMC_MSG_EnableLowMemoryPstate       ((uint16_t) 0x2F)
0108 #define PPSMC_MSG_UcodeAddressLow             ((uint16_t) 0x30)
0109 #define PPSMC_MSG_UcodeAddressHigh            ((uint16_t) 0x31)
0110 #define PPSMC_MSG_UcodeLoadStatus             ((uint16_t) 0x32)
0111 #define PPSMC_MSG_DriverDramAddrHi            ((uint16_t) 0x33)
0112 #define PPSMC_MSG_DriverDramAddrLo            ((uint16_t) 0x34)
0113 #define PPSMC_MSG_CondExecDramAddrHi          ((uint16_t) 0x35)
0114 #define PPSMC_MSG_CondExecDramAddrLo          ((uint16_t) 0x36)
0115 #define PPSMC_MSG_LoadUcodes                  ((uint16_t) 0x37)
0116 #define PPSMC_MSG_DriverResetMode             ((uint16_t) 0x38)
0117 #define PPSMC_MSG_PowerStateNotify            ((uint16_t) 0x39)
0118 #define PPSMC_MSG_SetDisplayPhyConfig         ((uint16_t) 0x3A)
0119 #define PPSMC_MSG_GetMaxSclkLevel             ((uint16_t) 0x3B)
0120 #define PPSMC_MSG_GetMaxLclkLevel             ((uint16_t) 0x3C)
0121 #define PPSMC_MSG_GetMaxUvdLevel              ((uint16_t) 0x3D)
0122 #define PPSMC_MSG_GetMaxEclkLevel             ((uint16_t) 0x3E)
0123 #define PPSMC_MSG_GetMaxAclkLevel             ((uint16_t) 0x3F)
0124 #define PPSMC_MSG_GetMaxNclkLevel             ((uint16_t) 0x40)
0125 #define PPSMC_MSG_GetMaxPstate                ((uint16_t) 0x41)
0126 #define PPSMC_MSG_DramAddrHiVirtual           ((uint16_t) 0x42)
0127 #define PPSMC_MSG_DramAddrLoVirtual           ((uint16_t) 0x43)
0128 #define PPSMC_MSG_DramAddrHiPhysical          ((uint16_t) 0x44)
0129 #define PPSMC_MSG_DramAddrLoPhysical          ((uint16_t) 0x45)
0130 #define PPSMC_MSG_DramBufferSize              ((uint16_t) 0x46)
0131 #define PPSMC_MSG_SetMmPwrLogDramAddrHi       ((uint16_t) 0x47)
0132 #define PPSMC_MSG_SetMmPwrLogDramAddrLo       ((uint16_t) 0x48)
0133 #define PPSMC_MSG_SetClkTableAddrHi           ((uint16_t) 0x49)
0134 #define PPSMC_MSG_SetClkTableAddrLo           ((uint16_t) 0x4A)
0135 #define PPSMC_MSG_GetConservativePowerLimit   ((uint16_t) 0x4B)
0136 
0137 #define PPSMC_MSG_InitJobs                    ((uint16_t) 0x252)
0138 #define PPSMC_MSG_ExecuteJob                  ((uint16_t) 0x254)
0139 
0140 #define PPSMC_MSG_NBDPM_Enable                ((uint16_t) 0x140)
0141 #define PPSMC_MSG_NBDPM_Disable               ((uint16_t) 0x141)
0142 
0143 #define PPSMC_MSG_DPM_FPS_Mode                ((uint16_t) 0x15d)
0144 #define PPSMC_MSG_DPM_Activity_Mode           ((uint16_t) 0x15e)
0145 
0146 #define PPSMC_MSG_PmStatusLogStart            ((uint16_t) 0x170)
0147 #define PPSMC_MSG_PmStatusLogSample           ((uint16_t) 0x171)
0148 
0149 #define PPSMC_MSG_AllowLowSclkInterrupt       ((uint16_t) 0x184)
0150 #define PPSMC_MSG_MmPowerMonitorStart         ((uint16_t) 0x18F)
0151 #define PPSMC_MSG_MmPowerMonitorStop          ((uint16_t) 0x190)
0152 #define PPSMC_MSG_MmPowerMonitorRestart       ((uint16_t) 0x191)
0153 
0154 #define PPSMC_MSG_SetClockGateMask            ((uint16_t) 0x260)
0155 #define PPSMC_MSG_SetFpsThresholdLo           ((uint16_t) 0x264)
0156 #define PPSMC_MSG_SetFpsThresholdHi           ((uint16_t) 0x265)
0157 #define PPSMC_MSG_SetLowSclkIntrThreshold     ((uint16_t) 0x266)
0158 
0159 #define PPSMC_MSG_ClkTableXferToDram          ((uint16_t) 0x267)
0160 #define PPSMC_MSG_ClkTableXferToSmu           ((uint16_t) 0x268)
0161 #define PPSMC_MSG_GetAverageGraphicsActivity  ((uint16_t) 0x269)
0162 #define PPSMC_MSG_GetAverageGioActivity       ((uint16_t) 0x26A)
0163 #define PPSMC_MSG_SetLoggerBufferSize         ((uint16_t) 0x26B)
0164 #define PPSMC_MSG_SetLoggerAddressHigh        ((uint16_t) 0x26C)
0165 #define PPSMC_MSG_SetLoggerAddressLow         ((uint16_t) 0x26D)
0166 #define PPSMC_MSG_SetWatermarkFrequency       ((uint16_t) 0x26E)
0167 #define PPSMC_MSG_SetDisplaySizePowerParams   ((uint16_t) 0x26F)
0168 
0169 /* REMOVE LATER*/
0170 #define PPSMC_MSG_DPM_ForceState              ((uint16_t) 0x104)
0171 
0172 /* Feature Enable Masks*/
0173 #define NB_DPM_MASK             0x00000800
0174 #define VDDGFX_MASK             0x00800000
0175 #define VCE_DPM_MASK            0x00400000
0176 #define ACP_DPM_MASK            0x00040000
0177 #define UVD_DPM_MASK            0x00010000
0178 #define GFX_CU_PG_MASK          0x00004000
0179 #define SCLK_DPM_MASK           0x00080000
0180 
0181 #if !defined(SMC_MICROCODE)
0182 #pragma pack(pop)
0183 
0184 #endif
0185 
0186 #endif