From: Scott Wood <scottwood@freescale.com>
To: Han Xu <han.xu@freescale.com>, Yuan Yao-B46683 <yao.yuan@freescale.com>
Cc: Fabio Estevam <festevam@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Li Yang-Leo-R58472 <LeoLi@freescale.com>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mtd: spi-nor: fsl-quadspi: add big-endian support
Date: Wed, 11 Nov 2015 12:48:21 -0600 [thread overview]
Message-ID: <1447267701.2262.201.camel@freescale.com> (raw)
In-Reply-To: <20151111175112.GA30612@chopperman.am.freescale.net>
On Wed, 2015-11-11 at 11:51 -0600, Han Xu wrote:
> On Fri, Oct 30, 2015 at 04:49:41AM -0500, Yuan Yao-B46683 wrote:
> > Hi Fabio Estevam,
> >
> > Thanks for your suggestion.
> > We have an internal discussions for that.
> >
> > We think that:
> > According to the initial commit message of regmap, it is targeting non
> > -memory mapped buses. (regmap: Add generic non-memory mapped register
> > access API) But in the imx2_wdt driver, it is used for memory-mapped
> > register space. So it seems that using such a complex framework just to
> > deal with endian is an over-kill.
> >
> > when it is not necessary to enable the clock every time we access the
> > register.
> > We don't think it is obvious to us how to use it for handling endianness,
> > especially not the way imx2_wdt uses regmap. __regmap_init_mmio_clk()
> > calls regmap_mmio_gen_context() which errors out if reg_format_endian is
> > not REGMAP_ENDIAN_DEFAULT or REGMAP_ENDIAN_NATIVE, and elsewhere regmap
> > -mmio.c It seems only little-endian accessors.
> >
> > Although it is possible to add the endianness support in the regmap_mmio
> > driver, we don't see too much value in using it especially
> >
> > So we think:
> > static void qspi_writel(struct fsl_qspi *q, u32 val, void __iomem
> > *addr) {
> > if (q->big_endian)
> > iowrite32be(val, addr);
> > else
> > iowrite32(val, addr);
> > }
> > This way is an easier, more effective solution to do the endian issue.
> >
> > How about your think?
>
> I think the implement is fine, but I prefer to use quirk rather than
> read from dts? Please also rebase the patch to latest l2-mtd code.
What specifically do you mean by "use quirk rather than read from dts"? The
information has to come from the device tree at some point, and it can't be
inferred from the compatible string (and thus the choice of
fsl_qspi_devtype_data instance) because the variance is in how the controller
is hooked up to the SoC, not in the controller itself.
-Scott
next prev parent reply other threads:[~2015-11-11 18:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-23 7:53 [PATCH] mtd: spi-nor: fsl-quadspi: add big-endian support Yuan Yao
2015-10-23 17:00 ` Brian Norris
2015-10-24 15:47 ` Fabio Estevam
2015-10-30 9:49 ` Yao Yuan
2015-11-11 17:51 ` Han Xu
2015-11-11 18:48 ` Scott Wood [this message]
2015-11-11 19:10 ` Brian Norris
2015-11-12 10:07 ` Yao Yuan
2015-11-11 19:03 ` Brian Norris
2015-11-16 4:08 ` Yao Yuan
2015-11-16 4:21 ` Brian Norris
2015-11-16 9:14 ` Yao Yuan
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=1447267701.2262.201.camel@freescale.com \
--to=scottwood@freescale.com \
--cc=LeoLi@freescale.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=festevam@gmail.com \
--cc=han.xu@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=yao.yuan@freescale.com \
/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;
as well as URLs for NNTP newsgroup(s).