public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/2] net: xilinx_gmii2rgmii: Add clock support
@ 2024-05-28  6:20 Vineeth Karumanchi
  2024-05-28  6:20 ` [PATCH net-next v3 1/2] dt-bindings: " Vineeth Karumanchi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Vineeth Karumanchi @ 2024-05-28  6:20 UTC (permalink / raw)
  To: git, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt,
	harini.katakam, andrew, hkallweit1, linux, michal.simek
  Cc: vineeth.karumanchi, netdev, devicetree, linux-kernel,
	linux-arm-kernel

Add input clock support to gmii_to_rgmii IP.
Add "clocks" bindings for the input clock.

Changes in v3:
- Added items constraints.

Changes in v2:
- removed "clkin" clock name property.
v2 link : https://lore.kernel.org/netdev/20240517054745.4111922-1-vineeth.karumanchi@amd.com/

v1 link : https://lore.kernel.org/netdev/20240515094645.3691877-1-vineeth.karumanchi@amd.com/ 

Vineeth Karumanchi (2):
  dt-bindings: net: xilinx_gmii2rgmii: Add clock support
  net: phy: xilinx-gmii2rgmii: Adopt clock support

 .../devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml        | 5 +++++
 drivers/net/phy/xilinx_gmii2rgmii.c                        | 7 +++++++
 2 files changed, 12 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 1/2] dt-bindings: net: xilinx_gmii2rgmii: Add clock support
  2024-05-28  6:20 [PATCH net-next v3 0/2] net: xilinx_gmii2rgmii: Add clock support Vineeth Karumanchi
@ 2024-05-28  6:20 ` Vineeth Karumanchi
  2024-05-28  9:44   ` Krzysztof Kozlowski
  2024-05-28  6:20 ` [PATCH net-next v3 2/2] net: phy: xilinx-gmii2rgmii: Adopt " Vineeth Karumanchi
  2024-05-29 12:20 ` [PATCH net-next v3 0/2] net: xilinx_gmii2rgmii: Add " patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Vineeth Karumanchi @ 2024-05-28  6:20 UTC (permalink / raw)
  To: git, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt,
	harini.katakam, andrew, hkallweit1, linux, michal.simek
  Cc: vineeth.karumanchi, netdev, devicetree, linux-kernel,
	linux-arm-kernel

Add "clocks" bindings for the input clock.

Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
---
 .../devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml          | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml b/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
index 0f781dac6717..eb803ddd13e0 100644
--- a/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
+++ b/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
@@ -31,6 +31,10 @@ properties:
   phy-handle:
     $ref: ethernet-controller.yaml#/properties/phy-handle
 
+  clocks:
+    items:
+      - description: 200/375 MHz free-running clock is used as input clock.
+
 required:
   - compatible
   - reg
@@ -51,5 +55,6 @@ examples:
             compatible = "xlnx,gmii-to-rgmii-1.0";
             reg = <8>;
             phy-handle = <&phy>;
+            clocks = <&dummy>;
         };
     };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 2/2] net: phy: xilinx-gmii2rgmii: Adopt clock support
  2024-05-28  6:20 [PATCH net-next v3 0/2] net: xilinx_gmii2rgmii: Add clock support Vineeth Karumanchi
  2024-05-28  6:20 ` [PATCH net-next v3 1/2] dt-bindings: " Vineeth Karumanchi
@ 2024-05-28  6:20 ` Vineeth Karumanchi
  2024-05-28  9:33   ` Wojciech Drewek
  2024-05-29 12:20 ` [PATCH net-next v3 0/2] net: xilinx_gmii2rgmii: Add " patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Vineeth Karumanchi @ 2024-05-28  6:20 UTC (permalink / raw)
  To: git, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt,
	harini.katakam, andrew, hkallweit1, linux, michal.simek
  Cc: vineeth.karumanchi, netdev, devicetree, linux-kernel,
	linux-arm-kernel

Add clock support to the gmii_to_rgmii IP.
Make clk optional to keep DTB backward compatibility.

Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
---
 drivers/net/phy/xilinx_gmii2rgmii.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
index 7b1bc5fcef9b..7c51daecf18e 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -15,6 +15,7 @@
 #include <linux/mii.h>
 #include <linux/mdio.h>
 #include <linux/phy.h>
+#include <linux/clk.h>
 #include <linux/of_mdio.h>
 
 #define XILINX_GMII2RGMII_REG		0x10
@@ -85,11 +86,17 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev)
 	struct device *dev = &mdiodev->dev;
 	struct device_node *np = dev->of_node, *phy_node;
 	struct gmii2rgmii *priv;
+	struct clk *clkin;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
+	clkin = devm_clk_get_optional_enabled(dev, NULL);
+	if (IS_ERR(clkin))
+		return dev_err_probe(dev, PTR_ERR(clkin),
+					"Failed to get and enable clock from Device Tree\n");
+
 	phy_node = of_parse_phandle(np, "phy-handle", 0);
 	if (!phy_node) {
 		dev_err(dev, "Couldn't parse phy-handle\n");
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v3 2/2] net: phy: xilinx-gmii2rgmii: Adopt clock support
  2024-05-28  6:20 ` [PATCH net-next v3 2/2] net: phy: xilinx-gmii2rgmii: Adopt " Vineeth Karumanchi
