Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFD0BC433EF for ; Tue, 22 Feb 2022 07:49:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 809D583C00; Tue, 22 Feb 2022 08:49:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=walle.cc header.i=@walle.cc header.b="L9Kyl1Zf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5C9038382C; Tue, 22 Feb 2022 08:49:11 +0100 (CET) Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E781F83C00 for ; Tue, 22 Feb 2022 08:49:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=michael@walle.cc Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id BA1A722175; Tue, 22 Feb 2022 08:49:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1645516147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1T9y2REyA+GCU2YtC51NEoUb1IRFmIFG0fnWNXt3tjo=; b=L9Kyl1Zf8nPssGD1cEd0KIPGd9LM2jBc9MkhbPpt4r8iq1P20Tb86zMlkK8GRxvYHqxtFy +vfieHclHfKwss8j5J3MOeQ1apXvSJtU/tSSaS2NgBRL+hsDOXCqI5pU9t11mjryO2Jt/Y oWkOgHH1JzhKEDqiKGRwGgz02qCFqD0= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 22 Feb 2022 08:49:05 +0100 From: Michael Walle To: Marek Vasut Cc: festevam@gmail.com, peng.fan@nxp.com, sbabic@denx.de, u-boot@lists.denx.de Subject: Re: [PATCH v2] ARM: imx: imx8mn-ddr4-evk: Add ethernet support In-Reply-To: References: <20220219161354.63523-1-marex@denx.de> <20220221101023.1458769-1-michael@walle.cc> User-Agent: Roundcube Webmail/1.4.12 Message-ID: <39bb52ef3032d5f1a526e6a232fdb869@walle.cc> X-Sender: michael@walle.cc 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 Hi Marek, Am 2022-02-21 17:49, schrieb Marek Vasut: > On 2/21/22 11:10, Michael Walle wrote: >>> +int board_phy_config(struct phy_device *phydev) >>> +{ >>> + /* enable rgmii rxc skew and phy mode select to RGMII copper */ >>> + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x1f); >>> + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x8); >>> + >>> + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x00); >>> + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x82ee); >>> + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05); >>> + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100); >> >> This is a AR8031, correct? Is there a reason why you don't use the >> device tree binding to set RGMII voltage, and RX and tx delays? > > I quickly cobbled this together from another board, since I needed > ethernet to do other tests with this board and the ethernet support > was missing. If you can send subsequent patch to flip this to DT-only > setup, I can test the patch on the board. I neither have this board, nor do I care much about it. I just saw the usual hardcoded atheros phy settings being done in the board setup. That being said, you can find an example in: arch/arm/dts/fsl-ls1028a-kontron-sl28-var4.dts But you have to figure out what you need. I guess the last four writes are the rgmii delays which are handled by phy-mode = "rgmii-id"; The 0x8 to 0x1f is 1.8V RGMII voltage, you'd need to look at the schematics if that voltage is actually used. A Zero means 1.5V. If it's using 2.5V then you don't have to do anything because an external regulator is used. -michael