Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Add smn callbacks to register block

Add smn block to register access and callback interface definition to
get smn base.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
467ebfe6 b2d55124

+24
+11
drivers/gpu/drm/amd/amdgpu/amdgpu_reg_access.c
··· 283 283 adev->reg.pcie.port_wreg(adev, reg, v); 284 284 } 285 285 286 + uint64_t amdgpu_reg_get_smn_base64(struct amdgpu_device *adev, 287 + enum amd_hw_ip_block_type block, 288 + int die_inst) 289 + { 290 + if (!adev->reg.smn.get_smn_base) { 291 + dev_err_once(adev->dev, "SMN base address callback not set\n"); 292 + return 0; 293 + } 294 + return adev->reg.smn.get_smn_base(adev, block, die_inst); 295 + } 296 + 286 297 /* 287 298 * register access helper functions. 288 299 */
+13
drivers/gpu/drm/amd/amdgpu/amdgpu_reg_access.h
··· 27 27 #include <linux/types.h> 28 28 #include <linux/spinlock.h> 29 29 30 + #include "amdgpu_ip.h" 31 + 30 32 struct amdgpu_device; 31 33 32 34 typedef uint32_t (*amdgpu_rreg_t)(struct amdgpu_device *, uint32_t); ··· 44 42 uint32_t); 45 43 typedef void (*amdgpu_block_wreg_t)(struct amdgpu_device *, uint32_t, uint32_t, 46 44 uint32_t); 45 + typedef uint64_t (*amdgpu_reg_get_smn_base64_t)(struct amdgpu_device *adev, 46 + enum amd_hw_ip_block_type block, 47 + int die_inst); 47 48 48 49 struct amdgpu_reg_ind { 49 50 spinlock_t lock; ··· 74 69 amdgpu_wreg_t port_wreg; 75 70 }; 76 71 72 + struct amdgpu_reg_smn_ext { 73 + amdgpu_reg_get_smn_base64_t get_smn_base; 74 + }; 75 + 77 76 struct amdgpu_reg_access { 78 77 struct amdgpu_reg_ind smc; 79 78 struct amdgpu_reg_ind uvd_ctx; ··· 86 77 struct amdgpu_reg_ind se_cac; 87 78 struct amdgpu_reg_ind_blk audio_endpt; 88 79 struct amdgpu_reg_pcie_ind pcie; 80 + struct amdgpu_reg_smn_ext smn; 89 81 }; 90 82 91 83 void amdgpu_reg_access_init(struct amdgpu_device *adev); ··· 119 109 uint32_t amdgpu_reg_pciep_rd32(struct amdgpu_device *adev, uint32_t reg); 120 110 void amdgpu_reg_pciep_wr32(struct amdgpu_device *adev, uint32_t reg, 121 111 uint32_t v); 112 + uint64_t amdgpu_reg_get_smn_base64(struct amdgpu_device *adev, 113 + enum amd_hw_ip_block_type block, 114 + int die_inst); 122 115 123 116 uint32_t amdgpu_device_rreg(struct amdgpu_device *adev, uint32_t reg, 124 117 uint32_t acc_flags);