@ 2024-05-28  9:33   ` Wojciech Drewek
  0 siblings, 0 replies; 6+ messages in thread
From: Wojciech Drewek @ 2024-05-28  9:33 UTC (permalink / raw)
  To: Vineeth Karumanchi, git, davem, edumazet, kuba, pabeni, robh,
	krzk+dt, conor+dt, harini.katakam, andrew, hkallweit1, linux,
	michal.simek
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel



On 28.05.2024 08:20, Vineeth Karumanchi wrote:
> Add clock support to the gmii_to_rgmii IP.
> Make clk optional to keep DTB backward compatibility.
> 
> Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
> ---

Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

>  drivers/net/phy/xilinx_gmii2rgmii.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
> index 7b1bc5fcef9b..7c51daecf18e 100644
> --- a/drivers/net/phy/xilinx_gmii2rgmii.c
> +++ b/drivers/net/phy/xilinx_gmii2rgmii.c
> @@ -15,6 +15,7 @@
>  #include <linux/mii.h>
>  #include <linux/mdio.h>
>  #include <linux/phy.h>
> +#include <linux/clk.h>
>  #include <linux/of_mdio.h>
>  
>  #define XILINX_GMII2RGMII_REG		0x10
> @@ -85,11 +86,17 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev)
>  	struct device *dev = &mdiodev->dev;
>  	struct device_node *np = dev->of_node, *phy_node;
>  	struct gmii2rgmii *priv;
> +	struct clk *clkin;
>  
>  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
>  		return -ENOMEM;
>  
> +	clkin = devm_clk_get_optional_enabled(dev, NULL);
> +	if (IS_ERR(clkin))
> +		return dev_err_probe(dev, PTR_ERR(clkin),
> +					"Failed to get and enable clock from Device Tree\n");
> +
>  	phy_node = of_parse_phandle(np, "phy-handle", 0);
>  	if (!phy_node) {
>  		dev_err(dev, "Couldn't parse phy-handle\n");

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v3 1/2] dt-bindings: net: xilinx_gmii2rgmii: Add clock support
  2024-05-28  6:20 ` [PATCH net-next v3 1/2] dt-bindings: " Vineeth Karumanchi
@ 2024-05-28  9:44   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-28  9:44 UTC (permalink / raw)
  To: Vineeth Karumanchi, git, davem, edumazet, kuba, pabeni, robh,
	krzk+dt, conor+dt, harini.katakam, andrew, hkallweit1, linux,
	michal.simek
  Cc: netdev, devicetree, linux-kernel, linux-arm-kernel

On 28/05/2024 08:20, Vineeth Karumanchi wrote:
> Add "clocks" bindings for the input clock.
> 
> Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
> ---
>  .../devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml          | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v3 0/2] net: xilinx_gmii2rgmii: Add clock support
  2024-05-28  6:20 [PATCH net-next v3 0/2] net: xilinx_gmii2rgmii: Add clock support Vineeth Karumanchi
  2024-05-28  6:20 ` [PATCH net-next v3 1/2] dt-bindings: " Vineeth Karumanchi
  2024-05-28  6:20 ` [PATCH net-next v3 2/2] net: phy: xilinx-gmii2rgmii: Adopt " Vineeth Karumanchi
@ 2024-05-29 12:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-29 12:20 UTC (permalink / raw)
  To: Vineeth Karumanchi
  Cc: git, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt,
	harini.katakam, andrew, hkallweit1, linux, michal.simek, netdev,
	devicetree, linux-kernel, linux-arm-kernel

Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Tue, 28 May 2024 11:50:06 +0530 you wrote:
> Add input clock support to gmii_to_rgmii IP.
> Add "clocks" bindings for the input clock.
> 
> Changes in v3:
> - Added items constraints.
> 
> Changes in v2:
> - removed "clkin" clock name property.
> v2 link : https://lore.kernel.org/netdev/20240517054745.4111922-1-vineeth.karumanchi@amd.com/
> 
> [...]

Here is the summary with links:
  - [net-next,v3,1/2] dt-bindings: net: xilinx_gmii2rgmii: Add clock support
    https://git.kernel.org/netdev/net-next/c/c1d96671088f
  - [net-next,v3,2/2] net: phy: xilinx-gmii2rgmii: Adopt clock support
    https://git.kernel.org/netdev/net-next/c/daab0ac53e77

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-29 12:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28  6:20 [PATCH net-next v3 0/2] net: xilinx_gmii2rgmii: Add clock support Vineeth Karumanchi
2024-05-28  6:20 ` [PATCH net-next v3 1/2] dt-bindings: " Vineeth Karumanchi
2024-05-28  9:44   ` Krzysztof Kozlowski
2024-05-28  6:20 ` [PATCH net-next v3 2/2] net: phy: xilinx-gmii2rgmii: Adopt " Vineeth Karumanchi
2024-05-28  9:33   ` Wojciech Drewek
2024-05-29 12:20 ` [PATCH net-next v3 0/2] net: xilinx_gmii2rgmii: Add " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox