Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3577590pxb; Mon, 24 Jan 2022 12:39:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJz53Rbtz4PUqRIIzU6jqqIiD2NIGfWsNrSnzW1QtAhYzJsmWijN5kh+oSbn4SkT2e9Ml9ev X-Received: by 2002:a17:902:c947:b0:14a:ff21:afe3 with SMTP id i7-20020a170902c94700b0014aff21afe3mr15762109pla.49.1643056761671; Mon, 24 Jan 2022 12:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056761; cv=none; d=google.com; s=arc-20160816; b=qnUG0ZUhZPdhyue4d12c35Zfvtb/eEXvsYMItX/fDlua5CKrFzvUpI1W4mEXK/caLR L7tlyVKAFr6cjFmOT6onbcfsTL6x15wibmppKtb1//pA0goVQupiYgtxAZbjZm+0T9H5 NxwypBhKrYmKEeOcWO0dq5f9SeDyLuyDMYJi7psyU2GURJpHue9D2FDqJUJ0OwcdmK3a RLYD2pxUlo5CIsf28nIEX+0ldyrlD5C4LVqQucBUzKrbHHjtHppYMO+JLuh+sFankRAP t7dTKiHNgyPkW8R0w9Z6+6AwF3QQPPGUcFquYA4vNxIqmBwurfVdJWHCSu6Mz7XNRVvA hjTQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M6x9iyPR8AgNCUj2efnZnNgU60OORxnSgmRHxYwfQf8=; b=aL9QTFjOUYnJbR6ZtmGp0u521Doh/N0A77SO662K+/q64rDKO/xbZd0YPetqeorCHx /oUq/HYaXSUK4M+LqiAQMCOjO902at4JjqZ3Yt9c0eYnomlI/dPtd6gG08QHW/J+fOf2 n4z1qW3cxKhtVEbhqUefghKbq2YnoiDHOXl6ROgzIJwIPdZMlmrP+TnSsIel4qhBS6tj ozQ4rV4266uz90IfU6Ps2fv09UtqM1p1RUJHFo5rwegKx4NekXujFDDhgPK4WcS1IwWM 8xlnI1y0gdGKOIQ0iObETOX0wBiytQa38Sm81mm8v4yruu4+KvBo3wr0QbDtLc7pG+TN I35Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KyvvuwtT; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q6si1569504plr.359.2022.01.24.12.39.06; Mon, 24 Jan 2022 12:39:21 -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=@linuxfoundation.org header.s=korg header.b=KyvvuwtT; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348037AbiAXTwN (ORCPT + 99 others); Mon, 24 Jan 2022 14:52:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355414AbiAXTlQ (ORCPT ); Mon, 24 Jan 2022 14:41:16 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FF9EC061757; Mon, 24 Jan 2022 11:20:58 -0800 (PST) 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 10264612FA; Mon, 24 Jan 2022 19:20:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA563C340E8; Mon, 24 Jan 2022 19:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052057; bh=+182Jy79sK9MXiS+S8hwpNplD7VC97KSLLO+0dqvPJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KyvvuwtTO0AU+jzur0E71fg9t0Gc7R9wpYkjgI5tMywTUzRXjG8WKvPJjf5k3l9X1 3g97vSm2NyVNql7Ej6e+y4v0CT4TKd0ZMz41f/6pWC/NumKuO/AkDCad47egPNFB8B MjcAdQWPZQAcjj5hvVAui8N9vXGAXRz0KO9VJ4Tg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Russell King (Oracle)" , Linus Walleij , Corentin Labbe , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.19 173/239] net: gemini: allow any RGMII interface mode Date: Mon, 24 Jan 2022 19:43:31 +0100 Message-Id: <20220124183948.603778604@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183943.102762895@linuxfoundation.org> References: <20220124183943.102762895@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Russell King (Oracle) [ Upstream commit 4e4f325a0a55907b14f579e6b1a38c53755e3de2 ] The four RGMII interface modes take care of the required RGMII delay configuration at the PHY and should not be limited by the network MAC driver. Sadly, gemini was only permitting RGMII mode with no delays, which would require the required delay to be inserted via PCB tracking or by the MAC. However, there are designs that require the PHY to add the delay, which is impossible without Gemini permitting the other three PHY interface modes. Fix the driver to allow these. Signed-off-by: Russell King (Oracle) Reviewed-by: Linus Walleij Tested-by: Corentin Labbe Link: https://lore.kernel.org/r/E1n4mpT-002PLd-Ha@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/cortina/gemini.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 5242687060b44..f8a3d1fecb0a5 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -304,21 +304,21 @@ static void gmac_speed_set(struct net_device *netdev) switch (phydev->speed) { case 1000: status.bits.speed = GMAC_SPEED_1000; - if (phydev->interface == PHY_INTERFACE_MODE_RGMII) + if (phy_interface_mode_is_rgmii(phydev->interface)) status.bits.mii_rmii = GMAC_PHY_RGMII_1000; netdev_dbg(netdev, "connect %s to RGMII @ 1Gbit\n", phydev_name(phydev)); break; case 100: status.bits.speed = GMAC_SPEED_100; - if (phydev->interface == PHY_INTERFACE_MODE_RGMII) + if (phy_interface_mode_is_rgmii(phydev->interface)) status.bits.mii_rmii = GMAC_PHY_RGMII_100_10; netdev_dbg(netdev, "connect %s to RGMII @ 100 Mbit\n", phydev_name(phydev)); break; case 10: status.bits.speed = GMAC_SPEED_10; - if (phydev->interface == PHY_INTERFACE_MODE_RGMII) + if (phy_interface_mode_is_rgmii(phydev->interface)) status.bits.mii_rmii = GMAC_PHY_RGMII_100_10; netdev_dbg(netdev, "connect %s to RGMII @ 10 Mbit\n", phydev_name(phydev)); @@ -389,6 +389,9 @@ static int gmac_setup_phy(struct net_device *netdev) status.bits.mii_rmii = GMAC_PHY_GMII; break; case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: + case PHY_INTERFACE_MODE_RGMII_TXID: + case PHY_INTERFACE_MODE_RGMII_RXID: netdev_dbg(netdev, "RGMII: set GMAC0 and GMAC1 to MII/RGMII mode\n"); status.bits.mii_rmii = GMAC_PHY_RGMII_100_10; -- 2.34.1