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/[email protected]/
v1 link : https://lore.kernel.org/netdev/[email protected]/
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
Add "clocks" bindings for the input clock.
Signed-off-by: Vineeth Karumanchi <[email protected]>
---
.../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
Add clock support to the gmii_to_rgmii IP.
Make clk optional to keep DTB backward compatibility.
Signed-off-by: Vineeth Karumanchi <[email protected]>
---
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
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 <[email protected]>
> ---
Reviewed-by: Wojciech Drewek <[email protected]>
> 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");
On 28/05/2024 08:20, Vineeth Karumanchi wrote:
> Add "clocks" bindings for the input clock.
>
> Signed-off-by: Vineeth Karumanchi <[email protected]>
> ---
> .../devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof
Hello:
This series was applied to netdev/net-next.git (main)
by David S. Miller <[email protected]>:
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/[email protected]/
>
> [...]
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