From patchwork Thu Feb 15 03:04:58 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: 201249 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp197769dyb; Wed, 14 Feb 2024 22:13:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVUa8z1b0mFhd1nwqokSyL/l824Erv2MvU4RIVgRRZhB+lRwCjzKUgjuA1iUgQMq9+SefYEs3m3bW8S1NK4lp8MxuvICA== X-Google-Smtp-Source: AGHT+IGQ/YFc+Yi3jpgzO5TIcHfpi+JBOBRu09nba0dYrMktsTs4vecUz7u0V/4NzWZS8XWRhyHv X-Received: by 2002:a17:906:7196:b0:a3d:1899:ec3 with SMTP id h22-20020a170906719600b00a3d18990ec3mr509047ejk.35.1707977583150; Wed, 14 Feb 2024 22:13:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707977583; cv=pass; d=google.com; s=arc-20160816; b=rqZTLRJ+vokO++GBY6g3kAEbKAhR6amEcVWI55WNYjYjcAhUuuew+nKCCyjWgDjO9h PzQ7sJi9UZTLSeRv5ZEVAPwgdTmAENh5jEVgN9oaJw8VlVfQfVf0cXVJJoMnwumtEpdY R1RYpG115hYWTxI8SoGTMZrBZTjQl4fRORKogMLognIdF7EY/vumT9WoeFdqh/cMOUNI oQVG8KWBzjA1I8n+IGIhvvAGuYv/TDcgUWXZdnXmRErzv2HeyNvo5/j+GUh/nf2WT7wH Ibg6mJPU9ekxgFEINmIoYSZMQZsaqRyS2JiY7YT5tigjtnqcl7I8ql9RZacMDQR5XnAb 5Sdw== 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=LmYrQJ7OelvEGpKp/xSNQi8aWOVnYn2uifgbLBSS4sI=; fh=chTeah25dtsI+fnQYorT/69F850asxoXrFC8SVATgvA=; b=zjsJwnWdtCObVJmhzaAaTyXpvdH0I2zYtTrjv6YKpws+74jRpLZxVtvIMB0qM+O5Hy ZNVzu1xtBC08qsNlV9Q1TWkN5UYwk6Tk36As8yJduHAHRlpDTUa8tT9Te7mjxGgCF7BV 9MDrDlbRa2UXi9MQKXEfKOETwS1qmHp90ZAuWyls1sc/lXcAxwAUrKn+8a2EfXXNCo5U Gmp1EphnhrhL9aHdbUPgJno7eF9gDmlfPpIn2DIg+sw4jBz1Mk3AJa89tW9LLKSZ8oQj zGdH7FXK+6ypEvGQ9AXUJvwFU7oaBcCIQ0ePkK3o/nhnXIv7L6QolIWqV9tOx1qjlrQM B+2g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c8ou8Ps6; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-66259-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66259-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cw14-20020a170906c78e00b00a3729de2a94si315768ejb.141.2024.02.14.22.13.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 22:13:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66259-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c8ou8Ps6; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-66259-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66259-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C540B1F2CD76 for ; Thu, 15 Feb 2024 03:12:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2BDFA1C29F; Thu, 15 Feb 2024 03:08:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="c8ou8Ps6" 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 D6A611BDED; Thu, 15 Feb 2024 03:08:35 +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=1707966517; cv=none; b=kj3L27NDpunDL0n0HLFswJGlu1keraDIhkWu862Hxl2J/tpec2EYBHRbpHhaLPeMF2qrOcQeJ+Aamb1YTVeiuPVUBB2B1M5A1e+/pQsvTNi6bWueFFHFNQ8EDvyEdeHwtymGNUlpjniFGzsA2evfIY5qSyNHerbrmASGSiGj0xA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707966517; c=relaxed/simple; bh=p/Gbsm0iaL+b0K2OX9Vd+27SSh2PBN4zKcqid0GWmkM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sAYUdOpANpt3XGSe9n/snszntEex/4tn4aYy3Sb4lrYJxsS3KVo8y1D/XV5P5bvydvHkqApFQ7/qHCx0XODCeOWzwehr7bQNF4a2G4mMVxvhVOdcreLeHXZfmyz7+dDk2gDCP0ADucaRK5Z38cmriPbHKRN/4vqcn0eADiBcQyc= 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=c8ou8Ps6; 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=1707966516; x=1739502516; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p/Gbsm0iaL+b0K2OX9Vd+27SSh2PBN4zKcqid0GWmkM=; b=c8ou8Ps6nZqZi6AgGD0LLNGKXTY/WjLKrW/xnO1y0WalHDVKgNHtao1O PhDO+lC+Hm9dhyg7DmiUCQ52/Y3Ot60MLsur6Q+pH74f4bkNIw6dSxDYB J0WSmRL35DY6KlUktg6NcBVfP2dJKxYuRTYrqDtw4XC1wC5ymRV01plAT DJQwnGgDGGwE0Tw5jFp86miDr6TVRZbtqTvGYOH+qUw3IWrtoOCz5Uibz KuBwd5OdImfKX/6NZMjO6rCSS6RFRc8bw+0isGXzNYG7sZO0nniwsOEpc HRSDr+KPHdfbL+6nRdq5dt/3LmeYdRGyP4pfUXsLV/1yn1367K040Cdsw A==; X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="19461428" X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="19461428" 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:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="3385846" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by fmviesa009.fm.intel.com with ESMTP; 14 Feb 2024 19:08:27 -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 8/9] stmmac: intel: interface switching support for EHL platform Date: Thu, 15 Feb 2024 11:04:58 +0800 Message-Id: <20240215030500.3067426-9-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: 1790944302651552075 X-GMAIL-MSGID: 1790944302651552075 'intel_get_pcs_neg_mode' and 'intel_config_serdes' was provided to handle interface mode change for EHL platform. Modphy register lane was provided to configure serdes on interface mode changing. Signed-off-by: Choong Yong Liang --- .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 21 +++++++++++++++++-- .../net/ethernet/stmicro/stmmac/dwmac-intel.h | 4 ++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 74cc0aa96faf..c79d8e3c3b24 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -759,6 +759,8 @@ static int intel_mgbe_common_data(struct pci_dev *pdev, static int ehl_common_data(struct pci_dev *pdev, struct plat_stmmacenet_data *plat) { + struct intel_priv_data *intel_priv = plat->bsp_priv; + plat->rx_queues_to_use = 8; plat->tx_queues_to_use = 8; plat->flags |= STMMAC_FLAG_USE_PHY_WOL; @@ -774,21 +776,28 @@ static int ehl_common_data(struct pci_dev *pdev, plat->safety_feat_cfg->prtyen = 0; plat->safety_feat_cfg->tmouten = 0; + intel_priv->tsn_lane_registers = ehl_tsn_lane_registers; + intel_priv->max_tsn_lane_registers = ARRAY_SIZE(ehl_tsn_lane_registers); + return intel_mgbe_common_data(pdev, plat); } static int ehl_sgmii_data(struct pci_dev *pdev, struct plat_stmmacenet_data *plat) { + struct intel_priv_data *intel_priv = plat->bsp_priv; + plat->bus_id = 1; plat->phy_interface = PHY_INTERFACE_MODE_SGMII; - plat->speed_mode_2500 = intel_speed_mode_2500; + plat->max_speed = SPEED_2500; plat->serdes_powerup = intel_serdes_powerup; plat->serdes_powerdown = intel_serdes_powerdown; plat->get_pcs_neg_mode = intel_get_pcs_neg_mode; plat->config_serdes = intel_config_serdes; plat->clk_ptp_rate = 204800000; + intel_priv->pid_modphy = PID_MODPHY3; + return ehl_common_data(pdev, plat); } @@ -841,12 +850,16 @@ static struct stmmac_pci_info ehl_pse0_rgmii1g_info = { static int ehl_pse0_sgmii1g_data(struct pci_dev *pdev, struct plat_stmmacenet_data *plat) { + struct intel_priv_data *intel_priv = plat->bsp_priv; + plat->phy_interface = PHY_INTERFACE_MODE_SGMII; - plat->speed_mode_2500 = intel_speed_mode_2500; + plat->max_speed = SPEED_2500; plat->serdes_powerup = intel_serdes_powerup; plat->serdes_powerdown = intel_serdes_powerdown; plat->get_pcs_neg_mode = intel_get_pcs_neg_mode; plat->config_serdes = intel_config_serdes; + intel_priv->pid_modphy = PID_MODPHY1; + return ehl_pse0_common_data(pdev, plat); } @@ -884,12 +897,16 @@ static struct stmmac_pci_info ehl_pse1_rgmii1g_info = { static int ehl_pse1_sgmii1g_data(struct pci_dev *pdev, struct plat_stmmacenet_data *plat) { + struct intel_priv_data *intel_priv = plat->bsp_priv; + plat->phy_interface = PHY_INTERFACE_MODE_SGMII; plat->speed_mode_2500 = intel_speed_mode_2500; plat->serdes_powerup = intel_serdes_powerup; plat->serdes_powerdown = intel_serdes_powerdown; plat->get_pcs_neg_mode = intel_get_pcs_neg_mode; plat->config_serdes = intel_config_serdes; + intel_priv->pid_modphy = PID_MODPHY1; + return ehl_pse1_common_data(pdev, plat); } diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h index 79c35ba969ea..093eed977ab0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h @@ -123,6 +123,10 @@ static const struct pmc_serdes_regs pid_modphy1_2p5g_regs[] = { { PID_MODPHY1_N_MODPHY_PCR_CMN_ANA_DWORD30, N_MODPHY_PCR_CMN_ANA_DWORD30_2P5G }, {} }; + +static const int ehl_tsn_lane_registers[] = {7, 8, 9, 10, 11}; +#else +static const int ehl_tsn_lane_registers[] = {}; #endif /* CONFIG_INTEL_PMC_IPC */ #endif /* __DWMAC_INTEL_H__ */