Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3390986pxb; Mon, 17 Jan 2022 19:26:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxexAP3LfkZOOsW+900H4MuzkOJwR3C6OCoCH1L8VdP/k4LDHE6EqwjowiDHcbnmnwGx+c+ X-Received: by 2002:a17:90b:4c0f:: with SMTP id na15mr28289116pjb.21.1642476361771; Mon, 17 Jan 2022 19:26:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642476361; cv=none; d=google.com; s=arc-20160816; b=yiyhS63LUJ2/MfdXtYs+vBYPgKqTVeV6fdhWf+vnhDybKza5pJdlaNRT7iunGY8mzE NTeSODm4x2EL3H2TD15ewbhVtIKuaKobED0EeRy1OUZ58X1uevEluUvbajd9qJuUVLOV H8QQ/2owXnKaj713Lut2yCotj5Cyc0VOfX9Si/Ad3+Ec39PL2a1rvkinviEh1xXcDmXa f3BbRn6uGFCg9LCXRVrscoM4Whl9Y0xo49AhNDJJLqiffLWBGr88CdR5XQL7UU12Hvo7 VWuz966NvWSuDDR/dmnmFu9Koh5zCKNla/B+jY6QMRX9AQXj/Wkiecgth3B0WC7dEz1p 3epQ== 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=CxMvtGmrlfIqpRJ6s4TqjZNC1dyuO09YlcmiB9bw+sc=; b=HZDHr6LJoxF90JU3wfJ4UfCNEZ37Ni8orClxjG3loTpnruyuqUiv+t0bBAaaRzT5pl /C+AwmGCFqP7jb9YLsGxJCAgYc8Xqzfr//NEoBI/X4FAA4ROnJ5tvAroCfp2x35/K+ui 2cK24g8PWXidQWpUWBprk4V8FZ13KYGjF7UqgNtY8/c+mQyatUAfO5RFr56GFqcaUh3G GjAhxO7ZpHO2WQgLKieXHhKiAvlfCnFlp0eEV0DQy/GNokMwwi/b27lUhWn7mRseqxEv GWEQyZDkbCHApHfyyCWQqjIxEObEDQG5+X8BbfO4Ba1SGImSM+eFw5Vmg7/q1dHbIl2p 0J6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WqrdzLtQ; 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 h9si1289975pjj.78.2022.01.17.19.25.49; Mon, 17 Jan 2022 19:26:01 -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=WqrdzLtQ; 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 S1344394AbiARCg1 (ORCPT + 99 others); Mon, 17 Jan 2022 21:36:27 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:43148 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345075AbiARCbQ (ORCPT ); Mon, 17 Jan 2022 21:31:16 -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 A309AB8123A; Tue, 18 Jan 2022 02:31:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3255DC36AF2; Tue, 18 Jan 2022 02:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642473073; bh=OYtagPmEH8J3yM7diMtlV65e0YrLQ3hiM0HP/KR3g/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WqrdzLtQ8t9V8Z1FhQ44E2Hga33L9PvNVqKBb2RyqIWc7tPOOAZBEfmHDnAOy6Luk HROIno/Nx3Uy4DAmwhrB2pVTqpA6rbvkdY4jQPEuiNPPWiNa7ZeXziiVi7VxkhRkcu arQ47BK6w63WhWsW4kQvisIjxEmPGXjLCUMwBLadoHhVUFt+9Weitm4ATSYoMKSU2X MPDhfQInW0ppcPGRkqCTQruVsuaKKRcUx6vAaJ/ZkPPSj9XIOOG3dkyNLuRB7JMczX WkRQDbehpc1vs5OHdf0LlS5IAuC7qrWayjTaBs+XbSuFd4LqwmA2c2tYEI9WnhEudT cbJhOq3uZIjfw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Russell King (Oracle)" , Linus Walleij , Corentin Labbe , Jakub Kicinski , Sasha Levin , ulli.kroll@googlemail.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 202/217] net: gemini: allow any RGMII interface mode Date: Mon, 17 Jan 2022 21:19:25 -0500 Message-Id: <20220118021940.1942199-202-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 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