From: Choong Yong Liang <yong.liang.choong@linux.intel.com>
To: "Rajneesh Bhardwaj" <irenic.rajneesh@gmail.com>,
"David E Box" <david.e.box@linux.intel.com>,
"Hans de Goede" <hdegoede@redhat.com>,
"Mark Gross" <markgross@kernel.org>,
"Jose Abreu" <Jose.Abreu@synopsys.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Marek Behún" <kabel@kernel.org>,
"Jean Delvare" <jdelvare@suse.com>,
"Guenter Roeck" <linux@roeck-us.net>,
"Giuseppe Cavallaro" <peppe.cavallaro@st.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Jose Abreu" <joabreu@synopsys.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Richard Cochran" <richardcochran@gmail.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Wong Vee Khee" <veekhee@apple.com>,
"Jon Hunter" <jonathanh@nvidia.com>,
"Jesse Brandeburg" <jesse.brandeburg@intel.com>,
"Revanth Kumar Uppala" <ruppala@nvidia.com>,
"Shenwei Wang" <shenwei.wang@nxp.com>,
"Andrey Konovalov" <andrey.konovalov@linaro.org>,
"Jochen Henneberg" <jh@henneberg-systemdesign.com>
Cc: David E Box <david.e.box@intel.com>,
Andrew Halaney <ahalaney@redhat.com>,
Simon Horman <simon.horman@corigine.com>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
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 <weifeng.voon@intel.com>,
Tan Tee Min <tee.min.tan@linux.intel.com>,
Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>,
Lai Peter Jun Ann <jun.ann.lai@intel.com>
Subject: [PATCH net-next v3 5/5] stmmac: intel: Add 1G/2.5G auto-negotiation support for ADL-N
Date: Thu, 21 Sep 2023 20:19:46 +0800 [thread overview]
Message-ID: <20230921121946.3025771-6-yong.liang.choong@linux.intel.com> (raw)
In-Reply-To: <20230921121946.3025771-1-yong.liang.choong@linux.intel.com>
Add modphy register lane to have 1G/2.5G auto-negotiation support for
ADL-N.
Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
---
.../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 a211f42914a2..bece46faa710 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -961,6 +961,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->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,
@@ -1343,7 +1390,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.25.1
next prev parent reply other threads:[~2023-09-21 17:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-21 12:19 [PATCH net-next v3 0/5] TSN auto negotiation between 1G and 2.5G Choong Yong Liang
2023-09-21 12:19 ` [PATCH net-next v3 1/5] arch: x86: Add IPC mailbox accessor function and add SoC register access Choong Yong Liang
2023-09-22 9:45 ` Simon Horman
2023-09-21 12:19 ` [PATCH net-next v3 2/5] net: pcs: xpcs: combine C37 SGMII AN and 2500BASEX for Intel mGbE controller Choong Yong Liang
2023-09-21 13:06 ` Russell King (Oracle)
2023-09-26 10:51 ` Serge Semin
2024-01-29 13:15 ` Choong Yong Liang
2023-09-21 12:19 ` [PATCH net-next v3 3/5] net: phy: update in-band AN mode when changing interface by PHY driver Choong Yong Liang
2023-09-21 14:04 ` Russell King (Oracle)
2024-01-29 13:18 ` Choong Yong Liang
2023-09-21 12:19 ` [PATCH net-next v3 4/5] net: stmmac: enable Intel mGbE 1G/2.5G auto-negotiation support Choong Yong Liang
2023-09-21 13:28 ` Russell King (Oracle)
2023-09-26 10:55 ` Serge Semin
2024-01-29 13:19 ` Choong Yong Liang
2024-01-29 13:41 ` Andrew Lunn
2024-02-02 3:07 ` Choong Yong Liang
2023-09-21 12:19 ` Choong Yong Liang [this message]
2023-09-21 13:14 ` [PATCH net-next v3 0/5] TSN auto negotiation between 1G and 2.5G Andrew Lunn
2023-09-21 14:09 ` Russell King (Oracle)
2024-01-29 13:13 ` Choong Yong Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230921121946.3025771-6-yong.liang.choong@linux.intel.com \
--to=yong.liang.choong@linux.intel.com \
--cc=Jose.Abreu@synopsys.com \
--cc=ahalaney@redhat.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=andrey.konovalov@linaro.org \
--cc=ast@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=david.e.box@intel.com \
--cc=david.e.box@linux.intel.com \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=hdegoede@redhat.com \
--cc=hkallweit1@gmail.com \
--cc=irenic.rajneesh@gmail.com \
--cc=jdelvare@suse.com \
--cc=jesse.brandeburg@intel.com \
--cc=jh@henneberg-systemdesign.com \
--cc=joabreu@synopsys.com \
--cc=john.fastabend@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=jun.ann.lai@intel.com \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=linux@roeck-us.net \
--cc=markgross@kernel.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=michael.wei.hong.sit@intel.com \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=ruppala@nvidia.com \
--cc=shenwei.wang@nxp.com \
--cc=simon.horman@corigine.com \
--cc=tee.min.tan@linux.intel.com \
--cc=veekhee@apple.com \
--cc=weifeng.voon@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).