提交 61b8013a 编写于 作者: S Srinivas Kandagatla 提交者: David S. Miller

stmmac: Allow SOCs to use Store forward mode eventhough tx_coe is 0. (V2)

This patch adds new field 'force_sf_dma_mode' to plat_stmmacenet_data
struct to allow users to specify if they want to use force store forward
eventhough tx_coe is not available in hw.
without this flag stmmac driver will use cut-thru mode not use
store-forward mode.
Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 eb0dc4bb
...@@ -557,9 +557,11 @@ static void free_dma_desc_resources(struct stmmac_priv *priv) ...@@ -557,9 +557,11 @@ static void free_dma_desc_resources(struct stmmac_priv *priv)
*/ */
static void stmmac_dma_operation_mode(struct stmmac_priv *priv) static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
{ {
if (likely((priv->plat->tx_coe) && (!priv->no_csum_insertion))) { if (likely(priv->plat->force_sf_dma_mode ||
/* In case of GMAC, SF mode has to be enabled ((priv->plat->tx_coe) && (!priv->no_csum_insertion)))) {
* to perform the TX COE. This depends on: /*
* In case of GMAC, SF mode can be enabled
* to perform the TX COE in HW. This depends on:
* 1) TX COE if actually supported * 1) TX COE if actually supported
* 2) There is no bugged Jumbo frame support * 2) There is no bugged Jumbo frame support
* that needs to not insert csum in the TDES. * that needs to not insert csum in the TDES.
......
...@@ -40,6 +40,7 @@ struct plat_stmmacenet_data { ...@@ -40,6 +40,7 @@ struct plat_stmmacenet_data {
int tx_coe; int tx_coe;
int bugged_jumbo; int bugged_jumbo;
int pmt; int pmt;
int force_sf_dma_mode;
void (*fix_mac_speed)(void *priv, unsigned int speed); void (*fix_mac_speed)(void *priv, unsigned int speed);
void (*bus_setup)(void __iomem *ioaddr); void (*bus_setup)(void __iomem *ioaddr);
int (*init)(struct platform_device *pdev); int (*init)(struct platform_device *pdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册