From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73D53C433EF for ; Wed, 5 Jan 2022 09:33:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3873F82F89; Wed, 5 Jan 2022 10:33:41 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="k6nyvv8O"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5244C82F87; Wed, 5 Jan 2022 10:33:39 +0100 (CET) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8842683094 for ; Wed, 5 Jan 2022 10:33:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x535.google.com with SMTP id y22so159536525edq.2 for ; Wed, 05 Jan 2022 01:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VRM4O7NBcItbDfrftKwvgAlnDCzJ+i8PU1QI9Z+mWzU=; b=k6nyvv8Or+2nHnxyYF2blwPJCXDugmkJUsUeWO9Nj0lJcShpqhFDgGGbJbIpL7KAFQ 0q4Dh4krRsrqCNNik9kyP71o//cmAj8945HnsOTorSCZ6h8ToDeMpI6xUHQgsd4FOZT7 ycCzng9bzUuagabCi1ieBeVZs1NSALoK6W39CTSGcP+uSrDtHIf2is02S6duC/MtOCKz tCR4IQHsokl35NDlfG2SQVIZaUW8cZ+3FSjHciEuJhw757fJqrIQiiNQPpr6heCwXpGZ 3FBDJqWblFQnvUd9GGpJO1KhPOsy2YlYPI8l3U8G6ldbfbWD+JoA9XFhvZkdRcfAT5tG Z8uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=VRM4O7NBcItbDfrftKwvgAlnDCzJ+i8PU1QI9Z+mWzU=; b=0jMRdJf4hI+yniPVe72vtdolKeH+bLUFjRhCyq4GLOKVOAY33IE6CC4xZ/+YV78YAG xeXb9xFu9Z0dEhbSSCgxXcOX226JOnTXRJgciqzkPArJQ0iivFjN8RYb6sVdNoVvGcqp btpfHO9YAGFIzWXrRXiA727UFMsn773vJR1Cx3AuCQ9NpsnHXEFMSWjT7KvNFU9f5VSf THmMwuFmcox74J233TSRsjcWiYcwmB27d/2adA1jMRwCEbbk8SBEWEiJvKKT2Cv0zKag w34jq8hbnoLaPA+PgJ1Lku7mwH5QsweRo0HkFbFR8aO1TZ1UNe7HzIrL829OKtn9vxgn 4yEg== X-Gm-Message-State: AOAM532hFqB3Vzja8Hh5fVmcbnmaFvwFMvEZGdt4CUSht+2WOwCKm/+k CxkC1QFvh1Z95ytxr/f7vWHywZGM+sTuBdvubVobPeucNPLywQ== X-Google-Smtp-Source: ABdhPJy7LeJMluq7fAAyCKgmpl85ZHzpOURmXJ9FKNUha0IueegYL0Bk/SHf9AtWGq1jrzrj8qoUzQJYUXccRgp9hZo= X-Received: by 2002:a05:6402:2072:: with SMTP id bd18mr51441684edb.280.1641375215744; Wed, 05 Jan 2022 01:33:35 -0800 (PST) MIME-Version: 1.0 References: <6748007f0b6db9554d7a4b52352dce23ca403f9d.1638798796.git.michal.simek@xilinx.com> In-Reply-To: <6748007f0b6db9554d7a4b52352dce23ca403f9d.1638798796.git.michal.simek@xilinx.com> From: Michal Simek Date: Wed, 5 Jan 2022 10:33:24 +0100 Message-ID: Subject: Re: [PATCH v2] net: zynq: Add support for mdio bus address decoding To: U-Boot , git Cc: Joe Hershberger , Ramon Fried Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean po 6. 12. 2021 v 14:53 odes=C3=ADlatel Michal Simek 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 =3D <&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 =3D <&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 > --- > > 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 =3D ofnode_get_parent(phandle_args.node); > + if (ofnode_name_eq(parent, "mdio")) > + parent =3D ofnode_get_parent(parent); > + > addr =3D ofnode_get_addr(parent); > if (addr !=3D FDT_ADDR_T_NONE) { > debug("MDIO bus not found %s\n", dev->name); > -- > 2.33.1 > Applied. M --=20 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