Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3576631pxb; Mon, 24 Jan 2022 12:37:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJboa87APjtb9Cczx31C4t14RwXa4fagrc3kFxrfZc2Jf2hY695K2Lgk/Cip7iflmz99bL X-Received: by 2002:a17:90b:3511:: with SMTP id ls17mr62751pjb.211.1643056675666; Mon, 24 Jan 2022 12:37:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643056675; cv=none; d=google.com; s=arc-20160816; b=PiLDjtx3UmMva1jk9eOanedIzMnH4zxczNSMgpSScV6Uf86MSVv3y71LJcjGGWwfdA MRO8DdgVa+Iqo6xuNY7t8iQucyr+qwv4nnWRCZhnOI2OYNwR8+4l4DTT2HrvHq4D5HmN rC/iooOPqJLyMSck52HUXDg/8fMsWG/9HoUW8IUQAdgOKcqkwARcV4Xccc1b6AtqDoc3 7PfCjm8r39h7iOx4ZesTZ+mzEMCnsYhdsduLrtscSiooIVAaQxLErp32gCNWqKIJJTj/ 9iE2K5EnTKQlmxVMSNqNhlI0X5EnCZgp7iol6bZVznMZhNH0oCYqig5V75VWrQNj8e9y PX9A== 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=vWvv0fhTgMsc5HLBgvKY3dlDvJ77NbtEVXvQONG1vZw=; b=sC5GP9Q+4gYbScNPLVOqxO13BKOhbzYhJAF3AnjcyUtv/xw7boYvKk/fFxZ5Va7Ia/ DRkWbx0WLwCrlROQCVgtqmyEFtc2VVUfh/6bM4PoC1/eoXQBNC+SU0JPiWFUPm3rQF0n LKU1NgAO+iY65iXBjzvu5L9tAMl2d06K8ka8uUQgZbtYht8Ju+QWox1ZyLZhC8u5nnJ8 VhPsHDm7XTa+gI3bqrFNemSib0tT/9XP3/0pj1/PAceYwWSmPceZ6hy7L6uJNVgZj9AE Y8XLpPJVkVzoTlb+m1ekp0j6tebgrzeuF2nId6iCSn4GxyCFwSFWu6JYbZJLRA9tpnzm 6Nng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kjoGCMsi; 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 i4si7449404pfr.258.2022.01.24.12.37.43; Mon, 24 Jan 2022 12:37:55 -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=kjoGCMsi; 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 S1345340AbiAXToa (ORCPT + 99 others); Mon, 24 Jan 2022 14:44:30 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:57606 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353810AbiAXTf0 (ORCPT ); Mon, 24 Jan 2022 14:35:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4F8A2B811F9; Mon, 24 Jan 2022 19:35:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E0FCC340E5; Mon, 24 Jan 2022 19:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052923; bh=WpGQNYxdLM7SQgZfdwnO1Afb2o+Mu2rm+buoGrLP4vM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kjoGCMsiRgtkYH6WVBNqFIfkBe7wbjKmuPNaLb7rX46fvMnj+1OwuoH7ntXlUElOf TVnVwSyr9w7BnzU5bYV2eQnTn3gULaju4dg6usRDQhWEVJRPYYljGWuetUvxtA++75 zgdyadaRh5hg1Yfry4iICEJrrZIZzqIpqi8G5m/A= 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 5.4 218/320] net: gemini: allow any RGMII interface mode Date: Mon, 24 Jan 2022 19:43:22 +0100 Message-Id: <20220124184001.062525668@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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 c9fb1ec625d8b..a8a8b77c1611e 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)); @@ -388,6 +388,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