Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp410658rdb; Mon, 29 Jan 2024 06:12:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfo56WWyYy2t88j7szB0UrFQ7schjhO+/r601E05Ps4OKHuZJRSQwcmUdXxU+EnYe0nJgy X-Received: by 2002:a17:90b:358f:b0:290:4e40:5adc with SMTP id mm15-20020a17090b358f00b002904e405adcmr7085178pjb.45.1706537561987; Mon, 29 Jan 2024 06:12:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706537561; cv=pass; d=google.com; s=arc-20160816; b=k/JDNq2aZpVZCP7DZoR5/Q9u9v8vle3/iveUhAbulAhqkLKv0b811rJEB2treooZWg POOlSuzWY4CcmYvSnMAfulhPPcgOil16nVq+hzF99o9aiQf88dzX+9ir871lcb3+cBAS ndM6m0EiAtw/uNMpCw9PidydEmxP4zp6iYN7g0ZI2dWhuzsJQ/JYGGmGayryiUQ3Z46i LKfIoKYjGhhUrh01QA1YKpVMfw3BJGjJFDfXZCUBAKOE1CBVkFuZldQ9EzwIyx0LMSJP VsUFV4bVTUXdknxQZPyt0ekEjUCs2hq0y+f9hZYTN00jQhCv03hje/28Yuk/XLRyl4BF ToYg== 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=IPbIVnHZKQyaqK3pCMfyT+ulGPLr9arnWOULvB7wFXg=; fh=/YJd8cagnZyj8HxcDZG6YnlmNxAW8XcSWCpxhbbfMGA=; b=N7FMnH1W0K0IM3gH2GgRUGLFmBwoHIFy104Q8mIqbcv3UdNTvS2JF0cK7A80N2hPdv LdpXq4EOOdHzzG1n5DBj3EQ2qQOo8YMVmiBCBPP1ZRbPXL6d7ycsKKVb1VI0dRy3xmky P6Zy6te9TmSdqfiyhu8oMOuFTnn36mlzUfCEhX+eLfkuJ4+1FnLGUyfl6fRDzSyPjWvI 4S+raFfNcHRGKwQ5daul3kZc+h2WUnWVA6thswrs9Eh3SDni78/CeCIbf4k6nnS17/Om PIxTN+u50BrY4kSTNc4TEXk1z7vpgh2LfjIt5v7bi4GvV3yCP++e1mVLfTaWi8vZTSkD iiyw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="AcPE/c2T"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42756-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42756-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j192-20020a638bc9000000b005d66232593dsi5685241pge.868.2024.01.29.06.12.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 06:12:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42756-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="AcPE/c2T"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-42756-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42756-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9784E288A83 for ; Mon, 29 Jan 2024 13:09:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6B54664D2; Mon, 29 Jan 2024 13:06:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AcPE/c2T" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 5C446664AE; Mon, 29 Jan 2024 13:06:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533587; cv=none; b=BI4p7028vRmPway3YgBbon18n4COfwUey6Pfo/O+WQj+7wFI2LAl5abpLwlXe4y5iL6sGtLG3EtLKYXhRKVHTxNDe4vxSBOPZ2qO4Ohc6c/WW+J1fkydrmx2hgUTJpRNIFk5GetNs7SDmzDKIqxOWhrq61DC8cw6q80wLV4iQlg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706533587; c=relaxed/simple; bh=YX+8SYjl2KN0yI2CjlWGvAYamUQY2YUGDNZGqVMB2u8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Kpnijbh1LPuRAi6DClyBksWVKrlG8KuSmn7unR6JmX9SZT5udGzfhlf73AKOU6LAmQojdb49gv04IFzWXLby4QmGYoc2fx50wn3OQon74waS2xC6tv0ywnXgJS+8lYsAdiYZzIxebO6aFRWAc0yuMB2dM28DneqCkId/KN8qPH0= 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=AcPE/c2T; arc=none smtp.client-ip=198.175.65.9 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=1706533587; x=1738069587; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YX+8SYjl2KN0yI2CjlWGvAYamUQY2YUGDNZGqVMB2u8=; b=AcPE/c2TphnboSNkXyibmUJLk4pX1eLfwXtFO9rABkLWP6+l+HaDarl9 JdT8KdbEMyfOXvnuBm+zo32wmrB96BPP0ruPOT0Rz6L1t3SQZXRgvs3Qu EZCZyZY69aOSL8+ezkXN5CP2aT3OAcmqNHV8XZkBGO7jMvlBJcZlKiddu Cd/3r6rjXNAFSuIod7GCmlpKqJ/FWvm2kQu63eH331Mwpoa3lI/nMEnsa u1pGJdqJAIdyBkID1OqnOK77uv0cN0he6Uz2HF45oR36IpEHzxAulvdZB IZiNeZEIuzilMrQZvod6lYPsaIXEmIfoHL915Q6CU/0JmQQs99Dwmigu6 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="21473643" X-IronPort-AV: E=Sophos;i="6.05,227,1701158400"; d="scan'208";a="21473643" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2024 05:06:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10967"; a="907106871" X-IronPort-AV: E=Sophos;i="6.05,227,1701158400"; d="scan'208";a="907106871" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by fmsmga002.fm.intel.com with ESMTP; 29 Jan 2024 05:06:17 -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 , Simon Horman , 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 v4 09/11] net: stmmac: configure SerDes on mac_finish Date: Mon, 29 Jan 2024 21:02:51 +0800 Message-Id: <20240129130253.1400707-10-yong.liang.choong@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129130253.1400707-1-yong.liang.choong@linux.intel.com> References: <20240129130253.1400707-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 50429c985441..ced26c01e88e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1129,12 +1129,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 778bdfc3f010..c14b4c204190 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