From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH][v2] driver/ifc:Change accessor function to take care of endianness
Date: Mon, 20 Jan 2014 16:51:03 -0600 [thread overview]
Message-ID: <1390258263.24905.337.camel@snotra.buserror.net> (raw)
In-Reply-To: <20140118082452.BC291380481@gemini.denx.de>
On Sat, 2014-01-18 at 09:24 +0100, Wolfgang Denk wrote:
> Dear Prabhakar Kushwaha,
>
> In message <1390028310-30861-1-git-send-email-prabhakar@freescale.com> you wrote:
> > IFC registers can be of type Little Endian or big Endian depending upon
> > Freescale SoC. Here SoC defines the register type of IFC IP.
>
> As is, you are only adding dead code, as there is no place anywhere in
> the mainline code that defines CONFIG_SYS_FSL_IFC_LE
Yes, consider it RFC until we have patches for a target that needs LE.
> > /* Program ROW0/COL0 */
> > - out_be32(&ifc->ifc_nand.row0, page_addr);
> > - out_be32(&ifc->ifc_nand.col0, (oob ? IFC_NAND_COL_MS : 0) | column);
> > + ifc_out32(&ifc->ifc_nand.row0, page_addr);
> > + ifc_out32(&ifc->ifc_nand.col0, (oob ? IFC_NAND_COL_MS : 0) | column);
>
> I seriously dislike the idea of introducing special I/O accessors for
> a single device driver. If more drivers would follow that example, we
> will soon have a serious mess.
As the changelog says, we have chips coming out on which these registers
are little-endian, and thus we can't hardcode big-endian in the
driver.
I don't know whether there's something more generic we could key off of
than IFC, but in Linux (and maybe U-Boot) we'll want to make this driven
by the device tree rather than at compile time (it's not as simple as
PPC versus ARM), so getting the knowledge from something other than the
IFC node would be awkward -- and it would be good to keep this code
similar between U-Boot and Linux.
What sort of mess are you envisioning? This isn't implementing
accessors from scratch; it's just a wrapper. It's local to IFC code.
-Scott
next prev parent reply other threads:[~2014-01-20 22:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-18 6:58 [U-Boot] [PATCH][v2] driver/ifc:Change accessor function to take care of endianness Prabhakar Kushwaha
2014-01-18 8:24 ` Wolfgang Denk
2014-01-20 22:51 ` Scott Wood [this message]
2014-01-21 5:42 ` Wolfgang Denk
2014-01-21 6:34 ` Wolfgang Denk
2014-01-21 6:49 ` York Sun
2014-01-21 9:14 ` Wolfgang Denk
2014-01-21 17:29 ` Scott Wood
2014-01-21 17:34 ` York Sun
2014-01-24 17:57 ` York Sun
2014-01-21 6:51 ` Prabhakar Kushwaha
2014-02-03 20:28 ` York Sun
2014-02-03 21:35 ` Scott Wood
2014-02-03 21:36 ` York Sun
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=1390258263.24905.337.camel@snotra.buserror.net \
--to=scottwood@freescale.com \
--cc=u-boot@lists.denx.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