On Fri, 22 Jun 2018, Guenter Roeck wrote:
The problem is this (from the kernel diffs provided by aCube):
#if defined(CONFIG_PPC32)
-#define smc501_readl(addr) ioread32be((addr))
-#define smc501_writel(val, addr) iowrite32be((val), (addr))
+#define smc501_readl(addr) ioread32((addr))
+#define smc501_writel(val, addr) iowrite32((val), (addr))
#else
#define smc501_readl(addr) readl(addr)
#define smc501_writel(val, addr) writel(val, addr)
This is a bit fishy since the cpu is big endian and iowrite32be()
should be identical to iowrite32(), but apparently that is not the
case here. I don't think I'll have time to track this down, though.
Thanks for finding this, it helps even if you don't have time to track it
down completely. Could this be related to using little endian PCI device
on a big endian CPU? Not sure which implementation will this use but in
arch/powerpc/kernel/iomap.c:
unsigned int ioread32(void __iomem *addr)
{
return readl(addr);
}
unsigned int ioread32be(void __iomem *addr)
{
return readl_be(addr);
}
so they don't look identical.