mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 06:13:30 +07:00
drm/amd/powerplay: tag swSMU code layers
Per designs, the swSMU code is separated into four layers. And the typical calling flow should be like: amdgpu_smu.c -> ${asic}_ppt.c -> smu_v11/12_0.c -> smu_cmn.c. Compile errors will come out for any violations. This can help to prevent cross callings(e.g. amdgpu_smu.c -> ${asic}_ppt.c -> amdgpu_smu.c -> ${asic}_ppt.c) which were common in our code. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
704759315a
commit
d8e0b16d81
@ -20,14 +20,14 @@
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define SWSMU_CODE_LAYER_L1
|
||||
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include "amdgpu.h"
|
||||
#include "amdgpu_smu.h"
|
||||
#include "smu_internal.h"
|
||||
#include "smu_v11_0.h"
|
||||
#include "smu_v12_0.h"
|
||||
#include "atom.h"
|
||||
#include "arcturus_ppt.h"
|
||||
#include "navi10_ppt.h"
|
||||
|
@ -21,10 +21,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define SWSMU_CODE_LAYER_L2
|
||||
|
||||
#include <linux/firmware.h>
|
||||
#include "amdgpu.h"
|
||||
#include "amdgpu_smu.h"
|
||||
#include "smu_internal.h"
|
||||
#include "atomfirmware.h"
|
||||
#include "amdgpu_atomfirmware.h"
|
||||
#include "amdgpu_atombios.h"
|
||||
|
@ -653,6 +653,7 @@ enum smu_cmn2asic_mapping_type {
|
||||
#define WORKLOAD_MAP(profile, workload) \
|
||||
[profile] = {1, (workload)}
|
||||
|
||||
#if !defined(SWSMU_CODE_LAYER_L2) && !defined(SWSMU_CODE_LAYER_L3) && !defined(SWSMU_CODE_LAYER_L4)
|
||||
int smu_load_microcode(struct smu_context *smu);
|
||||
|
||||
int smu_check_fw_status(struct smu_context *smu);
|
||||
@ -790,3 +791,4 @@ int smu_get_dpm_clock_table(struct smu_context *smu,
|
||||
int smu_get_status_gfxoff(struct amdgpu_device *adev, uint32_t *value);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -134,6 +134,8 @@ enum smu_v11_0_baco_seq {
|
||||
BACO_SEQ_COUNT,
|
||||
};
|
||||
|
||||
#if defined(SWSMU_CODE_LAYER_L2) || defined(SWSMU_CODE_LAYER_L3)
|
||||
|
||||
int smu_v11_0_init_microcode(struct smu_context *smu);
|
||||
|
||||
void smu_v11_0_fini_microcode(struct smu_context *smu);
|
||||
@ -263,3 +265,4 @@ int smu_v11_0_get_dpm_level_range(struct smu_context *smu,
|
||||
uint32_t *max_value);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -31,6 +31,8 @@
|
||||
#define MP1_Public 0x03b00000
|
||||
#define MP1_SRAM 0x03c00004
|
||||
|
||||
#if defined(SWSMU_CODE_LAYER_L2) || defined(SWSMU_CODE_LAYER_L3)
|
||||
|
||||
int smu_v12_0_check_fw_status(struct smu_context *smu);
|
||||
|
||||
int smu_v12_0_check_fw_version(struct smu_context *smu);
|
||||
@ -59,3 +61,4 @@ int smu_v12_0_set_soft_freq_limited_range(struct smu_context *smu, enum smu_clk_
|
||||
int smu_v12_0_set_driver_table_location(struct smu_context *smu);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -21,11 +21,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define SWSMU_CODE_LAYER_L2
|
||||
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/pci.h>
|
||||
#include "amdgpu.h"
|
||||
#include "amdgpu_smu.h"
|
||||
#include "smu_internal.h"
|
||||
#include "atomfirmware.h"
|
||||
#include "amdgpu_atomfirmware.h"
|
||||
#include "amdgpu_atombios.h"
|
||||
|
@ -21,9 +21,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define SWSMU_CODE_LAYER_L2
|
||||
|
||||
#include "amdgpu.h"
|
||||
#include "amdgpu_smu.h"
|
||||
#include "smu_internal.h"
|
||||
#include "smu_v12_0_ppsmc.h"
|
||||
#include "smu12_driver_if.h"
|
||||
#include "smu_v12_0.h"
|
||||
|
@ -21,11 +21,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define SWSMU_CODE_LAYER_L2
|
||||
|
||||
#include <linux/firmware.h>
|
||||
#include <linux/pci.h>
|
||||
#include "amdgpu.h"
|
||||
#include "amdgpu_smu.h"
|
||||
#include "smu_internal.h"
|
||||
#include "atomfirmware.h"
|
||||
#include "amdgpu_atomfirmware.h"
|
||||
#include "amdgpu_atombios.h"
|
||||
|
@ -20,10 +20,11 @@
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define SWSMU_CODE_LAYER_L4
|
||||
|
||||
#include "amdgpu.h"
|
||||
#include "amdgpu_smu.h"
|
||||
#include "smu_cmn.h"
|
||||
#include "smu_internal.h"
|
||||
#include "soc15_common.h"
|
||||
|
||||
/*
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
#include "amdgpu_smu.h"
|
||||
|
||||
#if defined(SWSMU_CODE_LAYER_L2) || defined(SWSMU_CODE_LAYER_L3) || defined(SWSMU_CODE_LAYER_L4)
|
||||
int smu_cmn_send_smc_msg_with_param(struct smu_context *smu,
|
||||
enum smu_message_type msg,
|
||||
uint32_t param,
|
||||
@ -79,3 +80,4 @@ int smu_cmn_write_watermarks_table(struct smu_context *smu);
|
||||
int smu_cmn_write_pptable(struct smu_context *smu);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#include "amdgpu_smu.h"
|
||||
|
||||
#if defined(SWSMU_CODE_LAYER_L1)
|
||||
|
||||
#define smu_ppt_funcs(intf, ret, smu, args...) \
|
||||
((smu)->ppt_funcs ? ((smu)->ppt_funcs->intf ? (smu)->ppt_funcs->intf(smu, ##args) : ret) : -EINVAL)
|
||||
|
||||
@ -95,3 +97,4 @@
|
||||
#define smu_set_pp_feature_mask(smu, new_mask) smu_ppt_funcs(set_pp_feature_mask, 0, smu, new_mask)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -26,10 +26,10 @@
|
||||
#include <linux/reboot.h>
|
||||
|
||||
#define SMU_11_0_PARTIAL_PPTABLE
|
||||
#define SWSMU_CODE_LAYER_L3
|
||||
|
||||
#include "amdgpu.h"
|
||||
#include "amdgpu_smu.h"
|
||||
#include "smu_internal.h"
|
||||
#include "atomfirmware.h"
|
||||
#include "amdgpu_atomfirmware.h"
|
||||
#include "amdgpu_atombios.h"
|
||||
|
@ -20,10 +20,11 @@
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define SWSMU_CODE_LAYER_L3
|
||||
|
||||
#include <linux/firmware.h>
|
||||
#include "amdgpu.h"
|
||||
#include "amdgpu_smu.h"
|
||||
#include "smu_internal.h"
|
||||
#include "atomfirmware.h"
|
||||
#include "amdgpu_atomfirmware.h"
|
||||
#include "smu_v12_0.h"
|
||||
|
Loading…
Reference in New Issue
Block a user