From patchwork Wed Apr 27 10:41:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622915 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=tRz6tZRa; 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 4KpFgz5fVlz9sBy for ; Wed, 27 Apr 2022 20:42:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 378FC83EAD; Wed, 27 Apr 2022 12:42:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="tRz6tZRa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5308883DFE; Wed, 27 Apr 2022 12:42:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E4FA983DFE for ; Wed, 27 Apr 2022 12:42:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8E6DAB82524; Wed, 27 Apr 2022 10:42:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96BEEC385AE; Wed, 27 Apr 2022 10:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056131; bh=0zwrTdoOGSazri3loobOmRmMNeI+2mBRcs8tHUsSv4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tRz6tZRaCECXiPsQFb9skafDH+1ZdZEqvHziTRtdD6akLHiiBOoC3ldWUt3tl+OhU iKm2JWl578qULu0dVsxLtNBAOqVwa3Y+N+AgPuysbsqjLZYXgSS7qxEHnYNxPKBtJC /DVMs9VdhukUmJpSoXXELikcNpHtrZHyztTo1IXncXsWhqfxs31atuuj47knRa5Ql6 mdulRFKnTDZjY84zUBkL2yp7f+DesDPY7+eGllOqFDqcKhNIVX9FnSELjzGC4yIGkl 1m2141pfcUXy7jsDg6HzSaKzNUNDhmEl2MNq3KvNwMYQ5aFtkcWbvLRSDCRN+lK1M8 IuIfICILY3HnA== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 01/19] net: mvneta: Get rid of platdata Date: Wed, 27 Apr 2022 12:41:44 +0200 Message-Id: <20220427104202.1205-2-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Drop .of_to_plat() from the mvneta driver and parse the two properties in .probe(). Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 15dc714058..d1c5f7930d 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1692,7 +1692,6 @@ static int mvneta_recv(struct udevice *dev, int flags, uchar **packetp) static int mvneta_probe(struct udevice *dev) { - struct eth_pdata *pdata = dev_get_plat(dev); struct mvneta_port *pp = dev_get_priv(dev); #if CONFIG_IS_ENABLED(DM_GPIO) struct ofnode_phandle_args sfp_args; @@ -1729,7 +1728,10 @@ static int mvneta_probe(struct udevice *dev) buffer_loc.rx_buffers = (phys_addr_t)(bd_space + size); } - pp->base = (void __iomem *)pdata->iobase; + pp->base = dev_read_addr_ptr(dev); + pp->phy_interface = dev_read_phy_mode(dev); + if (pp->phy_interface == PHY_INTERFACE_MODE_NA) + return -EINVAL; /* Configure MBUS address windows */ if (device_is_compatible(dev, "marvell,armada-3700-neta")) @@ -1737,9 +1739,6 @@ static int mvneta_probe(struct udevice *dev) else mvneta_conf_mbus_windows(pp); - /* PHY interface is already decoded in mvneta_of_to_plat() */ - pp->phy_interface = pdata->phy_interface; - /* fetch 'fixed-link' property from 'neta' node */ fl_node = fdt_subnode_offset(blob, node, "fixed-link"); if (fl_node != -FDT_ERR_NOTFOUND) { @@ -1808,20 +1807,6 @@ static const struct eth_ops mvneta_ops = { .write_hwaddr = mvneta_write_hwaddr, }; -static int mvneta_of_to_plat(struct udevice *dev) -{ - struct eth_pdata *pdata = dev_get_plat(dev); - - pdata->iobase = dev_read_addr(dev); - - /* Get phy-mode / phy_interface from DT */ - pdata->phy_interface = dev_read_phy_mode(dev); - if (pdata->phy_interface == PHY_INTERFACE_MODE_NA) - return -EINVAL; - - return 0; -} - static const struct udevice_id mvneta_ids[] = { { .compatible = "marvell,armada-370-neta" }, { .compatible = "marvell,armada-xp-neta" }, @@ -1833,7 +1818,6 @@ U_BOOT_DRIVER(mvneta) = { .name = "mvneta", .id = UCLASS_ETH, .of_match = mvneta_ids, - .of_to_plat = mvneta_of_to_plat, .probe = mvneta_probe, .ops = &mvneta_ops, .priv_auto = sizeof(struct mvneta_port), From patchwork Wed Apr 27 10:41:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622916 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=rDdLigUP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4KpFhC5V9Vz9sBy for ; Wed, 27 Apr 2022 20:42:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0908E83E7F; Wed, 27 Apr 2022 12:42:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="rDdLigUP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CFF0983D3D; Wed, 27 Apr 2022 12:42:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E5F9F83B46 for ; Wed, 27 Apr 2022 12:42:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C7DDF61C19; Wed, 27 Apr 2022 10:42:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A02DDC385AF; Wed, 27 Apr 2022 10:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056133; bh=P+lgaTetiRiJj09eTh2wJp01CcB5gQAZgePuWrkiQRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rDdLigUPzkQy3I9dM8K0CgBNYoMQFiSdtN9zz0z7ljiuoS7PpHYfceQ1pOnli3wks OlUyyX64IAp809oj0v1zx1QNvhuHfqGOjBrEfZ1U9zhn5dbeIBLzVuHQvyYkFPvs73 pGCMS4+gnRxt/cusRnpTpudNpFNJtattRa9kMgNXAdyDAxV4uTvWMckAKWmC98uGqk Ps1fH5hoDg4FyTsRf5dfAJupDYFsKNR0KfVWfxMJ738PEAg2SQP5jbRwUHJ+F4hvrg dLy+bqXkRLJ1+F3L4iq260x/zvmnkf+hPU1hD4yYHgG8Pl4e0GbV7P2gxtB3VABZ/G /Y+QrRT/O50/Q== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 02/19] net: mvneta: Fix 10Mbps speed Date: Wed, 27 Apr 2022 12:41:45 +0200 Message-Id: <20220427104202.1205-3-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún In mvneta_adjust_link() we need to set MII_SPEED bit only if PHY reports the speed at 100Mbps. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index d1c5f7930d..79cdb93341 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1195,7 +1195,7 @@ static void mvneta_adjust_link(struct udevice *dev) if (phydev->speed == SPEED_1000) val |= MVNETA_GMAC_CONFIG_GMII_SPEED; - else + else if (pp->speed == SPEED_100) val |= MVNETA_GMAC_CONFIG_MII_SPEED; mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); From patchwork Wed Apr 27 10:41:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622917 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=fXT9L69V; 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 4KpFhT4sLMz9sBy for ; Wed, 27 Apr 2022 20:43:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 56B5383ECD; Wed, 27 Apr 2022 12:42:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="fXT9L69V"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6EC2783EAE; Wed, 27 Apr 2022 12:42:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E197D83DFE for ; Wed, 27 Apr 2022 12:42:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C015861D41; Wed, 27 Apr 2022 10:42:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A949DC385AA; Wed, 27 Apr 2022 10:42:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056136; bh=L6qjBkQ2Tpi8/Qy5dFO/P+fA83QXhSp5rcMdX3egitg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fXT9L69Vp9R0raMIFJ95fD5F/iAOTNcbIzm7nJHuCTDqqIQArj1Uup1ZSauFhb/M4 mHdIRHVM5NJi7Tn1QAJrjCfe5PqoP8p2uh/gLjbEkjPPKjNIYBTBHKvwbFZU51HWse SZZpPQdoQztMkjnI3sC8J4QeV/Ja+yuOcAf8f4842D4F+O1FdQugl4BLbiGAGKbXQX itVtIookYMzXr7m22e1yaIiFjW0nDY9HNzbewZ7jlXuAhgpjdtxJWIAyf0t5qS93Av VwLIbmm9D3qKzTXXE04CImcPsctCkuQdnpYqdfvMoZKBetpeFLSWBUpJFm8yUSQo8I 2yljsRiDsaFFg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= , Mario Six , Chris Packham , Phil Sutter , Konstantin Porotchkin , Vladimir Vid Subject: [PATCH u-boot-marvell 03/19] net: mvneta: Use DM MDIO API for connecting PHY Date: Wed, 27 Apr 2022 12:41:46 +0200 Message-Id: <20220427104202.1205-4-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Use the modern DM MDIO API for connecting PHY in the mvneta driver. This requires enabling MVMDIO driver in several config files. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- configs/clearfog_defconfig | 1 + configs/controlcenterdc_defconfig | 1 + configs/db-88f6820-amc_defconfig | 1 + configs/db-88f6820-gp_defconfig | 1 + configs/db-mv784mp-gp_defconfig | 1 + configs/ds414_defconfig | 1 + configs/helios4_defconfig | 1 + configs/maxbcm_defconfig | 1 + configs/mvebu_espressobin-88f3720_defconfig | 1 + configs/theadorable_debug_defconfig | 1 + configs/turris_mox_defconfig | 1 + configs/turris_omnia_defconfig | 1 + configs/uDPU_defconfig | 1 + drivers/net/Kconfig | 1 + drivers/net/mvneta.c | 11 +++++------ 15 files changed, 19 insertions(+), 6 deletions(-) diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig index 880f16a6e0..b8f59d2962 100644 --- a/configs/clearfog_defconfig +++ b/configs/clearfog_defconfig @@ -63,6 +63,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_PCI=y CONFIG_PCI_MVEBU=y CONFIG_SCSI=y diff --git a/configs/controlcenterdc_defconfig b/configs/controlcenterdc_defconfig index d4b966b93f..df38b2c54f 100644 --- a/configs/controlcenterdc_defconfig +++ b/configs/controlcenterdc_defconfig @@ -77,6 +77,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_PCI=y CONFIG_DM_PCI_COMPAT=y CONFIG_PCI_MVEBU=y diff --git a/configs/db-88f6820-amc_defconfig b/configs/db-88f6820-amc_defconfig index 46c822fccd..9b77b4a5f0 100644 --- a/configs/db-88f6820-amc_defconfig +++ b/configs/db-88f6820-amc_defconfig @@ -67,6 +67,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_PCI=y CONFIG_PCI_MVEBU=y CONFIG_DEBUG_UART_SHIFT=2 diff --git a/configs/db-88f6820-gp_defconfig b/configs/db-88f6820-gp_defconfig index 2dcbc2f29a..f56d1fbf25 100644 --- a/configs/db-88f6820-gp_defconfig +++ b/configs/db-88f6820-gp_defconfig @@ -62,6 +62,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_PCI=y CONFIG_PCI_MVEBU=y CONFIG_SCSI=y diff --git a/configs/db-mv784mp-gp_defconfig b/configs/db-mv784mp-gp_defconfig index f19cc54975..5683f11836 100644 --- a/configs/db-mv784mp-gp_defconfig +++ b/configs/db-mv784mp-gp_defconfig @@ -65,6 +65,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_PCI=y CONFIG_PCI_MVEBU=y CONFIG_DEBUG_UART_SHIFT=2 diff --git a/configs/ds414_defconfig b/configs/ds414_defconfig index a3279c15c5..a83fe079b3 100644 --- a/configs/ds414_defconfig +++ b/configs/ds414_defconfig @@ -65,6 +65,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_PCI=y CONFIG_PCI_MVEBU=y CONFIG_DEBUG_UART_SHIFT=2 diff --git a/configs/helios4_defconfig b/configs/helios4_defconfig index 7d812e8fab..c2130bacb4 100644 --- a/configs/helios4_defconfig +++ b/configs/helios4_defconfig @@ -63,6 +63,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_PCI=y CONFIG_PCI_MVEBU=y CONFIG_SCSI=y diff --git a/configs/maxbcm_defconfig b/configs/maxbcm_defconfig index 8dd6adf247..40f79d47ea 100644 --- a/configs/maxbcm_defconfig +++ b/configs/maxbcm_defconfig @@ -47,6 +47,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_DEBUG_UART_SHIFT=2 CONFIG_SYS_NS16550=y CONFIG_KIRKWOOD_SPI=y diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig index ff05630d20..af30f1b363 100644 --- a/configs/mvebu_espressobin-88f3720_defconfig +++ b/configs/mvebu_espressobin-88f3720_defconfig @@ -76,6 +76,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_E1000=y CONFIG_MVNETA=y +CONFIG_MVMDIO=y CONFIG_NVME_PCI=y CONFIG_PCI=y CONFIG_PCI_AARDVARK=y diff --git a/configs/theadorable_debug_defconfig b/configs/theadorable_debug_defconfig index 86129e7d2d..9a03a0a7a3 100644 --- a/configs/theadorable_debug_defconfig +++ b/configs/theadorable_debug_defconfig @@ -70,6 +70,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_PCI=y CONFIG_DM_PCI_COMPAT=y CONFIG_PCI_MVEBU=y diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig index 9a76a118c2..bcd3699a4f 100644 --- a/configs/turris_mox_defconfig +++ b/configs/turris_mox_defconfig @@ -82,6 +82,7 @@ CONFIG_SPI_FLASH_MTD=y CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y +CONFIG_MVMDIO=y CONFIG_NVME_PCI=y CONFIG_PCI=y CONFIG_PCI_AARDVARK=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index ad56d3824b..6b218bd7a7 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -82,6 +82,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y +CONFIG_MVMDIO=y CONFIG_NVME_PCI=y CONFIG_PCI=y CONFIG_PCI_MVEBU=y diff --git a/configs/uDPU_defconfig b/configs/uDPU_defconfig index c07bad5076..f2852ad29b 100644 --- a/configs/uDPU_defconfig +++ b/configs/uDPU_defconfig @@ -73,6 +73,7 @@ CONFIG_PHY_MARVELL=y CONFIG_PHY_GIGE=y CONFIG_E1000=y CONFIG_MVNETA=y +CONFIG_MVMDIO=y CONFIG_PCI=y CONFIG_PCI_AARDVARK=y CONFIG_PHY=y diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 347fe8aa42..47f7a262f2 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -445,6 +445,7 @@ config MVNETA bool "Marvell Armada XP/385/3700 network interface support" depends on ARMADA_XP || ARMADA_38X || ARMADA_3700 select PHYLIB + select DM_MDIO help This driver supports the network interface units in the Marvell ARMADA XP, ARMADA 38X and ARMADA 3700 SoCs diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 79cdb93341..24a491dcde 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1571,16 +1571,15 @@ static int mvneta_start(struct udevice *dev) mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); } else { - /* Set phy address of the port */ - mvreg_write(pp, MVNETA_PHY_ADDR, pp->phyaddr); - - phydev = phy_connect(pp->bus, pp->phyaddr, dev, - pp->phy_interface); + phydev = dm_eth_phy_connect(dev); if (!phydev) { - printf("phy_connect failed\n"); + printf("dm_eth_phy_connect failed\n"); return -ENODEV; } + /* Set PHY address in case we will enable HW polling */ + mvreg_write(pp, MVNETA_PHY_ADDR, phydev->addr); + pp->phydev = phydev; phy_config(phydev); phy_startup(phydev); From patchwork Wed Apr 27 10:41:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622918 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=k1xVU2ri; 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 4KpFhk28F3z9sBy for ; Wed, 27 Apr 2022 20:43:18 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1529683ECC; Wed, 27 Apr 2022 12:42:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="k1xVU2ri"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9B8B383E7F; Wed, 27 Apr 2022 12:42:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B4DA583E7F for ; Wed, 27 Apr 2022 12:42:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6BEF0B82530; Wed, 27 Apr 2022 10:42:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A2F8C385A7; Wed, 27 Apr 2022 10:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056138; bh=L2PqYn0Ng/4p43A3+enT/XgLv5KqB0npQKRMHVCUR9A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k1xVU2ri+WZp5Z75lLuCy2zONx8KzbDgND6SSzpu+GUCMrHeQ1n3v681nfS+a21+E +7tYiLs/n4tZ4UBVVqXm27c7bKtPnj+LzBfn8UQA8YnH/BR2eTpcOtL0sb4uQL7bJy 26n53AysKS/I6eKJ/Y011z33It4ga4lSP/vVOqDNkqDqoyJvDsq287/YBnmNTnVZAW h3dkHpNfaryU3e0cz/rGCHslDSxWXYo86yz9KMtQsULUzku1ihSDeszqxcsjHc9pKP pMEdo2DTnesx5pVkSZ8hBne6Jd5o1VkdsLzix/Vn8uTigpqe1MUivzuk0PqY67Ptgb 7WfH4YKRa0ZCg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 04/19] net: mvneta: Remember fixed link instead of PHY address in priv data Date: Wed, 27 Apr 2022 12:41:47 +0200 Message-Id: <20220427104202.1205-5-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún We don't need to remember PHY address anymore, because since using DM MDIO for connecting PHY, the address is parsed by mdio-uclass from the ofnode. But the driver uses a special value of the address to signal fixed link usage. Drop phyaddr add fixed_link in driver private structure. This simplifies code a little. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 24a491dcde..83e9629138 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -277,12 +277,12 @@ struct mvneta_port { u16 rx_ring_size; phy_interface_t phy_interface; + bool fixed_link; unsigned int link; unsigned int duplex; unsigned int speed; int init; - int phyaddr; struct phy_device *phydev; #if CONFIG_IS_ENABLED(DM_GPIO) struct gpio_desc phy_reset_gpio; @@ -576,13 +576,6 @@ static void mvneta_rxq_buf_size_set(struct mvneta_port *pp, mvreg_write(pp, MVNETA_RXQ_SIZE_REG(rxq->id), val); } -static int mvneta_port_is_fixed_link(struct mvneta_port *pp) -{ - /* phy_addr is set to invalid value for fixed link */ - return pp->phyaddr > PHY_MAX_ADDR; -} - - /* Start the Ethernet port RX and TX activity */ static void mvneta_port_up(struct mvneta_port *pp) { @@ -834,7 +827,7 @@ static void mvneta_defaults_set(struct mvneta_port *pp) mvreg_write(pp, MVNETA_SDMA_CONFIG, val); /* Enable PHY polling in hardware if not in fixed-link mode */ - if (!mvneta_port_is_fixed_link(pp)) { + if (!pp->fixed_link) { val = mvreg_read(pp, MVNETA_UNIT_CONTROL); val |= MVNETA_PHY_POLLING_ENABLE; mvreg_write(pp, MVNETA_UNIT_CONTROL, val); @@ -1173,7 +1166,7 @@ static void mvneta_adjust_link(struct udevice *dev) struct phy_device *phydev = pp->phydev; int status_change = 0; - if (mvneta_port_is_fixed_link(pp)) { + if (pp->fixed_link) { debug("Using fixed link, skip link adjust\n"); return; } @@ -1548,7 +1541,7 @@ static int mvneta_start(struct udevice *dev) mvneta_port_power_up(pp, pp->phy_interface); if (!pp->init || pp->link == 0) { - if (mvneta_port_is_fixed_link(pp)) { + if (pp->fixed_link) { u32 val; pp->init = 1; @@ -1698,7 +1691,6 @@ static int mvneta_probe(struct udevice *dev) void *blob = (void *)gd->fdt_blob; int node = dev_of_offset(dev); struct mii_dev *bus; - unsigned long addr; void *bd_space; int ret; int fl_node; @@ -1742,14 +1734,9 @@ static int mvneta_probe(struct udevice *dev) fl_node = fdt_subnode_offset(blob, node, "fixed-link"); if (fl_node != -FDT_ERR_NOTFOUND) { /* set phy_addr to invalid value for fixed link */ - pp->phyaddr = PHY_MAX_ADDR + 1; pp->duplex = fdtdec_get_bool(blob, fl_node, "full-duplex"); pp->speed = fdtdec_get_int(blob, fl_node, "speed", 0); - } else { - /* Now read phyaddr from DT */ - addr = fdtdec_get_int(blob, node, "phy", 0); - addr = fdt_node_offset_by_phandle(blob, addr); - pp->phyaddr = fdtdec_get_int(blob, addr, "reg", 0); + pp->fixed_link = true; } bus = mdio_alloc(); From patchwork Wed Apr 27 10:41:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622919 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=iR0rk6a4; 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 4KpFhz4MbHz9sBy for ; Wed, 27 Apr 2022 20:43:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 42EA983EE5; Wed, 27 Apr 2022 12:42:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="iR0rk6a4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DF99083E7F; Wed, 27 Apr 2022 12:42:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6CD1B83EA1 for ; Wed, 27 Apr 2022 12:42:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 188BEB82576; Wed, 27 Apr 2022 10:42:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A31EFC385A9; Wed, 27 Apr 2022 10:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056140; bh=JT4zxmxpsc29np22VEQgDP0zmKIVwGjBeZADIdo6+3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iR0rk6a4zSExydjD74tnhFhL6+IYmDjmpHKay68cmXR7NneRhlHKfO+OekMEuWBwf oBT87BnNVngntVg4Ghgg1Cy+SdS8mDdaETWCXssZVIq+wpzANvNEpcJH5iW2XNcAWZ u6/LTqRUeNL8VOwanzxSFRB53JHuahkyZ5SamM+077xOC+uCfhyFi08QR60WhG8S8W G4a2hExeQJLVVDfa3+PJt4eOQ5nhWGzFebNrjPiYbfUnIbcLSaRWlpuAVyF1F8HyGt yO7liUW/Gvys+Y3qpJ+mi4tOI+AN7zvf+wCTvCEfpjyQO5z5xB6c0gNEuFIZTwffpr +ToBrltJ23bHw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= , Konstantin Porotchkin , Rogier Stam , Mark Kettenis Subject: [PATCH u-boot-marvell 05/19] arm: mvebu: Espressobin: Use DM registered MDIO to configure switch Date: Wed, 27 Apr 2022 12:41:48 +0200 Message-Id: <20220427104202.1205-6-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún In order to be able to get rid of the non-DM MDIO bus registered in mvneta driver, we need to stop using board_network_enable() and instead use the DM registered MDIO device to configure switch in last_stage_init(). Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- board/Marvell/mvebu_armada-37xx/board.c | 26 ++++++++++++++++----- configs/mvebu_espressobin-88f3720_defconfig | 1 + 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c index 98e1b36d11..3e5e0a0b5c 100644 --- a/board/Marvell/mvebu_armada-37xx/board.c +++ b/board/Marvell/mvebu_armada-37xx/board.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -254,14 +255,15 @@ int board_xhci_enable(fdt_addr_t base) return 0; } +#ifdef CONFIG_LAST_STAGE_INIT /* Helper function for accessing switch devices in multi-chip connection mode */ -static int mii_multi_chip_mode_write(struct mii_dev *bus, int dev_smi_addr, +static int mii_multi_chip_mode_write(struct udevice *bus, int dev_smi_addr, int smi_addr, int reg, u16 value) { u16 smi_cmd = 0; - if (bus->write(bus, dev_smi_addr, 0, - MVEBU_SW_SMI_DATA_REG, value) != 0) { + if (dm_mdio_write(bus, dev_smi_addr, MDIO_DEVAD_NONE, + MVEBU_SW_SMI_DATA_REG, value) != 0) { printf("Error writing to the PHY addr=%02x reg=%02x\n", smi_addr, reg); return -EFAULT; @@ -272,8 +274,8 @@ static int mii_multi_chip_mode_write(struct mii_dev *bus, int dev_smi_addr, (1 << SW_SMI_CMD_SMI_OP_OFF) | (smi_addr << SW_SMI_CMD_DEV_ADDR_OFF) | (reg << SW_SMI_CMD_REG_ADDR_OFF); - if (bus->write(bus, dev_smi_addr, 0, - MVEBU_SW_SMI_CMD_REG, smi_cmd) != 0) { + if (dm_mdio_write(bus, dev_smi_addr, MDIO_DEVAD_NONE, + MVEBU_SW_SMI_CMD_REG, smi_cmd) != 0) { printf("Error writing to the PHY addr=%02x reg=%02x\n", smi_addr, reg); return -EFAULT; @@ -283,11 +285,22 @@ static int mii_multi_chip_mode_write(struct mii_dev *bus, int dev_smi_addr, } /* Bring-up board-specific network stuff */ -int board_network_enable(struct mii_dev *bus) +int last_stage_init(void) { + struct udevice *bus; + ofnode node; + if (!of_machine_is_compatible("globalscale,espressobin")) return 0; + node = ofnode_by_compatible(ofnode_null(), "marvell,orion-mdio"); + if (!ofnode_valid(node) || + uclass_get_device_by_ofnode(UCLASS_MDIO, node, &bus) || + device_probe(bus)) { + printf("Cannot find MDIO bus\n"); + return 0; + } + /* * FIXME: remove this code once Topaz driver gets available * A3720 Community Board Only @@ -327,6 +340,7 @@ int board_network_enable(struct mii_dev *bus) return 0; } +#endif #ifdef CONFIG_OF_BOARD_SETUP int ft_board_setup(void *blob, struct bd_info *bd) diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig index af30f1b363..37e4fdc41e 100644 --- a/configs/mvebu_espressobin-88f3720_defconfig +++ b/configs/mvebu_espressobin-88f3720_defconfig @@ -25,6 +25,7 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_ARCH_EARLY_INIT_R=y CONFIG_BOARD_EARLY_INIT_F=y CONFIG_BOARD_LATE_INIT=y +CONFIG_LAST_STAGE_INIT=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_FUSE=y CONFIG_CMD_GPIO=y From patchwork Wed Apr 27 10:41:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622920 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=TJLphtsE; 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 4KpFjD5Rkvz9sBy for ; Wed, 27 Apr 2022 20:43:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8D4FA83E15; Wed, 27 Apr 2022 12:43:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="TJLphtsE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 86B7083EDF; Wed, 27 Apr 2022 12:42:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5611A83ECD for ; Wed, 27 Apr 2022 12:42:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 0F49BCE2145; Wed, 27 Apr 2022 10:42:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B960C385A7; Wed, 27 Apr 2022 10:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056143; bh=Cn00Zh0Yz9Pqiaep+0RXXeRA3affvGNUGFl5umk66i8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TJLphtsE16VrI03uHzymCFPnilE8AdAQ4RswEIqPYmXq+YXIsRza/ZebNiNOnVYMk j66R+qUceyWdom1RRnOldSoNivfcy662EWP6IkJBN4skWCU/IoH506NtRaXAgENUDP dnVqJdqD/tm8lqtJiUL0D8R5bdhRX0/794qOOLrzcK5CrXEoxMZ+5mEqP0wG6Tmj+i KHgjf54WI+3izYpxpMK6mPxip9HcFx8o+13zT1Sb5APBAE3/bOiaNAAK4YEY/h4W5O PlbBrJ3l1DUZpxhm8QsfCPbBSp+aRg95br7oHtq/Cf21eyR+UNKJ2Vtt33s8+Z2rPQ sye/70TnlC3bw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= , Heinrich Schuchardt , Vladimir Oltean , Simon Glass Subject: [PATCH u-boot-marvell 06/19] net: mdio-uclass: add dm_phy_find_by_ofnode() helper Date: Wed, 27 Apr 2022 12:41:49 +0200 Message-Id: <20220427104202.1205-7-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Add helper to resolve PHY node from it's ofnode via DM MDIO subsystem. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- include/miiphy.h | 9 +++++++++ net/mdio-uclass.c | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/include/miiphy.h b/include/miiphy.h index 110921f20d..c66a1845b5 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -188,6 +188,15 @@ int dm_mdio_write(struct udevice *mdio_dev, int addr, int devad, int reg, u16 va */ int dm_mdio_reset(struct udevice *mdio_dev); +/** + * dm_phy_find_by_ofnode - Find PHY device by ofnode + * + * @phynode: PHY's ofnode + * + * Return: pointer to phy_device, or NULL on error + */ +struct phy_device *dm_phy_find_by_ofnode(ofnode phynode); + /** * dm_mdio_phy_connect - Wrapper over phy_connect for DM MDIO * diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c index 7593618d9a..4401492ca0 100644 --- a/net/mdio-uclass.c +++ b/net/mdio-uclass.c @@ -129,6 +129,28 @@ static int dm_mdio_pre_remove(struct udevice *dev) return 0; } +struct phy_device *dm_phy_find_by_ofnode(ofnode phynode) +{ + struct mdio_perdev_priv *pdata; + struct udevice *mdiodev; + u32 phy_addr; + + if (ofnode_read_u32(phynode, "reg", &phy_addr)) + return NULL; + + if (uclass_get_device_by_ofnode(UCLASS_MDIO, + ofnode_get_parent(phynode), + &mdiodev)) + return NULL; + + if (device_probe(mdiodev)) + return NULL; + + pdata = dev_get_uclass_priv(mdiodev); + + return phy_find_by_mask(pdata->mii_bus, BIT(phy_addr)); +} + struct phy_device *dm_mdio_phy_connect(struct udevice *mdiodev, int phyaddr, struct udevice *ethdev, phy_interface_t interface) From patchwork Wed Apr 27 10:41:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622922 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Zmyt0p4o; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4KpFjj2SSZz9sBy for ; Wed, 27 Apr 2022 20:44:08 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D76A083ED4; Wed, 27 Apr 2022 12:43:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="Zmyt0p4o"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B57E383EAB; Wed, 27 Apr 2022 12:42:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2953A83ECC for ; Wed, 27 Apr 2022 12:42:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 93E3BB82524; Wed, 27 Apr 2022 10:42:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C88CBC385AF; Wed, 27 Apr 2022 10:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056145; bh=hI2Inf1HERXRgY01wbeGWiftkTIaaQcQ3Q0CBm5M+ic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zmyt0p4o2vb7+1OlQJ55LJarrmYjil2ql7TbyYpf3/EFa0bWoLHDUIOn7s3a6lEQT TCG29EPaljEaxv9XAvcdKZUiPj5i7Voh+RCAENGkdtysXSBnIg7av4rVqm3/b0/Rg7 p4FOruU4moL2xYugu+IE25SL1XVF9fCWE3X04TvQaVrMy7+x0D6OG6uqLfXYzex8ze KztSCxnoKElZtAdYdMQ7I1qWORLIL/hAvXzteX+0l1OhbE6laopmPJuNo5BldvLiL8 7m68nPfyLEkNPJF3GFfgl38LZs6gjQbiNKxh40TS4Ftyw6zZGLeWok3AY31m7Ab2ay m0BTzhPomO6sg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 07/19] arm: mvebu: turris_mox: Use DM registered MDIO Date: Wed, 27 Apr 2022 12:41:50 +0200 Message-Id: <20220427104202.1205-8-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún In order to be able to get rid of the non-DM MDIO bus registered in mvneta driver, start using the DM registered one in Turris MOX board code. This also allows us to drop the hack introduced in MOX' -u-boot.dtsi file. Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- .../dts/armada-3720-turris-mox-u-boot.dtsi | 19 ---- board/CZ.NIC/turris_mox/turris_mox.c | 88 +++++++++---------- 2 files changed, 44 insertions(+), 63 deletions(-) diff --git a/arch/arm/dts/armada-3720-turris-mox-u-boot.dtsi b/arch/arm/dts/armada-3720-turris-mox-u-boot.dtsi index 28a36a6103..71d5e70ca4 100644 --- a/arch/arm/dts/armada-3720-turris-mox-u-boot.dtsi +++ b/arch/arm/dts/armada-3720-turris-mox-u-boot.dtsi @@ -3,25 +3,6 @@ * 2022 by Marek Behún */ -/ { - mdio { - #address-cells = <1>; - #size-cells = <0>; - - old_binding_phy1: ethernet-phy@1 { - reg = <1>; - }; - }; -}; - -ð0 { - pinctrl-0 = <&rgmii_pins>, <&smi_pins>; - /delete-property/ phy-handle; - phy = <&old_binding_phy1>; -}; - -/delete-node/ &mdio; - &usb3 { vbus-supply = <&exp_usb3_vbus>; }; diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c index 9702d1fc78..a4738b3a3c 100644 --- a/board/CZ.NIC/turris_mox/turris_mox.c +++ b/board/CZ.NIC/turris_mox/turris_mox.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -216,35 +217,35 @@ static int mox_get_topology(const u8 **ptopology, int *psize, int *pis_sd) #define SW_SMI_CMD_R(d, r) (0x9800 | (((d) & 0x1f) << 5) | ((r) & 0x1f)) #define SW_SMI_CMD_W(d, r) (0x9400 | (((d) & 0x1f) << 5) | ((r) & 0x1f)) -static int sw_multi_read(struct mii_dev *bus, int sw, int dev, int reg) +static int sw_multi_read(struct udevice *bus, int sw, int dev, int reg) { - bus->write(bus, sw, 0, 0, SW_SMI_CMD_R(dev, reg)); + dm_mdio_write(bus, sw, MDIO_DEVAD_NONE, 0, SW_SMI_CMD_R(dev, reg)); mdelay(5); - return bus->read(bus, sw, 0, 1); + return dm_mdio_read(bus, sw, MDIO_DEVAD_NONE, 1); } -static void sw_multi_write(struct mii_dev *bus, int sw, int dev, int reg, +static void sw_multi_write(struct udevice *bus, int sw, int dev, int reg, u16 val) { - bus->write(bus, sw, 0, 1, val); - bus->write(bus, sw, 0, 0, SW_SMI_CMD_W(dev, reg)); + dm_mdio_write(bus, sw, MDIO_DEVAD_NONE, 1, val); + dm_mdio_write(bus, sw, MDIO_DEVAD_NONE, 0, SW_SMI_CMD_W(dev, reg)); mdelay(5); } -static int sw_scratch_read(struct mii_dev *bus, int sw, int reg) +static int sw_scratch_read(struct udevice *bus, int sw, int reg) { sw_multi_write(bus, sw, 0x1c, 0x1a, (reg & 0x7f) << 8); return sw_multi_read(bus, sw, 0x1c, 0x1a) & 0xff; } -static void sw_led_write(struct mii_dev *bus, int sw, int port, int reg, +static void sw_led_write(struct udevice *bus, int sw, int port, int reg, u16 val) { sw_multi_write(bus, sw, port, 0x16, 0x8000 | ((reg & 7) << 12) | (val & 0x7ff)); } -static void sw_blink_leds(struct mii_dev *bus, int peridot, int topaz) +static void sw_blink_leds(struct udevice *bus, int peridot, int topaz) { int i, p; struct { @@ -275,7 +276,7 @@ static void sw_blink_leds(struct mii_dev *bus, int peridot, int topaz) } } -static void check_switch_address(struct mii_dev *bus, int addr) +static void check_switch_address(struct udevice *bus, int addr) { if (sw_scratch_read(bus, addr, 0x70) >> 3 != addr) printf("Check of switch MDIO address failed for 0x%02x\n", @@ -374,36 +375,22 @@ static void mox_phy_modify(struct phy_device *phydev, int page, int reg, static void mox_phy_leds_start_blinking(void) { struct phy_device *phydev; - struct mii_dev *bus; - const char *node_name; - int node; + ofnode phy_node; - node = fdt_path_offset(gd->fdt_blob, "ethernet0"); - if (node < 0) { - printf("Cannot get eth0!\n"); - return; - } + phy_node = ofnode_get_phy_node(ofnode_path("ethernet0")); + if (!ofnode_valid(phy_node)) + goto err; - node_name = fdt_get_name(gd->fdt_blob, node, NULL); - if (!node_name) { - printf("Cannot get eth0 node name!\n"); - return; - } - - bus = miiphy_get_dev_by_name(node_name); - if (!bus) { - printf("Cannot get MDIO bus device!\n"); - return; - } - - phydev = phy_find_by_mask(bus, BIT(1)); - if (!phydev) { - printf("Cannot get ethernet PHY!\n"); - return; - } + phydev = dm_phy_find_by_ofnode(phy_node); + if (!phydev) + goto err; mox_phy_modify(phydev, 3, 0x12, 0x700, 0x400); mox_phy_modify(phydev, 3, 0x10, 0xff, 0xbb); + + return; +err: + printf("Cannot get ethernet PHY!\n"); } static bool read_reset_button(void) @@ -611,6 +598,26 @@ int show_board_info(void) return 0; } +static struct udevice *mox_mdio_bus(void) +{ + struct udevice *bus; + ofnode node; + + node = ofnode_by_compatible(ofnode_null(), "marvell,orion-mdio"); + if (!ofnode_valid(node)) + goto err; + + dm_mdio_probe_devices(); + + if (uclass_get_device_by_ofnode(UCLASS_MDIO, node, &bus)) + goto err; + + return bus; +err: + printf("Cannot get MDIO bus device!\n"); + return NULL; +} + int last_stage_init(void) { struct gpio_desc reset_gpio = {}; @@ -636,16 +643,9 @@ int last_stage_init(void) * 0x70 of Peridot (and potentially Topaz) modules */ if (peridot || topaz) { - struct mii_dev *bus; - const char *node_name; - int node; + struct udevice *bus = mox_mdio_bus(); - node = fdt_path_offset(gd->fdt_blob, "ethernet0"); - node_name = (node >= 0) ? fdt_get_name(gd->fdt_blob, node, NULL) : NULL; - bus = node_name ? miiphy_get_dev_by_name(node_name) : NULL; - if (!bus) { - printf("Cannot get MDIO bus device!\n"); - } else { + if (bus) { int i; for (i = 0; i < peridot; ++i) From patchwork Wed Apr 27 10:41:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622921 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=XKTMBLAH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4KpFjS4HL4z9sBy for ; Wed, 27 Apr 2022 20:43:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D882083E9B; Wed, 27 Apr 2022 12:43:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="XKTMBLAH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2FB4D83ECF; Wed, 27 Apr 2022 12:42:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4717683ED1 for ; Wed, 27 Apr 2022 12:42:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 089DB61D3E; Wed, 27 Apr 2022 10:42:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D23BCC385AA; Wed, 27 Apr 2022 10:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056147; bh=gS7NNtlvJ64NvbJrCxkUFD1ssjl8/EaYyRI9qfA0MDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XKTMBLAHbVHKCJa8pJ/ykTkqEllU8bnFa9Pya1JLlmhv14bkfwstALqQsj+kK49bg RknO2WqqN+2cSWhgAMG/5DijZkxv7CQ1V0xo35g7DWyyGEB7LBE+99Da5QhI10Z9MS bL66sM1zWkJm9FQV+jIMniYdJFcl6RHhae124nNW3RzZpwAObTTJ/iOaNYUVFErayU DWZlOHG2ctbXXNCT1veBiJMdeK4l+8YLsiCqDoSin5N8zhssTU38CJ0PWpczsxDE0x NrT0QV7Z+qHIQpVxeqzDAjog4HIoicxFjmHsvXIhWeCR7EWlur4vUwqK04DrEjDOgZ /dWFUH0mxwo9g== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 08/19] net: mvneta: Don't register MDIO bus Date: Wed, 27 Apr 2022 12:41:51 +0200 Message-Id: <20220427104202.1205-9-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún This MDIO bus is now handled by a proper mvmdio DM driver. Remove it from mvneta. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 143 +------------------------------------------ 1 file changed, 2 insertions(+), 141 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 83e9629138..19f8145fc0 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -288,7 +288,6 @@ struct mvneta_port { struct gpio_desc phy_reset_gpio; struct gpio_desc sfp_tx_disable_gpio; #endif - struct mii_dev *bus; }; /* The mvneta_tx_desc and mvneta_rx_desc structures describe the @@ -414,15 +413,6 @@ static struct buffer_location buffer_loc; */ #define BD_SPACE (1 << 20) -/* - * Dummy implementation that can be overwritten by a board - * specific function - */ -__weak int board_network_enable(struct mii_dev *bus) -{ - return 0; -} - /* Utility/helper methods */ /* Write helper method */ @@ -1421,118 +1411,6 @@ static int mvneta_init(struct udevice *dev) /* U-Boot only functions follow here */ -/* SMI / MDIO functions */ - -static int smi_wait_ready(struct mvneta_port *pp) -{ - u32 timeout = MVNETA_SMI_TIMEOUT; - u32 smi_reg; - - /* wait till the SMI is not busy */ - do { - /* read smi register */ - smi_reg = mvreg_read(pp, MVNETA_SMI); - if (timeout-- == 0) { - printf("Error: SMI busy timeout\n"); - return -EFAULT; - } - } while (smi_reg & MVNETA_SMI_BUSY); - - return 0; -} - -/* - * mvneta_mdio_read - miiphy_read callback function. - * - * Returns 16bit phy register value, or 0xffff on error - */ -static int mvneta_mdio_read(struct mii_dev *bus, int addr, int devad, int reg) -{ - struct mvneta_port *pp = bus->priv; - u32 smi_reg; - u32 timeout; - - /* check parameters */ - if (addr > MVNETA_PHY_ADDR_MASK) { - printf("Error: Invalid PHY address %d\n", addr); - return -EFAULT; - } - - if (reg > MVNETA_PHY_REG_MASK) { - printf("Err: Invalid register offset %d\n", reg); - return -EFAULT; - } - - /* wait till the SMI is not busy */ - if (smi_wait_ready(pp) < 0) - return -EFAULT; - - /* fill the phy address and regiser offset and read opcode */ - smi_reg = (addr << MVNETA_SMI_DEV_ADDR_OFFS) - | (reg << MVNETA_SMI_REG_ADDR_OFFS) - | MVNETA_SMI_OPCODE_READ; - - /* write the smi register */ - mvreg_write(pp, MVNETA_SMI, smi_reg); - - /* wait till read value is ready */ - timeout = MVNETA_SMI_TIMEOUT; - - do { - /* read smi register */ - smi_reg = mvreg_read(pp, MVNETA_SMI); - if (timeout-- == 0) { - printf("Err: SMI read ready timeout\n"); - return -EFAULT; - } - } while (!(smi_reg & MVNETA_SMI_READ_VALID)); - - /* Wait for the data to update in the SMI register */ - for (timeout = 0; timeout < MVNETA_SMI_TIMEOUT; timeout++) - ; - - return mvreg_read(pp, MVNETA_SMI) & MVNETA_SMI_DATA_MASK; -} - -/* - * mvneta_mdio_write - miiphy_write callback function. - * - * Returns 0 if write succeed, -EINVAL on bad parameters - * -ETIME on timeout - */ -static int mvneta_mdio_write(struct mii_dev *bus, int addr, int devad, int reg, - u16 value) -{ - struct mvneta_port *pp = bus->priv; - u32 smi_reg; - - /* check parameters */ - if (addr > MVNETA_PHY_ADDR_MASK) { - printf("Error: Invalid PHY address %d\n", addr); - return -EFAULT; - } - - if (reg > MVNETA_PHY_REG_MASK) { - printf("Err: Invalid register offset %d\n", reg); - return -EFAULT; - } - - /* wait till the SMI is not busy */ - if (smi_wait_ready(pp) < 0) - return -EFAULT; - - /* fill the phy addr and reg offset and write opcode and data */ - smi_reg = value << MVNETA_SMI_DATA_OFFS; - smi_reg |= (addr << MVNETA_SMI_DEV_ADDR_OFFS) - | (reg << MVNETA_SMI_REG_ADDR_OFFS); - smi_reg &= ~MVNETA_SMI_OPCODE_READ; - - /* write the smi register */ - mvreg_write(pp, MVNETA_SMI, smi_reg); - - return 0; -} - static int mvneta_start(struct udevice *dev) { struct mvneta_port *pp = dev_get_priv(dev); @@ -1690,10 +1568,9 @@ static int mvneta_probe(struct udevice *dev) #endif void *blob = (void *)gd->fdt_blob; int node = dev_of_offset(dev); - struct mii_dev *bus; void *bd_space; - int ret; int fl_node; + int ret; /* * Allocate buffer area for descs and rx_buffers. This is only @@ -1739,22 +1616,6 @@ static int mvneta_probe(struct udevice *dev) pp->fixed_link = true; } - bus = mdio_alloc(); - if (!bus) { - printf("Failed to allocate MDIO bus\n"); - return -ENOMEM; - } - - bus->read = mvneta_mdio_read; - bus->write = mvneta_mdio_write; - snprintf(bus->name, sizeof(bus->name), dev->name); - bus->priv = (void *)pp; - pp->bus = bus; - - ret = mdio_register(bus); - if (ret) - return ret; - #if CONFIG_IS_ENABLED(DM_GPIO) ret = dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args); if (!ret && ofnode_is_enabled(sfp_args.node)) @@ -1774,7 +1635,7 @@ static int mvneta_probe(struct udevice *dev) dm_gpio_set_value(&pp->sfp_tx_disable_gpio, 0); #endif - return board_network_enable(bus); + return 0; } static void mvneta_stop(struct udevice *dev) From patchwork Wed Apr 27 10:41:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622923 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=aC3DUgL/; 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 4KpFjw6pkpz9sBy for ; Wed, 27 Apr 2022 20:44:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 541D683EAD; Wed, 27 Apr 2022 12:43:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="aC3DUgL/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B99B083E9B; Wed, 27 Apr 2022 12:42:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3A57583E4F for ; Wed, 27 Apr 2022 12:42:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2A0FB61D41; Wed, 27 Apr 2022 10:42:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAD27C385A9; Wed, 27 Apr 2022 10:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056149; bh=QZf6lN6o+2WF+RT5f6SiWB8aYggj3yl9hQbRdo1tDWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aC3DUgL/uy6tnc2tO74fZFfba4eUH1H0Cf3ah9EaukwJMP10IWX4uum7AdHiNehd3 fD64v7i2XedjeWzQuZ0l2ttOaRin+rSme3O+UBERtGkHXPUksTp6HSTrn4hFUXkI5V /Hy7m9Ja+CYq0jb7qyQARv7JDmyO3GT2W3ngjsockNF+mp2PDvit9iU4o8lotAVBqx p/L2rSFZ+qTuXPPNhwY79BodbiJhFJy3tQiCYFjolqjmRwPQDbRh98ljzq26jB7GOL kCMiYRC0OvLYPd8LqwTl/g3UooivlFzD5g8iqfDCmXI5S5Y0X9DWY2wO3/q4LZTJE3 WHFTgyh5dI4rQ== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 09/19] net: mvneta: Fix unused variable warning if DM_GPIO is disabled Date: Wed, 27 Apr 2022 12:41:52 +0200 Message-Id: <20220427104202.1205-10-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún The `ret` variable in mvneta_probe() is unused if DM_GPIO is disabled. Since the variable is used only once after assigning value, we can inline the usage and drop the variable. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 19f8145fc0..72789fc5c6 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1570,7 +1570,6 @@ static int mvneta_probe(struct udevice *dev) int node = dev_of_offset(dev); void *bd_space; int fl_node; - int ret; /* * Allocate buffer area for descs and rx_buffers. This is only @@ -1617,8 +1616,8 @@ static int mvneta_probe(struct udevice *dev) } #if CONFIG_IS_ENABLED(DM_GPIO) - ret = dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args); - if (!ret && ofnode_is_enabled(sfp_args.node)) + if (!dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args) && + ofnode_is_enabled(sfp_args.node)) gpio_request_by_name_nodev(sfp_args.node, "tx-disable-gpio", 0, &pp->sfp_tx_disable_gpio, GPIOD_IS_OUT); From patchwork Wed Apr 27 10:41:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622925 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Ts30dBr4; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4KpFkM3Wllz9sBy for ; Wed, 27 Apr 2022 20:44:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A32D83EEF; Wed, 27 Apr 2022 12:43:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="Ts30dBr4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9FFAF83EF3; Wed, 27 Apr 2022 12:42:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 239E983E49 for ; Wed, 27 Apr 2022 12:42:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C4677B82524; Wed, 27 Apr 2022 10:42:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E39ECC385AA; Wed, 27 Apr 2022 10:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056151; bh=548g0PsmLWlfXo4wnjuv/wDfBWn0Jf6OeyuqrBwWG7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ts30dBr4AK0O58Vzhm8VKX2HDVk+P8UGXN9nyjwkdk/g0WzFnVxht17dRQPEyr4vP zDCps44AsR9IjLQHLOFwHQ+pujVeo4GYTBdr9z5gPfN2/CtW2dz83wsZ8l9KDqtyjR Qy4OxrUSf0LK0CoGSlbds6Uqo5nllL8d+Oz0gyKq+NG3zrUjx8rkKZUHvG0JCDnQHm OvjkaYwFJD1ENt/v9iRZkd+pNtS4xIhC6YK+5x8l/M68EFF/XpY+et9iYXZgUR3pqc Oj6sHNW5E6inKRbgDlvGNeWto1SNjsFDuyPaxNbmFI2XhK+4IxWmWXst4PxT7a0Pq6 gLsHPVHdhVQAQ== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 10/19] net: mvneta: Drop one indentation level in mvneta_adjust_link() Date: Wed, 27 Apr 2022 12:41:53 +0200 Message-Id: <20220427104202.1205-11-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Drop one indentation level in the mvneta_adjust_link() function. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 72789fc5c6..66d5e10174 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1161,31 +1161,29 @@ static void mvneta_adjust_link(struct udevice *dev) return; } - if (phydev->link) { - if ((pp->speed != phydev->speed) || - (pp->duplex != phydev->duplex)) { - u32 val; + if (phydev->link && + (pp->speed != phydev->speed || pp->duplex != phydev->duplex)) { + u32 val; - val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG); - val &= ~(MVNETA_GMAC_CONFIG_MII_SPEED | - MVNETA_GMAC_CONFIG_GMII_SPEED | - MVNETA_GMAC_CONFIG_FULL_DUPLEX | - MVNETA_GMAC_AN_SPEED_EN | - MVNETA_GMAC_AN_DUPLEX_EN); + val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG); + val &= ~(MVNETA_GMAC_CONFIG_MII_SPEED | + MVNETA_GMAC_CONFIG_GMII_SPEED | + MVNETA_GMAC_CONFIG_FULL_DUPLEX | + MVNETA_GMAC_AN_SPEED_EN | + MVNETA_GMAC_AN_DUPLEX_EN); - if (phydev->duplex) - val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX; + if (phydev->duplex) + val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX; - if (phydev->speed == SPEED_1000) - val |= MVNETA_GMAC_CONFIG_GMII_SPEED; - else if (pp->speed == SPEED_100) - val |= MVNETA_GMAC_CONFIG_MII_SPEED; + if (phydev->speed == SPEED_1000) + val |= MVNETA_GMAC_CONFIG_GMII_SPEED; + else if (pp->speed == SPEED_100) + val |= MVNETA_GMAC_CONFIG_MII_SPEED; - mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); + mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); - pp->duplex = phydev->duplex; - pp->speed = phydev->speed; - } + pp->duplex = phydev->duplex; + pp->speed = phydev->speed; } if (phydev->link != pp->link) { From patchwork Wed Apr 27 10:41:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622933 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=LhMNEcEs; 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 4KpFmD4gKcz9sBy for ; Wed, 27 Apr 2022 20:46:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 51D7083EE0; Wed, 27 Apr 2022 12:45:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="LhMNEcEs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2851983EA0; Wed, 27 Apr 2022 12:43:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 39F5383EA6 for ; Wed, 27 Apr 2022 12:42:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CE0BFB82576; Wed, 27 Apr 2022 10:42:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC646C385AE; Wed, 27 Apr 2022 10:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056153; bh=irRUX7KhdkYtcd6ZuJSDFTuHXloOsioe/0f9VjOutKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LhMNEcEsXhDPFdllVFTiAJHTYT94C0BN2OwtnFz/cVVE6fyp79JgT+QasbuOgy/UQ xat9/A2olDBD5qK1lyGAfBTKxos+qm3FBFcRrjrTHnCYbv/yItfAxlC3GnDjh9hTRh I0Qmu2QvaEHVAnnbxefImK8XrUiWY0fj4pmKruzIJ2l+If5ZWzRU2WOy/H/DQa0Va7 eRMA3lXP0joZO+mK8r1tiLlQrn6x1IvHdsT6F3b0C+4bKnzueSCOZp1hN6KdBWU7pj ITssm7xzj7o6yS+ZLzBmALvDRiEvgXhAUrrdzvGnWHQ0rO801vGAo9QXjsVREV3b0F /duCEPmO+7eng== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 11/19] net: mvneta: Use bool instead of int for boolean variable Date: Wed, 27 Apr 2022 12:41:54 +0200 Message-Id: <20220427104202.1205-12-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Use the bool type instead of int for status_change variable. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 66d5e10174..7d582c1206 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1154,7 +1154,7 @@ static void mvneta_adjust_link(struct udevice *dev) { struct mvneta_port *pp = dev_get_priv(dev); struct phy_device *phydev = pp->phydev; - int status_change = 0; + bool status_change = false; if (pp->fixed_link) { debug("Using fixed link, skip link adjust\n"); @@ -1193,7 +1193,7 @@ static void mvneta_adjust_link(struct udevice *dev) } pp->link = phydev->link; - status_change = 1; + status_change = true; } if (status_change) { From patchwork Wed Apr 27 10:41:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622924 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=CSmrduWe; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4KpFk80vJcz9sBy for ; Wed, 27 Apr 2022 20:44:32 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A104E83ED8; Wed, 27 Apr 2022 12:43:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="CSmrduWe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EEAED83B38; Wed, 27 Apr 2022 12:42:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 85B4183ED8 for ; Wed, 27 Apr 2022 12:42:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F9FB61C19; Wed, 27 Apr 2022 10:42:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 009A4C385AA; Wed, 27 Apr 2022 10:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056155; bh=2l1ff4rg3Rsttq7PgqCEsr7tAGjfwpErvqq8fvLFng0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CSmrduWewrEliqkaZh7O5atEJLO8Os97cK1LDXSMX8eGlCmmmFLfdha9Ji2I7dTax QIRa0JcKX4CYB0ykuoNQFfqqqQT/qmYUeQp01I4jktEuxHqIC0XR4zikziQbMEqfii qJ+QL2wx2w0y3u2dfqwe0xtZ/0ftLeUf/iab9PuATC/Y6/pILr50fWd8pREzFyqFPe V1QzoHeQkcI8yNHw0R+ekwq721UaQG/JSr60cGxLpueKZsh60Z/k/BKSlkZy54eLp/ okqJqmm82xyQbHx8afoerbGzPxHTb0VjROZ1HOmMSFJEnw49QzNwjH71LnQ7m5YiBg Uar1NXYFgLjCQ== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 12/19] net: mvneta: Drop unnecessary space Date: Wed, 27 Apr 2022 12:41:55 +0200 Message-Id: <20220427104202.1205-13-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Drop unnecessary space in mvneta_adjust_link(). Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 7d582c1206..5c3f7125b5 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1183,7 +1183,7 @@ static void mvneta_adjust_link(struct udevice *dev) mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); pp->duplex = phydev->duplex; - pp->speed = phydev->speed; + pp->speed = phydev->speed; } if (phydev->link != pp->link) { From patchwork Wed Apr 27 10:41:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622927 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pA+wy8rs; 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 4KpFkq4GSHz9sBy for ; Wed, 27 Apr 2022 20:45:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CDEED83ECD; Wed, 27 Apr 2022 12:43:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="pA+wy8rs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 96FCE83EF1; Wed, 27 Apr 2022 12:42:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4644183EAF for ; Wed, 27 Apr 2022 12:42:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EA13CB82576; Wed, 27 Apr 2022 10:42:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 124F6C385AE; Wed, 27 Apr 2022 10:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056157; bh=1+OmBfNf1lf/SA1KC4Fj7lNEREtQIVv1MRe/4BqHSHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pA+wy8rs0qMwyA9AoLQF3UInZDA0x2kjEz+KYNZir53rcgVVtYvS3wXe2m+rOJgBB yh+T8G97Wh1/C+rSnkxpPw5JN/0BEmbDLfCb5tYtnggOZHIcm6DD6iq7A15L3QUk+v +Csn+Y0yIsZ6Aj+jfn1a2Y6PA6vyw+Wxo0xDjPhwvRSj94B1kH6V+tUpSQ8UhGCgUY kA2sGnugMsDdAoZ/uTOGLuNwDon4SuvQNQymqovo0T+PBAFOL53t78sJS0W8NHhdDT 3KCyRdh/XTNJlPkG8BGvFkIBiOrZ3WbJKe4jiCQVXF9APPYKGG+Yt6Px3CW/vAX/DK y0cMc5jt8VPOQ== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 13/19] net: mvneta: Don't check for CONFIG_PHYLIB Date: Wed, 27 Apr 2022 12:41:56 +0200 Message-Id: <20220427104202.1205-14-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Drop checking for CONFIG_PHYLIB in mvneta, this is already done in Kconfig. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 5c3f7125b5..0ec9d2957c 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -40,10 +40,6 @@ DECLARE_GLOBAL_DATA_PTR; -#if !defined(CONFIG_PHYLIB) -# error Marvell mvneta requires PHYLIB -#endif - #define CONFIG_NR_CPUS 1 #define ETH_HLEN 14 /* Total octets in header */ From patchwork Wed Apr 27 10:41:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622926 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=jE5IGoOm; 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 4KpFkb16Mrz9sBy for ; Wed, 27 Apr 2022 20:44:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 468CD83EDF; Wed, 27 Apr 2022 12:43:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="jE5IGoOm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12F5E83EAF; Wed, 27 Apr 2022 12:42:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A254583E58 for ; Wed, 27 Apr 2022 12:42:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 69BF161D41; Wed, 27 Apr 2022 10:42:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AB92C385AA; Wed, 27 Apr 2022 10:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056159; bh=VWlkS10G9Ghi6N1jFDMJasyax5/4XHkU5zl8KlynGOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jE5IGoOmHzoW4Z9bpks8gcCJgO5uz27GWpia9gmmxaBYRQqb6I2v9JiMuBNjrfFus Dqw5OXoA0z8xphjbUAxwQFfaUTxIfhKcQM5ihdgiKa52/aVunIjjAvnBjfKyFsQvMd wClpziwbDRU0sb1a+Sr4VlP2zWvAGXksedgGty84o4MG/eotDnvs2JJetYXTTJEh56 nQZcECLCUsLXWFM+4AdKoTjOMP8o3BHKL0WYDdX7gjahU+iN6IiY+LbwwYDcGucmtF UqiFISoJ/GGRjHxHIXrgrAwfec5cLaF3ymf4HdlSRu9CyboiODzgXrrBx50VZQya7+ xGTvpEIXbjOgg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 14/19] net: mvneta: Rename CONFIG_NR_CPUS to MVNETA_NR_CPUS Date: Wed, 27 Apr 2022 12:41:57 +0200 Message-Id: <20220427104202.1205-15-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún The CONFIG_* macros are reserved for Kconfig. This was probably done when this driver was being imported from Linux. Rename the macro. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 0ec9d2957c..519e06ff01 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -40,7 +40,7 @@ DECLARE_GLOBAL_DATA_PTR; -#define CONFIG_NR_CPUS 1 +#define MVNETA_NR_CPUS 1 #define ETH_HLEN 14 /* Total octets in header */ /* 2(HW hdr) 14(MAC hdr) 4(CRC) 32(extra for cache prefetch) */ @@ -770,7 +770,7 @@ static void mvneta_defaults_set(struct mvneta_port *pp) /* Set CPU queue access map - all CPUs have access to all RX * queues and to all TX queues */ - for (cpu = 0; cpu < CONFIG_NR_CPUS; cpu++) + for (cpu = 0; cpu < MVNETA_NR_CPUS; cpu++) mvreg_write(pp, MVNETA_CPU_MAP(cpu), (MVNETA_CPU_RXQ_ACCESS_ALL_MASK | MVNETA_CPU_TXQ_ACCESS_ALL_MASK)); From patchwork Wed Apr 27 10:41:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622932 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=p/h6TMUZ; 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 4KpFlz4tfjz9sBy for ; Wed, 27 Apr 2022 20:46:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6339883E9B; Wed, 27 Apr 2022 12:45:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="p/h6TMUZ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB84683D3D; Wed, 27 Apr 2022 12:43:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D09F383EEC for ; Wed, 27 Apr 2022 12:42:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4D43F61D41; Wed, 27 Apr 2022 10:42:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23541C385AF; Wed, 27 Apr 2022 10:42:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056161; bh=o3pSrISZnBeagEMsdKXsNmddgsuDadx2ZA1k2z1MtUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p/h6TMUZQDl9ynAN+CJ6Wx3VCpnpB9oY/qOrOIQUFxmjV0KItIsVYdJHrXQLdOWUc ZoTP2Ae+fnD7nMAADnF3hWtbKNlBbPIqOgRSOcgM4sNz2RzellOeZIcd42Q5gDCV1a j5vTKgdDMYyUr5AtWL2WngijhSD6LqCk+xpSlZb+ORGsFmqXzP9amDrd9PVz4mU9WN aSF8b1aM5AaQtqr/QZH6Zx5x2GRcC5gijZlImAXst5PjeNDtkX0dbVi1NEhSU/XmNG 9mezR8mu9rfjT5lGS4VpHaPOxY/fL7Yi7z7zMJen7Mv7L8qCAm+bEucFCCDlAG6J45 UpQGfNBoU/y1A== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 15/19] net: mvneta: Convert to use PHY_FIXED for fixed-link Date: Wed, 27 Apr 2022 12:41:58 +0200 Message-Id: <20220427104202.1205-16-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Stop parsing fixed-link in the MAC driver. Instead support only PHY mode and let the fixed PHY driver handle the fixed-link case. Enable CONFIG_PHY_FIXED for mvneta boards that need it: Turris Omnia and ESPRESSObin. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- configs/mvebu_espressobin-88f3720_defconfig | 1 + configs/turris_omnia_defconfig | 1 + drivers/net/mvneta.c | 98 ++++++++------------- 3 files changed, 39 insertions(+), 61 deletions(-) diff --git a/configs/mvebu_espressobin-88f3720_defconfig b/configs/mvebu_espressobin-88f3720_defconfig index 37e4fdc41e..8d7d57ff1b 100644 --- a/configs/mvebu_espressobin-88f3720_defconfig +++ b/configs/mvebu_espressobin-88f3720_defconfig @@ -74,6 +74,7 @@ CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_WINBOND=y CONFIG_SPI_FLASH_MTD=y CONFIG_PHY_MARVELL=y +CONFIG_PHY_FIXED=y CONFIG_PHY_GIGE=y CONFIG_E1000=y CONFIG_MVNETA=y diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig index 6b218bd7a7..bdd70f2ba7 100644 --- a/configs/turris_omnia_defconfig +++ b/configs/turris_omnia_defconfig @@ -79,6 +79,7 @@ CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SPI_FLASH_SPANSION=y CONFIG_SPI_FLASH_MTD=y CONFIG_PHY_MARVELL=y +CONFIG_PHY_FIXED=y CONFIG_PHY_GIGE=y CONFIG_MVNETA=y CONFIG_MII=y diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 519e06ff01..5b1c4fe5fc 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -1152,11 +1152,6 @@ static void mvneta_adjust_link(struct udevice *dev) struct phy_device *phydev = pp->phydev; bool status_change = false; - if (pp->fixed_link) { - debug("Using fixed link, skip link adjust\n"); - return; - } - if (phydev->link && (pp->speed != phydev->speed || pp->duplex != phydev->duplex)) { u32 val; @@ -1168,6 +1163,21 @@ static void mvneta_adjust_link(struct udevice *dev) MVNETA_GMAC_AN_SPEED_EN | MVNETA_GMAC_AN_DUPLEX_EN); + /* FIXME: For fixed-link case, these were the initial settings + * used before the code was converted to use PHY_FIXED. Some of + * these may look nonsensical (for example BYPASS_AN makes sense + * for 1000base-x and 2500base-x modes, AFAIK), and in fact this + * may be changed in the future (when support for inband AN will + * be added). Also, why is ADVERT_FC enabled if we don't enable + * inband AN at all? + */ + if (pp->fixed_link) + val = MVNETA_GMAC_FORCE_LINK_UP | + MVNETA_GMAC_IB_BYPASS_AN_EN | + MVNETA_GMAC_SET_FC_EN | + MVNETA_GMAC_ADVERT_FC_EN | + MVNETA_GMAC_SAMPLE_TX_CFG_EN; + if (phydev->duplex) val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX; @@ -1413,56 +1423,34 @@ static int mvneta_start(struct udevice *dev) mvneta_port_power_up(pp, pp->phy_interface); if (!pp->init || pp->link == 0) { - if (pp->fixed_link) { - u32 val; - - pp->init = 1; - pp->link = 1; - mvneta_init(dev); - - val = MVNETA_GMAC_FORCE_LINK_UP | - MVNETA_GMAC_IB_BYPASS_AN_EN | - MVNETA_GMAC_SET_FC_EN | - MVNETA_GMAC_ADVERT_FC_EN | - MVNETA_GMAC_SAMPLE_TX_CFG_EN; - - if (pp->duplex) - val |= MVNETA_GMAC_CONFIG_FULL_DUPLEX; - - if (pp->speed == SPEED_1000) - val |= MVNETA_GMAC_CONFIG_GMII_SPEED; - else if (pp->speed == SPEED_100) - val |= MVNETA_GMAC_CONFIG_MII_SPEED; + phydev = dm_eth_phy_connect(dev); + if (!phydev) { + printf("dm_eth_phy_connect failed\n"); + return -ENODEV; + } - mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); - } else { - phydev = dm_eth_phy_connect(dev); - if (!phydev) { - printf("dm_eth_phy_connect failed\n"); - return -ENODEV; - } + pp->fixed_link = phydev->phy_id == PHY_FIXED_ID; - /* Set PHY address in case we will enable HW polling */ + /* Set PHY address in case we will enable HW polling */ + if (!pp->fixed_link) mvreg_write(pp, MVNETA_PHY_ADDR, phydev->addr); - pp->phydev = phydev; - phy_config(phydev); - phy_startup(phydev); - if (!phydev->link) { - printf("%s: No link.\n", phydev->dev->name); - return -1; - } - - /* Full init on first call */ - mvneta_init(dev); - pp->init = 1; - return 0; + pp->phydev = phydev; + phy_config(phydev); + phy_startup(phydev); + if (!phydev->link) { + printf("%s: No link.\n", phydev->dev->name); + return -1; } - } - /* Upon all following calls, this is enough */ - mvneta_port_up(pp); - mvneta_port_enable(pp); + /* Full init on first call */ + mvneta_init(dev); + pp->init = 1; + } else { + /* Upon all following calls, this is enough */ + mvneta_port_up(pp); + mvneta_port_enable(pp); + } return 0; } @@ -1560,10 +1548,7 @@ static int mvneta_probe(struct udevice *dev) #if CONFIG_IS_ENABLED(DM_GPIO) struct ofnode_phandle_args sfp_args; #endif - void *blob = (void *)gd->fdt_blob; - int node = dev_of_offset(dev); void *bd_space; - int fl_node; /* * Allocate buffer area for descs and rx_buffers. This is only @@ -1600,15 +1585,6 @@ static int mvneta_probe(struct udevice *dev) else mvneta_conf_mbus_windows(pp); - /* fetch 'fixed-link' property from 'neta' node */ - fl_node = fdt_subnode_offset(blob, node, "fixed-link"); - if (fl_node != -FDT_ERR_NOTFOUND) { - /* set phy_addr to invalid value for fixed link */ - pp->duplex = fdtdec_get_bool(blob, fl_node, "full-duplex"); - pp->speed = fdtdec_get_int(blob, fl_node, "speed", 0); - pp->fixed_link = true; - } - #if CONFIG_IS_ENABLED(DM_GPIO) if (!dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args) && ofnode_is_enabled(sfp_args.node)) From patchwork Wed Apr 27 10:41:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622928 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=UMFtZpxX; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4KpFl3220Mz9sBy for ; Wed, 27 Apr 2022 20:45:19 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5294683EF9; Wed, 27 Apr 2022 12:43:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="UMFtZpxX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0B66983E3A; Wed, 27 Apr 2022 12:43:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6FD8083ECA for ; Wed, 27 Apr 2022 12:42:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5A0E161C19; Wed, 27 Apr 2022 10:42:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C54AC385A7; Wed, 27 Apr 2022 10:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056163; bh=v9BoBRgZW3UK9kuO0aEbvyn2Lubqcx8xZge/UBP/vdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UMFtZpxXK7cvGSs3rdxNsHV6ULk219gTfGHavI1VPTVpwQ6rHZC2usHcBd7I5Hbio hC1Ija2nY9i6Qr3lUfYoVwmdBZr8qWcFk+NHZR+k6J8gH64iX4ZN+SB+wZFmBtqEOQ mXFnhyyOkS4YhLAhXThX+7SdQB6Z3GRU9Jd6G5loViIVgsgdNx4cBJrLIdXBaF6TOl 0PlBidQJaX4WxTPCFtDsQdAQ5zQjSQcbOCWRNwFP1BllZXrEH/ZqIrkKNfRf2DjZ6s OqFe6fPGDa6fA/JxIYe2Cx3/MRKlHp6ToK2YpIxwDs7/FJrNAt574hAJmKBjzRv4dv 1lHw9DvQOG9yQ== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 16/19] net: mvneta: Write PHY address just before enabling HW polling Date: Wed, 27 Apr 2022 12:41:59 +0200 Message-Id: <20220427104202.1205-17-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Write PHY address just before enabling HW polling of the PHY. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 5b1c4fe5fc..4917857681 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -814,6 +814,8 @@ static void mvneta_defaults_set(struct mvneta_port *pp) /* Enable PHY polling in hardware if not in fixed-link mode */ if (!pp->fixed_link) { + mvreg_write(pp, MVNETA_PHY_ADDR, pp->phydev->addr); + val = mvreg_read(pp, MVNETA_UNIT_CONTROL); val |= MVNETA_PHY_POLLING_ENABLE; mvreg_write(pp, MVNETA_UNIT_CONTROL, val); @@ -1431,10 +1433,6 @@ static int mvneta_start(struct udevice *dev) pp->fixed_link = phydev->phy_id == PHY_FIXED_ID; - /* Set PHY address in case we will enable HW polling */ - if (!pp->fixed_link) - mvreg_write(pp, MVNETA_PHY_ADDR, phydev->addr); - pp->phydev = phydev; phy_config(phydev); phy_startup(phydev); From patchwork Wed Apr 27 10:42:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622929 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=IwqB/YI2; 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 4KpFlH12w3z9sBy for ; Wed, 27 Apr 2022 20:45:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1241E83EF5; Wed, 27 Apr 2022 12:43:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="IwqB/YI2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 90ABB83E4F; Wed, 27 Apr 2022 12:43:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6C59C83EE7 for ; Wed, 27 Apr 2022 12:42:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 21D20B82602; Wed, 27 Apr 2022 10:42:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34E11C385AF; Wed, 27 Apr 2022 10:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056165; bh=iAs9ETvJRpYB1MIZZFqPmive0id9Ryq6E/1lGLx76Lk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IwqB/YI2z5jjHu1XTUo4aV3aX+wk84y4PzfSwqTWTYwFNSCng7e8M5Tds/alzSxW2 WJ2+pDCxkqaAWMbZpNOJpbCfTavzrfDtsaCR4J8Hfl3RyC4P2A0k7KVx1MtDJKRyP7 uH5/NvoUpCM0lAMObew3XWdTA0qYuI83CMm48+FH0XPShmPxxPDhU9ndN8OMERSpug 92KbTQbL09G5hc9uE9bMXy6VSgwYbjJPjky9InCtBS8xsq/4gMuU3sMKL4IEvWo9nk pIUIWQItcynjdVmh4qfXdN7sIfMxMB5K+wTWv1khoaFbf++13Q0CDKd0MQBkgayhVo pg1CxQgmTgH+w== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 17/19] net: mvneta: Drop fixed_link member from private struct Date: Wed, 27 Apr 2022 12:42:00 +0200 Message-Id: <20220427104202.1205-18-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Since this member is checked only at two places drop it and inline it's usage. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 4917857681..378789b632 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -273,7 +273,6 @@ struct mvneta_port { u16 rx_ring_size; phy_interface_t phy_interface; - bool fixed_link; unsigned int link; unsigned int duplex; unsigned int speed; @@ -813,7 +812,7 @@ static void mvneta_defaults_set(struct mvneta_port *pp) mvreg_write(pp, MVNETA_SDMA_CONFIG, val); /* Enable PHY polling in hardware if not in fixed-link mode */ - if (!pp->fixed_link) { + if (pp->phydev->phy_id != PHY_FIXED_ID) { mvreg_write(pp, MVNETA_PHY_ADDR, pp->phydev->addr); val = mvreg_read(pp, MVNETA_UNIT_CONTROL); @@ -1173,7 +1172,7 @@ static void mvneta_adjust_link(struct udevice *dev) * be added). Also, why is ADVERT_FC enabled if we don't enable * inband AN at all? */ - if (pp->fixed_link) + if (pp->phydev->phy_id == PHY_FIXED_ID) val = MVNETA_GMAC_FORCE_LINK_UP | MVNETA_GMAC_IB_BYPASS_AN_EN | MVNETA_GMAC_SET_FC_EN | @@ -1431,8 +1430,6 @@ static int mvneta_start(struct udevice *dev) return -ENODEV; } - pp->fixed_link = phydev->phy_id == PHY_FIXED_ID; - pp->phydev = phydev; phy_config(phydev); phy_startup(phydev); From patchwork Wed Apr 27 10:42:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622930 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=V/aUkftE; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4KpFlV4cjHz9sBy for ; Wed, 27 Apr 2022 20:45:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1CC2683F00; Wed, 27 Apr 2022 12:43:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="V/aUkftE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2BD9D83E4F; Wed, 27 Apr 2022 12:43:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6D40E83EDF for ; Wed, 27 Apr 2022 12:42:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 254B0B82530; Wed, 27 Apr 2022 10:42:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D9D5C385A9; Wed, 27 Apr 2022 10:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056167; bh=fFYADkBCfPIDeBjOTRZNXGDylqJOVWgFDfHoQnMVJi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V/aUkftEnKuRSA0DcnOBe7xNYu4f/RHKKIYOxtwbQcj7kDvoJ8/Lb4w1Kz8N7KgE1 /Cse7qu+JoQx1IIdTTjvzOuha3H/Wp0+yYVNLQJk5varcCWrPS+31hNq4J/s4Q8SqU LftGAY/TLj66S6blpn+Ak5qIZBu5htQyowKsijnTpXuPiTcgixx7pVKtL5vLN56HrZ 74uXvF3Xh2rupEcS5F+20TCREDvPGpL61iZ5n3uBP5NROblOuGQxyA8i4U3J05l68v HUFUrfmr9QQCte0trPbynjWYwOptUFCNcag0nytjtjN+Cnbliq6Y15nAmtj/T1As4V GVHkq8IFogOTA== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 18/19] net: mvneta: Disable fixed PHY code if PHY_FIXED is not compiled in Date: Wed, 27 Apr 2022 12:42:01 +0200 Message-Id: <20220427104202.1205-19-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Guard the code handling the fixed PHY case by CONFIG_IS_ENABLED(PHY_FIXED). Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 378789b632..292c364e5e 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -812,7 +812,8 @@ static void mvneta_defaults_set(struct mvneta_port *pp) mvreg_write(pp, MVNETA_SDMA_CONFIG, val); /* Enable PHY polling in hardware if not in fixed-link mode */ - if (pp->phydev->phy_id != PHY_FIXED_ID) { + if (!CONFIG_IS_ENABLED(PHY_FIXED) || + pp->phydev->phy_id != PHY_FIXED_ID) { mvreg_write(pp, MVNETA_PHY_ADDR, pp->phydev->addr); val = mvreg_read(pp, MVNETA_UNIT_CONTROL); @@ -1172,7 +1173,8 @@ static void mvneta_adjust_link(struct udevice *dev) * be added). Also, why is ADVERT_FC enabled if we don't enable * inband AN at all? */ - if (pp->phydev->phy_id == PHY_FIXED_ID) + if (CONFIG_IS_ENABLED(PHY_FIXED) && + pp->phydev->phy_id == PHY_FIXED_ID) val = MVNETA_GMAC_FORCE_LINK_UP | MVNETA_GMAC_IB_BYPASS_AN_EN | MVNETA_GMAC_SET_FC_EN | From patchwork Wed Apr 27 10:42:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1622931 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=H2mMEFKm; 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 4KpFlk70vMz9sBy for ; Wed, 27 Apr 2022 20:45:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2A5D083EFD; Wed, 27 Apr 2022 12:44:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="H2mMEFKm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0974283E55; Wed, 27 Apr 2022 12:43:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 73A4083ECF for ; Wed, 27 Apr 2022 12:42:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 14381B824A1; Wed, 27 Apr 2022 10:42:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46B41C385A7; Wed, 27 Apr 2022 10:42:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651056169; bh=8uH5fdLoEy+cc6f3tEovMSqbf+BbiIUNnFkMyW9RAE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H2mMEFKmTP2McjFI4H+tk4Rn7ov0r8KIASTDLEXmYp2bY4U1FmugbWfbI53231HO8 ghU6j7AwMnrZH80EzwNnCoI+AzF7ttuUZBV72kfYlhlz/tiTq168PsCCAGjmmYUrxL D0vNurlwCkPVqNjPVyt9TPZT4x4yZROseItgk8RikziPOwaTzFLxiUzuB00xqzqnmP 6tLc8X+5zDsfhvXzVVvfIGfZQ4D3M6KxzWmqTzAqocbHQjoQytvyGNrset8Dt9tSnT HWsPuCdPGSRWklhK932786euw6hUxE4NjTu+Czha4dmMBf2Fwo1qUONG0qPKg0tcWM EfnqsBs6b7bTg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: Robert Marko , =?utf-8?q?Pali_Roh=C3=A1r?= , U-Boot-Denx , Ramon Fried , Joe Hershberger , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 19/19] net: mvneta: Drop unneeded macro Date: Wed, 27 Apr 2022 12:42:02 +0200 Message-Id: <20220427104202.1205-20-kabel@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220427104202.1205-1-kabel@kernel.org> References: <20220427104202.1205-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean From: Marek Behún Macro MVNETA_GMAC_FORCE_LINK_UP can be dropped from value assignment in fixed link case, since it's value is written into the register later in the function for link-down-to-link-up case. The value is written as MVNETA_GMAC_FORCE_LINK_DOWN | MVNETA_GMAC_FORCE_LINK_PASS, and so the macro definition can also be dropped. Signed-off-by: Marek Behún Reviewed-by: Ramon Fried Reviewed-by: Stefan Roese --- drivers/net/mvneta.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c index 292c364e5e..d2c42c4396 100644 --- a/drivers/net/mvneta.c +++ b/drivers/net/mvneta.c @@ -188,7 +188,6 @@ DECLARE_GLOBAL_DATA_PTR; #define MVNETA_GMAC_AUTONEG_CONFIG 0x2c0c #define MVNETA_GMAC_FORCE_LINK_DOWN BIT(0) #define MVNETA_GMAC_FORCE_LINK_PASS BIT(1) -#define MVNETA_GMAC_FORCE_LINK_UP (BIT(0) | BIT(1)) #define MVNETA_GMAC_IB_BYPASS_AN_EN BIT(3) #define MVNETA_GMAC_CONFIG_MII_SPEED BIT(5) #define MVNETA_GMAC_CONFIG_GMII_SPEED BIT(6) @@ -1175,8 +1174,7 @@ static void mvneta_adjust_link(struct udevice *dev) */ if (CONFIG_IS_ENABLED(PHY_FIXED) && pp->phydev->phy_id == PHY_FIXED_ID) - val = MVNETA_GMAC_FORCE_LINK_UP | - MVNETA_GMAC_IB_BYPASS_AN_EN | + val = MVNETA_GMAC_IB_BYPASS_AN_EN | MVNETA_GMAC_SET_FC_EN | MVNETA_GMAC_ADVERT_FC_EN | MVNETA_GMAC_SAMPLE_TX_CFG_EN;