[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250424072209.3134762-4-chenhuacai@loongson.cn>
Date: Thu, 24 Apr 2025 15:22:09 +0800
From: Huacai Chen <chenhuacai@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: Yanteng Si <si.yanteng@...ux.dev>,
Feiyang Chen <chris.chenfeiyang@...il.com>,
loongarch@...ts.linux.dev,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Huacai Chen <chenhuacai@...ngson.cn>,
Andrew Lunn <andrew@...n.ch>,
Henry Chen <chenx97@...c.io>,
Biao Dong <dongbiao@...ngson.cn>,
Baoqi Zhang <zhangbaoqi@...ngson.cn>
Subject: [PATCH net-next V3 3/3] net: stmmac: dwmac-loongson: Add new GMAC's PCI device ID support
Add a new GMAC's PCI device ID (0x7a23) support which is used in
Loongson-2K3000/Loongson-3B6000M. The new GMAC device use external PHY,
so it reuses loongson_gmac_data() as the old GMAC device (0x7a03), and
the new GMAC device still doesn't support flow control now.
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Reviewed-by: Yanteng Si <si.yanteng@...ux.dev>
Tested-by: Henry Chen <chenx97@...c.io>
Tested-by: Biao Dong <dongbiao@...ngson.cn>
Signed-off-by: Baoqi Zhang <zhangbaoqi@...ngson.cn>
Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index 57917f26ab4d..e1591e6217d4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -66,7 +66,8 @@
DMA_STATUS_TPS | DMA_STATUS_TI | \
DMA_STATUS_MSK_COMMON_LOONGSON)
-#define PCI_DEVICE_ID_LOONGSON_GMAC 0x7a03
+#define PCI_DEVICE_ID_LOONGSON_GMAC1 0x7a03
+#define PCI_DEVICE_ID_LOONGSON_GMAC2 0x7a23
#define PCI_DEVICE_ID_LOONGSON_GNET 0x7a13
#define DWMAC_CORE_MULTICHAN_V1 0x10 /* Loongson custom ID 0x10 */
#define DWMAC_CORE_MULTICHAN_V2 0x12 /* Loongson custom ID 0x12 */
@@ -371,7 +372,7 @@ static struct mac_device_info *loongson_dwmac_setup(void *apriv)
/* Loongson GMAC doesn't support the flow control. Loongson GNET
* without multi-channel doesn't support the half-duplex link mode.
*/
- if (pdev->device == PCI_DEVICE_ID_LOONGSON_GMAC) {
+ if (pdev->device != PCI_DEVICE_ID_LOONGSON_GNET) {
mac->link.caps = MAC_10 | MAC_100 | MAC_1000;
} else {
if (ld->multichan)
@@ -659,7 +660,8 @@ static SIMPLE_DEV_PM_OPS(loongson_dwmac_pm_ops, loongson_dwmac_suspend,
loongson_dwmac_resume);
static const struct pci_device_id loongson_dwmac_id_table[] = {
- { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) },
+ { PCI_DEVICE_DATA(LOONGSON, GMAC1, &loongson_gmac_pci_info) },
+ { PCI_DEVICE_DATA(LOONGSON, GMAC2, &loongson_gmac_pci_info) },
{ PCI_DEVICE_DATA(LOONGSON, GNET, &loongson_gnet_pci_info) },
{}
};
--
2.47.1
Powered by blists - more mailing lists