50
50
51
51
#define RLCG_UCODE_LOADING_START_ADDRESS 0x00002000L
52
52
53
+ #define regCP_GFX_MQD_CONTROL_DEFAULT 0x00000100
54
+ #define regCP_GFX_HQD_VMID_DEFAULT 0x00000000
55
+ #define regCP_GFX_HQD_QUEUE_PRIORITY_DEFAULT 0x00000000
56
+ #define regCP_GFX_HQD_QUANTUM_DEFAULT 0x00000a01
57
+ #define regCP_GFX_HQD_CNTL_DEFAULT 0x00f00000
58
+ #define regCP_RB_DOORBELL_CONTROL_DEFAULT 0x00000000
59
+ #define regCP_GFX_HQD_RPTR_DEFAULT 0x00000000
60
+
61
+ #define regCP_HQD_EOP_CONTROL_DEFAULT 0x00000006
62
+ #define regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT 0x00000000
63
+ #define regCP_MQD_CONTROL_DEFAULT 0x00000100
64
+ #define regCP_HQD_PQ_CONTROL_DEFAULT 0x00308509
65
+ #define regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT 0x00000000
66
+ #define regCP_HQD_PQ_RPTR_DEFAULT 0x00000000
67
+ #define regCP_HQD_PERSISTENT_STATE_DEFAULT 0x0be05501
68
+ #define regCP_HQD_IB_CONTROL_DEFAULT 0x00300000
69
+
70
+
53
71
MODULE_FIRMWARE ("amdgpu/gc_12_0_0_pfp.bin" );
54
72
MODULE_FIRMWARE ("amdgpu/gc_12_0_0_me.bin" );
55
73
MODULE_FIRMWARE ("amdgpu/gc_12_0_0_mec.bin" );
@@ -2891,25 +2909,25 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
2891
2909
mqd -> cp_mqd_base_addr_hi = upper_32_bits (prop -> mqd_gpu_addr );
2892
2910
2893
2911
/* set up mqd control */
2894
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_MQD_CONTROL ) ;
2912
+ tmp = regCP_GFX_MQD_CONTROL_DEFAULT ;
2895
2913
tmp = REG_SET_FIELD (tmp , CP_GFX_MQD_CONTROL , VMID , 0 );
2896
2914
tmp = REG_SET_FIELD (tmp , CP_GFX_MQD_CONTROL , PRIV_STATE , 1 );
2897
2915
tmp = REG_SET_FIELD (tmp , CP_GFX_MQD_CONTROL , CACHE_POLICY , 0 );
2898
2916
mqd -> cp_gfx_mqd_control = tmp ;
2899
2917
2900
2918
/* set up gfx_hqd_vimd with 0x0 to indicate the ring buffer's vmid */
2901
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_VMID ) ;
2919
+ tmp = regCP_GFX_HQD_VMID_DEFAULT ;
2902
2920
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_VMID , VMID , 0 );
2903
2921
mqd -> cp_gfx_hqd_vmid = 0 ;
2904
2922
2905
2923
/* set up default queue priority level
2906
2924
* 0x0 = low priority, 0x1 = high priority */
2907
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_QUEUE_PRIORITY ) ;
2925
+ tmp = regCP_GFX_HQD_QUEUE_PRIORITY_DEFAULT ;
2908
2926
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_QUEUE_PRIORITY , PRIORITY_LEVEL , 0 );
2909
2927
mqd -> cp_gfx_hqd_queue_priority = tmp ;
2910
2928
2911
2929
/* set up time quantum */
2912
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_QUANTUM ) ;
2930
+ tmp = regCP_GFX_HQD_QUANTUM_DEFAULT ;
2913
2931
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_QUANTUM , QUANTUM_EN , 1 );
2914
2932
mqd -> cp_gfx_hqd_quantum = tmp ;
2915
2933
@@ -2931,7 +2949,7 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
2931
2949
2932
2950
/* set up the gfx_hqd_control, similar as CP_RB0_CNTL */
2933
2951
rb_bufsz = order_base_2 (prop -> queue_size / 4 ) - 1 ;
2934
- tmp = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_CNTL ) ;
2952
+ tmp = regCP_GFX_HQD_CNTL_DEFAULT ;
2935
2953
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_CNTL , RB_BUFSZ , rb_bufsz );
2936
2954
tmp = REG_SET_FIELD (tmp , CP_GFX_HQD_CNTL , RB_BLKSZ , rb_bufsz - 2 );
2937
2955
#ifdef __BIG_ENDIAN
@@ -2940,7 +2958,7 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
2940
2958
mqd -> cp_gfx_hqd_cntl = tmp ;
2941
2959
2942
2960
/* set up cp_doorbell_control */
2943
- tmp = RREG32_SOC15 ( GC , 0 , regCP_RB_DOORBELL_CONTROL ) ;
2961
+ tmp = regCP_RB_DOORBELL_CONTROL_DEFAULT ;
2944
2962
if (prop -> use_doorbell ) {
2945
2963
tmp = REG_SET_FIELD (tmp , CP_RB_DOORBELL_CONTROL ,
2946
2964
DOORBELL_OFFSET , prop -> doorbell_index );
@@ -2952,7 +2970,7 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
2952
2970
mqd -> cp_rb_doorbell_control = tmp ;
2953
2971
2954
2972
/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
2955
- mqd -> cp_gfx_hqd_rptr = RREG32_SOC15 ( GC , 0 , regCP_GFX_HQD_RPTR ) ;
2973
+ mqd -> cp_gfx_hqd_rptr = regCP_GFX_HQD_RPTR_DEFAULT ;
2956
2974
2957
2975
/* active the queue */
2958
2976
mqd -> cp_gfx_hqd_active = 1 ;
@@ -3047,14 +3065,14 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
3047
3065
mqd -> cp_hqd_eop_base_addr_hi = upper_32_bits (eop_base_addr );
3048
3066
3049
3067
/* set the EOP size, register value is 2^(EOP_SIZE+1) dwords */
3050
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_EOP_CONTROL ) ;
3068
+ tmp = regCP_HQD_EOP_CONTROL_DEFAULT ;
3051
3069
tmp = REG_SET_FIELD (tmp , CP_HQD_EOP_CONTROL , EOP_SIZE ,
3052
3070
(order_base_2 (GFX12_MEC_HPD_SIZE / 4 ) - 1 ));
3053
3071
3054
3072
mqd -> cp_hqd_eop_control = tmp ;
3055
3073
3056
3074
/* enable doorbell? */
3057
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_PQ_DOORBELL_CONTROL ) ;
3075
+ tmp = regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT ;
3058
3076
3059
3077
if (prop -> use_doorbell ) {
3060
3078
tmp = REG_SET_FIELD (tmp , CP_HQD_PQ_DOORBELL_CONTROL ,
@@ -3083,7 +3101,7 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
3083
3101
mqd -> cp_mqd_base_addr_hi = upper_32_bits (prop -> mqd_gpu_addr );
3084
3102
3085
3103
/* set MQD vmid to 0 */
3086
- tmp = RREG32_SOC15 ( GC , 0 , regCP_MQD_CONTROL ) ;
3104
+ tmp = regCP_MQD_CONTROL_DEFAULT ;
3087
3105
tmp = REG_SET_FIELD (tmp , CP_MQD_CONTROL , VMID , 0 );
3088
3106
mqd -> cp_mqd_control = tmp ;
3089
3107
@@ -3093,7 +3111,7 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
3093
3111
mqd -> cp_hqd_pq_base_hi = upper_32_bits (hqd_gpu_addr );
3094
3112
3095
3113
/* set up the HQD, this is similar to CP_RB0_CNTL */
3096
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_PQ_CONTROL ) ;
3114
+ tmp = regCP_HQD_PQ_CONTROL_DEFAULT ;
3097
3115
tmp = REG_SET_FIELD (tmp , CP_HQD_PQ_CONTROL , QUEUE_SIZE ,
3098
3116
(order_base_2 (prop -> queue_size / 4 ) - 1 ));
3099
3117
tmp = REG_SET_FIELD (tmp , CP_HQD_PQ_CONTROL , RPTR_BLOCK_SIZE ,
@@ -3118,7 +3136,7 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
3118
3136
tmp = 0 ;
3119
3137
/* enable the doorbell if requested */
3120
3138
if (prop -> use_doorbell ) {
3121
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_PQ_DOORBELL_CONTROL ) ;
3139
+ tmp = regCP_HQD_PQ_DOORBELL_CONTROL_DEFAULT ;
3122
3140
tmp = REG_SET_FIELD (tmp , CP_HQD_PQ_DOORBELL_CONTROL ,
3123
3141
DOORBELL_OFFSET , prop -> doorbell_index );
3124
3142
@@ -3133,17 +3151,17 @@ static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
3133
3151
mqd -> cp_hqd_pq_doorbell_control = tmp ;
3134
3152
3135
3153
/* reset read and write pointers, similar to CP_RB0_WPTR/_RPTR */
3136
- mqd -> cp_hqd_pq_rptr = RREG32_SOC15 ( GC , 0 , regCP_HQD_PQ_RPTR ) ;
3154
+ mqd -> cp_hqd_pq_rptr = regCP_HQD_PQ_RPTR_DEFAULT ;
3137
3155
3138
3156
/* set the vmid for the queue */
3139
3157
mqd -> cp_hqd_vmid = 0 ;
3140
3158
3141
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_PERSISTENT_STATE ) ;
3159
+ tmp = regCP_HQD_PERSISTENT_STATE_DEFAULT ;
3142
3160
tmp = REG_SET_FIELD (tmp , CP_HQD_PERSISTENT_STATE , PRELOAD_SIZE , 0x55 );
3143
3161
mqd -> cp_hqd_persistent_state = tmp ;
3144
3162
3145
3163
/* set MIN_IB_AVAIL_SIZE */
3146
- tmp = RREG32_SOC15 ( GC , 0 , regCP_HQD_IB_CONTROL ) ;
3164
+ tmp = regCP_HQD_IB_CONTROL_DEFAULT ;
3147
3165
tmp = REG_SET_FIELD (tmp , CP_HQD_IB_CONTROL , MIN_IB_AVAIL_SIZE , 3 );
3148
3166
mqd -> cp_hqd_ib_control = tmp ;
3149
3167
0 commit comments