net: axi_emac: Use reg property for DMA registers
Subsystems (2)
PATCH v2 1/1 net: axi_emac: Use reg property for DMA registers
As per the xlnx,axi-ethernet-1.00.a DT documentation in linux, the AXI DMA registers can be obtained via the reg property or via a separate node for the axistream DMA controller. Currently only the latter is supported, so add support to fetch the DMA controller registers from the "reg" property.
---
Changes in v2:
====
Add Reviewed-by Tag.
drivers/net/xilinx_axi_emac.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/xilinx_axi_emac.c +4 -5
@@ -903,12 +903,11 @@ static int axi_emac_of_to_plat(struct udevice *dev) ret =dev_read_phandle_with_args (dev,"axistream-connected" ,NULL ,0 ,0 , &axistream_node); -if (ret) { -printf ("%s: axistream is not found\n" , __func__); -return -EINVAL ; - } +if (!ret) + plat->dmatx = (struct axidma_reg *)ofnode_get_addr (axistream_node.node); +else + plat->dmatx = (struct axidma_reg *)dev_read_addr_index (dev,1 ); - plat->dmatx = (struct axidma_reg *)ofnode_get_addr (axistream_node.node);if (!plat->dmatx) {printf ("%s: axi_dma register space not found\n" , __func__);return -EINVAL ;
Signature · 1 line
2.34.1
Quoted 27 lines · Mayuresh Chitale
As per the xlnx,axi-ethernet-1.00.a DT documentation in linux, the AXI DMA registers can be obtained via the reg property or via a separate node for the axistream DMA controller. Currently only the latter is supported, so add support to fetch the DMA controller registers from the "reg" property.
Signed-off-by Mayuresh Chitale <[email protected]>Reviewed-by Michal Simek <[email protected]>---
Changes in v2:
====
Add Reviewed-by Tag.drivers/net/xilinx_axi_emac.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)drivers/net/xilinx_axi_emac.c +0
-3@@ -903,12 +903,11 @@ static int axi_emac_of_to_plat(struct udevice *dev) ret =dev_read_phandle_with_args (dev,"axistream-connected" ,NULL ,0 ,0 , &axistream_node); -if (ret) { -printf ("%s: axistream is not found\n" , __func__); -return -EINVAL ;
drivers/net/xilinx_axi_emac.c static int axi_emac_of_to_plat(struct udevice *dev) · line 913
Quoted 10 lines
drivers/net/xilinx_axi_emac.c +4
-2- } +if (!ret) + plat->dmatx = (struct axidma_reg *)ofnode_get_addr (axistream_node.node); +else + plat->dmatx = (struct axidma_reg *)dev_read_addr_index (dev,1 ); - plat->dmatx = (struct axidma_reg *)ofnode_get_addr (axistream_node.node);if (!plat->dmatx) {printf ("%s: axi_dma register space not found\n" , __func__);return -EINVAL ;
Applied.
M