The current dc21x4x driver accesses its memory mapped registers directly
instead of using the standard I/O accessors. This can cause problems on
some systems as the accesses can get out of order. So convert the direct
volatile dereferences to use the normal in/out macros.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
// SPDX-License-Identifier: GPL-2.0+
#include <common.h>
+#include <asm/io.h>
#include <env.h>
#include <malloc.h>
#include <net.h>
static u32 dc2114x_inl(struct eth_device *dev, u32 addr)
{
- return le32_to_cpu(*(volatile u32 *)(addr + dev->iobase));
+ return le32_to_cpu(readl(dev->iobase + addr));
}
static void dc2114x_outl(struct eth_device *dev, u32 command, u32 addr)
{
- *(volatile u32 *)(addr + dev->iobase) = cpu_to_le32(command);
+ writel(cpu_to_le32(command), dev->iobase + addr);
}
static void reset_de4x5(struct eth_device *dev)