]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: axi_emac: Use reg property for DMA registers
authorMayuresh Chitale <mchitale@ventanamicro.com>
Thu, 16 Nov 2023 16:40:24 +0000 (22:10 +0530)
committerMichal Simek <michal.simek@amd.com>
Wed, 13 Dec 2023 07:58:06 +0000 (08:58 +0100)
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 <mchitale@ventanamicro.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20231116164024.139934-1-mchitale@ventanamicro.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
drivers/net/xilinx_axi_emac.c

index 54f22327684f345fb18694e00f097ee1ce10bf4e..ef151ee51b40a1acd4df81b6afce78af5dbbafde 100644 (file)
@@ -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;