From patchwork Mon Mar 15 05:27:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 402436 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 0D2A8C43603 for ; Mon, 15 Mar 2021 05:25:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF65464E64 for ; Mon, 15 Mar 2021 05:25:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbhCOFYG (ORCPT ); Mon, 15 Mar 2021 01:24:06 -0400 Received: from mga07.intel.com ([134.134.136.100]:59451 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbhCOFXq (ORCPT ); Mon, 15 Mar 2021 01:23:46 -0400 IronPort-SDR: 7cY7+esVXPzqt75l6bu+AqyACOh2j1Q3Tgwf3l9B0AvTYXvYC4R/ZHnvwr8cHOuxHYNUyGNXc/ aJkzste6ksew== X-IronPort-AV: E=McAfee;i="6000,8403,9923"; a="253054434" X-IronPort-AV: E=Sophos;i="5.81,249,1610438400"; d="scan'208";a="253054434" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2021 22:23:46 -0700 IronPort-SDR: 1/cAsenCU0xICtIZHqEUWJfj1qU+rtF40TXR/wZ2gHHEdcPog4//sxMppSSwzhQ1W68iGh3uAw UfKQAPToILQA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,249,1610438400"; d="scan'208";a="373313777" Received: from glass.png.intel.com ([10.158.65.59]) by orsmga006.jf.intel.com with ESMTP; 14 Mar 2021 22:23:42 -0700 From: Ong Boon Leong To: Giuseppe Cavallaro , Andrew Lunn , Heiner Kallweit , Russell King i , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski Cc: Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ong Boon Leong , Voon Weifeng , Wong Vee Khee , Fugang Duan Subject: [PATCH net-next 4/6] net: stmmac: make in-band AN mode parsing is supported for non-DT Date: Mon, 15 Mar 2021 13:27:09 +0800 Message-Id: <20210315052711.16728-5-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210315052711.16728-1-boon.leong.ong@intel.com> References: <20210315052711.16728-1-boon.leong.ong@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Not all platform uses DT, so phylink_parse_mode() will skip in-band setup of pl->supported and pl->link_config.advertising entirely. So, we add the setting of ovr_an_inband flag to make it works for non-DT platform. Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++ include/linux/stmmac.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 208cae344ffa..b64ee029d41f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1117,6 +1117,8 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) priv->phylink_config.dev = &priv->dev->dev; priv->phylink_config.type = PHYLINK_NETDEV; priv->phylink_config.pcs_poll = true; + priv->phylink_config.ovr_an_inband = + priv->plat->mdio_bus_data->xpcs_an_inband; if (!fwnode) fwnode = dev_fwnode(priv->device); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index a302982de2d7..722dc167b5c9 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -81,6 +81,7 @@ struct stmmac_mdio_bus_data { unsigned int phy_mask; unsigned int has_xpcs; + unsigned int xpcs_an_inband; int *irqs; int probed_phy_irq; bool needs_reset;