drm/amdgpu: add SMUIO 15.0.0 headers
Subsystems (3)
Alex Deucher
maintainerPATCH 1/5 drm/amdgpu: add SMUIO 15.0.0 headers
Add headers for SMUIO 15.0.0.
v2: squash in updates (Alex)
--- .../asic_reg/smuio/smuio_15_0_0_offset.h | 100 +++++++++ .../asic_reg/smuio/smuio_15_0_0_sh_mask.h | 190 ++++++++++++++++++ 2 files changed, 290 insertions(+) create mode 100644 drivers/gpu/drm/amd/include/asic_reg/smuio/smuio_15_0_0_offset.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/smuio/smuio_15_0_0_sh_mask.h
drivers/gpu/drm/amd/include/asic_reg/smuio/smuio_15_0_0_offset.h new file +100 -0
@@ -0,0 +1,100 @@ +/* +* Copyright (C) 2025 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +#ifndef _smuio_15_0_0_OFFSET_HEADER +#define _smuio_15_0_0_OFFSET_HEADER + + + +// addressBlock: smuio_smuio_misc_SmuSmuioDec +// base address: 0x5a000 +#define regSMUIO_MCM_CONFIG 0x0023 +#define regSMUIO_MCM_CONFIG_BASE_IDX 0 +#define regIP_DISCOVERY_VERSION 0x0000 +#define regIP_DISCOVERY_VERSION_BASE_IDX 1 +#define regSCRATCH_REGISTER0 0x01c6 +#define regSCRATCH_REGISTER0_BASE_IDX 1 +#define regSCRATCH_REGISTER1 0x01c7 +#define regSCRATCH_REGISTER1_BASE_IDX 1 +#define regSCRATCH_REGISTER2 0x01c8 +#define regSCRATCH_REGISTER2_BASE_IDX 1 +#define regSCRATCH_REGISTER3 0x01c9 +#define regSCRATCH_REGISTER3_BASE_IDX 1 +#define regSCRATCH_REGISTER4 0x01ca +#define regSCRATCH_REGISTER4_BASE_IDX 1 +#define regSCRATCH_REGISTER5 0x01cb +#define regSCRATCH_REGISTER5_BASE_IDX 1 +#define regSCRATCH_REGISTER6 0x01cc +#define regSCRATCH_REGISTER6_BASE_IDX 1 +#define regSCRATCH_REGISTER7 0x01cd +#define regSCRATCH_REGISTER7_BASE_IDX 1 +#define regIO_SMUIO_PINSTRAP 0x01ce +#define regIO_SMUIO_PINSTRAP_BASE_IDX 1 + + +// addressBlock: smuio_smuio_reset_SmuSmuioDec +// base address: 0x5a300 +#define regSMUIO_GFX_MISC_CNTL 0x00c5 +#define regSMUIO_GFX_MISC_CNTL_BASE_IDX 0 + + +// addressBlock: smuio_smuio_tsc_SmuSmuioDec +// base address: 0x5a8a0 +#define regPWROK_REFCLK_GAP_CYCLES 0x0028 +#define regPWROK_REFCLK_GAP_CYCLES_BASE_IDX 1 +#define regGOLDEN_TSC_INCREMENT_UPPER 0x002b +#define regGOLDEN_TSC_INCREMENT_UPPER_BASE_IDX 1 +#define regGOLDEN_TSC_INCREMENT_LOWER 0x002c +#define regGOLDEN_TSC_INCREMENT_LOWER_BASE_IDX 1 +#define regGOLDEN_TSC_COUNT_UPPER 0x0030 +#define regGOLDEN_TSC_COUNT_UPPER_BASE_IDX 1 +#define regGOLDEN_TSC_COUNT_LOWER 0x0031 +#define regGOLDEN_TSC_COUNT_LOWER_BASE_IDX 1 +#define regSOC_GOLDEN_TSC_SHADOW_UPPER 0x0032 +#define regSOC_GOLDEN_TSC_SHADOW_UPPER_BASE_IDX 1 +#define regSOC_GOLDEN_TSC_SHADOW_LOWER 0x0033 +#define regSOC_GOLDEN_TSC_SHADOW_LOWER_BASE_IDX 1 +#define regSOC_GAP_PWROK 0x0034 +#define regSOC_GAP_PWROK_BASE_IDX 1 + + +// addressBlock: smuio_smuio_swtimer_SmuSmuioDec +// base address: 0x5aca8 +#define regPWR_VIRT_RESET_REQ 0x012a +#define regPWR_VIRT_RESET_REQ_BASE_IDX 1 +#define regPWR_DISP_TIMER_CONTROL 0x012b +#define regPWR_DISP_TIMER_CONTROL_BASE_IDX 1 +#define regPWR_DISP_TIMER_DEBUG 0x012c +#define regPWR_DISP_TIMER_DEBUG_BASE_IDX 1 +#define regPWR_DISP_TIMER_ELAPSED_CONTROL 0x012d +#define regPWR_DISP_TIMER_ELAPSED_CONTROL_BASE_IDX 1 +#define regPWR_DISP_TIMER2_CONTROL 0x012e +#define regPWR_DISP_TIMER2_CONTROL_BASE_IDX 1 +#define regPWR_DISP_TIMER2_DEBUG 0x012f +#define regPWR_DISP_TIMER2_DEBUG_BASE_IDX 1 +#define regPWR_DISP_TIMER2_ELAPSED_CONTROL 0x0130 +#define regPWR_DISP_TIMER2_ELAPSED_CONTROL_BASE_IDX 1 +#define regPWR_DISP_TIMER_GLOBAL_CONTROL 0x0131 +#define regPWR_DISP_TIMER_GLOBAL_CONTROL_BASE_IDX 1 +#define regPWR_IH_CONTROL 0x0132 +#define regPWR_IH_CONTROL_BASE_IDX 1 + + +#endif
drivers/gpu/drm/amd/include/asic_reg/smuio/smuio_15_0_0_sh_mask.h new file +190 -0
190 lines not on this page · raw message
Signature · 1 line
2.52.0
Alex Deucher
maintainerPATCH 2/5 drm/amdgpu: Add THM 15.0.0 headers
Add headers for THM 15.0.0.
v2: squash in updates (Alex)
--- .../include/asic_reg/thm/thm_15_0_0_offset.h | 157 +++++ .../include/asic_reg/thm/thm_15_0_0_sh_mask.h | 567 ++++++++++++++++++ 2 files changed, 724 insertions(+) create mode 100644 drivers/gpu/drm/amd/include/asic_reg/thm/thm_15_0_0_offset.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/thm/thm_15_0_0_sh_mask.h
drivers/gpu/drm/amd/include/asic_reg/thm/thm_15_0_0_offset.h new file +157 -0
@@ -0,0 +1,157 @@ +/* +* Copyright (C) 2025 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +#ifndef _thm_15_0_0_OFFSET_HEADER +#define _thm_15_0_0_OFFSET_HEADER + + + +// addressBlock: thm_thm_SmuThmDec +// base address: 0x59800 +#define regTHM_TCON_CUR_TMP 0x0000 +#define regTHM_TCON_CUR_TMP_BASE_IDX 0 +#define regTHM_TCON_HTC 0x0001 +#define regTHM_TCON_HTC_BASE_IDX 0 +#define regTHM_TCON_THERM_TRIP 0x0002 +#define regTHM_TCON_THERM_TRIP_BASE_IDX 0 +#define regTHM_CTF_DELAY 0x0004 +#define regTHM_CTF_DELAY_BASE_IDX 0 +#define regTHM_GPIO_PROCHOT_CTRL 0x0005 +#define regTHM_GPIO_PROCHOT_CTRL_BASE_IDX 0 +#define regTHM_SW_TEMP 0x0006 +#define regTHM_SW_TEMP_BASE_IDX 0 +#define regCG_MULT_THERMAL_CTRL 0x0007 +#define regCG_MULT_THERMAL_CTRL_BASE_IDX 0 +#define regCG_MULT_THERMAL_STATUS 0x0008 +#define regCG_MULT_THERMAL_STATUS_BASE_IDX 0 +#define regCG_THERMAL_RANGE 0x0009 +#define regCG_THERMAL_RANGE_BASE_IDX 0 +#define regTHM_TCON_LOCAL2 0x000a +#define regTHM_TCON_LOCAL2_BASE_IDX 0 +#define regTHM_TCON_LOCAL3 0x000b +#define regTHM_TCON_LOCAL3_BASE_IDX 0 +#define regTHM_TCON_LOCAL4 0x000c +#define regTHM_TCON_LOCAL4_BASE_IDX 0 +#define regTHM_TCON_LOCAL5 0x000d +#define regTHM_TCON_LOCAL5_BASE_IDX 0 +#define regTHM_TCON_LOCAL6 0x000e +#define regTHM_TCON_LOCAL6_BASE_IDX 0 +#define regTHM_TCON_LOCAL7 0x000f +#define regTHM_TCON_LOCAL7_BASE_IDX 0 +#define regTHM_TCON_LOCAL8 0x0010 +#define regTHM_TCON_LOCAL8_BASE_IDX 0 +#define regTHM_TCON_LOCAL9 0x0011 +#define regTHM_TCON_LOCAL9_BASE_IDX 0 +#define regTHM_TCON_LOCAL10 0x0012 +#define regTHM_TCON_LOCAL10_BASE_IDX 0 +#define regTHM_TCON_LOCAL11 0x0013 +#define regTHM_TCON_LOCAL11_BASE_IDX 0 +#define regTHM_TCON_LOCAL12 0x0014 +#define regTHM_TCON_LOCAL12_BASE_IDX 0 +#define regTHM_TCON_LOCAL13 0x0015 +#define regTHM_TCON_LOCAL13_BASE_IDX 0 +#define regTHM_TCON_LOCAL14 0x0016 +#define regTHM_TCON_LOCAL14_BASE_IDX 0 +#define regTHM_TCON_LOCAL15 0x0017 +#define regTHM_TCON_LOCAL15_BASE_IDX 0 +#define regTHM_PWRMGT 0x001b +#define regTHM_PWRMGT_BASE_IDX 0 +#define regTHM_DIE1_TEMP 0x001c +#define regTHM_DIE1_TEMP_BASE_IDX 0 +#define regTHM_DIE2_TEMP 0x001d +#define regTHM_DIE2_TEMP_BASE_IDX 0 +#define regTHM_DIE3_TEMP 0x001e +#define regTHM_DIE3_TEMP_BASE_IDX 0 +#define regSMUSBI_SBIREGADDR 0x0124 +#define regSMUSBI_SBIREGADDR_BASE_IDX 0 +#define regSMUSBI_SBIREGDATA 0x0125 +#define regSMUSBI_SBIREGDATA_BASE_IDX 0 +#define regSMUSBI_ERRATA_STAT_REG 0x0129 +#define regSMUSBI_ERRATA_STAT_REG_BASE_IDX 0 +#define regSMUSBI_SBICTRL 0x012a +#define regSMUSBI_SBICTRL_BASE_IDX 0 +#define regSMUSBI_CKNBIRESET 0x012b +#define regSMUSBI_CKNBIRESET_BASE_IDX 0 +#define regSMUSBI_TIMING 0x012c +#define regSMUSBI_TIMING_BASE_IDX 0 +#define regSMUSBI_HS_TIMING 0x012d +#define regSMUSBI_HS_TIMING_BASE_IDX 0 +#define regSBTSI_REMOTE_TEMP 0x012e +#define regSBTSI_REMOTE_TEMP_BASE_IDX 0 +#define regSBRMI_CONTROL 0x012f +#define regSBRMI_CONTROL_BASE_IDX 0 +#define regSBRMI_COMMAND 0x0130 +#define regSBRMI_COMMAND_BASE_IDX 0 +#define regSBRMI_WRITE_DATA0 0x0132 +#define regSBRMI_WRITE_DATA0_BASE_IDX 0 +#define regSBRMI_WRITE_DATA1 0x0133 +#define regSBRMI_WRITE_DATA1_BASE_IDX 0 +#define regSBRMI_WRITE_DATA2 0x0134 +#define regSBRMI_WRITE_DATA2_BASE_IDX 0 +#define regSBRMI_READ_DATA0 0x0136 +#define regSBRMI_READ_DATA0_BASE_IDX 0 +#define regSBRMI_READ_DATA1 0x0137 +#define regSBRMI_READ_DATA1_BASE_IDX 0 +#define regSBRMI_CORE_EN_NUMBER 0x0138 +#define regSBRMI_CORE_EN_NUMBER_BASE_IDX 0 +#define regSBRMI_CORE_EN_STATUS0 0x0139 +#define regSBRMI_CORE_EN_STATUS0_BASE_IDX 0 +#define regSBRMI_CORE_EN_STATUS1 0x013a +#define regSBRMI_CORE_EN_STATUS1_BASE_IDX 0 +#define regSBRMI_APIC_STATUS0 0x013b +#define regSBRMI_APIC_STATUS0_BASE_IDX 0 +#define regSBRMI_APIC_STATUS1 0x013c +#define regSBRMI_APIC_STATUS1_BASE_IDX 0 +#define regSBRMI_MCE_STATUS0 0x013d +#define regSBRMI_MCE_STATUS0_BASE_IDX 0 +#define regSBRMI_MCE_STATUS1 0x013e +#define regSBRMI_MCE_STATUS1_BASE_IDX 0 +#define regSMBUS_CNTL0 0x013f +#define regSMBUS_CNTL0_BASE_IDX 0 +#define regSMBUS_CNTL1 0x0140 +#define regSMBUS_CNTL1_BASE_IDX 0 +#define regSMBUS_BLKWR_CMD_CTRL0 0x0141 +#define regSMBUS_BLKWR_CMD_CTRL0_BASE_IDX 0 +#define regSMBUS_BLKWR_CMD_CTRL1 0x0142 +#define regSMBUS_BLKWR_CMD_CTRL1_BASE_IDX 0 +#define regSMBUS_BLKRD_CMD_CTRL0 0x0143 +#define regSMBUS_BLKRD_CMD_CTRL0_BASE_IDX 0 +#define regSMBUS_BLKRD_CMD_CTRL1 0x0144 +#define regSMBUS_BLKRD_CMD_CTRL1_BASE_IDX 0 +#define regSMBUS_TIMING_CNTL0 0x0145 +#define regSMBUS_TIMING_CNTL0_BASE_IDX 0 +#define regSMBUS_TIMING_CNTL1 0x0146 +#define regSMBUS_TIMING_CNTL1_BASE_IDX 0 +#define regSMBUS_TIMING_CNTL2 0x0147 +#define regSMBUS_TIMING_CNTL2_BASE_IDX 0 +#define regSMBUS_TRIGGER_CNTL 0x0148 +#define regSMBUS_TRIGGER_CNTL_BASE_IDX 0 +#define regSMBUS_UDID_CNTL0 0x0149 +#define regSMBUS_UDID_CNTL0_BASE_IDX 0 +#define regSMBUS_UDID_CNTL1 0x014a +#define regSMBUS_UDID_CNTL1_BASE_IDX 0 +#define regSMBUS_UDID_CNTL2 0x014b +#define regSMBUS_UDID_CNTL2_BASE_IDX 0 +#define regSMUSBI_SMBUS 0x014c +#define regSMUSBI_SMBUS_BASE_IDX 0 +#define regSMUSBI_ALERT 0x014d +#define regSMUSBI_ALERT_BASE_IDX 0 + +#endif
drivers/gpu/drm/amd/include/asic_reg/thm/thm_15_0_0_sh_mask.h new file +567 -0
567 lines not on this page · raw message
Signature · 1 line
2.52.0
Alex Deucher
maintainerPATCH 3/5 drm/amd: Enable SMUIO 15_0_0 support
In reply to Alex DeucherFrom: Pratik Vishwakarma <[email protected]>
Add SMUIO 15_0_0.
--- drivers/gpu/drm/amd/amdgpu/Makefile | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 4 ++ drivers/gpu/drm/amd/amdgpu/smuio_v15_0_0.c | 50 +++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/smuio_v15_0_0.h | 30 +++++++++++ 4 files changed, 85 insertions(+) create mode 100644 drivers/gpu/drm/amd/amdgpu/smuio_v15_0_0.c create mode 100644 drivers/gpu/drm/amd/amdgpu/smuio_v15_0_0.h
drivers/gpu/drm/amd/amdgpu/Makefile +1 -0
@@ -253,6 +253,7 @@ amdgpu-y += \ smuio_v13_0_3.o \ smuio_v13_0_6.o \ smuio_v14_0_2.o \ + smuio_v15_0_0.o \ smuio_v15_0_8.o # add reset block
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +4 -0
@@ -107,6 +107,7 @@#include "smuio_v13_0_3.h" #include "smuio_v13_0_6.h" #include "smuio_v14_0_2.h" +#include "smuio_v15_0_0.h" #include "smuio_v15_0_8.h" #include "vcn_v5_0_0.h" #include "vcn_v5_0_1.h"
@@ -3192,6 +3193,9 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)case IP_VERSION (14 ,0 ,2 ): adev->smuio.funcs = &smuio_v14_0_2_funcs;break ; +case IP_VERSION (15 ,0 ,0 ): + adev->smuio.funcs = &smuio_v15_0_0_funcs; +break ;case IP_VERSION (15 ,0 ,8 ): adev->smuio.funcs = &smuio_v15_0_8_funcs;break ;
drivers/gpu/drm/amd/amdgpu/smuio_v15_0_0.c new file +50 -0
50 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/smuio_v15_0_0.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* Copyright 2025 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +*/ +#ifndef __SMUIO_V15_0_0_H__ +#define __SMUIO_V15_0_0_H__ + +#include "soc15_common.h" + +extern const struct amdgpu_smuio_funcs smuio_v15_0_0_funcs; + +#endif /* __SMUIO_V15_0_0_H__ */
Signature · 1 line
2.52.0
Alex Deucher
maintainerPATCH 4/5 drm/amd: Enable SMU 15_0_0 firmware headers
In reply to Alex DeucherFrom: Pratik Vishwakarma <[email protected]>
Add SMU 15_0_0 firmware headers
v2: squash in updates (Alex)
--- .../inc/pmfw_if/smu15_driver_if_v15_0_0.h | 231 ++++++++++++++++++ .../pm/swsmu/inc/pmfw_if/smu_v15_0_0_pmfw.h | 160 ++++++++++++ .../pm/swsmu/inc/pmfw_if/smu_v15_0_0_ppsmc.h | 133 ++++++++++ 3 files changed, 524 insertions(+) create mode 100644 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu15_driver_if_v15_0_0.h create mode 100644 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v15_0_0_pmfw.h create mode 100644 drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v15_0_0_ppsmc.h
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu15_driver_if_v15_0_0.h new file +231 -0
@@ -0,0 +1,231 @@ +/* +* Copyright 2025 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +*/ + +#ifndef SMU15_DRIVER_IF_V15_0_0_H +#define SMU15_DRIVER_IF_V15_0_0_H + +typedef struct { +int32_t value; +uint32_t numFractionalBits; +}FloatInIntFormat_t ; + +typedef enum { +DSPCLK_DCFCLK =0 , +DSPCLK_DISPCLK , +DSPCLK_PIXCLK , +DSPCLK_PHYCLK , +DSPCLK_COUNT , +}DSPCLK_e ; + +typedef struct { +uint16_t Freq;// in MHz +uint16_t Vid;// min voltage in SVI3 VID +}DisplayClockTable_t ; + +typedef struct { +uint16_t MinClock;// This is either DCFCLK or SOCCLK (in MHz) +uint16_t MaxClock;// This is either DCFCLK or SOCCLK (in MHz) +uint16_t MinMclk; +uint16_t MaxMclk; + +uint8_t WmSetting; +uint8_t WmType;// Used for normal pstate change or memory retraining +uint8_t Padding[2 ]; +}WatermarkRowGeneric_t ; + +#define NUM_WM_RANGES 4 +#define WM_PSTATE_CHG 0 +#define WM_RETRAINING 1 + +typedef enum { +WM_SOCCLK =0 , +WM_DCFCLK , +WM_COUNT , +}WM_CLOCK_e ; + +typedef struct { +// Watermarks +WatermarkRowGeneric_t WatermarkRow[WM_COUNT ][NUM_WM_RANGES ]; + +uint32_t MmHubPadding[7 ];// SMU internal use +}Watermarks_t ; + +typedef enum { +CUSTOM_DPM_SETTING_GFXCLK , +CUSTOM_DPM_SETTING_CCLK , +CUSTOM_DPM_SETTING_FCLK_CCX , +CUSTOM_DPM_SETTING_FCLK_GFX , +CUSTOM_DPM_SETTING_FCLK_STALLS , +CUSTOM_DPM_SETTING_LCLK , +CUSTOM_DPM_SETTING_COUNT , +}CUSTOM_DPM_SETTING_e ; + +typedef struct { +uint8_t ActiveHystLimit; +uint8_t IdleHystLimit; +uint8_t FPS; +uint8_t MinActiveFreqType; +FloatInIntFormat_t MinActiveFreq; +FloatInIntFormat_t PD_Data_limit; +FloatInIntFormat_t PD_Data_time_constant; +FloatInIntFormat_t PD_Data_error_coeff; +FloatInIntFormat_t PD_Data_error_rate_coeff; +}DpmActivityMonitorCoeffExt_t ; + +typedef struct { +DpmActivityMonitorCoeffExt_t DpmActivityMonitorCoeff[CUSTOM_DPM_SETTING_COUNT ]; +}CustomDpmSettings_t ; + +#define NUM_DCFCLK_DPM_LEVELS 8 +#define NUM_DISPCLK_DPM_LEVELS 8 +#define NUM_DPPCLK_DPM_LEVELS 8 +#define NUM_SOCCLK_DPM_LEVELS 8 +#define NUM_VCN_DPM_LEVELS 8 +#define NUM_SOC_VOLTAGE_LEVELS 8 +#define NUM_VPE_DPM_LEVELS 8 +#define NUM_FCLK_DPM_LEVELS 8 +#define NUM_MEM_PSTATE_LEVELS 4 + + +typedef struct { +uint32_t UClk; +uint32_t MemClk; +uint32_t Voltage; +uint8_t WckRatio; +uint8_t Spare[3 ]; +}MemPstateTable_t ; + +//Freq in MHz +//Voltage in milli volts with 2 fractional bits +typedef struct { +uint32_t DcfClocks[NUM_DCFCLK_DPM_LEVELS ]; +uint32_t DispClocks[NUM_DISPCLK_DPM_LEVELS ]; +uint32_t DppClocks[NUM_DPPCLK_DPM_LEVELS ]; +uint32_t SocClocks[NUM_SOCCLK_DPM_LEVELS ]; +uint32_t VClocks[NUM_VCN_DPM_LEVELS ]; +uint32_t DClocks[NUM_VCN_DPM_LEVELS ]; +uint32_t VPEClocks[NUM_VPE_DPM_LEVELS ]; +uint32_t FclkClocks_Freq[NUM_FCLK_DPM_LEVELS ]; +uint32_t FclkClocks_Voltage[NUM_FCLK_DPM_LEVELS ]; +uint32_t SocVoltage[NUM_SOC_VOLTAGE_LEVELS ]; +MemPstateTable_t MemPstateTable[NUM_MEM_PSTATE_LEVELS ]; + +uint8_t NumDcfClkLevelsEnabled; +uint8_t NumDispClkLevelsEnabled;//Applies to both Dispclk and Dppclk +uint8_t NumSocClkLevelsEnabled; +uint8_t VcnClkLevelsEnabled;//Applies to both Vclk and Dclk + +uint8_t VpeClkLevelsEnabled; +uint8_t NumMemPstatesEnabled; +uint8_t NumFclkLevelsEnabled; +uint8_t spare; + +uint32_t MinGfxClk; +uint32_t MaxGfxClk; +}DpmClocks_t ; + +typedef struct { +uint16_t CoreFrequency[16 ];//Target core frequency [MHz] +uint16_t CorePower[16 ];//CAC calculated core power [mW] +uint16_t CoreTemperature[16 ];//TSEN measured core temperature [centi-C] +uint16_t GfxTemperature;//TSEN measured GFX temperature [centi-C] +uint16_t SocTemperature;//TSEN measured SOC temperature [centi-C] +uint16_t StapmOpnLimit;//Maximum IRM defined STAPM power limit [mW] +uint16_t StapmCurrentLimit;//Time filtered STAPM power limit [mW] +uint16_t InfrastructureCpuMaxFreq;//CCLK frequency limit enforced on classic cores [MHz] +uint16_t InfrastructureGfxMaxFreq;//GFXCLK frequency limit enforced on GFX [MHz] +uint16_t SkinTemp;//Maximum skin temperature reported by APU and HS2 chassis sensors [centi-C] +uint16_t GfxclkFrequency;//Time filtered target GFXCLK frequency [MHz] +uint16_t FclkFrequency;//Time filtered target FCLK frequency [MHz] +uint16_t GfxActivity;//Time filtered GFX busy % [0-100] +uint16_t SocclkFrequency;//Time filtered target SOCCLK frequency [MHz] +uint16_t VclkFrequency;//Time filtered target VCLK frequency [MHz] +uint16_t VcnActivity;//Time filtered VCN busy % [0-100] +uint16_t VpeclkFrequency;//Time filtered target VPECLK frequency [MHz] +uint16_t NpuclkFrequency;//Time filtered target NPUCLK frequency [MHz] +uint16_t NpuBusy[8 ];//Time filtered NPU per-column busy % [0-100] +uint16_t DRAMReads;//Time filtered DRAM read bandwidth [MB/sec] +uint16_t DRAMWrites;//Time filtered DRAM write bandwidth [MB/sec] +uint16_t CoreC0Residency[16 ];//Time filtered per-core C0 residency % [0-100] +uint16_t NpuPower;//Time filtered NPU power [mW] +uint32_t ApuPower;//Time filtered APU power [mW] +uint32_t GfxPower;//Time filtered GFX power [mW] +uint32_t dGpuPower;//Time filtered dGPU power [mW] +uint32_t SocketPower;//Time filtered power used for PPT/STAPM [APU+dGPU] [mW] +uint32_t AllCorePower;//Time filtered sum of core power across all cores in the socket [mW] +uint32_t FilterAlphaValue;//Metrics table alpha filter time constant [us] +uint32_t MetricsCounter;//Counter that is incremented on every metrics table update [PM_TIMER cycles] +uint16_t MemclkFrequency;//Time filtered target MEMCLK frequency [MHz] +uint16_t AieclkFrequency;//Time filtered target AIECLK frequency [MHz] +uint16_t NpuReads;//Time filtered NPU read bandwidth [MB/sec] +uint16_t NpuWrites;//Time filtered NPU write bandwidth [MB/sec] +uint32_t ThrottleResidency_PROCHOT;//Counter that is incremented on every metrics table update when PROCHOT was engaged [PM_TIMER cycles] +uint32_t ThrottleResidency_SPL;//Counter that is incremented on every metrics table update when SPL was engaged [PM_TIMER cycles] +uint32_t ThrottleResidency_FPPT;//Counter that is incremented on every metrics table update when fast PPT was engaged [PM_TIMER cycles] +uint32_t ThrottleResidency_SPPT;//Counter that is incremented on every metrics table update when slow PPT was engaged [PM_TIMER cycles] +uint32_t ThrottleResidency_THM_VDD;//Counter that is incremented on every metrics table update when VDD thermal throttling was engaged [PM_TIMER cycles] +uint32_t ThrottleResidency_THM_SOC;//Counter that is incremented on every metrics table update when SOC thermal throttling was engaged [PM_TIMER cycles] +uint16_t Psys;//Time filtered Psys power [mW] +uint16_t spare1; +uint32_t spare[6 ]; +}SmuMetrics_t ; + +//ISP tile definitions +typedef enum { +TILE_XTILE =0 ,//ONO0 +TILE_MTILE ,//ONO1 +TILE_PDP ,//ONO2 +TILE_CSTAT ,//ONO2 +TILE_LME ,//ONO3 +TILE_BYRP ,//ONO4 +TILE_GRBP ,//ONO4 +TILE_MCFP ,//ONO4 +TILE_YUVP ,//ONO4 +TILE_MCSC ,//ONO4 +TILE_GDC ,//ONO5 +TILE_MAX +}TILE_NUM_e ; + +// Tile Selection (Based on arguments) +#define ISP_TILE_SEL (tile) (1<<tile) +#define ISP_TILE_SEL_ALL 0x7FF + +// Workload bits +#define WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT 0 +#define WORKLOAD_PPLIB_VIDEO_BIT 2 +#define WORKLOAD_PPLIB_VR_BIT 3 +#define WORKLOAD_PPLIB_COMPUTE_BIT 4 +#define WORKLOAD_PPLIB_CUSTOM_BIT 5 +#define WORKLOAD_PPLIB_COUNT 6 + +#define TABLE_BIOS_IF 0 // Called by BIOS +#define TABLE_WATERMARKS 1 // Called by DAL through VBIOS, for Medusa generation this should no longer be used +#define TABLE_CUSTOM_DPM 2 // Called by Driver +#define TABLE_BIOS_GPIO_CONFIG 3 // Called by BIOS +#define TABLE_DPMCLOCKS 4 // Called by Driver and VBIOS +#define TABLE_SPARE0 5 // Unused +#define TABLE_SPARE1 6 // Unused +#define TABLE_SMU_METRICS 7 // Called by Driver and SMF/PMF +#define TABLE_COUNT 8 + +#endif
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v15_0_0_pmfw.h new file +160 -0
160 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v15_0_0_ppsmc.h new file +133 -0
133 lines not on this page · raw message
Signature · 1 line
2.52.0
Alex Deucher
maintainerPATCH 5/5 drm/amd: Enable SMU 15_0_0 support
In reply to Alex DeucherFrom: Pratik Vishwakarma <[email protected]>
Add SMU 15_0_0
--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 3 + .../gpu/drm/amd/include/kgd_pp_interface.h | 1 + drivers/gpu/drm/amd/pm/Makefile | 1 + drivers/gpu/drm/amd/pm/swsmu/Makefile | 2 +- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 12 + drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 1 + drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 6 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h | 247 +++ drivers/gpu/drm/amd/pm/swsmu/smu15/Makefile | 30 + .../gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c | 1843 +++++++++++++++++ .../drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c | 1352 ++++++++++++ .../drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.h | 28 + 12 files changed, 3524 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h create mode 100644 drivers/gpu/drm/amd/pm/swsmu/smu15/Makefile create mode 100644 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c create mode 100644 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c create mode 100644 drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.h
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +3 -0
@@ -2238,6 +2238,9 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev)case IP_VERSION (14 ,0 ,5 ):amdgpu_device_ip_block_add (adev, &smu_v14_0_ip_block);break ; +case IP_VERSION (15 ,0 ,0 ): +amdgpu_device_ip_block_add (adev, &smu_v15_0_ip_block); +break ;default : dev_err(adev->dev, "Failed to add smu ip block(MP1_HWIP:0x%x)\n",
drivers/gpu/drm/amd/include/kgd_pp_interface.h +1 -0
@@ -29,6 +29,7 @@ extern const struct amdgpu_ip_block_version smu_v11_0_ip_block;extern const struct amdgpu_ip_block_version smu_v12_0_ip_block;extern const struct amdgpu_ip_block_version smu_v13_0_ip_block;extern const struct amdgpu_ip_block_version smu_v14_0_ip_block; +extern const struct amdgpu_ip_block_version smu_v15_0_ip_block;enum smu_temp_metric_type {SMU_TEMP_METRIC_BASEBOARD ,
drivers/gpu/drm/amd/pm/Makefile +1 -0
@@ -31,6 +31,7 @@ subdir-ccflags-y += \ -I$(FULL_AMD_PATH)/pm/swsmu/smu12 \ -I$(FULL_AMD_PATH)/pm/swsmu/smu13 \ -I$(FULL_AMD_PATH)/pm/swsmu/smu14 \ + -I$(FULL_AMD_PATH)/pm/swsmu/smu15 \ -I$(FULL_AMD_PATH)/pm/powerplay/inc \ -I$(FULL_AMD_PATH)/pm/powerplay/smumgr\ -I$(FULL_AMD_PATH)/pm/powerplay/hwmgr \
drivers/gpu/drm/amd/pm/swsmu/Makefile +1 -1
@@ -22,7 +22,7 @@ AMD_SWSMU_PATH = ../pm/swsmu -SWSMU_LIBS = smu11 smu12 smu13 smu14 +SWSMU_LIBS = smu11 smu12 smu13 smu14 smu15 AMD_SWSMU = $(addsuffix /Makefile,$(addprefix $(FULL_AMD_PATH)/pm/swsmu/,$(SWSMU_LIBS)))
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +12 -0
@@ -46,6 +46,7 @@#include "smu_v13_0_7_ppt.h" #include "smu_v14_0_0_ppt.h" #include "smu_v14_0_2_ppt.h" +#include "smu_v15_0_0_ppt.h" #include "amd_pcie.h" /*
@@ -796,6 +797,9 @@ static int smu_set_funcs(struct amdgpu_device *adev)case IP_VERSION (14 ,0 ,3 ):smu_v14_0_2_set_ppt_funcs (smu);break ; +case IP_VERSION (15 ,0 ,0 ): +smu_v15_0_0_set_ppt_funcs (smu); +break ;default :return -EINVAL ; }
@@ -2806,6 +2810,14 @@ const struct amdgpu_ip_block_version smu_v14_0_ip_block = { .funcs = &smu_ip_funcs, }; +const struct amdgpu_ip_block_version smu_v15_0_ip_block = { + .type =AMD_IP_BLOCK_TYPE_SMC , + .major =15 , + .minor =0 , + .rev =0 , + .funcs = &smu_ip_funcs, +}; +const struct ras_smu_drv *smu_get_ras_smu_driver (void *handle) {struct smu_context *smu = (struct smu_context *)handle;
drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h +1 -0
@@ -1633,6 +1633,7 @@ typedef enum {METRICS_THROTTLER_RESIDENCY_THM_CORE ,METRICS_THROTTLER_RESIDENCY_THM_GFX ,METRICS_THROTTLER_RESIDENCY_THM_SOC , +METRICS_AVERAGE_NPUCLK , } MetricsMember_t; enum smu_cmn2asic_mapping_type {
drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h +5 -1
@@ -288,7 +288,11 @@__SMU_DUMMY_MAP (GetBadPageIpid), \__SMU_DUMMY_MAP (EraseRasTable), \__SMU_DUMMY_MAP (SetFastPptLimit), \ -__SMU_DUMMY_MAP (GetFastPptLimit), +__SMU_DUMMY_MAP (GetFastPptLimit), \ +__SMU_DUMMY_MAP (AllowZstates), \ +__SMU_DUMMY_MAP (GetSmartShiftStatus), \ +__SMU_DUMMY_MAP (EnableLSdma), \ +__SMU_DUMMY_MAP (DisableLSdma), #undef __SMU_DUMMY_MAP #define __SMU_DUMMY_MAP(type) SMU_MSG_##type
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v15_0.h new file +247 -0
247 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu15/Makefile new file +30 -0
@@ -0,0 +1,30 @@ +# +# Copyright 2025 Advanced Micro Devices, Inc. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# +# Makefile for the 'smu manager' sub-component of powerplay. +# It provides the smu management services for the driver. + +SMU15_MGR = smu_v15_0.o smu_v15_0_0_ppt.o + +AMD_SWSMU_SMU15MGR = $(addprefix $(AMD_SWSMU_PATH)/smu15/,$(SMU15_MGR)) + +AMD_POWERPLAY_FILES += $(AMD_SWSMU_SMU15MGR)
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c new file +1843 -0
1,843 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.c new file +1352 -0
800 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_0_ppt.h new file +28 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.52.0
Part of the diff is not shown here. View the raw message.