stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt
Subsystems (5)
PATCH 1/3 stmmac: if force_thresh_dma_mode is set, pass tc to both txmode and rxmode in tx_hard_error_bump_tc interrupt
From: Sonic Zhang <[email protected]>
Dont' pass SF_DMA_MODE to rxmode in this case.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +5 -1
@@ -1446,7 +1446,11 @@ static void stmmac_dma_interrupt(struct stmmac_priv *priv)/* Try to bump up the dma threshold on this failure */ if (unlikely (tc !=SF_DMA_MODE ) && (tc <=256 )) { tc +=64 ; - priv->hw->dma->dma_mode (priv->ioaddr, tc,SF_DMA_MODE ); +if (priv->plat->force_thresh_dma_mode) + priv->hw->dma->dma_mode (priv->ioaddr, tc, tc); +else + priv->hw->dma->dma_mode (priv->ioaddr, tc, +SF_DMA_MODE ); priv->xstats.threshold = tc; } }else if (unlikely (status == tx_hard_error))
Signature · 1 line
1.7.9.5
PATCH 2/3 stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set
From: Sonic Zhang <[email protected]>
Clear the TX COE bit when force_thresh_dma_mode is set even hardware dma capability says support.
Tested on BF609.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +5 -1
@@ -2746,7 +2746,11 @@ static int stmmac_hw_init(struct stmmac_priv *priv) priv->plat->enh_desc = priv->dma_cap.enh_desc; priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up; - priv->plat->tx_coe = priv->dma_cap.tx_coe; +/* TXCOE doesn't work in thresh DMA mode */ +if (priv->plat->force_thresh_dma_mode) + priv->plat->tx_coe =0 ; +else + priv->plat->tx_coe = priv->dma_cap.tx_coe;if (priv->dma_cap.rx_coe_type2) priv->plat->rx_coe =STMMAC_RX_COE_TYPE2 ;
Signature · 1 line
1.7.9.5
Re: [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set
Quoted 8 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
Clear the TX COE bit when
force_thresh_dma_modeis set even hardware dma capability says support.Tested on BF609.
Signed-off-by Sonic Zhang <[email protected]>
Quoted 22 lines
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +5
-1@@ -2746,7 +2746,11 @@ static int stmmac_hw_init(struct stmmac_priv *priv) priv->plat->enh_desc = priv->dma_cap.enh_desc; priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up; - priv->plat->tx_coe = priv->dma_cap.tx_coe; +/* TXCOE doesn't work in thresh DMA mode */ +if (priv->plat->force_thresh_dma_mode) + priv->plat->tx_coe =0 ; +else + priv->plat->tx_coe = priv->dma_cap.tx_coe;if (priv->dma_cap.rx_coe_type2) priv->plat->rx_coe =STMMAC_RX_COE_TYPE2 ;
Re: [PATCH 2/3] stmmac: hardware TX COE doesn't work when force_thresh_dma_mode is set
In reply to Sonic ZhangFrom: Sonic Zhang <[email protected]>
Date: Thu, 22 Jan 2015 14:55:57 +0800
Quoted 8 lines
From: Sonic Zhang <[email protected]>
Clear the TX COE bit when
force_thresh_dma_modeis set even hardware dma capability says support.Tested on BF609.
Signed-off-by Sonic Zhang <[email protected]>
Applied.
PATCH 3/3 stmmac: Add an optional device tree property "snps,burst_len"
In reply to Sonic ZhangFrom: Sonic Zhang <[email protected]>
This property define the AXI bug lenth.
--- Documentation/devicetree/bindings/net/stmmac.txt | 1 + .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 +++ 2 files changed, 4 insertions(+)
Documentation/devicetree/bindings/net/stmmac.txt +1 -0
@@ -43,6 +43,7 @@ Optional properties: available this clock is used for programming the Timestamp Addend Register. If not passed then the system clock will be used and this is fine on some platforms. +- snps,burst_len: The AXI burst lenth value of the AXI BUS MODE register. Examples:
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
@@ -234,6 +234,9 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,of_property_read_bool (np,"snps,fixed-burst" ); dma_cfg->mixed_burst =of_property_read_bool (np,"snps,mixed-burst" ); +of_property_read_u32 (np,"snps,burst_len" , &dma_cfg->burst_len); +if (dma_cfg->burst_len <0 || dma_cfg->burst_len >256 ) + dma_cfg->burst_len =0 ; } plat->force_thresh_dma_mode =of_property_read_bool (np,"snps,force_thresh_dma_mode" );if (plat->force_thresh_dma_mode) {
Signature · 1 line
1.7.9.5
Re: [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len"
Quoted 3 lines · Sonic Zhang
From: Sonic Zhang <[email protected]>
This property define the AXI bug lenth.
Hello
I can accept this patch for now. So thx :-)
FYI, I will send a set of patches to program the AXI Bus mode register providing more parameters from DT.
Peppe
Quoted 34 lines
Signed-off-by Sonic Zhang <[email protected]>--- Documentation/devicetree/bindings/net/stmmac.txt | 1 + .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 +++ 2 files changed, 4 insertions(+)Documentation/devicetree/bindings/net/stmmac.txt +1
-0@@ -43,6 +43,7 @@ Optional properties: available this clock is used for programming the Timestamp Addend Register. If not passed then the system clock will be used and this is fine on some platforms. +- snps,burst_len: The AXI burst lenth value of the AXI BUS MODE register. Examples:drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3
-0@@ -234,6 +234,9 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,of_property_read_bool (np,"snps,fixed-burst" ); dma_cfg->mixed_burst =of_property_read_bool (np,"snps,mixed-burst" ); +of_property_read_u32 (np,"snps,burst_len" , &dma_cfg->burst_len); +if (dma_cfg->burst_len <0 || dma_cfg->burst_len >256 ) + dma_cfg->burst_len =0 ; } plat->force_thresh_dma_mode =of_property_read_bool (np,"snps,force_thresh_dma_mode" );if (plat->force_thresh_dma_mode) {
Re: [PATCH 3/3] stmmac: Add an optional device tree property "snps,burst_len"
In reply to Sonic ZhangFrom: Sonic Zhang <[email protected]>
Date: Thu, 22 Jan 2015 14:55:58 +0800
Quoted 5 lines
From: Sonic Zhang <[email protected]>
This property define the AXI bug lenth.
Signed-off-by Sonic Zhang <[email protected]>
Applied.
From: Sonic Zhang <[email protected]>
Date: Thu, 22 Jan 2015 14:55:56 +0800
Quoted 5 lines
From: Sonic Zhang <[email protected]>
Dont' pass
SF_DMA_MODEto rxmode in this case.Signed-off-by Sonic Zhang <[email protected]>
Applied.