From patchwork Fri Feb 25 12:00:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12760166 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE3C1C433EF for ; Fri, 25 Feb 2022 12:00:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240374AbiBYMAm (ORCPT ); Fri, 25 Feb 2022 07:00:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238780AbiBYMAj (ORCPT ); Fri, 25 Feb 2022 07:00:39 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FC902614B4 for ; Fri, 25 Feb 2022 04:00:07 -0800 (PST) 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=eRV5LkPH0KYq9VzxZXZQiGF/wkBVGXkB1BxB9vZ/1Ao=; b=pEWrTXPJpvfyNcOvMK2PLQcAk2 dX8l+7dbQlxqjKZwsI4nS5WIvlgre/3U6GafMV6NHgrGKzNJQixFA3Y/seO2YOwDyu8HXO847bfHy V7s754Gk5diHl8rUwtzXzwE5E1NUO0QgG8cKBRIrpoNgztGGIRjZxcFOnatWPJ9AKuTCMXQJuonYx B39B6f0vi/fwWcQeMBZhIMpCyt8xL5mUlC+Bb3Ke+zSGmVUrDDduEffDFFjjgOxtNqvkZRxg7DrBg uSpO2v8jYyDa+c20qMCId1i/g41oYP+rX1AsEotyU0CNuqMx1rVdty1EiR8afwsZQsmPlJMZHzDT4 /oBv28xA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:46074 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nNZGU-0005Ik-Nb; Fri, 25 Feb 2022 12:00:03 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nNZGU-00AbGh-3Q; Fri, 25 Feb 2022 12:00:02 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Vladimir Oltean Cc: Marek Beh__n , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH net-next 1/6] net: dsa: sja1105: populate supported_interfaces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Fri, 25 Feb 2022 12:00:02 +0000 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Populate the supported interfaces bitmap for the SJA1105 DSA switch. This switch only supports a static model of configuration, so we restrict the interface modes to the configured setting. Reviewed-by: Vladimir Oltean Signed-off-by: Russell King (Oracle) --- drivers/net/dsa/sja1105/sja1105_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index b513713be610..90e73a982faf 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -1412,6 +1412,18 @@ static void sja1105_mac_link_up(struct dsa_switch *ds, int port, sja1105_inhibit_tx(priv, BIT(port), false); } +static void sja1105_phylink_get_caps(struct dsa_switch *ds, int port, + struct phylink_config *config) +{ + struct sja1105_private *priv = ds->priv; + + /* The SJA1105 MAC programming model is through the static config + * (the xMII Mode table cannot be dynamically reconfigured), and + * we have to program that early. + */ + __set_bit(priv->phy_mode[port], config->supported_interfaces); +} + static void sja1105_phylink_validate(struct dsa_switch *ds, int port, unsigned long *supported, struct phylink_link_state *state) @@ -3152,6 +3164,7 @@ static const struct dsa_switch_ops sja1105_switch_ops = { .set_ageing_time = sja1105_set_ageing_time, .port_change_mtu = sja1105_change_mtu, .port_max_mtu = sja1105_get_max_mtu, + .phylink_get_caps = sja1105_phylink_get_caps, .phylink_validate = sja1105_phylink_validate, .phylink_mac_config = sja1105_mac_config, .phylink_mac_link_up = sja1105_mac_link_up,