* [PATH net-next 0/2] net: xilinx_gmii2rgmii: Add clock support.
@ 2024-05-15 9:46 Vineeth Karumanchi
2024-05-15 9:46 ` [PATH net-next 1/2] dt-bindings: " Vineeth Karumanchi
2024-05-15 9:46 ` [PATH net-next 2/2] net: phy: xilinx-gmii2rgmii: Adopt " Vineeth Karumanchi
0 siblings, 2 replies; 5+ messages in thread
From: Vineeth Karumanchi @ 2024-05-15 9:46 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" and "clock_names" bindings, "clkin" is the input clock name.
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 | 9 +++++++++
drivers/net/phy/xilinx_gmii2rgmii.c | 7 +++++++
2 files changed, 16 insertions(+)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATH net-next 1/2] dt-bindings: net: xilinx_gmii2rgmii: Add clock support
2024-05-15 9:46 [PATH net-next 0/2] net: xilinx_gmii2rgmii: Add clock support Vineeth Karumanchi
@ 2024-05-15 9:46 ` Vineeth Karumanchi
2024-05-15 14:07 ` Krzysztof Kozlowski
2024-05-15 9:46 ` [PATH net-next 2/2] net: phy: xilinx-gmii2rgmii: Adopt " Vineeth Karumanchi
1 sibling, 1 reply; 5+ messages in thread
From: Vineeth Karumanchi @ 2024-05-15 9:46 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" and "clock_names" bindings, "clkin" is the input clock name.
Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
---
.../devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml | 9 +++++++++
1 file changed, 9 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..d84d13fb2c54 100644
--- a/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
+++ b/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
@@ -31,6 +31,13 @@ properties:
phy-handle:
$ref: ethernet-controller.yaml#/properties/phy-handle
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ const: clkin
+ description: 200/375 MHz free-running clock is used as a input clock.
+
required:
- compatible
- reg
@@ -51,5 +58,7 @@ examples:
compatible = "xlnx,gmii-to-rgmii-1.0";
reg = <8>;
phy-handle = <&phy>;
+ clocks = <&dummy>;
+ clock-names = "clkin";
};
};
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATH net-next 2/2] net: phy: xilinx-gmii2rgmii: Adopt clock support
2024-05-15 9:46 [PATH net-next 0/2] net: xilinx_gmii2rgmii: Add clock support Vineeth Karumanchi
2024-05-15 9:46 ` [PATH net-next 1/2] dt-bindings: " Vineeth Karumanchi
@ 2024-05-15 9:46 ` Vineeth Karumanchi
1 sibling, 0 replies; 5+ messages in thread
From: Vineeth Karumanchi @ 2024-05-15 9:46 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.
The input clock name "clkin" from device-tree
will be registered.
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..98a6e5f10bb7 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, "clkin");
+ if (IS_ERR(clkin))
+ return dev_err_probe(dev, PTR_ERR(clkin),
+ "Failed to get and enable clock_in 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] 5+ messages in thread
* Re: [PATH net-next 1/2] dt-bindings: net: xilinx_gmii2rgmii: Add clock support
2024-05-15 9:46 ` [PATH net-next 1/2] dt-bindings: " Vineeth Karumanchi
@ 2024-05-15 14:07 ` Krzysztof Kozlowski
2024-05-16 9:09 ` Vineeth Karumanchi
0 siblings, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-15 14:07 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 15/05/2024 11:46, Vineeth Karumanchi wrote:
> Add input clock support to gmii_to_rgmii IP.
Why? Wasn't it there before?
> Add "clocks" and "clock_names" bindings, "clkin" is the input clock name.
Please use standard email subjects, so with the PATCH keyword in the
title. `git format-patch` helps here to create proper versioned patches.
Another useful tool is b4. Skipping the PATCH keyword makes filtering of
emails more difficult thus making the review process less convenient.
Don't write it by yourself....
Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching. For bindings, the preferred subjects are
explained here:
https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
>
> Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
> ---
> .../devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml | 9 +++++++++
> 1 file changed, 9 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..d84d13fb2c54 100644
> --- a/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
> +++ b/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
> @@ -31,6 +31,13 @@ properties:
> phy-handle:
> $ref: ethernet-controller.yaml#/properties/phy-handle
>
> + clocks:
> + maxItems: 1
> +
> + clock-names:
> + const: clkin
> + description: 200/375 MHz free-running clock is used as a input clock.
Nope, just write the description as items in clocks, instead of
maxItems. And drop clock-names, not needed and kind of obvious.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATH net-next 1/2] dt-bindings: net: xilinx_gmii2rgmii: Add clock support
2024-05-15 14:07 ` Krzysztof Kozlowski
@ 2024-05-16 9:09 ` Vineeth Karumanchi
0 siblings, 0 replies; 5+ messages in thread
From: Vineeth Karumanchi @ 2024-05-16 9:09 UTC (permalink / raw)
To: Krzysztof Kozlowski, 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
Hi Krzysztof,
On 15/05/24 7:37 pm, Krzysztof Kozlowski wrote:
> On 15/05/2024 11:46, Vineeth Karumanchi wrote:
>> Add input clock support to gmii_to_rgmii IP.
>
> Why? Wasn't it there before?
Earlier we used to enable all PL clocks (fixed), now we want to enable
only the needed clocks.
>
>> Add "clocks" and "clock_names" bindings, "clkin" is the input clock name.
>
> Please use standard email subjects, so with the PATCH keyword in the
> title. `git format-patch` helps here to create proper versioned patches.
> Another useful tool is b4. Skipping the PATCH keyword makes filtering of
> emails more difficult thus making the review process less convenient.
>
> Don't write it by yourself....
>
> Please use subject prefixes matching the subsystem. You can get them for
> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
> your patch is touching. For bindings, the preferred subjects are
> explained here:
> https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters
>
sorry mybad, I used 'git format-patch', but typo!.
Will take care from next time.
>>
>> Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
>> ---
>> .../devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml | 9 +++++++++
>> 1 file changed, 9 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..d84d13fb2c54 100644
>> --- a/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
>> +++ b/Documentation/devicetree/bindings/net/xlnx,gmii-to-rgmii.yaml
>> @@ -31,6 +31,13 @@ properties:
>> phy-handle:
>> $ref: ethernet-controller.yaml#/properties/phy-handle
>>
>> + clocks:
>> + maxItems: 1
>> +
>> + clock-names:
>> + const: clkin
>> + description: 200/375 MHz free-running clock is used as a input clock.
>
> Nope, just write the description as items in clocks, instead of
> maxItems. And drop clock-names, not needed and kind of obvious.
>
OK.
🙏 vineeth
>
> Best regards,
> Krzysztof
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-05-16 9:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-15 9:46 [PATH net-next 0/2] net: xilinx_gmii2rgmii: Add clock support Vineeth Karumanchi
2024-05-15 9:46 ` [PATH net-next 1/2] dt-bindings: " Vineeth Karumanchi
2024-05-15 14:07 ` Krzysztof Kozlowski
2024-05-16 9:09 ` Vineeth Karumanchi
2024-05-15 9:46 ` [PATH net-next 2/2] net: phy: xilinx-gmii2rgmii: Adopt " Vineeth Karumanchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).