From patchwork Thu Feb 15 03:04:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Choong Yong Liang X-Patchwork-Id: 201251 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp218285dyb; Wed, 14 Feb 2024 23:13:47 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXAf0yvfy7pLl5/ZimfQJw1UUiEIIQeFc/uo8/IE9tqy4yWm/NRBeU5qd2eHQItHZntB/r56NLJXZKeyADbJrwO/BS3nw== X-Google-Smtp-Source: AGHT+IHL6rdsCnEmKbnSBrg3IBb7Tn+VN6xPjCscr2p8c7KeomBKBYI7FGjZYQw1wjSWJHNTAdVA X-Received: by 2002:a17:903:2349:b0:1d7:428f:50fd with SMTP id c9-20020a170903234900b001d7428f50fdmr1152380plh.31.1707981227067; Wed, 14 Feb 2024 23:13:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707981227; cv=pass; d=google.com; s=arc-20160816; b=KalyDcA3tY4CKYWc+PW4EwiEmLfAVuIGlDfh3jlR2BvV6Owx+f9ZCgXUNMFjh/jQ8A rwV32uSMf/qzc9/IeKxJAKsw0cayq9Nk0jOms1GUG0zV+CEbaK/HL/1dsM6Q6qGQ5X7g 6Cbx+tnyTeaisRPUxeqE2GLXhc9CRLNZXamhWOR9gcDN6u4vlFKkUFg/MJ/e+DPKnZAS w9T0N+r7QAU8R6sJN2PW4hi2JoGTeUEy1J96GLkWt7rKxSlFkOGIiO3va+pX7iAGJz8i U9Gzj/d4u6AVHA3N/INxcdtmwbVn0YNhmbiQC9hyYiDzuoSt7YxLbBLapDhvblDeCUDm ij2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=TTakV/5bnIstZwzO7KNO+VigYOS+w86gAAnqWolw8fo=; fh=chTeah25dtsI+fnQYorT/69F850asxoXrFC8SVATgvA=; b=YKfM24u2zAGaz84byRdZLYW4x3v9oDRviU/VaHUU1VV+wXikRDC3RX3EQHQz3V8LJZ LCJqidKdLffFPwAh+PG3ginXgPRMPocOOUbYV3jdSdQIV5Dd9JIvb49WiNO2fr92Z2wy k9IO2sppopvJgUeQClInrfadBHHCD0YCTiwaP8AUZoYQxKps/nC1rmhoa8cQxn/r2glw FkQAakEXXw4h7WBZzQ9xFxTt2y8oHRru3Efc0nbCnWmLUvPyUvtHhgAdMbp5RhqR8NeE D+8DXYeMHxl0lCFnGs7HCQtTVrp6V/fVWm3oehznY3VqkTR51FNq+jW4KmzSKhwCnZpY xOcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gZ7I4WHg; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-66257-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66257-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m16-20020a170902db1000b001d9b8bc0fd8si676769plx.68.2024.02.14.23.13.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 23:13:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66257-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gZ7I4WHg; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-66257-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66257-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 76F3629039D for ; Thu, 15 Feb 2024 03:10:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68E6517735; Thu, 15 Feb 2024 03:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gZ7I4WHg" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63A11BA2E; Thu, 15 Feb 2024 03:08:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707966500; cv=none; b=pPBGtcvh/k9PiYjfoYF3On/GAXsg5gajzLExh7m39f2UPaKZl6tCncqfRulkPT6QQaUTOHXFU1hiQaUVA49njUKqvISwWg7MGlgdAvfQG4HFtZNrh0E2AZ7dqhpT8BbVE3TKwlEVxTUcDRInuGfHA3vLQECsFOkcQxCeGMi1QwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707966500; c=relaxed/simple; bh=vvpIPgH1K2PujTnqInvxE+a2W/xss8TF8nrQRvP6KiQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YhfxIY2y2iepAuVg5LU3z9dinbQyIvibPGuuutDhrxGhwPpYlVZlftwS61VeS9nTgd7Z05UbzxUdAoaN/uhHHm8yEK+QZdREVARS0XdrDSlyvzzkScrcpI73oWG35bSeHsXtsHxtpmXBkE0ylvM3Ny554SOJiX7mmFDTVnRy/Xc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gZ7I4WHg; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707966500; x=1739502500; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vvpIPgH1K2PujTnqInvxE+a2W/xss8TF8nrQRvP6KiQ=; b=gZ7I4WHgYWomjcwBvI1Pjb0NLZQYZEmzbWXGCQZKyEj2P4MKAkgb/Pfi BlEVr/JgsVAfuWbocwM9DaBkvP4urpvi/dBJqeKy4TN1P+ZTHThCYjULj fHyQxZgwRT2pgeNDu2x/cIFUujAgeBAMCCnktlCIWvccOzeKCK/48GGIF /VEmgEshCibmvuz7Aoy8/Dz6/t7WixABW3KFyKdvDfC/0SwWs6fpQcv7/ KcnVIHuytBZ7hLxztv4btdhYanLxvRdIEIVZZ7CdrjOFwklUqQK3++K3R i1Vh322HTQ7qM9Mc451O/q34JDzu9F9NPY6fZzgytyrgvslirvI3mKpcb g==; X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="19461373" X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="19461373" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2024 19:08:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="3385820" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by fmviesa009.fm.intel.com with ESMTP; 14 Feb 2024 19:08:11 -0800 From: Choong Yong Liang To: Rajneesh Bhardwaj , David E Box , Hans de Goede , Mark Gross , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran , Russell King , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andrew Lunn , Heiner Kallweit , Philipp Zabel Cc: Andrew Halaney , Serge Semin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, bpf@vger.kernel.org, Voon Wei Feng , Michael Sit Wei Hong , Lai Peter Jun Ann , Abdul Rahim Faizal Subject: [PATCH net-next v5 6/9] net: stmmac: configure SerDes on mac_finish Date: Thu, 15 Feb 2024 11:04:56 +0800 Message-Id: <20240215030500.3067426-7-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240215030500.3067426-1-yong.liang.choong@linux.intel.com> References: <20240215030500.3067426-1-yong.liang.choong@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790948123253533684 X-GMAIL-MSGID: 1790948123253533684 SerDes will configure according to the provided interface mode after finish a major reconfiguration of the interface mode. Signed-off-by: Choong Yong Liang --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 13 +++++++++++++ include/linux/stmmac.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index dbd16fc38888..69a33e9f1a5c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1120,12 +1120,25 @@ static unsigned int stmmac_get_pcs_neg_mode(struct phylink_config *config, return neg_mode; } +static int stmmac_mac_finish(struct phylink_config *config, unsigned int mode, + phy_interface_t interface) +{ + struct net_device *ndev = to_net_dev(config->dev); + struct stmmac_priv *priv = netdev_priv(ndev); + + if (priv->plat->config_serdes) + priv->plat->config_serdes(ndev, priv->plat->bsp_priv, interface); + + return 0; +} + static const struct phylink_mac_ops stmmac_phylink_mac_ops = { .mac_select_pcs = stmmac_mac_select_pcs, .mac_config = stmmac_mac_config, .mac_link_down = stmmac_mac_link_down, .mac_link_up = stmmac_mac_link_up, .mac_get_pcs_neg_mode = stmmac_get_pcs_neg_mode, + .mac_finish = stmmac_mac_finish, }; /** diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index ffd66722eeda..fd3d7d25f871 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -279,6 +279,9 @@ struct plat_stmmacenet_data { void (*speed_mode_2500)(struct net_device *ndev, void *priv); unsigned int (*get_pcs_neg_mode)(phy_interface_t interface, struct pci_dev *pdev); + int (*config_serdes)(struct net_device *ndev, + void *priv, + phy_interface_t interface); void (*ptp_clk_freq_config)(struct stmmac_priv *priv); int (*init)(struct platform_device *pdev, void *priv); void (*exit)(struct platform_device *pdev, void *priv);