From patchwork Tue Mar 17 14:52:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King \(Oracle\)" X-Patchwork-Id: 222399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FD3EC10F29 for ; Tue, 17 Mar 2020 14:53:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1CCF206EC for ; Tue, 17 Mar 2020 14:53:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="kvGlQ6v6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726873AbgCQOxA (ORCPT ); Tue, 17 Mar 2020 10:53:00 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:40936 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgCQOxA (ORCPT ); Tue, 17 Mar 2020 10:53:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8KWOIQaLw1huY45ysIb3szlJngzH2KcSx3JCWXp7FAY=; b=kvGlQ6v6+YMbYbN15mfS4aAZue 5ixkgYQ54BCtyiNyNTqgHTKbQYGzwo4qzJreFXj7nzrjvzopCvwvRzn5n44Sj8VW72eR2M9MBvkEJ GK9GOKliRlqiGCmxl9NVxadxR7UA/htUfJETZ69htyiXzMe8KD1t0TWtJHFlzVzrjaJWb4bjoe/T7 ai0nhIlpEt5E8wzLi8NCZrrEUMASD0SvYF9kFuo0kM03uN4iSRyRtQGQWQRC+uQiL4wwflbw9DmMU kmcX4kqAHGsDE53k0TViLto9MV0cj+BTcj66EwY/vMTI7+IzrJdMWQRr39ga81P9SuKHtC/3Pd24c 71GL8Jmg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:36224 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jEDaJ-0007iI-PU; Tue, 17 Mar 2020 14:52:47 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jEDaI-0008JA-I7; Tue, 17 Mar 2020 14:52:46 +0000 In-Reply-To: <20200317144944.GP25745@shell.armlinux.org.uk> References: <20200317144944.GP25745@shell.armlinux.org.uk> From: Russell King To: Andrew Lunn , Florian Fainelli , Heiner Kallweit Cc: "David S. Miller" , netdev@vger.kernel.org Subject: [RFC net-next 1/5] net: phylink: rename 'ops' to 'mac_ops' MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 17 Mar 2020 14:52:46 +0000 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org *NOT FOR MERGING* Rename the bland 'ops' member of struct phylink to be a more descriptive 'mac_ops' - this is necessary as we're about to introduce another set of operations. Signed-off-by: Russell King --- drivers/net/phy/phylink.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index fed0c5907c6a..a34a3be92dba 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -40,7 +40,7 @@ enum { struct phylink { /* private: */ struct net_device *netdev; - const struct phylink_mac_ops *ops; + const struct phylink_mac_ops *mac_ops; struct phylink_config *config; struct device *dev; unsigned int old_link_state:1; @@ -154,7 +154,7 @@ static const char *phylink_an_mode_str(unsigned int mode) static int phylink_validate(struct phylink *pl, unsigned long *supported, struct phylink_link_state *state) { - pl->ops->validate(pl->config, supported, state); + pl->mac_ops->validate(pl->config, supported, state); return phylink_is_empty_linkmode(supported) ? -EINVAL : 0; } @@ -415,7 +415,7 @@ static void phylink_mac_config(struct phylink *pl, __ETHTOOL_LINK_MODE_MASK_NBITS, state->advertising, state->pause, state->link, state->an_enabled); - pl->ops->mac_config(pl->config, pl->cur_link_an_mode, state); + pl->mac_ops->mac_config(pl->config, pl->cur_link_an_mode, state); } static void phylink_mac_config_up(struct phylink *pl, @@ -429,7 +429,7 @@ static void phylink_mac_an_restart(struct phylink *pl) { if (pl->link_config.an_enabled && phy_interface_mode_is_8023z(pl->link_config.interface)) - pl->ops->mac_an_restart(pl->config); + pl->mac_ops->mac_an_restart(pl->config); } static void phylink_mac_pcs_get_state(struct phylink *pl, @@ -445,7 +445,7 @@ static void phylink_mac_pcs_get_state(struct phylink *pl, state->an_complete = 0; state->link = 1; - pl->ops->mac_pcs_get_state(pl->config, state); + pl->mac_ops->mac_pcs_get_state(pl->config, state); } /* The fixed state is... fixed except for the link state, @@ -512,11 +512,11 @@ static void phylink_mac_link_up(struct phylink *pl, struct net_device *ndev = pl->netdev; pl->cur_interface = link_state.interface; - pl->ops->mac_link_up(pl->config, pl->phydev, - pl->cur_link_an_mode, pl->cur_interface, - link_state.speed, link_state.duplex, - !!(link_state.pause & MLO_PAUSE_TX), - !!(link_state.pause & MLO_PAUSE_RX)); + pl->mac_ops->mac_link_up(pl->config, pl->phydev, + pl->cur_link_an_mode, pl->cur_interface, + link_state.speed, link_state.duplex, + !!(link_state.pause & MLO_PAUSE_TX), + !!(link_state.pause & MLO_PAUSE_RX)); if (ndev) netif_carrier_on(ndev); @@ -534,8 +534,8 @@ static void phylink_mac_link_down(struct phylink *pl) if (ndev) netif_carrier_off(ndev); - pl->ops->mac_link_down(pl->config, pl->cur_link_an_mode, - pl->cur_interface); + pl->mac_ops->mac_link_down(pl->config, pl->cur_link_an_mode, + pl->cur_interface); phylink_info(pl, "Link is Down\n"); } @@ -666,7 +666,7 @@ static int phylink_register_sfp(struct phylink *pl, * @fwnode: a pointer to a &struct fwnode_handle describing the network * interface * @iface: the desired link mode defined by &typedef phy_interface_t - * @ops: a pointer to a &struct phylink_mac_ops for the MAC. + * @mac_ops: a pointer to a &struct phylink_mac_ops for the MAC. * * Create a new phylink instance, and parse the link parameters found in @np. * This will parse in-band modes, fixed-link or SFP configuration. @@ -679,7 +679,7 @@ static int phylink_register_sfp(struct phylink *pl, struct phylink *phylink_create(struct phylink_config *config, struct fwnode_handle *fwnode, phy_interface_t iface, - const struct phylink_mac_ops *ops) + const struct phylink_mac_ops *mac_ops) { struct phylink *pl; int ret; @@ -712,7 +712,7 @@ struct phylink *phylink_create(struct phylink_config *config, pl->link_config.speed = SPEED_UNKNOWN; pl->link_config.duplex = DUPLEX_UNKNOWN; pl->link_config.an_enabled = true; - pl->ops = ops; + pl->mac_ops = mac_ops; __set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); timer_setup(&pl->link_poll, phylink_fixed_poll, 0); From patchwork Tue Mar 17 14:52:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King \(Oracle\)" X-Patchwork-Id: 222398 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41523C10F29 for ; Tue, 17 Mar 2020 14:53:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 158A2206EC for ; Tue, 17 Mar 2020 14:53:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="R5lO9zHk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726890AbgCQOxS (ORCPT ); Tue, 17 Mar 2020 10:53:18 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:40964 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgCQOxS (ORCPT ); Tue, 17 Mar 2020 10:53:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PPvxJfz7fcMsqq7ucObIfV85gjZPQBTgrMZBZr7ovF4=; b=R5lO9zHklJzTmeXfqThKz6uqDz IfCgrFTcrE36gJOK7mzJ7ZAn7cfhh5RWNePIc/xK44PmEETriROAKeUjQH+1wCwG2a5wroudwW3qo 0ZhiGJ/Mh48lIx4PrPX0Z+N2jaElfVRw9pLWj5JkGBEfaBBka0NVrK4cBezrxcNXJ0b99zn/6H5Lv f75HnNhPbfFsHPjgLx4SndSS6XU+5F/mUQDvdBmqy78Z0Yt16OCCv18F3BRIK3vIguorECenYWoCc /7aoUfGAMwJ1UVPxyVO9MoyBgKpNS3DXvh0UbNFW/xaXtJ8vYVAWfzG/suzt9TwvC4ofprth9DDPT GVxr/OYg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:44364 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jEDaU-0007iZ-Sc; Tue, 17 Mar 2020 14:52:59 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jEDaS-0008JO-Po; Tue, 17 Mar 2020 14:52:56 +0000 In-Reply-To: <20200317144944.GP25745@shell.armlinux.org.uk> References: <20200317144944.GP25745@shell.armlinux.org.uk> From: Russell King To: Andrew Lunn , Florian Fainelli , Heiner Kallweit Cc: "David S. Miller" , netdev@vger.kernel.org, Shawn Guo , Li Yang , Rob Herring , Mark Rutland , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [RFC net-next 3/5] arm64: dts: lx2160a: add PCS MDIO nodes MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 17 Mar 2020 14:52:56 +0000 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org *NOT FOR MERGING* Add PCS MDIO nodes for the LX2160A, which will be used when the MAC is in PHY mode and is using in-band negotiation. Signed-off-by: Russell King --- .../arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi index e5ee5591e52b..732af33eec18 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi @@ -960,6 +960,132 @@ status = "disabled"; }; + pcs_mdio1: mdio@8c07000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c07000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio2: mdio@8c0b000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c0b000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio3: mdio@8c0f000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c0f000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio4: mdio@8c13000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c13000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio5: mdio@8c17000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c17000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio6: mdio@8c1b000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c1b000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio7: mdio@8c1f000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c1f000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio8: mdio@8c23000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c23000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio9: mdio@8c27000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c27000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio10: mdio@8c2b000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c2b000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio11: mdio@8c2f000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c2f000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio12: mdio@8c33000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c33000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio13: mdio@8c37000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c37000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio14: mdio@8c3b000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c3b000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio15: mdio@8c3f000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c3f000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio16: mdio@8c43000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c43000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio17: mdio@8c47000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c47000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + + pcs_mdio18: mdio@8c4b000 { + compatible = "fsl,fman-memac-mdio"; + reg = <0x0 0x8c4b000 0x0 0x1000>; + little-endian; + status = "disabled"; + }; + fsl_mc: fsl-mc@80c000000 { compatible = "fsl,qoriq-mc"; reg = <0x00000008 0x0c000000 0 0x40>, @@ -988,91 +1114,109 @@ dpmac1: dpmac@1 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x1>; + pcs-mdio = <&pcs_mdio1>; }; dpmac2: dpmac@2 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x2>; + pcs-mdio = <&pcs_mdio2>; }; dpmac3: dpmac@3 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x3>; + pcs-mdio = <&pcs_mdio3>; }; dpmac4: dpmac@4 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x4>; + pcs-mdio = <&pcs_mdio4>; }; dpmac5: dpmac@5 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x5>; + pcs-mdio = <&pcs_mdio5>; }; dpmac6: dpmac@6 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x6>; + pcs-mdio = <&pcs_mdio6>; }; dpmac7: dpmac@7 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x7>; + pcs-mdio = <&pcs_mdio7>; }; dpmac8: dpmac@8 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x8>; + pcs-mdio = <&pcs_mdio8>; }; dpmac9: dpmac@9 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x9>; + pcs-mdio = <&pcs_mdio9>; }; dpmac10: dpmac@a { compatible = "fsl,qoriq-mc-dpmac"; reg = <0xa>; + pcs-mdio = <&pcs_mdio10>; }; dpmac11: dpmac@b { compatible = "fsl,qoriq-mc-dpmac"; reg = <0xb>; + pcs-mdio = <&pcs_mdio11>; }; dpmac12: dpmac@c { compatible = "fsl,qoriq-mc-dpmac"; reg = <0xc>; + pcs-mdio = <&pcs_mdio12>; }; dpmac13: dpmac@d { compatible = "fsl,qoriq-mc-dpmac"; reg = <0xd>; + pcs-mdio = <&pcs_mdio13>; }; dpmac14: dpmac@e { compatible = "fsl,qoriq-mc-dpmac"; reg = <0xe>; + pcs-mdio = <&pcs_mdio14>; }; dpmac15: dpmac@f { compatible = "fsl,qoriq-mc-dpmac"; reg = <0xf>; + pcs-mdio = <&pcs_mdio15>; }; dpmac16: dpmac@10 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x10>; + pcs-mdio = <&pcs_mdio16>; }; dpmac17: dpmac@11 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x11>; + pcs-mdio = <&pcs_mdio17>; }; dpmac18: dpmac@12 { compatible = "fsl,qoriq-mc-dpmac"; reg = <0x12>; + pcs-mdio = <&pcs_mdio18>; }; }; }; From patchwork Tue Mar 17 14:53:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King \(Oracle\)" X-Patchwork-Id: 222397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65B8BC10F29 for ; Tue, 17 Mar 2020 14:53:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3918D206EC for ; Tue, 17 Mar 2020 14:53:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="n+KG9/Ub" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbgCQOxa (ORCPT ); Tue, 17 Mar 2020 10:53:30 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:40996 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726112AbgCQOxa (ORCPT ); Tue, 17 Mar 2020 10:53:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zy40pSnnLPpjvBORId3UuXxIFCVRHdxNligFP4pP/e0=; b=n+KG9/UbqaX6zOQN/6dQMF2dyu 5RQFRroaYN4ORg2TDwxd6XTPlNk231l1n7gNtlCL4s0F11cAH6vKgIarwT8POHcl8bX3FTHIb7hDU /5muV2cjfHo5ndwFMTr1miLZPki40WXSlkusCPCLfWQQ9c0ZfbLGDBWJHa3PWJqQ1lk4v0JldqZ91 GqLjZr/pvOraqUifDfys9qnnScMidFNXVFKDCa83D96YIMu59/ryp/MHF1IgfnNXbNvF+c1/IDdxP N7DTqWgFGdrn1DpMA2GjuxExbFNLOEOs6UsZBcW6rnwynr+5SH7fArbei1XGibenZxglbAmVbJOZM wcCS08Qw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:44368 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jEDaf-0007is-1K; Tue, 17 Mar 2020 14:53:09 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1jEDac-0008Jd-Vq; Tue, 17 Mar 2020 14:53:07 +0000 In-Reply-To: <20200317144944.GP25745@shell.armlinux.org.uk> References: <20200317144944.GP25745@shell.armlinux.org.uk> From: Russell King To: Andrew Lunn , Florian Fainelli , Heiner Kallweit Cc: "David S. Miller" , netdev@vger.kernel.org, Ioana Radulescu Subject: [RFC net-next 5/5] dpaa2-mac: add 10GBASE-R PCS support MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 17 Mar 2020 14:53:06 +0000 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org *NOT FOR MERGING* Signed-off-by: Russell King --- .../net/ethernet/freescale/dpaa2/dpaa2-mac.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c index e7b2dc366338..38f8d31bf426 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c @@ -27,6 +27,10 @@ static void dpaa2_mac_pcs_get_state(struct phylink_config *config, phylink_mii_c22_pcs_get_state(pcs, state); break; + case PHY_INTERFACE_MODE_10GBASER: + phylink_mii_c45_pcs_get_state(pcs, state); + break; + default: break; } @@ -131,6 +135,10 @@ static int phy_mode(enum dpmac_eth_if eth_if, phy_interface_t *if_mode) *if_mode = PHY_INTERFACE_MODE_SGMII; break; + case DPMAC_ETH_IF_XFI: + *if_mode = PHY_INTERFACE_MODE_10GBASER; + break; + default: return -EINVAL; } @@ -191,6 +199,7 @@ static bool dpaa2_mac_phy_mode_mismatch(struct dpaa2_mac *mac, case PHY_INTERFACE_MODE_RGMII_ID: case PHY_INTERFACE_MODE_RGMII_RXID: case PHY_INTERFACE_MODE_RGMII_TXID: + case PHY_INTERFACE_MODE_10GBASER: return (interface != mac->if_mode); default: return true; @@ -216,6 +225,17 @@ static void dpaa2_mac_validate(struct phylink_config *config, switch (state->interface) { case PHY_INTERFACE_MODE_NA: + case PHY_INTERFACE_MODE_10GBASER: + phylink_set(mask, 10000baseT_Full); + phylink_set(mask, 10000baseKR_Full); + phylink_set(mask, 10000baseCR_Full); + phylink_set(mask, 10000baseSR_Full); + phylink_set(mask, 10000baseLR_Full); + phylink_set(mask, 10000baseLRM_Full); + phylink_set(mask, 10000baseER_Full); + if (state->interface != PHY_INTERFACE_MODE_NA) + break; + /* fallthrough */ case PHY_INTERFACE_MODE_1000BASEX: case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_RGMII: