62
62
#define regPC_CONFIG_CNTL_1 0x194d
63
63
#define regPC_CONFIG_CNTL_1_BASE_IDX 1
64
64
65
+ #define regCP_GFX_MQD_CONTROL_DEFAULT 0x00000100
66
+ #define regCP_GFX_HQD_VMID_DEFAULT 0x00000000
67
+ #define regCP_GFX_HQD_QUEUE_PRIORITY_DEFAULT 0x00000000
68
+ #define regCP_GFX_HQD_QUANTUM_DEFAULT 0x00000a01
69
+ #define regCP_GFX_HQD_CNTL_DEFAULT 0x00a00000
70
+ #define regCP_RB_DOORBELL_CONTROL_DEFAULT 0x00000000
71
+ #define regCP_GFX_HQD_RPTR_DEFAULT 0x00000000
72
+
73
+ #define regCP_HQD_EOP_CONTROL_DEFAULT 0x00000006
74
+ #define regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT 0x00000000
75
+ #define regCP_MQD_CONTROL_DEFAULT 0x00000100
76
+ #define regCP_HQD_PQ_CONTROL_DEFAULT 0x00308509
77
+ #define regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT 0x00000000
78
+ #define regCP_HQD_PQ_RPTR_DEFAULT 0x00000000
79
+ #define regCP_HQD_PERSISTENT_STATE_DEFAULT 0x0be05501
80
+ #define regCP_HQD_IB_CONTROL_DEFAULT 0x00300000
81
+
65
82
MODULE_FIRMWARE ("amdgpu/gc_11_0_0_pfp.bin" );
66
83
MODULE_FIRMWARE ("amdgpu/gc_11_0_0_me.bin" );
67
84
MODULE_FIRMWARE ("amdgpu/gc_11_0_0_mec.bin" );
@@ -3965,7 +3982,7 @@ static void gfx_v11_0_gfx_mqd_set_priority(struct amdgpu_device *adev,
3965
3982
if (prop -> hqd_pipe_priority == AMDGPU_GFX_PIPE_PRIO_HIGH )
3966
3983
priority = 1 ;
3967
3984
3968
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_QUEUE_PRIORITY ) ;
3985
+ tmp = regCP_GFX_HQD_QUEUE_PRIORITY_DEFAULT ;
3969
3986
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_QUEUE_PRIORITY , PRIORITY_LEVEL , priority );
3970
3987
mqd -> cp_gfx_hqd_queue_priority = tmp ;
3971
3988
}
@@ -3987,22 +4004,22 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
3987
4004
mqd -> cp_mqd_base_addr_hi = upper_32_bits (prop -> mqd_gpu_addr );
3988
4005
3989
4006
/* set up mqd control */
3990
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_MQD_CONTROL ) ;
4007
+ tmp = regCP_GFX_MQD_CONTROL_DEFAULT ;
3991
4008
tmp = REG_SET_FIELD (tmp , CP_GFX_MQD_CONTROL , VMID , 0 );
3992
4009
tmp = REG_SET_FIELD (tmp , CP_GFX_MQD_CONTROL , PRIV_STATE , 1 );
3993
4010
tmp = REG_SET_FIELD (tmp , CP_GFX_MQD_CONTROL , CACHE_POLICY , 0 );
3994
4011
mqd -> cp_gfx_mqd_control = tmp ;
3995
4012
3996
4013
/* set up gfx_hqd_vimd with 0x0 to indicate the ring buffer's vmid */
3997
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_VMID ) ;
4014
+ tmp = regCP_GFX_HQD_VMID_DEFAULT ;
3998
4015
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_VMID , VMID , 0 );
3999
4016
mqd -> cp_gfx_hqd_vmid = 0 ;
4000
4017
4001
4018
/* set up gfx queue priority */
4002
4019
gfx_v11_0_gfx_mqd_set_priority (adev , mqd , prop );
4003
4020
4004
4021
/* set up time quantum */
4005
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_QUANTUM ) ;
4022
+ tmp = regCP_GFX_HQD_QUANTUM_DEFAULT ;
4006
4023
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_QUANTUM , QUANTUM_EN , 1 );
4007
4024
mqd -> cp_gfx_hqd_quantum = tmp ;
4008
4025
@@ -4024,7 +4041,7 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
4024
4041
4025
4042
/* set up the gfx_hqd_control, similar as CP_RB0_CNTL */
4026
4043
rb_bufsz = order_base_2 (prop -> queue_size / 4 ) - 1 ;
4027
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_CNTL ) ;
4044
+ tmp = regCP_GFX_HQD_CNTL_DEFAULT ;
4028
4045
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_CNTL , RB_BUFSZ , rb_bufsz );
4029
4046
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_CNTL , RB_BLKSZ , rb_bufsz - 2 );
4030
4047
#ifdef __BIG_ENDIAN
@@ -4033,7 +4050,7 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
4033
4050
mqd -> cp_gfx_hqd_cntl = tmp ;
4034
4051
4035
4052
/* set up cp_doorbell_control */
4036
- tmp = RREG32_SOC15 ( GC , 0 , regCP_RB_DOORBELL_CONTROL ) ;
4053
+ tmp = regCP_RB_DOORBELL_CONTROL_DEFAULT ;
4037
4054
if (prop -> use_doorbell ) {
4038
4055
tmp = REG_SET_FIELD (tmp , CP_RB_DOORBELL_CONTROL ,
4039
4056
DOORBELL_OFFSET , prop -> doorbell_index );
@@ -4045,7 +4062,7 @@ static int gfx_v11_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
4045
4062
mqd -> cp_rb_doorbell_control = tmp ;
4046
4063
4047
4064
/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
4048
- mqd -> cp_gfx_hqd_rptr = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_RPTR ) ;
4065
+ mqd -> cp_gfx_hqd_rptr = regCP_GFX_HQD_RPTR_DEFAULT ;
4049
4066
4050
4067
/* active the queue */
4051
4068
mqd -> cp_gfx_hqd_active = 1 ;
@@ -4131,14 +4148,14 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
4131
4148
mqd -> cp_hqd_eop_base_addr_hi = upper_32_bits (eop_base_addr );
4132
4149
4133
4150
/* set the EOP size, register value is 2^(EOP_SIZE+1) dwords */
4134
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_EOP_CONTROL ) ;
4151
+ tmp = regCP_HQD_EOP_CONTROL_DEFAULT ;
4135
4152
tmp = REG_SET_FIELD (tmp , CP_HQD_EOP_CONTROL , EOP_SIZE ,
4136
4153
(order_base_2 (GFX11_MEC_HPD_SIZE / 4 ) - 1 ));
4137
4154
4138
4155
mqd -> cp_hqd_eop_control = tmp ;
4139
4156
4140
4157
/* enable doorbell? */
4141
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_PQ_DOORBELL_CONTROL ) ;
4158
+ tmp = regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT ;
4142
4159
4143
4160
if (prop -> use_doorbell ) {
4144
4161
tmp = REG_SET_FIELD (tmp , CP_HQD_PQ_DOORBELL_CONTROL ,
@@ -4167,7 +4184,7 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
4167
4184
mqd -> cp_mqd_base_addr_hi = upper_32_bits (prop -> mqd_gpu_addr );
4168
4185
4169
4186
/* set MQD vmid to 0 */
4170
- tmp = RREG32_SOC15 ( GC , 0 , regCP_MQD_CONTROL ) ;
4187
+ tmp = regCP_MQD_CONTROL_DEFAULT ;
4171
4188
tmp = REG_SET_FIELD (tmp , CP_MQD_CONTROL , VMID , 0 );
4172
4189
mqd -> cp_mqd_control = tmp ;
4173
4190
@@ -4177,7 +4194,7 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
4177
4194
mqd -> cp_hqd_pq_base_hi = upper_32_bits (hqd_gpu_addr );
4178
4195
4179
4196
/* set up the HQD, this is similar to CP_RB0_CNTL */
4180
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_PQ_CONTROL ) ;
4197
+ tmp = regCP_HQD_PQ_CONTROL_DEFAULT ;
4181
4198
tmp = REG_SET_FIELD (tmp , CP_HQD_PQ_CONTROL , QUEUE_SIZE ,
4182
4199
(order_base_2 (prop -> queue_size / 4 ) - 1 ));
4183
4200
tmp = REG_SET_FIELD (tmp , CP_HQD_PQ_CONTROL , RPTR_BLOCK_SIZE ,
@@ -4203,7 +4220,7 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
4203
4220
tmp = 0 ;
4204
4221
/* enable the doorbell if requested */
4205
4222
if (prop -> use_doorbell ) {
4206
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_PQ_DOORBELL_CONTROL ) ;
4223
+ tmp = regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT ;
4207
4224
tmp = REG_SET_FIELD (tmp , CP_HQD_PQ_DOORBELL_CONTROL ,
4208
4225
DOORBELL_OFFSET , prop -> doorbell_index );
4209
4226
@@ -4218,17 +4235,17 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
4218
4235
mqd -> cp_hqd_pq_doorbell_control = tmp ;
4219
4236
4220
4237
/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
4221
- mqd -> cp_hqd_pq_rptr = RREG32_SOC15 ( GC , 0 , regCP_HQD_PQ_RPTR ) ;
4238
+ mqd -> cp_hqd_pq_rptr = regCP_HQD_PQ_RPTR_DEFAULT ;
4222
4239
4223
4240
/* set the vmid for the queue */
4224
4241
mqd -> cp_hqd_vmid = 0 ;
4225
4242
4226
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_PERSISTENT_STATE ) ;
4243
+ tmp = regCP_HQD_PERSISTENT_STATE_DEFAULT ;
4227
4244
tmp = REG_SET_FIELD (tmp , CP_HQD_PERSISTENT_STATE , PRELOAD_SIZE , 0x55 );
4228
4245
mqd -> cp_hqd_persistent_state = tmp ;
4229
4246
4230
4247
/* set MIN_IB_AVAIL_SIZE */
4231
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_IB_CONTROL ) ;
4248
+ tmp = regCP_HQD_IB_CONTROL_DEFAULT ;
4232
4249
tmp = REG_SET_FIELD (tmp , CP_HQD_IB_CONTROL , MIN_IB_AVAIL_SIZE , 3 );
4233
4250
mqd -> cp_hqd_ib_control = tmp ;
4234
4251
0 commit comments