@@ -2962,8 +2962,6 @@ static void rtl_hw_start_8168e_2(struct rtl8169_private *tp)
2962
2962
RTL_W8 (tp , DLLPR , RTL_R8 (tp , DLLPR ) | PFM_EN );
2963
2963
RTL_W32 (tp , MISC , RTL_R32 (tp , MISC ) | PWM_EN );
2964
2964
rtl_mod_config5 (tp , Spi_en , 0 );
2965
-
2966
- rtl_hw_aspm_clkreq_enable (tp , true);
2967
2965
}
2968
2966
2969
2967
static void rtl_hw_start_8168f (struct rtl8169_private * tp )
@@ -3054,11 +3052,7 @@ static void rtl_hw_start_8168g_1(struct rtl8169_private *tp)
3054
3052
};
3055
3053
3056
3054
rtl_hw_start_8168g (tp );
3057
-
3058
- /* disable aspm and clock request before access ephy */
3059
- rtl_hw_aspm_clkreq_enable (tp , false);
3060
3055
rtl_ephy_init (tp , e_info_8168g_1 );
3061
- rtl_hw_aspm_clkreq_enable (tp , true);
3062
3056
}
3063
3057
3064
3058
static void rtl_hw_start_8168g_2 (struct rtl8169_private * tp )
@@ -3076,9 +3070,6 @@ static void rtl_hw_start_8168g_2(struct rtl8169_private *tp)
3076
3070
};
3077
3071
3078
3072
rtl_hw_start_8168g (tp );
3079
-
3080
- /* disable aspm and clock request before access ephy */
3081
- rtl_hw_aspm_clkreq_enable (tp , false);
3082
3073
rtl_ephy_init (tp , e_info_8168g_2 );
3083
3074
}
3084
3075
@@ -3099,8 +3090,6 @@ static void rtl_hw_start_8411_2(struct rtl8169_private *tp)
3099
3090
3100
3091
rtl_hw_start_8168g (tp );
3101
3092
3102
- /* disable aspm and clock request before access ephy */
3103
- rtl_hw_aspm_clkreq_enable (tp , false);
3104
3093
rtl_ephy_init (tp , e_info_8411_2 );
3105
3094
3106
3095
/* The following Realtek-provided magic fixes an issue with the RX unit
@@ -3238,8 +3227,6 @@ static void rtl_hw_start_8411_2(struct rtl8169_private *tp)
3238
3227
r8168_mac_ocp_write (tp , 0xFC32 , 0x0C25 );
3239
3228
r8168_mac_ocp_write (tp , 0xFC34 , 0x00A9 );
3240
3229
r8168_mac_ocp_write (tp , 0xFC36 , 0x012D );
3241
-
3242
- rtl_hw_aspm_clkreq_enable (tp , true);
3243
3230
}
3244
3231
3245
3232
static void rtl_hw_start_8168h_1 (struct rtl8169_private * tp )
@@ -3254,8 +3241,6 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
3254
3241
};
3255
3242
int rg_saw_cnt ;
3256
3243
3257
- /* disable aspm and clock request before access ephy */
3258
- rtl_hw_aspm_clkreq_enable (tp , false);
3259
3244
rtl_ephy_init (tp , e_info_8168h_1 );
3260
3245
3261
3246
rtl_set_fifo_size (tp , 0x08 , 0x10 , 0x02 , 0x06 );
@@ -3303,8 +3288,6 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
3303
3288
r8168_mac_ocp_write (tp , 0xe63e , 0x0000 );
3304
3289
r8168_mac_ocp_write (tp , 0xc094 , 0x0000 );
3305
3290
r8168_mac_ocp_write (tp , 0xc09e , 0x0000 );
3306
-
3307
- rtl_hw_aspm_clkreq_enable (tp , true);
3308
3291
}
3309
3292
3310
3293
static void rtl_hw_start_8168ep (struct rtl8169_private * tp )
@@ -3343,8 +3326,6 @@ static void rtl_hw_start_8168ep_3(struct rtl8169_private *tp)
3343
3326
{ 0x1e , 0x0000 , 0x2000 },
3344
3327
};
3345
3328
3346
- /* disable aspm and clock request before access ephy */
3347
- rtl_hw_aspm_clkreq_enable (tp , false);
3348
3329
rtl_ephy_init (tp , e_info_8168ep_3 );
3349
3330
3350
3331
rtl_hw_start_8168ep (tp );
@@ -3355,8 +3336,6 @@ static void rtl_hw_start_8168ep_3(struct rtl8169_private *tp)
3355
3336
r8168_mac_ocp_modify (tp , 0xd3e2 , 0x0fff , 0x0271 );
3356
3337
r8168_mac_ocp_modify (tp , 0xd3e4 , 0x00ff , 0x0000 );
3357
3338
r8168_mac_ocp_modify (tp , 0xe860 , 0x0000 , 0x0080 );
3358
-
3359
- rtl_hw_aspm_clkreq_enable (tp , true);
3360
3339
}
3361
3340
3362
3341
static void rtl_hw_start_8117 (struct rtl8169_private * tp )
@@ -3368,9 +3347,6 @@ static void rtl_hw_start_8117(struct rtl8169_private *tp)
3368
3347
int rg_saw_cnt ;
3369
3348
3370
3349
rtl8168ep_stop_cmac (tp );
3371
-
3372
- /* disable aspm and clock request before access ephy */
3373
- rtl_hw_aspm_clkreq_enable (tp , false);
3374
3350
rtl_ephy_init (tp , e_info_8117 );
3375
3351
3376
3352
rtl_set_fifo_size (tp , 0x08 , 0x10 , 0x02 , 0x06 );
@@ -3420,8 +3396,6 @@ static void rtl_hw_start_8117(struct rtl8169_private *tp)
3420
3396
3421
3397
/* firmware is for MAC only */
3422
3398
r8169_apply_firmware (tp );
3423
-
3424
- rtl_hw_aspm_clkreq_enable (tp , true);
3425
3399
}
3426
3400
3427
3401
static void rtl_hw_start_8102e_1 (struct rtl8169_private * tp )
@@ -3544,8 +3518,6 @@ static void rtl_hw_start_8402(struct rtl8169_private *tp)
3544
3518
3545
3519
static void rtl_hw_start_8106 (struct rtl8169_private * tp )
3546
3520
{
3547
- rtl_hw_aspm_clkreq_enable (tp , false);
3548
-
3549
3521
/* Force LAN exit from ASPM if Rx/Tx are not idle */
3550
3522
RTL_W32 (tp , FuncEvent , RTL_R32 (tp , FuncEvent ) | 0x002800 );
3551
3523
@@ -3562,7 +3534,6 @@ static void rtl_hw_start_8106(struct rtl8169_private *tp)
3562
3534
rtl_eri_write (tp , 0x1b0 , ERIAR_MASK_0011 , 0x0000 );
3563
3535
3564
3536
rtl_pcie_state_l2l3_disable (tp );
3565
- rtl_hw_aspm_clkreq_enable (tp , true);
3566
3537
}
3567
3538
3568
3539
DECLARE_RTL_COND (rtl_mac_ocp_e00e_cond )
@@ -3650,13 +3621,8 @@ static void rtl_hw_start_8125a_2(struct rtl8169_private *tp)
3650
3621
};
3651
3622
3652
3623
rtl_set_def_aspm_entry_latency (tp );
3653
-
3654
- /* disable aspm and clock request before access ephy */
3655
- rtl_hw_aspm_clkreq_enable (tp , false);
3656
3624
rtl_ephy_init (tp , e_info_8125a_2 );
3657
-
3658
3625
rtl_hw_start_8125_common (tp );
3659
- rtl_hw_aspm_clkreq_enable (tp , true);
3660
3626
}
3661
3627
3662
3628
static void rtl_hw_start_8125b (struct rtl8169_private * tp )
@@ -3671,12 +3637,8 @@ static void rtl_hw_start_8125b(struct rtl8169_private *tp)
3671
3637
};
3672
3638
3673
3639
rtl_set_def_aspm_entry_latency (tp );
3674
- rtl_hw_aspm_clkreq_enable (tp , false);
3675
-
3676
3640
rtl_ephy_init (tp , e_info_8125b );
3677
3641
rtl_hw_start_8125_common (tp );
3678
-
3679
- rtl_hw_aspm_clkreq_enable (tp , true);
3680
3642
}
3681
3643
3682
3644
static void rtl_hw_config (struct rtl8169_private * tp )
@@ -3772,7 +3734,8 @@ static void rtl_hw_start_8169(struct rtl8169_private *tp)
3772
3734
static void rtl_hw_start (struct rtl8169_private * tp )
3773
3735
{
3774
3736
rtl_unlock_config_regs (tp );
3775
-
3737
+ /* disable aspm and clock request before ephy access */
3738
+ rtl_hw_aspm_clkreq_enable (tp , false);
3776
3739
RTL_W16 (tp , CPlusCmd , tp -> cp_cmd );
3777
3740
3778
3741
if (tp -> mac_version <= RTL_GIGA_MAC_VER_06 )
@@ -3783,6 +3746,7 @@ static void rtl_hw_start(struct rtl8169_private *tp)
3783
3746
rtl_hw_start_8168 (tp );
3784
3747
3785
3748
rtl_enable_exit_l1 (tp );
3749
+ rtl_hw_aspm_clkreq_enable (tp , true);
3786
3750
rtl_set_rx_max_size (tp );
3787
3751
rtl_set_rx_tx_desc_registers (tp );
3788
3752
rtl_lock_config_regs (tp );
0 commit comments