Skip to content

Commit 0579f27

Browse files
Sagar Cheluvegowdadavem330
authored andcommitted
net: stmmac: dwmac-qcom-ethqos: Configure host DMA width
Commit 070246e ("net: stmmac: Fix for mismatched host/device DMA address width") added support in the stmmac driver for platform drivers to indicate the host DMA width, but left it up to authors of the specific platforms to indicate if their width differed from the addr64 register read from the MAC itself. Qualcomm's EMAC4 integration supports only up to 36 bit width (as opposed to the addr64 register indicating 40 bit width). Let's indicate that in the platform driver to avoid a scenario where the driver will allocate descriptors of size that is supported by the CPU which in our case is 36 bit, but as the addr64 register is still capable of 40 bits the device will use two descriptors as one address. Fixes: 8c4d92e ("net: stmmac: dwmac-qcom-ethqos: add support for emac4 on sa8775p platforms") Signed-off-by: Sagar Cheluvegowda <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Andrew Halaney <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c44711b commit 0579f27

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ struct ethqos_emac_driver_data {
9393
bool has_emac_ge_3;
9494
const char *link_clk_name;
9595
bool has_integrated_pcs;
96+
u32 dma_addr_width;
9697
struct dwmac4_addrs dwmac4_addrs;
9798
};
9899

@@ -276,6 +277,7 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = {
276277
.has_emac_ge_3 = true,
277278
.link_clk_name = "phyaux",
278279
.has_integrated_pcs = true,
280+
.dma_addr_width = 36,
279281
.dwmac4_addrs = {
280282
.dma_chan = 0x00008100,
281283
.dma_chan_offset = 0x1000,
@@ -845,6 +847,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
845847
plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI;
846848
if (data->has_integrated_pcs)
847849
plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS;
850+
if (data->dma_addr_width)
851+
plat_dat->host_dma_width = data->dma_addr_width;
848852

849853
if (ethqos->serdes_phy) {
850854
plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup;

0 commit comments

Comments
 (0)