diff mbox series

[U-Boot,2/3] net: xilinx_axi_emac: Read dma address using fdtdec_get_addr

Message ID 4b7c7fbbbda171ab9acbcdd0eee43825de13f1c6.1510241231.git.michal.simek@xilinx.com
State Accepted
Commit dc1fcc423c940692d8d8dd7c8240e83243b34859
Delegated to: Michal Simek
Headers show
Series [U-Boot,1/3] net: xilinx_axi_emac: Use wait_for_bit instead of while loop | expand

Commit Message

Michal Simek Nov. 9, 2017, 3:27 p.m. UTC
From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index ea79b7420ab9..4f2cef8a38d0 100644
--- a/drivers/net/xilinx_axi_emac.c
+++ b/drivers/net/xilinx_axi_emac.c
@@ -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;