Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3391285pxb; Mon, 17 Jan 2022 19:26:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8PwT8NDwbENssLkmANFMJAeHVFxGz3grucb+/WyY10z2BLBTk8TQGZ+LoJj7+Rzfv1KFH X-Received: by 2002:a63:920c:: with SMTP id o12mr21444731pgd.402.1642476391357; Mon, 17 Jan 2022 19:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642476391; cv=none; d=google.com; s=arc-20160816; b=g6XsY8q5kdPvGMRuBmu7PBt4yDleWFqH1PGiusopE58C4VH1x9rIPAX60mFhaXTZb0 /RvjDJu4sSm3fycVMgJgOlsT/AWyq6cGSSnb4K/a3BTH2BA2Nku8IZ61H6B9ZyoYOU7A w0adIJ3NbXG8Ow4O3Cc8mQcNi0/Efk+O6P9K5KcJfD8CDrHjS/PLWo8xlA+3gs8bhOgo rTbNcF7hXeAwD+3SqQ49LOnGNfKSod07/8FcCLf9F0ScGm70npptICcYmwUvEEdkL7NA X+gYtP+jjjTs03LB2lWobQ/08z/gYI6PKrYB9PmF/fZjpdPV/9c82SVHTWYfRYyPA/a4 CU1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e5swjHCTS2CSKv7X8N9lpuhbYH8KV9Gl78K/sWGkOk4=; b=mDFv0xiD6I6ZY1zQZyzArS/rToU+m2EcdPm/HZ7GNi+VNLnRLgyo2Tb2x0Ywr3yDCi MiQ2DJvEMZ3JLvFu9ltgJU3LKTWnN40RcMbh3ek2gI61W1kHDG9Qr8ZpASF7qbdW6RhC bOtxjQK2JxG2TQtvr3zS/vmiI8qALBm9PuhpSZYMLrOyH59V7GdTh7W99KK3EUna0BCU xzeS6M0Rh4kgGmiXbbAhTrmjXWlBBPJspjImRRz4aAW7VL9csjEG29gU1lp1GucIE5fe wrfz/ny59sFcbS5HKrGS+0CevSP4bIy8aab80NytJrG9vXNqSDI64W92KG9833alZXVq OM8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GtKqXh3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j193si13704451pge.180.2022.01.17.19.26.19; Mon, 17 Jan 2022 19:26:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GtKqXh3J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344299AbiARCgR (ORCPT + 99 others); Mon, 17 Jan 2022 21:36:17 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:48224 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345032AbiARCbN (ORCPT ); Mon, 17 Jan 2022 21:31:13 -0500 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 46FD0604EF; Tue, 18 Jan 2022 02:31:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A379CC36AF3; Tue, 18 Jan 2022 02:31:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642473071; bh=n7a3E2WcJQekIfeKdS2oq9HUz82e5Ru+YKJv+aqsPn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GtKqXh3Juxg0Kn+Ac8CDKpLWB3pFPkVuycqbbdRRUdwiV/DbH4kKtHaZEnBgsOa1t CQjH6yrI78++4QACVIzk/2tkRh2vs4WLoaogQQ2GoWJJLiKTQE23CnI1BmDyGAcfKm ffgg9S6syyI1dl7VgyWAZDVbPI+ZAodKgVfYcplFHlHdDgxuPWTOkLcm5MUp5Xq+99 pmlQs1PkxM2QyMZGtCWcd/newY8YqDwmxRxxFKlNce0LS8CkTyfjxSjtCM9YwGmuGa GqrXHCOtKvakSouJvf1GcALncI/VGZW9Rp3z5AIb/2lKbGmTyAvaQrLLEmiWH1ckNS /ZzYPJTXIv5Rg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Russell King (Oracle)" , Corentin Labbe , Andrew Lunn , Jakub Kicinski , Sasha Levin , hkallweit1@gmail.com, davem@davemloft.net, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 201/217] net: phy: marvell: configure RGMII delays for 88E1118 Date: Mon, 17 Jan 2022 21:19:24 -0500 Message-Id: <20220118021940.1942199-201-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Russell King (Oracle)" [ Upstream commit f22725c95ececb703c3f741e8f946d23705630b7 ] Corentin Labbe reports that the SSI 1328 does not work when allowing the PHY to operate at gigabit speeds, but does work with the generic PHY driver. This appears to be because m88e1118_config_init() writes a fixed value to the MSCR register, claiming that this is to enable 1G speeds. However, this always sets bits 4 and 5, enabling RGMII transmit and receive delays. The suspicion is that the original board this was added for required the delays to make 1G speeds work. Add the necessary configuration for RGMII delays for the 88E1118 to bring this into line with the requirements for RGMII support, and thus make the SSI 1328 work. Corentin Labbe has tested this on gemini-ssi1328 and gemini-ns2502. Reported-by: Corentin Labbe Tested-by: Corentin Labbe Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/marvell.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 4fcfca4e17021..b02491f7dd957 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -1242,6 +1242,12 @@ static int m88e1118_config_init(struct phy_device *phydev) if (err < 0) return err; + if (phy_interface_is_rgmii(phydev)) { + err = m88e1121_config_aneg_rgmii_delays(phydev); + if (err < 0) + return err; + } + /* Adjust LED Control */ if (phydev->dev_flags & MARVELL_PHY_M1118_DNS323_LEDS) err = phy_write(phydev, 0x10, 0x1100); -- 2.34.1