Skip to content

Commit 9af771c

Browse files
minimaxwelldavem330
authored andcommitted
net: mvpp2: Fix clock resource by adding missing mg_core_clk
Marvell's PPv2.2 IP needs an additional clock named "MG Core clock". This is required on Armada 7K and 8K. This commit adds the required clock in mvpp2, making sure it's only used on PPv2.2. Fixes: c7e92de ("clk: mvebu: cp110: Fix clock tree representation") Signed-off-by: Maxime Chevallier <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 45f972a commit 9af771c

File tree

1 file changed

+17
-2
lines changed
  • drivers/net/ethernet/marvell

1 file changed

+17
-2
lines changed

drivers/net/ethernet/marvell/mvpp2.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ struct mvpp2 {
942942
struct clk *pp_clk;
943943
struct clk *gop_clk;
944944
struct clk *mg_clk;
945+
struct clk *mg_core_clk;
945946
struct clk *axi_clk;
946947

947948
/* List of pointers to port structures */
@@ -8768,18 +8769,27 @@ static int mvpp2_probe(struct platform_device *pdev)
87688769
err = clk_prepare_enable(priv->mg_clk);
87698770
if (err < 0)
87708771
goto err_gop_clk;
8772+
8773+
priv->mg_core_clk = devm_clk_get(&pdev->dev, "mg_core_clk");
8774+
if (IS_ERR(priv->mg_core_clk)) {
8775+
priv->mg_core_clk = NULL;
8776+
} else {
8777+
err = clk_prepare_enable(priv->mg_core_clk);
8778+
if (err < 0)
8779+
goto err_mg_clk;
8780+
}
87718781
}
87728782

87738783
priv->axi_clk = devm_clk_get(&pdev->dev, "axi_clk");
87748784
if (IS_ERR(priv->axi_clk)) {
87758785
err = PTR_ERR(priv->axi_clk);
87768786
if (err == -EPROBE_DEFER)
8777-
goto err_mg_clk;
8787+
goto err_mg_core_clk;
87788788
priv->axi_clk = NULL;
87798789
} else {
87808790
err = clk_prepare_enable(priv->axi_clk);
87818791
if (err < 0)
8782-
goto err_mg_clk;
8792+
goto err_mg_core_clk;
87838793
}
87848794

87858795
/* Get system's tclk rate */
@@ -8851,6 +8861,10 @@ static int mvpp2_probe(struct platform_device *pdev)
88518861
}
88528862
err_axi_clk:
88538863
clk_disable_unprepare(priv->axi_clk);
8864+
8865+
err_mg_core_clk:
8866+
if (priv->hw_version == MVPP22)
8867+
clk_disable_unprepare(priv->mg_core_clk);
88548868
err_mg_clk:
88558869
if (priv->hw_version == MVPP22)
88568870
clk_disable_unprepare(priv->mg_clk);
@@ -8898,6 +8912,7 @@ static int mvpp2_remove(struct platform_device *pdev)
88988912
return 0;
88998913

89008914
clk_disable_unprepare(priv->axi_clk);
8915+
clk_disable_unprepare(priv->mg_core_clk);
89018916
clk_disable_unprepare(priv->mg_clk);
89028917
clk_disable_unprepare(priv->pp_clk);
89038918
clk_disable_unprepare(priv->gop_clk);

0 commit comments

Comments
 (0)