Hi all, The series of patches are to implement a new SW SMU driver for future asics. Background: The powerplay driver will be retired. The final version is for vega20 with SMU11. However, the future asic will use the new swSMU framework to implement as well. Here is the first version of new sw smu driver that is basing on vega20. Purpose: We would like to do re-arch for linux power codes to use a new sw SMU ip block for future asics. We hope to write a simple and readable framework for Linux. Currently, the default path is still with powerplay on vega20. So far we don’t plan to switch default path to new swSMU design for vega20. And we can use the module parameter amdgpu_dpm to switch it to new SW SMU design (modprobe amdgpu dpm=1). Development Items: - Setup new SMU IP block skeleton. - Implement SMC firmware loading function. - Implement SMC table data structure. - Implement SMU v11 indirect register (MP1) read/write and SMC message sending helpers. - Implement SMU v11 SMC table initialization (read from vbios, parse, populate, and write back to smc). - Implement SMU v11 memory pool location function. - Enable DPM feature for SMU v11 and implement DPM control callback function. - Enable interfaces for starting tools. - Implement SMU v11 power control and power containment functions. - Implement and enable SMU v11 thermal/fan control function. - Implement SMU interfaces placeholder for DC, VCN, and KFD driver. - Enable and align sys interface in the amdgpu_pm.c. So far, Kevin, Likun, Jack, and I have enabled features such as dpm, od, thermal, and etc. with new sw smu driver. (Thanks to Kevin, Likun and Jack's great effort!) Any comments are warm for us. Thanks & Best Regards! Ray Chengming Gui (14): drm/amd/powerplay: implement power_dpm_state sys interface for SMU11 drm/amd/powerplay: add watermarks related data structs and function for SMU11. drm/amd/powerplay: implement pp_power_profile_mode sys inerface for SMU11 drm/amd/powerplay: add display_config to handle display config for SMU11. drm/amd/powerplay: add mclk_latency_table struct and smu_clocks struct for SMU11 drm/amd/powerplay: add enable_umd_pstate functions for SMU11 drm/amd/powerplay: add get_profiling_clk_mask functions for SMU11 drm/amd/powerplay: add set_uclk_to_highest_level for SMU11 drm/amd/powerplay: add display_config_changed for SMU11. drm/amd/powerplay: add apply_clock_adjust_rules for SMU11. drm/amd/powerplay: add vega20_notify_smc_display_config functions for SMU11 drm/amd/powerplay: add vega20_find/force_higest/lowest_dpm for SMU11 drm/amd/powerplay: add vega20_unforce_dpm_levels for SMU11. drm/amd/powerplay: implement power_dpm_force_performance_level for SMU11 Huang Rui (53): drm/amd/powerplay: add new smu ip block drm/amd/powerplay: add smu11 sub block for SMU IP drm/amd/powerplay: add firmware loading interface drm/amd/powerplay: add fw load checking interface drm/amd/powerplay: add interface to read pptable from vbios drm/amd/powerplay: add placeholder of smu_initialize_pptable drm/amd/powerplay: add interface to init smc tables (v2) drm/amd/powerplay: add interface to init power (v2) drm/amd/powerplay: add interface to get vbios bootup values (v2) drm/amd/powerplay: add interface to check pptable (v2) drm/amd/powerplay: add interface to init fb allocations (v2) drm/amd/powerplay: add interface to parse pptable (v2) drm/amd/powerplay: add interface to populate smc pptable (v2) drm/amd/powerplay: add interface to check fw version (v2) drm/amd/powerplay: add interface to write pptable (v2) drm/amd/powerplay: add interface to set min dcef deep sleep (v2) drm/amd/powerplay: add interface to set tool table location (v2) drm/amd/powerplay: add interface to allocate memory pool (v2) drm/amd/powerplay: add interface to notify memory pool location (v2) drm/amd/powerplay: add interfaces for smu resume drm/amd/powerplay: add resume sequence placeholder for smu ip block drm/amdgpu: enable new smu ip block for vega20 drm/amd/powerplay: add new ppsmc header for smu11 (v2) drm/amd/powerplay: add pptable header for smu11 drm/amdgpu: update atomfirmware header for smu11 drm/amdgpu: update new members in atomfirmware drm/amd/powerplay: add smu table context structure drm/amd/powerplay: add get atom data table helper drm/amdgpu: move get_index_into_master_table macro into atomfirmware header drm/amd/powerplay: implement read_pptable_from_vbios function for smu11 drm/amd/powerplay: update pptable header for smu11 drm/amd/powerplay: add data structure of bootup values drm/amd/powerplay: implement get_vbios_bootup_values function for smu11 (v2) drm/amd/powerplay: implement get_clk_info_from_vbios function for smu11 (v2) drm/amd/powerplay: add vega20 pptable function file drm/amd/powerplay: add append_powerplay_table function drm/amd/powerplay: add get_max_sustainable_clock function drm/amd/powerplay: add the function to set deep sleep dcefclk drm/amd/powerplay: add two interfaces to set_active_display_count and store_cc6_data drm/amd/powerplay: add smu display configuration change function drm/amd/powerplay: add get_clock_by_type interface for display drm/amd/powerplay: add interface to get max high clocks for display drm/amd/powerplay: add interface to get clock by type with latency for display (v2) drm/amd/powerplay: add interface to get clock by type with voltage for display drm/amd/powerplay: add interface to request display clock voltage drm/amd/powerplay: add interface to get dal power level drm/amd/powerplay: add interface to get performance level drm/amd/powerplay: add interface to get current shallow sleep clocks drm/amd/powerplay: add interface to get current clocks for display drm/amd/powerplay: add interface to notify smu enable pme restore register drm/amd/powerplay: implement interface to set watermarks for clock ranges drm/amd/powerplay: remove unnecessary checking in smu_hw_fini drm/amd/powerplay: don't check hwmgr while using the sw smu Kevin Wang (38): drm/amd/powerplay: implement smu send message functions for smu11 (v3) drm/amd/powerplay: implement check_fw_status function for smu11 drm/amd/powerplay: implement check_fw_version function for smu11 drm/amd/powerplay: implement smu_init[fini]_smc_tables for smu11 drm/amd/powerplay: implement smu dpm context functions for smu11 drm/amd/powerplay: implement smu_init[fini]_power function for smu11 drm/amd/powerplay: implement smu_init(fini)_fb_allocations function drm/amd/powerplay: remove header of smu_v11_0_pptable drm/amd/powerplay: implement smu_alloc[free]_memory pool function drm/amd/powerplay: implement notify_memory_pool_location function for smu11 drm/amd/powerplay: add enum smu_msg_type to header drm/amd/powerplay: implement smu vega20_message_map for vega20 drm/amd/powerplay: use virtual msg index to replace asic-related msg index drm/amd/powerplay: replace SMU_MSG_XXX with PPSMC_MSG_XXX message index for smu11 (v2) drm/amd/powerplay: implement smu_init_display for smu11 drm/amd/powerplay: implement smu_run_afll_btc function drm/amd/powerplay: implement smu feature functions drm/amd/powerplay: implement feature get&set functions drm/amd/powerplay: implement smu_notify_display_change function for smu11 drm/amd/powerplay: implement get_current_clk_freq for smu11 drm/amd/powerplay: implement smu update table function drm/amd/powerplay: implement is_support_sw_smu function for new smu drm/amd/powerplay: implement sysfs of amdgpu_get_busy_percent for smu11 drm/amd/powerplay: implement sysfs of pp_table for smu11 drm/amd/powerplay: implement sensor of SCLK and MCLK for smu11 drm/amd/powerplay: implement sensor of thermal_get_temperature for smu11 drm/amd/powerplay: implement sensor of get_gpu_power for smu11 drm/amd/powerplay: implement sensor of get_gfx_vdd for smu11 drm/amd/powerplay: implement sensor of get feature mask drm/amd/powerplay: implement sysfs of get num states function drm/amd/powerplay: implement sysfs of pp_cur_state function drm/amd/powerplay: implement sysfs of pp_force_state for sw-smu drm/amd/powerplay: implement update enabled feature state to smc for smu11 drm/amd/powerplay: hwmon don't check powerplay when sw smu is enabled drm/amd/powerplay: implement uvd & vce dpm enable functions drm/amd/powerplay: implement sensor of uvd & vce power state for smu11 drm/amd/powerplay: implement dpm enable functions of uvd & vce for smu drm/amd/powerplay: enable amdgpu dpm for smu Likun Gao (33): drm/amd/powerplay: init microcode for smu11 drm/amd/powerplay: add function to parse pptable for smu11 drm/amd/powerplay: add function to check pptable for smu11 drm/amd/powerplay: update hw fini function to relase some memory drm/amd/powerplay: add function to populate smc pptable for smu11 drm/amd/powerplay: add function to write pptable for smu11 (v2) drm/amd/powerplay: add function to set min dcef deep sleep for smu11 (v2) drm/amd/powerplay: add function to set tool table location for smu11 (v2) drm/amd/powerplay: expose the function of smu read argument drm/amd/powerplay: Change the allocate method of dpm context for smu11. drm/amd/powerplay: set defalut dpm table for smu drm/amd/powerplay: add function to populate umd state clk. drm/amd/powerplay: add function to get power limit for smu11 (v2) drm/amd/powerplay: print clock levels for smu11 (v2) drm/amd/powerplay: add function to get thermal range drm/amd/powerplay: add function to set thermal range drm/amd/powerplay: add function to enable thermal alert drm/amd/powerplay: add function to set fan table to control thermal drm/amd/powerplay: add function to start thermal control drm/amd/powerplay: upload dpm level for smu11 drm/amd/powerplay: force clock levels for smu11 drm/amd/powerplay: add function to store overdrive information for smu11 drm/amd/powerplay: add function to set default overdrive settings drm/amd/powerplay: add golden dpm table to backup default DPM table drm/amd/powerplay: print overdrive percentage information for smu11 drm/amd/powerplay: get overdrive clock and voltage information drm/amd/powerplay: add sys interface for pcie for smu drm/amd/powerplay: add function to update overdrive settings drm/amd/powerplay: add sys interface for set sclk_od/mclk_od for smu drm/amd/powerplay: add sys interface to set pp_od_clk_voltage for smu drm/amd/powerplay: adjust power state when set od_clk drm/amd/powerplay: dpm clk can be set only when performance level is manual drm/amd/powerplay: Unify smu handle task function drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 + drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 12 +- drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 11 +- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 364 ++-- drivers/gpu/drm/amd/amdgpu/soc15.c | 9 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 99 +- drivers/gpu/drm/amd/include/amd_shared.h | 3 + drivers/gpu/drm/amd/include/atomfirmware.h | 44 +- drivers/gpu/drm/amd/powerplay/Makefile | 2 +- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 1198 +++++++++++ drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 732 +++++++ drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h | 89 + .../gpu/drm/amd/powerplay/inc/smu_v11_0_ppsmc.h | 128 ++ .../gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h | 147 ++ drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 1683 +++++++++++++++ drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2146 ++++++++++++++++++++ drivers/gpu/drm/amd/powerplay/vega20_ppt.h | 129 ++ 19 files changed, 6624 insertions(+), 185 deletions(-) create mode 100644 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c create mode 100644 drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h create mode 100644 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h create mode 100644 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_ppsmc.h create mode 100644 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0_pptable.h create mode 100644 drivers/gpu/drm/amd/powerplay/smu_v11_0.c create mode 100644 drivers/gpu/drm/amd/powerplay/vega20_ppt.c create mode 100644 drivers/gpu/drm/amd/powerplay/vega20_ppt.h -- 2.7.4 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx