Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3645163pxb; Mon, 24 Jan 2022 14:17:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyT17kMwsZ80gIekbgw0PpK0obLwVfEDAJ8oZbvhhINuy5AAhwGoSx4LnC/Vz5s51xWdNJE X-Received: by 2002:a17:90b:3148:: with SMTP id ip8mr423416pjb.72.1643062654274; Mon, 24 Jan 2022 14:17:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062654; cv=none; d=google.com; s=arc-20160816; b=co+hKbAyhuqWaRXviyHWODWlBKnFod2pGpJOikqwlx69+up9XmvIczzM/6417OAvQ2 TspWRq45kB+ZjHUAuZ+MqI4ahkcOLdD43n1rKaS5Pz1obzXiJnTLhTRAQPVlPfj+DtFA kYvALJ5bof+JDHRr7CjE9Fdr/zu/6w6zvFaS0VKdjKyp6prdO0C7ZvoKp1zJ5W2auxSd XnVRokSPenCl5Za508eGx7pize2n/dxbmXUZlXpo/uzmhre5QYfd8QAjX1LMVOOQ/e08 ZfWKLtXQNnddcAXThHu5zl3gxDHprd/e2AbRxOSuXG6tUZkhx+3Pqh/vquN/1ba2OUnJ I4TQ== 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=gpienNhB8hgseAXxOQyLfbC2Cd7OqRiKqtTW2/6xlnE=; b=SFSX0mInzCCCq+5SwsZ25/wsCLyJmUlGIqqL/8gUbokqIdffxBwg4EDYHxj6jAylxj VVdWK3fnFmdQlfIk4h5XJqcfUoPWZeNaV5CLDtCMA754a1bbaOk0kTnDi2riH/NXbANm 24bzxh+EBbA2NUYJuvN6swWU09fDdjl3JCYxibZi/jBUSYX9PozPe8v7CCmpE1XCfO6V J9XeI3h2ZWANa+4j4fE9E+MK/KQ8pJZBDsTCrffrgO0pvZtVkKMpKweZcQsvUNMzBuRF nxubpjxFDUQ/5ZeJONx/b9wWj3R4TD6DdLcAblg4yjAwtFaJ8tivbaGAEOxiFh5BMk/6 MmYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bEkeCw1K; 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 27si13979174pgl.734.2022.01.24.14.17.20; Mon, 24 Jan 2022 14:17:34 -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=bEkeCw1K; 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 S1581946AbiAXWMn (ORCPT + 99 others); Mon, 24 Jan 2022 17:12:43 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:46086 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377233AbiAXV3J (ORCPT ); Mon, 24 Jan 2022 16:29:09 -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 DB37D614D9; Mon, 24 Jan 2022 21:29:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C41EFC340F8; Mon, 24 Jan 2022 21:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059748; bh=CZwN9XuDQUkbNMVEEIxVWPpXVAE2UgZwHjhnWnLbtBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bEkeCw1KDaLX3y0l/Mx19GMH+hOge4tM6E6UKj7SeD5Qt58TsQ++f9GiFaRkYhEUk UQfTqC8UX+MrR68+wRZNFwlfrTtMBJwwv5UiCZapSaHm59vxrBUjpfdAHD0Pc7wVTI U2P557Q5gqhhzXq12mtNa3XivpNGZxoylpDZPwiw= 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.16 0719/1039] net: gemini: allow any RGMII interface mode Date: Mon, 24 Jan 2022 19:41:48 +0100 Message-Id: <20220124184149.498059748@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 941f175fb911e..0ff40a9b06cec 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -305,21 +305,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