public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: jitendra.vegiraju@broadcom.com
To: netdev@vger.kernel.org
Cc: alexandre.torgue@foss.st.com, joabreu@synopsys.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	jitendra.vegiraju@broadcom.com,
	bcm-kernel-feedback-list@broadcom.com, richardcochran@gmail.com,
	ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org,
	john.fastabend@gmail.com, fancer.lancer@gmail.com,
	rmk+kernel@armlinux.org.uk, ahalaney@redhat.com,
	xiaolei.wang@windriver.com, rohan.g.thomas@intel.com,
	Jianheng.Zhang@synopsys.com, linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org,
	andrew@lunn.ch, linux@armlinux.org.uk, horms@kernel.org,
	florian.fainelli@broadcom.com
Subject: [PATCH net-next v5 3/5] net: stmmac: Integrate dw25gmac into stmmac hwif handling
Date: Tue,  3 Sep 2024 22:48:13 -0700	[thread overview]
Message-ID: <20240904054815.1341712-4-jitendra.vegiraju@broadcom.com> (raw)
In-Reply-To: <20240904054815.1341712-1-jitendra.vegiraju@broadcom.com>

From: Jitendra Vegiraju <jitendra.vegiraju@broadcom.com>

Integrate dw25gmac support into stmmac hardware interface handling.
Added a new entry to the stmmac_hw table in hwif.c.
Since BCM8958x is an early adopter device, the synopsis_id reported in HW
is 0x32 and device_id is DWXGMAC_ID. Provide override support by giving
preference to snps_id, snps_dev_id values when initialized to non-zero
values by glue driver.

Signed-off-by: Jitendra Vegiraju <jitendra.vegiraju@broadcom.com>
---
 drivers/net/ethernet/stmicro/stmmac/hwif.c | 26 +++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c
index 29367105df54..ad76dbab6622 100644
--- a/drivers/net/ethernet/stmicro/stmmac/hwif.c
+++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c
@@ -257,6 +257,27 @@ static const struct stmmac_hwif_entry {
 		.est = &dwmac510_est_ops,
 		.setup = dwxgmac2_setup,
 		.quirks = NULL,
+	}, {
+		.gmac = false,
+		.gmac4 = false,
+		.xgmac = true,
+		.min_id = DW25GMAC_CORE_4_00,
+		.dev_id = DW25GMAC_ID,
+		.regs = {
+			.ptp_off = PTP_XGMAC_OFFSET,
+			.mmc_off = MMC_XGMAC_OFFSET,
+			.est_off = EST_XGMAC_OFFSET,
+		},
+		.desc = &dwxgmac210_desc_ops,
+		.dma = &dw25gmac400_dma_ops,
+		.mac = &dwxgmac210_ops,
+		.hwtimestamp = &stmmac_ptp,
+		.mode = NULL,
+		.tc = &dwmac510_tc_ops,
+		.mmc = &dwxgmac_mmc_ops,
+		.est = &dwmac510_est_ops,
+		.setup = dw25gmac_setup,
+		.quirks = NULL,
 	}, {
 		.gmac = false,
 		.gmac4 = false,
@@ -292,7 +313,10 @@ int stmmac_hwif_init(struct stmmac_priv *priv)
 	u32 id, dev_id = 0;
 	int i, ret;
 
-	if (needs_gmac) {
+	if (priv->plat->snps_id && priv->plat->snps_dev_id) {
+		id = priv->plat->snps_id;
+		dev_id = priv->plat->snps_dev_id;
+	} else if (needs_gmac) {
 		id = stmmac_get_id(priv, GMAC_VERSION);
 	} else if (needs_gmac4 || needs_xgmac) {
 		id = stmmac_get_id(priv, GMAC4_VERSION);
-- 
2.34.1



  parent reply	other threads:[~2024-09-04  5:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04  5:48 [net-next v5 0/5] net: stmmac: Add PCI driver support for BCM8958x jitendra.vegiraju
2024-09-04  5:48 ` [PATCH net-next v5 1/5] net: stmmac: Add HDMA mapping for dw25gmac support jitendra.vegiraju
2024-09-10 18:37   ` Serge Semin
2024-09-11 21:50     ` Jitendra Vegiraju
2024-09-04  5:48 ` [PATCH net-next v5 2/5] net: stmmac: Add basic dw25gmac support in stmmac core jitendra.vegiraju
2024-09-10 19:24   ` Serge Semin
2024-09-16 23:32     ` Jitendra Vegiraju
2024-10-04 16:05       ` Jitendra Vegiraju
2024-10-04 23:45         ` Serge Semin
2024-10-11  0:01         ` Serge Semin
2024-10-10 23:55       ` Serge Semin
2024-10-14 18:24         ` Jitendra Vegiraju
2024-09-04  5:48 ` jitendra.vegiraju [this message]
2024-09-04  5:48 ` [PATCH net-next v5 4/5] net: stmmac: Add PCI driver support for BCM8958x jitendra.vegiraju
2024-09-10 19:51   ` Serge Semin
2024-09-16 23:43     ` Jitendra Vegiraju
2024-09-04  5:48 ` [PATCH net-next v5 5/5] net: stmmac: Add BCM8958x driver to build system jitendra.vegiraju
2024-09-06 12:14 ` [net-next v5 0/5] net: stmmac: Add PCI driver support for BCM8958x Serge Semin
2024-09-10 11:29 ` Paolo Abeni
2024-09-10 11:55   ` Serge Semin

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=20240904054815.1341712-4-jitendra.vegiraju@broadcom.com \
    --to=jitendra.vegiraju@broadcom.com \
    --cc=Jianheng.Zhang@synopsys.com \
    --cc=ahalaney@redhat.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=joabreu@synopsys.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=rohan.g.thomas@intel.com \
    --cc=xiaolei.wang@windriver.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