@@ -2956,16 +2956,6 @@ icl_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
2956
2956
return pll ;
2957
2957
}
2958
2958
2959
- static i915_reg_t icl_pll_id_to_enable_reg (enum intel_dpll_id id )
2960
- {
2961
- if (intel_dpll_is_combophy (id ))
2962
- return CNL_DPLL_ENABLE (id );
2963
- else if (id == DPLL_ID_ICL_TBTPLL )
2964
- return TBT_PLL_ENABLE ;
2965
-
2966
- return MG_PLL_ENABLE (icl_pll_id_to_tc_port (id ));
2967
- }
2968
-
2969
2959
static bool mg_pll_get_hw_state (struct drm_i915_private * dev_priv ,
2970
2960
struct intel_shared_dpll * pll ,
2971
2961
struct intel_dpll_hw_state * hw_state )
@@ -3030,7 +3020,8 @@ static bool mg_pll_get_hw_state(struct drm_i915_private *dev_priv,
3030
3020
3031
3021
static bool icl_pll_get_hw_state (struct drm_i915_private * dev_priv ,
3032
3022
struct intel_shared_dpll * pll ,
3033
- struct intel_dpll_hw_state * hw_state )
3023
+ struct intel_dpll_hw_state * hw_state ,
3024
+ i915_reg_t enable_reg )
3034
3025
{
3035
3026
const enum intel_dpll_id id = pll -> info -> id ;
3036
3027
intel_wakeref_t wakeref ;
@@ -3042,7 +3033,7 @@ static bool icl_pll_get_hw_state(struct drm_i915_private *dev_priv,
3042
3033
if (!wakeref )
3043
3034
return false;
3044
3035
3045
- val = I915_READ (icl_pll_id_to_enable_reg ( id ) );
3036
+ val = I915_READ (enable_reg );
3046
3037
if (!(val & PLL_ENABLE ))
3047
3038
goto out ;
3048
3039
@@ -3055,6 +3046,21 @@ static bool icl_pll_get_hw_state(struct drm_i915_private *dev_priv,
3055
3046
return ret ;
3056
3047
}
3057
3048
3049
+ static bool combo_pll_get_hw_state (struct drm_i915_private * dev_priv ,
3050
+ struct intel_shared_dpll * pll ,
3051
+ struct intel_dpll_hw_state * hw_state )
3052
+ {
3053
+ return icl_pll_get_hw_state (dev_priv , pll , hw_state ,
3054
+ CNL_DPLL_ENABLE (pll -> info -> id ));
3055
+ }
3056
+
3057
+ static bool tbt_pll_get_hw_state (struct drm_i915_private * dev_priv ,
3058
+ struct intel_shared_dpll * pll ,
3059
+ struct intel_dpll_hw_state * hw_state )
3060
+ {
3061
+ return icl_pll_get_hw_state (dev_priv , pll , hw_state , TBT_PLL_ENABLE );
3062
+ }
3063
+
3058
3064
static void icl_dpll_write (struct drm_i915_private * dev_priv ,
3059
3065
struct intel_shared_dpll * pll )
3060
3066
{
@@ -3154,7 +3160,7 @@ static void icl_pll_enable(struct drm_i915_private *dev_priv,
3154
3160
static void combo_pll_enable (struct drm_i915_private * dev_priv ,
3155
3161
struct intel_shared_dpll * pll )
3156
3162
{
3157
- i915_reg_t enable_reg = icl_pll_id_to_enable_reg (pll -> info -> id );
3163
+ i915_reg_t enable_reg = CNL_DPLL_ENABLE (pll -> info -> id );
3158
3164
3159
3165
icl_pll_power_enable (dev_priv , pll , enable_reg );
3160
3166
@@ -3171,6 +3177,24 @@ static void combo_pll_enable(struct drm_i915_private *dev_priv,
3171
3177
/* DVFS post sequence would be here. See the comment above. */
3172
3178
}
3173
3179
3180
+ static void tbt_pll_enable (struct drm_i915_private * dev_priv ,
3181
+ struct intel_shared_dpll * pll )
3182
+ {
3183
+ icl_pll_power_enable (dev_priv , pll , TBT_PLL_ENABLE );
3184
+
3185
+ icl_dpll_write (dev_priv , pll );
3186
+
3187
+ /*
3188
+ * DVFS pre sequence would be here, but in our driver the cdclk code
3189
+ * paths should already be setting the appropriate voltage, hence we do
3190
+ * nothing here.
3191
+ */
3192
+
3193
+ icl_pll_enable (dev_priv , pll , TBT_PLL_ENABLE );
3194
+
3195
+ /* DVFS post sequence would be here. See the comment above. */
3196
+ }
3197
+
3174
3198
static void mg_pll_enable (struct drm_i915_private * dev_priv ,
3175
3199
struct intel_shared_dpll * pll )
3176
3200
{
@@ -3232,9 +3256,13 @@ static void icl_pll_disable(struct drm_i915_private *dev_priv,
3232
3256
static void combo_pll_disable (struct drm_i915_private * dev_priv ,
3233
3257
struct intel_shared_dpll * pll )
3234
3258
{
3235
- i915_reg_t enable_reg = icl_pll_id_to_enable_reg (pll -> info -> id );
3259
+ icl_pll_disable (dev_priv , pll , CNL_DPLL_ENABLE (pll -> info -> id ));
3260
+ }
3236
3261
3237
- icl_pll_disable (dev_priv , pll , enable_reg );
3262
+ static void tbt_pll_disable (struct drm_i915_private * dev_priv ,
3263
+ struct intel_shared_dpll * pll )
3264
+ {
3265
+ icl_pll_disable (dev_priv , pll , TBT_PLL_ENABLE );
3238
3266
}
3239
3267
3240
3268
static void mg_pll_disable (struct drm_i915_private * dev_priv ,
@@ -3268,10 +3296,16 @@ static void icl_dump_hw_state(struct drm_i915_private *dev_priv,
3268
3296
hw_state -> mg_pll_tdc_coldst_bias );
3269
3297
}
3270
3298
3271
- static const struct intel_shared_dpll_funcs icl_pll_funcs = {
3299
+ static const struct intel_shared_dpll_funcs combo_pll_funcs = {
3272
3300
.enable = combo_pll_enable ,
3273
3301
.disable = combo_pll_disable ,
3274
- .get_hw_state = icl_pll_get_hw_state ,
3302
+ .get_hw_state = combo_pll_get_hw_state ,
3303
+ };
3304
+
3305
+ static const struct intel_shared_dpll_funcs tbt_pll_funcs = {
3306
+ .enable = tbt_pll_enable ,
3307
+ .disable = tbt_pll_disable ,
3308
+ .get_hw_state = tbt_pll_get_hw_state ,
3275
3309
};
3276
3310
3277
3311
static const struct intel_shared_dpll_funcs mg_pll_funcs = {
@@ -3281,9 +3315,9 @@ static const struct intel_shared_dpll_funcs mg_pll_funcs = {
3281
3315
};
3282
3316
3283
3317
static const struct dpll_info icl_plls [] = {
3284
- { "DPLL 0" , & icl_pll_funcs , DPLL_ID_ICL_DPLL0 , 0 },
3285
- { "DPLL 1" , & icl_pll_funcs , DPLL_ID_ICL_DPLL1 , 0 },
3286
- { "TBT PLL" , & icl_pll_funcs , DPLL_ID_ICL_TBTPLL , 0 },
3318
+ { "DPLL 0" , & combo_pll_funcs , DPLL_ID_ICL_DPLL0 , 0 },
3319
+ { "DPLL 1" , & combo_pll_funcs , DPLL_ID_ICL_DPLL1 , 0 },
3320
+ { "TBT PLL" , & tbt_pll_funcs , DPLL_ID_ICL_TBTPLL , 0 },
3287
3321
{ "MG PLL 1" , & mg_pll_funcs , DPLL_ID_ICL_MGPLL1 , 0 },
3288
3322
{ "MG PLL 2" , & mg_pll_funcs , DPLL_ID_ICL_MGPLL2 , 0 },
3289
3323
{ "MG PLL 3" , & mg_pll_funcs , DPLL_ID_ICL_MGPLL3 , 0 },
0 commit comments