[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201214091616.13545-26-Sergey.Semin@baikalelectronics.ru>
Date: Mon, 14 Dec 2020 12:16:15 +0300
From: Serge Semin <Sergey.Semin@...kalelectronics.ru>
To: Rob Herring <robh+dt@...nel.org>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...com>,
Jose Abreu <joabreu@...opsys.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Johan Hovold <johan@...nel.org>,
Maxime Ripard <mripard@...nel.org>,
Joao Pinto <jpinto@...opsys.com>,
Lars Persson <larper@...s.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>
CC: Serge Semin <Sergey.Semin@...kalelectronics.ru>,
Serge Semin <fancer.lancer@...il.com>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
Vyacheslav Mitrofanov
<Vyacheslav.Mitrofanov@...kalelectronics.ru>,
<netdev@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH 25/25] net: stmmac: dwc-qos: Save master/slave clocks in the plat-data
Currently the "master_bus" clock of the DW QoS Eth controller isn't
preserved in the STMMAC platform data, while the "slave_bus" clock is
assigned to the stmmaceth clock pointer. It isn't correct from the
platform clock bindings point of view. The "stmmaceth" clock is supposed
to be the system clock, which is responsible for clocking the DMA
transfers from/to the controller FIFOs to/from the system memory and the
CSR interface if the later isn't separately clocked. If it's clocked
separately then the STMMAC platform code expects to also have "pclk"
specified. So in order to have the STMMAC platform data properly
initialized we need to set the "master_bus" clock handler to the
"stmmaceth" clock pointer, and the "slave_bus" clock handler to the "pclk"
clock pointer.
Signed-off-by: Serge Semin <Sergey.Semin@...kalelectronics.ru>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
index f53a78448988..b90d7e4c3d4a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
@@ -315,6 +315,8 @@ static void *tegra_eqos_probe(struct platform_device *pdev,
if (err < 0)
goto error;
+ data->stmmac_clk = eqos->clk_master;
+
eqos->clk_slave = devm_clk_get(&pdev->dev, "slave_bus");
if (IS_ERR(eqos->clk_slave)) {
err = PTR_ERR(eqos->clk_slave);
@@ -325,7 +327,7 @@ static void *tegra_eqos_probe(struct platform_device *pdev,
if (err < 0)
goto disable_master;
- data->stmmac_clk = eqos->clk_slave;
+ data->pclk = eqos->clk_slave;
eqos->reset = devm_gpiod_get(&pdev->dev, "phy-reset", GPIOD_OUT_HIGH);
if (IS_ERR(eqos->reset)) {
@@ -375,9 +377,10 @@ static void *tegra_eqos_probe(struct platform_device *pdev,
gpiod_set_value(eqos->reset, 1);
disable_slave:
clk_disable_unprepare(eqos->clk_slave);
- data->stmmac_clk = NULL;
+ data->pclk = NULL;
disable_master:
clk_disable_unprepare(eqos->clk_master);
+ data->stmmac_clk = NULL;
error:
eqos = ERR_PTR(err);
goto out;
@@ -397,6 +400,7 @@ static int tegra_eqos_remove(struct platform_device *pdev)
* data so the stmmac_remove_config_dt() method wouldn't have disabled
* the clocks too.
*/
+ priv->plat->pclk = NULL;
priv->plat->stmmac_clk = NULL;
return 0;
--
2.29.2
Powered by blists - more mailing lists