Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp254655rdb; Wed, 14 Feb 2024 21:30:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWuiOyAOyFQziwHgtnnWKOGhywJlxT9seWSsh2n/TnIUiiVCb+WTyzyKJulC9c8arz1PChs65LVB7Oh+P8zgH1Mi3vxXCMyUemIzwPTZw== X-Google-Smtp-Source: AGHT+IEh8LOD156RtQmd2AnvttODNkekEV8wfM6+frfGcMy4mJpXvbMv68GHjc7NNg6VNJi4x474 X-Received: by 2002:a17:903:183:b0:1db:6a20:24ca with SMTP id z3-20020a170903018300b001db6a2024camr962848plg.5.1707975006509; Wed, 14 Feb 2024 21:30:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707975006; cv=pass; d=google.com; s=arc-20160816; b=IUR4y3n4vKMAgq+hGb8OJieMUXEllDmb3wrBNrakMV1fdvX/47upe1enbDQ0nevrid 0BnExww/1WwMr+g2G5C0NoVKo04IAXEePRK4uiq6Up+0yoCWPG3RPfUV/0EE6JtkEqIa shkoBCbTLBcHjXVR5gxJmI1pzW9aaqWs7/OmVRsFnAU+2CZO857Fs0IVpequCtWmZtQr g7SJXQjEfyOFQ62AIwBean9W81S6GYr0xzQwdulMpeqmh1M3qKWIHpjAHM6Ac7ZF62dv 6gwiz8J0RtZxYHB4o3V8VzV103SlREoDlhAXky0zWEUGUh3lkFgfRl0zLgORCuyHUKEM PspQ== 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=1RJAG0YKQ2elvvfP1burGLa+E173ziVQ7i+i8k/F1w4=; fh=chTeah25dtsI+fnQYorT/69F850asxoXrFC8SVATgvA=; b=e+J3BxKw7JOQ+uxQZ78NtY5IoJf2Z9YVdXubPRnirazthgbKIy4JRiRl9mwwnNzpKs f6x64gP88XaqjCq0bK/oHHYmRQTwmHu3Jb+x8kDaO5ajR2jw1p3VIlTNsb/Y+EW0OVd1 5jcz8xPfxp5x34CH9WV51fqqW9tntVDaHlWoD/rRWYHsxRZns1qaQG1APp26q9ppOFbd xFrjkliLlHnAdQO89oxLJdCPJHwTGkTjvBRnyChtmdYBhZMS16FSCtsV4nxrNEAOb42M zMaJXilh0oYFOo5fnhDWyqthY7Khmd63JMqGng/xnfgZzvlrniFna693sozXSok+dQW/ sJLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Vsl1yFIr; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-66260-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66260-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. [139.178.88.99]) by mx.google.com with ESMTPS id n16-20020a170903111000b001d8ffa784cfsi549704plh.130.2024.02.14.21.30.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 21:30:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66260-linux.lists.archive=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=Vsl1yFIr; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-66260-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66260-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 5D128292CD2 for ; Thu, 15 Feb 2024 03:12:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 02CACDDD9; Thu, 15 Feb 2024 03:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Vsl1yFIr" 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 525B3611B; Thu, 15 Feb 2024 03:08:51 +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=1707966533; cv=none; b=b7d+ZQ+ZdxstqR72As7cd8cqUKT1IExZenJmv974hft1OvRpUCYdTbU/FdEb1cctDLjbxl3Wi51HzKBN0/khsTugPfxQD+uijZ+UF4WTmRfnR/qvV1ACOTMCQNganY3bQb4cBYfKMB1lIEEfIfUWtkqp0wS74p+qxWxPBNZkSe8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707966533; c=relaxed/simple; bh=qvmE9ozt+922Am67EghiGlMAntqBBBPRw+LPiyCAFes=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hx1NARbaEEZZ+y9qvvzGn9gv440KdljKsMddgcabRwIAdmyRzvcTvmzqBbh0co3YM0zKMo+EJFS1IO/RXXrzrYpeV4URJZXdNw7zF27Cl6/aD7K8IF6O3vsxSR0tMdfTCYQ3ixORaQBm/H89slJckjTr+wQPP7cJIBw5Ub/Duh4= 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=Vsl1yFIr; 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=1707966532; x=1739502532; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qvmE9ozt+922Am67EghiGlMAntqBBBPRw+LPiyCAFes=; b=Vsl1yFIrzGyB74w6qHdmSe/75lA/Y91AMd/wze4YnSKqCyO1X5CssomT +sDLZbk4EDil7qThVTwxstsX5KGjIFtOv/+MuX9vwiBi8+kAXe/pzDThB GcPblx2k1nstDqF8xuDmRwTRDoWRXjelIdUhwI+gIuRUB72n3LZdfsfwO vDZiifomVst5GFCaWpz8PZfVdb4eW8txWamopT9xQYjSgopR8Fz1bHSJ5 /nqXn7AoFcz1jcvvCVPXAXsZ2FglZ3Eva92kbU7rgGIh9v9TpNL5dImf/ jNmKyb6GXJGQ6H/GkiYS48akk5ddilcDoejfwjkkdDpOZDtP8z1L0JPYQ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="19461453" X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="19461453" 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:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,161,1705392000"; d="scan'208";a="3385871" Received: from yongliang-ubuntu20-ilbpg12.png.intel.com ([10.88.229.33]) by fmviesa009.fm.intel.com with ESMTP; 14 Feb 2024 19:08:35 -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 9/9] stmmac: intel: interface switching support for ADL-N platform Date: Thu, 15 Feb 2024 11:04:59 +0800 Message-Id: <20240215030500.3067426-10-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 ADL-S platform. Modphy register lane was provided to configure serdes on interface mode changing. Signed-off-by: Michael Sit Wei Hong Signed-off-by: Choong Yong Liang --- .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 49 ++++++++++++++++++- .../net/ethernet/stmicro/stmmac/dwmac-intel.h | 2 + 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index c79d8e3c3b24..f0f3d35bdb69 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -992,6 +992,53 @@ static int adls_sgmii_phy1_data(struct pci_dev *pdev, static struct stmmac_pci_info adls_sgmii1g_phy1_info = { .setup = adls_sgmii_phy1_data, }; + +static int adln_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 = 6; + plat->tx_queues_to_use = 4; + plat->clk_ptp_rate = 204800000; + + plat->safety_feat_cfg->tsoee = 1; + plat->safety_feat_cfg->mrxpee = 0; + plat->safety_feat_cfg->mestee = 1; + plat->safety_feat_cfg->mrxee = 1; + plat->safety_feat_cfg->mtxee = 1; + plat->safety_feat_cfg->epsi = 0; + plat->safety_feat_cfg->edpp = 0; + plat->safety_feat_cfg->prtyen = 0; + plat->safety_feat_cfg->tmouten = 0; + + intel_priv->tsn_lane_registers = adln_tsn_lane_registers; + intel_priv->max_tsn_lane_registers = ARRAY_SIZE(adln_tsn_lane_registers); + + return intel_mgbe_common_data(pdev, plat); +} + +static int adln_sgmii_phy0_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->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 adln_common_data(pdev, plat); +} + +static struct stmmac_pci_info adln_sgmii1g_phy0_info = { + .setup = adln_sgmii_phy0_data, +}; + static const struct stmmac_pci_func_data galileo_stmmac_func_data[] = { { .func = 6, @@ -1374,7 +1421,7 @@ static const struct pci_device_id intel_eth_pci_id_table[] = { { PCI_DEVICE_DATA(INTEL, TGLH_SGMII1G_1, &tgl_sgmii1g_phy1_info) }, { PCI_DEVICE_DATA(INTEL, ADLS_SGMII1G_0, &adls_sgmii1g_phy0_info) }, { PCI_DEVICE_DATA(INTEL, ADLS_SGMII1G_1, &adls_sgmii1g_phy1_info) }, - { PCI_DEVICE_DATA(INTEL, ADLN_SGMII1G, &tgl_sgmii1g_phy0_info) }, + { PCI_DEVICE_DATA(INTEL, ADLN_SGMII1G, &adln_sgmii1g_phy0_info) }, { PCI_DEVICE_DATA(INTEL, RPLP_SGMII1G, &tgl_sgmii1g_phy0_info) }, {} }; diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h index 093eed977ab0..2c6b50958988 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h @@ -124,8 +124,10 @@ static const struct pmc_serdes_regs pid_modphy1_2p5g_regs[] = { {} }; +static const int adln_tsn_lane_registers[] = {6}; static const int ehl_tsn_lane_registers[] = {7, 8, 9, 10, 11}; #else +static const int adln_tsn_lane_registers[] = {}; static const int ehl_tsn_lane_registers[] = {}; #endif /* CONFIG_INTEL_PMC_IPC */ -- 2.34.1