Re: [PATCH net-next 10/12] net: stmmac: tc956x: add TC956x/QPS615 support
From: Xilin Wu
Date: Thu May 07 2026 - 09:59:47 EST
On 5/7/2026 1:44 AM, Alex Elder wrote:
On 5/5/26 9:30 PM, Xilin Wu wrote:
On 5/1/2026 11:54 PM, Alex Elder wrote:
From: Daniel Thompson <daniel@xxxxxxxxxxxx>
Toshiba TC956x is an Ethernet AVB/TSN bridge and is essentially a
small and highly-specialized SoC. TC956x includes an "eMAC" subsystem
that can be accessed, along with several other peripherals, via two
PCIe endpoint functions. There is a main driver for the endpoint that
decomposes things and creates auxiliary bus devices to model the SoC.
The eMAC consists of a Designware XGMAC, XPCS and PMA. Each eMAC is
supported by an MSIGEN that bridges TC956x level interrupts to PCIe
MSIs.
Add a driver for the eMAC/MSIGEN combination.
Co-developed-by: Alex Elder <elder@xxxxxxxxxxxx>
Signed-off-by: Alex Elder <elder@xxxxxxxxxxxx>
Signed-off-by: Daniel Thompson <daniel@xxxxxxxxxxxx>
---
drivers/net/ethernet/stmicro/stmmac/Kconfig | 13 +
drivers/net/ethernet/stmicro/stmmac/Makefile | 2 +
.../ethernet/stmicro/stmmac/dwmac-tc956x.c | 791 ++++++++++++++++++
include/soc/toshiba/tc956x-dwmac.h | 84 ++
4 files changed, 890 insertions(+)
create mode 100644 drivers/net/ethernet/stmicro/stmmac/dwmac-tc956x.c
create mode 100644 include/soc/toshiba/tc956x-dwmac.h
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/ net/ethernet/stmicro/stmmac/Kconfig
index e3dd5adda5aca..66bcfaccbe21f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -404,6 +404,19 @@ config DWMAC_MOTORCOMM
This enables glue driver for Motorcomm DWMAC-based PCI Ethernet
controllers. Currently only YT6801 is supported.
+config DWMAC_TC956X
+ tristate "Toshiba TC956X DWMAC support"
+ depends on PCI
+ depends on COMMON_CLK
+ depends on TOSHIBA_TC956X_PCI
+ default m if TOSHIBA_TC956X_PCI
Hi Alex,
I think GENERIC_IRQ_CHIP should be selected here.
Yes there are a number of things missing in the Kconfig definitions
and I'm working through them this week. And yes, since we use
irq_generic_chip_ops we must ensure CONFIG_GENERIC_IRQ_CHIP is
enabled here.
Thank you for the driver.
Thank you for your feedback (this and others I see).
-Alex
Hi Alex,
Do you think if a shutdown callback like this is required? It looks like the driver sometimes does a MDIO MMIO read when the PCIe link is down, causing the board to reset due to SoC side PCIe NoC timeout.
After this change, the board can always shutdown gracefully.
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tc956x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tc956x.c
index 4e8b4a185583..34b8e3fe1b51 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tc956x.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tc956x.c
@@ -767,6 +767,17 @@ static void tc956x_dwmac_remove(struct auxiliary_device *adev)
tc956x_mac_disable(td);
}
+static void tc956x_dwmac_shutdown(struct auxiliary_device *adev)
+{
+ struct device *dev = &adev->dev;
+ int ret;
+
+ ret = stmmac_suspend(dev);
+ if (ret)
+ dev_warn(dev, "failed to suspend MAC during shutdown: %d\n",
+ ret);
+}
+
static const struct auxiliary_device_id tc956x_dwmac_ids[] = {
{ .name = TC956X_PCIE_DRIVER_NAME "." TC956X_XGMAC_DEV_NAME, },
{ },
@@ -777,6 +788,7 @@ static struct auxiliary_driver tc956x_dwmac_driver = {
.name = DRIVER_NAME,
.probe = tc956x_dwmac_probe,
.remove = tc956x_dwmac_remove,
+ .shutdown = tc956x_dwmac_shutdown,
.id_table = tc956x_dwmac_ids,
.driver = {
.name = DRIVER_NAME,
--
Best regards,
Xilin Wu <sophon@xxxxxxxxx>