]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: zynq_gem: Use ulong instead of u32 data type
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Wed, 15 Jan 2020 09:15:13 +0000 (02:15 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 28 Feb 2020 11:04:10 +0000 (12:04 +0100)
flush_dcache_range() expects unsigned long in the arguments. Here u32
variable is unable to hold the higher address value when ddr mapped
to higher addresses & flushing lower address dchache range instead
which is unmapped causing to crash.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/zynq_gem.c

index 288037e2a0f5af01f2a2d216e0ef3382af6f26ac..7f9dc3435bf228eef9142aaebe67cbad16852201 100644 (file)
@@ -655,7 +655,7 @@ static int zynq_gem_probe(struct udevice *dev)
                return -ENOMEM;
 
        memset(priv->rxbuffers, 0, RX_BUF * PKTSIZE_ALIGN);
-       u32 addr = (ulong)priv->rxbuffers;
+       ulong addr = (ulong)priv->rxbuffers;
        flush_dcache_range(addr, addr + roundup(RX_BUF * PKTSIZE_ALIGN, ARCH_DMA_MINALIGN));
        barrier();