drm/amdgpu: Retire pcie_gen3_enable function
authorHawking Zhang <Hawking.Zhang@amd.com>
Mon, 6 Mar 2023 11:34:34 +0000 (19:34 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 15 Mar 2023 22:45:27 +0000 (18:45 -0400)
Not needed since from vi. drop the function so
we don't duplicate code when introduce new asics.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/nv.c
drivers/gpu/drm/amd/amdgpu/soc15.c
drivers/gpu/drm/amd/amdgpu/soc21.c
drivers/gpu/drm/amd/amdgpu/vi.c

index f158e17..15f3c67 100644 (file)
@@ -520,21 +520,6 @@ static int nv_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk)
        return 0;
 }
 
-static void nv_pcie_gen3_enable(struct amdgpu_device *adev)
-{
-       if (pci_is_root_bus(adev->pdev->bus))
-               return;
-
-       if (amdgpu_pcie_gen2 == 0)
-               return;
-
-       if (!(adev->pm.pcie_gen_mask & (CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 |
-                                       CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)))
-               return;
-
-       /* todo */
-}
-
 static void nv_program_aspm(struct amdgpu_device *adev)
 {
        if (!amdgpu_device_should_use_aspm(adev))
@@ -1042,8 +1027,6 @@ static int nv_common_hw_init(void *handle)
        if (adev->nbio.funcs->apply_l1_link_width_reconfig_wa)
                adev->nbio.funcs->apply_l1_link_width_reconfig_wa(adev);
 
-       /* enable pcie gen2/3 link */
-       nv_pcie_gen3_enable(adev);
        /* enable aspm */
        nv_program_aspm(adev);
        /* setup nbio registers */
index 4954163..7d04c39 100644 (file)
@@ -610,24 +610,6 @@ static int soc15_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk
        return 0;
 }
 
-static void soc15_pcie_gen3_enable(struct amdgpu_device *adev)
-{
-       if (pci_is_root_bus(adev->pdev->bus))
-               return;
-
-       if (amdgpu_pcie_gen2 == 0)
-               return;
-
-       if (adev->flags & AMD_IS_APU)
-               return;
-
-       if (!(adev->pm.pcie_gen_mask & (CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 |
-                                       CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)))
-               return;
-
-       /* todo */
-}
-
 static void soc15_program_aspm(struct amdgpu_device *adev)
 {
        if (!amdgpu_device_should_use_aspm(adev))
@@ -1184,8 +1166,6 @@ static int soc15_common_hw_init(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-       /* enable pcie gen2/3 link */
-       soc15_pcie_gen3_enable(adev);
        /* enable aspm */
        soc15_program_aspm(adev);
        /* setup nbio registers */
index b3a33ea..6758076 100644 (file)
@@ -440,21 +440,6 @@ static int soc21_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk
        return 0;
 }
 
-static void soc21_pcie_gen3_enable(struct amdgpu_device *adev)
-{
-       if (pci_is_root_bus(adev->pdev->bus))
-               return;
-
-       if (amdgpu_pcie_gen2 == 0)
-               return;
-
-       if (!(adev->pm.pcie_gen_mask & (CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 |
-                                       CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)))
-               return;
-
-       /* todo */
-}
-
 static void soc21_program_aspm(struct amdgpu_device *adev)
 {
        if (!amdgpu_device_should_use_aspm(adev))
@@ -793,8 +778,6 @@ static int soc21_common_hw_init(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-       /* enable pcie gen2/3 link */
-       soc21_pcie_gen3_enable(adev);
        /* enable aspm */
        soc21_program_aspm(adev);
        /* setup nbio registers */
index 12ef782..2512b70 100644 (file)
@@ -1105,24 +1105,6 @@ static int vi_set_vce_clocks(struct amdgpu_device *adev, u32 evclk, u32 ecclk)
        return 0;
 }
 
-static void vi_pcie_gen3_enable(struct amdgpu_device *adev)
-{
-       if (pci_is_root_bus(adev->pdev->bus))
-               return;
-
-       if (amdgpu_pcie_gen2 == 0)
-               return;
-
-       if (adev->flags & AMD_IS_APU)
-               return;
-
-       if (!(adev->pm.pcie_gen_mask & (CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 |
-                                       CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3)))
-               return;
-
-       /* todo */
-}
-
 static void vi_enable_aspm(struct amdgpu_device *adev)
 {
        u32 data, orig;
@@ -1743,8 +1725,6 @@ static int vi_common_hw_init(void *handle)
 
        /* move the golden regs per IP block */
        vi_init_golden_registers(adev);
-       /* enable pcie gen2/3 link */
-       vi_pcie_gen3_enable(adev);
        /* enable aspm */
        vi_program_aspm(adev);
        /* enable the doorbell aperture */