From: Boris Brezillon <boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Jiancheng Xue <xuejiancheng-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: Brian Norris
<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
jteki-oRp2ZoJdM/RWk0Htik3J/w@public.gmane.org,
ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org,
juhosg-p3rKhJxN3npAfugRpC6u6w@public.gmane.org,
shijie.huang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
furquan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
han.xu-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
yanhaifeng-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
yanghongwei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
suwenping-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
raojun-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
ml.yang-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
gaofei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
zhangzhenxing-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
xuejiancheng-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org,
Binquan Peng
<pengbinquan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Subject: Re: [RESEND PATCH v7] mtd: spi-nor: add hisilicon spi-nor flash controller driver
Date: Tue, 8 Mar 2016 10:46:28 +0100 [thread overview]
Message-ID: <20160308104628.6224bde2@bbrezillon> (raw)
In-Reply-To: <56DE9A79.30704-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
On Tue, 8 Mar 2016 17:25:13 +0800
Jiancheng Xue <xuejiancheng-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> wrote:
> Hi Brian,
> Thank you very much for your comments.
>
> On 2016/3/8 6:52, Brian Norris wrote:
> [...]
> >>
> >> diff --git a/Documentation/devicetree/bindings/spi/spi-hisi-sfc.txt b/Documentation/devicetree/bindings/spi/spi-hisi-sfc.txt
> >> new file mode 100644
> >> index 0000000..7407147
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/spi/spi-hisi-sfc.txt
> >
> > This is not a SPI controller (or is it? it looks like a SPI NOR
> > controller that doesn't do generic SPI), so it shouldn't go in the spi/
> > directory.
> >
> OK. I'll move this file into Documentation/devicetree/bindings/mtd.
>
> >> @@ -0,0 +1,25 @@
> >> +HiSilicon SPI-NOR Flash Controller
> >> +
> >> +Required properties:
> >> +- compatible : Should be "hisilicon,hisi-sfc" and one of the following strings:
> >> + "hisilicon,hi3519-sfc"
> >> +- address-cells : number of cells required to define a chip select
> >> + address on the SPI bus. Should be set to 1. See spi-bus.txt.
> >
> > This is not exactly a typical SPI bus, though I suppose some of that
> > documentation could apply...
> >
>
> OK. I'll modify the description.
>
> [...]
> >> +static int hisi_spi_nor_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf,
> >> + int len)
> >> +{
> >> + struct hifmc_priv *priv = nor->priv;
> >> + struct hifmc_host *host = priv->host;
> >> + int ret;
> >> +
> >> + ret = hisi_spi_nor_send_cmd(nor, opcode, len);
> >> + if (ret)
> >> + return ret;
> >> +
> >> + memcpy(buf, host->iobase, len);
> >
> > sparse doesn't like any of these memcpy()'s, since that's __iomem. Are
> > you sure you want a regular memcpy here, and elsewhere?
> >
> It's not a must to use memcpy though host->iobase represents a segment of inner memory
> which stores data from flash device byte by byte. I will give up using memcpy here and
> hisi_spi_nor_write_reg() in next version. Thank you!
Or you can use memcpy_fromio(), which should give you better perfs than
using readX() accessors in a loop.
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-03-08 9:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 8:11 [RESEND PATCH v7] mtd: spi-nor: add hisilicon spi-nor flash controller driver Jiancheng Xue
[not found] ` <1456474316-24473-1-git-send-email-xuejiancheng-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-03-05 0:35 ` Ezequiel Garcia
2016-03-07 22:52 ` Brian Norris
2016-03-08 9:25 ` Jiancheng Xue
[not found] ` <56DE9A79.30704-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-03-08 9:46 ` Boris Brezillon [this message]
2016-03-09 3:35 ` Jiancheng Xue
2016-03-09 18:50 ` Brian Norris
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=20160308104628.6224bde2@bbrezillon \
--to=boris.brezillon-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org \
--cc=fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=furquan-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=gaofei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
--cc=han.xu-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=jteki-oRp2ZoJdM/RWk0Htik3J/w@public.gmane.org \
--cc=juhosg-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=manabian-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=ml.yang-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=pengbinquan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=raojun-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=shijie.huang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=suwenping-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
--cc=xuejiancheng-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
--cc=xuejiancheng-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=yanghongwei-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
--cc=yanhaifeng-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
--cc=zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=zhangzhenxing-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org \
/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