ethernet: stmmac: Add dma size option property

Sometimes, no need to use more DMA buffer, add a configurable
option from DTB.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I81883c1a3531b8805d554a34e07dc50735829ecc
This commit is contained in:
David Wu
2022-04-07 10:41:56 +08:00
committed by Tao Huang
parent b7d5398aee
commit b4ffd6bfee
3 changed files with 8 additions and 2 deletions

View File

@@ -2835,9 +2835,12 @@ static int stmmac_open(struct net_device *dev)
priv->rx_copybreak = STMMAC_RX_COPYBREAK;
if (!priv->dma_tx_size)
priv->dma_tx_size = DMA_DEFAULT_TX_SIZE;
priv->dma_tx_size = priv->plat->dma_size ? priv->plat->dma_size :
DMA_DEFAULT_TX_SIZE;
if (!priv->dma_rx_size)
priv->dma_rx_size = DMA_DEFAULT_RX_SIZE;
priv->dma_rx_size = priv->plat->dma_size ? priv->plat->dma_size :
DMA_DEFAULT_RX_SIZE;
/* Earlier check for TBS */
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++) {

View File

@@ -462,6 +462,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);
of_property_read_u32(np, "dma-size", &plat->dma_size);
plat->force_sf_dma_mode =
of_property_read_bool(np, "snps,force_sf_dma_mode");

View File

@@ -172,6 +172,7 @@ struct plat_stmmacenet_data {
int unicast_filter_entries;
int tx_fifo_size;
int rx_fifo_size;
int dma_size;
u32 addr64;
u32 rx_queues_to_use;
u32 tx_queues_to_use;