Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp212541rdb; Wed, 14 Feb 2024 19:10:05 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVOJqPs77c9S0Kv6wN4fAL1S1fpNQ4izf2S8Hnd+ggTMjxxdo6qJ0DalmEVG5Gyhz1lrNT2vLvcvjDWRzYCtLMecNfcz2Xz87iBna5t6g== X-Google-Smtp-Source: AGHT+IFFtAeFglHZfo055mEkYHbSM1aU6MHPpR2sAFYw66ujTHwUT9qg6o/ghksgF57u9F5ewcLi X-Received: by 2002:a25:ac13:0:b0:dc6:d2d9:3096 with SMTP id w19-20020a25ac13000000b00dc6d2d93096mr458758ybi.37.1707966605657; Wed, 14 Feb 2024 19:10:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707966605; cv=pass; d=google.com; s=arc-20160816; b=OB59N6P884P4WCDueWu6u/6PeRI4GoAOcvaQAF8btmB88lWdRVoiPulUJ2uOKFl4jU qWiM0CUL+XHZ9W2uuAK3lsc4TWKk+l03kGQUYmdmaCbkoeQYVWWS1JNoufT8k82iqG2y yU2ZZK+Q9D3uxIL6eE4mNwKa0IvIq5s1pDXSLFekGpYH4/nfBwGXScfqmbuismREWP7A IkbOXM/CFWZD4W9xYgHzrdEZQBdA/0v2mxuMgYHCaKACfSB7ckKBAsLNbCyycPAueJFF xmrueILJ/7uKNYXcwHQQiOEg9s27YCzjnsigLci5doSuJHggNDECdkw4td+33Hr3mQns 15Wg== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66257-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b16-20020ac84f10000000b0042c4dc12656si404794qte.781.2024.02.14.19.10.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 19:10:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66257-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66257-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 690AC1C29E22 for ; Thu, 15 Feb 2024 03:10:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3DEA168BA; Thu, 15 Feb 2024 03:08:21 +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 Content-Transfer-Encoding: 8bit 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); -- 2.34.1