* openrisc is broken
@ 2014-05-12 12:06 Franck Jullien
0 siblings, 0 replies; only message in thread
From: Franck Jullien @ 2014-05-12 12:06 UTC (permalink / raw)
To: barebox, Sascha Hauer
Hi,
Openrisc is broken because of this commit:
940237285ebbdbf openrisc: Use generic io accessors
There is know an endianness problem. The Linux ethoc driver use this:
static inline u32 ethoc_read(struct ethoc *dev, loff_t offset)
{
#ifdef CONFIG_WISHBONE_BUS_BIG_ENDIAN
return ioread32be(dev->iobase + offset);
#else
return ioread32(dev->iobase + offset);
#endif
}
in combination with CONFIG_GENERIC_IOMAP.
To fix this issue, I think we could just add:
#define ioread8(addr) readb(addr)
#define ioread16(addr) readw(addr)
#define ioread16be(addr) __be16_to_cpu(__raw_readw(addr))
#define ioread32(addr) readl(addr)
#define ioread32be(addr) __be32_to_cpu(__raw_readl(addr))
#define iowrite8(v, addr) writeb((v), (addr))
#define iowrite16(v, addr) writew((v), (addr))
#define iowrite16be(v, addr) __raw_writew(__cpu_to_be16(v), addr)
#define iowrite32(v, addr) writel((v), (addr))
#define iowrite32be(v, addr) __raw_writel(__cpu_to_be32(v), addr)
to our asm-generic/io.h file.
Then I could update the ethoc driver to make use on those accessors.
What do you think of this ?
Franck.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-05-12 12:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-12 12:06 openrisc is broken Franck Jullien
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox