From: Franck Jullien <franck.jullien@gmail.com>
To: barebox <barebox@lists.infradead.org>,
Sascha Hauer <s.hauer@pengutronix.de>
Subject: openrisc is broken
Date: Mon, 12 May 2014 14:06:09 +0200 [thread overview]
Message-ID: <CAJfOKBwruG364nPXp5w9W=p1T2D9XwMkzqKmf4D_8ASs94vL3w@mail.gmail.com> (raw)
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
reply other threads:[~2014-05-12 12:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJfOKBwruG364nPXp5w9W=p1T2D9XwMkzqKmf4D_8ASs94vL3w@mail.gmail.com' \
--to=franck.jullien@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox