Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp213250rdb; Wed, 14 Feb 2024 19:12:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVP5nL2YDVNI82wKQ9Ozx3g4G8iLKQFQjzqmTDOTrT9hHscOgKmRbnKPT4+ZyOhRucROXtAUzRijUniCp3uTAJQgCHRgbPdad3G6TpiHQ== X-Google-Smtp-Source: AGHT+IHxPbv/w5oVa7ilEaiw0N6qScpBUpPZRJ/aNtcdXiw0Dxp3trmN27d3WfHCyh/pJYEc3BZO X-Received: by 2002:a05:622a:1710:b0:42d:c8b1:216b with SMTP id h16-20020a05622a171000b0042dc8b1216bmr1025236qtk.4.1707966728755; Wed, 14 Feb 2024 19:12:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707966728; cv=pass; d=google.com; s=arc-20160816; b=Grp2zeyY5RG0UVZvTTbDZ7SJ3yMy+pEPQ/gdm+vSIju8S68M94uwjO4Jhgm7ORNgYY PIjBec8vt1tH0BCZozenlBEdV1RnpibYuepQFCgQv8vUekEGT58QqEIdztJxvNKykvCs gx/dUGTGXQIM1HGPDnQPgzGLPqmJJlXPk9OQTAAp/gmZB6pIN2wxhtI8Ljs11yZ9i0YU TMmDwqpVjOX8KTV0Bt+vhCHyXoV8ofVxHK3KYUZd27Pggmc53dgVI0TjBI4XlLoTPcer jkEK1BTt9pbXHHlaGmfkIafERQXtsTymZL8bJOxSJPisKFGzs+/yXs2s0KbnL0rNeWdF uRuw== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66259-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 k3-20020ac86043000000b0042c66f982dasi454430qtm.358.2024.02.14.19.12.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 19:12:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66259-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=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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66259-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 820F41C29F86 for ; Thu, 15 Feb 2024 03:12:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BE231BF53; Thu, 15 Feb 2024 03:08:38 +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 Content-Transfer-Encoding: 8bit '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__ */ -- 2.34.1