From: Jiancheng Xue <xuejiancheng@huawei.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: <robh+dt@kernel.org>, <pawel.moll@arm.com>,
<mark.rutland@arm.com>, <ijc+devicetree@hellion.org.uk>,
<galak@codeaurora.org>, <dwmw2@infradead.org>, <zajec5@gmail.com>,
<boris.brezillon@free-electrons.com>, <jteki@openedev.com>,
<ezequiel@vanguardiasur.com.ar>, <juhosg@openwrt.org>,
<shijie.huang@intel.com>, <mika.westerberg@linux.intel.com>,
<furquan@google.com>, <han.xu@freescale.com>,
<fabio.estevam@freescale.com>, <manabian@gmail.com>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-mtd@lists.infradead.org>, <yanhaifeng@hisilicon.com>,
<yanghongwei@hisilicon.com>, <suwenping@hisilicon.com>,
<raojun@hisilicon.com>, <ml.yang@hisilicon.com>,
<gaofei@hisilicon.com>, <zhangzhenxing@hisilicon.com>,
<xuejiancheng@hisilicon.com>,
Binquan Peng <pengbinquan@huawei.com>
Subject: Re: [RESEND PATCH v7] mtd: spi-nor: add hisilicon spi-nor flash controller driver
Date: Tue, 8 Mar 2016 17:25:13 +0800 [thread overview]
Message-ID: <56DE9A79.30704@huawei.com> (raw)
In-Reply-To: <20160307225229.GC55664@google.com>
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!
>> +
>> + return 0;
>> +}
>> +
[...]
>> +static void hisi_spi_nor_dma_transfer(struct spi_nor *nor, u32 start_off,
>> + u32 dma_buf, u32 len, u8 op_type)
>
> Does this controller support 64-bit addresses? What if you see LPAE, or
> an ARM64 CPU? It'd be nice if you don't truncate potentially 64-bit
> dma_buf down to u32.
>
> Brian
>
No, this controller just supports 32-bit addresses. So I think I have to truncate 64-bit dma_buf. :(
Thank you very much!
Regards,
Jiancheng
WARNING: multiple messages have this Message-ID (diff)
From: Jiancheng Xue <xuejiancheng@huawei.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
dwmw2@infradead.org, zajec5@gmail.com,
boris.brezillon@free-electrons.com, jteki@openedev.com,
ezequiel@vanguardiasur.com.ar, juhosg@openwrt.org,
shijie.huang@intel.com, mika.westerberg@linux.intel.com,
furquan@google.com, han.xu@freescale.com,
fabio.estevam@freescale.com, manabian@gmail.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, yanhaifeng@hisilicon.com,
yanghongwei@hisilicon.com, suwenping@hisilicon.com,
raojun@hisilicon.com, ml.yang@hisilicon.com,
gaofei@hisilicon.com, zhangzhenxing@hisilicon.com,
xuejiancheng@hisilicon.com, Binquan Peng <pengbinquan@huawei.com>
Subject: Re: [RESEND PATCH v7] mtd: spi-nor: add hisilicon spi-nor flash controller driver
Date: Tue, 8 Mar 2016 17:25:13 +0800 [thread overview]
Message-ID: <56DE9A79.30704@huawei.com> (raw)
In-Reply-To: <20160307225229.GC55664@google.com>
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!
>> +
>> + return 0;
>> +}
>> +
[...]
>> +static void hisi_spi_nor_dma_transfer(struct spi_nor *nor, u32 start_off,
>> + u32 dma_buf, u32 len, u8 op_type)
>
> Does this controller support 64-bit addresses? What if you see LPAE, or
> an ARM64 CPU? It'd be nice if you don't truncate potentially 64-bit
> dma_buf down to u32.
>
> Brian
>
No, this controller just supports 32-bit addresses. So I think I have to truncate 64-bit dma_buf. :(
Thank you very much!
Regards,
Jiancheng
next prev parent reply other threads:[~2016-03-08 9:29 UTC|newest]
Thread overview: 14+ 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
2016-02-26 8:11 ` Jiancheng Xue
2016-03-05 0:35 ` Ezequiel Garcia
2016-03-05 0:35 ` Ezequiel Garcia
2016-03-07 22:52 ` Brian Norris
2016-03-07 22:52 ` Brian Norris
2016-03-08 9:25 ` Jiancheng Xue [this message]
2016-03-08 9:25 ` Jiancheng Xue
2016-03-08 9:46 ` Boris Brezillon
2016-03-08 9:46 ` Boris Brezillon
2016-03-09 3:35 ` Jiancheng Xue
2016-03-09 3:35 ` Jiancheng Xue
2016-03-09 18:50 ` Brian Norris
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=56DE9A79.30704@huawei.com \
--to=xuejiancheng@huawei.com \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dwmw2@infradead.org \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=fabio.estevam@freescale.com \
--cc=furquan@google.com \
--cc=galak@codeaurora.org \
--cc=gaofei@hisilicon.com \
--cc=han.xu@freescale.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jteki@openedev.com \
--cc=juhosg@openwrt.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=manabian@gmail.com \
--cc=mark.rutland@arm.com \
--cc=mika.westerberg@linux.intel.com \
--cc=ml.yang@hisilicon.com \
--cc=pawel.moll@arm.com \
--cc=pengbinquan@huawei.com \
--cc=raojun@hisilicon.com \
--cc=robh+dt@kernel.org \
--cc=shijie.huang@intel.com \
--cc=suwenping@hisilicon.com \
--cc=xuejiancheng@hisilicon.com \
--cc=yanghongwei@hisilicon.com \
--cc=yanhaifeng@hisilicon.com \
--cc=zajec5@gmail.com \
--cc=zhangzhenxing@hisilicon.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.