net: stmmac: Support enhanced addressing mode for DWMAC 4.10
authorThierry Reding <treding@nvidia.com>
Wed, 2 Oct 2019 14:52:58 +0000 (16:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Oct 2019 19:00:50 +0000 (12:00 -0700)
commit560c07cba1319cf6765884ea9feedecf3020997d
treea38525a56ca577384bec444d650bca9b1e1f623c
parent968a2978cb39a754750d35a47049781660682a31
net: stmmac: Support enhanced addressing mode for DWMAC 4.10

The address width of the controller can be read from hardware feature
registers much like on XGMAC. Add support for parsing the ADDR64 field
so that the DMA mask can be set accordingly.

This avoids getting swiotlb involved for DMA on Tegra186 and later.

Also make sure that the upper 32 bits of the DMA address are written to
the DMA descriptors when enhanced addressing mode is used. Similarily,
for each channel, the upper 32 bits of the DMA descriptor ring's base
address also need to be programmed to make sure the correct memory can
be fetched when the DMA descriptor ring is located beyond the 32-bit
boundary.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac4.h
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h