drm/amd/amdgpu: Include headers for PWR and SMUIO registers
Subsystems (2)
PATCH 1/1 drm/amd/amdgpu: Include headers for PWR and SMUIO registers
Clean up the smu10, smu12, and gfx9 drivers to use headers for registers instead of hardcoding in the C source files.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 +++------- drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 9 ++------- drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 12 +++++++----- 3 files changed, 12 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -7
@@ -50,18 +50,14 @@#include "gfx_v9_4.h" +#include "asic_reg/pwr/pwr_10_0_offset.h" +#include "asic_reg/pwr/pwr_10_0_sh_mask.h" +#define GFX9_NUM_GFX_RINGS 1#define GFX9_MEC_HPD_SIZE 4096#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L#define RLC_SAVE_RESTORE_ADDR_STARTING_OFFSET 0x00000000L -#define mmPWR_MISC_CNTL_STATUS 0x0183 -#define mmPWR_MISC_CNTL_STATUS_BASE_IDX 0 -#define PWR_MISC_CNTL_STATUS__PWR_GFX_RLC_CGPG_EN__SHIFT 0x0 -#define PWR_MISC_CNTL_STATUS__PWR_GFXOFF_STATUS__SHIFT 0x1 -#define PWR_MISC_CNTL_STATUS__PWR_GFX_RLC_CGPG_EN_MASK 0x00000001L -#define PWR_MISC_CNTL_STATUS__PWR_GFXOFF_STATUS_MASK 0x00000006L -#define mmGCEA_PROBE_MAP 0x070c#define mmGCEA_PROBE_MAP_BASE_IDX 0
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +2 -7
@@ -36,6 +36,8 @@#include "power_state.h" #include "soc15_common.h" #include "smu10.h" +#include "asic_reg/pwr/pwr_10_0_offset.h" +#include "asic_reg/pwr/pwr_10_0_sh_mask.h" #define SMU10_MAX_DEEPSLEEP_DIVIDER_ID 5#define SMU10_MINIMUM_ENGINE_CLOCK 800/* 8Mhz, the low boundary of engine clock allowed on this chip */
@@ -43,13 +45,6 @@#define SMU10_DISPCLK_BYPASS_THRESHOLD 10000/* 100Mhz */ #define SMC_RAM_END 0x40000 -#define mmPWR_MISC_CNTL_STATUS 0x0183 -#define mmPWR_MISC_CNTL_STATUS_BASE_IDX 0 -#define PWR_MISC_CNTL_STATUS__PWR_GFX_RLC_CGPG_EN__SHIFT 0x0 -#define PWR_MISC_CNTL_STATUS__PWR_GFXOFF_STATUS__SHIFT 0x1 -#define PWR_MISC_CNTL_STATUS__PWR_GFX_RLC_CGPG_EN_MASK 0x00000001L -#define PWR_MISC_CNTL_STATUS__PWR_GFXOFF_STATUS_MASK 0x00000006L -static const unsigned long SMU10_Magic = (unsigned long ) PHM_Rv_Magic;
drivers/gpu/drm/amd/powerplay/smu_v12_0.c +7 -5
@@ -32,13 +32,15 @@#include "asic_reg/mp/mp_12_0_0_offset.h" #include "asic_reg/mp/mp_12_0_0_sh_mask.h" +#include "asic_reg/smuio/smuio_12_0_0_offset.h" +#include "asic_reg/smuio/smuio_12_0_0_sh_mask.h" -#define smnMP1_FIRMWARE_FLAGS 0x3010024 +// because some SMU12 based ASICs use older ip offset tables +// we should undefine this register from the smuio12 header +// to prevent confusion down the road +#undef mmPWR_MISC_CNTL_STATUS -#define mmSMUIO_GFX_MISC_CNTL 0x00c8 -#define mmSMUIO_GFX_MISC_CNTL_BASE_IDX 0 -#define SMUIO_GFX_MISC_CNTL__PWR_GFXOFF_STATUS_MASK 0x00000006L -#define SMUIO_GFX_MISC_CNTL__PWR_GFXOFF_STATUS__SHIFT 0x1 +#define smnMP1_FIRMWARE_FLAGS 0x3010024int smu_v12_0_send_msg_without_waiting (struct smu_context *smu,uint16_t msg)
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Public Use]
________________________________
From: amd-gfx <[email protected]> on behalf of Tom St Denis <[email protected]>
Sent: Friday, March 27, 2020 9:44 AM
To: [email protected] <[email protected]>
Cc: StDenis, Tom <[email protected]>
Subject: [PATCH] drm/amd/amdgpu: Include headers for PWR and SMUIO registers
Clean up the smu10, smu12, and gfx9 drivers to use headers for registers instead of hardcoding in the C source files.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 +++------- drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 9 ++------- drivers/gpu/drm/amd/powerplay/smu_v12_0.c | 12 +++++++----- 3 files changed, 12 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -7
@@ -50,18 +50,14 @@#include "gfx_v9_4.h" +#include "asic_reg/pwr/pwr_10_0_offset.h" +#include "asic_reg/pwr/pwr_10_0_sh_mask.h" +#define GFX9_NUM_GFX_RINGS 1#define GFX9_MEC_HPD_SIZE 4096#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L#define RLC_SAVE_RESTORE_ADDR_STARTING_OFFSET 0x00000000L -#define mmPWR_MISC_CNTL_STATUS 0x0183 -#define mmPWR_MISC_CNTL_STATUS_BASE_IDX 0 -#define PWR_MISC_CNTL_STATUS__PWR_GFX_RLC_CGPG_EN__SHIFT 0x0 -#define PWR_MISC_CNTL_STATUS__PWR_GFXOFF_STATUS__SHIFT 0x1 -#define PWR_MISC_CNTL_STATUS__PWR_GFX_RLC_CGPG_EN_MASK 0x00000001L -#define PWR_MISC_CNTL_STATUS__PWR_GFXOFF_STATUS_MASK 0x00000006L -#define mmGCEA_PROBE_MAP 0x070c#define mmGCEA_PROBE_MAP_BASE_IDX 0
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +2 -7
@@ -36,6 +36,8 @@#include "power_state.h" #include "soc15_common.h" #include "smu10.h" +#include "asic_reg/pwr/pwr_10_0_offset.h" +#include "asic_reg/pwr/pwr_10_0_sh_mask.h" #define SMU10_MAX_DEEPSLEEP_DIVIDER_ID 5#define SMU10_MINIMUM_ENGINE_CLOCK 800/* 8Mhz, the low boundary of engine clock allowed on this chip */
@@ -43,13 +45,6 @@#define SMU10_DISPCLK_BYPASS_THRESHOLD 10000/* 100Mhz */ #define SMC_RAM_END 0x40000 -#define mmPWR_MISC_CNTL_STATUS 0x0183 -#define mmPWR_MISC_CNTL_STATUS_BASE_IDX 0 -#define PWR_MISC_CNTL_STATUS__PWR_GFX_RLC_CGPG_EN__SHIFT 0x0 -#define PWR_MISC_CNTL_STATUS__PWR_GFXOFF_STATUS__SHIFT 0x1 -#define PWR_MISC_CNTL_STATUS__PWR_GFX_RLC_CGPG_EN_MASK 0x00000001L -#define PWR_MISC_CNTL_STATUS__PWR_GFXOFF_STATUS_MASK 0x00000006L -static const unsigned long SMU10_Magic = (unsigned long ) PHM_Rv_Magic;
drivers/gpu/drm/amd/powerplay/smu_v12_0.c +7 -5
@@ -32,13 +32,15 @@#include "asic_reg/mp/mp_12_0_0_offset.h" #include "asic_reg/mp/mp_12_0_0_sh_mask.h" +#include "asic_reg/smuio/smuio_12_0_0_offset.h" +#include "asic_reg/smuio/smuio_12_0_0_sh_mask.h" -#define smnMP1_FIRMWARE_FLAGS 0x3010024 +// because some SMU12 based ASICs use older ip offset tables +// we should undefine this register from the smuio12 header +// to prevent confusion down the road +#undef mmPWR_MISC_CNTL_STATUS -#define mmSMUIO_GFX_MISC_CNTL 0x00c8 -#define mmSMUIO_GFX_MISC_CNTL_BASE_IDX 0 -#define SMUIO_GFX_MISC_CNTL__PWR_GFXOFF_STATUS_MASK 0x00000006L -#define SMUIO_GFX_MISC_CNTL__PWR_GFXOFF_STATUS__SHIFT 0x1 +#define smnMP1_FIRMWARE_FLAGS 0x3010024int smu_v12_0_send_msg_without_waiting (struct smu_context *smu,uint16_t msg)
--
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7C63d58f7ec8114ef86c9108d7d254ff6b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637209135495314070&sdata=itPgDOvpUPrdr5IwY0HtIb5McGA7v%2Bim7d4XeGJ5%2BiQ%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx