* [PATCH v2] net: zynq: Add support for mdio bus address decoding
@ 2021-12-06 13:53 Michal Simek
2022-01-05 9:33 ` Michal Simek
0 siblings, 1 reply; 2+ messages in thread
From: Michal Simek @ 2021-12-06 13:53 UTC (permalink / raw)
To: u-boot, git; +Cc: Joe Hershberger, Michal Simek, Ramon Fried
Xilinx DTS files are using two way how to describe ethernet phy.
The first (already supported) has phy as subnode of gem node.
eth {
phy-handle = <&phy0>;
phy0: ethernet-phy@21 {
...
};
};
The second has mdio subnode (with mdio name) which has phy subnode. This
structure allow hadling MDIO reset signal (based on Linux mdio.yaml)
eth {
phy-handle = <&phy0>;
mdio {
phy0: ethernet-phy@21 {
...
};
};
};
This patch adds support for the second case where mdio subnode
is found driver will look at its parent to find out which gem is handling
MDIO bus.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
Changes in v2:
- update commit message
drivers/net/zynq_gem.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 3e227725022d..fece077066df 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -846,6 +846,9 @@ static int zynq_gem_of_to_plat(struct udevice *dev)
SPEED_1000);
parent = ofnode_get_parent(phandle_args.node);
+ if (ofnode_name_eq(parent, "mdio"))
+ parent = ofnode_get_parent(parent);
+
addr = ofnode_get_addr(parent);
if (addr != FDT_ADDR_T_NONE) {
debug("MDIO bus not found %s\n", dev->name);
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] net: zynq: Add support for mdio bus address decoding
2021-12-06 13:53 [PATCH v2] net: zynq: Add support for mdio bus address decoding Michal Simek
@ 2022-01-05 9:33 ` Michal Simek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2022-01-05 9:33 UTC (permalink / raw)
To: U-Boot, git; +Cc: Joe Hershberger, Ramon Fried
po 6. 12. 2021 v 14:53 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Xilinx DTS files are using two way how to describe ethernet phy.
>
> The first (already supported) has phy as subnode of gem node.
> eth {
> phy-handle = <&phy0>;
> phy0: ethernet-phy@21 {
> ...
> };
> };
>
> The second has mdio subnode (with mdio name) which has phy subnode. This
> structure allow hadling MDIO reset signal (based on Linux mdio.yaml)
> eth {
> phy-handle = <&phy0>;
> mdio {
> phy0: ethernet-phy@21 {
> ...
> };
> };
> };
>
> This patch adds support for the second case where mdio subnode
> is found driver will look at its parent to find out which gem is handling
> MDIO bus.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> Changes in v2:
> - update commit message
>
> drivers/net/zynq_gem.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
> index 3e227725022d..fece077066df 100644
> --- a/drivers/net/zynq_gem.c
> +++ b/drivers/net/zynq_gem.c
> @@ -846,6 +846,9 @@ static int zynq_gem_of_to_plat(struct udevice *dev)
> SPEED_1000);
>
> parent = ofnode_get_parent(phandle_args.node);
> + if (ofnode_name_eq(parent, "mdio"))
> + parent = ofnode_get_parent(parent);
> +
> addr = ofnode_get_addr(parent);
> if (addr != FDT_ADDR_T_NONE) {
> debug("MDIO bus not found %s\n", dev->name);
> --
> 2.33.1
>
Applied.
M
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-05 9:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 13:53 [PATCH v2] net: zynq: Add support for mdio bus address decoding Michal Simek
2022-01-05 9:33 ` Michal Simek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.