[PATCH] net: zynq: Add support for mdio bus address decoding

Ramon Fried rfried.dev at gmail.com
Sun Nov 21 20:11:04 CET 2021


On Thu, Nov 18, 2021 at 2:06 PM Michal Simek <michal.simek at xilinx.com> wrote:
>
> There are flying two configurations around.
Can you rephrase ? I don't understand.
> The first (already supported) has phy as subnode of gem node.
> The second has mdio subnode (with mdio name) which has phy subnode.
>
> 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 at xilinx.com>
> ---
>
>  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 033021f1cbfc..91957757727d 100644
> --- a/drivers/net/zynq_gem.c
> +++ b/drivers/net/zynq_gem.c
> @@ -804,6 +804,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
>


More information about the U-Boot mailing list