]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
net: ftgmac100: Fix Aspeed ast2600 TX hang issue
authorDylan Hung <dylan_hung@aspeedtech.com>
Wed, 14 Oct 2020 06:06:32 +0000 (14:06 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 16 Oct 2020 22:36:34 +0000 (15:36 -0700)
The new HW arbitration feature on Aspeed ast2600 will cause MAC TX to
hang when handling scatter-gather DMA.  Disable the problematic feature
by setting MAC register 0x58 bit28 and bit27.

Fixes: 39bfab8844a0 ("net: ftgmac100: Add support for DT phy-handle property")
Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/faraday/ftgmac100.c
drivers/net/ethernet/faraday/ftgmac100.h

index 87236206366fdf4d334fc241df21cf1156d66e4d..00024dd411471a3295a5d3e2c3f198136d479502 100644 (file)
@@ -1817,6 +1817,11 @@ static int ftgmac100_probe(struct platform_device *pdev)
                priv->rxdes0_edorr_mask = BIT(30);
                priv->txdes0_edotr_mask = BIT(30);
                priv->is_aspeed = true;
+               /* Disable ast2600 problematic HW arbitration */
+               if (of_device_is_compatible(np, "aspeed,ast2600-mac")) {
+                       iowrite32(FTGMAC100_TM_DEFAULT,
+                                 priv->base + FTGMAC100_OFFSET_TM);
+               }
        } else {
                priv->rxdes0_edorr_mask = BIT(15);
                priv->txdes0_edotr_mask = BIT(15);
index e5876a3fda91dcdd28386e4f03cc877e33868f21..63b3e02fab162ef65cd76d67992cc714cb7f7e5a 100644 (file)
 #define FTGMAC100_MACCR_FAST_MODE      (1 << 19)
 #define FTGMAC100_MACCR_SW_RST         (1 << 31)
 
+/*
+ * test mode control register
+ */
+#define FTGMAC100_TM_RQ_TX_VALID_DIS (1 << 28)
+#define FTGMAC100_TM_RQ_RR_IDLE_PREV (1 << 27)
+#define FTGMAC100_TM_DEFAULT                                                   \
+       (FTGMAC100_TM_RQ_TX_VALID_DIS | FTGMAC100_TM_RQ_RR_IDLE_PREV)
+
 /*
  * PHY control register
  */