]> git.sur5r.net Git - u-boot/commitdiff
net: xilinx_axi_emac: Read dma address using fdtdec_get_addr
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Thu, 22 Jun 2017 05:44:55 +0000 (11:14 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 28 Nov 2017 15:09:27 +0000 (16:09 +0100)
Read dma address using fdtdec_get_addr as it checks for
address cells and size cells and reads the address
properly. fdtdec_get_int always assume address is of int
size which goes wrong if using it on 64-bit architecture.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/xilinx_axi_emac.c

index ea79b7420ab97ad40ed135622e744ed9d9b7ecc8..4f2cef8a38d0b6a193e4741458f0aada07886e86 100644 (file)
@@ -694,8 +694,8 @@ static int axi_emac_ofdata_to_platdata(struct udevice *dev)
                printf("%s: axistream is not found\n", __func__);
                return -EINVAL;
        }
-       priv->dmatx = (struct axidma_reg *)fdtdec_get_int(gd->fdt_blob,
-                                                         offset, "reg", 0);
+       priv->dmatx = (struct axidma_reg *)fdtdec_get_addr(gd->fdt_blob,
+                                                         offset, "reg");
        if (!priv->dmatx) {
                printf("%s: axi_dma register space not found\n", __func__);
                return -EINVAL;