aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_main.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 9ecd6cf9815a..efc42e1f9b4a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -919,6 +919,24 @@ static void stmmac_check_ether_addr(struct stmmac_priv *priv)
919 priv->dev->dev_addr); 919 priv->dev->dev_addr);
920} 920}
921 921
922static int stmmac_init_dma_engine(struct stmmac_priv *priv)
923{
924 int pbl = DEFAULT_DMA_PBL, fixed_burst = 0, burst_len = 0;
925
926 /* Some DMA parameters can be passed from the platform;
927 * in case of these are not passed we keep a default
928 * (good for all the chips) and init the DMA! */
929 if (priv->plat->dma_cfg) {
930 pbl = priv->plat->dma_cfg->pbl;
931 fixed_burst = priv->plat->dma_cfg->fixed_burst;
932 burst_len = priv->plat->dma_cfg->burst_len;
933 }
934
935 return priv->hw->dma->init(priv->ioaddr, pbl, fixed_burst,
936 burst_len, priv->dma_tx_phy,
937 priv->dma_rx_phy);
938}
939
922/** 940/**
923 * stmmac_open - open entry point of the driver 941 * stmmac_open - open entry point of the driver
924 * @dev : pointer to the device structure. 942 * @dev : pointer to the device structure.
@@ -967,10 +985,7 @@ static int stmmac_open(struct net_device *dev)
967 init_dma_desc_rings(dev); 985 init_dma_desc_rings(dev);
968 986
969 /* DMA initialization and SW reset */ 987 /* DMA initialization and SW reset */
970 ret = priv->hw->dma->init(priv->ioaddr, priv->plat->dma_cfg->pbl, 988 ret = stmmac_init_dma_engine(priv);
971 priv->plat->dma_cfg->fixed_burst,
972 priv->plat->dma_cfg->burst_len,
973 priv->dma_tx_phy, priv->dma_rx_phy);
974 if (ret < 0) { 989 if (ret < 0) {
975 pr_err("%s: DMA initialization failed\n", __func__); 990 pr_err("%s: DMA initialization failed\n", __func__);
976 goto open_error; 991 goto open_error;