From patchwork Thu Nov 18 12:06:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1556599 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.a=rsa-sha256 header.s=20210112 header.b=QLlwOfUB; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hvz6f04Szz9s5P for ; Thu, 18 Nov 2021 23:06:33 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 96DD882F82; Thu, 18 Nov 2021 13:06:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="QLlwOfUB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AFA2E82982; Thu, 18 Nov 2021 13:06:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 A4AEE82F91 for ; Thu, 18 Nov 2021 13:06:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ed1-x52e.google.com with SMTP id b15so25990211edd.7 for ; Thu, 18 Nov 2021 04:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FdrevWDaYnXTkwuguN9g6AoHgGipvLeZfJCzIDVAyMQ=; b=QLlwOfUBDDcBofhnEjAoifk5Ep14YNVoR9jaLl4900eA8uUQxiF/McPKv2X6m7s0HF YKmYhAsTeY6eKs22xttkhrAO+ZH0LyZR213WS93dlJg5T+Jst7ixT7G397CqBHsW6EJF GBlfEdxdzH/XIzMvPHOOcVTvnjfUMmNv1YcGhcOptPgZcDakjIluMXfdnMHYbII64/FK caQXTxl3dFFQdWYHmWApCqjA4wg4DqoB4d4PAo1YDLv/sbd6i0JB8Iq4CkpfJ85DzFmQ kM9g9HnLnFF3iyUW5Tad1kotvNBauWp3sP3oBrCWgr6L5cmurnUH3IXA7Hh0zt6OWvy3 3Hpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=FdrevWDaYnXTkwuguN9g6AoHgGipvLeZfJCzIDVAyMQ=; b=p9vDriwSDjDqTwaGkZEdr8zTcsHsIP+R6fGaVtUkohRVOHdzmcSnMiZjdNnv8yD4va Frn3ewosLHTjG7HyXGkur6443qrxIuR7yguXBWlig71X17JLEYsUSI4dkSkGr8qqOBOy ku6DeLJNznLN6oNTshqtLRj/nSP3lC9n/eH7DZfvLgVcypPsh8ciPRJLZSJvk3Dn2/xs d6H/Oakkm+vy0GZUvlc8JY1skvHD1LB6SxxVL+QDKflI8HHUY/IXD7H6terpBCpjfps5 I5Qz4zYeiFHC2ftommHVOM6MDprEUcO459F09eoXI5d2N8ZzG1sSjUMXAiejbZSNWAvb Yj+w== X-Gm-Message-State: AOAM533o0w2w4zv/R51cPMAkFzg6ZZ9hamGJ4dcF7zel3IupL7ZUjQE6 mKD+AixT0naQStiq4X/ctjOhapMMmFhUJQ== X-Google-Smtp-Source: ABdhPJyzqulwJET6Fe6oOHDnm2G9R0zDR41PJ8Q/GIQrGmIjUpapZTJKwc+Sw1ITh3FlURHLVAJnoQ== X-Received: by 2002:a50:cdc8:: with SMTP id h8mr10621925edj.87.1637237182990; Thu, 18 Nov 2021 04:06:22 -0800 (PST) Received: from localhost ([2a02:768:2307:40d6::45a]) by smtp.gmail.com with ESMTPSA id r11sm483253edd.70.2021.11.18.04.06.22 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Nov 2021 04:06:22 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Cc: Joe Hershberger , Michal Simek , Ramon Fried Subject: [PATCH] net: zynq: Add support for mdio bus address decoding Date: Thu, 18 Nov 2021 13:06:21 +0100 Message-Id: <18d08c5410d34f2d7d3bb63b1dc7874b71f639af.1637237178.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.35 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 There are flying two configurations around. 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 --- 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);