diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2013-08-28 06:55:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-30 17:26:09 -0400 |
commit | e2a240c7d3bcebf90936cc7c22c2729b3a4cec1f (patch) | |
tree | 3f64f44e21ffb77d25c5680cc92ffe579ae9648b | |
parent | 816c5b5b016acde51f0547cf1657d87cf22a6d47 (diff) |
driver:net:stmmac: Disable DMA store and forward mode if platform data force_thresh_dma_mode is set.
Some synopsys ip implementation doesn't support DMA store and forward mode,
such as BF60x. So, set force_thresh_dma_mode to use DMA thresholds only.
Update document and devicetree as well.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/devicetree/bindings/net/stmmac.txt | 5 | ||||
-rw-r--r-- | Documentation/networking/stmmac.txt | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 | ||||
-rw-r--r-- | include/linux/stmmac.h | 1 |
5 files changed, 17 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/net/stmmac.txt b/Documentation/devicetree/bindings/net/stmmac.txt index 261c563b5f06..eba0e5e59ebe 100644 --- a/Documentation/devicetree/bindings/net/stmmac.txt +++ b/Documentation/devicetree/bindings/net/stmmac.txt | |||
@@ -22,6 +22,11 @@ Required properties: | |||
22 | - snps,pbl Programmable Burst Length | 22 | - snps,pbl Programmable Burst Length |
23 | - snps,fixed-burst Program the DMA to use the fixed burst mode | 23 | - snps,fixed-burst Program the DMA to use the fixed burst mode |
24 | - snps,mixed-burst Program the DMA to use the mixed burst mode | 24 | - snps,mixed-burst Program the DMA to use the mixed burst mode |
25 | - snps,force_thresh_dma_mode Force DMA to use the threshold mode for | ||
26 | both tx and rx | ||
27 | - snps,force_sf_dma_mode Force DMA to use the Store and Forward | ||
28 | mode for both tx and rx. This flag is | ||
29 | ignored if force_thresh_dma_mode is set. | ||
25 | 30 | ||
26 | Optional properties: | 31 | Optional properties: |
27 | - mac-address: 6 bytes, mac address | 32 | - mac-address: 6 bytes, mac address |
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt index 654d2e55c8cb..457b8bbafb08 100644 --- a/Documentation/networking/stmmac.txt +++ b/Documentation/networking/stmmac.txt | |||
@@ -123,6 +123,7 @@ struct plat_stmmacenet_data { | |||
123 | int bugged_jumbo; | 123 | int bugged_jumbo; |
124 | int pmt; | 124 | int pmt; |
125 | int force_sf_dma_mode; | 125 | int force_sf_dma_mode; |
126 | int force_thresh_dma_mode; | ||
126 | int riwt_off; | 127 | int riwt_off; |
127 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 128 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
128 | void (*bus_setup)(void __iomem *ioaddr); | 129 | void (*bus_setup)(void __iomem *ioaddr); |
@@ -159,6 +160,8 @@ Where: | |||
159 | o pmt: core has the embedded power module (optional). | 160 | o pmt: core has the embedded power module (optional). |
160 | o force_sf_dma_mode: force DMA to use the Store and Forward mode | 161 | o force_sf_dma_mode: force DMA to use the Store and Forward mode |
161 | instead of the Threshold. | 162 | instead of the Threshold. |
163 | o force_thresh_dma_mode: force DMA to use the Shreshold mode other than | ||
164 | the Store and Forward mode. | ||
162 | o riwt_off: force to disable the RX watchdog feature and switch to NAPI mode. | 165 | o riwt_off: force to disable the RX watchdog feature and switch to NAPI mode. |
163 | o fix_mac_speed: this callback is used for modifying some syscfg registers | 166 | o fix_mac_speed: this callback is used for modifying some syscfg registers |
164 | (on ST SoCs) according to the link speed negotiated by the | 167 | (on ST SoCs) according to the link speed negotiated by the |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index be406911fd01..8d4ccd35a016 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -1224,7 +1224,9 @@ static void free_dma_desc_resources(struct stmmac_priv *priv) | |||
1224 | */ | 1224 | */ |
1225 | static void stmmac_dma_operation_mode(struct stmmac_priv *priv) | 1225 | static void stmmac_dma_operation_mode(struct stmmac_priv *priv) |
1226 | { | 1226 | { |
1227 | if (priv->plat->force_sf_dma_mode || priv->plat->tx_coe) { | 1227 | if (priv->plat->force_thresh_dma_mode) |
1228 | priv->hw->dma->dma_mode(priv->ioaddr, tc, tc); | ||
1229 | else if (priv->plat->force_sf_dma_mode || priv->plat->tx_coe) { | ||
1228 | /* | 1230 | /* |
1229 | * In case of GMAC, SF mode can be enabled | 1231 | * In case of GMAC, SF mode can be enabled |
1230 | * to perform the TX COE in HW. This depends on: | 1232 | * to perform the TX COE in HW. This depends on: |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index da8be6e63096..74a89a4aef88 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -79,6 +79,11 @@ static int stmmac_probe_config_dt(struct platform_device *pdev, | |||
79 | of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl); | 79 | of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl); |
80 | dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst"); | 80 | dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst"); |
81 | dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst"); | 81 | dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst"); |
82 | plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode"); | ||
83 | if (plat->force_thresh_dma_mode) { | ||
84 | plat->force_sf_dma_mode = 0; | ||
85 | pr_warn("force_sf_dma_mode is ignored if force_thresh_dma_mode is set."); | ||
86 | } | ||
82 | 87 | ||
83 | return 0; | 88 | return 0; |
84 | } | 89 | } |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 9e495d31516e..bb5deb0feb6b 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -108,6 +108,7 @@ struct plat_stmmacenet_data { | |||
108 | int bugged_jumbo; | 108 | int bugged_jumbo; |
109 | int pmt; | 109 | int pmt; |
110 | int force_sf_dma_mode; | 110 | int force_sf_dma_mode; |
111 | int force_thresh_dma_mode; | ||
111 | int riwt_off; | 112 | int riwt_off; |
112 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 113 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
113 | void (*bus_setup)(void __iomem *ioaddr); | 114 | void (*bus_setup)(void __iomem *ioaddr); |