From patchwork Mon Dec 18 21:44:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 180661 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1552452dyi; Mon, 18 Dec 2023 13:47:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IGx34tQshL6SdLGRpPtfzsls5vQujx0T5i6AWAitsFUs99DFbZMCGiC48BuluDl3hGE+tF1 X-Received: by 2002:ac2:5e99:0:b0:50e:4444:f2a4 with SMTP id b25-20020ac25e99000000b0050e4444f2a4mr269372lfq.109.1702936078282; Mon, 18 Dec 2023 13:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936078; cv=none; d=google.com; s=arc-20160816; b=idsJI7v6l2/aigKqp8jXuQGLZWUePf4GQGP+VSPimbO9lNG8nPi+8ZsFEZOUFtLCkC l/coYSWRI9i7a3NSPHjbZzzXM8Un9XasqDhcwiaw89t59l362MEEnz3Mi3iGBuKdGeGg FJj4j4pwfe5OAYwQdwMzJqMPyqrBn2TAFg42GJb5Iz1UvEZaypPrnND9Z15Z1ky9XWf7 KkLWIXnb/G+/kQAqQ0zfkbBvEtGBoEW5Bv2KBa1dwXDxA1YBOMnuv3vowGoGtMN4c7m8 FOqU5ux99E661i9sBMklu9ggRFbBf8nRcRZ1WSIGwTacQP6FvHMq2gEqiDUB3q6CszUo VHLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dtyktrD7g18YdUT/SV48Nf6MPUu8IoeErrF4Rif8gR0=; fh=MOJyzNMsFAJQqEQehvdnrwT/huG78rLnZqS8spAjFqo=; b=nwDGeCuXWmDAxffmV8FSQ0Dek70Hyua6aoJRVFhgUOufeQJmb2zbQ67WE2sLzz0Vyh gs971JI4fGV6qk4wv5z0+6MznlRmbB93iXiJzFDDEDeSdZ31zIvH5ZqVpv5b2H603wsn 0EFh9dBkI/i9myPGqyrnK2Jl7fvwFnY8FfbOk6daRmEw1ReuZ4dXj2df5npCf3w2cHZK k4Gre7y3AqsbVns0PxBaKTkyLJoC9D96pEXbZVmF9WeLfuBlXb67+0D3L74pQMT0B2DS p11OxDOPLanWU4IuzV75r9e6LzENbkN/IzlLETbKr0+bHhmC3CqPJAI81CT3BOaX9ffC ZRTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=xMRMTnkW; spf=pass (google.com: domain of linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dc25-20020a056402311900b005535017368dsi1108263edb.73.2023.12.18.13.47.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:47:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=xMRMTnkW; spf=pass (google.com: domain of linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4420-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AA0B81F2611F for ; Mon, 18 Dec 2023 21:47:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4D087C65C; Mon, 18 Dec 2023 21:45:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="xMRMTnkW" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8935479956; Mon, 18 Dec 2023 21:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702935900; bh=HuOM7ECyvIemfEAWs07YUa5GDYXFtppCMkeuXbHE3H8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xMRMTnkWmjm5My4aEyYxW2P25j5XCxD36o4zB4JmSkNduJ7Fynp9bbcMP8KQ8iCXR 3YzK8ubA/jcfwOIXRBxgdLb2FjxEEVdpess4KdwQyFN/BymURC/BiFryKL/+z7IGsy cRpq5UTqONLl8aXg37G0lyk9l8q5yvQUYt9N502yeLT8e17Tuw+LYu9z7FbP4tatJr bdtCTd9VjsCMc7K/CMDNgIFALdbTsEQ47nx1Eg5bF+UmSMyYZQLTnNZ46tEowi6Efh xpiW0LgL5v+HNgbkvbqqQ6HgmxAC7l9lG21r+HOMf7THqPEEwMUhTJywRpYBu6Pr9n wouRy+uMbBwig== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D81DD37814AF; Mon, 18 Dec 2023 21:44:59 +0000 (UTC) From: Cristian Ciocaltea To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing , Samin Guo , Paul Walmsley , Palmer Dabbelt , Albert Ou , Hal Feng , Michael Turquette , Stephen Boyd , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Richard Cochran , Giuseppe Cavallaro Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, Emil Renner Berthing Subject: [PATCH v4 6/9] riscv: dts: starfive: visionfive-v1: Setup ethernet phy Date: Mon, 18 Dec 2023 23:44:46 +0200 Message-ID: <20231218214451.2345691-7-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> References: <20231218214451.2345691-1-cristian.ciocaltea@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785657901083637303 X-GMAIL-MSGID: 1785657901083637303 The StarFive VisionFive V1 SBC uses a Motorcomm YT8521 PHY supporting RGMII-ID, but requires manual adjustment of the RX internal delay to work properly. The default RX delay provided by the driver is 1.95 ns, which proves to be too high. Applying a 50% reduction seems to mitigate the issue. Also note this adjustment is not necessary on BeagleV Starlight SBC, which uses a Microchip PHY. Hence, there is no indication of a misbehaviour on the GMAC side, but most likely the issue stems from the Motorcomm PHY. While at it, drop the redundant gpio include, which is already provided by jh7100-common.dtsi. Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing Signed-off-by: Cristian Ciocaltea Reviewed-by: Andrew Lunn --- .../jh7100-starfive-visionfive-v1.dts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts b/arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts index e82af72f1aaf..4e396f820660 100644 --- a/arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts +++ b/arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts @@ -6,7 +6,6 @@ /dts-v1/; #include "jh7100-common.dtsi" -#include / { model = "StarFive VisionFive V1"; @@ -18,3 +17,24 @@ gpio-restart { priority = <224>; }; }; + +/* + * The board uses a Motorcomm YT8521 PHY supporting RGMII-ID, but requires + * manual adjustment of the RX internal delay to work properly. The default + * RX delay provided by the driver (1.95ns) is too high, but applying a 50% + * reduction seems to mitigate the issue. + * + * It is worth noting the adjustment is not necessary on BeagleV Starlight SBC, + * which uses a Microchip PHY. Hence, most likely the Motorcomm PHY is the one + * responsible for the misbehaviour, not the GMAC. + */ +&mdio { + phy: ethernet-phy@0 { + reg = <0>; + rx-internal-delay-ps = <900>; + }; +}; + +&gmac { + phy-handle = <&phy>; +};