Commit 64c3b252 authored by Byungho An's avatar Byungho An Committed by David S. Miller

net: stmmac: fixed the pbl setting with DT

This patch fixed the pbl(programmable burst length) setting
using DT. Even though the default pbl is 8, If there is no
pbl property in device tree file, pbl is set 0 and it causes
bandwidth degradation.
Signed-off-by: default avatarByungho An <bh74.an@samsung.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 33c6b1f6
...@@ -71,14 +71,18 @@ static int stmmac_probe_config_dt(struct platform_device *pdev, ...@@ -71,14 +71,18 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
plat->force_sf_dma_mode = 1; plat->force_sf_dma_mode = 1;
} }
dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), GFP_KERNEL); if (of_find_property(np, "snps,pbl", NULL)) {
if (!dma_cfg) dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
return -ENOMEM; GFP_KERNEL);
if (!dma_cfg)
plat->dma_cfg = dma_cfg; return -ENOMEM;
of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl); plat->dma_cfg = dma_cfg;
dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst"); of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst"); dma_cfg->fixed_burst =
of_property_read_bool(np, "snps,fixed-burst");
dma_cfg->mixed_burst =
of_property_read_bool(np, "snps,mixed-burst");
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment