net: ethernet: stmmac: cleanup clock and optimization
Subsystems (5)
v4 cover net: ethernet: stmmac: cleanup clock and optimization
Some improvements:
- manage syscfg as optional clock,
- update slew rate of ETH_MDIO pin,
- Enable gating of the MAC TX clock during TX low-power mode
V4: Update with Andrew Lunn remark
Christophe Roullier (4):
net: ethernet: stmmac: Add support for syscfg clock
ARM: dts: stm32: remove syscfg clock on stm32mp157c ethernet
ARM: dts: stm32: adjust slew rate for Ethernet
ARM: dts: stm32: Enable gating of the MAC TX clock during TX low-power
mode on stm32mp157c
arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 9 ++++++-- arch/arm/boot/dts/stm32mp157c.dtsi | 7 +++--- .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 23 +++++++------------ 3 files changed, 18 insertions(+), 21 deletions(-)
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 1/4 net: ethernet: stmmac: Add support for syscfg clock
Add optional support for syscfg clock in dwmac-stm32.c Now Syscfg clock is activated automatically when syscfg registers are used
--- .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +8 -15
@@ -155,18 +155,14 @@ static int stm32mp1_clk_prepare(struct stm32_dwmac *dwmac, bool prepare) ret =clk_prepare_enable (dwmac->syscfg_clk);if (ret)return ret; - -if (dwmac->clk_eth_ck) { - ret =clk_prepare_enable (dwmac->clk_eth_ck); -if (ret) { -clk_disable_unprepare (dwmac->syscfg_clk); + ret =clk_prepare_enable (dwmac->clk_eth_ck); +if (ret) { +clk_disable_unprepare (dwmac->syscfg_clk);return ret; - } } }else {clk_disable_unprepare (dwmac->syscfg_clk); -if (dwmac->clk_eth_ck) -clk_disable_unprepare (dwmac->clk_eth_ck); +clk_disable_unprepare (dwmac->clk_eth_ck); }return ret; }
@@ -320,12 +316,10 @@ static int stm32mp1_parse_data(struct stm32_dwmac *dwmac,return PTR_ERR (dwmac->clk_ethstp); } -/* Clock for sysconfig */ +/* Optional Clock for sysconfig */ dwmac->syscfg_clk =devm_clk_get (dev,"syscfg-clk" ); -if (IS_ERR (dwmac->syscfg_clk)) { -dev_err (dev,"No syscfg clock provided...\n" ); -return PTR_ERR (dwmac->syscfg_clk); - } +if (IS_ERR (dwmac->syscfg_clk)) + dwmac->syscfg_clk =NULL ;/* Get IRQ information early to have an ability to ask for deferred * probe if needed before we went too far with resource allocation.
@@ -437,8 +431,7 @@ static int stm32mp1_suspend(struct stm32_dwmac *dwmac)clk_disable_unprepare (dwmac->clk_tx);clk_disable_unprepare (dwmac->syscfg_clk); -if (dwmac->clk_eth_ck) -clk_disable_unprepare (dwmac->clk_eth_ck); +clk_disable_unprepare (dwmac->clk_eth_ck);return ret; }
Signature · 1 line
2.17.1
Re: [PATCH V4 net-next 1/4] net: ethernet: stmmac: Add support for syscfg clock
Quoted 5 lines · Christophe Roullier
Add optional support for syscfg clock in
dwmac-stm32.cNow Syscfg clock is activated automatically when syscfg registers are usedSigned-off-by Christophe Roullier <[email protected]>
Andrew
Re: [PATCH V4 net-next 1/4] net: ethernet: stmmac: Add support for syscfg clock
In reply to Christophe RoullierFrom: Christophe Roullier <[email protected]>
Date: Thu, 7 Nov 2019 09:47:54 +0100
Quoted 5 lines
Add optional support for syscfg clock in
dwmac-stm32.cNow Syscfg clock is activated automatically when syscfg registers are usedSigned-off-by Christophe Roullier <[email protected]>
Applied to net-next, thanks.
PATCH v4 2/4 ARM: dts: stm32: remove syscfg clock on stm32mp157c ethernet
In reply to Christophe RoullierSyscfg is now activated automatically when syscfg registers are used
--- arch/arm/boot/dts/stm32mp157c.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/arm/boot/dts/stm32mp157c.dtsi +2 -4
@@ -1326,13 +1326,11 @@ clock-names = "stmmaceth", "mac-clk-tx", "mac-clk-rx", - "ethstp", - "syscfg-clk"; + "ethstp"; clocks = <&rcc ETHMAC>, <&rcc ETHTX>, <&rcc ETHRX>, - <&rcc ETHSTP>, - <&rcc SYSCFG>; + <&rcc ETHSTP>; st,syscon = <&syscfg 0x4>; snps,mixed-burst; snps,pbl = <2>;
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v4 3/4 ARM: dts: stm32: adjust slew rate for Ethernet
In reply to Christophe RoullierETH_MDIO slew-rate should be set to "0" instead of "2"
--- arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
arch/arm/boot/dts/stm32mp157-pinctrl.dtsi +7 -2
@@ -217,13 +217,18 @@ <STM32_PINMUX('C', 2, AF11)>, /* ETH_RGMII_TXD2 */ <STM32_PINMUX('E', 2, AF11)>, /* ETH_RGMII_TXD3 */ <STM32_PINMUX('B', 11, AF11)>, /* ETH_RGMII_TX_CTL */ - <STM32_PINMUX('A', 2, AF11)>, /* ETH_MDIO */ <STM32_PINMUX('C', 1, AF11)>; /* ETH_MDC */ bias-disable; drive-push-pull; - slew-rate = <3>; + slew-rate = <2>; }; pins2 { + pinmux = <STM32_PINMUX('A', 2, AF11)>; /* ETH_MDIO */ + bias-disable; + drive-push-pull; + slew-rate = <0>; + }; + pins3 { pinmux = <STM32_PINMUX('C', 4, AF11)>, /* ETH_RGMII_RXD0 */ <STM32_PINMUX('C', 5, AF11)>, /* ETH_RGMII_RXD1 */ <STM32_PINMUX('B', 0, AF11)>, /* ETH_RGMII_RXD2 */
Signature · 1 line
2.17.1
PATCH v4 4/4 ARM: dts: stm32: Enable gating of the MAC TX clock during TX low-power mode on stm32mp157c
In reply to Christophe RoullierWhen there is no activity on ethernet phy link, the ETH_GTX_CLK is cut
--- arch/arm/boot/dts/stm32mp157c.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/stm32mp157c.dtsi +1 -0
@@ -1334,6 +1334,7 @@ st,syscon = <&syscfg 0x4>; snps,mixed-burst; snps,pbl = <2>; + snps,en-tx-lpi-clockgating; snps,axi-config = <&stmmac_axi_config_0>; snps,tso; status = "disabled";
Signature · 1 line
2.17.1
David Miller
maintainerFrom: Christophe Roullier <[email protected]>
Date: Thu, 7 Nov 2019 09:47:53 +0100
Quoted 6 lines
Some improvements:
- manage syscfg as optional clock,
- update slew rate ofETH_MDIOpin,
- Enable gating of the MAC TX clock during TX low-power modeV4: Update with Andrew Lunn remark
This is mostly ARM DT updates, which tree should this go through?
I don't want to step on toes this time :-)
Hi David
Quoted 8 lines · David Miller
From: Christophe Roullier <[email protected]>
Date: Thu, 7 Nov 2019 09:47:53 +0100Quoted 5 lines
Some improvements:
- manage syscfg as optional clock,
- update slew rate ofETH_MDIOpin,
- Enable gating of the MAC TX clock during TX low-power mode
Quoted 6 lines
Quoted 1 line
V4: Update with Andrew Lunn remark
This is mostly ARM DT updates, which tree should this go through?
I don't want to step on toes this time :-)
I'll take DT patches in my STM32 tree.
Thanks
Alex
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
David Miller
maintainerFrom: Alexandre Torgue <[email protected]>
Date: Fri, 8 Nov 2019 11:35:23 +0100
Quoted 11 lines
Hi David
Quoted 8 lines · David Miller
From: Christophe Roullier <[email protected]>
Date: Thu, 7 Nov 2019 09:47:53 +0100Quoted 5 lines
Some improvements:
- manage syscfg as optional clock,
- update slew rate ofETH_MDIOpin,
- Enable gating of the MAC TX clock during TX low-power mode
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
V4: Update with Andrew Lunn remark
This is mostly ARM DT updates, which tree should this go through? I don't want to step on toes this time :-)
I'll take DT patches in my STM32 tree.
Ok, I took patch #1 into net-next.
Hi Christophe
Quoted 12 lines · Christophe Roullier
Some improvements:
- manage syscfg as optional clock,
- update slew rate ofETH_MDIOpin,
- Enable gating of the MAC TX clock during TX low-power modeV4: Update with Andrew Lunn remark
Christophe Roullier (4):
net: ethernet: stmmac: Add support for syscfg clock
ARM: dts: stm32: remove syscfg clock on stm32mp157c ethernet
ARM: dts: stm32: adjust slew rate for Ethernet
ARM: dts: stm32: Enable gating of the MAC TX clock during TX low-power
Quoted 7 lines
mode on stm32mp157carch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 9 ++++++-- arch/arm/boot/dts/stm32mp157c.dtsi | 7 +++--- .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 23 +++++++------------ 3 files changed, 18 insertions(+), 21 deletions(-)
For DT patches:
Applied on stm32-next.
Thanks.
Alex
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel