Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2020 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 ALDEBARAN_PP_SMC_H
0025 #define ALDEBARAN_PP_SMC_H
0026 
0027 #pragma pack(push, 1)
0028 
0029 // SMU Response Codes:
0030 #define PPSMC_Result_OK                    0x1
0031 #define PPSMC_Result_Failed                0xFF
0032 #define PPSMC_Result_UnknownCmd            0xFE
0033 #define PPSMC_Result_CmdRejectedPrereq     0xFD
0034 #define PPSMC_Result_CmdRejectedBusy       0xFC
0035 
0036 // Message Definitions:
0037 #define PPSMC_MSG_TestMessage                    0x1
0038 #define PPSMC_MSG_GetSmuVersion                  0x2
0039 #define PPSMC_MSG_GfxDriverReset                 0x3
0040 #define PPSMC_MSG_GetDriverIfVersion             0x4
0041 #define PPSMC_MSG_spare1                         0x5
0042 #define PPSMC_MSG_spare2                         0x6
0043 #define PPSMC_MSG_EnableAllSmuFeatures           0x7
0044 #define PPSMC_MSG_DisableAllSmuFeatures          0x8
0045 #define PPSMC_MSG_spare3                         0x9
0046 #define PPSMC_MSG_spare4                         0xA
0047 #define PPSMC_MSG_spare5                         0xB
0048 #define PPSMC_MSG_spare6                         0xC
0049 #define PPSMC_MSG_GetEnabledSmuFeaturesLow       0xD
0050 #define PPSMC_MSG_GetEnabledSmuFeaturesHigh      0xE
0051 #define PPSMC_MSG_SetDriverDramAddrHigh          0xF
0052 #define PPSMC_MSG_SetDriverDramAddrLow           0x10
0053 #define PPSMC_MSG_SetToolsDramAddrHigh           0x11
0054 #define PPSMC_MSG_SetToolsDramAddrLow            0x12
0055 #define PPSMC_MSG_TransferTableSmu2Dram          0x13
0056 #define PPSMC_MSG_TransferTableDram2Smu          0x14
0057 #define PPSMC_MSG_UseDefaultPPTable              0x15
0058 #define PPSMC_MSG_SetSystemVirtualDramAddrHigh   0x16
0059 #define PPSMC_MSG_SetSystemVirtualDramAddrLow    0x17
0060 #define PPSMC_MSG_SetSoftMinByFreq               0x18
0061 #define PPSMC_MSG_SetSoftMaxByFreq               0x19
0062 #define PPSMC_MSG_SetHardMinByFreq               0x1A
0063 #define PPSMC_MSG_SetHardMaxByFreq               0x1B
0064 #define PPSMC_MSG_GetMinDpmFreq                  0x1C
0065 #define PPSMC_MSG_GetMaxDpmFreq                  0x1D
0066 #define PPSMC_MSG_GetDpmFreqByIndex              0x1E
0067 #define PPSMC_MSG_SetWorkloadMask                0x1F
0068 #define PPSMC_MSG_GetVoltageByDpm                0x20
0069 #define PPSMC_MSG_GetVoltageByDpmOverdrive       0x21
0070 #define PPSMC_MSG_SetPptLimit                    0x22
0071 #define PPSMC_MSG_GetPptLimit                    0x23
0072 #define PPSMC_MSG_PrepareMp1ForUnload            0x24
0073 #define PPSMC_MSG_PrepareMp1ForReset             0x25 //retired in 68.07
0074 #define PPSMC_MSG_SoftReset                      0x26 //retired in 68.07
0075 #define PPSMC_MSG_RunDcBtc                       0x27
0076 #define PPSMC_MSG_DramLogSetDramAddrHigh         0x28
0077 #define PPSMC_MSG_DramLogSetDramAddrLow          0x29
0078 #define PPSMC_MSG_DramLogSetDramSize             0x2A
0079 #define PPSMC_MSG_GetDebugData                   0x2B
0080 #define PPSMC_MSG_WaflTest                       0x2C
0081 #define PPSMC_MSG_spare7                         0x2D
0082 #define PPSMC_MSG_SetMemoryChannelEnable         0x2E
0083 #define PPSMC_MSG_SetNumBadHbmPagesRetired       0x2F
0084 #define PPSMC_MSG_DFCstateControl                0x32
0085 #define PPSMC_MSG_GetGmiPwrDnHyst                0x33
0086 #define PPSMC_MSG_SetGmiPwrDnHyst                0x34
0087 #define PPSMC_MSG_GmiPwrDnControl                0x35
0088 #define PPSMC_MSG_EnterGfxoff                    0x36
0089 #define PPSMC_MSG_ExitGfxoff                     0x37
0090 #define PPSMC_MSG_SetExecuteDMATest              0x38
0091 #define PPSMC_MSG_EnableDeterminism              0x39
0092 #define PPSMC_MSG_DisableDeterminism             0x3A
0093 #define PPSMC_MSG_SetUclkDpmMode                 0x3B
0094 
0095 //STB to dram log
0096 #define PPSMC_MSG_DumpSTBtoDram                     0x3C
0097 #define PPSMC_MSG_STBtoDramLogSetDramAddrHigh       0x3D
0098 #define PPSMC_MSG_STBtoDramLogSetDramAddrLow        0x3E
0099 #define PPSMC_MSG_STBtoDramLogSetDramSize           0x3F
0100 #define PPSMC_MSG_SetSystemVirtualSTBtoDramAddrHigh 0x40
0101 #define PPSMC_MSG_SetSystemVirtualSTBtoDramAddrLow  0x41
0102 
0103 #define PPSMC_MSG_GfxDriverResetRecovery    0x42
0104 #define PPSMC_MSG_BoardPowerCalibration     0x43
0105 #define PPSMC_MSG_HeavySBR                      0x45
0106 #define PPSMC_MSG_SetBadHBMPagesRetiredFlagsPerChannel  0x46
0107 #define PPSMC_Message_Count         0x47
0108 
0109 
0110 //PPSMC Reset Types
0111 #define PPSMC_RESET_TYPE_WARM_RESET              0x00
0112 #define PPSMC_RESET_TYPE_DRIVER_MODE_1_RESET     0x01 //driver msg argument should be 1 for mode-1
0113 #define PPSMC_RESET_TYPE_DRIVER_MODE_2_RESET     0x02 //and 2 for mode-2
0114 #define PPSMC_RESET_TYPE_PCIE_LINK_RESET         0x03
0115 #define PPSMC_RESET_TYPE_BIF_LINK_RESET          0x04
0116 #define PPSMC_RESET_TYPE_PF0_FLR_RESET           0x05
0117 
0118 
0119 typedef enum {
0120   GFXOFF_ERROR_NO_ERROR,
0121   GFXOFF_ERROR_DISALLOWED,
0122   GFXOFF_ERROR_GFX_BUSY,
0123   GFXOFF_ERROR_GFX_OFF,
0124   GFXOFF_ERROR_GFX_ON,
0125 } GFXOFF_ERROR_e;
0126 
0127 typedef uint32_t PPSMC_Result;
0128 typedef uint32_t PPSMC_Msg;
0129 #pragma pack(pop)
0130 
0131 #endif