[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241018205332.525595-4-jitendra.vegiraju@broadcom.com>
Date: Fri, 18 Oct 2024 13:53:30 -0700
From: jitendra.vegiraju@...adcom.com
To: netdev@...r.kernel.org
Cc: alexandre.torgue@...s.st.com,
joabreu@...opsys.com,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
mcoquelin.stm32@...il.com,
jitendra.vegiraju@...adcom.com,
bcm-kernel-feedback-list@...adcom.com,
richardcochran@...il.com,
ast@...nel.org,
daniel@...earbox.net,
hawk@...nel.org,
john.fastabend@...il.com,
fancer.lancer@...il.com,
rmk+kernel@...linux.org.uk,
ahalaney@...hat.com,
xiaolei.wang@...driver.com,
rohan.g.thomas@...el.com,
Jianheng.Zhang@...opsys.com,
linux-kernel@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org,
bpf@...r.kernel.org,
andrew@...n.ch,
linux@...linux.org.uk,
horms@...nel.org,
florian.fainelli@...adcom.com,
quic_abchauha@...cinc.com
Subject: [PATCH net-next v6 3/5] net: stmmac: Integrate dw25gmac into stmmac hwif handling
From: Jitendra Vegiraju <jitendra.vegiraju@...adcom.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, dev_id values when initialized to non-zero
values by glue driver.
Signed-off-by: Jitendra Vegiraju <jitendra.vegiraju@...adcom.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 88cce28b2f98..b8ee7bf20037 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->dev_id) {
+ id = priv->plat->snps_id;
+ dev_id = priv->plat->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
Powered by blists - more mailing lists