/dts-v1/; #include "mt7621.dtsi" #include / { model = "Linksys RE6500"; memory@0 { device_type = "memory"; reg = <0x0 0x4000000>; }; chosen { bootargs = "console=ttyS0,57600"; }; gpio-leds { compatible = "gpio-leds"; wifi { label = "re6500:orange:wifi"; gpios = <&gpio0 0 0>; }; power { label = "re6500:white:power"; gpios = <&gpio0 9 0>; }; }; gpio-keys-polled { compatible = "gpio-keys-polled"; #address-cells = <1>; #size-cells = <0>; poll-interval = <20>; wps { label = "wps"; gpios = <&gpio0 10 1>; linux,code = ; }; reset { label = "reset"; gpios = <&gpio0 11 0>; linux,code = ; }; }; }; &spi0 { status = "okay"; m25p80@0 { #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <10000000>; m25p,chunked-io = <32>; partition@0 { label = "u-boot"; reg = <0x0 0x30000>; read-only; }; partition@30000 { label = "u-boot-env"; reg = <0x30000 0x10000>; read-only; }; factory: partition@40000 { label = "factory"; reg = <0x40000 0x10000>; read-only; }; partition@50000 { label = "firmware"; reg = <0x50000 0x7b0000>; }; }; }; &pinctrl { state_default: pinctrl0 { gpio { ralink,group = "i2c", "uart2", "uart3", "rgmii2"; ralink,function = "gpio"; }; }; }; &pcie { status = "okay"; pcie0 { mt76@0,0 { reg = <0x0000 0 0 0 0>; device_type = "pci"; mediatek,mtd-eeprom = <&factory 0x0000>; mediatek,2ghz = <0>; }; }; pcie1 { mt76@1,0 { reg = <0x0000 0 0 0 0>; device_type = "pci"; mediatek,mtd-eeprom = <&factory 0x8000>; mediatek,5ghz = <0>; }; }; }; ðernet { mtd-mac-address = <&factory 0x2e>; }; &xhci { status = "disabled"; }; it.cgi/openwrt/upstream/about/?h=v21.02.1'>aboutsummaryrefslogtreecommitdiffstats
blob: b0f55e0866d9a7466458a31941575e5896c9ae08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From 37d151859e09d09a950ad3ae615db1903bcc59d3 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski@gmail.com>
Date: Sun, 13 Nov 2011 14:59:37 +0100
Subject: [PATCH 43/79] bcm63xx_enet: fix lockup on BCM6328

BCM6328 locks up on a maxburst size of 16, reduce it to 8 for BCM6328 and
BCM6368.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/net/ethernet/broadcom/bcm63xx_enet.c |   14 ++++++++------
 drivers/net/ethernet/broadcom/bcm63xx_enet.h |    4 ++++
 2 files changed, 12 insertions(+), 6 deletions(-)

--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -261,7 +261,6 @@ static int bcm_enet_refill_rx(struct net
 			if (!skb)
 				break;
 			priv->rx_skb[desc_idx] = skb;
-
 			p = dma_map_single(&priv->pdev->dev, skb->data,
 					   priv->rx_skb_size,
 					   DMA_FROM_DEVICE);
@@ -995,9 +994,9 @@ static int bcm_enet_open(struct net_devi
 	enet_writel(priv, priv->hw_mtu, ENET_TXMAXLEN_REG);
 
 	/* set dma maximum burst len */
-	enet_dmac_writel(priv, BCMENET_DMA_MAXBURST,
+	enet_dmac_writel(priv, priv->dma_maxburst,
 			 ENETDMAC_MAXBURST_REG(priv->rx_chan));
-	enet_dmac_writel(priv, BCMENET_DMA_MAXBURST,
+	enet_dmac_writel(priv, priv->dma_maxburst,
 			 ENETDMAC_MAXBURST_REG(priv->tx_chan));
 
 	/* set correct transmit fifo watermark */
@@ -1593,7 +1592,7 @@ static int compute_hw_mtu(struct bcm_ene
 	 * it's appended
 	 */
 	priv->rx_skb_size = ALIGN(actual_mtu + ETH_FCS_LEN,
-				  BCMENET_DMA_MAXBURST * 4);
+				  priv->dma_maxburst * 4);
 	return 0;
 }
 
@@ -1700,6 +1699,8 @@ static int __devinit bcm_enet_probe(stru
 		return -ENOMEM;
 	priv = netdev_priv(dev);
 
+	priv->dma_maxburst = bcm_enet_is_sw(priv) ?
+			BCMENETSW_DMA_MAXBURST : BCMENET_DMA_MAXBURST;
 	ret = compute_hw_mtu(priv, dev->mtu);
 	if (ret)
 		goto out;
@@ -2263,9 +2264,9 @@ static int bcm_enetsw_open(struct net_de
 	enet_dmas_writel(priv, 0, ENETDMAS_SRAM4_REG(priv->tx_chan));
 
 	/* set dma maximum burst len */
-	enet_dmac_writel(priv, BCMENET_DMA_MAXBURST,
+	enet_dmac_writel(priv, priv->dma_maxburst,
 			 ENETDMAC_MAXBURST_REG(priv->rx_chan));
-	enet_dmac_writel(priv, BCMENET_DMA_MAXBURST,
+	enet_dmac_writel(priv, priv->dma_maxburst,
 			 ENETDMAC_MAXBURST_REG(priv->tx_chan));
 
 	/* set flow control low/high threshold to 1/3 / 2/3 */
@@ -2727,6 +2728,7 @@ static int __devinit bcm_enetsw_probe(st
 	priv->irq_tx = irq_tx;
 	priv->rx_ring_size = BCMENET_DEF_RX_DESC;
 	priv->tx_ring_size = BCMENET_DEF_TX_DESC;
+	priv->dma_maxburst = BCMENETSW_DMA_MAXBURST;
 
 	pd = pdev->dev.platform_data;
 	if (pd) {
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h
@@ -17,6 +17,7 @@
 
 /* maximum burst len for dma (4 bytes unit) */
 #define BCMENET_DMA_MAXBURST	16
+#define BCMENETSW_DMA_MAXBURST	8
 
 /* tx transmit threshold (4 bytes unit), fifo is 256 bytes, the value
  * must be low enough so that a DMA transfer of above burst length can
@@ -280,6 +281,9 @@ struct bcm_enet_priv {
 	/* number of dma desc in tx ring */
 	int tx_ring_size;
 
+	/* maximum dma burst size */
+	int dma_maxburst;
+
 	/* cpu view of rx dma ring */
 	struct bcm_enet_desc *tx_desc_cpu;